Fix tricky access to Horus settings (#4094)

This commit is contained in:
3djc
2016-12-04 12:18:57 +01:00
committed by Bertrand Songis
parent 3cd139b906
commit 119f3ef88c
2 changed files with 12 additions and 6 deletions
+11 -5
View File
@@ -47,8 +47,11 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
ui->setupUi(this);
setWindowIcon(CompanionIcon("edit.png"));
restoreGeometry(g.modelEditGeo());
restoreGeometry(g.modelEditGeo());
ui->pushButton->setIcon(CompanionIcon("simulate.png"));
if(GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
ui->pushButton->setEnabled(false);
}
SetupPanel * setupPanel = new SetupPanel(this, model, generalSettings, firmware);
addTab(setupPanel, tr("Setup"));
if (firmware->getCapability(Heli))
@@ -68,7 +71,7 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
s1.report("CF");
if (firmware->getCapability(Telemetry) & TM_HASTELEMETRY)
addTab(new TelemetryPanel(this, model, generalSettings, firmware), tr("Telemetry"));
connect(setupPanel, SIGNAL(extendedLimitsToggled()), chnPanel, SLOT(refreshExtendedLimits()));
s1.report("end");
gStopwatch.report("ModelEdit end constructor");
@@ -107,7 +110,12 @@ void ModelEdit::on_tabWidget_currentChanged(int index)
void ModelEdit::on_pushButton_clicked()
{
launchSimulation();
if (GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
QMessageBox::warning(this, "Unavailable", "Horus simulation not currently supported within Companion");
}
else {
launchSimulation();
}
}
void ModelEdit::launchSimulation()
@@ -118,5 +126,3 @@ void ModelEdit::launchSimulation()
startSimulation(this, *simuData, 0);
delete simuData;
}
+1 -1
View File
@@ -200,7 +200,7 @@ int main(int argc, char *argv[])
showMessage(QObject::tr("ERROR: Simulator %1 not found").arg(firmwareId), QMessageBox::Critical);
return 2;
}
if (factory->type() == BOARD_HORUS && HORUS_READY_FOR_RELEASE())
if (factory->type() == BOARD_HORUS)
dialog = new SimulatorDialogHorus(NULL, factory->create());
else if (factory->type() == BOARD_FLAMENCO)
dialog = new SimulatorDialogFlamenco(NULL, factory->create());