Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Improved auto-generated menus in graphical apps. Modified MPU6050.py. Added MPU925x.py . Fixed Sensorpendulum App & I2C oscilloscope#57

Merged
mariobehling merged 11 commits intofossasia:developmentfossasia/pslab-python:developmentfrom
jithinbp:developmentjithinbp/pslab-python:developmentCopy head branch name to clipboard
May 8, 2017
Merged

Improved auto-generated menus in graphical apps. Modified MPU6050.py. Added MPU925x.py . Fixed Sensorpendulum App & I2C oscilloscope#57
mariobehling merged 11 commits intofossasia:developmentfossasia/pslab-python:developmentfrom
jithinbp:developmentjithinbp/pslab-python:developmentCopy head branch name to clipboard

Conversation

@jithinbp
Copy link
Collaborator

@jithinbp jithinbp commented Apr 30, 2017

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
tmp
Figure : Menu generated by F_Sensors.py based on the new format of Params dict. using MPU6050 sensor

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' }
Copy link
Member

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 )

Copy link
Collaborator Author

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?

@jithinbp
Copy link
Collaborator Author

jithinbp commented Apr 30, 2017

-Functions with user defined variable inputs are defined as QSpinbox/QDoubleSpinBox.
Screenshot with MPU6050.
tmp

KalmanFilter is defined in the following entry in Params

'KalmanFilter': {'dataType':'double','min':0,'max':1000,'prefix':'value: '}

If you're all satisfied with the current implementation, we can proceed to modify the Params dictionary for all the other sensors as well. @wavicles @viveksb007 @akarshan96 . I've made the necessary changes because only four sensors actually had the 'init' method exposed to the user.

jithinbp added 6 commits May 1, 2017 00:17
 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
@jithinbp jithinbp changed the title Modified MPU6050.py for improved auto-generated menus in graphical apps Improved auto-generated menus in graphical apps. Modified MPU6050.py. Added MPU925x.py . Fixed Sensorpendulum App & I2C oscilloscope May 7, 2017
@mariobehling mariobehling merged commit fcf6a0d into fossasia:development May 8, 2017
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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.