38 topicName = getProperty<std::string>(
"TopicName").getValue();
46 topic = getTopic<RemoteGuiListenerInterfacePrx>(topicName);
73 fillRecursively(RemoteGui::WidgetStateMap& widgetStates,
81 out <<
"\nall state names: " <<
getMapKeys(widgetStates)
87 out << std::string(lvl * 4,
'-') <<
" " << node->name <<
" ["
89 for (
const auto&
c : node->children)
99 if (!handler.isValid(*widget,
s))
101 throw LocalException()
102 <<
"Widget is not valid: " << widget->name <<
", WidgetT: " << widget->ice_id()
103 <<
", HandlerT: " << handler.getHandlerT() <<
"\nMessage:\n"
104 <<
s.str() << dumpInfo;
108 std::string
const& name = widget->name;
112 bool nameIsNew = widgetStates.emplace(widget->name, widget->defaultState).second;
116 throw LocalException()
117 <<
"Widget with name '" << widget->name <<
"' already exists" << dumpInfo;
119 nameIsNew =
values.emplace(widget->name, widget->defaultValue).second;
123 for (
auto& child : widget->children)
126 fillRecursively(widgetStates,
values, child, rootWidget);
138 std::unique_lock<std::mutex> lock(tabMutex);
139 tabs[tabId] = rootWidget;
142 auto& widgetStates = tabWidgetStates[tabId];
143 widgetStates.clear();
144 auto&
values = tabStates[tabId];
148 fillRecursively(tabWidgetStates[tabId], tabStates[tabId], rootWidget, rootWidget);
151 topic->reportTabChanged(tabId);
160 std::unique_lock<std::mutex> lock(tabMutex);
162 tabWidgetStates.erase(tabId);
163 tabStates.erase(tabId);
165 topic->reportTabsRemoved();
171 std::unique_lock<std::mutex> lock(tabMutex);
175 RemoteGui::TabWidgetStateMap
178 std::unique_lock<std::mutex> lock(tabMutex);
179 return tabWidgetStates;
182 RemoteGui::TabValueMap
185 std::unique_lock<std::mutex> lock(tabMutex);
192 std::unique_lock<std::mutex> lock(tabMutex);
193 return tabStates.at(tabId);
198 const std::string& widgetName,
199 const RemoteGui::ValueVariant&
value,
203 std::unique_lock<std::mutex> lock(tabMutex);
205 tabState.at(widgetName) =
value;
207 delta[widgetName] =
value;
208 topic->reportStateChanged(tabId, delta);
217 std::unique_lock<std::mutex> lock(tabMutex);
219 for (
const auto& pair :
values)
221 merged[pair.first] = pair.second;
223 topic->reportStateChanged(tabId,
values);
226 RemoteGui::WidgetStateMap
229 std::unique_lock<std::mutex> lock(tabMutex);
230 return tabWidgetStates.at(tabId);
235 const RemoteGui::WidgetStateMap& state,
239 std::unique_lock<std::mutex> lock(tabMutex);
240 RemoteGui::WidgetStateMap& tabWidgetState = tabWidgetStates.at(tabId);
241 tabWidgetState = state;
242 topic->reportWidgetChanged(tabId, tabWidgetState);