test
Dependencies: ad5422_arduino mbed LT1446 ADS1248-1 LM35-1 Flash FT813 PGA280_ADS1259
TFT/display.Draw_ChromeTest.cpp@7:c364201bc3ed, 2020-09-01 (annotated)
- Committer:
- nikmaos
- Date:
- Tue Sep 01 10:52:34 2020 +0000
- Revision:
- 7:c364201bc3ed
- Parent:
- 3:d4b106bf3a32
1.09.2020;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nikmaos | 3:d4b106bf3a32 | 1 | #include "display.h" |
nikmaos | 3:d4b106bf3a32 | 2 | void Display::ChromTest(float temp,float ras,int temp_u,float ras_u) |
nikmaos | 3:d4b106bf3a32 | 3 | { |
nikmaos | 3:d4b106bf3a32 | 4 | StartDL(); |
nikmaos | 3:d4b106bf3a32 | 5 | //"Parameters" |
nikmaos | 3:d4b106bf3a32 | 6 | (*_TFT).DL(CLEAR_COLOR_RGB(255, 255, 255)); |
nikmaos | 3:d4b106bf3a32 | 7 | (*_TFT).DL(CLEAR(1, 1, 1)); |
nikmaos | 7:c364201bc3ed | 8 | (*_TFT).DL(COLOR_RGB(0, 0, 0)); |
nikmaos | 7:c364201bc3ed | 9 | (*_TFT).Text(287, 0 , 31, 0, "Parameters"); |
nikmaos | 7:c364201bc3ed | 10 | |
nikmaos | 3:d4b106bf3a32 | 11 | //кнопка "текущая температура" |
nikmaos | 3:d4b106bf3a32 | 12 | (*_TFT).DL(TAG_MASK(1));//пометки что это изменено относительно генератора кода |
nikmaos | 3:d4b106bf3a32 | 13 | (*_TFT).DL(TAG(CHROM_TEMP_PRESS));// |
nikmaos | 3:d4b106bf3a32 | 14 | (*_TFT).DL(COLOR_RGB(255, 85, 0)); |
nikmaos | 3:d4b106bf3a32 | 15 | if (pressedButton == CHROM_TEMP_PRESS) {// |
nikmaos | 3:d4b106bf3a32 | 16 | (*_TFT).DL(COLOR_RGB(75, 70, 108)); |
nikmaos | 3:d4b106bf3a32 | 17 | }// |
nikmaos | 3:d4b106bf3a32 | 18 | (*_TFT).DL(BEGIN(RECTS)); |
nikmaos | 3:d4b106bf3a32 | 19 | (*_TFT).DL(VERTEX2II(5, 245, 0, 0)); |
nikmaos | 3:d4b106bf3a32 | 20 | (*_TFT).DL(VERTEX2II(395, 295, 0, 0)); |
nikmaos | 3:d4b106bf3a32 | 21 | (*_TFT).DL(END()); |
nikmaos | 3:d4b106bf3a32 | 22 | // |
nikmaos | 3:d4b106bf3a32 | 23 | (*_TFT).DL(COLOR_RGB(0, 0, 0)); |
nikmaos | 7:c364201bc3ed | 24 | (*_TFT).Text(16, 263 , 27, 0, "TempKol Current:"); |
nikmaos | 3:d4b106bf3a32 | 25 | (*_TFT).DL(TAG_MASK(0));//конец обработки нажатия кнопки |
nikmaos | 3:d4b106bf3a32 | 26 | // |
nikmaos | 7:c364201bc3ed | 27 | (*_TFT).DL(COLOR_RGB(0, 0, 0)); |
nikmaos | 3:d4b106bf3a32 | 28 | char str[5]={0}; |
nikmaos | 7:c364201bc3ed | 29 | sprintf(str,"%2.2f",temp); |
nikmaos | 7:c364201bc3ed | 30 | (*_TFT).Text(150, 263 , 27, 0, str); |
nikmaos | 7:c364201bc3ed | 31 | (*_TFT).Text(189, 260 , 27, 0, "o"); |
nikmaos | 7:c364201bc3ed | 32 | (*_TFT).Text(197, 263 , 27, 0, "C / SET: "); |
nikmaos | 3:d4b106bf3a32 | 33 | sprintf(str,"%02d",temp_u); |
nikmaos | 7:c364201bc3ed | 34 | (*_TFT).Text(264, 263 , 27, 0, str); |
nikmaos | 7:c364201bc3ed | 35 | (*_TFT).Text(264+20, 260 , 27, 0, "o"); |
nikmaos | 7:c364201bc3ed | 36 | (*_TFT).Text(292, 263 , 27, 0, "C"); |
nikmaos | 3:d4b106bf3a32 | 37 | //"Set Tempkol" |
nikmaos | 3:d4b106bf3a32 | 38 | (*_TFT).DL(TAG_MASK(1));//пометки что это изменено относительно генератора кода |
nikmaos | 3:d4b106bf3a32 | 39 | (*_TFT).DL(TAG(CHROM_SET_TEMP_PRESS));// |
nikmaos | 3:d4b106bf3a32 | 40 | (*_TFT).DL(COLOR_RGB(255, 255, 255)); |
nikmaos | 7:c364201bc3ed | 41 | if(pressedButton == CHROM_SET_TEMP_PRESS) |
nikmaos | 7:c364201bc3ed | 42 | (*_TFT).Button(405, 245, 390, 50, 27, OPT_FLAT, "Set TempKol"); |
nikmaos | 7:c364201bc3ed | 43 | else |
nikmaos | 7:c364201bc3ed | 44 | (*_TFT).Button(405, 245, 390, 50, 27, 0, "Set TempKol"); |
nikmaos | 3:d4b106bf3a32 | 45 | (*_TFT).DL(TAG_MASK(0));//конец обработки нажатия кнопки |
nikmaos | 3:d4b106bf3a32 | 46 | // |
nikmaos | 3:d4b106bf3a32 | 47 | (*_TFT).DL(COLOR_RGB(85, 255, 127)); |
nikmaos | 3:d4b106bf3a32 | 48 | (*_TFT).DL(BEGIN(RECTS)); |
nikmaos | 3:d4b106bf3a32 | 49 | (*_TFT).DL(VERTEX2II(5, 305, 0, 0)); |
nikmaos | 3:d4b106bf3a32 | 50 | (*_TFT).DL(VERTEX2II(395, 355, 0, 0)); |
nikmaos | 3:d4b106bf3a32 | 51 | (*_TFT).DL(END()); |
nikmaos | 3:d4b106bf3a32 | 52 | // |
nikmaos | 3:d4b106bf3a32 | 53 | (*_TFT).DL(COLOR_RGB(0, 0, 0)); |
nikmaos | 7:c364201bc3ed | 54 | (*_TFT).Text(16, 324 , 27, 0, "Rashod Current:"); |
nikmaos | 7:c364201bc3ed | 55 | // |
nikmaos | 3:d4b106bf3a32 | 56 | sprintf(str,"%2.2f",ras);// |
nikmaos | 7:c364201bc3ed | 57 | (*_TFT).Text(145, 324 , 27, 0, str); |
nikmaos | 7:c364201bc3ed | 58 | (*_TFT).Text(176+3, 324 , 27, 0, "cm"); |
nikmaos | 7:c364201bc3ed | 59 | (*_TFT).Text(192+8, 321 , 27, 0, "3"); |
nikmaos | 7:c364201bc3ed | 60 | (*_TFT).Text(200+8, 324 , 27, 0, "/min | SET: "); |
nikmaos | 3:d4b106bf3a32 | 61 | sprintf(str,"%2.2f",ras_u); |
nikmaos | 7:c364201bc3ed | 62 | (*_TFT).Text(290, 324 , 27, 0, str); |
nikmaos | 7:c364201bc3ed | 63 | (*_TFT).Text(321+3, 324 , 27, 0, "cm"); |
nikmaos | 7:c364201bc3ed | 64 | (*_TFT).Text(336+8, 321 , 27, 0, "3"); |
nikmaos | 7:c364201bc3ed | 65 | (*_TFT).Text(344+8, 324 , 27, 0, "/min"); |
nikmaos | 3:d4b106bf3a32 | 66 | //установить расход |
nikmaos | 3:d4b106bf3a32 | 67 | (*_TFT).DL(TAG_MASK(1));//пометки что это изменено относительно генератора кода |
nikmaos | 3:d4b106bf3a32 | 68 | (*_TFT).DL(TAG(CHROM_SET_RASHOD_PRESS));// |
nikmaos | 3:d4b106bf3a32 | 69 | (*_TFT).DL(COLOR_RGB(255, 255, 255)); |
nikmaos | 7:c364201bc3ed | 70 | if(pressedButton == CHROM_SET_RASHOD_PRESS) |
nikmaos | 7:c364201bc3ed | 71 | (*_TFT).Button(405, 305, 390, 50, 27, OPT_FLAT, "Set Rashod"); |
nikmaos | 7:c364201bc3ed | 72 | //activeScreen=} |
nikmaos | 7:c364201bc3ed | 73 | else |
nikmaos | 7:c364201bc3ed | 74 | (*_TFT).Button(405, 305, 390, 50, 27, 0, "Set Rashod"); |
nikmaos | 3:d4b106bf3a32 | 75 | (*_TFT).DL(TAG_MASK(0));//конец обработки нажатия кнопки |
nikmaos | 3:d4b106bf3a32 | 76 | //тут не кнопка а отображалка сигнал сенсора |
nikmaos | 3:d4b106bf3a32 | 77 | (*_TFT).DL(COLOR_RGB(85, 255, 127)); |
nikmaos | 3:d4b106bf3a32 | 78 | (*_TFT).DL(BEGIN(RECTS)); |
nikmaos | 3:d4b106bf3a32 | 79 | (*_TFT).DL(VERTEX2II(5, 365, 0, 0)); |
nikmaos | 3:d4b106bf3a32 | 80 | (*_TFT).DL(VERTEX2II(395, 415, 0, 0)); |
nikmaos | 3:d4b106bf3a32 | 81 | (*_TFT).DL(END()); |
nikmaos | 3:d4b106bf3a32 | 82 | // |
nikmaos | 7:c364201bc3ed | 83 | (*_TFT).DL(COLOR_RGB(0, 0, 0)); |
nikmaos | 7:c364201bc3ed | 84 | (*_TFT).Text(20, 383 , 27, 0, "SensorSignal: 0042 / SensorGane: 001"); |
nikmaos | 3:d4b106bf3a32 | 85 | //Set sensor gane |
nikmaos | 3:d4b106bf3a32 | 86 | (*_TFT).DL(TAG_MASK(1));//пометки что это изменено относительно генератора кода |
nikmaos | 3:d4b106bf3a32 | 87 | (*_TFT).DL(TAG(CHROM_SET_SENSGAIN_PRESS));// |
nikmaos | 3:d4b106bf3a32 | 88 | (*_TFT).DL(COLOR_RGB(255, 255, 255)); |
nikmaos | 7:c364201bc3ed | 89 | if(pressedButton == CHROM_SET_SENSGAIN_PRESS) |
nikmaos | 7:c364201bc3ed | 90 | (*_TFT).Button(405, 365, 390, 50, 27, OPT_FLAT, "Set SensorGane"); |
nikmaos | 7:c364201bc3ed | 91 | else |
nikmaos | 7:c364201bc3ed | 92 | (*_TFT).Button(405, 365, 390, 50, 27, 0, "Set SensorGane"); |
nikmaos | 7:c364201bc3ed | 93 | (*_TFT).DL(TAG_MASK(0));//конец обработки нажатия кнопки |
nikmaos | 3:d4b106bf3a32 | 94 | // |
nikmaos | 7:c364201bc3ed | 95 | |
nikmaos | 3:d4b106bf3a32 | 96 | //Пробоотбор |
nikmaos | 3:d4b106bf3a32 | 97 | (*_TFT).DL(TAG_MASK(1));//пометки что это изменено относительно генератора кода |
nikmaos | 3:d4b106bf3a32 | 98 | (*_TFT).DL(TAG(CHROM_PROBA_PRESS));// |
nikmaos | 3:d4b106bf3a32 | 99 | (*_TFT).DL(COLOR_RGB(255, 170, 0)); |
nikmaos | 7:c364201bc3ed | 100 | if(pressedButton == CHROM_PROBA_PRESS) |
nikmaos | 7:c364201bc3ed | 101 | (*_TFT).Button(5, 425, 390, 50, 27, OPT_FLAT, "Probootbor"); |
nikmaos | 7:c364201bc3ed | 102 | else |
nikmaos | 7:c364201bc3ed | 103 | (*_TFT).Button(5, 425, 390, 50, 27, 0, "Probootbor"); |
nikmaos | 3:d4b106bf3a32 | 104 | (*_TFT).DL(TAG_MASK(0));//конец обработки нажатия кнопки |
nikmaos | 3:d4b106bf3a32 | 105 | //Analiz |
nikmaos | 3:d4b106bf3a32 | 106 | (*_TFT).DL(TAG_MASK(1));//пометки что это изменено относительно генератора кода |
nikmaos | 3:d4b106bf3a32 | 107 | (*_TFT).DL(TAG(CHROM_ANALIZ_PRESS));// |
nikmaos | 3:d4b106bf3a32 | 108 | (*_TFT).DL(COLOR_RGB(85, 255, 0)); |
nikmaos | 7:c364201bc3ed | 109 | if(pressedButton == CHROM_ANALIZ_PRESS) |
nikmaos | 7:c364201bc3ed | 110 | (*_TFT).Button(405, 425, 390, 50, 27, OPT_FLAT, "Analiz"); |
nikmaos | 7:c364201bc3ed | 111 | else |
nikmaos | 7:c364201bc3ed | 112 | (*_TFT).Button(405, 425, 390, 50, 27, 0, "Analiz"); |
nikmaos | 7:c364201bc3ed | 113 | (*_TFT).DL(TAG_MASK(0));//конец обработки нажатия кнопки |
nikmaos | 7:c364201bc3ed | 114 | //Переход в настройки ПИД регулятора |
nikmaos | 7:c364201bc3ed | 115 | /*(*_TFT).DL(TAG_MASK(1)); |
nikmaos | 7:c364201bc3ed | 116 | (*_TFT).DL(TAG(PID_MENU_PRESS));*/ |
nikmaos | 7:c364201bc3ed | 117 | if(TouchX>405&&TouchY>185&&TouchX<(405+390)&&TouchY<(185+50)) |
nikmaos | 7:c364201bc3ed | 118 | pressedButton=PID_MENU_PRESS; |
nikmaos | 3:d4b106bf3a32 | 119 | (*_TFT).DL(COLOR_RGB(255, 255, 255)); |
nikmaos | 7:c364201bc3ed | 120 | if(pressedButton == PID_MENU_PRESS) |
nikmaos | 7:c364201bc3ed | 121 | (*_TFT).Button(405, 185, 390, 50, 27, OPT_FLAT, "PID Controller Menu"); |
nikmaos | 7:c364201bc3ed | 122 | else |
nikmaos | 7:c364201bc3ed | 123 | (*_TFT).Button(405, 185, 390, 50, 27, 0, "PID Controller Menu"); |
nikmaos | 7:c364201bc3ed | 124 | //(*_TFT).DL(TAG_MASK(0)); |
nikmaos | 7:c364201bc3ed | 125 | |
nikmaos | 3:d4b106bf3a32 | 126 | (*_TFT).DL(DISPLAY()); |
nikmaos | 7:c364201bc3ed | 127 | FinishDL(); |
nikmaos | 3:d4b106bf3a32 | 128 | } |