From 822753bb4f3f4dcb76d8fbc2fc2665d13f9b56b0 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 30 Aug 2024 00:18:35 +0200 Subject: [PATCH] Update MainFlowControl.cpp --- .../jomjol_flowcontroll/MainFlowControl.cpp | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/code/components/jomjol_flowcontroll/MainFlowControl.cpp b/code/components/jomjol_flowcontroll/MainFlowControl.cpp index d64e4056..684e3caf 100644 --- a/code/components/jomjol_flowcontroll/MainFlowControl.cpp +++ b/code/components/jomjol_flowcontroll/MainFlowControl.cpp @@ -969,16 +969,33 @@ esp_err_t handler_editflow(httpd_req_t *req) if (httpd_query_key_value(_query, "aecgc", _valuechar, 30) == ESP_OK) { - int _aecgc = std::stoi(_valuechar); - switch (_aecgc) + std::string _aecgc = std::string(_valuechar); + if (isStringNumeric(_aecgc)) { - case 1: CFstatus.ImageGainceiling = GAINCEILING_4X; break; - case 2: CFstatus.ImageGainceiling = GAINCEILING_8X; break; - case 3: CFstatus.ImageGainceiling = GAINCEILING_16X; break; - case 4: CFstatus.ImageGainceiling = GAINCEILING_32X; break; - case 5: CFstatus.ImageGainceiling = GAINCEILING_64X; break; - case 6: CFstatus.ImageGainceiling = GAINCEILING_128X; break; - default: CFstatus.ImageGainceiling = GAINCEILING_2X; + int _aecgc_ = std::stoi(_valuechar); + switch (_aecgc_) + { + case 1: + CFstatus.ImageGainceiling = GAINCEILING_4X; + break; + case 2: + CFstatus.ImageGainceiling = GAINCEILING_8X; + break; + case 3: + CFstatus.ImageGainceiling = GAINCEILING_16X; + break; + case 4: + CFstatus.ImageGainceiling = GAINCEILING_32X; + break; + case 5: + CFstatus.ImageGainceiling = GAINCEILING_64X; + break; + case 6: + CFstatus.ImageGainceiling = GAINCEILING_128X; + break; + default: + CFstatus.ImageGainceiling = GAINCEILING_2X; + } } }