Merge branch 'daniel' of https://gitlab.psi.ch/samenv/seweb into daniel
This commit is contained in:
@ -79,8 +79,8 @@ new Settings()
|
|||||||
.treat("hideRightPart", "hr", to_bool, false) //used to completely disable the right part
|
.treat("hideRightPart", "hr", to_bool, false) //used to completely disable the right part
|
||||||
.treat("wideGraphs", "wg", to_bool, false) //used to toggle the size of the graphs part
|
.treat("wideGraphs", "wg", to_bool, false) //used to toggle the size of the graphs part
|
||||||
.treat("showAsync", "sa", to_bool, false)
|
.treat("showAsync", "sa", to_bool, false)
|
||||||
.treat("device", "dev", 0, "")
|
.treat("device", "device", 0, "")
|
||||||
.treat("server", "srv", 0, "")
|
.treat("stream", "stream", 0, "")
|
||||||
.treat("instrument", "instrument", 0, "")
|
.treat("instrument", "instrument", 0, "")
|
||||||
.treat("timerange", "time", 0, "-1800,0")
|
.treat("timerange", "time", 0, "-1800,0")
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ if (window.instrument) {
|
|||||||
window.clientTags = "&instrument=" + window.instrument;
|
window.clientTags = "&instrument=" + window.instrument;
|
||||||
} else {
|
} else {
|
||||||
let args = '';
|
let args = '';
|
||||||
if (window.server) { args += "&stream=" + window.server; }
|
if (window.stream) { args += "&stream=" + window.stream; }
|
||||||
if (window.device) { args += "&device=" + window.device; }
|
if (window.device) { args += "&device=" + window.device; }
|
||||||
window.clientTags = args;
|
window.clientTags = args;
|
||||||
}
|
}
|
||||||
|
@ -160,6 +160,8 @@ class InfluxGraph(HandlerBase):
|
|||||||
if self.instrument:
|
if self.instrument:
|
||||||
streams, tags, self.device_name = self.server.lookup_streams(self.instrument, **self.init_tags)
|
streams, tags, self.device_name = self.server.lookup_streams(self.instrument, **self.init_tags)
|
||||||
self.tags = {**self.init_tags, **tags}
|
self.tags = {**self.init_tags, **tags}
|
||||||
|
else:
|
||||||
|
self.tags = self.init_tags
|
||||||
blocks = self.get_available_variables(start_time, end_time, self.chart_configs, userconfiguration)
|
blocks = self.get_available_variables(start_time, end_time, self.chart_configs, userconfiguration)
|
||||||
# initialize self.last_values to keep track of the available variables
|
# initialize self.last_values to keep track of the available variables
|
||||||
self.last_values = {var["name"]: [0, None] for block in blocks for var in block["curves"]}
|
self.last_values = {var["name"]: [0, None] for block in blocks for var in block["curves"]}
|
||||||
|
9
secop.py
9
secop.py
@ -19,17 +19,24 @@ def convert_par(module, name, par):
|
|||||||
|
|
||||||
|
|
||||||
def convert_cmd(module, name, cmd):
|
def convert_cmd(module, name, cmd):
|
||||||
result = dict(type='input', button=True, name=module+":"+name, title=name)
|
result = dict(type='pushbutton', name=module+":"+name, title=name)
|
||||||
result['command'] = 'do %s:%s' % (module, name)
|
result['command'] = 'do %s:%s' % (module, name)
|
||||||
argument = cmd['datainfo'].get('argument')
|
argument = cmd['datainfo'].get('argument')
|
||||||
if cmd['datainfo'].get('result'):
|
if cmd['datainfo'].get('result'):
|
||||||
result['result'] = True
|
result['result'] = True
|
||||||
|
else:
|
||||||
|
if not argument: # simple command like stop
|
||||||
|
return result
|
||||||
|
result['button'] = not argument
|
||||||
|
# result['type'] = pushbutton will be replaced below
|
||||||
if argument:
|
if argument:
|
||||||
if argument['type'] == 'enum':
|
if argument['type'] == 'enum':
|
||||||
result['enum_names'] = [dict(title=k, value=v) for k, v in argument['members'].items()]
|
result['enum_names'] = [dict(title=k, value=v) for k, v in argument['members'].items()]
|
||||||
result['type'] = 'enum'
|
result['type'] = 'enum'
|
||||||
elif argument['type'] == 'bool':
|
elif argument['type'] == 'bool':
|
||||||
result['type'] = 'checkbox'
|
result['type'] = 'checkbox'
|
||||||
|
else:
|
||||||
|
result['type'] = 'input'
|
||||||
else:
|
else:
|
||||||
result['type'] = 'rdonly'
|
result['type'] = 'rdonly'
|
||||||
if cmd['description']:
|
if cmd['description']:
|
||||||
|
@ -297,7 +297,7 @@ def replace_by_empty(file):
|
|||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def default():
|
def default():
|
||||||
if not any(flask.request.values.get(k) for k in ('instrument', 'server', 'device')):
|
if not any(flask.request.values.get(k) for k in ('instrument', 'stream', 'device')):
|
||||||
if not server.single_instrument:
|
if not server.single_instrument:
|
||||||
return select_experiment()
|
return select_experiment()
|
||||||
return general_file('SEAWebClient.html')
|
return general_file('SEAWebClient.html')
|
||||||
|
Reference in New Issue
Block a user