1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-25 09:15:21 +03:00

[Companion] All Horus functions now enabled

This commit is contained in:
Bertrand Songis 2017-01-18 10:55:37 +01:00
parent 98357995fa
commit 61e91a9c32
5 changed files with 22 additions and 62 deletions

View file

@ -62,9 +62,9 @@ enum BoardEnum {
#define HEX_FILES_FILTER "HEX files (*.hex);;"
#define BIN_FILES_FILTER "BIN files (*.bin);;"
#define DFU_FILES_FILTER "DFU files (*.dfu);;"
#define EEPE_FILES_FILTER "EEPE EEPROM files (*.eepe);;"
#define EEPE_FILES_FILTER "EEPE files (*.eepe);;"
#define OTX_FILES_FILTER "OpenTX files (*.otx);;"
#define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
#define EEPROM_FILES_FILTER "Radio and Models settings files (*.otx *.eepe *.bin *.hex);;" OTX_FILES_FILTER EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex *.dfu);;" BIN_FILES_FILTER HEX_FILES_FILTER DFU_FILES_FILTER
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
@ -76,10 +76,4 @@ const char * const ARROW_UP = "\xE2\x86\x91";
const char * const ARROW_RIGHT = "\xE2\x86\x92";
const char * const ARROW_DOWN = "\xE2\x86\x93";
#if defined(DEBUG)
#define HORUS_READY_FOR_RELEASE() true
#else
#define HORUS_READY_FOR_RELEASE() false
#endif
#endif // _CONSTANTS_H_

View file

@ -836,7 +836,7 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
BoardEnum board = GetCurrentFirmware()->getBoard();
SimulatorDialog * dialog;
if (board == BOARD_HORUS && HORUS_READY_FOR_RELEASE()) {
if (board == BOARD_HORUS) {
dialog = new SimulatorDialogHorus(parent, simulator, flags);
QTemporaryDir tmpDir(QDir::tempPath() + "/otx-XXXXXX");
settingsPath = tmpDir.path();

View file

@ -560,12 +560,7 @@ void MainWindow::openDocURL()
void MainWindow::openFile()
{
QString fileFilter;
if (GetCurrentFirmware()->getBoard() == BOARD_HORUS && HORUS_READY_FOR_RELEASE()) {
fileFilter = tr(OTX_FILES_FILTER);
}
else {
fileFilter = tr(EEPROM_FILES_FILTER);
}
fileFilter = tr(EEPROM_FILES_FILTER);
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Models and Settings file"), g.eepromDir(), fileFilter);
if (!fileName.isEmpty()) {
g.eepromDir(QFileInfo(fileName).dir().absolutePath());
@ -755,8 +750,8 @@ void MainWindow::loadBackup()
void MainWindow::readEeprom()
{
if (GetCurrentFirmware()->getBoard()== BOARD_HORUS && HORUS_READY_FOR_RELEASE()) {
// TODO
if (GetCurrentFirmware()->getBoard()== BOARD_HORUS) {
qDebug() << "TODO readEEPROM HORUS";
}
else {
QString tempFile;
@ -908,35 +903,19 @@ void MainWindow::updateMenus()
bool hasMdiChild = (activeMdiChild() != 0);
bool hasSelection = (activeMdiChild() && activeMdiChild()->hasSelection());
if(GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
newAct->setEnabled(false);
openAct->setEnabled(false);
saveAct->setEnabled(false);
saveAsAct->setEnabled(false);
writeEepromAct->setEnabled(false);
readEepromAct->setEnabled(false);
writeBackupToRadioAct->setEnabled(false);
readBackupToFileAct->setEnabled(false);
cutAct->setEnabled(false);
copyAct->setEnabled(false);
pasteAct->setEnabled(false);
for (int i=0; i<MAX_RECENT; ++i)
recentFileActs[i]->setEnabled(false);
} else {
newAct->setEnabled(true);
openAct->setEnabled(true);
saveAct->setEnabled(hasMdiChild);
saveAsAct->setEnabled(hasMdiChild);
cutAct->setEnabled(hasSelection);
copyAct->setEnabled(hasSelection);
pasteAct->setEnabled(hasMdiChild ? activeMdiChild()->hasPasteData() : false);
writeEepromAct->setEnabled(hasMdiChild);
readEepromAct->setEnabled(true);
writeBackupToRadioAct->setEnabled(true);
readBackupToFileAct->setEnabled(true);
for (int i=0; i<MAX_RECENT; ++i)
recentFileActs[i]->setEnabled(true);
}
newAct->setEnabled(true);
openAct->setEnabled(true);
saveAct->setEnabled(hasMdiChild);
saveAsAct->setEnabled(hasMdiChild);
cutAct->setEnabled(hasSelection);
copyAct->setEnabled(hasSelection);
pasteAct->setEnabled(hasMdiChild ? activeMdiChild()->hasPasteData() : false);
writeEepromAct->setEnabled(hasMdiChild);
readEepromAct->setEnabled(true);
writeBackupToRadioAct->setEnabled(true);
readBackupToFileAct->setEnabled(true);
for (int i=0; i<MAX_RECENT; ++i)
recentFileActs[i]->setEnabled(true);
separatorAct->setVisible(hasMdiChild);
simulateAct->setEnabled(hasSelection);
printAct->setEnabled(hasSelection);

View file

@ -94,12 +94,7 @@ void MdiChild::refresh(bool expand)
if (1 || expand) {
ui->modelsList->expandAll();
}
if (GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
ui->simulateButton->setEnabled(false);
}
else {
ui->simulateButton->setEnabled(GetCurrentFirmware()->getCapability(Simulation));
}
ui->simulateButton->setEnabled(GetCurrentFirmware()->getCapability(Simulation));
updateTitle();
}

View file

@ -49,9 +49,6 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
setWindowIcon(CompanionIcon("edit.png"));
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))
@ -110,12 +107,7 @@ void ModelEdit::on_tabWidget_currentChanged(int index)
void ModelEdit::on_pushButton_clicked()
{
if (GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
QMessageBox::warning(this, "Unavailable", "Horus simulation not currently supported within Companion");
}
else {
launchSimulation();
}
launchSimulation();
}
void ModelEdit::launchSimulation()