1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 17:55:19 +03:00
This commit is contained in:
Kjell Kernen 2013-12-12 16:42:32 +01:00
parent 39a4b8e39d
commit adec1f4cf1
5 changed files with 73 additions and 73 deletions

View file

@ -31,7 +31,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
ui->EEbackupCB->hide(); ui->EEbackupCB->hide();
} }
} else { } else {
ui->FlashLoadButton->setText(tr("Load eEprom")); ui->FlashLoadButton->setText(tr("Browse for file"));
ui->profile_label->hide(); ui->profile_label->hide();
ui->patchcalib_CB->hide(); ui->patchcalib_CB->hide();
ui->patchhw_CB->hide(); ui->patchhw_CB->hide();
@ -51,9 +51,9 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
ui->BurnFlashButton->setDisabled(true); ui->BurnFlashButton->setDisabled(true);
ui->EEbackupCB->hide(); ui->EEbackupCB->hide();
if (DocName.isEmpty()) { if (DocName.isEmpty()) {
this->setWindowTitle(tr("Write models to TX")); this->setWindowTitle(tr("Write Models and Settings to TX"));
} else { } else {
this->setWindowTitle(tr("Write %1 to TX").arg(DocName)); this->setWindowTitle(tr("Write Models and Settings in %1 to TX").arg(DocName));
} }
QSettings settings("companion9x", "companion9x"); QSettings settings("companion9x", "companion9x");
int profileid=settings.value("profileId", 1).toInt(); int profileid=settings.value("profileId", 1).toInt();
@ -151,7 +151,7 @@ void burnDialog::on_FlashLoadButton_clicked()
fileName = QFileDialog::getOpenFileName(this, tr("Open"), settings.value("lastFlashDir").toString(), FLASH_FILES_FILTER); fileName = QFileDialog::getOpenFileName(this, tr("Open"), settings.value("lastFlashDir").toString(), FLASH_FILES_FILTER);
checkFw(fileName); checkFw(fileName);
} else { } else {
QString fileName = QFileDialog::getOpenFileName(this,tr("Choose file to write to EEPROM memory"), settings.value("lastDir").toString(), tr(EXTERNAL_EEPROM_FILES_FILTER)); QString fileName = QFileDialog::getOpenFileName(this,tr("Choose file to load Models and Settings from"), settings.value("lastDir").toString(), tr(EXTERNAL_EEPROM_FILES_FILTER));
if (checkeEprom(fileName)) { if (checkeEprom(fileName)) {
if (burnraw==false) { if (burnraw==false) {
ui->BurnFlashButton->setEnabled(true); ui->BurnFlashButton->setEnabled(true);
@ -196,7 +196,7 @@ void burnDialog::checkFw(QString fileName)
ui->SVNField->setText(flash.getSvn()); ui->SVNField->setText(flash.getSvn());
ui->ModField->setText(flash.getBuild()); ui->ModField->setText(flash.getBuild());
ui->BurnFlashButton->setEnabled(true); ui->BurnFlashButton->setEnabled(true);
ui->BurnFlashButton->setText(tr("Burn to TX")); ui->BurnFlashButton->setText(tr("Write to TX"));
if (flash.hasSplash()) { if (flash.hasSplash()) {
ui->SplashFrame->show(); ui->SplashFrame->show();
ui->ImageLoadButton->setEnabled(true); ui->ImageLoadButton->setEnabled(true);
@ -292,7 +292,7 @@ bool burnDialog::checkeEprom(QString fileName)
uint8_t eeprom[EESIZE_RLC_MAX]; uint8_t eeprom[EESIZE_RLC_MAX];
int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX); int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX);
if (!eeprom_size) { if (!eeprom_size) {
int res = QMessageBox::question(this, "companion9x",tr("Invalid binary EEPROM File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No); int res = QMessageBox::question(this, "companion9x",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) { if (res == QMessageBox::No) {
return false; return false;
} }
@ -302,7 +302,7 @@ bool burnDialog::checkeEprom(QString fileName)
} }
file.close(); file.close();
if (!LoadEeprom(radioData, eeprom, eeprom_size)) { if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
int res = QMessageBox::question(this, "companion9x",tr("Invalid binary EEPROM File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No); int res = QMessageBox::question(this, "companion9x",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) { if (res == QMessageBox::No) {
return false; return false;
} }
@ -325,7 +325,7 @@ bool burnDialog::checkeEprom(QString fileName)
return false; return false;
} }
if (!LoadEeprom(radioData, eeprom, eeprom_size)) { if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
int res = QMessageBox::question(this, "companion9x",tr("Invalid binary EEPROM File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No); int res = QMessageBox::question(this, "companion9x",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::No) { if (res == QMessageBox::No) {
return false; return false;
} }
@ -514,7 +514,7 @@ void burnDialog::on_BurnFlashButton_clicked()
radioData.generalSettings.PPM_Multiplier=PPM_Multiplier; radioData.generalSettings.PPM_Multiplier=PPM_Multiplier;
patch=true; patch=true;
} else { } else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio calibration data in profile, eeprom not patched")); QMessageBox::critical(this, tr("Warning"), tr("Wrong radio calibration data in profile, Settings not patched"));
} }
} }
if (ui->patchhw_CB->isChecked()) { if (ui->patchhw_CB->isChecked()) {
@ -568,7 +568,7 @@ void burnDialog::on_BurnFlashButton_clicked()
radioData.generalSettings.speakerVolume=byte8u; radioData.generalSettings.speakerVolume=byte8u;
patch=true; patch=true;
} else { } else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, eeprom not patched")); QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
} }
QString fileName; QString fileName;

