Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync Settings; Store Settings in Single Location #608

Merged
merged 14 commits into from
Feb 8, 2018

Conversation

krkeegan
Copy link
Collaborator

@krkeegan krkeegan commented Feb 6, 2018

This makes a few changes to the settings design that should make our life easier.

  1. This condenses all settings and their attributes into a single dict. (no more changing default values in one place and the settings in another)
  2. This changes the push of settings from all settings, to only those that are different that what is on the machine
  3. Each setting is synced immediately upon change, no more need to call push settings, any change whether programatically or in the settings panel will cause a sync of that setting

This requires a simultaneous update to the Firmware, so the version number should be changed.

Make a truly single source for all attributes about all settings.
Added some helper functions as well.

Change on_change_config to callback.  Prior function was only called
if setting was changed on the config page.  This way it is actually
called when a setting is changed no matter where.
Conflicts:
	UIElements/measureMachinePopup.py
Computed Settings are saved in the config file, but are not shown
to the user.  They are updated by a function whenever the relevant
user settings are changed.  This enables all settings details
to be stored in one location rather than scattered about.
Will request all machine settings on serial connection.

Anytime GC sees a setting report from the machine that doesn't match
the GC value, that setting is updated.

Settings are checked for closeness, because float values on
arduino only have 6 guaranteed significant digits
@krkeegan
Copy link
Collaborator Author

krkeegan commented Feb 6, 2018

Matching commit from firmware is MaslowCNC/Firmware#384

@blurfl
Copy link
Collaborator

blurfl commented Feb 6, 2018

This crashes for me (using the matching firmware) with this output:

File "main.py", line 274, in runPeriodically
self.receivedSetting(message)
File "main.py", line 236, in receivedSetting
value, position = self.parseFloat(message, position)
File "main.py", line 248, in parseFloat
return (float(match.group(0)), match.end(0))
AttributeError: 'NoneType' object has no attribute 'group'

Can't just append length of line to the end, we will end up with
a stack of line lengths that don't match.
Just in case we receive a spurious line starting with $ don't
crash.
@krkeegan
Copy link
Collaborator Author

krkeegan commented Feb 7, 2018

OK, this should work now @blurfl, thank you for catching that, it lead to the discovery of a number of small issues.

@krkeegan krkeegan merged commit 83aaf3c into MaslowCNC:master Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants