|
35 | 35 | from PyQt5.QtWidgets import * |
36 | 36 |
|
37 | 37 | # App versioning |
38 | | -APP_VERSION = '0.8.0' |
39 | | -APP_TIMESTAMP = '2019.05.26 22:20:00' |
| 38 | +APP_VERSION = '0.8.1' |
| 39 | +APP_TIMESTAMP = '2019.06.01 12:20:00' |
40 | 40 |
|
41 | 41 | # App name |
42 | 42 | APP_NAME = 'SumoManager v' + APP_VERSION |
@@ -418,15 +418,15 @@ def run(self): |
418 | 418 | if window.config: |
419 | 419 | # Transfer the personalized values |
420 | 420 | tmp_config = json.loads(data['config.json']) |
421 | | - tmp_config['wifis'] = window.config['wifis'] |
422 | | - tmp_config['sumo_id'] = window.config['sumo_id'] |
| 421 | + tmp_config['wifis'] = window.config.get('wifis') |
| 422 | + tmp_config['sumo_id'] = window.config.get('sumo_id') or 'xxxxxxxx' |
423 | 423 | tmp_config['status_led_pin'] = window.status_led_pin |
424 | | - tmp_config['sumo_server'] = window.config['sumo_server'] |
425 | | - tmp_config['ultrasonic_threshold'] = window.config['ultrasonic_threshold'] |
426 | | - tmp_config['left_line_value'] = window.config['left_line_value'] |
427 | | - tmp_config['right_line_value'] = window.config['right_line_value'] |
428 | | - tmp_config['left_line_threshold'] = window.config['left_line_threshold'] |
429 | | - tmp_config['right_line_threshold'] = window.config['right_line_threshold'] |
| 424 | + tmp_config['sumo_server'] = window.config.get('sumo_server') or '165.227.140.64:80' |
| 425 | + tmp_config['ultrasonic_threshold'] = window.config.get('ultrasonic_threshold') or 40 |
| 426 | + tmp_config['left_line_value'] = window.config.get('left_line_value') or 0 |
| 427 | + tmp_config['right_line_value'] = window.config.get('right_line_value') or 0 |
| 428 | + tmp_config['left_line_threshold'] = window.config.get('left_line_threshold') or 1000 |
| 429 | + tmp_config['right_line_threshold'] = window.config.get('right_line_threshold') or 1000 |
430 | 430 | data['config.json'] = json.dumps(tmp_config, indent=8) |
431 | 431 | # In case it's the default config file |
432 | 432 | else: |
|
0 commit comments