mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-05 05:22:07 +08:00
ui: reset live parameters and delay when reset calibration pressed (#35211)
* Reset params and lag too * Old param too
This commit is contained in:
@@ -194,6 +194,9 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
|
||||
if (ConfirmationDialog::confirm(tr("Are you sure you want to reset calibration?"), tr("Reset"), this)) {
|
||||
params.remove("CalibrationParams");
|
||||
params.remove("LiveTorqueParameters");
|
||||
params.remove("LiveParameters");
|
||||
params.remove("LiveParametersV2");
|
||||
params.remove("LiveDelay");
|
||||
}
|
||||
});
|
||||
addItem(resetCalibBtn);
|
||||
@@ -326,7 +329,7 @@ void SettingsWindow::setCurrentPanel(int index, const QString ¶m) {
|
||||
if (param.endsWith("Panel")) {
|
||||
QString panelName = param;
|
||||
panelName.chop(5); // Remove "Panel" suffix
|
||||
|
||||
|
||||
// Find the panel by name
|
||||
for (int i = 0; i < nav_btns->buttons().size(); i++) {
|
||||
if (nav_btns->buttons()[i]->text() == tr(panelName.toStdString().c_str())) {
|
||||
@@ -338,7 +341,7 @@ void SettingsWindow::setCurrentPanel(int index, const QString ¶m) {
|
||||
emit expandToggleDescription(param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
panel_widget->setCurrentIndex(index);
|
||||
nav_btns->buttons()[index]->setChecked(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user