diff --git a/code/lib/jomjol_flowcontroll/ClassFlowControll.cpp b/code/lib/jomjol_flowcontroll/ClassFlowControll.cpp index 7bfdf9c2..87194e38 100644 --- a/code/lib/jomjol_flowcontroll/ClassFlowControll.cpp +++ b/code/lib/jomjol_flowcontroll/ClassFlowControll.cpp @@ -124,7 +124,7 @@ bool ClassFlowControll::doFlow(string time) string ClassFlowControll::getReadout(bool _rawvalue = false) { if (flowpostprocessing) - return flowpostprocessing->getReadout(); + return flowpostprocessing->getReadoutParam(_rawvalue); string zw = ""; string result = ""; diff --git a/code/lib/jomjol_flowcontroll/ClassFlowPostProcessing.cpp b/code/lib/jomjol_flowcontroll/ClassFlowPostProcessing.cpp index 6e7b3bb5..13e90f80 100644 --- a/code/lib/jomjol_flowcontroll/ClassFlowPostProcessing.cpp +++ b/code/lib/jomjol_flowcontroll/ClassFlowPostProcessing.cpp @@ -244,13 +244,14 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) if (isanalog) ReturnValue = ReturnValue + analog; + ReturnRawValue = ReturnValue; + if ((findDelimiterPos(ReturnValue, "N") == std::string::npos) && (ReturnValue.length() > 0)) { while ((ReturnValue.length() > 1) && (ReturnValue[0] == '0')) { ReturnValue.erase(0, 1); } - ReturnRawValue = ReturnValue; Value = std::stof(ReturnValue); SavePreValue(Value, zwtime); } diff --git a/code/lib/jomjol_time_sntp/time_sntp.cpp b/code/lib/jomjol_time_sntp/time_sntp.cpp index e6c796bf..dc0f6d64 100644 --- a/code/lib/jomjol_time_sntp/time_sntp.cpp +++ b/code/lib/jomjol_time_sntp/time_sntp.cpp @@ -48,7 +48,7 @@ std::string gettimestring(const char * frm) time(&now); localtime_r(&now, &timeinfo); // Is time set? If not, tm_year will be (1970 - 1900). - if (setTimeAlwaysOnReboot || (timeinfo.tm_year < (2016 - 1900))) { + if (timeinfo.tm_year < (2016 - 1900)) { ESP_LOGI(TAG, "Reboot - Connecting to WiFi and getting time over NTP."); obtain_time(); // update 'now' variable with current time @@ -77,27 +77,20 @@ void setup_time(void) // Is time set? If not, tm_year will be (1970 - 1900). if (timeinfo.tm_year < (2016 - 1900)) { ESP_LOGI(TAG, "Time is not set yet. Connecting to WiFi and getting time over NTP."); + initialize_sntp(); obtain_time(); // update 'now' variable with current time time(&now); } + else + { + if (setTimeAlwaysOnReboot) + { + obtain_time(); + } + } char strftime_buf[64]; -/* - // Set timezone to Eastern Standard Time and print local time - setenv("TZ", "EST5EDT,M3.2.0/2,M11.1.0", 1); - tzset(); - localtime_r(&now, &timeinfo); - strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo); - ESP_LOGI(TAG, "The current date/time in New York is: %s", strftime_buf); - - // Set timezone to China Standard Time - setenv("TZ", "CST-8", 1); - tzset(); - localtime_r(&now, &timeinfo); - strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo); - ESP_LOGI(TAG, "The current date/time in Shanghai is: %s", strftime_buf); -*/ // Set timezone to Berlin Standard Time setenv("TZ", "UTC+9", 1); tzset(); @@ -112,9 +105,10 @@ void setup_time(void) printf("time %s\n", zw.c_str()); } + static void obtain_time(void) { - initialize_sntp(); +// initialize_sntp(); // wait for time to be set time_t now = 0; diff --git a/firmware/firmware.bin b/firmware/firmware.bin index 83fb7753..7363d5fc 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