From 852665779c24880e97c1a560e8f19a11f2ee28a3 Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Thu, 3 Feb 2022 10:55:20 +0100 Subject: Introduce selectable values for ad-hoc parameters --- gui/odr-dabmux-gui.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'gui/odr-dabmux-gui.py') diff --git a/gui/odr-dabmux-gui.py b/gui/odr-dabmux-gui.py index 31f9588..df6b81f 100755 --- a/gui/odr-dabmux-gui.py +++ b/gui/odr-dabmux-gui.py @@ -29,7 +29,7 @@ from muxconfig import * from muxrc import * -from bottle import route, run, template, static_file, request +from bottle import * import json import argparse @@ -84,10 +84,19 @@ def rc_get(module, param): value = rc.get_param_value(module, param) + if param in paramObj: + paramList = paramObj[param] + label = paramObj["labels"][param] + else: + paramList = [] + label = "" + return template('rcparam', module = module, param = param, - value = value) + value = value, + label = label, + list = paramList) @route('/rc//', method="POST") def rc_post(module, param): @@ -153,5 +162,9 @@ if __name__ == '__main__': rc = MuxRemoteControl(cli_args.mhost, cli_args.rcport) - run(host=cli_args.host, port=int(cli_args.port), debug=True, reloader=False) + # Import selectable paramaters values + paramFile = open("rcparam.json") + paramStr = paramFile.read() + paramObj = json.loads(paramStr) + run(host=cli_args.host, port=int(cli_args.port), debug=True, reloader=False) -- cgit v1.2.3