diff --git a/display/cud_display_v3.HMI b/display/cud_display_v3.HMI index f3bcb4c..94ecfef 100644 Binary files a/display/cud_display_v3.HMI and b/display/cud_display_v3.HMI differ diff --git a/display/images/climate/FS High - On - Locked.png b/display/images/climate/FS High - On - Locked.png new file mode 100644 index 0000000..c0c2370 Binary files /dev/null and b/display/images/climate/FS High - On - Locked.png differ diff --git a/display/images/climate/FS High - On - Pressed.png b/display/images/climate/FS High - On - Pressed.png index 96142a8..175bb94 100644 Binary files a/display/images/climate/FS High - On - Pressed.png and b/display/images/climate/FS High - On - Pressed.png differ diff --git a/display/images/climate/FS High - On.png b/display/images/climate/FS High - On.png index 9b80c4c..f3d3149 100644 Binary files a/display/images/climate/FS High - On.png and b/display/images/climate/FS High - On.png differ diff --git a/display/images/climate/FS Low - On - Locked.png b/display/images/climate/FS Low - On - Locked.png new file mode 100644 index 0000000..65d316a Binary files /dev/null and b/display/images/climate/FS Low - On - Locked.png differ diff --git a/display/images/climate/FS Low - On - Pressed.png b/display/images/climate/FS Low - On - Pressed.png index eca564b..e500b97 100644 Binary files a/display/images/climate/FS Low - On - Pressed.png and b/display/images/climate/FS Low - On - Pressed.png differ diff --git a/display/images/climate/FS Low - On.png b/display/images/climate/FS Low - On.png index d903a76..baab418 100644 Binary files a/display/images/climate/FS Low - On.png and b/display/images/climate/FS Low - On.png differ diff --git a/display/images/climate/FS Mid - On - Locked.png b/display/images/climate/FS Mid - On - Locked.png new file mode 100644 index 0000000..643cbb7 Binary files /dev/null and b/display/images/climate/FS Mid - On - Locked.png differ diff --git a/display/images/climate/FS Mid - On - Pressed.png b/display/images/climate/FS Mid - On - Pressed.png index 75313a7..90c179f 100644 Binary files a/display/images/climate/FS Mid - On - Pressed.png and b/display/images/climate/FS Mid - On - Pressed.png differ diff --git a/display/images/climate/FS Mid - On.png b/display/images/climate/FS Mid - On.png index 1be9a1b..2fb521a 100644 Binary files a/display/images/climate/FS Mid - On.png and b/display/images/climate/FS Mid - On.png differ diff --git a/platformio.ini b/platformio.ini index 2ad267e..8bd5bc5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -14,6 +14,6 @@ board = wt32-eth01 framework = arduino lib_deps = siwats/ESPMegaPROR3@^2.4.3 monitor_speed = 115200 -build_flags = -DCORE_DEBUG_LEVEL=0 +build_flags = -DCORE_DEBUG_LEVEL=5 monitor_port = COM36 upload_port = COM36 \ No newline at end of file diff --git a/src/Untitled-1.m b/src/Untitled-1.m new file mode 100644 index 0000000..a72be42 --- /dev/null +++ b/src/Untitled-1.m @@ -0,0 +1,182 @@ +%% Set up the Import Options and import the data +opts = delimitedTextImportOptions("NumVariables", 8); + +% Specify range and delimiter +opts.DataLines = [1, Inf]; +opts.Delimiter = ","; + +% Specify column names and types +opts.VariableNames = ["Iteration", "NoseRadius", "CuttingSpeed", "FeedRate", "DepthOfCut", "ForceRatio", "AverageSurfaceRoughness", "MaximumSurfaceRoughness"]; +opts.VariableTypes = ["double", "double", "double", "double", "double", "double", "double", "double"]; + +% Specify file level properties +opts.ExtraColumnsRule = "ignore"; +opts.EmptyLineRule = "read"; + +% Import the data +Data = readtable("D:\Nextcloud\siwat\Documents\Lean Manufacturing\Data.csv", opts); + +%% Clear temporary variables +clear opts + +% Remove Header +Data = Data(2:end,:); + +inputs = [Data.NoseRadius,Data.CuttingSpeed,Data.FeedRate, Data.DepthOfCut]; +outputs = [Data.ForceRatio, Data.AverageSurfaceRoughness, Data.MaximumSurfaceRoughness]; + +% Solve an Input-Output Fitting problem with a Neural Network +% Script generated by Neural Fitting app +% Created 19-Mar-2024 12:05:08 +% +% This script assumes these variables are defined: +% +% inputs - input data. +% outputs - target data. + +x = inputs'; +t = outputs'; + +% Choose a Training Function +% For a list of all training functions type: help nntrain +% 'trainlm' is usually fastest. +% 'trainbr' takes longer but may be better for challenging problems. +% 'trainscg' uses less memory. Suitable in low memory situations. +trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation. + +% Create a Fitting Network +hiddenLayerSize = 50; +net = fitnet(hiddenLayerSize,trainFcn); + +% Choose Input and Output Pre/Post-Processing Functions +% For a list of all processing functions type: help nnprocess +net.input.processFcns = {'removeconstantrows','mapminmax'}; +net.output.processFcns = {'removeconstantrows','mapminmax'}; + +% Setup Division of Data for Training, Validation, Testing +% For a list of all data division functions type: help nndivision +net.divideFcn = 'dividerand'; % Divide data randomly +net.divideMode = 'sample'; % Divide up every sample +net.divideParam.trainRatio = 70/100; +net.divideParam.valRatio = 15/100; +net.divideParam.testRatio = 15/100; + +% Choose a Performance Function +% For a list of all performance functions type: help nnperformance +net.performFcn = 'mse'; % Mean Squared Error + +% Choose Plot Functions +% For a list of all plot functions type: help nnplot +net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ... + 'plotregression', 'plotfit'}; + +% Train the Network +[net,tr] = train(net,x,t); + +% Test the Network +y = net(x); +e = gsubtract(t,y); +performance = perform(net,t,y) + +% Recalculate Training, Validation and Test Performance +trainTargets = t .* tr.trainMask{1}; +valTargets = t .* tr.valMask{1}; +testTargets = t .* tr.testMask{1}; +trainPerformance = perform(net,trainTargets,y) +valPerformance = perform(net,valTargets,y) +testPerformance = perform(net,testTargets,y) + +% View the Network +view(net) + +% Plots +% Uncomment these lines to enable various plots. +%figure, plotperform(tr) +%figure, plottrainstate(tr) +%figure, ploterrhist(e) +%figure, plotregression(t,y) +%figure, plotfit(net,x,t) + +% Deployment +% Change the (false) values to (true) to enable the following code blocks. +% See the help for each generation function for more information. +if (false) + % Generate MATLAB function for neural network for application + % deployment in MATLAB scripts or with MATLAB Compiler and Builder + % tools, or simply to examine the calculations your trained neural + % network performs. + genFunction(net,'myNeuralNetworkFunction'); + y = myNeuralNetworkFunction(x); +end +if (false) + % Generate a matrix-only MATLAB function for neural network code + % generation with MATLAB Coder tools. + genFunction(net,'myNeuralNetworkFunction','MatrixOnly','yes'); + y = myNeuralNetworkFunction(x); +end +if (false) + % Generate a Simulink diagram for simulation or deployment with. + % Simulink Coder tools. + gensim(net); +end + + +%% Test Model with Data +% Sample Data +NoseRadius = [0.4 0.4 0.8 0.8 0.8]; +CuttingSpeed = [250 250 250 250 250]; +FeedRate = [0.18 0.18 0.18 0.18 0.18]; +DepthOfCut = [0.25 0.25 0.25 0.25 0.25]; +% Expected Data +ForceRatio = [0.324,0.281,0.256,0.26,0.181]; +SurfaceRoughness = [2.557 2.773 1.827 2.403 2.987]; +MaximumSurfaceRoughness = [12.387 13.478 9.110 13.878 18.304]; + +% Test Model for error +prediction = []; +for i = 1:5 + test = [NoseRadius(i),CuttingSpeed(i),FeedRate(i),DepthOfCut(i)]; + test = test'; + y = net(test); + % Print Expected and Predicted Value + fprintf('Test %d\n',i); + fprintf('Nose Radius: %f\n',NoseRadius(i)); + fprintf('Cutting Speed: %f\n',CuttingSpeed(i)); + fprintf('Feed Rate: %f\n',FeedRate(i)); + fprintf('Depth of Cut: %f\n',DepthOfCut(i)); + fprintf('Predicted Force Ratio: %f\n',y(1)); + fprintf('Expected Force Ratio: %f\n',ForceRatio(i)); + fprintf('Error Force Ratio: %f\n',abs(ForceRatio(i)-y(1))); + fprintf('Predicted Surface Roughness: %f\n',y(2)); + fprintf('Expected Surface Roughness: %f\n',SurfaceRoughness(i)); + fprintf('Error Surface Roughness: %f\n',abs(SurfaceRoughness(i)-y(2))); + fprintf('Predicted Maximum Surface Roughness: %f\n',y(3)); + fprintf('Expected Maximum Surface Roughness: %f\n',MaximumSurfaceRoughness(i)); + fprintf('Error Maximum Surface Roughness: %f\n',abs(MaximumSurfaceRoughness(i)-y(3))); + fprintf('\n'); + prediction = [prediction,y]; +end + +prediction = prediction'; + +% Plot graph comparing the expected and predicted values +figure; +subplot(3,1,1); +plot(1:5,ForceRatio,'-o',1:5,prediction(:,1),'-o'); +title('Force Ratio'); +xlabel('Test'); +ylabel('Force Ratio'); +legend('Expected','Predicted'); +subplot(3,1,2); +plot(1:5,SurfaceRoughness,'-o',1:5,prediction(:,2),'-o'); +title('Surface Roughness'); +xlabel('Test'); +ylabel('Surface Roughness'); +legend('Expected','Predicted'); +subplot(3,1,3); +plot(1:5,MaximumSurfaceRoughness,'-o',1:5,prediction(:,3),'-o'); +title('Maximum Surface Roughness'); +xlabel('Test'); +ylabel('Maximum Surface Roughness'); +legend('Expected','Predicted'); + diff --git a/src/display.cpp b/src/display.cpp index 31cfa0f..0d267c3 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -186,6 +186,7 @@ void CUDDisplay::loop() ESP_LOGD("CUD Display", "Checking MQTT Connection, Connection is %s", this->cards.iot->mqttConnected() ? "true" : "false"); if (!this->cards.iot->mqttConnected()) { + this->standalone = true; if (first_disconnect) { // When MQTT is disconnected, enter standalone mode @@ -196,7 +197,6 @@ void CUDDisplay::loop() this->cards.outputCard->setState(this->conf->socket_contactor_pin, true); first_disconnect = false; } - this->standalone = true; } else { @@ -209,11 +209,11 @@ void CUDDisplay::loop() // A/C temperature range limits are set first_disconnect = true; // Rebound the temperature - if(this->cards.ac->getTemperature() < this->get_ac_temp_lower_bound()) + if (this->cards.ac->getTemperature() < this->get_ac_temp_lower_bound()) { this->cards.ac->setTemperature(this->get_ac_temp_lower_bound()); } - else if(this->cards.ac->getTemperature() > this->get_ac_temp_upper_bound()) + else if (this->cards.ac->getTemperature() > this->get_ac_temp_upper_bound()) { this->cards.ac->setTemperature(this->get_ac_temp_upper_bound()); } @@ -764,10 +764,10 @@ void CUDDisplay::refresh_display_ac() uint8_t temperature = this->cards.ac->getTemperature(); ESP_LOGV("CUD Display", "Mode: %d, Fan Speed: %d, Temperature: %d", mode, fan_speed, temperature); ESP_LOGV("CUD Display", "Previous Mode: %d, Drawn Mode: %d", previous_mode, drawn_mode); - // Draw the state picture set // Is the AC locked? if (this->get_ac_lock()) { + // Draw the state picture set // When the display is locked // the state picture set we use is the locked state picture set this->takeSerialMutex(); @@ -779,6 +779,42 @@ void CUDDisplay::refresh_display_ac() // Set Alpha of Locked Icon to 127 this->displayAdapter->printf("%s.aph=%d", LCD_DASHBOARD_ELEMENT_NAME_ICO_LOCK, 127); this->sendStopBytes(); + // Overlay the ac container + this->displayAdapter->printf("vis %s,1", LCD_DASHBOARD_ELEMENT_NAME_AC_PANEL_OVERLAY); + this->sendStopBytes(); + // Hide the temperature adjustment buttons + this->displayAdapter->printf("vis %s,0", LCD_DASHBOARD_ELEMENT_NAME_AC_TEMP_UP_BUTTON); + this->sendStopBytes(); + this->displayAdapter->printf("vis %s,0", LCD_DASHBOARD_ELEMENT_NAME_AC_TEMP_DOWN_BUTTON); + this->sendStopBytes(); + + // Draw the mode picture set + // If it is not locked + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_COOL, drawn_mode == 2 ? (LCD_DASHBOARD_PIC_AC_MODE_COOL_ACTIVE_LOCKED) : LCD_DASHBOARD_PIC_AC_MODE_COOL_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_COOL, drawn_mode == 2 ? LCD_DASHBOARD_PIC_AC_MODE_COOL_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_MODE_COOL_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_FAN, drawn_mode == 1 ? LCD_DASHBOARD_PIC_AC_MODE_FAN_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_MODE_FAN_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_FAN, drawn_mode == 1 ? LCD_DASHBOARD_PIC_AC_MODE_FAN_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_MODE_FAN_INACTIVE); + this->sendStopBytes(); + // Draw fan speed auto picture set + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_AUTO, fan_speed == 0 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_AUTO, fan_speed == 0 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_LOW, fan_speed == 1 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_LOW, fan_speed == 1 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_MEDIUM, fan_speed == 2 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_MEDIUM, fan_speed == 2 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_HIGH, fan_speed == 3 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_HIGH, fan_speed == 3 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_ACTIVE_LOCKED : LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_INACTIVE); + this->sendStopBytes(); this->giveSerialMutex(); } else @@ -794,38 +830,46 @@ void CUDDisplay::refresh_display_ac() // Set Alpha of Locked Icon to 0 this->displayAdapter->printf("%s.aph=%d", LCD_DASHBOARD_ELEMENT_NAME_ICO_LOCK, 0); this->sendStopBytes(); + // Hide the ac container overlay + this->displayAdapter->printf("vis %s,0", LCD_DASHBOARD_ELEMENT_NAME_AC_PANEL_OVERLAY); + this->sendStopBytes(); + // Show the temperature adjustment buttons + this->displayAdapter->printf("vis %s,1", LCD_DASHBOARD_ELEMENT_NAME_AC_TEMP_UP_BUTTON); + this->sendStopBytes(); + this->displayAdapter->printf("vis %s,1", LCD_DASHBOARD_ELEMENT_NAME_AC_TEMP_DOWN_BUTTON); + this->sendStopBytes(); + // Draw the mode picture set + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_COOL, drawn_mode == 2 ? (LCD_DASHBOARD_PIC_AC_MODE_COOL_ACTIVE) : LCD_DASHBOARD_PIC_AC_MODE_COOL_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_COOL, drawn_mode == 2 ? LCD_DASHBOARD_PIC_AC_MODE_COOL_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_MODE_COOL_INACTIVE_PRESS); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_FAN, drawn_mode == 1 ? LCD_DASHBOARD_PIC_AC_MODE_FAN_ACTIVE : LCD_DASHBOARD_PIC_AC_MODE_FAN_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_FAN, drawn_mode == 1 ? LCD_DASHBOARD_PIC_AC_MODE_FAN_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_MODE_FAN_INACTIVE_PRESS); + this->sendStopBytes(); + this->giveSerialMutex(); + // Draw fan speed picture set + this->takeSerialMutex(); + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_AUTO, fan_speed == 0 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_ACTIVE : LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_AUTO, fan_speed == 0 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_INACTIVE_PRESS); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_LOW, fan_speed == 1 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_ACTIVE : LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_LOW, fan_speed == 1 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_INACTIVE_PRESS); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_MEDIUM, fan_speed == 2 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_ACTIVE : LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_MEDIUM, fan_speed == 2 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_INACTIVE_PRESS); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_HIGH, fan_speed == 3 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_ACTIVE : LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_INACTIVE); + this->sendStopBytes(); + this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_HIGH, fan_speed == 3 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_INACTIVE_PRESS); + this->sendStopBytes(); this->giveSerialMutex(); } - // Draw the mode picture set - this->takeSerialMutex(); - this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_COOL, drawn_mode == 2 ? LCD_DASHBOARD_PIC_AC_MODE_COOL_ACTIVE : LCD_DASHBOARD_PIC_AC_MODE_COOL_INACTIVE); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_COOL, drawn_mode == 2 ? LCD_DASHBOARD_PIC_AC_MODE_COOL_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_MODE_COOL_INACTIVE_PRESS); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_FAN, drawn_mode == 1 ? LCD_DASHBOARD_PIC_AC_MODE_FAN_ACTIVE : LCD_DASHBOARD_PIC_AC_MODE_FAN_INACTIVE); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_MODE_FAN, drawn_mode == 1 ? LCD_DASHBOARD_PIC_AC_MODE_FAN_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_MODE_FAN_INACTIVE_PRESS); - this->sendStopBytes(); - this->giveSerialMutex(); + // Draw the fan speed picture set - this->takeSerialMutex(); - this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_AUTO, fan_speed == 0 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_ACTIVE : LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_INACTIVE); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_AUTO, fan_speed == 0 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_FAN_SPEED_AUTO_INACTIVE_PRESS); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_LOW, fan_speed == 1 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_ACTIVE : LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_INACTIVE); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_LOW, fan_speed == 1 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_INACTIVE_PRESS); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_MEDIUM, fan_speed == 2 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_ACTIVE : LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_INACTIVE); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_MEDIUM, fan_speed == 2 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_INACTIVE_PRESS); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_HIGH, fan_speed == 3 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_ACTIVE : LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_INACTIVE); - this->sendStopBytes(); - this->displayAdapter->printf("%s.pic2=%d", LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_HIGH, fan_speed == 3 ? LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_ACTIVE_PRESS : LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_INACTIVE_PRESS); - this->sendStopBytes(); - this->giveSerialMutex(); // Draw the temperature this->takeSerialMutex(); this->displayAdapter->printf("%s.txt=\"%d\"", LCD_DASHBOARD_ELEMENT_NAME_AC_TEMPERATURE, temperature); diff --git a/src/lcd_elements.hpp b/src/lcd_elements.hpp index 48ddd9b..bd3bdb7 100644 --- a/src/lcd_elements.hpp +++ b/src/lcd_elements.hpp @@ -164,6 +164,7 @@ #define LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_LOW "btn_acfs_low" #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_ACTIVE 82 #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_ACTIVE_PRESS 81 +#define LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_ACTIVE_LOCKED 95 #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_INACTIVE 80 #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_LOW_INACTIVE_PRESS 79 @@ -171,6 +172,7 @@ #define LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_MEDIUM "btn_acfs_mid" #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_ACTIVE 86 #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_ACTIVE_PRESS 85 +#define LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_ACTIVE_LOCKED 94 #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_INACTIVE 84 #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_MEDIUM_INACTIVE_PRESS 83 @@ -178,6 +180,7 @@ #define LCD_DASHBOARD_ELEMENT_NAME_AC_FAN_SPEED_HIGH "btn_acfs_high" #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_ACTIVE 78 #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_ACTIVE_PRESS 77 +#define LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_ACTIVE_LOCKED 93 #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_INACTIVE 76 #define LCD_DASHBOARD_PIC_AC_FAN_SPEED_HIGH_INACTIVE_PRESS 75 @@ -193,6 +196,9 @@ #define LCD_DASHBOARD_ELEMENT_ROOM_TEMPERATURE 4 #define LCD_DASHBOARD_ELEMENT_NAME_ROOM_TEMPERATURE "txt_room_temp" +#define LCD_DASHBOARD_ELEMENT_AC_PANEL_OVERLAY 26 +#define LCD_DASHBOARD_ELEMENT_NAME_AC_PANEL_OVERLAY "pnl_ac_dim" + // All System Button #define LCD_DASHBOARD_ELEMENT_ALL_SYSTEM_TOGGLE 17 #define LCD_DASHBOARD_ELEMENT_NAME_ALL_SYSTEM_TOGGLE "btn_allsys"