Repository for import to local machine

Dependencies:   DMBasicGUI DMSupport

GCComponentStatusColorArea.h

Committer:
jmitc91516
Date:
2016-01-13
Revision:
0:47c880c1463d
Child:
1:a5258871b33d

File content as of revision 0:47c880c1463d:

#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