Repository for import to local machine
Dependencies: DMBasicGUI DMSupport
ColumnDHPSUDACPageHandler.h@8:26e49e6955bd, 2017-07-31 (annotated)
- Committer:
- jmitc91516
- Date:
- Mon Jul 31 15:37:57 2017 +0000
- Revision:
- 8:26e49e6955bd
- Parent:
- 1:a5258871b33d
Method ramp scrolling improved, and more bitmaps moved to QSPI memory
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmitc91516 | 1:a5258871b33d | 1 | #ifndef COLUMNDHPSUDACPAGEHANDLER_H |
jmitc91516 | 1:a5258871b33d | 2 | #define COLUMNDHPSUDACPAGEHANDLER_H |
jmitc91516 | 1:a5258871b33d | 3 | |
jmitc91516 | 1:a5258871b33d | 4 | #include "mbed.h" |
jmitc91516 | 1:a5258871b33d | 5 | #include "DMBoard.h" |
jmitc91516 | 1:a5258871b33d | 6 | |
jmitc91516 | 1:a5258871b33d | 7 | #include "USBHostGC.h" |
jmitc91516 | 1:a5258871b33d | 8 | |
jmitc91516 | 1:a5258871b33d | 9 | #include "GuiLib.h" |
jmitc91516 | 1:a5258871b33d | 10 | |
jmitc91516 | 1:a5258871b33d | 11 | |
jmitc91516 | 1:a5258871b33d | 12 | /* |
jmitc91516 | 1:a5258871b33d | 13 | This class handles user interaction with the easyGUI "PSU_DAC_Page". |
jmitc91516 | 1:a5258871b33d | 14 | |
jmitc91516 | 1:a5258871b33d | 15 | Note that this class is a singleton - we do not need or want there to be more than one instance of it |
jmitc91516 | 1:a5258871b33d | 16 | (we do not want multiple values for the calibration values, etc, and nor will we show |
jmitc91516 | 1:a5258871b33d | 17 | more than one easyGUI 'PSU_DAC_Page' to the user at the same time). |
jmitc91516 | 1:a5258871b33d | 18 | */ |
jmitc91516 | 1:a5258871b33d | 19 | |
jmitc91516 | 1:a5258871b33d | 20 | class ColumnDHPSUDACPageHandler { |
jmitc91516 | 1:a5258871b33d | 21 | public: |
jmitc91516 | 1:a5258871b33d | 22 | /** |
jmitc91516 | 1:a5258871b33d | 23 | * Static method to create (if necessary) and retrieve the single ColumnDHPSUDACPageHandler instance |
jmitc91516 | 1:a5258871b33d | 24 | */ |
jmitc91516 | 1:a5258871b33d | 25 | static ColumnDHPSUDACPageHandler * GetInstance(USBDeviceConnected* newUsbDevice, USBHostGC* newUsbHostGC); |
jmitc91516 | 1:a5258871b33d | 26 | |
jmitc91516 | 1:a5258871b33d | 27 | /** |
jmitc91516 | 1:a5258871b33d | 28 | * Version of the above that does not create the instance. Provided for callers that do not have |
jmitc91516 | 1:a5258871b33d | 29 | * the 'usbDevice' and 'usbHostGC' pointers, and that just want access to the instance |
jmitc91516 | 1:a5258871b33d | 30 | */ |
jmitc91516 | 1:a5258871b33d | 31 | static ColumnDHPSUDACPageHandler * GetInstance(void); |
jmitc91516 | 1:a5258871b33d | 32 | |
jmitc91516 | 1:a5258871b33d | 33 | bool TouchAreaIsOnPSUDACPage(int touchAreaIndex); |
jmitc91516 | 1:a5258871b33d | 34 | |
jmitc91516 | 1:a5258871b33d | 35 | bool DealWithTouch(int touchAreaIndex); |
jmitc91516 | 1:a5258871b33d | 36 | |
jmitc91516 | 1:a5258871b33d | 37 | void DisplayingEasyGUIPage(bool updateEasyGUIVariables); |
jmitc91516 | 1:a5258871b33d | 38 | |
jmitc91516 | 1:a5258871b33d | 39 | private: |
jmitc91516 | 1:a5258871b33d | 40 | static ColumnDHPSUDACPageHandler * theColumnDHPSUDACPageHandlerInstance; |
jmitc91516 | 1:a5258871b33d | 41 | |
jmitc91516 | 1:a5258871b33d | 42 | USBDeviceConnected* usbDevice; |
jmitc91516 | 1:a5258871b33d | 43 | USBHostGC* usbHostGC; |
jmitc91516 | 1:a5258871b33d | 44 | |
jmitc91516 | 1:a5258871b33d | 45 | // singleton class -> constructor is private |
jmitc91516 | 1:a5258871b33d | 46 | ColumnDHPSUDACPageHandler(USBDeviceConnected* newUsbDevice, USBHostGC* newUsbHostGC); |
jmitc91516 | 1:a5258871b33d | 47 | ~ColumnDHPSUDACPageHandler(); |
jmitc91516 | 1:a5258871b33d | 48 | |
jmitc91516 | 1:a5258871b33d | 49 | bool GetCurrentPSUDACValueFromGC(void); |
jmitc91516 | 1:a5258871b33d | 50 | bool SetCurrentPSUDACValueInGC(void); |
jmitc91516 | 1:a5258871b33d | 51 | |
jmitc91516 | 1:a5258871b33d | 52 | void SendCommandToGCAndGetResponse(char* command, char* response); |
jmitc91516 | 1:a5258871b33d | 53 | bool SendCommandToGCWithDACKResponse(char *cmd); |
jmitc91516 | 1:a5258871b33d | 54 | |
jmitc91516 | 1:a5258871b33d | 55 | void UpdateEasyGUIPage(void); |
jmitc91516 | 1:a5258871b33d | 56 | }; |
jmitc91516 | 1:a5258871b33d | 57 | |
jmitc91516 | 1:a5258871b33d | 58 | #endif // COLUMNDHPSUDACPAGEHANDLER_H |