# HG changeset patch # User sl # Date 1409073897 -7200 # Node ID 62356e3ecb84d0c02de7ca1afda481f61a867bd2 # Parent 2d749a2bea340b7985f2137fc301f591a17bf212 Request results getters moved to display base. diff -r 2d749a2bea34 -r 62356e3ecb84 CMakeLists.txt --- a/CMakeLists.txt Mon Aug 25 22:05:30 2014 +0200 +++ b/CMakeLists.txt Tue Aug 26 19:24:57 2014 +0200 @@ -28,7 +28,9 @@ FutabaGP1212A02.h HidDevice.h HidReport.h - MiniDisplay.h) + MiniDisplay.h + Display.h + ) source_group(Includes FILES ${INCLUDES}) diff -r 2d749a2bea34 -r 62356e3ecb84 Display.h --- a/Display.h Mon Aug 25 22:05:30 2014 +0200 +++ b/Display.h Tue Aug 26 19:24:57 2014 +0200 @@ -5,13 +5,18 @@ #ifndef DISPLAY_H #define DISPLAY_H +const int KMaxDisplayStringLength = 256; + /** Define an interface to some basic display functionality */ class DisplayBase { public: - DisplayBase():iRequest(EMiniDisplayRequestNone){} + DisplayBase():iRequest(EMiniDisplayRequestNone),iPowerOn(false){ + iDeviceId[0]=0; + iFirmwareRevision[0]=0; +} virtual ~DisplayBase(){}; // virtual int Open()=0; @@ -33,9 +38,19 @@ virtual void CancelRequest(){iRequest=EMiniDisplayRequestNone;} virtual bool RequestPending(){return iRequest!=EMiniDisplayRequestNone;} + virtual bool PowerOn() {return iPowerOn;} + virtual char* DeviceId() {return iDeviceId;} + virtual char* FirmwareRevision() {return iFirmwareRevision;} + protected: void SetRequest(TMiniDisplayRequest aRequest) { iRequest=aRequest; } +protected: + char iDeviceId[KMaxDisplayStringLength]; + char iFirmwareRevision[KMaxDisplayStringLength]; + bool iPowerOn; + + private: TMiniDisplayRequest iRequest; }; diff -r 2d749a2bea34 -r 62356e3ecb84 FutabaGP1212A01.cpp --- a/FutabaGP1212A01.cpp Mon Aug 25 22:05:30 2014 +0200 +++ b/FutabaGP1212A01.cpp Tue Aug 26 19:24:57 2014 +0200 @@ -20,11 +20,8 @@ iFrameAlpha(NULL), iFrameBeta(NULL), iFrameGamma(NULL), - iNeedFullFrameUpdate(0), - iPowerOn(false) + iNeedFullFrameUpdate(0) { - iDeviceId[0]=0; - iFirmwareRevision[0]=0; //ResetBuffers(); } @@ -679,23 +676,4 @@ Write(report); } -/** -*/ -bool GP1212A01A::PowerOn() - { - return iPowerOn; - } -/** -*/ -char* GP1212A01A::DeviceId() - { - return iDeviceId; - } - -/** -*/ -char* GP1212A01A::FirmwareRevision() - { - return iFirmwareRevision; - } diff -r 2d749a2bea34 -r 62356e3ecb84 FutabaGP1212A01.h --- a/FutabaGP1212A01.h Mon Aug 25 22:05:30 2014 +0200 +++ b/FutabaGP1212A01.h Tue Aug 26 19:24:57 2014 +0200 @@ -55,9 +55,6 @@ // TMiniDisplayRequest AttemptRequestCompletion(); FutabaVfdReport& InputReport() {return iInputReport;} - bool PowerOn(); - char* DeviceId(); - char* FirmwareRevision(); private: void RequestDeviceId(); @@ -104,10 +101,6 @@ //unsigned char *iFrontBuffer; //unsigned char *iBackBuffer; FutabaVfdReport iInputReport; - // - char iDeviceId[KFutabaMaxHidReportSize]; - char iFirmwareRevision[KFutabaMaxHidReportSize]; - bool iPowerOn; }; diff -r 2d749a2bea34 -r 62356e3ecb84 MiniDisplay.cpp --- a/MiniDisplay.cpp Mon Aug 25 22:05:30 2014 +0200 +++ b/MiniDisplay.cpp Tue Aug 26 19:24:57 2014 +0200 @@ -165,13 +165,13 @@ //------------------------------------------------------------- bool MiniDisplayRequestPending(MiniDisplayDevice aDevice) { - return ((GP1212A01A*)aDevice)->RequestPending(); + return ((GraphicDisplay*)aDevice)->RequestPending(); } //------------------------------------------------------------- TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice) { - return ((GP1212A01A*)aDevice)->CurrentRequest(); + return ((GraphicDisplay*)aDevice)->CurrentRequest(); } //------------------------------------------------------------- @@ -183,23 +183,23 @@ //------------------------------------------------------------- TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice) { - return ((GP1212A01A*)aDevice)->AttemptRequestCompletion(); + return ((GraphicDisplay*)aDevice)->AttemptRequestCompletion(); } //------------------------------------------------------------- char* MiniDisplayDeviceId(MiniDisplayDevice aDevice) { - return ((GP1212A01A*)aDevice)->DeviceId(); + return ((GraphicDisplay*)aDevice)->DeviceId(); } //------------------------------------------------------------- char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice) { - return ((GP1212A01A*)aDevice)->FirmwareRevision(); + return ((GraphicDisplay*)aDevice)->FirmwareRevision(); } //------------------------------------------------------------- bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice) { - return ((GP1212A01A*)aDevice)->PowerOn(); + return ((GraphicDisplay*)aDevice)->PowerOn(); } \ No newline at end of file