Newer
Older
#ifndef QGCUASPARAMMANAGER_H
#define QGCUASPARAMMANAGER_H
#include <QWidget>
#include <QMap>
#include <QTimer>
class UASInterface;
class UASParameterDataModel;
class QGCUASParamManager : public QWidget
{
Q_OBJECT
public:
QGCUASParamManager(UASInterface* uas, QWidget *parent = 0);
/** @brief Get the known, confirmed value of a parameter */
virtual bool getParameterValue(int component, const QString& parameter, QVariant& value) const;
/** @brief Provide tooltips / user-visible descriptions for parameters */
virtual void setParamDescriptions(const QMap<QString,QString>& paramDescs);
/** @brief Get the UAS of this widget
* @return The MAV of this mgr. Unless the MAV object has been destroyed, this is never null.
*/
UASInterface* getUAS();
//TODO decouple this UI message display further
virtual void setParameterStatusMsg(const QString& msg);
/** @brief Load parameter meta information from appropriate CSV file */
virtual void loadParamMetaInfoCSV();
signals:
void parameterChanged(int component, QString parameter, QVariant value);
void parameterChanged(int component, int parameterIndex, QVariant value);
// void parameterUpdateRequested(int component, const QString& parameter);
// void parameterUpdateRequestedById(int componentId, int paramId);
public slots:
lm
committed
/** @brief Write one parameter to the MAV */
virtual void setParameter(int component, QString parameterName, QVariant value) = 0;
lm
committed
/** @brief Request list of parameters from MAV */
/** @brief Request a single parameter by name */
virtual void requestParameterUpdate(int component, const QString& parameter);
virtual void handleParameterUpdate(int component, int paramCount, int paramId, const QString& parameterName, QVariant value) = 0;
virtual void handleParameterListUpToDate(int component) = 0;
protected:
UASInterface* mav; ///< The MAV this widget is controlling
UASParameterDataModel* paramDataModel;///< Shared data model of parameters
UASParameterCommsMgr* paramCommsMgr; ///< Shared comms mgr for parameters