rework of the server side

main change: the same server may be used for several instruments

- client classes are 'Interactors' dealing with the parameters etc.
- methods from history are added to the clients
+ improvements on the js client side
This commit is contained in:
l_samenv
2025-03-19 08:14:06 +01:00
parent b8ac8f8bb5
commit 958e472f3b
8 changed files with 445 additions and 292 deletions

View File

@ -490,7 +490,7 @@ let graphs = (function (){
if(idx != -1){ //if the clicked block is displayed somewhere, we create a selection window
createSelection(idx); // We will create a selection at the gindex
}
}
}
createGraph(gindex, block); // we create at the current shown selector (gindex), the graph corresponding to the one clicked (block)
})
selection.appendChild(bel);
@ -547,7 +547,7 @@ let graphs = (function (){
+ "&variables=" + varlist
+ "&interval=" + resolution
+ "&id=" + clientID).getJSON().then(function(data){
//console.log('Graph', block, data)
// console.log('Graph', block, data);
let graph = new Graph(gindex, graph_elm, "Time", block.unit, block.tag, type);
graph_array[gindex] = graph;
@ -559,7 +559,6 @@ let graphs = (function (){
for(let e of data.graph[key]){
pdata.push({x: e[0]*1000, y: e[1]});
}
addDataset(gindex, key, pdata, dict[key])
// if(pdata.length > 0){
// addDataset(gindex, key, pdata, dict[key])
@ -919,7 +918,6 @@ let graphs = (function (){
AJAX("http://" + hostPort + "/getvars").postForm(
"time=" + msRightTimestampGetVars/1000
+ window['clientTags']
+ "&userconfiguration=" + JSON.stringify(getFormattedUserConfigurationFromLocalStorage())
+ "&id="+ clientID).then(function(data){
blocks = data.blocks;
@ -998,7 +996,6 @@ let graphs = (function (){
AJAX("http://" + hostPort + "/getvars").postForm(
"time=" + msRightTimestamp/1000 + "&userconfiguration="
+ JSON.stringify(getFormattedUserConfigurationFromLocalStorage())
+ window['clientTags']
+ "&id="+ clientID).then(function(data){
currentMaxTime = msRightTimestamp + 60000;
currentMinTime = msLeftTimestamp;
@ -1304,7 +1301,6 @@ let graphs = (function (){
AJAX("http://" + hostPort + "/getvars").postForm(
"time=" + currentMaxTime/1000
+ "&userconfiguration=" + JSON.stringify(userConfiguration)
+ window['clientTags']
+ "&id="+ clientID).then(function(data){
blocks = data.blocks;
document.getElementById("device").innerHTML = data.device