Documents > BPS V2 C++ API
bpsgauge.h
Go to the documentation of this file.
00001 
00004 #ifndef BPSGAUGE_H
00005 #define BPSGAUGE_H
00006 
00007 #include "bpscore_global.h"
00008 #include <QObject>
00009 #include <QMap>
00010 
00018 class BPSCORE_EXPORT BpsGauge : public QObject
00019 {
00020     Q_OBJECT
00021     BPS_PRIVATE(BpsGauge)
00022 
00023 public:
00027     enum Unit {
00028         UnitCelsius     = 0,        // The value is degrees celsius.
00029         UnitPH          = 1         // The value is pH.
00030     };
00031 
00035     enum {
00036         StatusStable    = 0,        // The value was successfully read and is stable.
00037         StatusDynamic   = 1         // The value was successfully read but is dynamic (moving).
00038     };
00039 
00043     BpsGauge(QObject* aParent=0);
00044 
00048     virtual ~BpsGauge();
00049 
00055     void setConfig(const QMap<QString,QString>& aConfig);
00056 
00061     QMap<QString,QString> config() const;
00062 
00067     virtual Unit unit() const = 0;
00068 
00075     virtual int resolution() const = 0;
00076 
00081     virtual void requestReadValue(int aTimeout = 0) = 0;
00082 
00083 signals:
00084 
00090     void readValueOk(int aStatus, double aValue);
00091 
00096     void readValueTimeout(const QString& aMessage);
00097 
00102     void readValueError(const QString& aMessage);
00103 
00108     void error(const QString& aMessage);
00109 
00110 };
00111 
00112 #endif // BPSGAUGE_H