Skip to content

Commit 67115dd

Browse files
authored
Merge pull request #29 from jomjol/rolling
Update to v2.2.0
2 parents 480da7c + cefe125 commit 67115dd

File tree

22 files changed

+792
-194
lines changed

22 files changed

+792
-194
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,30 @@ A 3d-printable housing can be found here: https://www.thingiverse.com/thing:4571
2727

2828

2929

30-
##### Rolling - (2020-09-25)
30+
##### Rolling - (2020-09-27)
3131

32-
* based on v2.1.0 (2020-09-25)
32+
* based on v2.2.0 (2020-09-27)
3333

3434

3535

36-
##### 2.1.0 Layout update (2020-09-25)
36+
37+
##### 2.2.0 Version Controll (2020-09-27)
38+
39+
* Integrated automated versioning system (menu: SYSTEM --> INFO)
40+
* Update Build-System to PlatformIO - Espressif 32 v2.0.0 (ESP-IDF 4.1)
41+
42+
43+
44+
45+
##### 2.1.0 Decimal Shift, Chrome & Edge (2020-09-25)
3746

3847
* Implementation of Decimal Shift
3948

4049
* Update default CNN for digits to v6.4.0
4150

4251
* Improvement HTML
4352

44-
* Support for Chrome and Firefox
53+
* Support for Chrome and Edge
4554

4655
* Reduce logging to minimum - extended logging on demand
4756

code/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,12 @@ list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/proto
44

55
set(PROJECT_VER "0.0.9.3")
66

7+
ADD_CUSTOM_COMMAND(
8+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.cpp
9+
${CMAKE_CURRENT_BINARY_DIR}/_version.cpp
10+
COMMAND ${CMAKE_COMMAND} -P
11+
${CMAKE_CURRENT_SOURCE_DIR}/version.cmake)
12+
13+
714
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
815
project(esp32cam-server-only)

code/lib/jomjol_fileserver_ota/server_file.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static esp_err_t download_get_handler(httpd_req_t *req)
258258
return ESP_FAIL;
259259
}
260260

261-
esp_err_t res = httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
261+
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
262262

263263
ESP_LOGI(TAG, "Sending file : %s (%ld bytes)...", filename, file_stat.st_size);
264264
set_content_type_from_file(req, filename);
@@ -437,7 +437,6 @@ static esp_err_t delete_post_handler(httpd_req_t *req)
437437

438438
//////////////////////////////////////////////////////////////
439439
char _query[200];
440-
char _filename[30];
441440
char _valuechar[30];
442441
std::string fn = "/sdcard/firmware/";
443442
std::string _task;
@@ -576,8 +575,6 @@ void unzip(std::string _in_zip_file, std::string _target_directory){
576575
size_t uncomp_size;
577576
mz_zip_archive zip_archive;
578577
void* p;
579-
const int N = 50;
580-
char data[2048];
581578
char archive_filename[64];
582579
std::string zw;
583580
// static const char* s_Test_archive_filename = "testhtml.zip";

code/lib/jomjol_flowcontroll/ClassFlowAnalog.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,14 @@ bool ClassFlowAnalog::doAlignAndCut(string time)
171171
return false;
172172
}
173173

174-
if (input_roi.length() > 0)
175-
img_roi = new CImageBasis(input_roi);
174+
if (input_roi.length() > 0){
175+
img_roi = new CImageBasis(input_roi);
176+
if (!img_roi->ImageOkay()){
177+
LogFile.WriteToFile("ClassFlowAnalog::doAlignAndCut ImageRoi not okay!");
178+
delete img_roi;
179+
return false;
180+
}
181+
}
176182

177183
for (int i = 0; i < ROI.size(); ++i)
178184
{

code/lib/jomjol_flowcontroll/ClassFlowControll.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "server_ota.h"
77

88
std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _host){
9-
bool found = false;
109
std::string _classname = "";
1110
std::string result = "";
1211
if (_stepname.compare("[MakeImage]") == 0){
@@ -29,7 +28,6 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _
2928
// printf(FlowControll[i]->name().c_str()); printf("\n");
3029
FlowControll[i]->doFlow("");
3130
result = FlowControll[i]->getHTMLSingleStep(_host);
32-
found = true;
3331
}
3432

3533
return result;

code/lib/jomjol_flowcontroll/ClassFlowDigit.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,15 @@ bool ClassFlowDigit::doAlignAndCut(string time)
149149
return false;
150150
}
151151

152-
if (input_roi.length() > 0)
152+
if (input_roi.length() > 0){
153153
img_roi = new CImageBasis(input_roi);
154+
if (!img_roi->ImageOkay()){
155+
LogFile.WriteToFile("ClassFlowAnalog::doAlignAndCut ImageRoi not okay!");
156+
delete img_roi;
157+
return false;
158+
}
159+
}
160+
154161

