Cosmetics

This commit is contained in:
bsongis
2015-05-25 20:09:31 +02:00
parent 6f51fc9da6
commit ae833f98d0
+23 -24
View File
@@ -197,12 +197,10 @@ void FlashProcess::analyseStandardError(const QString &text)
currStderrLine = currStderrLine.mid(nlPos+1); currStderrLine = currStderrLine.mid(nlPos+1);
} }
if (text.contains("-E-") && !text.contains("-E- No receive file name")) { if ((text.contains("-E-") && !text.contains("-E- No receive file name")) ||
text.contains("No DFU capable USB device found")) {
hasErrors = true; hasErrors = true;
} }
if (text.contains("No DFU capable USB device found")) {
hasErrors = true;
}
} }
void FlashProcess::onReadyReadStandardOutput() void FlashProcess::onReadyReadStandardOutput()
@@ -221,39 +219,39 @@ void FlashProcess::onReadyReadStandardError()
void FlashProcess::errorWizard() void FlashProcess::errorWizard()
{ {
QString output=progress->getText(); // TODO = ui->plainTextEdit->toPlainText(); QString output = progress->getText();
if (output.contains("avrdude: Expected signature for")) { // wrong signature if (output.contains("avrdude: Expected signature for")) { // wrong signature
int pos=output.indexOf("avrdude: Device signature = "); int pos = output.indexOf("avrdude: Device signature = ");
bool fwexist=false; bool fwexist = false;
QString DeviceStr="Unknown"; QString DeviceStr = tr("unknown");
QString FwStr=""; QString FwStr = "";
if (pos>0) { if (pos > 0) {
QString DeviceId=output.mid(pos+28,8); QString DeviceId = output.mid(pos+28, 8);
if (DeviceId=="0x1e9602") { if (DeviceId=="0x1e9602") {
DeviceStr="Atmega 64"; DeviceStr = "Atmega 64";
FwStr="\n"+tr("ie: OpenTX for 9X board or OpenTX for 9XR board"); FwStr="\n" + tr("ie: OpenTX for 9X board or OpenTX for 9XR board");
fwexist=true; fwexist = true;
} }
else if (DeviceId=="0x1e9702") { else if (DeviceId=="0x1e9702") {
DeviceStr="Atmega 128"; DeviceStr = "Atmega 128";
FwStr="\n"+tr("ie: OpenTX for M128 / 9X board or OpenTX for 9XR board with M128 chip"); FwStr="\n" + tr("ie: OpenTX for M128 / 9X board or OpenTX for 9XR board with M128 chip");
fwexist=true; fwexist = true;
} }
else if (DeviceId=="0x1e9703") { else if (DeviceId=="0x1e9703") {
DeviceStr="Atmega 1280"; DeviceStr = "Atmega 1280";
} }
else if (DeviceId=="0x1e9704") { else if (DeviceId=="0x1e9704") {
DeviceStr="Atmega 1281"; DeviceStr = "Atmega 1281";
} }
else if (DeviceId=="0x1e9801") { else if (DeviceId=="0x1e9801") {
DeviceStr="Atmega 2560"; DeviceStr = "Atmega 2560";
FwStr="\n"+tr("ie: OpenTX for Gruvin9X board"); FwStr="\n" + tr("ie: OpenTX for Gruvin9X board");
fwexist = true; fwexist = true;
} }
else if (DeviceId=="0x1e9802") { else if (DeviceId=="0x1e9802") {
DeviceStr="Atmega 2561"; DeviceStr = "Atmega 2561";
} }
} }
if (fwexist==false) { if (fwexist==false) {
@@ -263,7 +261,8 @@ void FlashProcess::errorWizard()
Firmware *firmware = GetCurrentFirmware(); Firmware *firmware = GetCurrentFirmware();
QMessageBox::warning(NULL, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease select an appropriate firmware type to program it.").arg(DeviceStr)+FwStr+tr("\nYou are currently using:\n %1").arg(firmware->getName())); QMessageBox::warning(NULL, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease select an appropriate firmware type to program it.").arg(DeviceStr)+FwStr+tr("\nYou are currently using:\n %1").arg(firmware->getName()));
} }
} else if (output.contains("No DFU capable USB device found")){ }
else if (output.contains("No DFU capable USB device found")){
#if defined WIN32 || !defined __GNUC__ #if defined WIN32 || !defined __GNUC__
QMessageBox::warning(NULL, "Companion - Tip of the day", tr("Your radio does not seem connected to USB or the driver is not installed!!!\n\nPlease use ZADIG to properly install the driver.")); QMessageBox::warning(NULL, "Companion - Tip of the day", tr("Your radio does not seem connected to USB or the driver is not installed!!!\n\nPlease use ZADIG to properly install the driver."));
#else #else
@@ -298,6 +297,6 @@ void FlashProcess::onFinished(int code=0)
void FlashProcess::addReadFuses() void FlashProcess::addReadFuses()
{ {
progress->addSeparator(); progress->addSeparator();
progress->addText(tr("FUSES: Low=%1 High=%2 Ext=%3").arg(lfuse,2,16,QChar('0')).arg(hfuse,2,16,QChar('0')).arg(efuse,2,16,QChar('0'))); progress->addText(tr("FUSES: Low=%1 High=%2 Ext=%3").arg(lfuse, 2, 16, QChar('0')).arg(hfuse, 2, 16, QChar('0')).arg(efuse, 2, 16, QChar('0')));
progress->addSeparator(); progress->addSeparator();
} }