37 topicName = getProperty<std::string>(
"TopicName").getValue();
45 topic = getTopic<RemoteGuiListenerInterfacePrx>(topicName);
71 static void fillRecursively(RemoteGui::WidgetStateMap& widgetStates,
79 out <<
"\nall state names: " <<
getMapKeys(widgetStates)
86 out << std::string(lvl * 4,
'-') <<
" " << node->name
88 for (
const auto&
c : node->children)
98 if (!handler.isValid(*widget,
s))
100 throw LocalException() <<
"Widget is not valid: " << widget->name
101 <<
", WidgetT: " << widget->ice_id()
102 <<
", HandlerT: " << handler.getHandlerT()
103 <<
"\nMessage:\n" <<
s.str()
108 std::string
const& name = widget->name;
112 bool nameIsNew = widgetStates.emplace(widget->name, widget->defaultState).second;
116 throw LocalException() <<
"Widget with name '" << widget->name <<
"' already exists"
119 nameIsNew =
values.emplace(widget->name, widget->defaultValue).second;
123 for (
auto& child : widget->children)
126 fillRecursively(widgetStates,
values, child, rootWidget);
135 std::unique_lock<std::mutex> lock(tabMutex);
136 tabs[tabId] = rootWidget;
139 auto& widgetStates = tabWidgetStates[tabId];
140 widgetStates.clear();
141 auto&
values = tabStates[tabId];
145 fillRecursively(tabWidgetStates[tabId], tabStates[tabId], rootWidget, rootWidget);
148 topic->reportTabChanged(tabId);
156 std::unique_lock<std::mutex> lock(tabMutex);
158 tabWidgetStates.erase(tabId);
159 tabStates.erase(tabId);
161 topic->reportTabsRemoved();
166 std::unique_lock<std::mutex> lock(tabMutex);
172 std::unique_lock<std::mutex> lock(tabMutex);
173 return tabWidgetStates;
178 std::unique_lock<std::mutex> lock(tabMutex);
184 std::unique_lock<std::mutex> lock(tabMutex);
185 return tabStates.at(tabId);
191 std::unique_lock<std::mutex> lock(tabMutex);
193 tabState.at(widgetName) =
value;
195 delta[widgetName] =
value;
196 topic->reportStateChanged(tabId, delta);
202 std::unique_lock<std::mutex> lock(tabMutex);
204 for (
const auto& pair :
values)
206 merged[pair.first] = pair.second;
208 topic->reportStateChanged(tabId,
values);
213 std::unique_lock<std::mutex> lock(tabMutex);
214 return tabWidgetStates.at(tabId);
220 std::unique_lock<std::mutex> lock(tabMutex);
221 RemoteGui::WidgetStateMap& tabWidgetState = tabWidgetStates.at(tabId);
222 tabWidgetState = state;
223 topic->reportWidgetChanged(tabId, tabWidgetState);