24 #include <ArmarXGui/gui-plugins/RemoteGuiPlugin/ui_RemoteGuiWidget.h>
29 #include <ArmarXGui/interface/RemoteGuiInterface.h>
65 ,
public armarx::RemoteGuiListenerInterface
80 QPointer<QDialog> getConfigDialog(QWidget* parent = 0)
override;
81 void configured()
override;
86 void loadSettings(QSettings* settings)
override;
91 void saveSettings(QSettings* settings)
override;
99 return "Util.RemoteGui";
103 void onInitComponent()
override;
104 void onConnectComponent()
override;
107 void reportTabChanged(
const std::string& tab,
const Ice::Current&)
override;
108 void reportTabsRemoved(
const Ice::Current&)
override;
109 void reportWidgetChanged(
const std::string& tab,
const RemoteGui::WidgetStateMap& widgetState,
const Ice::Current&)
override;
110 void reportStateChanged(
const std::string& tab,
const RemoteGui::ValueMap& delta,
const Ice::Current&)
override;
112 void onLockWidget()
override;
113 void onUnlockWidget()
override;
117 void onTabChanged(QString
id);
118 void onTabsChanged();
119 void onWidgetChanged(QString
id);
120 void onStateChanged(QString
id);
122 void onGuiStateChanged();
123 void onSendButtonClicked();
125 void onCheckBoxGroupTabsClicked(
bool checked);
126 void onComboBoxTabGroupsCurrentIndexChanged(
const QString& group);
130 void tabChanged(QString
id);
132 void widgetChanged(QString
id);
133 void stateChanged(QString
id);
136 void createTab(std::string
const& tabId);
137 void removeObsoleteTabs();
138 void updateWidgets(std::string
const& tabId);
139 void updateState(std::string
const& tabId);
142 void createWidgets(std::string
const&
id);
143 void updateValuesInWidget(std::string
const&
id);
145 void updateValuesInState();
147 void doAutoUpdate(std::string
const&
id);
149 QWidget* createWidgetFromDescription(std::string
const& tabId,
RemoteGui::WidgetPtr const& desc);
154 std::string fullName()
const;
155 std::string name(
const std::string& pre)
const;
156 int findTabIndex(QTabWidget* tab)
const;
157 QWidget* w =
nullptr;
158 std::set<std::string> groups;
163 Ui::RemoteGuiWidget widget;
165 QPointer<SimpleConfigDialog> dialog;
166 std::string remoteGuiProviderName;
167 RemoteGuiInterfacePrx remoteGuiProvider;
169 std::mutex stateMutex;
170 RemoteGui::WidgetMap tabs;
171 std::map<std::string, TabData> qtTabs;
172 std::map<std::string, RemoteGui::WidgetMap> guiDescriptions;
173 RemoteGui::TabValueMap tabValueMap;
174 RemoteGui::TabValueMap tabDirtyMap;
176 RemoteGui::TabWidgetStateMap tabWidgetStates;
178 std::map<std::string, std::map<std::string, QWidget*>> guiWidgets;
180 std::atomic<bool> internalUpdate {
false};
182 static constexpr
auto groupAll =
"<ALL>";
183 static constexpr
auto groupUngrouped =
"<UNGROUPED>";
184 std::string activeGroup = groupAll;
186 std::map<std::string, std::size_t> tabsPerGroup;