-
Notifications
You must be signed in to change notification settings - Fork 226
Improved auto-generated menus in graphical apps. Modified MPU6050.py. Added MPU925x.py . Fixed Sensorpendulum App & I2C oscilloscope #57
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
Conversation
PSL/SENSORS/MPU6050.py
Outdated
self.params = {'powerUp': ['Go'], 'setGyroRange': [250, 500, 1000, 2000], 'setAccelRange': [2, 4, 8, 16], | ||
'KalmanFilter': [.01, .1, 1, 10, 100, 1000, 10000, 'OFF']} | ||
self.params = {'powerUp': None, 'setGyroRange': [250, 500, 1000, 2000], 'setAccelRange' : [2, 4, 8, 16], | ||
'KalmanFilter': 'double' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In pslab-desktop-app how would GUI know the range of slider that it needs to generate in KalmanFilter value? ( if a text box is generated, to take input from user then also we need to insert a check that user doesn't give some invalid value )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I haven't started modifying that part in the desktop app yet.
Here's my suggestion:
- if type(value) is None :
Assume that no arguments are required . Create a QMenuAction . - if type(value) == list :
Pre-defined values have been provided. Create a submenu with clickable values - if type(value == dict :
A user input is required, and this dictionary must have all relevant configuration options.
The following keys can be created- 'dataType': 'double'/'integer'/'text' ...
- 'min'/'max'/'value' ... For sliders/spinboxes
- Any other arguments required for various input types
Works?
-Functions with user defined variable inputs are defined as QSpinbox/QDoubleSpinBox. KalmanFilter is defined in the following entry in
|
Fixes fossasia#55. Improved GUI menus
Fixes#58 . Separate methods for starting acquisition, fetching data buffer, and processing data buffer have been implemented in Peripherals.I2C
Fixes fossasia#58 . Separate methods for starting acquisition, fetching data buffer, and processing data buffer have been implemented in Peripherals.I2C
…into development
MPU6050.py is being changed to demonstrate as an example for newer format of Params dictionary. This does not break the other sensor classes. refer to #55.

Corresponding changes have been made in pslab-desktop-apps according fossasia/pslab-desktop#89
Figure : Menu generated by F_Sensors.py based on the new format of Params dict. using MPU6050 sensor