Code projet_gestion_de_commande_en_ligne
Dependencies: TS_DISCO_F746NG LCD_DISCO_F746NG BSP_DISCO_F746NG BUTTON_GROUP
main.cpp@1:7e34491bfd01, 2020-06-19 (annotated)
- Committer:
- azerty000
- Date:
- Fri Jun 19 14:12:12 2020 +0000
- Revision:
- 1:7e34491bfd01
- Parent:
- 0:735dae6ecacf
- Child:
- 2:e007f6b6e145
commande
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
darkseb | 0:735dae6ecacf | 1 | #include "mbed.h" |
darkseb | 0:735dae6ecacf | 2 | #include "stm32746g_discovery_lcd.h" |
darkseb | 0:735dae6ecacf | 3 | #include "stm32746g_discovery_ts.h" |
darkseb | 0:735dae6ecacf | 4 | #include "button_group.hpp" |
azerty000 | 1:7e34491bfd01 | 5 | #include "pomme.h" |
azerty000 | 1:7e34491bfd01 | 6 | #include "poire.h" |
azerty000 | 1:7e34491bfd01 | 7 | #include "orange.h" |
azerty000 | 1:7e34491bfd01 | 8 | #include "banane.h" |
azerty000 | 1:7e34491bfd01 | 9 | #include "tomate.h" |
azerty000 | 1:7e34491bfd01 | 10 | #include "fraise.h" |
azerty000 | 1:7e34491bfd01 | 11 | #include "raisin.h" |
azerty000 | 1:7e34491bfd01 | 12 | #include "kiwi.h" |
azerty000 | 1:7e34491bfd01 | 13 | #include "haricot.h" |
azerty000 | 1:7e34491bfd01 | 14 | |
azerty000 | 1:7e34491bfd01 | 15 | |
azerty000 | 1:7e34491bfd01 | 16 | |
darkseb | 0:735dae6ecacf | 17 | |
darkseb | 0:735dae6ecacf | 18 | Serial pc(USBTX, USBRX); // tx, rx |
darkseb | 0:735dae6ecacf | 19 | |
darkseb | 0:735dae6ecacf | 20 | using namespace Mikami; |
darkseb | 0:735dae6ecacf | 21 | TS_DISCO_F746NG ts_; |
darkseb | 0:735dae6ecacf | 22 | LCD_DISCO_F746NG lcd_; |
darkseb | 0:735dae6ecacf | 23 | |
azerty000 | 1:7e34491bfd01 | 24 | |
azerty000 | 1:7e34491bfd01 | 25 | //Pomme |
azerty000 | 1:7e34491bfd01 | 26 | void drawImage_pomme(int offsetX, int offsetY) |
azerty000 | 1:7e34491bfd01 | 27 | { |
azerty000 | 1:7e34491bfd01 | 28 | int x = 0; |
azerty000 | 1:7e34491bfd01 | 29 | int y = 0; |
azerty000 | 1:7e34491bfd01 | 30 | uint32_t* dataPtr = (uint32_t*)pomme.data; |
azerty000 | 1:7e34491bfd01 | 31 | while(y < pomme.height) |
azerty000 | 1:7e34491bfd01 | 32 | { |
azerty000 | 1:7e34491bfd01 | 33 | while(x < pomme.width) |
azerty000 | 1:7e34491bfd01 | 34 | { |
azerty000 | 1:7e34491bfd01 | 35 | BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr); |
azerty000 | 1:7e34491bfd01 | 36 | dataPtr++; |
azerty000 | 1:7e34491bfd01 | 37 | x++; |
azerty000 | 1:7e34491bfd01 | 38 | } |
azerty000 | 1:7e34491bfd01 | 39 | x = 0; |
azerty000 | 1:7e34491bfd01 | 40 | y++; |
azerty000 | 1:7e34491bfd01 | 41 | } |
azerty000 | 1:7e34491bfd01 | 42 | } |
azerty000 | 1:7e34491bfd01 | 43 | |
azerty000 | 1:7e34491bfd01 | 44 | |
azerty000 | 1:7e34491bfd01 | 45 | //Poire |
azerty000 | 1:7e34491bfd01 | 46 | void drawImage_poire(int offsetX, int offsetY) |
azerty000 | 1:7e34491bfd01 | 47 | { |
azerty000 | 1:7e34491bfd01 | 48 | int x = 0; |
azerty000 | 1:7e34491bfd01 | 49 | int y = 0; |
azerty000 | 1:7e34491bfd01 | 50 | uint32_t* dataPtr = (uint32_t*)poire.data; |
azerty000 | 1:7e34491bfd01 | 51 | while(y < poire.height) |
azerty000 | 1:7e34491bfd01 | 52 | { |
azerty000 | 1:7e34491bfd01 | 53 | while(x < poire.width) |
azerty000 | 1:7e34491bfd01 | 54 | { |
azerty000 | 1:7e34491bfd01 | 55 | BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr); |
azerty000 | 1:7e34491bfd01 | 56 | dataPtr++; |
azerty000 | 1:7e34491bfd01 | 57 | x++; |
azerty000 | 1:7e34491bfd01 | 58 | } |
azerty000 | 1:7e34491bfd01 | 59 | x = 0; |
azerty000 | 1:7e34491bfd01 | 60 | y++; |
azerty000 | 1:7e34491bfd01 | 61 | } |
azerty000 | 1:7e34491bfd01 | 62 | } |
azerty000 | 1:7e34491bfd01 | 63 | |
azerty000 | 1:7e34491bfd01 | 64 | //Orange |
azerty000 | 1:7e34491bfd01 | 65 | void drawImage_orange(int offsetX, int offsetY) |
azerty000 | 1:7e34491bfd01 | 66 | { |
azerty000 | 1:7e34491bfd01 | 67 | int x = 0; |
azerty000 | 1:7e34491bfd01 | 68 | int y = 0; |
azerty000 | 1:7e34491bfd01 | 69 | uint32_t* dataPtr = (uint32_t*)orange.data; |
azerty000 | 1:7e34491bfd01 | 70 | while(y < orange.height) |
azerty000 | 1:7e34491bfd01 | 71 | { |
azerty000 | 1:7e34491bfd01 | 72 | while(x < orange.width) |
azerty000 | 1:7e34491bfd01 | 73 | { |
azerty000 | 1:7e34491bfd01 | 74 | BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr); |
azerty000 | 1:7e34491bfd01 | 75 | dataPtr++; |
azerty000 | 1:7e34491bfd01 | 76 | x++; |
azerty000 | 1:7e34491bfd01 | 77 | } |
azerty000 | 1:7e34491bfd01 | 78 | x = 0; |
azerty000 | 1:7e34491bfd01 | 79 | y++; |
azerty000 | 1:7e34491bfd01 | 80 | } |
azerty000 | 1:7e34491bfd01 | 81 | } |
azerty000 | 1:7e34491bfd01 | 82 | |
azerty000 | 1:7e34491bfd01 | 83 | //Banane |
azerty000 | 1:7e34491bfd01 | 84 | void drawImage_banane(int offsetX, int offsetY) |
azerty000 | 1:7e34491bfd01 | 85 | { |
azerty000 | 1:7e34491bfd01 | 86 | int x = 0; |
azerty000 | 1:7e34491bfd01 | 87 | int y = 0; |
azerty000 | 1:7e34491bfd01 | 88 | uint32_t* dataPtr = (uint32_t*)banane.data; |
azerty000 | 1:7e34491bfd01 | 89 | while(y < banane.height) |
azerty000 | 1:7e34491bfd01 | 90 | { |
azerty000 | 1:7e34491bfd01 | 91 | while(x < banane.width) |
azerty000 | 1:7e34491bfd01 | 92 | { |
azerty000 | 1:7e34491bfd01 | 93 | BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr); |
azerty000 | 1:7e34491bfd01 | 94 | dataPtr++; |
azerty000 | 1:7e34491bfd01 | 95 | x++; |
azerty000 | 1:7e34491bfd01 | 96 | } |
azerty000 | 1:7e34491bfd01 | 97 | x = 0; |
azerty000 | 1:7e34491bfd01 | 98 | y++; |
azerty000 | 1:7e34491bfd01 | 99 | } |
azerty000 | 1:7e34491bfd01 | 100 | } |
azerty000 | 1:7e34491bfd01 | 101 | |
azerty000 | 1:7e34491bfd01 | 102 | //Tomate |
azerty000 | 1:7e34491bfd01 | 103 | void drawImage_tomate(int offsetX, int offsetY) |
azerty000 | 1:7e34491bfd01 | 104 | { |
azerty000 | 1:7e34491bfd01 | 105 | int x = 0; |
azerty000 | 1:7e34491bfd01 | 106 | int y = 0; |
azerty000 | 1:7e34491bfd01 | 107 | uint32_t* dataPtr = (uint32_t*)tomate.data; |
azerty000 | 1:7e34491bfd01 | 108 | while(y < tomate.height) |
azerty000 | 1:7e34491bfd01 | 109 | { |
azerty000 | 1:7e34491bfd01 | 110 | while(x < tomate.width) |
azerty000 | 1:7e34491bfd01 | 111 | { |
azerty000 | 1:7e34491bfd01 | 112 | BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr); |
azerty000 | 1:7e34491bfd01 | 113 | dataPtr++; |
azerty000 | 1:7e34491bfd01 | 114 | x++; |
azerty000 | 1:7e34491bfd01 | 115 | } |
azerty000 | 1:7e34491bfd01 | 116 | x = 0; |
azerty000 | 1:7e34491bfd01 | 117 | y++; |
azerty000 | 1:7e34491bfd01 | 118 | } |
azerty000 | 1:7e34491bfd01 | 119 | } |
azerty000 | 1:7e34491bfd01 | 120 | |
azerty000 | 1:7e34491bfd01 | 121 | //Fraise |
azerty000 | 1:7e34491bfd01 | 122 | void drawImage_fraise(int offsetX, int offsetY) |
azerty000 | 1:7e34491bfd01 | 123 | { |
azerty000 | 1:7e34491bfd01 | 124 | int x = 0; |
azerty000 | 1:7e34491bfd01 | 125 | int y = 0; |
azerty000 | 1:7e34491bfd01 | 126 | uint32_t* dataPtr = (uint32_t*)fraise.data; |
azerty000 | 1:7e34491bfd01 | 127 | while(y < fraise.height) |
azerty000 | 1:7e34491bfd01 | 128 | { |
azerty000 | 1:7e34491bfd01 | 129 | while(x < fraise.width) |
azerty000 | 1:7e34491bfd01 | 130 | { |
azerty000 | 1:7e34491bfd01 | 131 | BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr); |
azerty000 | 1:7e34491bfd01 | 132 | dataPtr++; |
azerty000 | 1:7e34491bfd01 | 133 | x++; |
azerty000 | 1:7e34491bfd01 | 134 | } |
azerty000 | 1:7e34491bfd01 | 135 | x = 0; |
azerty000 | 1:7e34491bfd01 | 136 | y++; |
azerty000 | 1:7e34491bfd01 | 137 | } |
azerty000 | 1:7e34491bfd01 | 138 | } |
azerty000 | 1:7e34491bfd01 | 139 | |
azerty000 | 1:7e34491bfd01 | 140 | //Raisin |
azerty000 | 1:7e34491bfd01 | 141 | void drawImage_raisin(int offsetX, int offsetY) |
azerty000 | 1:7e34491bfd01 | 142 | { |
azerty000 | 1:7e34491bfd01 | 143 | int x = 0; |
azerty000 | 1:7e34491bfd01 | 144 | int y = 0; |
azerty000 | 1:7e34491bfd01 | 145 | uint32_t* dataPtr = (uint32_t*)raisin.data; |
azerty000 | 1:7e34491bfd01 | 146 | while(y < raisin.height) |
azerty000 | 1:7e34491bfd01 | 147 | { |
azerty000 | 1:7e34491bfd01 | 148 | while(x < raisin.width) |
azerty000 | 1:7e34491bfd01 | 149 | { |
azerty000 | 1:7e34491bfd01 | 150 | BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr); |
azerty000 | 1:7e34491bfd01 | 151 | dataPtr++; |
azerty000 | 1:7e34491bfd01 | 152 | x++; |
azerty000 | 1:7e34491bfd01 | 153 | } |
azerty000 | 1:7e34491bfd01 | 154 | x = 0; |
azerty000 | 1:7e34491bfd01 | 155 | y++; |
azerty000 | 1:7e34491bfd01 | 156 | } |
azerty000 | 1:7e34491bfd01 | 157 | } |
azerty000 | 1:7e34491bfd01 | 158 | |
azerty000 | 1:7e34491bfd01 | 159 | //Kiwi |
azerty000 | 1:7e34491bfd01 | 160 | void drawImage_kiwi(int offsetX, int offsetY) |
azerty000 | 1:7e34491bfd01 | 161 | { |
azerty000 | 1:7e34491bfd01 | 162 | int x = 0; |
azerty000 | 1:7e34491bfd01 | 163 | int y = 0; |
azerty000 | 1:7e34491bfd01 | 164 | uint32_t* dataPtr = (uint32_t*)kiwi.data; |
azerty000 | 1:7e34491bfd01 | 165 | while(y < kiwi.height) |
azerty000 | 1:7e34491bfd01 | 166 | { |
azerty000 | 1:7e34491bfd01 | 167 | while(x < kiwi.width) |
azerty000 | 1:7e34491bfd01 | 168 | { |
azerty000 | 1:7e34491bfd01 | 169 | BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr); |
azerty000 | 1:7e34491bfd01 | 170 | dataPtr++; |
azerty000 | 1:7e34491bfd01 | 171 | x++; |
azerty000 | 1:7e34491bfd01 | 172 | } |
azerty000 | 1:7e34491bfd01 | 173 | x = 0; |
azerty000 | 1:7e34491bfd01 | 174 | y++; |
azerty000 | 1:7e34491bfd01 | 175 | } |
azerty000 | 1:7e34491bfd01 | 176 | } |
azerty000 | 1:7e34491bfd01 | 177 | |
azerty000 | 1:7e34491bfd01 | 178 | //Haricot |
azerty000 | 1:7e34491bfd01 | 179 | void drawImage_haricot(int offsetX, int offsetY) |
azerty000 | 1:7e34491bfd01 | 180 | { |
azerty000 | 1:7e34491bfd01 | 181 | int x = 0; |
azerty000 | 1:7e34491bfd01 | 182 | int y = 0; |
azerty000 | 1:7e34491bfd01 | 183 | uint32_t* dataPtr = (uint32_t*)haricot.data; |
azerty000 | 1:7e34491bfd01 | 184 | while(y < haricot.height) |
azerty000 | 1:7e34491bfd01 | 185 | { |
azerty000 | 1:7e34491bfd01 | 186 | while(x < haricot.width) |
azerty000 | 1:7e34491bfd01 | 187 | { |
azerty000 | 1:7e34491bfd01 | 188 | BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr); |
azerty000 | 1:7e34491bfd01 | 189 | dataPtr++; |
azerty000 | 1:7e34491bfd01 | 190 | x++; |
azerty000 | 1:7e34491bfd01 | 191 | } |
azerty000 | 1:7e34491bfd01 | 192 | x = 0; |
azerty000 | 1:7e34491bfd01 | 193 | y++; |
azerty000 | 1:7e34491bfd01 | 194 | } |
azerty000 | 1:7e34491bfd01 | 195 | } |
azerty000 | 1:7e34491bfd01 | 196 | |
azerty000 | 1:7e34491bfd01 | 197 | |
azerty000 | 1:7e34491bfd01 | 198 | |
azerty000 | 1:7e34491bfd01 | 199 | |
azerty000 | 1:7e34491bfd01 | 200 | |
azerty000 | 1:7e34491bfd01 | 201 | |
azerty000 | 1:7e34491bfd01 | 202 | |
azerty000 | 1:7e34491bfd01 | 203 | |
azerty000 | 1:7e34491bfd01 | 204 | |
azerty000 | 1:7e34491bfd01 | 205 | |
azerty000 | 1:7e34491bfd01 | 206 | |
darkseb | 0:735dae6ecacf | 207 | int main() |
darkseb | 0:735dae6ecacf | 208 | { |
darkseb | 0:735dae6ecacf | 209 | unsigned int boutton_commande = 0; |
darkseb | 0:735dae6ecacf | 210 | unsigned int boutton_retour = 0; |
darkseb | 0:735dae6ecacf | 211 | unsigned int boutton_scanner = 0; |
darkseb | 0:735dae6ecacf | 212 | unsigned int boutton_panier = 0; |
darkseb | 0:735dae6ecacf | 213 | unsigned int boutton_acceuil = 0; |
darkseb | 0:735dae6ecacf | 214 | unsigned int boutton_valider = 0; |
darkseb | 0:735dae6ecacf | 215 | |
darkseb | 0:735dae6ecacf | 216 | BSP_LCD_Init(); |
darkseb | 0:735dae6ecacf | 217 | BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FB_START_ADDRESS); |
darkseb | 0:735dae6ecacf | 218 | BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER); |
darkseb | 0:735dae6ecacf | 219 | |
darkseb | 0:735dae6ecacf | 220 | while(1) |
azerty000 | 1:7e34491bfd01 | 221 | { |
azerty000 | 1:7e34491bfd01 | 222 | //Ecran d'acceuil |
darkseb | 0:735dae6ecacf | 223 | BSP_LCD_Clear(LCD_COLOR_WHITE); |
darkseb | 0:735dae6ecacf | 224 | BSP_LCD_SetFont(&LCD_DEFAULT_FONT); |
darkseb | 0:735dae6ecacf | 225 | BSP_LCD_SetBackColor(LCD_COLOR_ORANGE); |
darkseb | 0:735dae6ecacf | 226 | BSP_LCD_SetTextColor(LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 227 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 228 | |
darkseb | 0:735dae6ecacf | 229 | BSP_LCD_DisplayStringAt(0, 70, (uint8_t *)"BIENVENUE SUR CEL", CENTER_MODE); |
darkseb | 0:735dae6ecacf | 230 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 231 | |
darkseb | 0:735dae6ecacf | 232 | //Bouton faire une commande |
darkseb | 0:735dae6ecacf | 233 | Button commande(lcd_, ts_, 88, 160, 300, 50, |
darkseb | 0:735dae6ecacf | 234 | LCD_COLOR_BLUE, LCD_COLOR_BLACK, "Faire une commande", Font20); |
darkseb | 0:735dae6ecacf | 235 | commande.Draw(LCD_COLOR_GRAY, LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 236 | |
darkseb | 0:735dae6ecacf | 237 | while(boutton_commande == 0) |
darkseb | 0:735dae6ecacf | 238 | { |
darkseb | 0:735dae6ecacf | 239 | if(commande.Touched()) |
darkseb | 0:735dae6ecacf | 240 | { |
darkseb | 0:735dae6ecacf | 241 | boutton_commande = 1; |
darkseb | 0:735dae6ecacf | 242 | } |
darkseb | 0:735dae6ecacf | 243 | } |
darkseb | 0:735dae6ecacf | 244 | boutton_commande = 0; |
darkseb | 0:735dae6ecacf | 245 | |
darkseb | 0:735dae6ecacf | 246 | |
darkseb | 0:735dae6ecacf | 247 | //Ecran produits |
darkseb | 0:735dae6ecacf | 248 | BSP_LCD_Clear(LCD_COLOR_WHITE); |
darkseb | 0:735dae6ecacf | 249 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 250 | |
azerty000 | 1:7e34491bfd01 | 251 | drawImage_pomme (0,70) ; |
azerty000 | 1:7e34491bfd01 | 252 | drawImage_poire (0,130) ; |
azerty000 | 1:7e34491bfd01 | 253 | drawImage_orange (0,200) ; |
azerty000 | 1:7e34491bfd01 | 254 | drawImage_banane (155,65) ; |
azerty000 | 1:7e34491bfd01 | 255 | drawImage_tomate (155,130) ; |
azerty000 | 1:7e34491bfd01 | 256 | drawImage_fraise (155,200) ; |
azerty000 | 1:7e34491bfd01 | 257 | drawImage_raisin (310,65) ; |
azerty000 | 1:7e34491bfd01 | 258 | drawImage_kiwi (317,138) ; |
azerty000 | 1:7e34491bfd01 | 259 | drawImage_haricot (310,200) ; |
azerty000 | 1:7e34491bfd01 | 260 | |
darkseb | 0:735dae6ecacf | 261 | //Bouton retour |
darkseb | 0:735dae6ecacf | 262 | Button retour(lcd_, ts_, 10, 5, 60, 40, |
darkseb | 0:735dae6ecacf | 263 | LCD_COLOR_BLUE, LCD_COLOR_BLACK, "Retour", Font12); |
darkseb | 0:735dae6ecacf | 264 | retour.Draw(LCD_COLOR_GRAY, LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 265 | |
darkseb | 0:735dae6ecacf | 266 | //Bouton scanner |
darkseb | 0:735dae6ecacf | 267 | Button scanner(lcd_, ts_, 200, 5, 60, 40, |
darkseb | 0:735dae6ecacf | 268 | LCD_COLOR_BLUE, LCD_COLOR_BLACK, "Scanner", Font12); |
darkseb | 0:735dae6ecacf | 269 | scanner.Draw(LCD_COLOR_GRAY, LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 270 | |
darkseb | 0:735dae6ecacf | 271 | //Bouton panier |
darkseb | 0:735dae6ecacf | 272 | Button panier(lcd_, ts_, 410, 5, 60, 40, |
darkseb | 0:735dae6ecacf | 273 | LCD_COLOR_BLUE, LCD_COLOR_BLACK, "Panier", Font12); |
darkseb | 0:735dae6ecacf | 274 | panier.Draw(LCD_COLOR_GRAY, LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 275 | |
darkseb | 0:735dae6ecacf | 276 | while(boutton_retour == 0 && boutton_scanner == 0 && boutton_panier == 0) |
darkseb | 0:735dae6ecacf | 277 | { |
darkseb | 0:735dae6ecacf | 278 | if(retour.Touched()) |
darkseb | 0:735dae6ecacf | 279 | { |
darkseb | 0:735dae6ecacf | 280 | boutton_retour = 1; |
darkseb | 0:735dae6ecacf | 281 | } |
darkseb | 0:735dae6ecacf | 282 | |
darkseb | 0:735dae6ecacf | 283 | else if(scanner.Touched()) |
darkseb | 0:735dae6ecacf | 284 | { |
darkseb | 0:735dae6ecacf | 285 | boutton_scanner = 1; |
darkseb | 0:735dae6ecacf | 286 | |
darkseb | 0:735dae6ecacf | 287 | //Ecran scanner |
darkseb | 0:735dae6ecacf | 288 | BSP_LCD_Clear(LCD_COLOR_WHITE); |
darkseb | 0:735dae6ecacf | 289 | BSP_LCD_SetFont(&Font20); |
darkseb | 0:735dae6ecacf | 290 | BSP_LCD_SetBackColor(LCD_COLOR_ORANGE); |
darkseb | 0:735dae6ecacf | 291 | BSP_LCD_SetTextColor(LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 292 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 293 | |
darkseb | 0:735dae6ecacf | 294 | BSP_LCD_DisplayStringAt(0, 40, (uint8_t *)"Scanner le code barre", CENTER_MODE); |
darkseb | 0:735dae6ecacf | 295 | BSP_LCD_DisplayStringAt(0, 60, (uint8_t *)"du produit", CENTER_MODE); |
darkseb | 0:735dae6ecacf | 296 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 297 | |
darkseb | 0:735dae6ecacf | 298 | BSP_LCD_SetBackColor(LCD_COLOR_RED); |
darkseb | 0:735dae6ecacf | 299 | BSP_LCD_DisplayStringAt(0, 100, (uint8_t *)"Le produit est :", CENTER_MODE); |
darkseb | 0:735dae6ecacf | 300 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 301 | |
darkseb | 0:735dae6ecacf | 302 | //Bouton retour vers la page d'acceuil |
darkseb | 0:735dae6ecacf | 303 | Button acceuil(lcd_, ts_, 68, 215, 350, 40, |
darkseb | 0:735dae6ecacf | 304 | LCD_COLOR_BLUE, LCD_COLOR_BLACK, "Retour vers la page d'acceuil", Font16); |
darkseb | 0:735dae6ecacf | 305 | acceuil.Draw(LCD_COLOR_GRAY, LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 306 | |
darkseb | 0:735dae6ecacf | 307 | while(boutton_acceuil == 0) |
darkseb | 0:735dae6ecacf | 308 | { |
darkseb | 0:735dae6ecacf | 309 | if(acceuil.Touched()) |
darkseb | 0:735dae6ecacf | 310 | { |
darkseb | 0:735dae6ecacf | 311 | boutton_acceuil = 1; |
darkseb | 0:735dae6ecacf | 312 | } |
darkseb | 0:735dae6ecacf | 313 | } |
darkseb | 0:735dae6ecacf | 314 | boutton_acceuil = 0; |
darkseb | 0:735dae6ecacf | 315 | } |
darkseb | 0:735dae6ecacf | 316 | |
darkseb | 0:735dae6ecacf | 317 | else if(panier.Touched()) |
darkseb | 0:735dae6ecacf | 318 | { |
darkseb | 0:735dae6ecacf | 319 | boutton_panier = 1; |
darkseb | 0:735dae6ecacf | 320 | |
darkseb | 0:735dae6ecacf | 321 | //Ecran panier |
darkseb | 0:735dae6ecacf | 322 | BSP_LCD_Clear(LCD_COLOR_WHITE); |
darkseb | 0:735dae6ecacf | 323 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 324 | |
darkseb | 0:735dae6ecacf | 325 | //Bouton valider la commande |
darkseb | 0:735dae6ecacf | 326 | Button valider(lcd_, ts_, 88, 215, 300, 40, |
darkseb | 0:735dae6ecacf | 327 | LCD_COLOR_BLUE, LCD_COLOR_BLACK, "Valider la commande", Font16); |
darkseb | 0:735dae6ecacf | 328 | valider.Draw(LCD_COLOR_GRAY, LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 329 | |
darkseb | 0:735dae6ecacf | 330 | while(boutton_valider == 0) |
darkseb | 0:735dae6ecacf | 331 | { |
darkseb | 0:735dae6ecacf | 332 | if(valider.Touched()) |
darkseb | 0:735dae6ecacf | 333 | { |
darkseb | 0:735dae6ecacf | 334 | boutton_valider = 1; |
darkseb | 0:735dae6ecacf | 335 | } |
darkseb | 0:735dae6ecacf | 336 | } |
darkseb | 0:735dae6ecacf | 337 | boutton_valider = 0; |
darkseb | 0:735dae6ecacf | 338 | |
darkseb | 0:735dae6ecacf | 339 | |
darkseb | 0:735dae6ecacf | 340 | //Ecran prix total |
darkseb | 0:735dae6ecacf | 341 | BSP_LCD_Clear(LCD_COLOR_WHITE); |
darkseb | 0:735dae6ecacf | 342 | BSP_LCD_SetFont(&LCD_DEFAULT_FONT); |
darkseb | 0:735dae6ecacf | 343 | BSP_LCD_SetBackColor(LCD_COLOR_ORANGE); |
darkseb | 0:735dae6ecacf | 344 | BSP_LCD_SetTextColor(LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 345 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 346 | |
darkseb | 0:735dae6ecacf | 347 | BSP_LCD_DisplayStringAt(0, 70, (uint8_t *)"Prix total", CENTER_MODE); |
darkseb | 0:735dae6ecacf | 348 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 349 | |
darkseb | 0:735dae6ecacf | 350 | BSP_LCD_SetFont(&Font20); |
darkseb | 0:735dae6ecacf | 351 | BSP_LCD_SetBackColor(LCD_COLOR_RED); |
darkseb | 0:735dae6ecacf | 352 | BSP_LCD_DisplayStringAt(0, 120, (uint8_t *)"100,00 Euros", CENTER_MODE); |
darkseb | 0:735dae6ecacf | 353 | HAL_Delay(1000); |
darkseb | 0:735dae6ecacf | 354 | |
darkseb | 0:735dae6ecacf | 355 | //Bouton retour vers la page d'acceuil |
darkseb | 0:735dae6ecacf | 356 | Button acceuil(lcd_, ts_, 68, 215, 350, 40, |
darkseb | 0:735dae6ecacf | 357 | LCD_COLOR_BLUE, LCD_COLOR_BLACK, "Retour vers la page d'acceuil", Font16); |
darkseb | 0:735dae6ecacf | 358 | acceuil.Draw(LCD_COLOR_GRAY, LCD_COLOR_BLACK); |
darkseb | 0:735dae6ecacf | 359 | |
darkseb | 0:735dae6ecacf | 360 | while(boutton_acceuil == 0) |
darkseb | 0:735dae6ecacf | 361 | { |
darkseb | 0:735dae6ecacf | 362 | if(acceuil.Touched()) |
darkseb | 0:735dae6ecacf | 363 | { |
darkseb | 0:735dae6ecacf | 364 | boutton_acceuil = 1; |
darkseb | 0:735dae6ecacf | 365 | } |
darkseb | 0:735dae6ecacf | 366 | } |
darkseb | 0:735dae6ecacf | 367 | boutton_acceuil = 0; |
darkseb | 0:735dae6ecacf | 368 | } |
darkseb | 0:735dae6ecacf | 369 | } |
darkseb | 0:735dae6ecacf | 370 | boutton_retour = 0; |
darkseb | 0:735dae6ecacf | 371 | boutton_scanner = 0; |
darkseb | 0:735dae6ecacf | 372 | boutton_panier = 0; |
darkseb | 0:735dae6ecacf | 373 | } |
darkseb | 0:735dae6ecacf | 374 | } |