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:
parent
98357995fa
commit
61e91a9c32
5 changed files with 22 additions and 62 deletions
|
@ -62,9 +62,9 @@ enum BoardEnum {
|
||||||
#define HEX_FILES_FILTER "HEX files (*.hex);;"
|
#define HEX_FILES_FILTER "HEX files (*.hex);;"
|
||||||
#define BIN_FILES_FILTER "BIN files (*.bin);;"
|
#define BIN_FILES_FILTER "BIN files (*.bin);;"
|
||||||
#define DFU_FILES_FILTER "DFU files (*.dfu);;"
|
#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 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 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 EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||||
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
|
#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_RIGHT = "\xE2\x86\x92";
|
||||||
const char * const ARROW_DOWN = "\xE2\x86\x93";
|
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_
|
#endif // _CONSTANTS_H_
|
||||||
|
|
|
@ -836,7 +836,7 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
|
||||||
BoardEnum board = GetCurrentFirmware()->getBoard();
|
BoardEnum board = GetCurrentFirmware()->getBoard();
|
||||||
SimulatorDialog * dialog;
|
SimulatorDialog * dialog;
|
||||||
|
|
||||||
if (board == BOARD_HORUS && HORUS_READY_FOR_RELEASE()) {
|
if (board == BOARD_HORUS) {
|
||||||
dialog = new SimulatorDialogHorus(parent, simulator, flags);
|
dialog = new SimulatorDialogHorus(parent, simulator, flags);
|
||||||
QTemporaryDir tmpDir(QDir::tempPath() + "/otx-XXXXXX");
|
QTemporaryDir tmpDir(QDir::tempPath() + "/otx-XXXXXX");
|
||||||
settingsPath = tmpDir.path();
|
settingsPath = tmpDir.path();
|
||||||
|
|
|
@ -560,12 +560,7 @@ void MainWindow::openDocURL()
|
||||||
void MainWindow::openFile()
|
void MainWindow::openFile()
|
||||||
{
|
{
|
||||||
QString fileFilter;
|
QString fileFilter;
|
||||||
if (GetCurrentFirmware()->getBoard() == BOARD_HORUS && HORUS_READY_FOR_RELEASE()) {
|
fileFilter = tr(EEPROM_FILES_FILTER);
|
||||||
fileFilter = tr(OTX_FILES_FILTER);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
fileFilter = tr(EEPROM_FILES_FILTER);
|
|
||||||
}
|
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Models and Settings file"), g.eepromDir(), fileFilter);
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Models and Settings file"), g.eepromDir(), fileFilter);
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
g.eepromDir(QFileInfo(fileName).dir().absolutePath());
|
g.eepromDir(QFileInfo(fileName).dir().absolutePath());
|
||||||
|
@ -755,8 +750,8 @@ void MainWindow::loadBackup()
|
||||||
|
|
||||||
void MainWindow::readEeprom()
|
void MainWindow::readEeprom()
|
||||||
{
|
{
|
||||||
if (GetCurrentFirmware()->getBoard()== BOARD_HORUS && HORUS_READY_FOR_RELEASE()) {
|
if (GetCurrentFirmware()->getBoard()== BOARD_HORUS) {
|
||||||
// TODO
|
qDebug() << "TODO readEEPROM HORUS";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString tempFile;
|
QString tempFile;
|
||||||
|
@ -907,36 +902,20 @@ void MainWindow::updateMenus()
|
||||||
{
|
{
|
||||||
bool hasMdiChild = (activeMdiChild() != 0);
|
bool hasMdiChild = (activeMdiChild() != 0);
|
||||||
bool hasSelection = (activeMdiChild() && activeMdiChild()->hasSelection());
|
bool hasSelection = (activeMdiChild() && activeMdiChild()->hasSelection());
|
||||||
|
|
||||||
if(GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
|
newAct->setEnabled(true);
|
||||||
newAct->setEnabled(false);
|
openAct->setEnabled(true);
|
||||||
openAct->setEnabled(false);
|
saveAct->setEnabled(hasMdiChild);
|
||||||
saveAct->setEnabled(false);
|
saveAsAct->setEnabled(hasMdiChild);
|
||||||
saveAsAct->setEnabled(false);
|
cutAct->setEnabled(hasSelection);
|
||||||
writeEepromAct->setEnabled(false);
|
copyAct->setEnabled(hasSelection);
|
||||||
readEepromAct->setEnabled(false);
|
pasteAct->setEnabled(hasMdiChild ? activeMdiChild()->hasPasteData() : false);
|
||||||
writeBackupToRadioAct->setEnabled(false);
|
writeEepromAct->setEnabled(hasMdiChild);
|
||||||
readBackupToFileAct->setEnabled(false);
|
readEepromAct->setEnabled(true);
|
||||||
cutAct->setEnabled(false);
|
writeBackupToRadioAct->setEnabled(true);
|
||||||
copyAct->setEnabled(false);
|
readBackupToFileAct->setEnabled(true);
|
||||||
pasteAct->setEnabled(false);
|
for (int i=0; i<MAX_RECENT; ++i)
|
||||||
for (int i=0; i<MAX_RECENT; ++i)
|
recentFileActs[i]->setEnabled(true);
|
||||||
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);
|
|
||||||
}
|
|
||||||
separatorAct->setVisible(hasMdiChild);
|
separatorAct->setVisible(hasMdiChild);
|
||||||
simulateAct->setEnabled(hasSelection);
|
simulateAct->setEnabled(hasSelection);
|
||||||
printAct->setEnabled(hasSelection);
|
printAct->setEnabled(hasSelection);
|
||||||
|
|
|
@ -94,12 +94,7 @@ void MdiChild::refresh(bool expand)
|
||||||
if (1 || expand) {
|
if (1 || expand) {
|
||||||
ui->modelsList->expandAll();
|
ui->modelsList->expandAll();
|
||||||
}
|
}
|
||||||
if (GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
|
ui->simulateButton->setEnabled(GetCurrentFirmware()->getCapability(Simulation));
|
||||||
ui->simulateButton->setEnabled(false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui->simulateButton->setEnabled(GetCurrentFirmware()->getCapability(Simulation));
|
|
||||||
}
|
|
||||||
updateTitle();
|
updateTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,6 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
|
||||||
setWindowIcon(CompanionIcon("edit.png"));
|
setWindowIcon(CompanionIcon("edit.png"));
|
||||||
restoreGeometry(g.modelEditGeo());
|
restoreGeometry(g.modelEditGeo());
|
||||||
ui->pushButton->setIcon(CompanionIcon("simulate.png"));
|
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);
|
SetupPanel * setupPanel = new SetupPanel(this, model, generalSettings, firmware);
|
||||||
addTab(setupPanel, tr("Setup"));
|
addTab(setupPanel, tr("Setup"));
|
||||||
if (firmware->getCapability(Heli))
|
if (firmware->getCapability(Heli))
|
||||||
|
@ -110,12 +107,7 @@ void ModelEdit::on_tabWidget_currentChanged(int index)
|
||||||
|
|
||||||
void ModelEdit::on_pushButton_clicked()
|
void ModelEdit::on_pushButton_clicked()
|
||||||
{
|
{
|
||||||
if (GetCurrentFirmware()->getBoard() == BOARD_HORUS && !HORUS_READY_FOR_RELEASE()) {
|
launchSimulation();
|
||||||
QMessageBox::warning(this, "Unavailable", "Horus simulation not currently supported within Companion");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
launchSimulation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelEdit::launchSimulation()
|
void ModelEdit::launchSimulation()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue