aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.cpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-08 00:23:01 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-08 00:38:15 +0900
commit9cfdd8937209e3e47b551e7a188add100cbae2e7 (patch)
tree037f80b8785cb9a62bf6e55e62ffe21c391b2285 /src/app.cpp
parent46d1ad85e8a4531dcb7dc9599f6c09554e2cdfbb (diff)
Change names. Not use sequence number but request number
* AppList API * Member variable(Not use sequence) Change-Id: Ie0d3d0394c5e050e894b11a91aab97f5bac73f00 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/app.cpp b/src/app.cpp
index e9f6d92..386524d 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -120,10 +120,10 @@ processTimerHandler(sd_event_source *s, uint64_t usec, void *userdata)
void App::timerHandler()
{
- unsigned seq = g_app_list.currentSequenceNumber();
- HMI_SEQ_DEBUG(seq, "Timer expired remove Request");
+ unsigned req_num = g_app_list.currentRequestNumber();
+ HMI_SEQ_DEBUG(req_num, "Timer expired remove Request");
g_app_list.reqDump();
- g_app_list.removeRequest(seq);
+ g_app_list.removeRequest(req_num);
g_app_list.next();
g_app_list.reqDump();
if (g_app_list.haveRequest())
@@ -423,7 +423,7 @@ void App::layout_commit()
void App::set_timer()
{
- HMI_SEQ_DEBUG(g_app_list.currentSequenceNumber(), "Timer set activate");
+ HMI_SEQ_DEBUG(g_app_list.currentRequestNumber(), "Timer set activate");
if (g_timer_ev_src == nullptr)
{
// firsttime set into sd_event
@@ -444,19 +444,19 @@ void App::set_timer()
void App::stop_timer()
{
- unsigned seq = g_app_list.currentSequenceNumber();
- HMI_SEQ_DEBUG(seq, "Timer stop");
+ unsigned req_num = g_app_list.currentRequestNumber();
+ HMI_SEQ_DEBUG(req_num, "Timer stop");
int rc = sd_event_source_set_enabled(g_timer_ev_src, SD_EVENT_OFF);
if (rc < 0)
{
- HMI_SEQ_ERROR(seq, "Timer stop failed");
+ HMI_SEQ_ERROR(req_num, "Timer stop failed");
}
}
bool App::lm_release(const struct WMAction &action)
{
//auto const &surface_id = this->lookup_id(drawing_name);
- unsigned req_num = g_app_list.currentSequenceNumber();
+ unsigned req_num = g_app_list.currentRequestNumber();
auto const &surface_id = this->lookup_id(action.role.c_str());
if (!surface_id)
{
@@ -558,7 +558,7 @@ bool App::lm_layout_change(const struct WMAction &action)
TODO: emit syncDraw with application*/
if (msg)
{
- HMI_SEQ_DEBUG(g_app_list.currentSequenceNumber(), msg);
+ HMI_SEQ_DEBUG(g_app_list.currentRequestNumber(), msg);
//g_app_list.removeRequest(req_num);
return false;
}
@@ -644,7 +644,7 @@ bool App::do_transition(unsigned req_num)
if (!ret)
{
- //this->emit_error(request_seq, 0 /*error_num*/, "error happens"); // test
+ //this->emit_error(req_num, 0 /*error_num*/, "error happens"); // test
}
else if (ret && sync_draw_happen)
{
@@ -763,8 +763,8 @@ void App::lm_layout_change(const char *drawing_name)
std::string hack_appid = "hack";
std::string hack_role = main;
std::string hack_area = str_area_main;
- g_app_list.setAction(g_app_list.currentSequenceNumber(), hack_appid, hack_role, hack_area, true);
- g_app_list.setEndDrawFinished(g_app_list.currentSequenceNumber(), hack_appid, hack_role); // This process is illegal
+ g_app_list.setAction(g_app_list.currentRequestNumber(), hack_appid, hack_role, hack_area, true);
+ g_app_list.setEndDrawFinished(g_app_list.currentRequestNumber(), hack_appid, hack_role); // This process is illegal
// >>> HACK
this->emit_syncdraw(main.c_str(), str_area_main.c_str(),
area_rect_main.x, area_rect_main.y,
@@ -869,8 +869,8 @@ void App::api_activate_surface(char const *appid, char const *drawing_name, char
/*
* Queueing Phase
*/
- unsigned current = g_app_list.currentSequenceNumber();
- unsigned requested_num = g_app_list.getSequenceNumber(id);
+ unsigned current = g_app_list.currentRequestNumber();
+ unsigned requested_num = g_app_list.getRequestNumber(id);
if (requested_num != 0)
{
HMI_SEQ_INFO(requested_num, "%s %s %s request is already queued", id.c_str(), role.c_str(), area.c_str());
@@ -925,8 +925,8 @@ void App::api_deactivate_surface(char const *appid, char const *drawing_name, co
/*
* Queueing Phase
*/
- unsigned current = g_app_list.currentSequenceNumber();
- unsigned requested_num = g_app_list.getSequenceNumber(id);
+ unsigned current = g_app_list.currentRequestNumber();
+ unsigned requested_num = g_app_list.getRequestNumber(id);
if (requested_num != 0)
{
HMI_SEQ_INFO(requested_num, "%s %s %s request is already queued", id.c_str(), role.c_str(), area.c_str());
@@ -999,30 +999,30 @@ void App::lm_enddraw(const char *drawing_name)
}
}
-void App::do_enddraw(unsigned request_seq)
+void App::do_enddraw(unsigned req_num)
{
// get actions
- auto actions = g_app_list.getActions(request_seq);
- HMI_SEQ_INFO(request_seq, "do endDraw");
+ auto actions = g_app_list.getActions(req_num);
+ HMI_SEQ_INFO(req_num, "do endDraw");
for (const auto &act : actions)
{
- HMI_SEQ_DEBUG(request_seq, "visible %s", act.role.c_str());
+ HMI_SEQ_DEBUG(req_num, "visible %s", act.role.c_str());
this->lm_enddraw(act.role.c_str());
}
- HMI_SEQ_INFO(request_seq, "emit flushDraw");
+ HMI_SEQ_INFO(req_num, "emit flushDraw");
/* do
{
// emit flush Draw
- //emitFlushDrawToAll(&g_app_list, request_seq);
+ //emitFlushDrawToAll(&g_app_list, req_num);
// emit status change event
} while (!g_app_list.requestFinished());*/
}
void App::process_request()
{
- unsigned req = g_app_list.currentSequenceNumber();
+ unsigned req = g_app_list.currentRequestNumber();
HMI_SEQ_DEBUG(req, "Do next request");
do_transition(req);
}
@@ -1031,8 +1031,8 @@ void App::api_enddraw(char const *appid, char const *drawing_name)
{
std::string id(appid);
std::string role(drawing_name);
- unsigned current_seq = g_app_list.currentSequenceNumber();
- bool result = g_app_list.setEndDrawFinished(current_seq, id, role);
+ unsigned current_req = g_app_list.currentRequestNumber();
+ bool result = g_app_list.setEndDrawFinished(current_req, id, role);
if (!result)
{
@@ -1040,16 +1040,16 @@ void App::api_enddraw(char const *appid, char const *drawing_name)
return;
}
- if (g_app_list.endDrawFullfilled(current_seq))
+ if (g_app_list.endDrawFullfilled(current_req))
{
// do task for endDraw
//this->stop_timer();
- this->do_enddraw(current_seq);
+ this->do_enddraw(current_req);
this->stop_timer();
- g_app_list.removeRequest(current_seq);
- HMI_SEQ_INFO(current_seq, "Finish request");
+ g_app_list.removeRequest(current_req);
+ HMI_SEQ_INFO(current_req, "Finish request");
g_app_list.next();
if (g_app_list.haveRequest())
{
@@ -1058,7 +1058,7 @@ void App::api_enddraw(char const *appid, char const *drawing_name)
}
else
{
- HMI_SEQ_INFO(current_seq, "Wait other App call endDraw");
+ HMI_SEQ_INFO(current_req, "Wait other App call endDraw");
return;
}
}