Newer
Older
#ifndef QGCPARAMSLIDER_H
#define QGCPARAMSLIDER_H
#include <QWidget>
lm
committed
#include <QAction>
#include <QtDesigner/QDesignerExportWidget>
lm
committed
#include "QGCToolWidgetItem.h"
namespace Ui
{
class QGCParamSlider;
{
Q_OBJECT
public:
explicit QGCParamSlider(QWidget *parent = 0);
~QGCParamSlider();
lm
committed
public slots:
void startEditMode();
void endEditMode();
lm
committed
/** @brief Send the parameter to the MAV */
void sendParameter();
/** @brief Set the slider value as parameter value */
void setSliderValue(int sliderValue);
/** @brief Update the UI with the new parameter value */
void setParameterValue(int uas, int component, int paramCount, int paramIndex, QString parameterName, const QVariant value);
void writeSettings(QSettings& settings);
void readSettings(const QSettings& settings);
lm
committed
void refreshParamList();
void setActiveUAS(UASInterface *uas);
void selectComponent(int componentIndex);
void selectParameter(int paramIndex);
/** @brief Set a double parameter value */
lm
committed
void setParamValue(double value);
/** @brief Set an integer parameter value */
void setParamValue(int value);
Lorenz Meier
committed
/** @brief Show descriptive text next to slider */
void showInfo(bool enable);
/** @brief Show tool tip of calling element */
void showTooltip();
protected slots:
/** @brief Request the parameter of this widget from the MAV */
void requestParameter();
lm
committed
lm
committed
QString parameterName; ///< Key/Name of the parameter
QVariant parameterValue; ///< Value of the parameter
lm
committed
double parameterScalingFactor; ///< Factor to scale the parameter between slider and true value
float parameterMin;
float parameterMax;
int component; ///< ID of the MAV component to address
void changeEvent(QEvent *e);
/** @brief Convert scaled int to float */
float scaledIntToFloat(int sliderValue);
int floatToScaledInt(float value);