Improved auto-generated menus in graphical apps. Modified MPU6050.py. Added MPU925x.py . Fixed Sensorpendulum App & I2C oscilloscope#57
Improved auto-generated menus in graphical apps. Modified MPU6050.py. Added MPU925x.py . Fixed Sensorpendulum App & I2C oscilloscope#57mariobehling merged 11 commits intofossasia:developmentfossasia/pslab-python:developmentfrom
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.
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.
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