фича: числа с разделением по тысячам

This commit is contained in:
2025-01-21 15:41:10 +03:00
parent 2c2cbf4249
commit 073bf43d8b
7 changed files with 118 additions and 44 deletions

View File

@@ -17,15 +17,22 @@ def extract_param_names(mc):
r += helper_extract(child)
return r
elif 'name' in widget:
copy_fields = {"widget": widget['widget'], "name": widget['name']}
if 'min' in widget:
copy_fields['min'] = widget['min']
if 'max' in widget:
copy_fields['max'] = widget['max']
match widget['widget']:
case 'select': return [{"name": widget['name'], "initValue": widget['values'][0]['value']}]
case 'checkbox': return [{"name": widget['name'], "initValue": 'false'}]
case 'number': return [{"name": widget['name'], "initValue": widget['min'] if widget['min'] else '0'}]
case 'modulation-modcod': return [{"name": widget['name'] + "Modulation", "initValue": '"QPSK"'}]
case 'modulation-speed': return [{"name": widget['name'] + "Speed", "initValue": '"1/4"'}]
case 'select': return [{"initValue": widget['values'][0]['value']} | copy_fields]
case 'checkbox': return [{"initValue": 'false'} | copy_fields]
case 'number': return [{"initValue": widget['min'] if widget['min'] else '0'} | copy_fields]
case 'number-int': return [{"initValue": "0"} | copy_fields]
case 'modulation-modcod': return [{"name": widget['name'] + "Modulation", "initValue": '"QPSK"'} | copy_fields]
case 'modulation-speed': return [{"name": widget['name'] + "Speed", "initValue": '"1/4"'} | copy_fields]
case 'watch': return []
return [{"name": widget['name'], "initValue": 'null'}]
return [{"initValue": 'null'} | copy_fields]
return []
for cat in mc['params']: