Diverse Anpassungen besonders bei SEAWebClientGroup

This commit is contained in:
Daniel
2025-04-24 14:50:27 +02:00
parent 58ee8130e6
commit 0d5ffd72a8
8 changed files with 760 additions and 932 deletions

View File

@ -3,7 +3,7 @@
var MAXBLOCK = 4; // max number of blocks
var elements = []; // grid elements
var swiper = []; // This array contains main-swiper-Instances.
// var swiper = []; // This array contains main-swiper-Instances.
var hostPort = ""; // Address and port of static html-file.
var clientID = ""; // ID given by server when SSE-connection is established.
var clientTitle = ""; // Contains name of instrument and device.
@ -12,7 +12,6 @@ var getUpdatesGraphics = true;
var initCommands = [];
var loadingShown = true;
var writePermission = false;
var menuMode = false;
var panelOn = true;
var firstState = 0;
var showParams = false;
@ -127,22 +126,7 @@ function nextInitCommand() {
var loadingScreen = document.getElementsByClassName("loading-div")[0];
loadingScreen.style.display = "none";
loadingShown = false;
/* Not working without swiper, necessary??? */
// if (location.hash) { // there was a #hash part
// var slideNames = location.hash.substr(1);
// gotoGroups(slideNames);
// }
console.log("loading finished");
// function gotoGroups(slideNames) {
// slideNames = slideNames.split("%20");
// var l = Math.min(MAXBLOCK,slideNames.length);
// document.title = "SEA "+ clientTitle + " " + slideNames.join(" ");
// for (var s=0; s<l; s++) {
// getGroup(s, slideNames[s]);
// }
// }
}
}
@ -165,9 +149,9 @@ window.onload = function() {
let crossElement = document.getElementById("close-cross");
if(window.hideRightPart){
if (window.hideRightPart){
document.body.removeChild(crossElement);
}else{
} else {
crossElement.onclick = function(){
if (showParams) {
showParams = false;
@ -176,32 +160,27 @@ window.onload = function() {
if (window.wideGraphs) {
window.wideGraphs = false;
document.getElementById('close-cross').innerHTML = '<img class = "icon-close" src="res/icon_sinus.png">';
document.getElementsByClassName('log-icon-container')[0].classList.remove("log-icon-container-hidden");
} else {
window.wideGraphs = true;
document.getElementById('close-cross').innerHTML = '<img class = "icon-close" src="res/icon_modules.png">';
document.getElementsByClassName('log-icon-container')[0].classList.add("log-icon-container-hidden");
}
}
if (elements[0].style.display == "inline-block") { // only graphics is visible
elements[0].style.display = "none"; // hide graphics
elements[1].style.display = "inline-block"; // show modules
elements[2].style.display = "none"; // hide parameters
} else if (elements[1].style.display == "inline-block") { // only modules are visible
elements[0].style.display = "inline-block"; // show graphics
elements[1].style.display = "none"; // hide modules
elements[2].style.display = "none"; // hide parameters
} else if (elements[2].style.display == "inline-block") { // only parameters are visible
elements[0].style.display = "none"; // hide graphics
elements[1].style.display = "inline-block"; // show modules
elements[2].style.display = "none"; // hide parameters
}
adjustGrid();
}
}
let logIcon = document.getElementById("log-icon-container");
let logIcon = document.getElementsByClassName("log-icon-container")[0];
logIcon.onclick = function(){
elements[3].classList.toggle('grid-element-3-visible');
}
if (window.showConsole) {
window.showConsole = false;
} else {
window.showConsole = true;
// Initialize?
}
adjustGrid();
}
var homeButton = document.getElementById("home-icon");
@ -209,33 +188,6 @@ window.onload = function() {
window.location = "/select_experiment";
};
buildUpdateConnection();
// if (location.hash) {
// console.log("hash in url", location.hash);
// initSlides = location.hash.substring(1);
// } else {
// initSlides = "";
// }
// // Initialisation will be continued, when SSE-connection is established
// // and id-message is obtained.
// // (see also at SEAWebClientCommunication.js)
// addEventListener("popstate", function (e) {
// if (e.state) {
// if (loadingShown) {
// if (initSlides != e.state.funarg) {
// console.log("hash mismatch", initSlides, e.state.funarg);
// initSlides = e.state.funarg;
// }
// } else {
// console.log("popstate", e.state.func, e.state.funarg);
// window[e.state.func](e.state.funarg);
// }
// } else {
// document.title = "SEA "+ clientTitle;
// for (var s=0; s<MAXBLOCK; s++) {
// swiper[s].slideTo(defaultSlidePos(s));
// }
// }
// })
};
function toggleHeader() {