author | sl |
Wed, 28 May 2014 21:31:03 +0200 | |
changeset 14 | 9903a5edeb56 |
parent 10 | 64cfde8062c7 |
child 15 | 737f8bb110be |
permissions | -rw-r--r-- |
sl@2 | 1 |
#ifndef MINIDISPLAY_H |
sl@2 | 2 |
#define MINIDISPLAY_H |
sl@2 | 3 |
|
sl@2 | 4 |
#include <QQuickItem> |
sl@4 | 5 |
#include "FutabaVfd.h" |
sl@2 | 6 |
|
sl@2 | 7 |
class MiniDisplay : public QQuickItem |
sl@2 | 8 |
{ |
sl@2 | 9 |
Q_OBJECT |
sl@2 | 10 |
Q_DISABLE_COPY(MiniDisplay) |
sl@4 | 11 |
// |
sl@5 | 12 |
Q_PROPERTY(bool isOpen READ isOpen NOTIFY statusChanged) |
sl@5 | 13 |
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) |
sl@8 | 14 |
Q_PROPERTY(QString vendor READ vendor) |
sl@8 | 15 |
Q_PROPERTY(QString product READ product) |
sl@8 | 16 |
Q_PROPERTY(QString serialNumber READ serialNumber) |
sl@10 | 17 |
Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) |
sl@10 | 18 |
Q_PROPERTY(int maxBrightness READ maxBrightness NOTIFY opened) |
sl@10 | 19 |
Q_PROPERTY(int minBrightness READ minBrightness NOTIFY opened) |
sl@11 | 20 |
Q_PROPERTY(QPoint framePosition READ framePosition WRITE setFramePosition NOTIFY closed) |
sl@4 | 21 |
|
sl@4 | 22 |
public: |
sl@5 | 23 |
//Methods |
sl@4 | 24 |
Q_INVOKABLE void open(); |
sl@4 | 25 |
Q_INVOKABLE void close(); |
sl@4 | 26 |
// |
sl@4 | 27 |
Q_INVOKABLE void clear(); |
sl@4 | 28 |
Q_INVOKABLE void fill(); |
sl@4 | 29 |
Q_INVOKABLE void swapBuffers(); |
sl@9 | 30 |
// |
sl@9 | 31 |
Q_INVOKABLE void requestPowerStatus(); |
sl@9 | 32 |
Q_INVOKABLE void requestDeviceId(); |
sl@9 | 33 |
Q_INVOKABLE void requestFirmwareVersion(); |
sl@4 | 34 |
|
sl@5 | 35 |
public: |
sl@5 | 36 |
//Properties |
sl@5 | 37 |
bool isOpen(); |
sl@5 | 38 |
QFont font() const {return iFont;} |
sl@5 | 39 |
void setFont(const QFont& aFont); |
sl@8 | 40 |
// |
sl@8 | 41 |
QString vendor(); |
sl@8 | 42 |
QString product(); |
sl@8 | 43 |
QString serialNumber(); |
sl@10 | 44 |
// |
sl@10 | 45 |
int maxBrightness() const; |
sl@10 | 46 |
int minBrightness() const; |
sl@10 | 47 |
int brightness() const; |
sl@10 | 48 |
void setBrightness(int aBrightness); |
sl@11 | 49 |
// |
sl@11 | 50 |
QPoint framePosition() const; |
sl@11 | 51 |
void setFramePosition(const QPoint& aPoint); |
sl@5 | 52 |
|
sl@4 | 53 |
signals: |
sl@5 | 54 |
void opened(); |
sl@5 | 55 |
void openError(); |
sl@11 | 56 |
void closing(); |
sl@5 | 57 |
void closed(); |
sl@5 | 58 |
void statusChanged(); |
sl@5 | 59 |
void fontChanged(); |
sl@10 | 60 |
void brightnessChanged(); |
sl@9 | 61 |
// |
sl@9 | 62 |
void powerStatus(bool powerOn); |
sl@9 | 63 |
void deviceId(QString deviceId); |
sl@9 | 64 |
void firmwareVersion(QString version); |
sl@9 | 65 |
|
sl@9 | 66 |
public slots: |
sl@9 | 67 |
void readTimer(); |
sl@9 | 68 |
|
sl@2 | 69 |
|
sl@2 | 70 |
public: |
sl@2 | 71 |
MiniDisplay(QQuickItem *parent = 0); |
sl@2 | 72 |
~MiniDisplay(); |
sl@4 | 73 |
|
sl@4 | 74 |
private: |
sl@4 | 75 |
GP1212A01A iDisplay; |
sl@5 | 76 |
QFont iFont; |
sl@9 | 77 |
int iReadAttempt; |
sl@10 | 78 |
int iBrightness; |
sl@11 | 79 |
QPoint iFramePosition; |
sl@2 | 80 |
}; |
sl@2 | 81 |
|
sl@2 | 82 |
#endif // MINIDISPLAY_H |
sl@2 | 83 |