From b24db856dfad178889b9a75e66143975acd112f8 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 16 Apr 2025 09:47:53 +0200 Subject: [PATCH 1/5] add nv.speed to generic.ini --- config/generic.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/generic.ini b/config/generic.ini index 15e7f7f..f7b9228 100644 --- a/config/generic.ini +++ b/config/generic.ini @@ -25,10 +25,11 @@ hefill=- ln2fill=- hepump=- hemot=- -nv=- +flow_sensor=- +nv.speed=unit:1 nv.flow=unit:ln/min nv.flowtarget=unit:ln/min nv.flowp=unit:ln/min stickrot=unit:deg tcoil1=*_coil,unit:K -tcoil2=*_coil,unit:K \ No newline at end of file +tcoil2=*_coil,unit:K From a7e23febfe3046cb02704df2668e8c3c909be048 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 30 Apr 2025 11:16:39 +0200 Subject: [PATCH 2/5] change row-waiting-for-answer color to a light yellow orangered is too aggressive --- client/cssFiles/SEAWebClientGroup.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cssFiles/SEAWebClientGroup.css b/client/cssFiles/SEAWebClientGroup.css index aa78449..0b37705 100644 --- a/client/cssFiles/SEAWebClientGroup.css +++ b/client/cssFiles/SEAWebClientGroup.css @@ -48,7 +48,7 @@ } .row-waiting-for-answer { - background-color: orangered; + background-color: LightGoldenrodYellow; } /* ------------------------------ icon-modules ------------------------------ */ From fe80de4d4b4660ff5c15632334dd7864522a0e75 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 30 Apr 2025 11:18:18 +0200 Subject: [PATCH 3/5] get a faster response from a change in the previous implementation, the row-waiting-for-answer class was removed only on the next poll. this should happen more quickly. + remove some print statements --- influxgraph.py | 6 +++--- secop.py | 4 +++- webserver.py | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/influxgraph.py b/influxgraph.py index 53b9c5a..570d2e3 100644 --- a/influxgraph.py +++ b/influxgraph.py @@ -274,7 +274,7 @@ class InfluxGraph(HandlerBase): pass # skip not existing or already removed items # add remaining curves curves.extend(curve_dict.values()) - print(key, curves) + # print(key, curves) group['curves'] = curves result.append(group) return result @@ -370,8 +370,8 @@ class InfluxGraph(HandlerBase): if len(curve) > l: del curve[:l] else: - if fullminute: - print('R', key) + # if fullminute: + # print('R', key) result.pop(key) # print('poll', sum(len(c) for c in result.values()), self.last_time) if len(result) > 0: diff --git a/secop.py b/secop.py index 85dd0e1..0a5e825 100644 --- a/secop.py +++ b/secop.py @@ -153,7 +153,9 @@ class SecopInteractor(SecopClient): logging.info('SENDCOMMAND %r', command) try: if is_param: - self.setParameterFromString(module, parameter, strvalue) + entry = self.setParameterFromString(module, parameter, strvalue) + item = {'name': f'{module}:{parameter}', 'value': str(entry), 'formatted': entry.formatted()} + self.updates[module, parameter] = item result = True else: result = self.execCommandFromString(module, parameter, strvalue)[0] diff --git a/webserver.py b/webserver.py index aded0fd..bd470e3 100755 --- a/webserver.py +++ b/webserver.py @@ -385,7 +385,6 @@ a { title('older than 30 days') showtitle = 2 - print('A', args) out.append(f'{key[1]} / {" ".join(devices)}') out.append(f'{daterange}') if timerange: From b0761d9be9a2f0a916bf2b0dd167ec2115e94acc Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 30 Apr 2025 14:46:22 +0200 Subject: [PATCH 4/5] make sure instrument and device are availabel separately - added comment to the alert to be modified ("You changed a field without pressing the return key.") --- client/jsFiles/SEAWebClientCommunication.js | 10 ++++++++-- client/jsFiles/SEAWebClientMain.js | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/client/jsFiles/SEAWebClientCommunication.js b/client/jsFiles/SEAWebClientCommunication.js index f2efabb..a331f7d 100644 --- a/client/jsFiles/SEAWebClientCommunication.js +++ b/client/jsFiles/SEAWebClientCommunication.js @@ -72,12 +72,18 @@ function handleUpdateMessage(src, message) { clientID = message.id; if ("device" in message) { if (message.device == "_inst_select") { - clientTitle = "select instrument"; + window.clientTitle = "select instrument"; console.log('IDselect') pushInitCommand("getblock?path=_inst_select&", "instrument selection"); sizeChange(); } else { - clientTitle = message.instrument + " " + message.device; + if (message.instrument) { + window.instrument = message.instrument; + } + if (message.device) { + window.device = message.device; + } + window.clientTitle = window.instrument + " " + window.device; // console.log('loadBlocks', message); loadFirstBlocks(); } diff --git a/client/jsFiles/SEAWebClientMain.js b/client/jsFiles/SEAWebClientMain.js index e1306a4..3d8740b 100644 --- a/client/jsFiles/SEAWebClientMain.js +++ b/client/jsFiles/SEAWebClientMain.js @@ -182,7 +182,11 @@ window.onload = function() { let array_icon_edit = document.getElementsByClassName('icon-edit'); let array_button = document.getElementsByClassName('input-element-button'); if (writePermission == false) { - alertify.confirm("WRITE PERMISSION", "You are working on "+ clientTitle + ". Are You sure you want to change things here?", + // TODO: here instead of asking "Please confirm we are on ", do not show the instrument, + // ask the user "Please confrim the instrument:" and check it the entered instrument is correct + // (case insensitive) + alertify.confirm("WRITE PERMISSION", "Current device: "+ window.device + + ". Please confirm we are on " + window.instrument + "", function () { // User decided to proceed. prompt = false; From d6ad08025bb255a3013bbc60fefbb73af17b439a Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 30 Apr 2025 14:48:01 +0200 Subject: [PATCH 5/5] send instrument='n_a' if not available instead of null + remove another debugging print statement --- secop.py | 1 - webserver.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/secop.py b/secop.py index 0a5e825..51ff6a2 100644 --- a/secop.py +++ b/secop.py @@ -73,7 +73,6 @@ class SecopInteractor(SecopClient): component['info'] = info component['name'] = f'{name}:value' component['title'] = name - print(component) components.append(component) self.param_updates.add('value') self.param_updates.add('status') diff --git a/webserver.py b/webserver.py index bd470e3..36e6f6d 100755 --- a/webserver.py +++ b/webserver.py @@ -147,7 +147,7 @@ def get_update(_=None): logging.info('UPDATE %s %s', client.id, socket.getfqdn(flask.request.remote_addr.split(':')[-1])) # msg = dict(type='id', id=client.id, title=instrument.title); # yield to_json_sse(msg) - msg = dict(type='id', id=client.id, instrument=kwargs.get('instrument', ''), + msg = dict(type='id', id=client.id, instrument=kwargs.get('instrument') or 'n_a', device=client.device_name) yield to_json_sse(msg) try: