|
|
@ -287,18 +287,20 @@ |
|
|
|
<div class="col-4 col-sm-9"><input type="checkbox" name="disp_pwr"/></div> |
|
|
|
</div> |
|
|
|
<div id="screenSaver"></div> |
|
|
|
<div class="row mb-3"> |
|
|
|
<div class="row mb-3" id="luminanceOption"> |
|
|
|
<div class="col-12 col-sm-3 my-2">{#DISP_LUMINANCE}</div> |
|
|
|
<div class="col-12 col-sm-9"><input type="number" name="disp_cont" min="0" max="255"></select></div> |
|
|
|
</div> |
|
|
|
<p class="des">{#DISP_PINOUT}</p> |
|
|
|
<div id="dispPins"></div> |
|
|
|
<div id="pirPin"></div> |
|
|
|
<p class="des">Graph options</p> |
|
|
|
<div id="graphSize"></div> |
|
|
|
<div class="row mb-3"> |
|
|
|
<div class="col-12 col-sm-3 my-2">Show ratio (0-100 %)</div> |
|
|
|
<div class="col-12 col-sm-9"><input type="number" name="disp_graph_ratio" min="0" max="100"></select></div> |
|
|
|
<div id="graphOptions"> |
|
|
|
<p class="des">{#GRAPH_OPTIONS}</p> |
|
|
|
<div id="graphSize"></div> |
|
|
|
<div class="row mb-3"> |
|
|
|
<div class="col-12 col-sm-3 my-2">{#GRAPH_SHOW_RATIO}</div> |
|
|
|
<div class="col-12 col-sm-9"><input type="number" name="disp_graph_ratio" min="0" max="100"></select></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</fieldset> |
|
|
|
</div> |
|
|
@ -1095,12 +1097,12 @@ |
|
|
|
|
|
|
|
document.getElementsByName("disp_graph_ratio")[0].value = obj["disp_graph_ratio"]; |
|
|
|
|
|
|
|
var opts2 = [[0, "Line 1 - 2"], [1, "Line 2 - 3"], [2, "Line 1 - 3"], [3, "Line 2 - 4"], [4, "Line 1 - 4"]]; |
|
|
|
var opts2 = [[0, "{#GRAPH_LINES_1_2}"], [1, "{#GRAPH_LINES_2_3}"], [2, "{#GRAPH_LINES_1_3}"], [3, "{#GRAPH_LINES_2_4}"], [4, "{#GRAPH_LINES_1_4}"]]; |
|
|
|
var graph_size_sel = sel("disp_graph_size", opts2, obj["disp_graph_size"]); |
|
|
|
graph_size_sel.id = 'disp_graph_size'; |
|
|
|
document.getElementById("graphSize").append( |
|
|
|
ml("div", {class: "row mb-3"}, [ |
|
|
|
ml("div", {class: "col-12 col-sm-3 my-2"}, "Graph size"), |
|
|
|
ml("div", {class: "col-12 col-sm-3 my-2"}, "{#GRAPH_POSITION}"), |
|
|
|
ml("div", {class: "col-12 col-sm-9"}, graph_size_sel) |
|
|
|
]) |
|
|
|
); |
|
|
@ -1113,14 +1115,14 @@ |
|
|
|
// It depends on fix pin array (see var pins) |
|
|
|
// var pins = [['clock', 'disp_clk'], ['data', 'disp_data'], ['cs', 'disp_cs'], ['dc', 'disp_dc'], ['reset', 'disp_rst']]; |
|
|
|
const pinMap = new Map([ |
|
|
|
[0, [0,0,0,0,0,0]], //none |
|
|
|
[1, [1,1,0,0,0,0]], //SSD1306_128X64 |
|
|
|
[2, [1,1,0,0,0,0]], //SH1106_128X64 |
|
|
|
[3, [1,1,1,1,0,0]], //PCD8544_84X48 /nokia5110 |
|
|
|
[4, [1,1,0,0,0,0]], //SSD1306_128X32 |
|
|
|
[5, [1,1,0,0,0,0]], //SSD1306_128x64 |
|
|
|
[6, [1,1,0,0,0,0]], //SSD1309_128x64 |
|
|
|
[10, [1,1,1,1,1,1]] //ePaper |
|
|
|
[0, [0,0,0,0,0,0]], //none |
|
|
|
[1, [1,1,0,0,0,0]], //SSD1306_128X64 |
|
|
|
[2, [1,1,0,0,0,0]], //SH1106_128X64 |
|
|
|
[3, [1,1,1,1,0,0]], //PCD8544_84X48 /nokia5110 |
|
|
|
[4, [1,1,0,0,0,0]], //SSD1306_128X32 |
|
|
|
[5, [1,1,0,0,0,0]], //SSD1306_64X48 |
|
|
|
[6, [1,1,0,0,0,0]], //SSD1309_128x64 |
|
|
|
[10, [1,1,1,1,1,1]] //ePaper |
|
|
|
]) |
|
|
|
for(var i = 0; i < pins.length; i++) { |
|
|
|
var cl = document.getElementById("row_" + pins[i][1]).classList; |
|
|
@ -1132,14 +1134,22 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var screenSaver = document.getElementById("disp_screensaver").value; |
|
|
|
const optionsMap = new Map([ // options: [Graph, Luminance, Screensaver] |
|
|
|
[0, [0,0,0]], //none |
|
|
|
[1, [1,1,1]], //SSD1306_128X64 |
|
|
|
[2, [1,1,1]], //SH1106_128X64 |
|
|
|
[3, [1,1,0]], //PCD8544_84X48 /nokia5110 |
|
|
|
[4, [0,1,1]], //SSD1306_128X32 |
|
|
|
[5, [0,1,1]], //SSD1306_64X48 |
|
|
|
[6, [1,1,1]], //SSD1309_128x64 |
|
|
|
[10, [0,0,0]] //ePaper |
|
|
|
]) |
|
|
|
|
|
|
|
if (2==screenSaver) { // show pir pin only for motion screensaver |
|
|
|
setHide("pirPin", false); |
|
|
|
} |
|
|
|
else { // no pir pin for all others |
|
|
|
setHide("pirPin", true); |
|
|
|
} |
|
|
|
var screenSaver = document.getElementById("disp_screensaver").value; |
|
|
|
setHide("graphOptions", !optionsMap.get(dispType)[0]); |
|
|
|
setHide("luminanceOption", !optionsMap.get(dispType)[1]); |
|
|
|
setHide("screenSaver", !optionsMap.get(dispType)[2]); |
|
|
|
setHide("pirPin", !(optionsMap.get(dispType)[2] && (screenSaver==2))); // show pir pin only for motion screensaver |
|
|
|
} |
|
|
|
|
|
|
|
function tick() { |
|
|
|