-
Notifications
You must be signed in to change notification settings - Fork 2
[CPP-297] Add INS settings confirmation popup #162
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
Adds a popup dialog that asks the user to confirm that the INS mode should be changed, showing any necessary IMU settings changes if needed. Accepting this dialog will configure the IMU as needed, save the settings then reset the device.
|
|
||
| self.msg_sender.send( | ||
| MsgReset { | ||
| flags: 1, |
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.
What happens when flags are 0 and a MsgReset is sent? Just reset the device but not the settings?
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.
Just reset the device but not the settings?
Yep, exactly
console_backend/src/settings_tab.rs
Outdated
| ("imu", "imu_raw_output", SettingValue::Boolean(true)), | ||
| ("imu", "gyro_range", SettingValue::String("125".to_string())), | ||
| ("imu", "acc_range", SettingValue::String("8g".to_string())), | ||
| ("imu", "imu_rate", SettingValue::String("100".to_string())), |
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.
I think it would make sense to have these as constants either at the top of this file or in the constants.rs file so they are easier to find if someone needed to make changes.
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.
Definitely agree - I did try to do this initially but wasn't able to mark the array as static or const due to SettingValue::String values needing to be Strings. Do you know a nice way of doing this?
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.
There may be a way to do this with a lazy static but I could be wrong? https://docs.rs/lazy_static/1.4.0/lazy_static/
You could alternatively just make constants for the values true/125/8g/100 and use them here.
This may also be something you could create once in the constructor for the struct then just clone it as needed.
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.
Few minor requests but this looks great!!
resources/Constants/Constants.qml
Outdated
|
|
||
| insSettingsPopup: QtObject { | ||
| readonly property var columnHeaders: ["Name", "Current Value", "Recommended Value"] | ||
| readonly property int dialogWidth: 500 |
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.
To me it seems like the third column is a little cramped. I could see possibly increasing the dialogwidth or renaming "Recommended Value" to "New Value" or something of the like.
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.
Alternatively you could play around with deriving the width. Possibly parent.width/2
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.
Use an alias to get to the dialog box directly, instead
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.
LGTM

Adds a popup dialog that asks the user to confirm that the INS mode should be changed, showing any necessary IMU settings changes if needed. Accepting this dialog will configure the IMU as needed, save the settings then reset the device.
Compared to the old console, I've tried to streamline things a little here by combining the "do you wish to change IMU settings" and "do you want to save and restart" dialogs into the one dialog. I can't think of a reason that a user would only want to go through with only half of this process, so I think for simplicity (both in implementation and from a UI standpoint) it probably makes sense to combine.
The GIFs in the table below show this behaviour and compare it to how it was in the old console. The "Change INS mode" popup will display when the INS mode is turned off, or when it is turned on but no IMU settings need changing. The "Change INS mode + IMU settings" popup will display when the INS mode is turned on and IMU settings are needed to change.