Library for 3.2'' uLcd Picaso Display4D system Picaso Serial Environment Command Set web: http://www.4dsystems.com.au/product/20/67/Processors_Graphics/PICASO/

Committer:
adelino
Date:
Sun Jul 06 10:36:27 2014 +0000
Revision:
0:65fd8b1cbf86
Library to communicate and draw on an LCD

Who changed what in which revision?

UserRevisionLine numberNew contents of line
adelino 0:65fd8b1cbf86 1 #ifndef OBJET_GRAPHIC_H
adelino 0:65fd8b1cbf86 2 #define OBJET_GRAPHIC_H
adelino 0:65fd8b1cbf86 3
adelino 0:65fd8b1cbf86 4 #include "PicasoSerial.h"
adelino 0:65fd8b1cbf86 5 #include <vector>
adelino 0:65fd8b1cbf86 6 #include <string>
adelino 0:65fd8b1cbf86 7
adelino 0:65fd8b1cbf86 8 /**
adelino 0:65fd8b1cbf86 9 * Library for 3.2'' uLcd Picaso Display
adelino 0:65fd8b1cbf86 10 * 4D system
adelino 0:65fd8b1cbf86 11 * The Objets
adelino 0:65fd8b1cbf86 12 * Picaso Serial Environment Command Set
adelino 0:65fd8b1cbf86 13 * http://www.4dsystems.com.au/product/20/67/Processors_Graphics/PICASO/
adelino 0:65fd8b1cbf86 14 * @autor A.Decarvalho
adelino 0:65fd8b1cbf86 15 *
adelino 0:65fd8b1cbf86 16 * 17/04/ 2014
adelino 0:65fd8b1cbf86 17 *
adelino 0:65fd8b1cbf86 18 */
adelino 0:65fd8b1cbf86 19
adelino 0:65fd8b1cbf86 20 //-------------------------------------
adelino 0:65fd8b1cbf86 21 class ObjetHeader;
adelino 0:65fd8b1cbf86 22 //-------------------------------------
adelino 0:65fd8b1cbf86 23 //
adelino 0:65fd8b1cbf86 24 //
adelino 0:65fd8b1cbf86 25 class Screen
adelino 0:65fd8b1cbf86 26 {
adelino 0:65fd8b1cbf86 27 public:
adelino 0:65fd8b1cbf86 28 /** Construct a Screen
adelino 0:65fd8b1cbf86 29 *
adelino 0:65fd8b1cbf86 30 * @param serial the PicasoSerial Obj
adelino 0:65fd8b1cbf86 31 * @param _x the up left
adelino 0:65fd8b1cbf86 32 * @params _y the up left
adelino 0:65fd8b1cbf86 33 * @params _w the width
adelino 0:65fd8b1cbf86 34 * @params _h the height
adelino 0:65fd8b1cbf86 35 * @param _colorBkg the background color
adelino 0:65fd8b1cbf86 36 */
adelino 0:65fd8b1cbf86 37 // constructeur
adelino 0:65fd8b1cbf86 38 Screen(PicasoSerial* serial,UINT16 _x,UINT16 _y,UINT16 _w,UINT16 _h,Color _colorBkg);
adelino 0:65fd8b1cbf86 39 //
adelino 0:65fd8b1cbf86 40 ~Screen(void);
adelino 0:65fd8b1cbf86 41 //
adelino 0:65fd8b1cbf86 42 //! draw all objects
adelino 0:65fd8b1cbf86 43 void drawAll(void);
adelino 0:65fd8b1cbf86 44 //------------------------------
adelino 0:65fd8b1cbf86 45 //! add a new Objet
adelino 0:65fd8b1cbf86 46 void addObj(ObjetHeader* pObj);
adelino 0:65fd8b1cbf86 47 //
adelino 0:65fd8b1cbf86 48 //! draw a particular object
adelino 0:65fd8b1cbf86 49 void drawObj(ObjetHeader* pObj);
adelino 0:65fd8b1cbf86 50 //
adelino 0:65fd8b1cbf86 51 //! @returns PicasoSerial the pointer to draw on the screen
adelino 0:65fd8b1cbf86 52 PicasoSerial* getPicasoSerial(void);
adelino 0:65fd8b1cbf86 53 //
adelino 0:65fd8b1cbf86 54 void drawCells(void);
adelino 0:65fd8b1cbf86 55
adelino 0:65fd8b1cbf86 56 //getter
adelino 0:65fd8b1cbf86 57 UINT16 getXpos(void);
adelino 0:65fd8b1cbf86 58 UINT16 getYpos(void);
adelino 0:65fd8b1cbf86 59 UINT16 getWidth(void);
adelino 0:65fd8b1cbf86 60 UINT16 getHeight(void);
adelino 0:65fd8b1cbf86 61 Color getColorBkg(void);
adelino 0:65fd8b1cbf86 62
adelino 0:65fd8b1cbf86 63 bool isContent(ObjetHeader* pObj, UINT16 _x,UINT16 _y);
adelino 0:65fd8b1cbf86 64
adelino 0:65fd8b1cbf86 65 //-----------------------------------------------------
adelino 0:65fd8b1cbf86 66 //! returns the Objet in [_x,_y] position
adelino 0:65fd8b1cbf86 67 ObjetHeader* getObjetPosition(UINT16 _x,UINT16 _y);
adelino 0:65fd8b1cbf86 68
adelino 0:65fd8b1cbf86 69 //! returns the Objet by Id
adelino 0:65fd8b1cbf86 70 ObjetHeader* getObjetById(UINT16 _id);
adelino 0:65fd8b1cbf86 71
adelino 0:65fd8b1cbf86 72 //-----------------------------------------------------
adelino 0:65fd8b1cbf86 73 //! returns the touch and update the GraphicMessage
adelino 0:65fd8b1cbf86 74 TouchEvent getTouchEvent(GraphicMessage* msg);
adelino 0:65fd8b1cbf86 75
adelino 0:65fd8b1cbf86 76 //-------------------------------------------
adelino 0:65fd8b1cbf86 77 //! update the identifier Id of the object being touched
adelino 0:65fd8b1cbf86 78 void getProcessMessage(GraphicMessage* msg);
adelino 0:65fd8b1cbf86 79
adelino 0:65fd8b1cbf86 80 protected:
adelino 0:65fd8b1cbf86 81 PicasoSerial* mySerial;
adelino 0:65fd8b1cbf86 82
adelino 0:65fd8b1cbf86 83 UINT16 myXpos,myYpos,myWidth,myHeight;
adelino 0:65fd8b1cbf86 84
adelino 0:65fd8b1cbf86 85 Color myColorBkg;
adelino 0:65fd8b1cbf86 86
adelino 0:65fd8b1cbf86 87 vector<ObjetHeader*> myVectorObjet;
adelino 0:65fd8b1cbf86 88 };
adelino 0:65fd8b1cbf86 89 //
adelino 0:65fd8b1cbf86 90 //
adelino 0:65fd8b1cbf86 91 //--------------------------------------
adelino 0:65fd8b1cbf86 92 //
adelino 0:65fd8b1cbf86 93 //
adelino 0:65fd8b1cbf86 94 class ObjetHeader
adelino 0:65fd8b1cbf86 95 {
adelino 0:65fd8b1cbf86 96 public:
adelino 0:65fd8b1cbf86 97 /** Construct a ObjetHeader the father
adelino 0:65fd8b1cbf86 98 *
adelino 0:65fd8b1cbf86 99 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 100 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 101 * @params _x the up left
adelino 0:65fd8b1cbf86 102 * @params _y the up left
adelino 0:65fd8b1cbf86 103 * @params _w the width
adelino 0:65fd8b1cbf86 104 * @params _h the height
adelino 0:65fd8b1cbf86 105 * @param _color the background color
adelino 0:65fd8b1cbf86 106 * @params _isVisible
adelino 0:65fd8b1cbf86 107 */
adelino 0:65fd8b1cbf86 108 // constructor
adelino 0:65fd8b1cbf86 109 //
adelino 0:65fd8b1cbf86 110 ObjetHeader(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,UINT16 _w,UINT16 _h,Color _color,bool _isVisible);
adelino 0:65fd8b1cbf86 111 //
adelino 0:65fd8b1cbf86 112 //! draw the obj
adelino 0:65fd8b1cbf86 113 virtual void draw(void);
adelino 0:65fd8b1cbf86 114 //
adelino 0:65fd8b1cbf86 115 virtual ~ObjetHeader(void);
adelino 0:65fd8b1cbf86 116 //
adelino 0:65fd8b1cbf86 117 //! test a overlap
adelino 0:65fd8b1cbf86 118 bool overlapWith(ObjetHeader* pObj);
adelino 0:65fd8b1cbf86 119 //
adelino 0:65fd8b1cbf86 120 static bool overlap(ObjetHeader* pObj1,ObjetHeader* pObj2);
adelino 0:65fd8b1cbf86 121 //
adelino 0:65fd8b1cbf86 122 static const UINT16 CELL_DIM=80;
adelino 0:65fd8b1cbf86 123 static const UINT16 CELL_COL=3;
adelino 0:65fd8b1cbf86 124 void updateCellId(void);
adelino 0:65fd8b1cbf86 125
adelino 0:65fd8b1cbf86 126
adelino 0:65fd8b1cbf86 127 //getter
adelino 0:65fd8b1cbf86 128 UINT16 getXpos(void);
adelino 0:65fd8b1cbf86 129 UINT16 getYpos(void);
adelino 0:65fd8b1cbf86 130 UINT16 getWidth(void);
adelino 0:65fd8b1cbf86 131 UINT16 getHeight(void);
adelino 0:65fd8b1cbf86 132 UINT16 getElementId(void);
adelino 0:65fd8b1cbf86 133 bool getIsVisible(void);
adelino 0:65fd8b1cbf86 134 State getElementState(void);
adelino 0:65fd8b1cbf86 135
adelino 0:65fd8b1cbf86 136 float getSpeedX(void);
adelino 0:65fd8b1cbf86 137 float getSpeedY(void);
adelino 0:65fd8b1cbf86 138
adelino 0:65fd8b1cbf86 139 Color getColor(void);
adelino 0:65fd8b1cbf86 140
adelino 0:65fd8b1cbf86 141 UINT16 getCellId(void);
adelino 0:65fd8b1cbf86 142
adelino 0:65fd8b1cbf86 143 //setter
adelino 0:65fd8b1cbf86 144 void setColor(Color _color);
adelino 0:65fd8b1cbf86 145 void setElementState(State _state);
adelino 0:65fd8b1cbf86 146 void setElementId(UINT16 _id);
adelino 0:65fd8b1cbf86 147 void setVisibility(bool _val);
adelino 0:65fd8b1cbf86 148 void setInvertSpeedX(void);
adelino 0:65fd8b1cbf86 149 void setInvertSpeedY(void);
adelino 0:65fd8b1cbf86 150 void setSpeedX(float _speedX);
adelino 0:65fd8b1cbf86 151 void setSpeedY(float _speedY);
adelino 0:65fd8b1cbf86 152 void setSpeedXY(float _speedX,float _speedY);
adelino 0:65fd8b1cbf86 153
adelino 0:65fd8b1cbf86 154 void setXpos(UINT16 _xpos);
adelino 0:65fd8b1cbf86 155 void setYpos(UINT16 _ypos);
adelino 0:65fd8b1cbf86 156
adelino 0:65fd8b1cbf86 157 GRAPHIC_OBJ_TYPE getElementType(void);
adelino 0:65fd8b1cbf86 158
adelino 0:65fd8b1cbf86 159 void setUpdateAutomatic(bool _state);
adelino 0:65fd8b1cbf86 160 bool getUpdateAutomatic(void);
adelino 0:65fd8b1cbf86 161
adelino 0:65fd8b1cbf86 162 protected:
adelino 0:65fd8b1cbf86 163 Screen* myScreen;
adelino 0:65fd8b1cbf86 164
adelino 0:65fd8b1cbf86 165 void elementUpdate(void);
adelino 0:65fd8b1cbf86 166
adelino 0:65fd8b1cbf86 167 UINT16 myX,myY,myWidth,myHeight;
adelino 0:65fd8b1cbf86 168 UINT16 myElementId;
adelino 0:65fd8b1cbf86 169 GRAPHIC_OBJ_TYPE myElementType;
adelino 0:65fd8b1cbf86 170
adelino 0:65fd8b1cbf86 171 bool myElementIsVisible;
adelino 0:65fd8b1cbf86 172 bool myIsUpdateAutomatic;
adelino 0:65fd8b1cbf86 173 float mySpeedX,mySpeedY;
adelino 0:65fd8b1cbf86 174
adelino 0:65fd8b1cbf86 175 UINT16 myXMoveMin,myXMoveMax,myYMoveMin,myYMoveMax;
adelino 0:65fd8b1cbf86 176 UINT16 myCellId;
adelino 0:65fd8b1cbf86 177
adelino 0:65fd8b1cbf86 178 State myElementState;
adelino 0:65fd8b1cbf86 179 Color myColor;
adelino 0:65fd8b1cbf86 180 };
adelino 0:65fd8b1cbf86 181 //-----------------------------------------
adelino 0:65fd8b1cbf86 182 //
adelino 0:65fd8b1cbf86 183 //
adelino 0:65fd8b1cbf86 184 class Isocele:public ObjetHeader
adelino 0:65fd8b1cbf86 185 {
adelino 0:65fd8b1cbf86 186 public:
adelino 0:65fd8b1cbf86 187 Isocele(Screen* mScreen,UINT16 _id,UINT16 xc,UINT16 yc,UINT16 radius,int orientation,float _speed,Color color,bool isVisible);
adelino 0:65fd8b1cbf86 188 //
adelino 0:65fd8b1cbf86 189 virtual void draw(void);
adelino 0:65fd8b1cbf86 190 //
adelino 0:65fd8b1cbf86 191 virtual ~Isocele(void);
adelino 0:65fd8b1cbf86 192 //
adelino 0:65fd8b1cbf86 193 void setOrientation(int _orientation);
adelino 0:65fd8b1cbf86 194 //
adelino 0:65fd8b1cbf86 195 void turnLeft(void);
adelino 0:65fd8b1cbf86 196 //
adelino 0:65fd8b1cbf86 197 void turnRight(void);
adelino 0:65fd8b1cbf86 198 //
adelino 0:65fd8b1cbf86 199 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 200 //
adelino 0:65fd8b1cbf86 201 void setNewPosition(INT16 _xcnew,INT16 _ycnew);
adelino 0:65fd8b1cbf86 202 //
adelino 0:65fd8b1cbf86 203 void update(float delta);
adelino 0:65fd8b1cbf86 204 //
adelino 0:65fd8b1cbf86 205 int getOrientation(void);
adelino 0:65fd8b1cbf86 206 //
adelino 0:65fd8b1cbf86 207 UINT16 getXcenter(void);
adelino 0:65fd8b1cbf86 208 //
adelino 0:65fd8b1cbf86 209 UINT16 getYcenter(void);
adelino 0:65fd8b1cbf86 210
adelino 0:65fd8b1cbf86 211 static const int ORIENTATION_UP=0;
adelino 0:65fd8b1cbf86 212 static const int ORIENTATION_LEFT=1;
adelino 0:65fd8b1cbf86 213 static const int ORIENTATION_DOWN=2;
adelino 0:65fd8b1cbf86 214 static const int ORIENTATION_RIGHT=3;
adelino 0:65fd8b1cbf86 215
adelino 0:65fd8b1cbf86 216 protected:
adelino 0:65fd8b1cbf86 217 UINT16 myXcenter;
adelino 0:65fd8b1cbf86 218 UINT16 myYcenter;
adelino 0:65fd8b1cbf86 219 UINT16 myRadius;
adelino 0:65fd8b1cbf86 220 int myOrientation;
adelino 0:65fd8b1cbf86 221
adelino 0:65fd8b1cbf86 222 UINT16 myX1,myY1;
adelino 0:65fd8b1cbf86 223 UINT16 myX2,myY2;
adelino 0:65fd8b1cbf86 224 UINT16 myX3,myY3;
adelino 0:65fd8b1cbf86 225 float mySpeed;
adelino 0:65fd8b1cbf86 226
adelino 0:65fd8b1cbf86 227 void updateOrientation(void);
adelino 0:65fd8b1cbf86 228 void myElementUpdate(void);
adelino 0:65fd8b1cbf86 229 };
adelino 0:65fd8b1cbf86 230 //----------------------------------------
adelino 0:65fd8b1cbf86 231 //
adelino 0:65fd8b1cbf86 232 //
adelino 0:65fd8b1cbf86 233 class Rectangle:public ObjetHeader
adelino 0:65fd8b1cbf86 234 {
adelino 0:65fd8b1cbf86 235 public:
adelino 0:65fd8b1cbf86 236 /** Construct a filled Rectangle
adelino 0:65fd8b1cbf86 237 *
adelino 0:65fd8b1cbf86 238 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 239 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 240 * @params _x the up left
adelino 0:65fd8b1cbf86 241 * @params _y the up left
adelino 0:65fd8b1cbf86 242 * @params _w the width
adelino 0:65fd8b1cbf86 243 * @params _h the height
adelino 0:65fd8b1cbf86 244 * @param _color the background color
adelino 0:65fd8b1cbf86 245 * @params _isVisible
adelino 0:65fd8b1cbf86 246 */
adelino 0:65fd8b1cbf86 247 Rectangle(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,UINT16 _w,UINT16 _h,Color _color,bool _isVisible);
adelino 0:65fd8b1cbf86 248 //
adelino 0:65fd8b1cbf86 249 virtual void draw(void);
adelino 0:65fd8b1cbf86 250 //
adelino 0:65fd8b1cbf86 251 virtual ~Rectangle(void);
adelino 0:65fd8b1cbf86 252 //
adelino 0:65fd8b1cbf86 253 //! updating the position of the object, in the case of a game
adelino 0:65fd8b1cbf86 254 void update(float delta);
adelino 0:65fd8b1cbf86 255
adelino 0:65fd8b1cbf86 256
adelino 0:65fd8b1cbf86 257 //setter
adelino 0:65fd8b1cbf86 258 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 259 //
adelino 0:65fd8b1cbf86 260 void setNewPosition(INT16 _xcnew,INT16 _ycnew);
adelino 0:65fd8b1cbf86 261
adelino 0:65fd8b1cbf86 262 };
adelino 0:65fd8b1cbf86 263 //----------------------------------------
adelino 0:65fd8b1cbf86 264 //
adelino 0:65fd8b1cbf86 265 //
adelino 0:65fd8b1cbf86 266 class Circle:public ObjetHeader
adelino 0:65fd8b1cbf86 267 {
adelino 0:65fd8b1cbf86 268 public:
adelino 0:65fd8b1cbf86 269 /** Construct a filled Circle
adelino 0:65fd8b1cbf86 270 *
adelino 0:65fd8b1cbf86 271 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 272 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 273 * @params _xc the center x
adelino 0:65fd8b1cbf86 274 * @params _yc the center y
adelino 0:65fd8b1cbf86 275 * @params _radius
adelino 0:65fd8b1cbf86 276 * @param _color the background color
adelino 0:65fd8b1cbf86 277 * @params _isVisible
adelino 0:65fd8b1cbf86 278 */
adelino 0:65fd8b1cbf86 279 Circle(Screen* mScreen,UINT16 _id,UINT16 _xc,UINT16 _yc,UINT16 _radius,Color _color,bool _isVisible);
adelino 0:65fd8b1cbf86 280 //
adelino 0:65fd8b1cbf86 281 virtual void draw(void);
adelino 0:65fd8b1cbf86 282 //
adelino 0:65fd8b1cbf86 283 virtual ~Circle(void);
adelino 0:65fd8b1cbf86 284 //
adelino 0:65fd8b1cbf86 285 void update(float delta);
adelino 0:65fd8b1cbf86 286
adelino 0:65fd8b1cbf86 287 // getter
adelino 0:65fd8b1cbf86 288 UINT16 getCenterX(void);
adelino 0:65fd8b1cbf86 289 //
adelino 0:65fd8b1cbf86 290 UINT16 getCenterY(void);
adelino 0:65fd8b1cbf86 291
adelino 0:65fd8b1cbf86 292 //setter
adelino 0:65fd8b1cbf86 293 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 294 //
adelino 0:65fd8b1cbf86 295 void setNewPosition(INT16 _xnew,INT16 _ynew);
adelino 0:65fd8b1cbf86 296 //
adelino 0:65fd8b1cbf86 297 void setCenterX(UINT16 _xcenter);
adelino 0:65fd8b1cbf86 298 //
adelino 0:65fd8b1cbf86 299 void setCenterY(UINT16 _ycenter);
adelino 0:65fd8b1cbf86 300
adelino 0:65fd8b1cbf86 301 protected:
adelino 0:65fd8b1cbf86 302 UINT16 myRadius;
adelino 0:65fd8b1cbf86 303 UINT16 myCenterX;
adelino 0:65fd8b1cbf86 304 UINT16 myCenterY;
adelino 0:65fd8b1cbf86 305 };
adelino 0:65fd8b1cbf86 306 //-----------------------------------------
adelino 0:65fd8b1cbf86 307 //
adelino 0:65fd8b1cbf86 308 //
adelino 0:65fd8b1cbf86 309 class Ellipse:public ObjetHeader
adelino 0:65fd8b1cbf86 310 {
adelino 0:65fd8b1cbf86 311 public:
adelino 0:65fd8b1cbf86 312 /** Construct a filled Ellipse
adelino 0:65fd8b1cbf86 313 *
adelino 0:65fd8b1cbf86 314 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 315 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 316 * @params _xc the center x
adelino 0:65fd8b1cbf86 317 * @params _yc the center y
adelino 0:65fd8b1cbf86 318 * @params _radiusX
adelino 0:65fd8b1cbf86 319 * @radius _radiusY
adelino 0:65fd8b1cbf86 320 * @param _color the background color
adelino 0:65fd8b1cbf86 321 * @params _isVisible
adelino 0:65fd8b1cbf86 322 */
adelino 0:65fd8b1cbf86 323 Ellipse(Screen* mScreen,UINT16 _id,UINT16 _xc,UINT16 _yc,UINT16 _radiusX,UINT16 _radiusY,Color _color,bool _isVisible);
adelino 0:65fd8b1cbf86 324 //
adelino 0:65fd8b1cbf86 325 virtual void draw(void);
adelino 0:65fd8b1cbf86 326 //
adelino 0:65fd8b1cbf86 327 virtual ~Ellipse(void);
adelino 0:65fd8b1cbf86 328 //
adelino 0:65fd8b1cbf86 329 void update(float delta);
adelino 0:65fd8b1cbf86 330 // getter
adelino 0:65fd8b1cbf86 331 UINT16 getCenterX(void);
adelino 0:65fd8b1cbf86 332 //
adelino 0:65fd8b1cbf86 333 UINT16 getCenterY(void);
adelino 0:65fd8b1cbf86 334
adelino 0:65fd8b1cbf86 335 //setter
adelino 0:65fd8b1cbf86 336 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 337 //
adelino 0:65fd8b1cbf86 338 void setNewPosition(INT16 _xcnew,INT16 _ycnew);
adelino 0:65fd8b1cbf86 339 //
adelino 0:65fd8b1cbf86 340 void setCenterX(UINT16 _xcenter);
adelino 0:65fd8b1cbf86 341 //
adelino 0:65fd8b1cbf86 342 void setCenterY(UINT16 _ycenter);
adelino 0:65fd8b1cbf86 343
adelino 0:65fd8b1cbf86 344
adelino 0:65fd8b1cbf86 345 protected:
adelino 0:65fd8b1cbf86 346 UINT16 myCenterX;
adelino 0:65fd8b1cbf86 347 UINT16 myCenterY;
adelino 0:65fd8b1cbf86 348 UINT16 myRadiusX;
adelino 0:65fd8b1cbf86 349 UINT16 myRadiusY;
adelino 0:65fd8b1cbf86 350 };
adelino 0:65fd8b1cbf86 351 //-----------------------------------------
adelino 0:65fd8b1cbf86 352 //
adelino 0:65fd8b1cbf86 353 //
adelino 0:65fd8b1cbf86 354 class Diamond:public ObjetHeader
adelino 0:65fd8b1cbf86 355 {
adelino 0:65fd8b1cbf86 356 public:
adelino 0:65fd8b1cbf86 357 /** Construct a filled Diamond
adelino 0:65fd8b1cbf86 358 *
adelino 0:65fd8b1cbf86 359 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 360 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 361 * @params x1
adelino 0:65fd8b1cbf86 362 * @params y1
adelino 0:65fd8b1cbf86 363 * @params x2
adelino 0:65fd8b1cbf86 364 * @params y2
adelino 0:65fd8b1cbf86 365 * @params x3
adelino 0:65fd8b1cbf86 366 * @params y3
adelino 0:65fd8b1cbf86 367 * @params x4
adelino 0:65fd8b1cbf86 368 * @params y4
adelino 0:65fd8b1cbf86 369 * @param _color the background color
adelino 0:65fd8b1cbf86 370 * @params _isVisible
adelino 0:65fd8b1cbf86 371 */
adelino 0:65fd8b1cbf86 372 Diamond(Screen* mScreen,UINT16 _id,UINT16 x1,UINT16 y1,UINT16 x2,UINT16 y2,
adelino 0:65fd8b1cbf86 373 UINT16 x3,UINT16 y3,UINT16 x4,UINT16 y4,Color _color,bool _isVisible);
adelino 0:65fd8b1cbf86 374 //
adelino 0:65fd8b1cbf86 375 virtual void draw(void);
adelino 0:65fd8b1cbf86 376 //
adelino 0:65fd8b1cbf86 377 virtual ~Diamond(void);
adelino 0:65fd8b1cbf86 378 //
adelino 0:65fd8b1cbf86 379 void update(float delta);
adelino 0:65fd8b1cbf86 380
adelino 0:65fd8b1cbf86 381 //setter
adelino 0:65fd8b1cbf86 382 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 383 //
adelino 0:65fd8b1cbf86 384 void setNewPosition(INT16 _xnew,INT16 _ynew);
adelino 0:65fd8b1cbf86 385
adelino 0:65fd8b1cbf86 386 protected:
adelino 0:65fd8b1cbf86 387 UINT16 myX1,myY1;
adelino 0:65fd8b1cbf86 388 UINT16 myX2,myY2;
adelino 0:65fd8b1cbf86 389 UINT16 myX3,myY3;
adelino 0:65fd8b1cbf86 390 UINT16 myX4,myY4;
adelino 0:65fd8b1cbf86 391 UINT16 myU1,myU2;
adelino 0:65fd8b1cbf86 392 UINT16 myV1,myV2;
adelino 0:65fd8b1cbf86 393
adelino 0:65fd8b1cbf86 394 };
adelino 0:65fd8b1cbf86 395 //---------------------------------------
adelino 0:65fd8b1cbf86 396 //
adelino 0:65fd8b1cbf86 397 //
adelino 0:65fd8b1cbf86 398 class Triangle:public ObjetHeader
adelino 0:65fd8b1cbf86 399 {
adelino 0:65fd8b1cbf86 400 public:
adelino 0:65fd8b1cbf86 401 /** Construct a filled Triangle
adelino 0:65fd8b1cbf86 402 *
adelino 0:65fd8b1cbf86 403 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 404 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 405 * @params x1
adelino 0:65fd8b1cbf86 406 * @params y1
adelino 0:65fd8b1cbf86 407 * @params x2
adelino 0:65fd8b1cbf86 408 * @params y2
adelino 0:65fd8b1cbf86 409 * @params x3
adelino 0:65fd8b1cbf86 410 * @params y3
adelino 0:65fd8b1cbf86 411 * @param _color the background color
adelino 0:65fd8b1cbf86 412 * @params _isVisible
adelino 0:65fd8b1cbf86 413 */
adelino 0:65fd8b1cbf86 414
adelino 0:65fd8b1cbf86 415 Triangle(Screen* mScreen,UINT16 _id,UINT16 x1,UINT16 y1,
adelino 0:65fd8b1cbf86 416 UINT16 x2,UINT16 y2,
adelino 0:65fd8b1cbf86 417 UINT16 x3,UINT16 y3,
adelino 0:65fd8b1cbf86 418 Color _color,bool _isVisible);
adelino 0:65fd8b1cbf86 419 //
adelino 0:65fd8b1cbf86 420 virtual void draw(void);
adelino 0:65fd8b1cbf86 421 //
adelino 0:65fd8b1cbf86 422 virtual ~Triangle(void);
adelino 0:65fd8b1cbf86 423 //
adelino 0:65fd8b1cbf86 424 void update(float delta);
adelino 0:65fd8b1cbf86 425
adelino 0:65fd8b1cbf86 426
adelino 0:65fd8b1cbf86 427 //setter
adelino 0:65fd8b1cbf86 428 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 429 //
adelino 0:65fd8b1cbf86 430 void setNewPosition(INT16 _xnew,INT16 _ynew);
adelino 0:65fd8b1cbf86 431
adelino 0:65fd8b1cbf86 432
adelino 0:65fd8b1cbf86 433 protected:
adelino 0:65fd8b1cbf86 434 UINT16 myX1,myY1;
adelino 0:65fd8b1cbf86 435 UINT16 myX2,myY2;
adelino 0:65fd8b1cbf86 436 UINT16 myX3,myY3;
adelino 0:65fd8b1cbf86 437 UINT16 myU,myV;
adelino 0:65fd8b1cbf86 438 };
adelino 0:65fd8b1cbf86 439 //------------------------------------------
adelino 0:65fd8b1cbf86 440 //
adelino 0:65fd8b1cbf86 441 //
adelino 0:65fd8b1cbf86 442 class Label:public ObjetHeader
adelino 0:65fd8b1cbf86 443 {
adelino 0:65fd8b1cbf86 444 public:
adelino 0:65fd8b1cbf86 445 /** Construct a label
adelino 0:65fd8b1cbf86 446 *
adelino 0:65fd8b1cbf86 447 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 448 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 449 * @params _x
adelino 0:65fd8b1cbf86 450 * @params _y
adelino 0:65fd8b1cbf86 451 * @params _text
adelino 0:65fd8b1cbf86 452 * @params _font
adelino 0:65fd8b1cbf86 453 * @params _colorText
adelino 0:65fd8b1cbf86 454 * @params _colorBkg
adelino 0:65fd8b1cbf86 455 * @params _isVisible
adelino 0:65fd8b1cbf86 456 */
adelino 0:65fd8b1cbf86 457
adelino 0:65fd8b1cbf86 458 Label(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,
adelino 0:65fd8b1cbf86 459 string _text,Font _font,Color _colorText,Color _colorBkg,bool _isVisible);
adelino 0:65fd8b1cbf86 460
adelino 0:65fd8b1cbf86 461 //
adelino 0:65fd8b1cbf86 462 virtual void draw(void);
adelino 0:65fd8b1cbf86 463 //
adelino 0:65fd8b1cbf86 464 virtual ~Label(void);
adelino 0:65fd8b1cbf86 465
adelino 0:65fd8b1cbf86 466 //setter
adelino 0:65fd8b1cbf86 467 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 468 //
adelino 0:65fd8b1cbf86 469 void setNewText(string _newText);
adelino 0:65fd8b1cbf86 470
adelino 0:65fd8b1cbf86 471 protected:
adelino 0:65fd8b1cbf86 472 string myText;
adelino 0:65fd8b1cbf86 473 Font myFont;
adelino 0:65fd8b1cbf86 474 Color myColorText;
adelino 0:65fd8b1cbf86 475
adelino 0:65fd8b1cbf86 476 };
adelino 0:65fd8b1cbf86 477 //-------------------------------------------
adelino 0:65fd8b1cbf86 478 //
adelino 0:65fd8b1cbf86 479 //
adelino 0:65fd8b1cbf86 480 class GraphicLed:public ObjetHeader
adelino 0:65fd8b1cbf86 481 {
adelino 0:65fd8b1cbf86 482 public:
adelino 0:65fd8b1cbf86 483 /** Construct a filled Circle
adelino 0:65fd8b1cbf86 484 *
adelino 0:65fd8b1cbf86 485 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 486 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 487 * @params _xc center
adelino 0:65fd8b1cbf86 488 * @params _yc center
adelino 0:65fd8b1cbf86 489 * @params _radius
adelino 0:65fd8b1cbf86 490 * @params _colorOn
adelino 0:65fd8b1cbf86 491 * @params _colorOff
adelino 0:65fd8b1cbf86 492 * @params _state LED_STATE_ON or LED_STATE_OFF,
adelino 0:65fd8b1cbf86 493 * @params _isVisible
adelino 0:65fd8b1cbf86 494 */
adelino 0:65fd8b1cbf86 495 GraphicLed(Screen* mScreen,UINT16 _id,UINT16 _xc,UINT16 _yc,UINT16 _radius,
adelino 0:65fd8b1cbf86 496 Color _colorOn,Color _colorOff,State _state,bool _isVisible);
adelino 0:65fd8b1cbf86 497 //
adelino 0:65fd8b1cbf86 498 virtual void draw(void);
adelino 0:65fd8b1cbf86 499 //
adelino 0:65fd8b1cbf86 500 virtual ~GraphicLed(void);
adelino 0:65fd8b1cbf86 501
adelino 0:65fd8b1cbf86 502
adelino 0:65fd8b1cbf86 503 //setter
adelino 0:65fd8b1cbf86 504 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 505 //
adelino 0:65fd8b1cbf86 506 void setState(State _state);
adelino 0:65fd8b1cbf86 507
adelino 0:65fd8b1cbf86 508 protected:
adelino 0:65fd8b1cbf86 509 Color myColorOn;
adelino 0:65fd8b1cbf86 510 Color myColorOff;
adelino 0:65fd8b1cbf86 511 UINT16 myRadius;
adelino 0:65fd8b1cbf86 512 UINT16 myCenterX;
adelino 0:65fd8b1cbf86 513 UINT16 myCenterY;
adelino 0:65fd8b1cbf86 514 };
adelino 0:65fd8b1cbf86 515 //------------------------------------------
adelino 0:65fd8b1cbf86 516 //
adelino 0:65fd8b1cbf86 517 //
adelino 0:65fd8b1cbf86 518 class Button:public ObjetHeader
adelino 0:65fd8b1cbf86 519 {
adelino 0:65fd8b1cbf86 520 public:
adelino 0:65fd8b1cbf86 521 /** Construct a Button
adelino 0:65fd8b1cbf86 522 *
adelino 0:65fd8b1cbf86 523 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 524 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 525 * @params _x up left
adelino 0:65fd8b1cbf86 526 * @params _y up left
adelino 0:65fd8b1cbf86 527 * @params _text
adelino 0:65fd8b1cbf86 528 * @params _font
adelino 0:65fd8b1cbf86 529 * @params _colorText
adelino 0:65fd8b1cbf86 530 * @params _colorBtn
adelino 0:65fd8b1cbf86 531 * @params _state BUTTON_STATE_PRESSED or BUTTON_STATE_RELEASED,
adelino 0:65fd8b1cbf86 532 * @params _isVisible
adelino 0:65fd8b1cbf86 533 */
adelino 0:65fd8b1cbf86 534 Button(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,string _text,Font _font,
adelino 0:65fd8b1cbf86 535 Color _colorText,Color _colorBtn,State _state,bool _isVisible);
adelino 0:65fd8b1cbf86 536 //
adelino 0:65fd8b1cbf86 537 virtual void draw(void);
adelino 0:65fd8b1cbf86 538 //
adelino 0:65fd8b1cbf86 539 virtual ~Button(void);
adelino 0:65fd8b1cbf86 540
adelino 0:65fd8b1cbf86 541 //setter
adelino 0:65fd8b1cbf86 542 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 543 //
adelino 0:65fd8b1cbf86 544 void setState(State _state);
adelino 0:65fd8b1cbf86 545
adelino 0:65fd8b1cbf86 546 protected:
adelino 0:65fd8b1cbf86 547 string myText;
adelino 0:65fd8b1cbf86 548 Font myFont;
adelino 0:65fd8b1cbf86 549 Color myColorText;
adelino 0:65fd8b1cbf86 550 };
adelino 0:65fd8b1cbf86 551 //------------------------------------------
adelino 0:65fd8b1cbf86 552 //
adelino 0:65fd8b1cbf86 553 //
adelino 0:65fd8b1cbf86 554 class Slider:public ObjetHeader
adelino 0:65fd8b1cbf86 555 {
adelino 0:65fd8b1cbf86 556 public:
adelino 0:65fd8b1cbf86 557 /** Construct a Slider
adelino 0:65fd8b1cbf86 558 *
adelino 0:65fd8b1cbf86 559 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 560 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 561 * @params _x up left
adelino 0:65fd8b1cbf86 562 * @params _y up left
adelino 0:65fd8b1cbf86 563 * @params _width
adelino 0:65fd8b1cbf86 564 * @params _height
adelino 0:65fd8b1cbf86 565 * @params _valMax
adelino 0:65fd8b1cbf86 566 * @params _value
adelino 0:65fd8b1cbf86 567 * @params _colorBkg
adelino 0:65fd8b1cbf86 568 * @params _isVisible
adelino 0:65fd8b1cbf86 569 */
adelino 0:65fd8b1cbf86 570 Slider(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,UINT16 _width,UINT16 _height,int _valMax,int _value,
adelino 0:65fd8b1cbf86 571 Color _colorBkg,bool _isVisible);
adelino 0:65fd8b1cbf86 572 //
adelino 0:65fd8b1cbf86 573 virtual void draw(void);
adelino 0:65fd8b1cbf86 574 //
adelino 0:65fd8b1cbf86 575 virtual ~Slider(void);
adelino 0:65fd8b1cbf86 576 //
adelino 0:65fd8b1cbf86 577 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 578 //
adelino 0:65fd8b1cbf86 579 int getValue(GraphicMessage* pmsg);
adelino 0:65fd8b1cbf86 580
adelino 0:65fd8b1cbf86 581 protected:
adelino 0:65fd8b1cbf86 582 int myValueMax;
adelino 0:65fd8b1cbf86 583 int myValue;
adelino 0:65fd8b1cbf86 584 };
adelino 0:65fd8b1cbf86 585 //------------------------------------------
adelino 0:65fd8b1cbf86 586 //
adelino 0:65fd8b1cbf86 587 //
adelino 0:65fd8b1cbf86 588 class Input:public ObjetHeader
adelino 0:65fd8b1cbf86 589 {
adelino 0:65fd8b1cbf86 590 public:
adelino 0:65fd8b1cbf86 591 /** Construct a Input
adelino 0:65fd8b1cbf86 592 *
adelino 0:65fd8b1cbf86 593 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 594 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 595 * @params _x up left
adelino 0:65fd8b1cbf86 596 * @params _y up left
adelino 0:65fd8b1cbf86 597 * @params _width
adelino 0:65fd8b1cbf86 598 * @params _height
adelino 0:65fd8b1cbf86 599 * @params _valMin
adelino 0:65fd8b1cbf86 600 * @params _valInc incrementing the value
adelino 0:65fd8b1cbf86 601 * @params _valMax
adelino 0:65fd8b1cbf86 602 * @params _isVisible
adelino 0:65fd8b1cbf86 603 */
adelino 0:65fd8b1cbf86 604 Input(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,UINT16 _width,UINT16 _height,float _valMin,float _valInc,
adelino 0:65fd8b1cbf86 605 float _valMax,bool _isVisible);
adelino 0:65fd8b1cbf86 606 //
adelino 0:65fd8b1cbf86 607 virtual void draw(void);
adelino 0:65fd8b1cbf86 608 //
adelino 0:65fd8b1cbf86 609 virtual ~Input(void);
adelino 0:65fd8b1cbf86 610 //
adelino 0:65fd8b1cbf86 611 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 612 //
adelino 0:65fd8b1cbf86 613 float getValue(GraphicMessage* msg);
adelino 0:65fd8b1cbf86 614 //
adelino 0:65fd8b1cbf86 615 void setColorBkg(Color _color);
adelino 0:65fd8b1cbf86 616 //
adelino 0:65fd8b1cbf86 617 void setColorCursorDown(Color _color);
adelino 0:65fd8b1cbf86 618 //
adelino 0:65fd8b1cbf86 619 void setColorCursorUp(Color _color);
adelino 0:65fd8b1cbf86 620
adelino 0:65fd8b1cbf86 621 protected:
adelino 0:65fd8b1cbf86 622 float myValMin;
adelino 0:65fd8b1cbf86 623 float myValInc;
adelino 0:65fd8b1cbf86 624 float myValMax;
adelino 0:65fd8b1cbf86 625 float myValue;
adelino 0:65fd8b1cbf86 626 Color myColorBkg;
adelino 0:65fd8b1cbf86 627 Color myColorCursorUp;
adelino 0:65fd8b1cbf86 628 Color myColorCursorDown;
adelino 0:65fd8b1cbf86 629 };
adelino 0:65fd8b1cbf86 630 //-----------------------------------------
adelino 0:65fd8b1cbf86 631 //
adelino 0:65fd8b1cbf86 632 //
adelino 0:65fd8b1cbf86 633 class Switch:public ObjetHeader
adelino 0:65fd8b1cbf86 634 {
adelino 0:65fd8b1cbf86 635 public:
adelino 0:65fd8b1cbf86 636 /** Construct a Switch
adelino 0:65fd8b1cbf86 637 *
adelino 0:65fd8b1cbf86 638 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 639 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 640 * @params _x up left
adelino 0:65fd8b1cbf86 641 * @params _y up left
adelino 0:65fd8b1cbf86 642 * @params _width
adelino 0:65fd8b1cbf86 643 * @params _height
adelino 0:65fd8b1cbf86 644 * @params _isVisible
adelino 0:65fd8b1cbf86 645 */
adelino 0:65fd8b1cbf86 646 Switch(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,UINT16 _width,UINT16 _height,bool _isVisible);
adelino 0:65fd8b1cbf86 647 //
adelino 0:65fd8b1cbf86 648 virtual void draw(void);
adelino 0:65fd8b1cbf86 649 //
adelino 0:65fd8b1cbf86 650 virtual ~Switch(void);
adelino 0:65fd8b1cbf86 651 //
adelino 0:65fd8b1cbf86 652 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 653 //
adelino 0:65fd8b1cbf86 654 void setState(State _state);
adelino 0:65fd8b1cbf86 655 //
adelino 0:65fd8b1cbf86 656 void changeState(GraphicMessage* msg);
adelino 0:65fd8b1cbf86 657
adelino 0:65fd8b1cbf86 658 protected:
adelino 0:65fd8b1cbf86 659 Color myColorOn;
adelino 0:65fd8b1cbf86 660 Color myColorOff;
adelino 0:65fd8b1cbf86 661 Color myColorCursor;
adelino 0:65fd8b1cbf86 662 };
adelino 0:65fd8b1cbf86 663 //------------------------------------
adelino 0:65fd8b1cbf86 664 //
adelino 0:65fd8b1cbf86 665 //
adelino 0:65fd8b1cbf86 666 class DigitLed:public ObjetHeader
adelino 0:65fd8b1cbf86 667 {
adelino 0:65fd8b1cbf86 668 public:
adelino 0:65fd8b1cbf86 669 /** Construct a Digit Led
adelino 0:65fd8b1cbf86 670 *
adelino 0:65fd8b1cbf86 671 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 672 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 673 * @params _x up left
adelino 0:65fd8b1cbf86 674 * @params _y up left
adelino 0:65fd8b1cbf86 675 * @params _ptVisible
adelino 0:65fd8b1cbf86 676 * @params _isVisible
adelino 0:65fd8b1cbf86 677 */
adelino 0:65fd8b1cbf86 678 DigitLed(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,bool _ptVisible,bool _isVisible);
adelino 0:65fd8b1cbf86 679 //
adelino 0:65fd8b1cbf86 680 virtual void draw(void);
adelino 0:65fd8b1cbf86 681 //
adelino 0:65fd8b1cbf86 682 virtual ~DigitLed(void);
adelino 0:65fd8b1cbf86 683 //
adelino 0:65fd8b1cbf86 684 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 685 //
adelino 0:65fd8b1cbf86 686 void setValue(char _value);
adelino 0:65fd8b1cbf86 687 //
adelino 0:65fd8b1cbf86 688 void setColorBkg(Color _colorBkg);
adelino 0:65fd8b1cbf86 689 //
adelino 0:65fd8b1cbf86 690 void setColorSeg(Color _colorSeg);
adelino 0:65fd8b1cbf86 691 //
adelino 0:65fd8b1cbf86 692 void setPtVisible(bool _state);
adelino 0:65fd8b1cbf86 693
adelino 0:65fd8b1cbf86 694 protected:
adelino 0:65fd8b1cbf86 695 char myValue;
adelino 0:65fd8b1cbf86 696 Color myColorBkg;
adelino 0:65fd8b1cbf86 697 Color myColorSeg;
adelino 0:65fd8b1cbf86 698 UINT16 myIncX;
adelino 0:65fd8b1cbf86 699 UINT16 myIncY;
adelino 0:65fd8b1cbf86 700 bool isPtVisible;
adelino 0:65fd8b1cbf86 701 //
adelino 0:65fd8b1cbf86 702 void draw_seg_a(PicasoSerial* ps);
adelino 0:65fd8b1cbf86 703 void draw_seg_b(PicasoSerial* ps);
adelino 0:65fd8b1cbf86 704
adelino 0:65fd8b1cbf86 705 void draw_seg_c(PicasoSerial* ps);
adelino 0:65fd8b1cbf86 706
adelino 0:65fd8b1cbf86 707 void draw_seg_d(PicasoSerial* ps);
adelino 0:65fd8b1cbf86 708 void draw_seg_e(PicasoSerial* ps);
adelino 0:65fd8b1cbf86 709 void draw_seg_f(PicasoSerial* ps);
adelino 0:65fd8b1cbf86 710
adelino 0:65fd8b1cbf86 711 void draw_seg_g(PicasoSerial* ps);
adelino 0:65fd8b1cbf86 712 void draw_seg_pt(PicasoSerial* ps);
adelino 0:65fd8b1cbf86 713 };
adelino 0:65fd8b1cbf86 714 //--------------------------------------------
adelino 0:65fd8b1cbf86 715 //
adelino 0:65fd8b1cbf86 716 //
adelino 0:65fd8b1cbf86 717 class Digit3Led:public ObjetHeader
adelino 0:65fd8b1cbf86 718 {
adelino 0:65fd8b1cbf86 719 public:
adelino 0:65fd8b1cbf86 720 /** Construct a 3 Digit Led [000]
adelino 0:65fd8b1cbf86 721 *
adelino 0:65fd8b1cbf86 722 * @param mScreen the pointer screen
adelino 0:65fd8b1cbf86 723 * @param _id the identifier Id
adelino 0:65fd8b1cbf86 724 * @params _x up left
adelino 0:65fd8b1cbf86 725 * @params _y up left
adelino 0:65fd8b1cbf86 726 * @params _resolution 1[000],10[00.0],100[0.00]
adelino 0:65fd8b1cbf86 727 * @params _isVisible
adelino 0:65fd8b1cbf86 728 */
adelino 0:65fd8b1cbf86 729 Digit3Led(Screen* mScreen,UINT16 _id,UINT16 _x,UINT16 _y,UINT8 _resolution,bool _isVisible);
adelino 0:65fd8b1cbf86 730 //
adelino 0:65fd8b1cbf86 731 virtual void draw(void);
adelino 0:65fd8b1cbf86 732 //
adelino 0:65fd8b1cbf86 733 virtual ~Digit3Led(void);
adelino 0:65fd8b1cbf86 734 //
adelino 0:65fd8b1cbf86 735 void setInvisible(bool _state);
adelino 0:65fd8b1cbf86 736 //
adelino 0:65fd8b1cbf86 737 void setValue(float _value);
adelino 0:65fd8b1cbf86 738 //
adelino 0:65fd8b1cbf86 739 void setColorBkg(Color _colorBkg);
adelino 0:65fd8b1cbf86 740 //
adelino 0:65fd8b1cbf86 741 void setColorSeg(Color _colorSeg);
adelino 0:65fd8b1cbf86 742
adelino 0:65fd8b1cbf86 743 protected:
adelino 0:65fd8b1cbf86 744 Color myColorBkg;
adelino 0:65fd8b1cbf86 745 Color myColorSeg;
adelino 0:65fd8b1cbf86 746 float myValue;
adelino 0:65fd8b1cbf86 747 UINT8 myResolution;
adelino 0:65fd8b1cbf86 748
adelino 0:65fd8b1cbf86 749 DigitLed* myDigitLedCentaine;
adelino 0:65fd8b1cbf86 750 DigitLed* myDigitLedDizaine;
adelino 0:65fd8b1cbf86 751 DigitLed* myDigitLedUnite;
adelino 0:65fd8b1cbf86 752
adelino 0:65fd8b1cbf86 753 };
adelino 0:65fd8b1cbf86 754 //--------------------------------------------------------
adelino 0:65fd8b1cbf86 755 #endif