155162

156163
for (int i = 0; i < ROI.size(); ++i)

code/lib/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,15 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
329329
return true;
330330
}
331331

332-
zw = ErsetzteN(ReturnRawValue);
332+
zw = ErsetzteN(ReturnRawValue);
333+
333334

334335
Value = std::stof(zw);
336+
if (checkDigitIncreaseConsistency)
337+
{
338+
// Value = checkDigitConsistency(Value, DecimalShift, isanalog);
339+
}
340+
335341
zwvalue = RundeOutput(Value, AnzahlAnalog - DecimalShift);
336342

337343
if ((!AllowNegativeRates) && (Value < PreValue))
@@ -413,39 +419,40 @@ string ClassFlowPostProcessing::ErsetzteN(string input)
413419
return input;
414420
}
415421

416-
string ClassFlowPostProcessing::checkDigitConsistency(string input, int _decilamshift, int lastvalueanalog){
417-
/*
418-
if (checkDigitIncreaseConsistency && lastvalueanalog > -1)
422+
float ClassFlowPostProcessing::checkDigitConsistency(float input, int _decilamshift, bool _isanalog){
423+
int aktdigit, olddigit;
424+
int aktdigit_before, olddigit_before;
425+
int pot, pot_max;
426+
float zw;
427+
428+
pot = _decilamshift;
429+
if (!_isanalog) // falls es keine analogwerte gibt, kann die letzte nicht bewerte werden
419430
{
420-
int zifferIST;
421-
// int substrakt = 0;
422-
bool lastcorrected = false;
423-
for (int i = input.length() - 1; i >= 0; --i)
424-
{
425-
zifferIST = input[i] - 48; //std::stoi(std::string(input[i]));
426-
if (lastcorrected)
427-
{
428-
zifferIST--;
429-
input[i] = zifferIST + 48;
430-
lastcorrected = false;
431-
}
431+
pot++;
432+
}
433+
pot_max = ((int) log10(input)) + 1;
434+
435+
while (pot <= pot_max)
436+
{
437+
zw = input / pow(10, pot-1);
438+
aktdigit_before = ((int) zw) % 10;
439+
zw = PreValue / pow(10, pot-1);
440+
olddigit_before = ((int) zw) % 10;
441+
442+
zw = input / pow(10, pot);
443+
aktdigit = ((int) zw) % 10;
444+
zw = PreValue / pow(10, pot);
445+
olddigit = ((int) zw) % 10;
432446

433-
pot = posPunkt - i - 1;
434-
zw = PreValue / pow(10, pot);
435-
ziffer = ((int) zw) % 10;
436-
if (zifferIST < ziffer)
447+
if (aktdigit != olddigit) {
448+
if (olddigit_before <= aktdigit_before) // stelle vorher hat noch keinen Nulldurchgang --> nachfolgestelle sollte sich nicht verändern
437449
{
438-
if (lastvalueanalog >= 7)
439-
{
440-
input[i] = ziffer + 48;
441-
lastvalueanalog = ziffer;
442-
lastcorrected = true;
443-
}
450+
input = input + ((float) (olddigit - aktdigit)) * pow(10, pot); // Neue Digit wird durch alte Digit ersetzt;
444451
}
445-
446-
447452
}
453+
454+
pot++;
448455
}
449-
*/
456+
450457
return input;
451458
}

code/lib/jomjol_flowcontroll/ClassFlowPostProcessing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ClassFlowPostProcessing :
99
{
1010
protected:
1111
bool PreValueUse;
12-
int PreValueAgeStartup;
12+
int PreValueAgeStartup;
1313
bool AllowNegativeRates;
1414
float MaxRateValue;
1515
bool useMaxRateValue;
@@ -29,7 +29,7 @@ class ClassFlowPostProcessing :
2929
string ShiftDecimal(string in, int _decShift);
3030

3131
string ErsetzteN(string);
32-
string checkDigitConsistency(string, int _decilamshift, int lastvalueanalog = -1);
32+
float checkDigitConsistency(float input, int _decilamshift, bool _isanalog);
3333
string RundeOutput(float _in, int _anzNachkomma);
3434

3535
public:

code/lib/jomjol_image_proc/CFindTemplate.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,6 @@ void CAlignAndCutImage::CutAndSave(std::string _template1, int x1, int y1, int d
528528
int memsize = dx * dy * this->channels;
529529
uint8_t* odata = (unsigned char*)GET_MEMORY(memsize);
530530

531-
532-
int x_source, y_source;
533531
stbi_uc* p_target;
534532
stbi_uc* p_source;
535533

0 commit comments

Comments
 (0)