Repository for import to local machine
Dependencies: DMBasicGUI DMSupport
Diff: GCComponentStatusColorArea.h
- Revision:
- 0:47c880c1463d
- Child:
- 1:a5258871b33d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GCComponentStatusColorArea.h Wed Jan 13 13:17:05 2016 +0000 @@ -0,0 +1,69 @@ +#ifndef GCCOMPONENTSTATUSCOLORAREA_H +#define GCCOMPONENTSTATUSCOLORAREA_H + +#include "GuiLib.h" + +#include "GCComponentStatusEnums.h" + + +// For a particular component, this is the area on the display +// to be filled with a colour indicating the status of the component +class GCComponentStatusColorArea +{ +public: + GCComponentStatusColorArea(); + + GCComponentStatusColorArea(GuiConst_INT16S X, GuiConst_INT16S Y, GuiConst_INT16S W, GuiConst_INT16S H); + + void SetComponentStatus(GCComponentStatus newStatus) { componentStatus = newStatus; } + + GCComponentStatus GetComponentStatus(void) { return componentStatus; } + + void DisplayComponentStatus(void); + +private: + GuiConst_INT16S x; + GuiConst_INT16S y; + GuiConst_INT16S w; + GuiConst_INT16S h; + + GCComponentStatus componentStatus; + + static GuiConst_INTCOLOR GetColorForComponentStatus(GCComponentStatus status); +}; + +class HomePageGCComponentStatusColorAreas +{ +public: + HomePageGCComponentStatusColorAreas(); + + GCComponentStatusColorArea *GetColorArea(GCComponent component); + + void SetGCComponentStatus(GCComponent component, GCComponentStatus newStatus); + + void DisplayAll(void); + +private: + enum HomePageColorAreasCount { HOME_PAGE_COLOR_AREAS_COUNT = 4 }; + + GCComponentStatusColorArea *colorAreas[HOME_PAGE_COLOR_AREAS_COUNT]; +}; + +class SingleGCComponentPageStatusColorAreas +{ +public: + SingleGCComponentPageStatusColorAreas(); + + GCComponentStatusColorArea *GetColorArea(GCComponent component); + + void SetGCComponentStatus(GCComponent component, GCComponentStatus newStatus); + + void DisplayGCComponentStatus(GCComponent component); + +private: + enum SingleGCComponentPageColorAreasCount { SINGLE_PAGE_COLOR_AREAS_COUNT = 4 }; + + GCComponentStatusColorArea *colorAreas[SINGLE_PAGE_COLOR_AREAS_COUNT]; +}; + +#endif // GCCOMPONENTSTATUSCOLORAREA_H