summaryrefslogtreecommitdiffstats
path: root/app/onscreenmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'app/onscreenmodel.cpp')
-rw-r--r--app/onscreenmodel.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/onscreenmodel.cpp b/app/onscreenmodel.cpp
index 184d1a6..c36f0e9 100644
--- a/app/onscreenmodel.cpp
+++ b/app/onscreenmodel.cpp
@@ -27,34 +27,38 @@ const char _buttons[] = "buttons";
void OnScreenModel::setModel(QVariant data)
{
- HMI_DEBUG(_modelName, "setModel start!");
+ fprintf(stderr, "OnScreenModel::setModel: setModel start!\n");
+
clearModel();
struct json_object *j_title = nullptr, *j_type = nullptr, *j_contents = nullptr, *j_buttons = nullptr;
struct json_object *j_param = json_tokener_parse(data.toString().toStdString().c_str());
+
+ fprintf(stderr, "OnScreenModel::setModel receiving end: %s\n", data.toString().toStdString().c_str());
+
if(json_object_object_get_ex(j_param, _title, &j_title)) {
m_title = json_object_get_string(j_title);
}
else {
- HMI_DEBUG(_modelName, "title input is null");
+ fprintf(stderr, "OnScreenModel::setModel: title input is null\n");
}
if(json_object_object_get_ex(j_param, _type, &j_type)) {
m_type = json_object_get_string(j_type);
}
else {
- HMI_DEBUG(_modelName, "type input is null");
+ fprintf(stderr, "OnScreenModel::setModel: type input is null\n");
}
if(json_object_object_get_ex(j_param, _contents, &j_contents)) {
m_contents = json_object_get_string(j_contents);
}
else {
- HMI_DEBUG(_modelName, "contents input is null");
+ fprintf(stderr, "OnScreenModel::setModel: contents input is null\n");
}
if(json_object_object_get_ex(j_param, _buttons, &j_buttons)) {
if(json_object_get_type(j_buttons) != json_type_array) {
- HMI_DEBUG(_modelName, "buttons josn type isn't array!");
+ fprintf(stderr, "OnScreenModel::setModel buttons josn type isn't array!\n");
}
else {
m_buttons.clear();
@@ -67,9 +71,10 @@ void OnScreenModel::setModel(QVariant data)
}
}
else {
- HMI_DEBUG("OnScreenModel", "buttons input is null");
+ fprintf(stderr, "OnScreenModel::setModel: buttons input is null\n");
}
- HMI_DEBUG(_modelName, "setModel end!titile=%s,type=%s,contents=%s,btnNum=%d",
+
+ fprintf(stderr, "OnScreenModel::setModel setModel end!titile=%s,type=%s,contents=%s,btnNum=%d\n",
m_title.toStdString().c_str(), m_type.toStdString().c_str(), m_contents.toStdString().c_str(), m_buttons.size());
}