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

@ -85,7 +85,7 @@
<!-- &#215; -->
<img class = "icon-close" src="res/icon_sinus.png">
</div>
<div id="log-icon-container">
<div class="log-icon-container">
<img class = "log-icon" src="res/icon_log.png">
</div>
</body>

View File

@ -27,13 +27,12 @@
}
.history {
position: absolute;
font-family: monospace;
font-size: 12px;
padding: 80px 8px 50px 8px;
width: 100%;
height: 100%;
overflow-y: auto;
background-color: #303030;
color: lightgray;
background-color: lightgray;
color: #303030;
}

View File

@ -18,17 +18,13 @@
overflow-y: hidden;
}
.link {
transition: 0.4s;
cursor: pointer;
color: steelblue;
text-decoration: underline;
}
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* panel */
.link:focus {
color: orangered;
outline: none;
}
/* ------------------------------ modules-icons ------------------------------ */
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* row */
.row {
padding: 4px 0px 4px 0px;
@ -36,7 +32,7 @@
min-height: 24px;
display: block;
border-bottom: dotted darkgray 2px;
overflow: hidden;
/* overflow: hidden; */
transition: 0.2s;
position: relative;
}
@ -55,59 +51,6 @@
/* background-color: lightgray; */
}
.clickable:hover {
background-color: lightgray;
}
.link-static {
padding-left: 4px;
background-color: #303030;
color: white;
border-bottom: none;
}
.info-box {
margin: 4px 0px 4px 0px;
padding: 4px;
border-radius: 4px;
background-color: darkslategray;
color: white;
display: none;
width: 100%;
cursor: pointer;
}
.col-left {
min-height: 24px;
line-height: 24px;
float: left;
}
.event-toggle-info {
color: darkslategray;
cursor: pointer;
}
.col-right-modules {
position: absolute;
right: 16px;
}
.col-right-parameters {
float: right;
}
.col-right-disabled {
display: none;
}
.modules-title {
display: inline-block;
min-width: 120px;
}
/* ------------------------------ modules-icons ------------------------------ */
.modules-icon {
display: inline-block;
width: 12px;
@ -118,6 +61,29 @@
margin-bottom: 4px;
}
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* left */
.col-left {
display: inline-block;
min-width: 140px;
}
/* ------------------------------ info ------------------------------ */
.info-box {
padding: 4px;
border-radius: 4px;
background-color: #303030;
color: white;
width: 100%;
display: none;
}
.button-info:hover + .info-box {
display: inline-block;
}
/* ------------------------------ status-icon ------------------------------ */
.status-icon {
@ -149,32 +115,40 @@
.status-info {
color: white;
background-color: #303030;
opacity: 0;
position: absolute;
left: 20px;
top: 2px;
z-index: 100;
padding: 2px;
border-radius: 6px;
transition: 1s;
display: none;
}
.status-icon:hover ~ .status-info {
opacity: 1.0;
display: inline-block;
}
/* ------------------------------ value ------------------------------ */
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* right */
.col-right-parameters-value {
position: absolute;
right: 16px;
.col-right-modules {
float: right;
}
.col-right-parameters {
float: right;
}
.col-right-value {
padding-right: 4px;
}
.col-right-disabled {
display: none;
}
/* ------------------------------ edit-icon ------------------------------ */
.edit-icon {
/* position: absolute; */
/* right: 0; */
float: right;
cursor: pointer;
}
@ -184,9 +158,17 @@
opacity: .6;
}
/* ------------------------------ hidden-input_element ------------------------------ */
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* INPUT ELEMENTS */
.hidden-input-element {
.input-element {
z-index: 100;
position: absolute;
right: 0;
top: 20px;
}
.input-element-hidden {
display: none;
}
@ -199,6 +181,7 @@
border: solid 2px dimgray;
color: black;
text-align: right;
margin-top: 4px;
}
::-ms-clear { /* remove the x in the input box on IE */
@ -207,22 +190,21 @@
}
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* CHECKBOX */
.parameter-checkbox {
/* .parameter-checkbox {
opacity: 0;
float: left;
}
} */
.parameter-checkbox + .parameter-label {
/* .parameter-checkbox + .parameter-label {
position: relative;
cursor: pointer;
float: left;
}
} */
.parameter-checkbox:focus+.parameter-label {
/* .parameter-checkbox:focus+.parameter-label {
opacity: 0.8;
}
} */
.parameter-checkbox+.parameter-label::before {
/* .parameter-checkbox+.parameter-label::before {
content: ' ';
position: absolute;
left: -24px;
@ -232,9 +214,9 @@
display: block;
background: lightgray;
border: 2px solid dimgray;
}
} */
.parameter-checkbox+.parameter-label::after {
/* .parameter-checkbox+.parameter-label::after {
content: ' ';
position: absolute;
left: -19px;
@ -251,14 +233,14 @@
-webkit-transform: scale(0);
transform: scale(0);
opacity: 0;
}
} */
.parameter-checkbox:checked+.parameter-label::after {
/* .parameter-checkbox:checked+.parameter-label::after {
-ms-transform: scale(1);
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
} */
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* RADIO */

View File

@ -136,23 +136,6 @@ meta, body {
overflow: hidden;
}
/* ------------------------------ log ------------------------------ */
.grid-element-3 {
position: absolute;
display: block;
bottom: 0;
width: 100%;
height: 0;
opacity: .9;
z-index: 1000;
/* transition: 1s; */
}
.grid-element-3-visible {
height: 50%;
}
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* PANEL */
.panel {
@ -198,7 +181,7 @@ meta, body {
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* LOG ICON */
#log-icon-container {
.log-icon-container {
z-index: 1001;
bottom: 9px;
right: 12px;
@ -207,6 +190,10 @@ meta, body {
cursor: pointer;
}
.log-icon-container-hidden {
display: none;
}
.log-icon {
height: 20px;
width: 20px;

View File

@ -69,16 +69,12 @@ function handleUpdateMessage(src, message) {
// id-message: Confirms establishment of SSE-connection and determines
// specific ID of the client
case "id":
for (var i = 0; i < swiper.length; i++) {
swiper[i].removeAllSlides();
}
clientID = message.id;
if ("device" in message) {
if (message.device == "_inst_select") {
clientTitle = "select instrument";
console.log('IDselect')
pushInitCommand("getblock?path=_inst_select&", "instrument selection");
menuMode = true;
sizeChange();
} else {
clientTitle = message.instrument + " " + message.device;
@ -208,11 +204,6 @@ function updateValues(message, src) {
let elem = matches[j];
let type = elem.__ctype__; // -> Show Dom-Properties
// let text = htmlEscape(component.formatted);
// if (text) {
// elem.innerHTML = text;
// }
if (type == "rdonly" || type == "rdlink") {
let text = htmlEscape(component.formatted);
if (text) {
@ -232,17 +223,29 @@ function updateValues(message, src) {
}
}
elem.actualValue = value;
resizeTextfield(elem);
resize_textfield(elem);
} else if (type == "checkbox") {
let row = elem.parentNode.parentNode;
let row = elem.closest('div');
row.style.backgroundColor = "white";
console.log('receive: ', value);
// console.log('CBX', elem.name, message, Boolean(value && value != 'false'));
elem.checked = Boolean(value && value != 'false');
// elem.checked = Boolean(value && value != 'false');
if (value === 'False') {
elem.checked = false;
} else {
elem.checked = true;
}
} else if (type == "enum") {
elem.style.display = "block";
let row = elem.parentNode.parentNode;
let row = elem.closest('div');
row.style.backgroundColor = "white";
elem.value = value;
let options = elem.childNodes;
for (var j = 0; j < options.length; j++) {
if (options[j].label == value) {
elem.value = j + 1;
}
}
}
}
}
@ -253,7 +256,6 @@ function updateStatus(component) {
let status_icon = matches[0];
let row = status_icon.closest(".row");
let right = row.lastChild;
right.classList.remove('col-right-disabled');
let statusCode = component.statuscode;
// Update status info, visible when mouse cursor is hovering over status icon
@ -262,11 +264,19 @@ function updateStatus(component) {
status_info.innerHTML = component.formatted;
}
status_icon.classList.remove('status-icon-disabled');
status_icon.classList.remove('status-icon-idle');
status_icon.classList.remove('status-icon-warn');
status_icon.classList.remove('status-icon-busy');
status_icon.classList.remove('status-icon-error');
row.classList.remove('row-disabled');
right.classList.remove = 'col-right-disabled';
switch (statusCode) {
case 0:
status_icon.classList.add('status-icon-disabled');
row.classList.add('row-disabled');
right.innerHTML = 'col-right-disabled';
right.classList.add = 'col-right-disabled';
break;
case 1:
status_icon.classList.add('status-icon-idle');
@ -355,17 +365,21 @@ function successHandler(s, message) {
// appendToGridElement(2, "", "parameters", createContent({components:[]}));
} else {
// In the module-block a parameter was selected
showParams = true;
// -> write parameter-block to grid-element2
isl = appendToGridElement(2, message.title, 'parameters', createContent(message));
if (nColumns == 1) {
elements[1].style.display = "none"; // hide modules
elements[2].style.display = "inline-block"; // show parameters
showParams = true;
adjustGrid();
if (nColumns == 1 || nColumns == 2 || nColumns == 3) {
// elements[1].style.display = "none"; // hide modules
// elements[2].style.display = "inline-block"; // show parameters
// style(2,"100vw","100vh");
document.getElementById('close-cross').innerHTML = '<img class = "icon-close" src="res/icon_close.png">';
} else if (nColumns == 2 || nColumns == 3) {
} else {
}
// else if (nColumns == 2 || nColumns == 3) {
// adjustGrid();
// } else {
// adjustGrid();
// }
}
nextInitCommand();
// Request for updates.

File diff suppressed because it is too large Load Diff

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() {

View File

@ -44,10 +44,6 @@ function determineViewportSize() {
if (height > MINHEIGHT) {
nRows = 2;
}
if (menuMode) {
nRows = 1;
nColumns = 1;
}
}
function sizeChange() {
@ -68,108 +64,110 @@ function adjustGrid() {
style(0,"100vw","100vh");
style(1); // hide
style(2); // hide
// style(3); // hide
style(3); // hide
return;
}
switch (nColumns) {
case 1:
if (menuMode) {
leftWidth = Math.min(100, MINWIDTH / width * 100);
style(1,leftWidth + "vw","100vh");
if (window['showConsole']) {
if (showParams) {
style(0); // hide
style(1); // hide
style(2,"100vw","50vh");
style(3,"100vw","50vh");
} else {
style(0); // hide
style(1,"100vw","50vh");
style(2); // hide
style(3,"100vw","50vh");
}
} else {
// we may want to switch to 90vh on safari ios (workaround)
style(0); // hide
style(1,"100vw","100vh");
style(2); // hide
// style(3); // hide
}
if (showParams) {
style(0); // hide
style(1); // hide
style(2,"100vw","100vh");
style(3); // hide
} else {
style(0); // hide
style(1,"100vw","100vh");
style(2); // hide
style(3); // hide
}
}
break;
case 2:
case 3:
rightWidth = Math.min(50, MINWIDTH / width * 100);
leftWidth = 100 - rightWidth;
if (nRows == 1 || !window['showConsole']) {
if (showParams) {
style(0,leftWidth + "vw","100vh");
style(1); // hide
style(2,rightWidth + "vw","100vh");
// style(3); // hide
if (window['showConsole']) {
if (nRows == 1) {
if (showParams) {
style(0,leftWidth + "vw","100vh");
style(1); // hide
style(2,rightWidth + "vw","50vh");
style(3,rightWidth + "vw","50vh");
} else {
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","50vh");
style(2); // hide
style(3,rightWidth + "vw","50vh");
}
} else {
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","100vh");
style(2); // hide
// style(3); // hide
if (showParams) {
style(0,leftWidth + "vw","100vh");
style(1); // hide
style(2,rightWidth + "vw","50vh");
style(3,rightWidth + "vw","50vh");
} else {
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","50vh");
style(2); // hide
style(3,rightWidth + "vw","50vh");
}
}
} else {
// if (showParams) {
// style(0,leftWidth + "vw","100vh");
// style(1); // hide
// style(2,rightWidth + "vw","50vh");
// style(3,rightWidth + "vw","50vh");
// } else {
// style(0,leftWidth + "vw","100vh");
// style(1,rightWidth + "vw","50vh");
// style(2); // hide
// style(3,rightWidth + "vw","50vh");
// }
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","50vh");
style(2,rightWidth + "vw","50vh");
// style(3); // hide
if (nRows == 1) {
if (showParams) {
style(0,leftWidth + "vw","100vh");
style(1); // hide
style(2,rightWidth + "vw","100vh");
style(3); // hide
} else {
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","100vh");
style(2); // hide
style(3); // hide
}
} else {
if (showParams) {
style(0,leftWidth + "vw","100vh");
style(1); // hide
style(2,rightWidth + "vw","100vh");
style(3); // hide
} else {
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","100vh");
style(2); // hide
style(3); // hide
}
}
}
break;
case 3:
rightWidth = MINWIDTH / width * 100;
leftWidth = 100 - rightWidth;
if (nRows == 1 || !window['showConsole']) {
if (showParams) {
style(0,leftWidth + "vw","100vh");
style(1); // hide
style(2,rightWidth + "vw","100vh");
// style(3); // hide
} else {
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","100vh");
style(2); // hide
// style(3); // hide
}
} else {
// if (showParams) {
// style(0,leftWidth + "vw","100vh");
// style(1); // hide
// style(2,rightWidth + "vw","50vh");
// style(3,rightWidth + "vw","50vh");
// } else {
// style(0,leftWidth + "vw","100vh");
// style(1,rightWidth + "vw","50vh");
// style(2); // hide
// style(3,rightWidth + "vw","50vh");
// }
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","50vh");
style(2,rightWidth + "vw","50vh");
// style(3); // hide
}
break;
case 4:
rightWidth = MINWIDTH / width * 100;
leftWidth = 100 - 2 * rightWidth;
// if (nRows == 1 || !window['showConsole']) {
if (window['showConsole']) {
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","50vh");
style(2,rightWidth + "vw","50vh");
style(3,100 - leftWidth + "vw","50vh");
} else {
style(0,leftWidth + "vw","100vh");
style(1,rightWidth + "vw","100vh");
// if (window['showConsole']) {
// style(2); // hide
// style(3,rightWidth + "vw","100vh");
// } else {
style(2,rightWidth + "vw","100vh");
// style(3); // hide
// }
// } else {
// style(0,leftWidth + "vw","100vh");
// style(1,rightWidth + "vw","50vh");
// style(2,rightWidth + "vw","50vh");
// style(3,(2 * rightWidth) + "vw","50vh");
// }
style(2,rightWidth + "vw","100vh");
style(3); // hide
}
break;
default:
break;