Repository for import to local machine
Dependencies: DMBasicGUI DMSupport
GCComponentStatusColorArea.h@1:a5258871b33d, 2017-07-20 (annotated)
- Committer:
- jmitc91516
- Date:
- Thu Jul 20 08:42:29 2017 +0000
- Revision:
- 1:a5258871b33d
- Parent:
- 0:47c880c1463d
Version before re-layout (July 2017). Also for mbed CLI import to local machine.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmitc91516 | 0:47c880c1463d | 1 | #ifndef GCCOMPONENTSTATUSCOLORAREA_H |
jmitc91516 | 0:47c880c1463d | 2 | #define GCCOMPONENTSTATUSCOLORAREA_H |
jmitc91516 | 0:47c880c1463d | 3 | |
jmitc91516 | 0:47c880c1463d | 4 | #include "GuiLib.h" |
jmitc91516 | 0:47c880c1463d | 5 | |
jmitc91516 | 0:47c880c1463d | 6 | #include "GCComponentStatusEnums.h" |
jmitc91516 | 0:47c880c1463d | 7 | |
jmitc91516 | 0:47c880c1463d | 8 | |
jmitc91516 | 1:a5258871b33d | 9 | /* |
jmitc91516 | 1:a5258871b33d | 10 | Classes to handle the status rectangles - these are rectangles displayed |
jmitc91516 | 1:a5258871b33d | 11 | along with each easyGUI "structure" (i.e. page), whose colour shows the status |
jmitc91516 | 1:a5258871b33d | 12 | of the corresponding component. |
jmitc91516 | 1:a5258871b33d | 13 | |
jmitc91516 | 1:a5258871b33d | 14 | How many rectangles there are, and their size and location, varies from |
jmitc91516 | 1:a5258871b33d | 15 | one "structure" to another. |
jmitc91516 | 1:a5258871b33d | 16 | */ |
jmitc91516 | 1:a5258871b33d | 17 | |
jmitc91516 | 1:a5258871b33d | 18 | /* |
jmitc91516 | 1:a5258871b33d | 19 | #define this if we want to make the colour areas look three-dimensional - |
jmitc91516 | 1:a5258871b33d | 20 | i.e. a white line to the top and left, black to the bottom and right |
jmitc91516 | 1:a5258871b33d | 21 | */ |
jmitc91516 | 1:a5258871b33d | 22 | #define THREE_DIMENSIONAL |
jmitc91516 | 1:a5258871b33d | 23 | |
jmitc91516 | 0:47c880c1463d | 24 | class GCComponentStatusColorArea |
jmitc91516 | 0:47c880c1463d | 25 | { |
jmitc91516 | 0:47c880c1463d | 26 | public: |
jmitc91516 | 0:47c880c1463d | 27 | GCComponentStatusColorArea(); |
jmitc91516 | 0:47c880c1463d | 28 | |
jmitc91516 | 0:47c880c1463d | 29 | GCComponentStatusColorArea(GuiConst_INT16S X, GuiConst_INT16S Y, GuiConst_INT16S W, GuiConst_INT16S H); |
jmitc91516 | 0:47c880c1463d | 30 | |
jmitc91516 | 0:47c880c1463d | 31 | void SetComponentStatus(GCComponentStatus newStatus) { componentStatus = newStatus; } |
jmitc91516 | 0:47c880c1463d | 32 | |
jmitc91516 | 0:47c880c1463d | 33 | GCComponentStatus GetComponentStatus(void) { return componentStatus; } |
jmitc91516 | 0:47c880c1463d | 34 | |
jmitc91516 | 1:a5258871b33d | 35 | GuiConst_INTCOLOR GetCurrentColor(void); |
jmitc91516 | 1:a5258871b33d | 36 | |
jmitc91516 | 0:47c880c1463d | 37 | void DisplayComponentStatus(void); |
jmitc91516 | 0:47c880c1463d | 38 | |
jmitc91516 | 1:a5258871b33d | 39 | void SetSecondArea(GuiConst_INT16S X2, GuiConst_INT16S Y2, GuiConst_INT16S W2, GuiConst_INT16S H2); |
jmitc91516 | 1:a5258871b33d | 40 | |
jmitc91516 | 1:a5258871b33d | 41 | static void DisplayErrorRectangle(void); |
jmitc91516 | 1:a5258871b33d | 42 | |
jmitc91516 | 0:47c880c1463d | 43 | private: |
jmitc91516 | 1:a5258871b33d | 44 | |
jmitc91516 | 0:47c880c1463d | 45 | GuiConst_INT16S x; |
jmitc91516 | 0:47c880c1463d | 46 | GuiConst_INT16S y; |
jmitc91516 | 0:47c880c1463d | 47 | GuiConst_INT16S w; |
jmitc91516 | 0:47c880c1463d | 48 | GuiConst_INT16S h; |
jmitc91516 | 0:47c880c1463d | 49 | |
jmitc91516 | 1:a5258871b33d | 50 | bool secondAreaDefined; |
jmitc91516 | 1:a5258871b33d | 51 | GuiConst_INT16S x2; |
jmitc91516 | 1:a5258871b33d | 52 | GuiConst_INT16S y2; |
jmitc91516 | 1:a5258871b33d | 53 | GuiConst_INT16S w2; |
jmitc91516 | 1:a5258871b33d | 54 | GuiConst_INT16S h2; |
jmitc91516 | 1:a5258871b33d | 55 | |
jmitc91516 | 0:47c880c1463d | 56 | GCComponentStatus componentStatus; |
jmitc91516 | 0:47c880c1463d | 57 | |
jmitc91516 | 0:47c880c1463d | 58 | static GuiConst_INTCOLOR GetColorForComponentStatus(GCComponentStatus status); |
jmitc91516 | 1:a5258871b33d | 59 | #ifdef THREE_DIMENSIONAL |
jmitc91516 | 1:a5258871b33d | 60 | static GuiConst_INTCOLOR GetTopBevelColorForComponentStatus(GCComponentStatus status); |
jmitc91516 | 1:a5258871b33d | 61 | static GuiConst_INTCOLOR GetBottomBevelColorForComponentStatus(GCComponentStatus status); |
jmitc91516 | 1:a5258871b33d | 62 | static void DisplayBevelledEdgesOnRectangle(GuiConst_INT16S rectangleLeft, GuiConst_INT16S rectangleTop, |
jmitc91516 | 1:a5258871b33d | 63 | GuiConst_INT16S rectangleRight, GuiConst_INT16S rectangleBottom, |
jmitc91516 | 1:a5258871b33d | 64 | GuiConst_INTCOLOR topBevelColour, GuiConst_INTCOLOR bottomBevelColour); |
jmitc91516 | 1:a5258871b33d | 65 | #endif // THREE_DIMENSIONAL |
jmitc91516 | 0:47c880c1463d | 66 | }; |
jmitc91516 | 0:47c880c1463d | 67 | |
jmitc91516 | 1:a5258871b33d | 68 | /* |
jmitc91516 | 1:a5258871b33d | 69 | The status areas for the home page - there are four in all |
jmitc91516 | 1:a5258871b33d | 70 | */ |
jmitc91516 | 0:47c880c1463d | 71 | class HomePageGCComponentStatusColorAreas |
jmitc91516 | 0:47c880c1463d | 72 | { |
jmitc91516 | 0:47c880c1463d | 73 | public: |
jmitc91516 | 0:47c880c1463d | 74 | HomePageGCComponentStatusColorAreas(); |
jmitc91516 | 0:47c880c1463d | 75 | |
jmitc91516 | 0:47c880c1463d | 76 | GCComponentStatusColorArea *GetColorArea(GCComponent component); |
jmitc91516 | 0:47c880c1463d | 77 | |
jmitc91516 | 0:47c880c1463d | 78 | void SetGCComponentStatus(GCComponent component, GCComponentStatus newStatus); |
jmitc91516 | 0:47c880c1463d | 79 | |
jmitc91516 | 1:a5258871b33d | 80 | GCComponentStatus GetGCComponentStatus(GCComponent component); |
jmitc91516 | 1:a5258871b33d | 81 | |
jmitc91516 | 0:47c880c1463d | 82 | void DisplayAll(void); |
jmitc91516 | 0:47c880c1463d | 83 | |
jmitc91516 | 1:a5258871b33d | 84 | void DisplayEach(bool displayColumnArea, bool displayInjectorArea, bool displayDetectorArea, bool displayGasArea); |
jmitc91516 | 1:a5258871b33d | 85 | |
jmitc91516 | 1:a5258871b33d | 86 | GuiConst_INTCOLOR GetComponentCurrentColor(GCComponent component); |
jmitc91516 | 1:a5258871b33d | 87 | |
jmitc91516 | 0:47c880c1463d | 88 | private: |
jmitc91516 | 0:47c880c1463d | 89 | enum HomePageColorAreasCount { HOME_PAGE_COLOR_AREAS_COUNT = 4 }; |
jmitc91516 | 0:47c880c1463d | 90 | |
jmitc91516 | 0:47c880c1463d | 91 | GCComponentStatusColorArea *colorAreas[HOME_PAGE_COLOR_AREAS_COUNT]; |
jmitc91516 | 0:47c880c1463d | 92 | }; |
jmitc91516 | 0:47c880c1463d | 93 | |
jmitc91516 | 1:a5258871b33d | 94 | /* |
jmitc91516 | 1:a5258871b33d | 95 | The status areas for all four of the single component pages |
jmitc91516 | 1:a5258871b33d | 96 | (Column, Injector, Detector and Gas) |
jmitc91516 | 1:a5258871b33d | 97 | */ |
jmitc91516 | 0:47c880c1463d | 98 | class SingleGCComponentPageStatusColorAreas |
jmitc91516 | 0:47c880c1463d | 99 | { |
jmitc91516 | 0:47c880c1463d | 100 | public: |
jmitc91516 | 0:47c880c1463d | 101 | SingleGCComponentPageStatusColorAreas(); |
jmitc91516 | 0:47c880c1463d | 102 | |
jmitc91516 | 0:47c880c1463d | 103 | GCComponentStatusColorArea *GetColorArea(GCComponent component); |
jmitc91516 | 0:47c880c1463d | 104 | |
jmitc91516 | 0:47c880c1463d | 105 | void SetGCComponentStatus(GCComponent component, GCComponentStatus newStatus); |
jmitc91516 | 0:47c880c1463d | 106 | |
jmitc91516 | 1:a5258871b33d | 107 | GCComponentStatus GetGCComponentStatus(GCComponent component); |
jmitc91516 | 1:a5258871b33d | 108 | |
jmitc91516 | 0:47c880c1463d | 109 | void DisplayGCComponentStatus(GCComponent component); |
jmitc91516 | 0:47c880c1463d | 110 | |
jmitc91516 | 0:47c880c1463d | 111 | private: |
jmitc91516 | 0:47c880c1463d | 112 | enum SingleGCComponentPageColorAreasCount { SINGLE_PAGE_COLOR_AREAS_COUNT = 4 }; |
jmitc91516 | 0:47c880c1463d | 113 | |
jmitc91516 | 0:47c880c1463d | 114 | GCComponentStatusColorArea *colorAreas[SINGLE_PAGE_COLOR_AREAS_COUNT]; |
jmitc91516 | 0:47c880c1463d | 115 | }; |
jmitc91516 | 0:47c880c1463d | 116 | |
jmitc91516 | 0:47c880c1463d | 117 | #endif // GCCOMPONENTSTATUSCOLORAREA_H |