View file

@ -96,7 +96,7 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>Burn to TX</string> <string>Write to TX</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -258,7 +258,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Load Firmware</string> <string>Browse for file</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -286,7 +286,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Backup and restore existing eeprom</string> <string>Backup and restore Models and Settings</string>
</property> </property>
<property name="tristate"> <property name="tristate">
<bool>false</bool> <bool>false</bool>

View file

@ -103,9 +103,9 @@ downloadDialog_forWait(NULL)
readSettings(); readSettings();
FirmwareInfo *firmware = GetCurrentFirmware(); FirmwareInfo *firmware = GetCurrentFirmware();
if (ActiveProfile) { if (ActiveProfile) {
setWindowTitle(tr("companion9x - EEPROM Editor - firmware %1 - profile %2").arg(firmware->name).arg(ActiveProfileName)); setWindowTitle(tr("companion9x - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
} else { } else {
setWindowTitle(tr("companion9x - EEPROM Editor - firmware %1").arg(firmware->name)); setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
} }
setUnifiedTitleAndToolBarOnMac(true); setUnifiedTitleAndToolBarOnMac(true);
this->setWindowIcon(QIcon(":/icon.png")); this->setWindowIcon(QIcon(":/icon.png"));
@ -347,7 +347,7 @@ void MainWindow::reply1Accepted()
int errnum=hline.mid(6).toInt(); int errnum=hline.mid(6).toInt();
switch(errnum) { switch(errnum) {
case 1: case 1:
errormsg=tr("Firmware does not longer fit in flash, due to selected firmware options"); errormsg=tr("Firmware does not longer fit in program memory, due to selected firmware options");
break; break;
case 2: case 2:
errormsg=tr("Compilation server temporary failure, try later"); errormsg=tr("Compilation server temporary failure, try later");
@ -387,7 +387,7 @@ void MainWindow::reply1Accepted()
int errnum=hline.mid(6).toInt(); int errnum=hline.mid(6).toInt();
switch(errnum) { switch(errnum) {
case 1: case 1:
errormsg=tr("Firmware does not fit in flash, due to selected firmware options"); errormsg=tr("Firmware does not fit in program memory, due to selected firmware options");
break; break;
case 2: case 2:
errormsg=tr("Compilation server termporary failure, try later"); errormsg=tr("Compilation server termporary failure, try later");
@ -427,7 +427,7 @@ void MainWindow::reply1Accepted()
} }
settings.setValue(downloadedFW, currentFWrev); settings.setValue(downloadedFW, currentFWrev);
if (autoflash) { if (autoflash) {
int ret = QMessageBox::question(this, "companion9x", tr("Do you want to flash the firmware now ?"), QMessageBox::Yes | QMessageBox::No); int ret = QMessageBox::question(this, "companion9x", tr("Do you want to write the firmware to the transmitter now ?"), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) { if (ret == QMessageBox::Yes) {
burnToFlash(downloadedFWFilename); burnToFlash(downloadedFWFilename);
} }
@ -712,13 +712,13 @@ void MainWindow::loadProfile()
settings.setValue("profileId", profnum); settings.setValue("profileId", profnum);
current_firmware_variant = GetFirmwareVariant(firmware_id); current_firmware_variant = GetFirmwareVariant(firmware_id);
FirmwareInfo *firmware = GetCurrentFirmware(); FirmwareInfo *firmware = GetCurrentFirmware();
setWindowTitle(tr("companion9x - EEPROM Editor - firmware %1").arg(firmware->name)); setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
// settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath()); // settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath());
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) { foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget()); MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
mdiChild->eepromInterfaceChanged(); mdiChild->eepromInterfaceChanged();
} }
setWindowTitle(tr("companion9x - EEPROM Editor - firmware %1 - profile %2").arg(firmware->name).arg(ActiveProfileName)); setWindowTitle(tr("companion9x - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
} }
} }
@ -729,7 +729,7 @@ void MainWindow::unloadProfile()
QSettings settings("companion9x", "companion9x"); QSettings settings("companion9x", "companion9x");
settings.setValue("ActiveProfile",0); settings.setValue("ActiveProfile",0);
FirmwareInfo *firmware = GetCurrentFirmware(); FirmwareInfo *firmware = GetCurrentFirmware();
setWindowTitle(tr("companion9x - EEPROM Editor - firmware %1").arg(firmware->name)); setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
} }
void MainWindow::preferences() void MainWindow::preferences()
@ -738,9 +738,9 @@ void MainWindow::preferences()
pd->exec(); pd->exec();
FirmwareInfo *firmware = GetCurrentFirmware(); FirmwareInfo *firmware = GetCurrentFirmware();
if (ActiveProfile) { if (ActiveProfile) {
setWindowTitle(tr("companion9x - EEPROM Editor - firmware %1 - profile %2").arg(firmware->name).arg(ActiveProfileName)); setWindowTitle(tr("companion9x - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
} else { } else {
setWindowTitle(tr("companion9x - EEPROM Editor - firmware %1").arg(firmware->name)); setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
} }
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) { foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
@ -1048,14 +1048,14 @@ void MainWindow::burnFrom()
} else { } else {
QStringList str; QStringList str;
str << path << tempFile; str << path << tempFile;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Read EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Read Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
res = ad->exec(); res = ad->exec();
sleep(1); sleep(1);
} }
} else { } else {
QStringList str = GetReceiveEEpromCommand(tempFile); QStringList str = GetReceiveEEpromCommand(tempFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Read EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Read Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
res = ad->exec(); res = ad->exec();
} }
@ -1076,10 +1076,10 @@ void MainWindow::burnExtenalToEEPROM()
cd->exec(); cd->exec();
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath()); settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath());
int ret = QMessageBox::question(this, "companion9x", tr("Write %1 to EEPROM memory?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No); int ret = QMessageBox::question(this, "companion9x", tr("Load %1 to Models and Settings?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) return; if (ret != QMessageBox::Yes) return;
if (!isValidEEPROM(fileName)) if (!isValidEEPROM(fileName))
ret = QMessageBox::question(this, "companion9x", tr("The file %1\nhas not been recognized as a valid EEPROM\nBurn anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No); ret = QMessageBox::question(this, "companion9x", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) return; if (ret != QMessageBox::Yes) return;
bool backupEnable = settings.value("backupEnable", true).toBool(); bool backupEnable = settings.value("backupEnable", true).toBool();
QString backupPath = settings.value("backupPath", "").toString(); QString backupPath = settings.value("backupPath", "").toString();
@ -1105,14 +1105,14 @@ void MainWindow::burnExtenalToEEPROM()
} else { } else {
QStringList str; QStringList str;
str << path << backupFile; str << path << backupFile;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
} else { } else {
QStringList str = GetReceiveEEpromCommand(backupFile); QStringList str = GetReceiveEEpromCommand(backupFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup EEPROM From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"));
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -1122,22 +1122,22 @@ void MainWindow::burnExtenalToEEPROM()
QString tempDir = QDir::tempPath(); QString tempDir = QDir::tempPath();
QString tempFlash = tempDir + "/flash.bin"; QString tempFlash = tempDir + "/flash.bin";
QStringList str = GetReceiveFlashCommand(tempFlash); QStringList str = GetReceiveFlashCommand(tempFlash);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Flash From Tx"); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Firmware From Tx");
ad->setWindowIcon(QIcon(":/images/read_flash.png")); ad->setWindowIcon(QIcon(":/images/read_flash.png"));
ad->exec(); ad->exec();
sleep(1); sleep(1);
QString restoreFile = tempDir + "/compat.bin"; QString restoreFile = tempDir + "/compat.bin";
if (!convertEEPROM(fileName, restoreFile, tempFlash)) { if (!convertEEPROM(fileName, restoreFile, tempFlash)) {
int ret = QMessageBox::question(this, "Error", tr("Cannot check eeprom compatibility! Continue anyway?") , int ret = QMessageBox::question(this, "Error", tr("Cannot check Models and Settings compatibility! Continue anyway?") ,
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
if (ret==QMessageBox::No) if (ret==QMessageBox::No)
return; return;
} else { } else {
int rev = getEpromVersion(restoreFile); int rev = getEpromVersion(restoreFile);
if ((rev / 100) != (oldrev / 100)) { if ((rev / 100) != (oldrev / 100)) {
QMessageBox::warning(this, tr("Warning"), tr("Firmware in radio is of a different family of eeprom written, check file and preferences!")); QMessageBox::warning(this, tr("Warning"), tr("The transmitter firmware belongs to another product family, check file and preferences!"));
} else if (rev < oldrev) { } else if (rev < oldrev) {
QMessageBox::warning(this, tr("Warning"), tr("Firmware in flash is outdated, please upgrade!")); QMessageBox::warning(this, tr("Warning"), tr("The transmitter firmware is outdated, please upgrade!"));
} }
fileName = restoreFile; fileName = restoreFile;
} }
@ -1155,14 +1155,14 @@ void MainWindow::burnExtenalToEEPROM()
} else { } else {
QStringList str; QStringList str;
str << path << backupFile; str << path << backupFile;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
} else { } else {
QStringList str = ((MainWindow *)this->parent())->GetReceiveEEpromCommand(backupFile); QStringList str = ((MainWindow *)this->parent())->GetReceiveEEpromCommand(backupFile);
avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, tr("Backup EEPROM From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"));
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
ad->exec(); ad->exec();
sleep(1); sleep(1);
@ -1177,14 +1177,14 @@ void MainWindow::burnExtenalToEEPROM()
} else { } else {
QStringList str; QStringList str;
str << fileName << path; str << fileName << path;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write EEPROM To Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write Models and Settings To Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
} else { } else {
QStringList str = GetSendEEpromCommand(fileName); QStringList str = GetSendEEpromCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Write EEPROM To Tx", AVR_DIALOG_SHOW_DONE); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Write Models and Settings To Tx", AVR_DIALOG_SHOW_DONE);
ad->setWindowIcon(QIcon(":/images/write_eeprom.png")); ad->setWindowIcon(QIcon(":/images/write_eeprom.png"));
ad->exec(); ad->exec();
} }
@ -1354,34 +1354,34 @@ void MainWindow::burnToFlash(QString fileToFlash)
backupFile=backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin"; backupFile=backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
} }
QStringList str = GetReceiveEEpromCommand(backupFile); QStringList str = GetReceiveEEpromCommand(backupFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup EEPROM From Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
int res = ad->exec(); int res = ad->exec();
if (QFileInfo(backupFile).exists() && res) { if (QFileInfo(backupFile).exists() && res) {
sleep(1); sleep(1);
QStringList str = GetSendFlashCommand(fileName); QStringList str = GetSendFlashCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Write Flash To Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Write Firmware To Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
ad->setWindowIcon(QIcon(":/images/write_flash.png")); ad->setWindowIcon(QIcon(":/images/write_flash.png"));
int res = ad->exec(); int res = ad->exec();
if (res) { if (res) {
QString restoreFile = tempDir + "/restore.bin"; QString restoreFile = tempDir + "/restore.bin";
if (!convertEEPROM(backupFile, restoreFile, fileName)) { if (!convertEEPROM(backupFile, restoreFile, fileName)) {
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert EEProm for this firmware, original EEProm file will be used")); QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
restoreFile = backupFile; restoreFile = backupFile;
} }
sleep(1); sleep(1);
QStringList str = GetSendEEpromCommand(restoreFile); QStringList str = GetSendEEpromCommand(restoreFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Restore EEPROM To Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Restore Models and Settings To Tx"), AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
ad->setWindowIcon(QIcon(":/images/write_eeprom.png")); ad->setWindowIcon(QIcon(":/images/write_eeprom.png"));
res=ad->exec(); res=ad->exec();
if (!res) { if (!res) {
QMessageBox::warning(this, tr("Restore failed"), tr("Cannot restore EEProm to TX, original EEProm file can be found at: %1").arg(backupFile)); QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to TX. The models and settings data file can be found at: %1").arg(backupFile));
} }
} else { } else {
QMessageBox::warning(this, tr("Flash failed"), tr("Cannot flash the TX, original EEProm file can be found at: %1").arg(backupFile)); QMessageBox::warning(this, tr("Firmware write failed"), tr("Could not write firmware to to transmitter. The models and settings data file can be found at: %1").arg(backupFile));
} }
} else { } else {
QMessageBox::warning(this, tr("Backup failed"), tr("Cannot backup existing EEProm from TX, Flash process aborted")); QMessageBox::warning(this, tr("Backup failed"), tr("Cannot backup existing Models and Settings from TX. Firmware write process aborted"));
} }
} else { } else {
bool backupEnable=settings.value("backupEnable", true).toBool(); bool backupEnable=settings.value("backupEnable", true).toBool();
@ -1396,14 +1396,14 @@ void MainWindow::burnToFlash(QString fileToFlash)
QDateTime datetime; QDateTime datetime;
QString backupFile=backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin"; QString backupFile=backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
QStringList str = GetReceiveEEpromCommand(backupFile); QStringList str = GetReceiveEEpromCommand(backupFile);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup EEPROM From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Backup Models and Settings From Tx"));
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
ad->exec(); ad->exec();
sleep(1); sleep(1);
} }
QStringList str = GetSendFlashCommand(fileName); QStringList str = GetSendFlashCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Write Flash To Tx"), AVR_DIALOG_SHOW_DONE); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Write Firmware To Tx"), AVR_DIALOG_SHOW_DONE);
ad->setWindowIcon(QIcon(":/images/write_flash.png")); ad->setWindowIcon(QIcon(":/images/write_flash.png"));
ad->exec(); ad->exec();
} }
@ -1413,25 +1413,25 @@ void MainWindow::burnToFlash(QString fileToFlash)
void MainWindow::burnExtenalFromEEPROM() void MainWindow::burnExtenalFromEEPROM()
{ {
QSettings settings("companion9x", "companion9x"); QSettings settings("companion9x", "companion9x");
QString fileName = QFileDialog::getSaveFileName(this, tr("Read EEPROM memory to File"), settings.value("lastDir").toString(), tr(EXTERNAL_EEPROM_FILES_FILTER)); QString fileName = QFileDialog::getSaveFileName(this, tr("Save transmitter Models and Settings to File"), settings.value("lastDir").toString(), tr(EXTERNAL_EEPROM_FILES_FILTER));
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
EEPROMInterface *eepromInterface = GetEepromInterface(); EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_TARANIS(eepromInterface->getBoard())) { if (IS_TARANIS(eepromInterface->getBoard())) {
QString path=FindTaranisPath(); QString path=FindTaranisPath();
if (path.isEmpty()) { if (path.isEmpty()) {
QMessageBox::warning(this, tr("Taranis radio not found"), tr("Impossible to identify the radio on your system, please verify the eeprom disk is connected.")); QMessageBox::warning(this, tr("Taranis radio not found"), tr("Impossible to identify the radio on your system, please verify that the eeprom disk is connected."));
return; return;
} else { } else {
QStringList str; QStringList str;
str << path << fileName; str << path << fileName;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Read EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Read Models and Settings From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
ad->exec(); ad->exec();
} }
} else { } else {
settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath()); settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath());
QStringList str = GetReceiveEEpromCommand(fileName); QStringList str = GetReceiveEEpromCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Read EEPROM From Tx")); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, tr("Read Models and Settings From Tx"));
ad->setWindowIcon(QIcon(":/images/read_eeprom.png")); ad->setWindowIcon(QIcon(":/images/read_eeprom.png"));
ad->exec(); ad->exec();
} }
@ -1441,7 +1441,7 @@ void MainWindow::burnExtenalFromEEPROM()
void MainWindow::burnFromFlash() void MainWindow::burnFromFlash()
{ {
QSettings settings("companion9x", "companion9x"); QSettings settings("companion9x", "companion9x");
QString fileName = QFileDialog::getSaveFileName(this,tr("Read Flash to File"), settings.value("lastFlashDir").toString(),tr(FLASH_FILES_FILTER)); QString fileName = QFileDialog::getSaveFileName(this,tr("Read Tx Firmware to File"), settings.value("lastFlashDir").toString(),tr(FLASH_FILES_FILTER));
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
QFile file(fileName); QFile file(fileName);
if (file.exists()) { if (file.exists()) {
@ -1449,7 +1449,7 @@ void MainWindow::burnFromFlash()
} }
settings.setValue("lastFlashDir",QFileInfo(fileName).dir().absolutePath()); settings.setValue("lastFlashDir",QFileInfo(fileName).dir().absolutePath());
QStringList str = GetReceiveFlashCommand(fileName); QStringList str = GetReceiveFlashCommand(fileName);
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Flash From Tx"); avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Read Firmware From Tx");
ad->setWindowIcon(QIcon(":/images/read_flash.png")); ad->setWindowIcon(QIcon(":/images/read_flash.png"));
ad->exec(); ad->exec();
} }
@ -1674,34 +1674,34 @@ void MainWindow::createActions()
connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste())); connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
burnToAct = new QAction(QIcon(":/images/write_eeprom.png"), tr("&Write EEPROM To Tx"), this); burnToAct = new QAction(QIcon(":/images/write_eeprom.png"), tr("&Write Models and Settings To Tx"), this);
burnToAct->setShortcut(tr("Ctrl+Alt+W")); burnToAct->setShortcut(tr("Ctrl+Alt+W"));
burnToAct->setStatusTip(tr("Write EEPROM to transmitter")); burnToAct->setStatusTip(tr("Write Models and Settings to transmitter"));
connect(burnToAct,SIGNAL(triggered()),this,SLOT(burnTo())); connect(burnToAct,SIGNAL(triggered()),this,SLOT(burnTo()));
burnFromAct = new QAction(QIcon(":/images/read_eeprom.png"), tr("&Read EEPROM From Tx"), this); burnFromAct = new QAction(QIcon(":/images/read_eeprom.png"), tr("&Read Models and Settings From Tx"), this);
burnFromAct->setShortcut(tr("Ctrl+Alt+R")); burnFromAct->setShortcut(tr("Ctrl+Alt+R"));
burnFromAct->setStatusTip(tr("Read EEPROM from transmitter")); burnFromAct->setStatusTip(tr("Read Models and Settings from transmitter"));
connect(burnFromAct,SIGNAL(triggered()),this,SLOT(burnFrom())); connect(burnFromAct,SIGNAL(triggered()),this,SLOT(burnFrom()));
burnToFlashAct = new QAction(QIcon(":/images/write_flash.png"), tr("Write Flash memory"), this); burnToFlashAct = new QAction(QIcon(":/images/write_flash.png"), tr("Write Firmware"), this);
burnToFlashAct->setStatusTip(tr("Write flash memory to transmitter")); burnToFlashAct->setStatusTip(tr("Write firmware to transmitter"));
connect(burnToFlashAct,SIGNAL(triggered()),this,SLOT(burnToFlash())); connect(burnToFlashAct,SIGNAL(triggered()),this,SLOT(burnToFlash()));
burnExtenalToEEPROMAct = new QAction(QIcon(":/images/write_eeprom_file.png"), tr("Write EEPROM memory from file"), this); burnExtenalToEEPROMAct = new QAction(QIcon(":/images/write_eeprom_file.png"), tr("Write Models and Settings from file to Tx"), this);
burnExtenalToEEPROMAct->setStatusTip(tr("Write EEPROM memory from file to transmitter")); burnExtenalToEEPROMAct->setStatusTip(tr("Write Models and Settings from file to transmitter"));
connect(burnExtenalToEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalToEEPROM())); connect(burnExtenalToEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalToEEPROM()));
burnExtenalFromEEPROMAct = new QAction(QIcon(":/images/read_eeprom_file.png"), tr("Read EEPROM memory to file"), this); burnExtenalFromEEPROMAct = new QAction(QIcon(":/images/read_eeprom_file.png"), tr("Save transmitter Models and Settings to file"), this);
burnExtenalFromEEPROMAct->setStatusTip(tr("Read EEPROM memory from transmitter to file")); burnExtenalFromEEPROMAct->setStatusTip(tr("Save the Models and Settings from the transmitter to a file"));
connect(burnExtenalFromEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalFromEEPROM())); connect(burnExtenalFromEEPROMAct,SIGNAL(triggered()),this,SLOT(burnExtenalFromEEPROM()));
burnFromFlashAct = new QAction(QIcon(":/images/read_flash.png"), tr("Read Flash memory"), this); burnFromFlashAct = new QAction(QIcon(":/images/read_flash.png"), tr("Read Firmware"), this);
burnFromFlashAct->setStatusTip(tr("Read flash memory to transmitter")); burnFromFlashAct->setStatusTip(tr("Read firmware from transmitter"));
connect(burnFromFlashAct,SIGNAL(triggered()),this,SLOT(burnFromFlash())); connect(burnFromFlashAct,SIGNAL(triggered()),this,SLOT(burnFromFlash()));
burnConfigAct = new QAction(QIcon(":/images/configure.png"), tr("&Configure..."), this); burnConfigAct = new QAction(QIcon(":/images/configure.png"), tr("&Configure Communication..."), this);
burnConfigAct->setStatusTip(tr("Configure burning software")); burnConfigAct->setStatusTip(tr("Configure software for communication with the transmitter"));
connect(burnConfigAct,SIGNAL(triggered()),this,SLOT(burnConfig())); connect(burnConfigAct,SIGNAL(triggered()),this,SLOT(burnConfig()));
EEPROMInterface *eepromInterface = GetEepromInterface(); EEPROMInterface *eepromInterface = GetEepromInterface();
if (!IS_ARM(eepromInterface->getBoard())) { if (!IS_ARM(eepromInterface->getBoard())) {
@ -1817,7 +1817,7 @@ void MainWindow::createMenus()
editMenu->addAction(copyAct); editMenu->addAction(copyAct);
editMenu->addAction(pasteAct); editMenu->addAction(pasteAct);
burnMenu = menuBar()->addMenu(tr("&Burn")); burnMenu = menuBar()->addMenu(tr("&Read/Write"));
burnMenu->addAction(burnToAct); burnMenu->addAction(burnToAct);
burnMenu->addAction(burnFromAct); burnMenu->addAction(burnFromAct);
burnMenu->addSeparator(); burnMenu->addSeparator();
@ -1913,7 +1913,7 @@ void MainWindow::createToolBars()
editToolBar->addAction(copyAct); editToolBar->addAction(copyAct);
editToolBar->addAction(pasteAct); editToolBar->addAction(pasteAct);
burnToolBar = addToolBar(tr("Burn")); burnToolBar = addToolBar(tr("Write"));
burnToolBar->addAction(burnToAct); burnToolBar->addAction(burnToAct);
burnToolBar->addAction(burnFromAct); burnToolBar->addAction(burnFromAct);
burnToolBar->addSeparator(); burnToolBar->addSeparator();
@ -2100,13 +2100,13 @@ int MainWindow::getEpromVersion(QString fileName)
uint8_t eeprom[EESIZE_RLC_MAX]; uint8_t eeprom[EESIZE_RLC_MAX];
int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX); int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX);
if (!eeprom_size) { if (!eeprom_size) {
QMessageBox::critical(this, tr("Error"), tr("Invalid EEPROM File %1").arg(fileName)); QMessageBox::critical(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(fileName));
file.close(); file.close();
return -1; return -1;
} }
file.close(); file.close();
if (!LoadEeprom(testData, eeprom, eeprom_size)) { if (!LoadEeprom(testData, eeprom, eeprom_size)) {
QMessageBox::critical(this, tr("Error"),tr("Invalid EEPROM File %1").arg(fileName)); QMessageBox::critical(this, tr("Error"),tr("Invalid Models and Settings File %1").arg(fileName));
return -1; return -1;
} }
} }
@ -2125,7 +2125,7 @@ int MainWindow::getEpromVersion(QString fileName)
return -1; return -1;
} }
if (!LoadEeprom(testData, eeprom, eeprom_size)) { if (!LoadEeprom(testData, eeprom, eeprom_size)) {
QMessageBox::critical(this, tr("Error"),tr("Invalid binary EEPROM File %1").arg(fileName)); QMessageBox::critical(this, tr("Error"),tr("Invalid binary Models and Settings File %1").arg(fileName));
return -1; return -1;
} }
} }

View file

@ -566,7 +566,7 @@ void preferencesDialog::on_snapshotClipboardCKB_clicked()
void preferencesDialog::on_backupPathButton_clicked() void preferencesDialog::on_backupPathButton_clicked()
{ {
QSettings settings("companion9x", "companion9x"); QSettings settings("companion9x", "companion9x");
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your eeprom backup folder"), settings.value("backupPath").toString()); QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), settings.value("backupPath").toString());
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
settings.setValue("backupPath", fileName); settings.setValue("backupPath", fileName);
ui->backupPath->setText(fileName); ui->backupPath->setText(fileName);

View file

@ -787,7 +787,7 @@ Mode 4:
<item row="16" column="0"> <item row="16" column="0">
<widget class="QLabel" name="label_17"> <widget class="QLabel" name="label_17">
<property name="text"> <property name="text">
<string>eEprom backup folder</string> <string>Models and Settings folder</string>
</property> </property>
</widget> </widget>
</item> </item>