rename variables
This commit is contained in:
@@ -31,7 +31,6 @@ file(
|
|||||||
${workspaceRoot}/src/prog/domod/src/ubus/capabilities_shutters.cpp
|
${workspaceRoot}/src/prog/domod/src/ubus/capabilities_shutters.cpp
|
||||||
${workspaceRoot}/src/prog/domod/src/ubus/capabilities_sprinklers.cpp
|
${workspaceRoot}/src/prog/domod/src/ubus/capabilities_sprinklers.cpp
|
||||||
${workspaceRoot}/src/prog/domod/src/ubus/timers.cpp
|
${workspaceRoot}/src/prog/domod/src/ubus/timers.cpp
|
||||||
|
|
||||||
# Timers
|
# Timers
|
||||||
${workspaceRoot}/src/prog/domod/src/timers/timers-manager.cpp
|
${workspaceRoot}/src/prog/domod/src/timers/timers-manager.cpp
|
||||||
${workspaceRoot}/src/prog/domod/src/timers/event.cpp
|
${workspaceRoot}/src/prog/domod/src/timers/event.cpp
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ TimerManager::~TimerManager(void)
|
|||||||
*/
|
*/
|
||||||
int TimerManager::load(void)
|
int TimerManager::load(void)
|
||||||
{
|
{
|
||||||
struct json_object *the_root_node, *the_data_node;
|
struct json_object *the_root_node, *the_timers_node;
|
||||||
|
|
||||||
the_root_node = json_object_from_file(m_timers_path.c_str());
|
the_root_node = json_object_from_file(m_timers_path.c_str());
|
||||||
if (the_root_node == NULL)
|
if (the_root_node == NULL)
|
||||||
@@ -78,17 +78,17 @@ int TimerManager::load(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (json_object_object_get_ex(the_root_node, k_entry_timers, &the_data_node) && (json_object_get_type(the_data_node) == json_type_array))
|
if (json_object_object_get_ex(the_root_node, k_entry_timers, &the_timers_node) && (json_object_get_type(the_timers_node) == json_type_array))
|
||||||
{
|
{
|
||||||
int the_len;
|
int the_len;
|
||||||
struct json_object *the_timer_node;
|
struct json_object *the_event_node;
|
||||||
|
|
||||||
the_len = json_object_array_length(the_data_node);
|
the_len = json_object_array_length(the_timers_node);
|
||||||
for (int i = 0; i < the_len; i++)
|
for (int i = 0; i < the_len; i++)
|
||||||
{
|
{
|
||||||
Event the_event;
|
Event the_event;
|
||||||
the_timer_node = json_object_array_get_idx(the_data_node, i);
|
the_event_node = json_object_array_get_idx(the_timers_node, i);
|
||||||
the_event.from_json(the_timer_node);
|
the_event.from_json(the_event_node);
|
||||||
|
|
||||||
m_timers.push_back(the_event);
|
m_timers.push_back(the_event);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user