aboutsummaryrefslogtreecommitdiffstats
path: root/src/applist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/applist.cpp')
-rw-r--r--src/applist.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/applist.cpp b/src/applist.cpp
index be88977..36c5917 100644
--- a/src/applist.cpp
+++ b/src/applist.cpp
@@ -21,6 +21,7 @@
using std::shared_ptr;
using std::string;
using std::unique_ptr;
+using std::vector;
namespace wm {
@@ -81,19 +82,39 @@ unsigned AppList::getSequenceNumber(const string &appid){
unsigned AppList::addAllocateRequest(WMRequest req){
if(req_list.size() == 0){
- req.seq_num = 1;
+ req.seq_num = current_seq;
}
else{
+ HMI_SEQ_DEBUG(current_seq, "real: %d", req_list.back().seq_num + 1);
req.seq_num = req_list.back().seq_num + 1;
}
req_list.push_back(req);
- return req.seq_num;
+ return req.seq_num; // return 1; if you test time_expire
}
bool AppList::requestFinished(){
return req_list.empty();
}
+struct WMTrigger AppList::getRequest(unsigned request_seq){
+ for(auto& x : req_list){
+ if (request_seq == x.seq_num)
+ {
+ return x.trigger;
+ }
+ }
+}
+
+const vector<struct WMAction>& AppList::getActions(unsigned request_seq){
+ for (auto &x : req_list)
+ {
+ if (request_seq == x.seq_num)
+ {
+ return x.sync_draw_req;
+ }
+ }
+}
+
bool AppList::setAction(unsigned request_seq, const string &appid, const string &role, const string &area){
bool result = false;
for (auto& x : req_list)
@@ -190,9 +211,9 @@ void AppList::client_dump(){
void AppList::req_dump()
{
DUMP("======= req dump =====");
- DUMP("current sequence: %d", current_seq);
+ DUMP("current request : %d", current_seq);
for(const auto& x : req_list){
- DUMP("sequence number: %d", x.seq_num);
+ DUMP("requested with : %d", x.seq_num);
DUMP("Trigger : (APPID :%s, ROLE :%s, AREA :%s, TASK: %d)",
x.trigger.appid.c_str(),
x.trigger.role.c_str(),
@@ -201,7 +222,7 @@ void AppList::req_dump()
for (const auto& y : x.sync_draw_req){
DUMP(
- "Action : (APPID :%s, ROLE :%s, AREA :%s, END_RAW_FINISHED: %d)",
+ "Action : (APPID :%s, ROLE :%s, AREA :%s, END_DRAW_FINISHED: %d)",
y.appid.c_str(),
y.role.c_str(),
y.area.c_str(),