Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
47f65b93
authored
May 30, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue
#252
fixed. Working on
#256
parent
f8e584fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/PCBDBHelper.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/websockets/ActionTalk.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/websockets/VocabularyTalk.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/PCBDBHelper.java
View file @
47f65b93
...
...
@@ -250,7 +250,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
values
.
put
(
"id_stu"
,
id_stu
);
db
.
beginTransaction
();
for
(
Picto
picto
:
vocabulary
)
{
Log
.
i
(
LOG_TAG
,
"inserting "
+
picto
.
get_id
()+
":"
+
picto
.
get_translation
()+
":"
+
picto
.
get_json_attrs
()+
"-id_sce: "
+
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_active_scene
());
Log
.
d
(
LOG_TAG
,
"inserting "
+
picto
.
get_id
()+
":"
+
picto
.
get_translation
()+
":"
+
picto
.
get_json_attrs
()+
"-id_sce: "
+
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_active_scene
());
values
.
put
(
"id_picto"
,
picto
.
get_id
());
values
.
put
(
"id_scene"
,
this
.
currentUser
.
get_active_scene
());
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/websockets/ActionTalk.java
View file @
47f65b93
...
...
@@ -60,7 +60,7 @@ public class ActionTalk implements Emitter.Listener {
picto_id
=
picto_stupicto
.
getInt
(
param_picto_id
);
picto_cat
=
attrs_stu_picto
!=
null
?
attrs_stu_picto
.
optInt
(
param_picto_cat
,
Picto
.
NO_CATEGORY
)
:
0
;
}
Log
.
i
(
LOG_TAG
,
"Received message '"
+
action
+
Log
.
d
(
LOG_TAG
,
"Received message '"
+
action
+
"' for picto "
+
picto_id
+
" (cat "
+
picto_cat
);
for
(
iActionListener
listener
:
this
.
listeners
)
listener
.
action
(
action
.
equals
(
action_add
)
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/websockets/VocabularyTalk.java
View file @
47f65b93
...
...
@@ -34,6 +34,7 @@ public class VocabularyTalk implements Emitter.Listener {
final
String
param_picto
=
"picto"
;
final
String
param_stu_picto
=
"stu_picto"
;
final
String
param_picto_id
=
"id"
;
final
String
param_stupicto_scene
=
"scene"
;
final
String
param_picto_cat
=
"id_cat"
;
final
String
action_update
=
"update"
;
final
String
action_update_category
=
"update_category"
;
...
...
@@ -41,6 +42,7 @@ public class VocabularyTalk implements Emitter.Listener {
final
String
action_delete
=
"delete"
;
JSONObject
msg
=
(
JSONObject
)
args
[
0
];
try
{
Log
.
i
(
LOG_TAG
,
"raw Received message "
+
msg
.
toString
());
...
...
@@ -51,7 +53,7 @@ public class VocabularyTalk implements Emitter.Listener {
JSONObject
picto_stupicto
=
stu_picto
.
optJSONObject
(
param_picto
);
int
picto_id
=
picto_stupicto
.
getInt
(
param_picto_id
);
int
picto_cat
=
attrs_stu_picto
!=
null
?
attrs_stu_picto
.
optInt
(
param_picto_cat
,
Picto
.
NO_CATEGORY
)
:
0
;
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_active_scene
()
==
msg
.
getJSONObject
(
"attributes"
).
getInt
(
"id_scene"
))
{
if
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_active_scene
()
==
stu_picto
.
getInt
(
param_stupicto_scene
))
{
PCBcontext
.
getNetService
().
nextSynchro
(
new
Date
().
getTime
()
+
PCBcontext
.
getNetService
().
getSynchroTimingLength
()
*
2
);
//nos saltamos una sincronización para evitar que llegue antes que los websockets
for
(
iVocabularyListener
listener
:
this
.
listeners
)
listener
.
change
(
action
.
equals
(
action_update
)
?
iVocabularyListener
.
action
.
update
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment