#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <HX711.h>
#include <EEPROM.h>
LiquidCrystal_I2C _lcd1(0x27, 20, 4);
int _dispTempLength1=0;
boolean _isNeedClearDisp1;
bool _FreeLog1_IArr[2];
bool _FreeLog1_Q1_StArr[] = {1, 1};
bool En_100557512_1;
int FreeRAM_100557512_1;
bool EN_33141984_2;
bool tare_33141984_2;
float scaleFactor_33141984_2;
byte readingsCount_33141984_2;
long weight_33141984_2;
HX711 scale_33141984_2;
bool EN_33141984_3;
bool tare_33141984_3;
float scaleFactor_33141984_3;
byte readingsCount_33141984_3;
long weight_33141984_3;
HX711 scale_33141984_3;
bool EN_33141984_4;
bool tare_33141984_4;
float scaleFactor_33141984_4;
byte readingsCount_33141984_4;
long weight_33141984_4;
HX711 scale_33141984_4;
struct _poligonInexes
{
int minIndex;
int maxIndex;
}
;
int _Poligon_InArray_1[2] = {0, 21000};
int _Poligon_OutArray_1[2] = {0, 50000};
int _Poligon_InArray_3[2] = {0, 21000};
int _Poligon_OutArray_3[2] = {0, 15000};
int _Poligon_InArray_2[2] = {0, 50};
int _Poligon_OutArray_2[2] = {0, 150};
const int _menuParametrsArray[] PROGMEM = {1, 0, 0, 9, 14, 0, 0, 0, 0, 0, 4, 0, 20, 17, 6, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 16, 29, 6, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 16, 17, 22, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 16, 17, 6, 18, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 17, 6, 2, 27, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 2, 10, 19, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 2, 10, 3, 21, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 10, 3, 5, 28, 9, 4, 5, 0, 0, 1, 0, 0, 1, 4, 13, 0, 30, 7, 14, 31, 10, 4, 2, 0, 0, 1, 0, 0, 1, 4, 7, 0, 23, 24, 14, 8, 11, 4, 6, 0, 0, 1, 0, 0, 1, 4, 14, 0, 13, 7, 32, 8, 12, 4, 3, 0, 0, 1, 0, 0, 1, 4, 8, 0, 13, 7, 14, 25, 13, 4, 1, 0, 0, 1, 0, 0, 1, 4, 1, 0, 7, 14, 8, 15, 14, 4, 4, 0, 0, 1, 0, 0, 1, 4, 9, 0, 14, 8, 1, 26};
int _menuValueArray_int[6];
const int _menuConstantValuesArray_int[] PROGMEM = {1};
const char _flprogMenuNameString1[] PROGMEM = "Otdilenya";
const char _flprogMenuNameString2[] PROGMEM = "Connected devace";
const char _flprogMenuNameString3[] PROGMEM = "System parameters";
const char _flprogMenuNameString4[] PROGMEM = "WellDATA";
const char _flprogMenuNameString5[] PROGMEM = "Setting";
const char _flprogMenuNameString6[] PROGMEM = "Archive copy";
const char _flprogMenuNameString7[] PROGMEM = "Kust";
const char _flprogMenuNameString8[] PROGMEM = "Dr TEAM N";
const char _flprogMenuNameString9[] PROGMEM = "Drill mashine";
const char _flprogMenuNameString10[] PROGMEM = "System status";
const char _flprogMenuNameString11[] PROGMEM = "88888";
const char _flprogMenuNameString12[] PROGMEM = "Works parameters";
const char _flprogMenuNameString13[] PROGMEM = "Well N";
const char _flprogMenuNameString14[] PROGMEM = "Ploschca";
const char _flprogMenuNameString15[] PROGMEM = "*Otdilenya";
const char _flprogMenuNameString16[] PROGMEM = "Welldata";
const char _flprogMenuNameString17[] PROGMEM = "Works parametrs";
const char _flprogMenuNameString18[] PROGMEM = "*Connected devace";
const char _flprogMenuNameString19[] PROGMEM = "*System parameters";
const char _flprogMenuNameString20[] PROGMEM = "*Welldata";
const char _flprogMenuNameString21[] PROGMEM = "*Setting";
const char _flprogMenuNameString22[] PROGMEM = "*Archive copy";
const char _flprogMenuNameString23[] PROGMEM = "Well";
const char _flprogMenuNameString24[] PROGMEM = "*Kust";
const char _flprogMenuNameString25[] PROGMEM = "*Dr TEAM";
const char _flprogMenuNameString26[] PROGMEM = "*Drill mashine";
const char _flprogMenuNameString27[] PROGMEM = "*System status";
const char _flprogMenuNameString28[] PROGMEM = "***8";
const char _flprogMenuNameString29[] PROGMEM = "*Works parametrs";
const char _flprogMenuNameString30[] PROGMEM = "*Well";
const char _flprogMenuNameString31[] PROGMEM = "Dr TEAM";
const char _flprogMenuNameString32[] PROGMEM = "*Ploschca";
const char* const _flprogMenuStringsArray[] PROGMEM = { _flprogMenuNameString1, _flprogMenuNameString2, _flprogMenuNameString3, _flprogMenuNameString4, _flprogMenuNameString5, _flprogMenuNameString6, _flprogMenuNameString7, _flprogMenuNameString8, _flprogMenuNameString9, _flprogMenuNameString10, _flprogMenuNameString11, _flprogMenuNameString12, _flprogMenuNameString13, _flprogMenuNameString14, _flprogMenuNameString15, _flprogMenuNameString16, _flprogMenuNameString17, _flprogMenuNameString18, _flprogMenuNameString19, _flprogMenuNameString20, _flprogMenuNameString21, _flprogMenuNameString22, _flprogMenuNameString23, _flprogMenuNameString24, _flprogMenuNameString25, _flprogMenuNameString26, _flprogMenuNameString27, _flprogMenuNameString28, _flprogMenuNameString29, _flprogMenuNameString30, _flprogMenuNameString31, _flprogMenuNameString32};
struct _menuItemStricture
{
int startInArrayIndex;
}
;
struct _menuMainStricture
{
String tempString;
int startIndex;
int stopIndex;
bool isSwitchMenuAroundRing;
_menuItemStricture currentItem;
}
;
_menuItemStricture _MenuItems[14];
_menuMainStricture _MainMenus[1];
bool _FreeLog1_Q1 = 0;
bool _bounse15S = 0;
bool _bounse15O = 0;
unsigned long _bounse15P = 0UL;
bool _SEEPR1OSN = 0;
bool _bounse21S = 0;
bool _bounse21O = 0;
unsigned long _bounse21P = 0UL;
String _swi2;
int _disp2oldLength = 0;
bool _k5 = 0;
bool _mkb1C1xP1 = 0;
bool _mkb1C1xP2 = 0;
bool _mkb1C1xP3 = 0;
bool _mkb1C1xP4 = 0;
bool _mkb1C2xP1 = 0;
bool _mkb1C2xP2 = 0;
bool _mkb1C2xP3 = 0;
bool _mkb1C2xP4 = 0;
bool _mkb1C3xP1 = 0;
bool _mkb1C3xP2 = 0;
bool _mkb1C3xP3 = 0;
bool _mkb1C3xP4 = 0;
bool _mkb1C4xP1 = 0;
bool _mkb1C4xP2 = 0;
bool _mkb1C4xP3 = 0;
bool _mkb1C4xP4 = 0;
bool _mkb1C5xP1 = 0;
bool _mkb1C5xP2 = 0;
bool _mkb1C5xP3 = 0;
bool _mkb1C5xP4 = 0;
bool _k1 = 0;
bool _bounse22S = 0;
bool _bounse22O = 0;
unsigned long _bounse22P = 0UL;
bool _gen1I = 0;
bool _gen1O = 0;
unsigned long _gen1P = 0UL;
bool _kgen1 = 0;
String _mux3;
bool _bounse2S = 0;
bool _bounse2O = 0;
unsigned long _bounse2P = 0UL;
bool _count2I = 0;
int _count2_Value = 0;
bool _bounse9S = 0;
bool _bounse9O = 0;
unsigned long _bounse9P = 0UL;
bool _bounse16S = 0;
bool _bounse16O = 0;
unsigned long _bounse16P = 0UL;
String _Terminal_48396036;
bool _bounseInput33S = 0;
bool _bounseInput33O = 0;
unsigned long _bounseInput33P = 0UL;
int _disp4oldLength = 0;
bool _bounse17S = 0;
bool _bounse17O = 0;
unsigned long _bounse17P = 0UL;
bool _bounse23S = 0;
bool _bounse23O = 0;
unsigned long _bounse23P = 0UL;
int _disp5oldLength = 0;
String _mux4;
float _Terminal_202794734;
bool _bounse3S = 0;
bool _bounse3O = 0;
unsigned long _bounse3P = 0UL;
bool _k2 = 0;
bool _bounse10S = 0;
bool _bounse10O = 0;
unsigned long _bounse10P = 0UL;
bool _bounse4S = 0;
bool _bounse4O = 0;
unsigned long _bounse4P = 0UL;
String _Terminal_38408886;
bool _bounse12S = 0;
bool _bounse12O = 0;
unsigned long _bounse12P = 0UL;
bool _bounse18S = 0;
bool _bounse18O = 0;
unsigned long _bounse18P = 0UL;
String _swi1;
int _disp1oldLength = 0;
bool _k3 = 0;
int _disp6oldLength = 0;
bool _k8 = 0;
String _Terminal_185247745;
int _disp7oldLength = 0;
bool _bounseInput30S = 0;
bool _bounseInput30O = 0;
unsigned long _bounseInput30P = 0UL;
bool _bounse6S = 0;
bool _bounse6O = 0;
unsigned long _bounse6P = 0UL;
bool _bounse13S = 0;
bool _bounse13O = 0;
unsigned long _bounse13P = 0UL;
bool _k4 = 0;
bool _bounse19S = 0;
bool _bounse19O = 0;
unsigned long _bounse19P = 0UL;
bool _tim1I = 0;
bool _tim1O = 0;
unsigned long _tim1P = 0UL;
bool _ktim1 = 0;
bool _bounse14S = 0;
bool _bounse14O = 0;
unsigned long _bounse14P = 0UL;
float _Terminal_20382769;
bool _bounse20S = 0;
bool _bounse20O = 0;
unsigned long _bounse20P = 0UL;
String _Terminal_106751009;
String _mux1;
bool _bounseInput32S = 0;
bool _bounseInput32O = 0;
unsigned long _bounseInput32P = 0UL;
bool _MenuBlock_222602257_AMO_241360251 = 0;
bool _MenuBlock_222602257_AMO_123216794 = 0;
bool _MenuBlock_222602257_AMO_84109339 = 0;
bool _MenuBlock_222602257_AMO_130541516 = 0;
bool _MenuBlock_222602257_AMO_154140248 = 0;
bool _MenuBlock_222602257_AMO_223201016 = 0;
bool _MenuBlock_222602257_AMO_211711800 = 0;
bool _MenuBlock_222602257_AMO_4428595 = 0;
String _MenuBlock_222602257_ASO_1;
String _MenuBlock_222602257_ASO_2;
String _MenuBlock_222602257_ASO_3;
String _MenuBlock_222602257_ASO_4;
String _MenuBlock_222602257_MNO;
String _MenuBlock_222602257_VNO;
bool _MenuBlock_222602257_OEIS = 0;
bool _MenuBlock_222602257_OMUIS = 0;
bool _MenuBlock_222602257_OMDIS = 0;
bool _MenuBlock_222602257_OEMIS = 0;
bool _MenuBlock_222602257_OExFMIS = 0;
bool _MenuBlock_222602257_OVUIS = 0;
bool _MenuBlock_222602257_OVDIS = 0;
bool _MenuBlock_222602257_IDI_0 = 0;
bool _MenuBlock_222602257_IDI_1 = 0;
bool _MenuBlock_222602257_IDI_2 = 0;
bool _MenuBlock_222602257_IDI_3 = 0;
bool _MenuBlock_222602257_IDI_4 = 0;
bool _MenuBlock_222602257_IDI_5 = 0;
bool _MenuBlock_222602257_IDI_6 = 0;
bool _MenuBlock_222602257_IDI_7 = 0;
bool _MenuBlock_222602257_IDI_8 = 0;
bool _MenuBlock_222602257_IDI_9 = 0;
bool _MenuBlock_222602257COMMAOIS = 0;
bool _MenuBlock_222602257MinusIOS = 0;
bool _MenuBlock_222602257_BackspaceIOS = 0;
bool _MenuBlock_222602257_AMMO = 0;
bool _bounse7S = 0;
bool _bounse7O = 0;
unsigned long _bounse7P = 0UL;
String _mux2;
bool _bounse8S = 0;
bool _bounse8O = 0;
unsigned long _bounse8P = 0UL;
bool _tempVariable_bool;
int _tempVariable_int;
void setup()
{
pinMode(33, INPUT_PULLUP);
pinMode(30, INPUT_PULLUP);
pinMode(32, INPUT_PULLUP);
Wire.begin();
delay(10);
if(((readByteFromEEPROM(0, 0, 0x0))) != 151)
{
(updateByteToEEPROM(0, 0, 0x0, (151)));
(updateIntegerToEEPROM(1, 0, 0x0, (222)));
(updateIntegerToEEPROM(3, 0, 0x0, (1)));
(updateIntegerToEEPROM(5, 0, 0x0, (3)));
(updateIntegerToEEPROM(7, 0, 0x0, (3000)));
(updateIntegerToEEPROM(9, 0, 0x0, (8)));
(updateIntegerToEEPROM(11, 0, 0x0, (110)));
}
_lcd1.init();
_lcd1.backlight();
_bounseInput33O = digitalRead(33);
_bounseInput30O = digitalRead(30);
_bounseInput32O = digitalRead(32);
pinMode(22, INPUT_PULLUP);
pinMode(24, INPUT_PULLUP);
pinMode(26, INPUT_PULLUP);
pinMode(28, INPUT_PULLUP);
pinMode(23, OUTPUT);
digitalWrite(23, HIGH);
pinMode(25, OUTPUT);
digitalWrite(25, HIGH);
pinMode(27, OUTPUT);
digitalWrite(27, HIGH);
pinMode(29, OUTPUT);
digitalWrite(29, HIGH);
pinMode(31, OUTPUT);
digitalWrite(31, HIGH);
scale_33141984_2.begin(48, 49);
scale_33141984_2.tare();
scale_33141984_3.begin(52, 53);
scale_33141984_3.tare();
scale_33141984_4.begin(50, 51);
scale_33141984_4.tare();
_MenuItems[0].startInArrayIndex = 0;
_MenuItems[1].startInArrayIndex = 16;
_MenuItems[2].startInArrayIndex = 32;
_MenuItems[3].startInArrayIndex = 48;
_MenuItems[4].startInArrayIndex = 64;
_MenuItems[5].startInArrayIndex = 80;
_MenuItems[6].startInArrayIndex = 96;
_MenuItems[7].startInArrayIndex = 112;
_MenuItems[8].startInArrayIndex = 128;
_MenuItems[9].startInArrayIndex = 144;
_MenuItems[10].startInArrayIndex = 160;
_MenuItems[11].startInArrayIndex = 176;
_MenuItems[12].startInArrayIndex = 192;
_MenuItems[13].startInArrayIndex = 208;
_MainMenus[0].tempString = "";
_MainMenus[0].startIndex = 1;
_MainMenus[0].isSwitchMenuAroundRing = 1;
_MainMenus[0].stopIndex = 8;
_MainMenus[0].currentItem = _MenuItems[0];
_menuValueArray_int[0] = (readIntegerFromEEPROM(1, 0, 0x0));
_menuValueArray_int[1] = (readIntegerFromEEPROM(3, 0, 0x0));
_menuValueArray_int[2] = (readIntegerFromEEPROM(5, 0, 0x0));
_menuValueArray_int[3] = (readIntegerFromEEPROM(7, 0, 0x0));
_menuValueArray_int[4] = (readIntegerFromEEPROM(9, 0, 0x0));
_menuValueArray_int[5] = (readIntegerFromEEPROM(11, 0, 0x0));
}
void loop()
{
if (_isNeedClearDisp1)
{
_lcd1.clear();
_isNeedClearDisp1= 0;
}
bool _bounceInputTmp33 = (digitalRead (33));
if (_bounseInput33S)
{
if (millis() >= (_bounseInput33P + 40))
{
_bounseInput33O= _bounceInputTmp33;
_bounseInput33S=0;
}
}
else
{
if (_bounceInputTmp33 != _bounseInput33O)
{
_bounseInput33S=1;
_bounseInput33P = millis();
}
}
bool _bounceInputTmp30 = (digitalRead (30));
if (_bounseInput30S)
{
if (millis() >= (_bounseInput30P + 40))
{
_bounseInput30O= _bounceInputTmp30;
_bounseInput30S=0;
}
}
else
{
if (_bounceInputTmp30 != _bounseInput30O)
{
_bounseInput30S=1;
_bounseInput30P = millis();
}
}
bool _bounceInputTmp32 = (digitalRead (32));
if (_bounseInput32S)
{
if (millis() >= (_bounseInput32P + 40))
{
_bounseInput32O= _bounceInputTmp32;
_bounseInput32S=0;
}
}
else
{
if (_bounceInputTmp32 != _bounseInput32O)
{
_bounseInput32S=1;
_bounseInput32P = millis();
}
}
//Плата:1
//Наименование:Заставка 2 секунди
if ((!_ktim1))
{
_dispTempLength1 = (String("WellData")).length();
if (_disp1oldLength > _dispTempLength1)
{
_isNeedClearDisp1 = 1;
}
_disp1oldLength = _dispTempLength1;
_lcd1.setCursor(int((20 - _dispTempLength1)/2), 0);
_lcd1.print(String("WellData"));
}
else
{
if (_disp1oldLength > 0)
{
_isNeedClearDisp1 = 1;
_disp1oldLength = 0;
}
}
if ((!_ktim1))
{
_dispTempLength1 = (String("Software ver. 0.001")).length();
if (_disp2oldLength > _dispTempLength1)
{
_isNeedClearDisp1 = 1;
}
_disp2oldLength = _dispTempLength1;
_lcd1.setCursor(0, 3);
_lcd1.print(String("Software ver. 0.001"));
}
else
{
if (_disp2oldLength > 0)
{
_isNeedClearDisp1 = 1;
_disp2oldLength = 0;
}
}
if (1)
{
if (_tim1I)
{
if (_isTimer(_tim1P, 2000))
{
_tim1O = 1;
}
}
else
{
_tim1I =1;
_tim1P = millis();
}
}
else
{
_tim1O = 0;
_tim1I = 0;
}
if(_tim1O)
{
_ktim1 = 1;
}
else
{
_ktim1 = 0;
}
//Плата:3
//Наименование:LCD
if (_ktim1 == 1)
{
if (1)
{
_dispTempLength1 = ((_mux1)).length();
if (_disp4oldLength > _dispTempLength1)
{
_isNeedClearDisp1 = 1;
}
_disp4oldLength = _dispTempLength1;
_lcd1.setCursor(0, 0);
_lcd1.print((_mux1));
}
else
{
if (_disp4oldLength > 0)
{
_isNeedClearDisp1 = 1;
_disp4oldLength = 0;
}
}
if (1)
{
_dispTempLength1 = ((_mux3)).length();
if (_disp5oldLength > _dispTempLength1)
{
_isNeedClearDisp1 = 1;
}
_disp5oldLength = _dispTempLength1;
_lcd1.setCursor(0, 1);
_lcd1.print((_mux3));
}
else
{
if (_disp5oldLength > 0)
{
_isNeedClearDisp1 = 1;
_disp5oldLength = 0;
}
}
if (1)
{
_dispTempLength1 = ((_mux2)).length();
if (_disp6oldLength > _dispTempLength1)
{
_isNeedClearDisp1 = 1;
}
_disp6oldLength = _dispTempLength1;
_lcd1.setCursor(0, 2);
_lcd1.print((_mux2));
}
else
{
if (_disp6oldLength > 0)
{
_isNeedClearDisp1 = 1;
_disp6oldLength = 0;
}
}
if (1)
{
_dispTempLength1 = ((_mux4)).length();
if (_disp7oldLength > _dispTempLength1)
{
_isNeedClearDisp1 = 1;
}
_disp7oldLength = _dispTempLength1;
_lcd1.setCursor(0, 3);
_lcd1.print((_mux4));
}
else
{
if (_disp7oldLength > 0)
{
_isNeedClearDisp1 = 1;
_disp7oldLength = 0;
}
}
}
//Плата:4
//Наименование:Меню
_k8 = 1;
digitalWrite(23, 0);
_mkb1C1xP1 = ! (digitalRead(22));
_mkb1C1xP2 = ! (digitalRead(24));
_mkb1C1xP3 = ! (digitalRead(26));
_mkb1C1xP4 = ! (digitalRead(28));
digitalWrite(23, 1);
digitalWrite(25, 0);
_mkb1C2xP1 = ! (digitalRead(22));
_mkb1C2xP2 = ! (digitalRead(24));
_mkb1C2xP3 = ! (digitalRead(26));
_mkb1C2xP4 = ! (digitalRead(28));
digitalWrite(25, 1);
digitalWrite(27, 0);
_mkb1C3xP1 = ! (digitalRead(22));
_mkb1C3xP2 = ! (digitalRead(24));
_mkb1C3xP3 = ! (digitalRead(26));
_mkb1C3xP4 = ! (digitalRead(28));
digitalWrite(27, 1);
digitalWrite(29, 0);
_mkb1C4xP1 = ! (digitalRead(22));
_mkb1C4xP2 = ! (digitalRead(24));
_mkb1C4xP3 = ! (digitalRead(26));
_mkb1C4xP4 = ! (digitalRead(28));
digitalWrite(29, 1);
digitalWrite(31, 0);
_mkb1C5xP1 = ! (digitalRead(22));
_mkb1C5xP2 = ! (digitalRead(24));
_mkb1C5xP3 = ! (digitalRead(26));
_mkb1C5xP4 = ! (digitalRead(28));
digitalWrite(31, 1);
bool _bounceTmpD12 = _mkb1C1xP1;
if (_bounse12S)
{
if (millis() >= (_bounse12P + 40))
{
_bounse12O= _bounceTmpD12;
_bounse12S=0;
}
}
else
{
if (_bounceTmpD12 != _bounse12O)
{
_bounse12S=1;
_bounse12P = millis();
}
}
bool _bounceTmpD3 = _mkb1C4xP2;
if (_bounse3S)
{
if (millis() >= (_bounse3P + 40))
{
_bounse3O= _bounceTmpD3;
_bounse3S=0;
}
}
else
{
if (_bounceTmpD3 != _bounse3O)
{
_bounse3S=1;
_bounse3P = millis();
}
}
bool _bounceTmpD8 = _mkb1C5xP2;
if (_bounse8S)
{
if (millis() >= (_bounse8P + 40))
{
_bounse8O= _bounceTmpD8;
_bounse8S=0;
}
}
else
{
if (_bounceTmpD8 != _bounse8O)
{
_bounse8S=1;
_bounse8P = millis();
}
}
bool _bounceTmpD9 = _mkb1C5xP3;
if (_bounse9S)
{
if (millis() >= (_bounse9P + 40))
{
_bounse9O= _bounceTmpD9;
_bounse9S=0;
}
}
else
{
if (_bounceTmpD9 != _bounse9O)
{
_bounse9S=1;
_bounse9P = millis();
}
}
bool _bounceTmpD7 = _mkb1C5xP1;
if (_bounse7S)
{
if (millis() >= (_bounse7P + 40))
{
_bounse7O= _bounceTmpD7;
_bounse7S=0;
}
}
else
{
if (_bounceTmpD7 != _bounse7O)
{
_bounse7S=1;
_bounse7P = millis();
}
}
bool _bounceTmpD10 = _mkb1C5xP4;
if (_bounse10S)
{
if (millis() >= (_bounse10P + 40))
{
_bounse10O= _bounceTmpD10;
_bounse10S=0;
}
}
else
{
if (_bounceTmpD10 != _bounse10O)
{
_bounse10S=1;
_bounse10P = millis();
}
}
bool _bounceTmpD6 = _mkb1C4xP4;
if (_bounse6S)
{
if (millis() >= (_bounse6P + 40))
{
_bounse6O= _bounceTmpD6;
_bounse6S=0;
}
}
else
{
if (_bounceTmpD6 != _bounse6O)
{
_bounse6S=1;
_bounse6P = millis();
}
}
bool _bounceTmpD21 = _mkb1C3xP2;
if (_bounse21S)
{
if (millis() >= (_bounse21P + 40))
{
_bounse21O= _bounceTmpD21;
_bounse21S=0;
}
}
else
{
if (_bounceTmpD21 != _bounse21O)
{
_bounse21S=1;
_bounse21P = millis();
}
}
bool _bounceTmpD22 = _mkb1C4xP1;
if (_bounse22S)
{
if (millis() >= (_bounse22P + 40))
{
_bounse22O= _bounceTmpD22;
_bounse22S=0;
}
}
else
{
if (_bounceTmpD22 != _bounse22O)
{
_bounse22S=1;
_bounse22P = millis();
}
}
_FreeLog1_IArr[0] = _bounse22O;
_FreeLog1_IArr[1] = _bounse21O;
_FreeLog1_Q1 = _checkFreeLogicBlockOutput(_FreeLog1_IArr, 2, _FreeLog1_Q1_StArr, 2);
_k5 = _FreeLog1_Q1;
bool _bounceTmpD13 = _mkb1C1xP2;
if (_bounse13S)
{
if (millis() >= (_bounse13P + 40))
{
_bounse13O= _bounceTmpD13;
_bounse13S=0;
}
}
else
{
if (_bounceTmpD13 != _bounse13O)
{
_bounse13S=1;
_bounse13P = millis();
}
}
bool _bounceTmpD14 = _mkb1C1xP3;
if (_bounse14S)
{
if (millis() >= (_bounse14P + 40))
{
_bounse14O= _bounceTmpD14;
_bounse14S=0;
}
}
else
{
if (_bounceTmpD14 != _bounse14O)
{
_bounse14S=1;
_bounse14P = millis();
}
}
bool _bounceTmpD15 = _mkb1C1xP4;
if (_bounse15S)
{
if (millis() >= (_bounse15P + 40))
{
_bounse15O= _bounceTmpD15;
_bounse15S=0;
}
}
else
{
if (_bounceTmpD15 != _bounse15O)
{
_bounse15S=1;
_bounse15P = millis();
}
}
bool _bounceTmpD16 = _mkb1C2xP1;
if (_bounse16S)
{
if (millis() >= (_bounse16P + 40))
{
_bounse16O= _bounceTmpD16;
_bounse16S=0;
}
}
else
{
if (_bounceTmpD16 != _bounse16O)
{
_bounse16S=1;
_bounse16P = millis();
}
}
bool _bounceTmpD17 = _mkb1C2xP2;
if (_bounse17S)
{
if (millis() >= (_bounse17P + 40))
{
_bounse17O= _bounceTmpD17;
_bounse17S=0;
}
}
else
{
if (_bounceTmpD17 != _bounse17O)
{
_bounse17S=1;
_bounse17P = millis();
}
}
bool _bounceTmpD18 = _mkb1C2xP3;
if (_bounse18S)
{
if (millis() >= (_bounse18P + 40))
{
_bounse18O= _bounceTmpD18;
_bounse18S=0;
}
}
else
{
if (_bounceTmpD18 != _bounse18O)
{
_bounse18S=1;
_bounse18P = millis();
}
}
bool _bounceTmpD19 = _mkb1C2xP4;
if (_bounse19S)
{
if (millis() >= (_bounse19P + 40))
{
_bounse19O= _bounceTmpD19;
_bounse19S=0;
}
}
else
{
if (_bounceTmpD19 != _bounse19O)
{
_bounse19S=1;
_bounse19P = millis();
}
}
bool _bounceTmpD20 = _mkb1C3xP1;
if (_bounse20S)
{
if (millis() >= (_bounse20P + 40))
{
_bounse20O= _bounceTmpD20;
_bounse20S=0;
}
}
else
{
if (_bounceTmpD20 != _bounse20O)
{
_bounse20S=1;
_bounse20P = millis();
}
}
bool _bounceTmpD23 = _mkb1C3xP3;
if (_bounse23S)
{
if (millis() >= (_bounse23P + 40))
{
_bounse23O= _bounceTmpD23;
_bounse23S=0;
}
}
else
{
if (_bounceTmpD23 != _bounse23O)
{
_bounse23S=1;
_bounse23P = millis();
}
}
bool _bounceTmpD2 = _mkb1C3xP4;
if (_bounse2S)
{
if (millis() >= (_bounse2P + 40))
{
_bounse2O= _bounceTmpD2;
_bounse2S=0;
}
}
else
{
if (_bounceTmpD2 != _bounse2O)
{
_bounse2S=1;
_bounse2P = millis();
}
}
bool _bounceTmpD4 = _mkb1C4xP3;
if (_bounse4S)
{
if (millis() >= (_bounse4P + 40))
{
_bounse4O= _bounceTmpD4;
_bounse4S=0;
}
}
else
{
if (_bounceTmpD4 != _bounse4O)
{
_bounse4S=1;
_bounse4P = millis();
}
}
if (1)
{
_tempVariable_bool = 1;
if (! _MenuBlock_222602257_OEIS)
{
_MenuBlock_222602257_OEIS = 1;
(_MainMenus[0]).tempString = "";
}
_tempVariable_int = pgm_read_byte(&_menuParametrsArray[((_MainMenus[0].currentItem).startInArrayIndex)+10]);
_MenuBlock_222602257_MNO = _readStringFromProgmem ((char*)pgm_read_word(&(_flprogMenuStringsArray[_tempVariable_int - 1])));
_MenuBlock_222602257_VNO = _menuOutputValueString (0);
_MenuBlock_222602257_AMO_241360251 = pgm_read_byte(&_menuParametrsArray[(_MainMenus[0].currentItem).startInArrayIndex]) == 1;
_MenuBlock_222602257_AMO_123216794 = pgm_read_byte(&_menuParametrsArray[(_MainMenus[0].currentItem).startInArrayIndex]) == 2;
_MenuBlock_222602257_AMO_84109339 = pgm_read_byte(&_menuParametrsArray[(_MainMenus[0].currentItem).startInArrayIndex]) == 3;
_MenuBlock_222602257_AMO_130541516 = pgm_read_byte(&_menuParametrsArray[(_MainMenus[0].currentItem).startInArrayIndex]) == 4;
_MenuBlock_222602257_AMO_154140248 = pgm_read_byte(&_menuParametrsArray[(_MainMenus[0].currentItem).startInArrayIndex]) == 5;
_MenuBlock_222602257_AMO_223201016 = pgm_read_byte(&_menuParametrsArray[(_MainMenus[0].currentItem).startInArrayIndex]) == 6;
_MenuBlock_222602257_AMO_211711800 = pgm_read_byte(&_menuParametrsArray[(_MainMenus[0].currentItem).startInArrayIndex]) == 7;
_MenuBlock_222602257_AMO_4428595 = pgm_read_byte(&_menuParametrsArray[(_MainMenus[0].currentItem).startInArrayIndex]) == 8;
_MenuBlock_222602257_AMMO = (pgm_read_byte(&_menuParametrsArray[((_MainMenus[0].currentItem).startInArrayIndex)+5])) == 0;
_tempVariable_int = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[0]).currentItem).startInArrayIndex) +12]);
if(_tempVariable_int == 0)
{
_MenuBlock_222602257_ASO_1 = "";
}
else
{
_MenuBlock_222602257_ASO_1 = _readStringFromProgmem ((char*)pgm_read_word(&(_flprogMenuStringsArray[_tempVariable_int - 1])));
}
_tempVariable_int = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[0]).currentItem).startInArrayIndex) +13]);
if(_tempVariable_int == 0)
{
_MenuBlock_222602257_ASO_2 = "";
}
else
{
_MenuBlock_222602257_ASO_2 = _readStringFromProgmem ((char*)pgm_read_word(&(_flprogMenuStringsArray[_tempVariable_int - 1])));
}
_tempVariable_int = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[0]).currentItem).startInArrayIndex) +14]);
if(_tempVariable_int == 0)
{
_MenuBlock_222602257_ASO_3 = "";
}
else
{
_MenuBlock_222602257_ASO_3 = _readStringFromProgmem ((char*)pgm_read_word(&(_flprogMenuStringsArray[_tempVariable_int - 1])));
}
_tempVariable_int = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[0]).currentItem).startInArrayIndex) +15]);
if(_tempVariable_int == 0)
{
_MenuBlock_222602257_ASO_4 = "";
}
else
{
_MenuBlock_222602257_ASO_4 = _readStringFromProgmem ((char*)pgm_read_word(&(_flprogMenuStringsArray[_tempVariable_int - 1])));
}
}
else
{
_tempVariable_bool = 0;
if (_MenuBlock_222602257_OEIS)
{
_MenuBlock_222602257_OEIS = 0;
_menuUpdateToEEpromItems();
}
_MenuBlock_222602257_AMO_241360251 = 0;
_MenuBlock_222602257_AMO_123216794 = 0;
_MenuBlock_222602257_AMO_84109339 = 0;
_MenuBlock_222602257_AMO_130541516 = 0;
_MenuBlock_222602257_AMO_154140248 = 0;
_MenuBlock_222602257_AMO_223201016 = 0;
_MenuBlock_222602257_AMO_211711800 = 0;
_MenuBlock_222602257_AMO_4428595 = 0;
_MenuBlock_222602257_AMMO = 0;
_MenuBlock_222602257_ASO_1 = "";
_MenuBlock_222602257_ASO_2 = "";
_MenuBlock_222602257_ASO_3 = "";
_MenuBlock_222602257_ASO_4 = "";
_MenuBlock_222602257_MNO = "";
_MenuBlock_222602257_VNO = "";
}
if(_bounse3O)
{
if (! _MenuBlock_222602257_OMUIS)
{
_MenuBlock_222602257_OMUIS = 1;
if(_tempVariable_bool)
{
_menuUpEvents(0);
_menuUpdateToEEpromItems();
}
}
}
else
{
_MenuBlock_222602257_OMUIS = 0;
}
if(_bounse8O)
{
if (! _MenuBlock_222602257_OMDIS)
{
_MenuBlock_222602257_OMDIS = 1;
if(_tempVariable_bool)
{
_menuDownEvents(0);
_menuUpdateToEEpromItems();
}
}
}
else
{
_MenuBlock_222602257_OMDIS = 0;
}
if(_bounse10O)
{
if (! _MenuBlock_222602257_OEMIS)
{
_MenuBlock_222602257_OEMIS = 1;
if(_tempVariable_bool)
{
_menuEnterTheMenuEvents (0);
_menuUpdateToEEpromItems();
}
}
}
else
{
_MenuBlock_222602257_OEMIS = 0;
}
if(_bounse6O)
{
if (! _MenuBlock_222602257_OExFMIS)
{
_MenuBlock_222602257_OExFMIS = 1;
if(_tempVariable_bool)
{
_menuExitFromMenuEvents (0);
_menuUpdateToEEpromItems();
}
}
}
else
{
_MenuBlock_222602257_OExFMIS = 0;
}
if(_bounse9O)
{
if (! _MenuBlock_222602257_OVUIS)
{
_MenuBlock_222602257_OVUIS = 1;
if(_tempVariable_bool)
{
_valueUpEvents(0);
}
}
}
else
{
_MenuBlock_222602257_OVUIS = 0;
}
if(_bounse7O)
{
if (! _MenuBlock_222602257_OVDIS)
{
_MenuBlock_222602257_OVDIS = 1;
if(_tempVariable_bool)
{
_valueDownEvents(0);
}
}
}
else
{
_MenuBlock_222602257_OVDIS = 0;
}
if(0)
{
if (_tempVariable_bool)
{
(_MainMenus[0]).currentItem = _MenuItems[0];
_menuUpdateToEEpromItems();
(_MainMenus[0]).tempString = "";
}
}
if(0)
{
if (_tempVariable_bool)
{
(_MainMenus[0]).currentItem = _MenuItems[1];
_menuUpdateToEEpromItems();
(_MainMenus[0]).tempString = "";
}
}
if(0)
{
if (_tempVariable_bool)
{
(_MainMenus[0]).currentItem = _MenuItems[2];
_menuUpdateToEEpromItems();
(_MainMenus[0]).tempString = "";
}
}
if(0)
{
if (_tempVariable_bool)
{
(_MainMenus[0]).currentItem = _MenuItems[3];
_menuUpdateToEEpromItems();
(_MainMenus[0]).tempString = "";
}
}
if(0)
{
if (_tempVariable_bool)
{
(_MainMenus[0]).currentItem = _MenuItems[4];
_menuUpdateToEEpromItems();
(_MainMenus[0]).tempString = "";
}
}
if(0)
{
if (_tempVariable_bool)
{
(_MainMenus[0]).currentItem = _MenuItems[5];
_menuUpdateToEEpromItems();
(_MainMenus[0]).tempString = "";
}
}
if(0)
{
if (_tempVariable_bool)
{
(_MainMenus[0]).currentItem = _MenuItems[6];
_menuUpdateToEEpromItems();
(_MainMenus[0]).tempString = "";
}
}
if(0)
{
if (_tempVariable_bool)
{
(_MainMenus[0]).currentItem = _MenuItems[7];
_menuUpdateToEEpromItems();
(_MainMenus[0]).tempString = "";
}
}
if(((_bounse21O) &&((!_k5))))
{
if (! _MenuBlock_222602257_IDI_0)
{
_MenuBlock_222602257_IDI_0 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '0');
}
}
}
else
{
_MenuBlock_222602257_IDI_0 = 0;
}
if(_bounse12O)
{
if (! _MenuBlock_222602257_IDI_1)
{
_MenuBlock_222602257_IDI_1 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '1');
}
}
}
else
{
_MenuBlock_222602257_IDI_1 = 0;
}
if(_bounse13O)
{
if (! _MenuBlock_222602257_IDI_2)
{
_MenuBlock_222602257_IDI_2 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '2');
}
}
}
else
{
_MenuBlock_222602257_IDI_2 = 0;
}
if(_bounse14O)
{
if (! _MenuBlock_222602257_IDI_3)
{
_MenuBlock_222602257_IDI_3 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '3');
}
}
}
else
{
_MenuBlock_222602257_IDI_3 = 0;
}
if(_bounse15O)
{
if (! _MenuBlock_222602257_IDI_4)
{
_MenuBlock_222602257_IDI_4 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '4');
}
}
}
else
{
_MenuBlock_222602257_IDI_4 = 0;
}
if(_bounse16O)
{
if (! _MenuBlock_222602257_IDI_5)
{
_MenuBlock_222602257_IDI_5 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '5');
}
}
}
else
{
_MenuBlock_222602257_IDI_5 = 0;
}
if(_bounse17O)
{
if (! _MenuBlock_222602257_IDI_6)
{
_MenuBlock_222602257_IDI_6 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '6');
}
}
}
else
{
_MenuBlock_222602257_IDI_6 = 0;
}
if(_bounse18O)
{
if (! _MenuBlock_222602257_IDI_7)
{
_MenuBlock_222602257_IDI_7 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '7');
}
}
}
else
{
_MenuBlock_222602257_IDI_7 = 0;
}
if(_bounse19O)
{
if (! _MenuBlock_222602257_IDI_8)
{
_MenuBlock_222602257_IDI_8 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '8');
}
}
}
else
{
_MenuBlock_222602257_IDI_8 = 0;
}
if(_bounse20O)
{
if (! _MenuBlock_222602257_IDI_9)
{
_MenuBlock_222602257_IDI_9 = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '9');
}
}
}
else
{
_MenuBlock_222602257_IDI_9 = 0;
}
if(_bounse23O)
{
if (! _MenuBlock_222602257COMMAOIS)
{
_MenuBlock_222602257COMMAOIS = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '.');
}
}
}
else
{
_MenuBlock_222602257COMMAOIS = 0;
}
if(_bounse2O)
{
if (! _MenuBlock_222602257MinusIOS)
{
_MenuBlock_222602257MinusIOS = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '-');
}
}
}
else
{
_MenuBlock_222602257MinusIOS = 0;
}
if(_bounse4O)
{
if (! _MenuBlock_222602257_BackspaceIOS)
{
_MenuBlock_222602257_BackspaceIOS = 1;
if(_tempVariable_bool)
{
_menuDirectInputKeyPressEvents(0, '<');
}
}
}
else
{
_MenuBlock_222602257_BackspaceIOS = 0;
}
_k3 = _MenuBlock_222602257_AMMO;
En_100557512_1 = 1;
if (En_100557512_1)
{
extern int __bss_end;
extern int *__brkval;
if((int)__brkval == 0)
{
FreeRAM_100557512_1 = ((int)&FreeRAM_100557512_1) - ((int)&__bss_end);
}
else
{
FreeRAM_100557512_1 = ((int)&FreeRAM_100557512_1) - ((int)__brkval);
}
}
if (0)
{
_count2_Value = 0;
}
else
{
if ((!_bounseInput33O))
{
if (! _count2I)
{
_count2I = 1;
_count2_Value = _count2_Value + 1;
}
}
else
{
_count2I = 0;
}
}
if(_count2_Value >= (3))
{
_count2_Value = 0;
}
if((_count2_Value) == 0)
{
_mux3 = ((String("SPP ")) + ((_floatToStringWitRaz((((_poligon((weight_33141984_3), _Poligon_InArray_3, _Poligon_OutArray_3, 2)))/(100.0)),2))) + (String(" ")) + (String("bar")));
}
if((_count2_Value) == 1)
{
_mux3 = _MenuBlock_222602257_ASO_2;
}
if((_count2_Value) == 2)
{
_mux3 = String("");
}
if((_count2_Value) == 0)
{
_mux2 = ((String("PCT ")) + ((String((_poligon((weight_33141984_4), _Poligon_InArray_2, _Poligon_OutArray_2, 2)), DEC))) + (String(" ")) + (String("bar")));
}
if((_count2_Value) == 1)
{
_mux2 = _MenuBlock_222602257_ASO_3;
}
if((_count2_Value) == 2)
{
_mux2 = String("");
}
if((_count2_Value) == 0)
{
_mux4 = ((_swi1) + (_swi2) + (String(" ")) + (String("ton")));
}
if((_count2_Value) == 1)
{
_mux4 = _MenuBlock_222602257_ASO_4;
}
if((_count2_Value) == 2)
{
_mux4 = String("");
}
if((_count2_Value) == 0)
{
_mux1 = (String(FreeRAM_100557512_1, DEC));
}
if((_count2_Value) == 1)
{
_mux1 = _MenuBlock_222602257_ASO_1;
}
if((_count2_Value) == 2)
{
_mux1 = String("");
}
//Плата:5
//Наименование:Режим СПО / Буріння
if (_ktim1 == 1)
{
_k4 = (!_bounseInput30O);
_k1 = (!_k4);
_k2 = _k4;
if (_k2)
{
if (! _gen1I)
{
_gen1I = 1;
_gen1O = 1;
_gen1P = millis();
}
}
else
{
_gen1I = 0 ;
_gen1O= 0;
}
if (_gen1I)
{
if (_isTimer (_gen1P , 100))
{
_gen1P = millis();
_gen1O = ! _gen1O;
}
}
if(_gen1O)
{
_kgen1 = 1;
}
else
{
_kgen1 = 0;
}
if(_kgen1)
{
if(!_SEEPR1OSN)
{
(updateFloatToEEPROM(13, 0, 0x0, ((((_poligon((weight_33141984_2), _Poligon_InArray_1, _Poligon_OutArray_1, 2)))/(100.0)))));
_SEEPR1OSN=1;
}
}
else
{
if(_SEEPR1OSN)
{
_SEEPR1OSN=0;
}
}
_Terminal_48396036 = (_floatToStringWitRaz((((_poligon((weight_33141984_2), _Poligon_InArray_1, _Poligon_OutArray_1, 2)))/(100.0)),2));
_Terminal_38408886 = (_floatToStringWitRaz(((1.00)*((((readFloatFromEEPROM(13, 0, 0x0)))-((((_poligon((weight_33141984_2), _Poligon_InArray_1, _Poligon_OutArray_1, 2)))/(100.0)))))),2));
if(_k4)
{
_swi1=String("WOH ");
}
else
{
_swi1=String("WOB ");
}
if(_k4)
{
_swi2=(_floatToStringWitRaz((((_poligon((weight_33141984_2), _Poligon_InArray_1, _Poligon_OutArray_1, 2)))/(100.0)),2));
}
else
{
_swi2=(_floatToStringWitRaz(((1.00)*((((readFloatFromEEPROM(13, 0, 0x0)))-((((_poligon((weight_33141984_2), _Poligon_InArray_1, _Poligon_OutArray_1, 2)))/(100.0)))))),2));
}
}
//Плата:6
//Наименование:Вага на гаку
EN_33141984_2 = 1;
tare_33141984_2 = (!_bounseInput32O);
scaleFactor_33141984_2 = 1.00;
readingsCount_33141984_2 = 0;
if(EN_33141984_2)
{
if(tare_33141984_2) scale_33141984_2.tare();
scale_33141984_2.set_scale(scaleFactor_33141984_2);
weight_33141984_2 = scale_33141984_2.get_units(readingsCount_33141984_2);
}
_Terminal_20382769 = (((_poligon((weight_33141984_2), _Poligon_InArray_1, _Poligon_OutArray_1, 2)))/(100.0));
//Плата:7
//Наименование:Тиск в маніфольдній лінії
EN_33141984_3 = 1;
tare_33141984_3 = 0;
scaleFactor_33141984_3 = 1.00;
readingsCount_33141984_3 = 0;
if(EN_33141984_3)
{
if(tare_33141984_3) scale_33141984_3.tare();
scale_33141984_3.set_scale(scaleFactor_33141984_3);
weight_33141984_3 = scale_33141984_3.get_units(readingsCount_33141984_3);
}
_Terminal_202794734 = (((_poligon((weight_33141984_3), _Poligon_InArray_3, _Poligon_OutArray_3, 2)))/(100.0));
_Terminal_106751009 = (_floatToStringWitRaz((((_poligon((weight_33141984_3), _Poligon_InArray_3, _Poligon_OutArray_3, 2)))/(100.0)),2));
//Плата:8
//Наименование:Тиск гідроключа
EN_33141984_4 = 1;
tare_33141984_4 = 0;
scaleFactor_33141984_4 = 0;
readingsCount_33141984_4 = 0;
if(EN_33141984_4)
{
if(tare_33141984_4) scale_33141984_4.tare();
scale_33141984_4.set_scale(scaleFactor_33141984_4);
weight_33141984_4 = scale_33141984_4.get_units(readingsCount_33141984_4);
}
_Terminal_185247745 = (String((_poligon((weight_33141984_4), _Poligon_InArray_2, _Poligon_OutArray_2, 2)), DEC));
//Плата:10
//Наименование:Електронне табло
}
String _floatToStringWitRaz(float value, int raz)
{
return String(value,raz);
}
bool _isTimer(unsigned long startTime, unsigned long period)
{
unsigned long currentTime;
currentTime = millis();
if (currentTime>= startTime)
{
return (currentTime>=(startTime + period));
}
else
{
return (currentTime >=(4294967295-startTime+period));
}
}
String _readStringFromProgmem (char *string)
{
String result = String("");
while (pgm_read_byte(string)!='\0')
{
result=result+ char(pgm_read_byte(string));
string++;
}
return result;
}
void _menuUpEvents (int menuIndex)
{
(_MainMenus[menuIndex]).tempString = "";
int tempIndex = pgm_read_byte(&_menuParametrsArray[((_MainMenus[menuIndex]).currentItem).startInArrayIndex]);
int parIndex = pgm_read_byte(&_menuParametrsArray[ (((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+5]);
int parentStartIndex;
int parentStopIndex;
if (parIndex == 0)
{
parentStartIndex = (_MainMenus[menuIndex]).startIndex;
parentStopIndex =(_MainMenus[menuIndex]).stopIndex;
}
else
{
parentStartIndex = pgm_read_byte(&_menuParametrsArray[((_MenuItems[parIndex - 1]).startInArrayIndex)+3]);
parentStopIndex = pgm_read_byte(&_menuParametrsArray[((_MenuItems[parIndex-1]).startInArrayIndex)+4]);
}
if (tempIndex == parentStartIndex)
{
if((_MainMenus[menuIndex]).isSwitchMenuAroundRing)
{
(_MainMenus[menuIndex]).currentItem = _MenuItems[parentStopIndex -1];
return;
}
else
{
return;
}
}
(_MainMenus[menuIndex]).currentItem = _MenuItems[tempIndex - 2];
return;
}
void _menuDownEvents (int menuIndex)
{
(_MainMenus[menuIndex]).tempString = "";
int tempIndex = pgm_read_byte(&_menuParametrsArray[((_MainMenus[menuIndex]).currentItem).startInArrayIndex]);
int parIndex = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+5]);
int parentStartIndex;
int parentStopIndex;
if (parIndex == 0)
{
parentStartIndex = (_MainMenus[menuIndex]).startIndex;
parentStopIndex =(_MainMenus[menuIndex]).stopIndex;
}
else
{
parentStartIndex = pgm_read_byte(&_menuParametrsArray[((_MenuItems[parIndex-1]).startInArrayIndex)+3]);
parentStopIndex = pgm_read_byte(&_menuParametrsArray[((_MenuItems[parIndex-1]).startInArrayIndex)+4]);
}
if (tempIndex == parentStopIndex)
{
if((_MainMenus[menuIndex]).isSwitchMenuAroundRing)
{
(_MainMenus[menuIndex]).currentItem = _MenuItems[parentStartIndex -1];
return;
}
else
{
return;
}
}
(_MainMenus[menuIndex]).currentItem = _MenuItems[tempIndex];
return;
}
void _valueUpEvents (int menuIndex)
{
int valIndex = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+2]);
int itemType = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+1]);
int indexMax = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+6]);
int indexStep = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+8]);
if (itemType == 4)
{
_menuValueArray_int[valIndex -1] = _menuValueArray_int[valIndex -1] + (pgm_read_word(&_menuConstantValuesArray_int[indexStep -1]));
}
}
void _valueDownEvents (int menuIndex)
{
int valIndex = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+2]);
int itemType = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+1]);
int indexMin = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+7]);
int indexStep = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+8]);
if (itemType == 4)
{
_menuValueArray_int[valIndex - 1] = _menuValueArray_int[valIndex - 1] - (pgm_read_word(&_menuConstantValuesArray_int[indexStep - 1]));
}
}
void _menuEnterTheMenuEvents (int menuIndex)
{
int itemType = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+1]);
if(!(itemType == 0))
{
return;
}
int tempIndex = pgm_read_byte(&_menuParametrsArray[((_MainMenus[menuIndex]).currentItem).startInArrayIndex]);
int newIndex = pgm_read_byte(&_menuParametrsArray[((_MenuItems[tempIndex - 1]).startInArrayIndex)+3]);
if(newIndex == 0)
{
return;
}
(_MainMenus[menuIndex]).tempString = "";
(_MainMenus[menuIndex]).currentItem = _MenuItems[newIndex - 1];
return;
}
void _menuExitFromMenuEvents (int menuIndex)
{
int parIndex = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+5]);
if(parIndex == 0)
{
return;
}
(_MainMenus[menuIndex]).tempString = "";
(_MainMenus[menuIndex]).currentItem = _MenuItems[parIndex - 1];
return;
}
String _menuOutputValueString (int menuIndex)
{
int itemType = pgm_read_byte(&_menuParametrsArray[ (((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+1]);
int valueStrIndex = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+11]);
if(itemType == 0)
{
if(valueStrIndex == 0)
{
return "";
}
}
int valIndex = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+2]);
int indexMin = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+7]);
int indexMax = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+6]);
if(valIndex == 0)
{
return "";
}
int convFormat = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+9]);
if(itemType == 4)
{
return _convertNamber(itemType, convFormat, valIndex, indexMax, indexMin);
}
return "";
}
void _menuDirectInputKeyPressEvents(int menuIndex, char inputSymbol)
{
int valIndex = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+2]);
int temp;
if(valIndex == 0)
{
return;
}
int itemType = pgm_read_byte(&_menuParametrsArray[(((_MainMenus[menuIndex]).currentItem).startInArrayIndex)+1]);
if((inputSymbol == '.') &&(itemType != 8))
{
return;
}
if(itemType == 7)
{
return;
}
if(inputSymbol == '<')
{
temp = ((_MainMenus[menuIndex]).tempString).length();
if(temp == 0)
{
return;
}
else
{
if(temp == 1)
{
(_MainMenus[menuIndex]).tempString ="";
}
else
{
(_MainMenus[menuIndex]).tempString = ((_MainMenus[menuIndex]).tempString).substring(0, temp - 1);
}
}
}
else
{
if(inputSymbol == '-')
{
temp = ((_MainMenus[menuIndex]).tempString).length();
if(temp == 0)
{
(_MainMenus[menuIndex]).tempString = "-";
}
else
{
if(((_MainMenus[menuIndex]).tempString).charAt(0) == '-')
{
(_MainMenus[menuIndex]).tempString = ((_MainMenus[menuIndex]).tempString).substring(1);
}
else
{
(_MainMenus[menuIndex]).tempString = "-" + (_MainMenus[menuIndex]).tempString;
}
}
}
else
{
(_MainMenus[menuIndex]).tempString = (_MainMenus[menuIndex]).tempString + inputSymbol;
}
}
if(itemType == 4)
{
_menuValueArray_int[valIndex - 1] = (((_MainMenus[menuIndex]).tempString)).toInt();
}
}
void _menuUpdateToEEpromItems()
{
(updateIntegerToEEPROM(1, 0, 0x0, ((_menuValueArray_int[0]))));
(updateIntegerToEEPROM(3, 0, 0x0, ((_menuValueArray_int[1]))));
(updateIntegerToEEPROM(5, 0, 0x0, ((_menuValueArray_int[2]))));
(updateIntegerToEEPROM(7, 0, 0x0, ((_menuValueArray_int[3]))));
(updateIntegerToEEPROM(9, 0, 0x0, ((_menuValueArray_int[4]))));
(updateIntegerToEEPROM(11, 0, 0x0, ((_menuValueArray_int[5]))));
}
String _convertNamber(int itemType, int convFormat, int valIndex, int indexMax, int indexMin)
{
if (itemType== 4)
{
if (convFormat == 4)
{
return String((_menuValueArray_int[valIndex - 1 ]),DEC);
}
if (convFormat == 5)
{
return String((_menuValueArray_int[valIndex - 1]),HEX);
}
if (convFormat == 6)
{
return String((_menuValueArray_int[valIndex -1]),BIN);
}
}
}
bool _checkFreeLogicBlockOutput(bool inArray[], int inArraySize, bool stArray[], int stArraySize)
{
int inIndex = 0;
bool result = 1;
for (int i = 0; i < stArraySize; i = i + 1)
{
if (!(inArray[inIndex] == stArray[i]))
{
result = 0;
}
inIndex ++;
if (inIndex == inArraySize)
{
if (result)
{
return 1;
}
else
{
result = 1;
}
inIndex = 0;
}
}
return 0;
}
int _poligon(int value, int intArray[], int outArray[], int arraySize)
{
struct _poligonInexes indexes;
indexes = _getPoligonIndexes(value, intArray, arraySize);
return map(value, intArray[indexes.minIndex], intArray[indexes.maxIndex], outArray[indexes.minIndex], outArray[indexes.maxIndex]);
}
struct _poligonInexes _getPoligonIndexes(int value, int array[], int arraySize)
{
struct _poligonInexes result;
int i;
result.minIndex = 0;
result.maxIndex = 0;
for (i = 0; i < arraySize; i++)
{
if (array [result.minIndex] > array[i])
{
result.minIndex = i;
}
if (array [result.maxIndex] < array[i])
{
result.maxIndex = i;
}
}
for (i = 0; i < arraySize; i++)
{
if ((array [i] >= value) && (array [result.maxIndex] > array[i]))
{
result.maxIndex = i;
}
}
if (result.maxIndex==0)
{
result.minIndex = 0;
result.maxIndex=1;
}
else
{
result.minIndex = result.maxIndex -1;
}
return result;
return result;
}
byte readByteFromEEPROM(int addres, byte bitAddres, byte chipAddres)
{
return EEPROM.read(addres);
}
void updateByteToEEPROM(int addres, byte bitAddres, byte chipAddres, byte value)
{
return EEPROM.update(addres, value);
}
int readIntegerFromEEPROM(int addres, byte bitAddres, byte chipAddres)
{
byte hight = readByteFromEEPROM(addres, bitAddres, chipAddres);
byte low = readByteFromEEPROM((addres+1), bitAddres, chipAddres);
return word(hight, low);
}
void updateIntegerToEEPROM(int addres, byte bitAddres, byte chipAddres, int value)
{
updateByteToEEPROM(addres, bitAddres, chipAddres, highByte(value));
updateByteToEEPROM((addres+1), bitAddres, chipAddres, lowByte(value));
}
float readFloatFromEEPROM(int addres, byte bitAddres, byte chipAddres)
{
byte x[4];
for(byte i = 0; i < 4; i++)
{
x[i] = readByteFromEEPROM((addres+i), bitAddres, chipAddres);
}
float *y = (float *)&x;
return y[0];
}
void updateFloatToEEPROM(int addres, byte bitAddres, byte chipAddres, float value)
{
byte *x = (byte *)&value;
for(byte i = 0; i < 4; i++)
{
updateByteToEEPROM((addres+i), bitAddres, chipAddres, x[i]);
}
}
FPS: 0
Power: 0.00W
Power: 0.00W