Compare commits
No commits in common. "66873fa7355439326915c424a3718b58c1f80f94" and "ec8072a1a6e98ce40d06cfff77e6c94655d6c094" have entirely different histories.
66873fa735
...
ec8072a1a6
13 changed files with 179 additions and 169 deletions
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 2 MiB After Width: | Height: | Size: 2 MiB |
Binary file not shown.
|
@ -95,17 +95,34 @@ var indexFloat = lowerIndex + timeDiff / ((upperTime[0] - lowerTime[0]) + ((uppe
|
|||
if (indexFloat > index) {
|
||||
index = indexFloat;
|
||||
}
|
||||
var traces = [];
|
||||
for (var i = 1; i <= 4; i++) {
|
||||
var trace = {
|
||||
var trace1 = {
|
||||
x: time,
|
||||
y: eval("channel" + i),
|
||||
name: 'Channel ' + i,
|
||||
y: channel1,
|
||||
name: 'Channel 1',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace2 = {
|
||||
x: time,
|
||||
y: channel2,
|
||||
name: 'Channel 2',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace3 = {
|
||||
x: time,
|
||||
y: channel3,
|
||||
name: 'Channel 3',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace4 = {
|
||||
x: time,
|
||||
y: channel4,
|
||||
name: 'Channel 4',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
traces.push(trace);
|
||||
}
|
||||
var layout = {
|
||||
title: 'Timing Control Data Blocks',
|
||||
xaxis: {
|
||||
|
@ -129,7 +146,7 @@ dash: 'dot'
|
|||
}
|
||||
}]
|
||||
};
|
||||
Plotly.newPlot('plot_chart', traces, layout);
|
||||
Plotly.newPlot('plot_chart', [trace1, trace2, trace3, trace4], layout);
|
||||
});
|
||||
}
|
||||
setInterval(loadGraphData, 10000);
|
||||
|
@ -189,17 +206,34 @@ var indexFloat = lowerIndex + timeDiff / ((upperTime[0] - lowerTime[0]) + ((uppe
|
|||
if (indexFloat > index) {
|
||||
index = indexFloat;
|
||||
}
|
||||
var traces = [];
|
||||
for (var i = 1; i <= 4; i++) {
|
||||
var trace = {
|
||||
var trace1 = {
|
||||
x: time,
|
||||
y: eval("channel" + i),
|
||||
name: 'Channel ' + i,
|
||||
y: channel1,
|
||||
name: 'Channel 1',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace2 = {
|
||||
x: time,
|
||||
y: channel2,
|
||||
name: 'Channel 2',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace3 = {
|
||||
x: time,
|
||||
y: channel3,
|
||||
name: 'Channel 3',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace4 = {
|
||||
x: time,
|
||||
y: channel4,
|
||||
name: 'Channel 4',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
traces.push(trace);
|
||||
}
|
||||
var layout = {
|
||||
title: 'Timing Control Data Blocks',
|
||||
xaxis: {
|
||||
|
@ -223,7 +257,7 @@ dash: 'dot'
|
|||
}
|
||||
}]
|
||||
};
|
||||
Plotly.newPlot('tc_plot_chart', traces, layout);
|
||||
Plotly.newPlot('tc_plot_chart', [trace1, trace2, trace3, trace4], layout);
|
||||
var plot = document.getElementById('tc_plot_chart');
|
||||
}
|
||||
function rgbaToHex(rgba) {
|
||||
|
@ -451,11 +485,6 @@ showToast('Error while verifying timing control data. The timestamps are not inc
|
|||
return null;
|
||||
}
|
||||
}
|
||||
if (tcdata[0].ch1 > 0 || tcdata[0].ch2 > 0 || tcdata[0].ch3 > 0 || tcdata[0].ch4 > 0 ||
|
||||
tcdata[9].ch1 > 0 || tcdata[9].ch2 > 0 || tcdata[9].ch3 > 0 || tcdata[9].ch4 > 0) {
|
||||
showToast('Error: Values for ch1 to ch4 must be 0 for the first and last entry.', 'error');
|
||||
return null;
|
||||
}
|
||||
var currentTime = {hour: new Date().getHours(), min: new Date().getMinutes()};
|
||||
var jsonData = {tcdata: tcdata, currenttime: currentTime};
|
||||
return JSON.stringify(jsonData);
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
</tr>
|
||||
</table>
|
||||
<a href="#" id="save-button" class="pure-button pure-button-primary" onclick="sendDataToServer();">save</a>
|
||||
<a href="#" id="save-button" class="pure-button pure-button-primary" onclick="fillTableFromJson();">reset</a>
|
||||
</div>
|
||||
</div> <!-- end of tab-tde -->
|
||||
<script src="http://{{IP_ADDRESS}}/js_bottom">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Light setup - {{LIGHT_NAME}}{{LIGHT_NAME_DEV_POSTFIX}}</title>
|
||||
<title>Light setup - {{LIGHT_NAME}}</title>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
|
||||
|
|
|
@ -1,24 +1,20 @@
|
|||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
#tab-lights,
|
||||
#tab-config,
|
||||
#tab-tde {
|
||||
#tab-lights, #tab-config, #tab-tde {
|
||||
display: none;
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#tab-lights.visible,
|
||||
#tab-config.visible,
|
||||
#tab-lights.visible {
|
||||
display: block;
|
||||
}
|
||||
#tab-config.visible {
|
||||
display: block;
|
||||
}
|
||||
#tab-tde.visible {
|
||||
display: block;
|
||||
}
|
||||
.pure-table td {
|
||||
padding: 4px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.pure-form input[type="number"] {
|
||||
width: 60px;
|
||||
|
@ -45,6 +41,9 @@ cursor: pointer;
|
|||
.pure-button:hover {
|
||||
background-color: #333;
|
||||
}
|
||||
.top-align {
|
||||
vertical-align: top;
|
||||
}
|
||||
.toast {
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
|
@ -60,7 +59,7 @@ opacity: 0;
|
|||
transition: opacity 0.5s ease-in-out;
|
||||
}
|
||||
.toast.success {
|
||||
background-color: #4caf50;
|
||||
background-color: #4CAF50;
|
||||
}
|
||||
.toast.error {
|
||||
background-color: #f44336;
|
||||
|
@ -76,8 +75,5 @@ input[type=range]:focus {
|
|||
outline: none;
|
||||
}
|
||||
[id^="bri"] {
|
||||
width: 50%;
|
||||
}
|
||||
.top-align {
|
||||
vertical-align: top;
|
||||
width: 50%;
|
||||
}
|
|
@ -9,6 +9,7 @@ function addTabListener() {
|
|||
var acfg = document.getElementById("tab-a-config");
|
||||
var atde = document.getElementById("tab-a-tde");
|
||||
|
||||
|
||||
amain.addEventListener("click", function() {
|
||||
//console.log("Switch to main lights tab");
|
||||
tabMain.classList.add("visible");
|
||||
|
@ -120,18 +121,34 @@ function loadGraphData() {
|
|||
index = indexFloat;
|
||||
}
|
||||
//console.log("index in graph >>>" + index);
|
||||
var traces = [];
|
||||
for (var i = 1; i <= 4; i++) {
|
||||
var trace = {
|
||||
x: time,
|
||||
y: eval("channel" + i),
|
||||
name: 'Channel ' + i,
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
|
||||
traces.push(trace);
|
||||
}
|
||||
var trace1 = {
|
||||
x: time,
|
||||
y: channel1,
|
||||
name: 'Channel 1',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace2 = {
|
||||
x: time,
|
||||
y: channel2,
|
||||
name: 'Channel 2',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace3 = {
|
||||
x: time,
|
||||
y: channel3,
|
||||
name: 'Channel 3',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace4 = {
|
||||
x: time,
|
||||
y: channel4,
|
||||
name: 'Channel 4',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var layout = {
|
||||
title: 'Timing Control Data Blocks',
|
||||
xaxis: {
|
||||
|
@ -155,7 +172,7 @@ function loadGraphData() {
|
|||
}
|
||||
}]
|
||||
};
|
||||
Plotly.newPlot('plot_chart', traces, layout);
|
||||
Plotly.newPlot('plot_chart', [trace1, trace2, trace3, trace4], layout);
|
||||
});
|
||||
}
|
||||
setInterval(loadGraphData, 10000);
|
||||
|
@ -229,18 +246,34 @@ function loadTCGraphData() {
|
|||
index = indexFloat;
|
||||
}
|
||||
//console.log("index in graph >>>" + index);
|
||||
var traces = [];
|
||||
for (var i = 1; i <= 4; i++) {
|
||||
var trace = {
|
||||
x: time,
|
||||
y: eval("channel" + i),
|
||||
name: 'Channel ' + i,
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
|
||||
traces.push(trace);
|
||||
}
|
||||
var trace1 = {
|
||||
x: time,
|
||||
y: channel1,
|
||||
name: 'Channel 1',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace2 = {
|
||||
x: time,
|
||||
y: channel2,
|
||||
name: 'Channel 2',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace3 = {
|
||||
x: time,
|
||||
y: channel3,
|
||||
name: 'Channel 3',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var trace4 = {
|
||||
x: time,
|
||||
y: channel4,
|
||||
name: 'Channel 4',
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers',
|
||||
};
|
||||
var layout = {
|
||||
title: 'Timing Control Data Blocks',
|
||||
xaxis: {
|
||||
|
@ -264,7 +297,7 @@ function loadTCGraphData() {
|
|||
}
|
||||
}]
|
||||
};
|
||||
Plotly.newPlot('tc_plot_chart', traces, layout);
|
||||
Plotly.newPlot('tc_plot_chart', [trace1, trace2, trace3, trace4], layout);
|
||||
|
||||
var plot = document.getElementById('tc_plot_chart'); // Das HTML-Div-Element, in dem der Plot angezeigt wird
|
||||
}
|
||||
|
@ -559,14 +592,7 @@ function createJsonFromTable() {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Überprüft die Werte für ch1 bis ch4 bei i=0 und i=9
|
||||
if (tcdata[0].ch1 > 0 || tcdata[0].ch2 > 0 || tcdata[0].ch3 > 0 || tcdata[0].ch4 > 0 ||
|
||||
tcdata[9].ch1 > 0 || tcdata[9].ch2 > 0 || tcdata[9].ch3 > 0 || tcdata[9].ch4 > 0) {
|
||||
showToast('Error: Values for ch1 to ch4 must be 0 for the first and last entry.', 'error');
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
var currentTime = {hour: new Date().getHours(), min: new Date().getMinutes()};
|
||||
var jsonData = {tcdata: tcdata, currenttime: currentTime};
|
||||
//console.log("jsonData = " + JSON.stringify(jsonData));
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
</table>
|
||||
|
||||
<a href="#" id="save-button" class="pure-button pure-button-primary" onclick="sendDataToServer();">save</a>
|
||||
<a href="#" id="save-button" class="pure-button pure-button-primary" onclick="fillTableFromJson();">reset</a>
|
||||
</div>
|
||||
</div> <!-- end of tab-tde -->
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Light setup - {{LIGHT_NAME}}{{LIGHT_NAME_DEV_POSTFIX}}</title>
|
||||
<title>Light setup - {{LIGHT_NAME}}</title>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
|
||||
|
|
|
@ -1,107 +1,79 @@
|
|||
/* Vereinheitlichter Look */
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
#tab-lights, #tab-config, #tab-tde {
|
||||
display: none;
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Gemeinsame Regeln für die Tabs */
|
||||
#tab-lights,
|
||||
#tab-config,
|
||||
#tab-tde {
|
||||
display: none;
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
border-radius: 3px;
|
||||
#tab-lights.visible {
|
||||
display: block;
|
||||
}
|
||||
#tab-config.visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Sichtbarkeitsregeln für die Tabs */
|
||||
#tab-lights.visible,
|
||||
#tab-config.visible,
|
||||
#tab-tde.visible {
|
||||
display: block;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Gemeinsame Regeln für Tabellenzellen */
|
||||
.pure-table td {
|
||||
padding: 4px;
|
||||
vertical-align: top;
|
||||
/* Hinzugefügt: vertikale Ausrichtung oben */
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
/* Stil für Formularelemente */
|
||||
.pure-form input[type="number"] {
|
||||
width: 60px;
|
||||
height: 20px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #ccc;
|
||||
width: 60px;
|
||||
height: 20px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.pure-form select {
|
||||
width: 80px;
|
||||
height: 26px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #ccc;
|
||||
background-color: #fff;
|
||||
width: 80px;
|
||||
height: 26px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #ccc;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* Stil für Buttons */
|
||||
.pure-button {
|
||||
background-color: #5a5a5a;
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
border: none;
|
||||
padding: 8px 12px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
background-color: #5a5a5a;
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
border: none;
|
||||
padding: 8px 12px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pure-button:hover {
|
||||
background-color: #333;
|
||||
background-color: #333;
|
||||
}
|
||||
.top-align {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* Stil für die Toast-Nachrichten */
|
||||
.toast {
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
transition: opacity 0.5s ease-in-out;
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
transition: opacity 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.toast.success {
|
||||
background-color: #4caf50;
|
||||
background-color: #4CAF50;
|
||||
}
|
||||
|
||||
.toast.error {
|
||||
background-color: #f44336;
|
||||
background-color: #f44336;
|
||||
}
|
||||
|
||||
/* Stil für den Range-Slider */
|
||||
input[type=range] {
|
||||
-webkit-appearance: none;
|
||||
width: 70%;
|
||||
height: 7px;
|
||||
margin: 4px 0;
|
||||
background-color: #ddd;
|
||||
-webkit-appearance: none;
|
||||
width: 70%;
|
||||
height: 7px;
|
||||
margin: 4px 0;
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
input[type=range]:focus {
|
||||
outline: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Spezifischer Stil für Elemente mit ID, die mit "bri" beginnen */
|
||||
[id^="bri"] {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.top-align {
|
||||
vertical-align: top;
|
||||
}
|
|
@ -4,10 +4,7 @@
|
|||
sed -e 's/^[[:space:]]*//' -e '/^\/\/.*/d' $1 |
|
||||
# Remove one line comments starting with //
|
||||
sed -e 's/^\/\/.*$//' |
|
||||
# Remove trailing comments starting with space //
|
||||
# Remove trailing comments starting with //
|
||||
sed -e 's/ \/\/.*$//' |
|
||||
# Remove one-line comments starting with /*
|
||||
sed -e 's/\/\*.*//g' |
|
||||
# Remove empty lines
|
||||
sed -e '/^\s*$/d'
|
||||
|
||||
sed '/^\s*$/d'
|
||||
|
|
|
@ -20,13 +20,5 @@ bash ../../tools/html2string.sh ../html/config_template.html > config_template.h
|
|||
bash ../../tools/html2string.sh ../html/light_control_template.html > light_control_template.html
|
||||
bash ../../tools/html2string.sh ../html/top.js > top.js
|
||||
bash ../../tools/html2string.sh ../html/bottom.js > bottom.js
|
||||
bash ../../tools/html2string.sh ../html/style.css > style.css
|
||||
|
||||
#for file in *"_tmp"; do
|
||||
# if [[ -f "$file" ]]; then
|
||||
# new_file="${file%_tmp}"
|
||||
# html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true "$file" > "$new_file"
|
||||
# rm "$file"
|
||||
# fi
|
||||
#done
|
||||
cp -av ../html/style.css . > /dev/null
|
||||
|
||||
|
|
Loading…
Reference in a new issue