diff options
author | Robin ALEXANDER <colisee@hotmail.com> | 2022-02-03 10:55:20 +0100 |
---|---|---|
committer | Robin ALEXANDER <colisee@hotmail.com> | 2022-02-03 10:55:20 +0100 |
commit | 852665779c24880e97c1a560e8f19a11f2ee28a3 (patch) | |
tree | 51e4d4ec58dc1753ec8708bfc38943b86bba9d0e /gui/odr-dabmux-gui.py | |
parent | 6db5087d69445592e193267fbe2e13b96b4c41d7 (diff) | |
download | dabmux-852665779c24880e97c1a560e8f19a11f2ee28a3.tar.gz dabmux-852665779c24880e97c1a560e8f19a11f2ee28a3.tar.bz2 dabmux-852665779c24880e97c1a560e8f19a11f2ee28a3.zip |
Introduce selectable values for ad-hoc parameters
Diffstat (limited to 'gui/odr-dabmux-gui.py')
-rwxr-xr-x | gui/odr-dabmux-gui.py | 19 |
1 files changed, 16 insertions, 3 deletions
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/<module>/<param>', 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) |