Skip to content

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

Merged
merged 11 commits into from
May 8, 2017

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy