Skip to content

Commit

Permalink
update rectification program
Browse files Browse the repository at this point in the history
  • Loading branch information
LKosoj committed Jul 3, 2022
1 parent faabff9 commit a2bd0ef
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Samovar.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#error This code is designed to run on ESP32 platform, not Arduino nor ESP8266! Please check your Tools->Board setting.
#endif

#define SAMOVAR_VERSION "5.09"
#define SAMOVAR_VERSION "5.10"
//#define __SAMOVAR_DEBUG

#include <OneWire.h>
Expand Down
41 changes: 25 additions & 16 deletions data/program.htm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@
reader.readAsText(file, "UTF-8");
}

function getProgramFromFile(selectObject){
var value = selectObject.value;
var fn;
if (value == 0) fn = '/program_fruit.txt';
else if (value == 1) fn = '/program_grain.txt';
else if (value == 2) fn = '/program_shugar.txt';

fetch(fn)
.then(response => response.text())
.then((data) => {
document.getElementById('WProgram1').value = data
glcalcnum = false;
calc_program();
})
}

function SaveProgramToFile() {
var filename, text;
filename = 'programbackup.txt';
Expand Down Expand Up @@ -357,7 +373,7 @@
}

window.onload = function() {
calc_program();
getProgramFromFile(document.getElementById("loadprogram"));
return;
getProgram();
document.getElementById("WProgram1").addEventListener("change", function(event) {
Expand All @@ -381,7 +397,13 @@ <h1>
<div class="message-box" style="display: none;" id="message"></div>
Samovar v. <span id='version'>%v%</span>
</h1>
<div class="text">Расчет программы отбора</div>
<div class="text">Расчет программы отбора
<select id="loadprogram" name="loadprogram" onchange="getProgramFromFile(this)">
<option value="0">Фрукты</option>
<option value="1">Зерно</option>
<option value="2">Сахар</option>
</select>
</div>
<div class="tabcontent" style="display: block;border-top: solid;border-top-width: 1px;border-top-color: rgb(204, 204, 204);">
<div class="container_row" style="border: 1px dashed #bbb; margin-bottom: 1em;">
<div id="Prog">
Expand Down Expand Up @@ -433,20 +455,7 @@ <h1>
</div>

<div>
<textarea cols="40" rows="15" id='WProgram1' name='WProgram1' style="visibility: hidden;position: absolute;width: 20;">
0;0.07;25;H;135
0;0.1;15;H;0
1;0.3;20;H;0
2;0.4;20;H;0
3;0.4;20;H;0
0;300;0;P;145
4;1.4;10;B;0
5;0.9;40;B;0
0;300;0;P;170
6;1.2;40;C;0
7;1;10;B;0
8;0.2;10;T;160
9;0.1;10;T;0</textarea>
<textarea cols="40" rows="15" id='WProgram1' name='WProgram1' style="visibility: hidden;position: absolute;width: 20;"></textarea>
<textarea cols="40" rows="15" id='WProgram' name='WProgram' style="visibility: hidden;position: absolute;width: 20;">%WProgram%</textarea>
</div>

Expand Down
26 changes: 13 additions & 13 deletions data/program_fruit.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
0;0.07;25;H;135
0;0.1;15;H;0
1;0.3;20;H;0
2;0.4;20;H;0
3;0.4;20;H;140
0;400;0;P;145
4;1.4;10;B;140
4;1;30;B;0
0;0.07;30;H;135
0;0.1;20;H;0
1;0.2;20;H;0
2;0.3;20;H;0
3;0.4;10;H;140
0;300;0;P;145
4;1;10;B;140
4;0.9;40;B;0
0;200;0;P;173
0;200;0;P;170
5;1.2;50;C;165
6;0.9;5;B;140
6;0.7;3;B;137
6;0.5;2;B;135
7;0.2;10;T;160
5;1.1;40;C;165
6;0.9;5;C;0
6;0.7;3;C;0
6;0.5;2;B;140
7;0.2;10;T;140
8;0.1;10;T;0
18 changes: 9 additions & 9 deletions data/program_grain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
1;0.2;20;H;0
2;0.3;20;H;0
3;0.4;10;H;140
0;300;0;P;143
4;1.4;10;B;0
5;0.9;40;B;0
0;300;0;P;145
4;1;10;B;140
4;0.9;40;B;0
0;200;0;P;175
0;200;0;P;170
5;1.2;40;C;166
6;0.8;5;B;140
6;0.6;5;B;0
5;1.1;40;C;166
6;0.8;5;C;0
6;0.6;3;C;0
6;0.4;2;B;140
7;0.2;10;T;140
8;0.4;30;T;0
8;0.4;30;T;160
9;0.5;60;T;0
9;1.4;40;T;0
9;1.4;40;T;0
10;1.4;40;T;0
10;1.4;40;T;0
24 changes: 13 additions & 11 deletions data/program_shugar.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
1;0.07;30;H;135
1;0.1;30;H;0
2;0.2;20;H;0
3;0.3;10;H;0
4;0.4;10;H;150
0;0.07;30;H;135
0;0.1;20;H;0
1;0.2;20;H;0
2;0.3;20;H;0
3;0.4;10;H;155
0;200;0;P;175
0;300;0;P;173
5;1.2;10;C;166
6;1.2;70;C;0
7;0.8;10;B;140
8;0.6;10;B;135
9;0.3;10;T;120
10;0.2;10;T;0
4;1.1;10;C;170
4;1.1;35;C;0
5;1.1;35;C;0
5;0.8;10;C;0
6;0.6;5;C;0
7;0.4;3;C;0
8;0.3;2;B;140
9;0.3;10;T;120

0 comments on commit a2bd0ef

Please sign in to comment.