28 #ifndef CONFIGTASKWIDGET_H
29 #define CONFIGTASKWIDGET_H
38 #include <QTableWidget>
39 #include <QDoubleSpinBox>
43 #include <QPushButton>
44 #include <QDesktopServices>
86 return (lhs.
objid == this->objid && lhs.
objinstid == this->objinstid);
120 void disableMouseWheelEvents();
121 bool eventFilter(QObject *obj, QEvent *evt);
129 void addUAVObject(QString objectName,
QList<int> *reloadGroups = NULL);
132 void addWidget(QWidget *widget);
149 void addUAVObjectToWidgetRelation(QString
object, QString field, QWidget *widget,
int index = 0,
150 double scale = 1,
bool isLimited =
false,
151 bool useUnits =
false,
QList<int> *defaultReloadGroups =
nullptr,
152 quint32 instID = 0,
bool oneWayBind =
false);
158 void addConnectionsButton(QPushButton *button);
160 void addWidgetToDefaultReloadGroups(QWidget *widget,
QList<int> *groups);
164 bool addShadowWidget(QString
object, QString field, QWidget *widget,
int index = 0,
165 double scale = 1,
bool isLimited =
false,
bool useUnits =
false,
166 QList<int> *defaultReloadGroups = NULL, quint32 instID = 0);
168 void autoLoadWidgets();
169 void loadAllLimits();
171 bool isAutopilotConnected();
173 void setDirty(
bool value);
175 bool allObjectsUpdated();
177 void addHelpButton(QPushButton *button, QString url);
178 void forceShadowUpdates();
179 void forceConnectedState();
181 void setNotMandatory(QString
object);
186 void onAutopilotDisconnect();
187 void onAutopilotConnect();
188 void invalidateObjects();
193 void widgetContentsChanged(QWidget *widget);
196 void populateWidgetsRequested();
199 void refreshWidgetsValuesRequested();
202 void updateObjectsFromWidgetsRequested();
204 void autoPilotConnected();
206 void autoPilotDisconnected();
207 void defaultRequested(
int group);
211 void defaultButtonClicked();
212 void reloadButtonClicked();
213 void rebootButtonClicked();
214 void connectionsButtonClicked();
220 bool allowWidgetUpdates;
221 QStringList objectsList;
226 QMap<UAVObject *, bool> objectUpdates;
227 QMap<int, QList<objectToWidget *> *> defaultReloadGroups;
228 QMap<QWidget *, objectToWidget *> shadowsList;
229 QMap<QPushButton *, QString> helpButtonList;
234 bool setFieldFromWidget(QWidget *widget,
UAVObjectField *field,
int index,
double scale,
235 bool usesUnits =
false);
246 bool setWidgetFromField(QWidget *widget,
UAVObjectField *field,
int index,
double scale,
247 bool hasLimits,
bool useUnits =
false);
248 bool widgetReadOnly(QWidget *widget)
const;
249 void connectWidgetUpdatesToSlot(QWidget *widget,
const char *
function);
250 void disconnectWidgetUpdatesToSlot(QWidget *widget,
const char *
function);
251 void loadWidgetLimits(QWidget *widget,
UAVObjectField *field,
int index,
bool hasLimits,
252 bool useUnits,
double scale);
259 QString applyScaleToUnits(QString units,
double scale);
260 void setWidgetEnabledByObj(QWidget *widget,
bool enabled);
263 void addApplySaveButtons(QPushButton *update, QPushButton *
save);
264 void addReloadButton(QPushButton *button,
int buttonGroup);
265 void addDefaultButton(QPushButton *button,
int buttonGroup);
266 void addRebootButton(QPushButton *button);
283 void addUAVObjectToWidgetRelation(QString
object, QString field, QWidget *widget,
284 QString element,
double scale,
bool isLimited =
false,
285 bool useUnits =
false,
QList<int> *defaultReloadGroups =
nullptr,
286 quint32 instID = 0,
bool oneWayBind =
false);
289 QString outOfLimitsStyle;
292 virtual void disableObjUpdates();
293 virtual void enableObjUpdates();
294 virtual void clearDirty();
295 virtual void widgetsContentsChanged();
296 virtual void populateWidgets();
297 virtual void refreshWidgetsValues(
UAVObject *obj = NULL);
298 virtual void updateObjectsFromWidgets();
299 virtual void helpButtonPressed();
302 virtual void enableControls(
bool enable);
303 void checkWidgetsLimits(QWidget *widget,
UAVObjectField *field,
int index,
bool hasLimits,
304 bool useUnits, QVariant value,
double scale);
305 virtual QVariant getVariantFromWidget(QWidget *widget,
double scale,
bool usesUnits =
false);
306 virtual bool setWidgetFromVariant(QWidget *widget, QVariant value,
double scale,
308 virtual QString getOptionFromChecked(QWidget *widget,
bool checked);
309 virtual bool getCheckedFromOption(QWidget *widget, QString option);
315 bool resetWidgetToDefault(QWidget *widget);
324 void setWidgetProperty(QWidget *widget,
const char *prop,
const QVariant &value);
330 void setWidgetEnabled(QWidget *widget,
bool enabled =
true);
335 #endif // CONFIGTASKWIDGET_H
Core plugin system that manages the plugins, their life cycle and their registered objects...
save(matfile $(SAVEOBJECTSCODE))