John Mitchell / lpc4088_displaymodule_GC500_2_5inch

Dependencies:   DMBasicGUI DMSupport

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ColumnDHPSUDACPageHandler.h Source File

ColumnDHPSUDACPageHandler.h

00001 #ifndef COLUMNDHPSUDACPAGEHANDLER_H
00002 #define COLUMNDHPSUDACPAGEHANDLER_H
00003 
00004 #include "mbed.h"
00005 #include "DMBoard.h"
00006 
00007 #include "USBHostGC.h"
00008 
00009 #include "GuiLib.h"
00010 
00011 
00012 /*
00013     This class handles user interaction with the easyGUI "PSU_DAC_Page".
00014     
00015     Note that this class is a singleton - we do not need or want there to be more than one instance of it
00016     (we do not want multiple values for the calibration values, etc, and nor will we show 
00017     more than one easyGUI 'PSU_DAC_Page' to the user at the same time).
00018 */
00019 
00020 class ColumnDHPSUDACPageHandler {
00021 public:
00022     /**
00023     * Static method to create (if necessary) and retrieve the single ColumnDHPSUDACPageHandler instance
00024     */
00025     static ColumnDHPSUDACPageHandler * GetInstance(USBDeviceConnected* newUsbDevice, USBHostGC* newUsbHostGC);
00026     
00027     /**
00028     * Version of the above that does not create the instance. Provided for callers that do not have 
00029     * the 'usbDevice' and 'usbHostGC' pointers, and that just want access to the instance
00030     */
00031     static ColumnDHPSUDACPageHandler * GetInstance(void);
00032     
00033     bool TouchAreaIsOnPSUDACPage(int touchAreaIndex);
00034 
00035     bool DealWithTouch(int touchAreaIndex);
00036     
00037     void DisplayingEasyGUIPage(bool updateEasyGUIVariables);
00038 
00039 private:    
00040     static ColumnDHPSUDACPageHandler * theColumnDHPSUDACPageHandlerInstance;
00041     
00042     USBDeviceConnected* usbDevice;
00043     USBHostGC* usbHostGC;
00044     
00045     // singleton class -> constructor is private
00046     ColumnDHPSUDACPageHandler(USBDeviceConnected* newUsbDevice, USBHostGC* newUsbHostGC);    
00047     ~ColumnDHPSUDACPageHandler();
00048     
00049     bool GetCurrentPSUDACValueFromGC(void);
00050     bool SetCurrentPSUDACValueInGC(void);
00051 
00052     void SendCommandToGCAndGetResponse(char* command, char* response);
00053     bool SendCommandToGCWithDACKResponse(char *cmd);
00054 
00055     void UpdateEasyGUIPage(void);
00056 };
00057 
00058 #endif // COLUMNDHPSUDACPAGEHANDLER_H