Documents > BPS V2 C++ API
bpsscales.h
Go to the documentation of this file.
00001 
00004 #ifndef BPSSCALES_H
00005 #define BPSSCALES_H
00006 
00007 #include "bpscore_global.h"
00008 #include <QMap>
00009 #include <QObject>
00010 
00018 class BPSCORE_EXPORT BpsScales : public QObject
00019 {
00020     Q_OBJECT
00021     BPS_PRIVATE(BpsScales)
00022 
00023 public:
00027     enum {
00028         StatusStable    = 0,        // The weight was successfully read and is stable.
00029         StatusDynamic   = 1,        // The weight was successfully read but is dynamic (moving).
00030         StatusOverload  = 2,        // The scales is overloaded (above valid maximum weight).
00031         StatusUnderload = 3,        // The scales is underloaded (below valid minimum weight).
00032         StatusError     = 4         // The scales is in error state (but still can communicate with host obviously).
00033     };
00034 
00038     BpsScales(QObject* aParent=0);
00039 
00043     virtual ~BpsScales();
00044 
00050     void setConfig(const QMap<QString,QString>& aConfig);
00051 
00056     QMap<QString,QString> config() const;
00057     
00064     virtual bool canTare() const;
00065 
00069     virtual void requestReadWeight() = 0;
00070 
00074     virtual void requestReadTare();
00075 
00079     virtual void requestTakeTare();
00080 
00084     virtual void requestClearTare();
00085 
00086 signals:
00087 
00094     void readWeightOk(int aStatus, double aWeight, bool aTared);
00095 
00100     void readWeightError(const QString& aMessage);
00101 
00106     void readTareOk(double aTare);
00107 
00112     void readTareError(const QString& aMessage);
00113 
00117     void takeTareOk();
00118 
00123     void takeTareError(const QString& aMessage);
00124 
00128     void clearTareOk();
00129 
00134     void clearTareError(const QString& aMessage);
00135 
00139     void ok();
00140 
00145     void error(const QString& aMessage);
00146 
00147 };
00148 
00149 #endif // BPSSCALES_H