Merge remote-tracking branch 'origin/next' into mhotar/cz_translations

This commit is contained in:
mhotar
2014-04-19 18:23:23 +02:00
99 changed files with 3927 additions and 4807 deletions
+1
View File
@@ -5,3 +5,4 @@ radio/src/bootloader/.dep/
radio/src/bootloader/bootloader_ramBoot* radio/src/bootloader/bootloader_ramBoot*
*.lbm *.lbm
*.o *.o
/doc
+8 -5
View File
@@ -178,14 +178,14 @@ Nicholas Crego
Keith Hertzog Keith Hertzog
Johan Moelich Johan Moelich
Timo Esser Timo Esser
Dean Church (mensual) Dean Church (monthly)
Brian Paddock (mensual) Brian Paddock (monthly)
Jean Pierre Parisy Jean Pierre Parisy
Norbert Martsch Norbert Martsch
Jean-Marie Guitard Jean-Marie Guitard
Eric Beier Eric Beier
Mike Perkins Mike Perkins
Tilman Baumann (mensual) Tilman Baumann (monthly)
Fred Larssen Fred Larssen
Ari Aalto Ari Aalto
Robert Sams Robert Sams
@@ -197,7 +197,7 @@ Kenneth Crump
Dave Matison Dave Matison
Mike Matheny Mike Matheny
Pino Agostino Pino Agostino
Graham Boucher (mensual) Graham Boucher (monthly)
Nelson Noura Nelson Noura
Joel Allamy Joel Allamy
Philip David Martin Philip David Martin
@@ -208,7 +208,7 @@ Timothy Pelletier
Glen Roe (ShowMaster) Glen Roe (ShowMaster)
Jan Van Ooteghem Jan Van Ooteghem
David Ankers - Special thanks here to the OpenPilot project! David Ankers - Special thanks here to the OpenPilot project!
Lawrence Christensen (mensual) Lawrence Christensen (monthly)
Leo Duflou Leo Duflou
Bruce Wood Bruce Wood
Arnd Feige Arnd Feige
@@ -372,3 +372,6 @@ Aaron Stringer
Alan J Wasserman Alan J Wasserman
Wolfgang Rauser Wolfgang Rauser
Samuel Cook Samuel Cook
BoltRC - www.boltrc.com
Friedrich Ipolt
+247 -30
View File
@@ -11,14 +11,22 @@
#include <QDesktopServices> #include <QDesktopServices>
#include <QtGui> #include <QtGui>
appPreferencesDialog::appPreferencesDialog(QWidget *parent) : AppPreferencesDialog::AppPreferencesDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::appPreferencesDialog) ui(new Ui::AppPreferencesDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
updateLock=false;
setWindowIcon(CompanionIcon("apppreferences.png")); setWindowIcon(CompanionIcon("apppreferences.png"));
voice=NULL;
connect(ui->langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
connect(ui->voiceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
initSettings(); initSettings();
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
connect(this, SIGNAL(accepted()), this, SLOT(writeValues())); connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
#ifndef JOYSTICKS #ifndef JOYSTICKS
ui->joystickCB->hide(); ui->joystickCB->hide();
ui->joystickCB->setDisabled(true); ui->joystickCB->setDisabled(true);
@@ -26,15 +34,16 @@ appPreferencesDialog::appPreferencesDialog(QWidget *parent) :
ui->joystickChkB->hide(); ui->joystickChkB->hide();
ui->label_11->hide(); ui->label_11->hide();
#endif #endif
resize(0,0);
shrink();
} }
appPreferencesDialog::~appPreferencesDialog() AppPreferencesDialog::~AppPreferencesDialog()
{ {
delete ui; delete ui;
} }
void appPreferencesDialog::writeValues() void AppPreferencesDialog::writeValues()
{ {
g.autoCheckApp(ui->startupCheck_companion9x->isChecked()); g.autoCheckApp(ui->startupCheck_companion9x->isChecked());
g.autoCheckFw(ui->startupCheck_fw->isChecked()); g.autoCheckFw(ui->startupCheck_fw->isChecked());
@@ -69,17 +78,17 @@ void appPreferencesDialog::writeValues()
else else
g.profile[g.id()].name(ui->profileNameLE->text()); g.profile[g.id()].name(ui->profileNameLE->text());
// If a new radio type has been choosen, several things need to reset // If a new fw type has been choosen, several things need to reset
if ( initialRadioType != ui->radioCB->currentIndex()) g.cpuId( ui->CPU_ID_LE->text() );
{ current_firmware_variant = getFirmwareVariant();
if (g.profile[g.id()].fwType() != current_firmware_variant.id) {
g.profile[g.id()].fwName(""); g.profile[g.id()].fwName("");
g.profile[g.id()].fwType(getDefaultFwType(ui->radioCB->currentIndex()));
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
g.profile[g.id()].initFwVariables(); g.profile[g.id()].initFwVariables();
g.profile[g.id()].fwType( current_firmware_variant.id );
} }
} }
void appPreferencesDialog::on_snapshotPathButton_clicked() void AppPreferencesDialog::on_snapshotPathButton_clicked()
{ {
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), g.snapshotDir()); QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), g.snapshotDir());
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
@@ -89,7 +98,7 @@ void appPreferencesDialog::on_snapshotPathButton_clicked()
} }
} }
void appPreferencesDialog::initSettings() void AppPreferencesDialog::initSettings()
{ {
ui->snapshotClipboardCKB->setChecked(g.snapToClpbrd()); ui->snapshotClipboardCKB->setChecked(g.snapToClpbrd());
ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware()); ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware());
@@ -105,8 +114,10 @@ void appPreferencesDialog::initSettings()
ui->showSplash->setChecked(g.showSplash()); ui->showSplash->setChecked(g.showSplash());
ui->historySize->setValue(g.historySize()); ui->historySize->setValue(g.historySize());
ui->backLightColor->setCurrentIndex(g.backLight()); ui->backLightColor->setCurrentIndex(g.backLight());
if (getRadioType(g.profile[g.id()].fwType())==6) // TODO - NOT AT ALL OK. THERE SHOULD BE A COMMON RADIO DEFINITION.
if (IS_TARANIS(GetCurrentFirmware()->getBoard()))
ui->backLightColor->setEnabled(false); ui->backLightColor->setEnabled(false);
ui->simuSW->setChecked(g.simuSW()); ui->simuSW->setChecked(g.simuSW());
ui->modelWizard_CB->setChecked(g.useWizard()); ui->modelWizard_CB->setChecked(g.useWizard());
ui->libraryPath->setText(g.libDir()); ui->libraryPath->setText(g.libDir());
@@ -159,8 +170,7 @@ void appPreferencesDialog::initSettings()
ui->sdPath->setText(g.profile[g.id()].sdPath()); ui->sdPath->setText(g.profile[g.id()].sdPath());
ui->profileNameLE->setText(g.profile[g.id()].name()); ui->profileNameLE->setText(g.profile[g.id()].name());
ui->SplashFileName->setText(g.profile[g.id()].splashFile()); ui->SplashFileName->setText(g.profile[g.id()].splashFile());
initialRadioType = getRadioType(g.profile[g.id()].fwType());
ui->radioCB->setCurrentIndex(initialRadioType);
displayImage( g.profile[g.id()].splashFile() ); displayImage( g.profile[g.id()].splashFile() );
QString hwSettings; QString hwSettings;
@@ -176,9 +186,22 @@ void appPreferencesDialog::initSettings()
} }
ui->lblGeneralSettings->setText(hwSettings); ui->lblGeneralSettings->setText(hwSettings);
ui->CPU_ID_LE->setText(g.cpuId());
FirmwareInterface * current_firmware = GetCurrentFirmware();
foreach(FirmwareInterface * firmware, firmwares) {
ui->downloadVerCB->addItem(firmware->name, firmware->id);
if (current_firmware == firmware) {
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
}
}
baseFirmwareChanged();
firmwareChanged();
} }
void appPreferencesDialog::on_libraryPathButton_clicked() void AppPreferencesDialog::on_libraryPathButton_clicked()
{ {
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your library folder"), g.libDir()); QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your library folder"), g.libDir());
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
@@ -187,13 +210,14 @@ void appPreferencesDialog::on_libraryPathButton_clicked()
} }
} }
void appPreferencesDialog::on_snapshotClipboardCKB_clicked() void AppPreferencesDialog::on_snapshotClipboardCKB_clicked()
{ {
if (ui->snapshotClipboardCKB->isChecked()) { if (ui->snapshotClipboardCKB->isChecked()) {
ui->snapshotPath->setDisabled(true); ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true); ui->snapshotPathButton->setDisabled(true);
g.snapToClpbrd(true); g.snapToClpbrd(true);
} else { }
else {
ui->snapshotPath->setEnabled(true); ui->snapshotPath->setEnabled(true);
ui->snapshotPath->setReadOnly(true); ui->snapshotPath->setReadOnly(true);
ui->snapshotPathButton->setEnabled(true); ui->snapshotPathButton->setEnabled(true);
@@ -201,7 +225,7 @@ void appPreferencesDialog::on_snapshotClipboardCKB_clicked()
} }
} }
void appPreferencesDialog::on_backupPathButton_clicked() void AppPreferencesDialog::on_backupPathButton_clicked()
{ {
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupDir()); QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupDir());
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
@@ -211,7 +235,7 @@ void appPreferencesDialog::on_backupPathButton_clicked()
ui->backupEnable->setEnabled(true); ui->backupEnable->setEnabled(true);
} }
void appPreferencesDialog::on_ge_pathButton_clicked() void AppPreferencesDialog::on_ge_pathButton_clicked()
{ {
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Google Earth executable"),ui->ge_lineedit->text()); QString fileName = QFileDialog::getOpenFileName(this, tr("Select Google Earth executable"),ui->ge_lineedit->text());
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
@@ -220,7 +244,7 @@ void appPreferencesDialog::on_ge_pathButton_clicked()
} }
#ifdef JOYSTICKS #ifdef JOYSTICKS
void appPreferencesDialog::on_joystickChkB_clicked() { void AppPreferencesDialog::on_joystickChkB_clicked() {
if (ui->joystickChkB->isChecked()) { if (ui->joystickChkB->isChecked()) {
QStringList joystickNames; QStringList joystickNames;
joystickNames << tr("No joysticks found"); joystickNames << tr("No joysticks found");
@@ -246,7 +270,7 @@ void appPreferencesDialog::on_joystickChkB_clicked() {
} }
} }
void appPreferencesDialog::on_joystickcalButton_clicked() { void AppPreferencesDialog::on_joystickcalButton_clicked() {
joystickDialog * jd=new joystickDialog(this, ui->joystickCB->currentIndex()); joystickDialog * jd=new joystickDialog(this, ui->joystickCB->currentIndex());
jd->exec(); jd->exec();
} }
@@ -254,7 +278,7 @@ void appPreferencesDialog::on_joystickcalButton_clicked() {
// ******** Profile tab functions // ******** Profile tab functions
void appPreferencesDialog::on_sdPathButton_clicked() void AppPreferencesDialog::on_sdPathButton_clicked()
{ {
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), g.profile[g.id()].sdPath()); QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), g.profile[g.id()].sdPath());
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
@@ -262,12 +286,12 @@ void appPreferencesDialog::on_sdPathButton_clicked()
} }
} }
void appPreferencesDialog::on_removeProfileButton_clicked() void AppPreferencesDialog::on_removeProfileButton_clicked()
{ {
if ( g.id() == 0 ) if ( g.id() == 0 ) {
QMessageBox::information(this, tr("Not possible to remove profile"), tr("The default profile can not be removed.")); QMessageBox::information(this, tr("Not possible to remove profile"), tr("The default profile can not be removed."));
else }
{ else {
g.profile[g.id()].remove(); g.profile[g.id()].remove();
g.id( 0 ); g.id( 0 );
initSettings(); initSettings();
@@ -275,7 +299,7 @@ void appPreferencesDialog::on_removeProfileButton_clicked()
} }
bool appPreferencesDialog::displayImage( QString fileName ) bool AppPreferencesDialog::displayImage( QString fileName )
{ {
// Start by clearing the pixmap // Start by clearing the pixmap
ui->imageLabel->setPixmap(QPixmap()); ui->imageLabel->setPixmap(QPixmap());
@@ -294,7 +318,7 @@ bool appPreferencesDialog::displayImage( QString fileName )
return true; return true;
} }
void appPreferencesDialog::on_SplashSelect_clicked() void AppPreferencesDialog::on_SplashSelect_clicked()
{ {
QString supportedImageFormats; QString supportedImageFormats;
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) { for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
@@ -312,11 +336,204 @@ void appPreferencesDialog::on_SplashSelect_clicked()
} }
} }
void appPreferencesDialog::on_clearImageButton_clicked() { void AppPreferencesDialog::on_clearImageButton_clicked() {
ui->imageLabel->clear(); ui->imageLabel->clear();
ui->SplashFileName->clear(); ui->SplashFileName->clear();
} }
void AppPreferencesDialog::showVoice(bool show)
{
if (show)
showVoice();
else
hideVoice();
}
void AppPreferencesDialog::showVoice()
{
ui->voiceLabel->show();
ui->voiceCombo->show();
}
void AppPreferencesDialog::hideVoice()
{
ui->voiceLabel->hide();
ui->voiceCombo->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
}
void AppPreferencesDialog::baseFirmwareChanged()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
voice=NULL;
foreach(FirmwareInterface * firmware, firmwares) {
if (firmware->id == selected_firmware) {
showVoice(firmware->voice);
populateFirmwareOptions(firmware);
break;
}
}
firmwareChanged();
}
FirmwareVariant AppPreferencesDialog::getFirmwareVariant()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
bool voice=false;
foreach(FirmwareInterface * firmware, firmwares) {
if (firmware->id == selected_firmware) {
QString id = firmware->id;
foreach(QCheckBox *cb, optionsCheckBoxes) {
if (cb->isChecked()) {
if (cb->text()=="voice" && cb->isChecked())
voice=true;
id += QString("-") + cb->text();
}
}
if (! firmware->getCapability(MultiLangVoice)) {
if (ui->voiceCombo->count() && (voice || firmware->voice))
id += QString("-tts") + ui->voiceCombo->currentText();
}
if (ui->langCombo->count())
id += QString("-") + ui->langCombo->currentText();
return GetFirmwareVariant(id);
}
}
// Should never occur...
return default_firmware_variant;
}
void AppPreferencesDialog::firmwareOptionChanged(bool state)
{
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
FirmwareInterface * firmware=NULL;
if (cb && state) {
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
foreach(firmware, firmwares) {
if (firmware->id == selected_firmware) {
foreach(QList<Option> opts, firmware->opts) {
foreach(Option opt, opts) {
if (cb->text() == opt.name) {
foreach(Option other, opts) {
if (other.name != opt.name) {
foreach(QCheckBox *ocb, optionsCheckBoxes) {
if (ocb->text() == other.name)
ocb->setChecked(false);
}
}
}
if (voice) {
showVoice(voice->isChecked());
}
return firmwareChanged();
}
}
}
}
}
}
else if (cb && !state) {
if (cb->text()=="voice") {
hideVoice();
}
}
if (voice) {
showVoice(voice->isChecked());
}
else if (firmware) {
if (firmware->voice) {
showVoice();
}
}
return firmwareChanged();
}
void AppPreferencesDialog::firmwareLangChanged()
{
firmwareChanged();
}
void AppPreferencesDialog::firmwareChanged()
{
if (updateLock)
return;
FirmwareVariant variant = getFirmwareVariant();
QString stamp;
stamp.append(variant.firmware->getStampUrl());
QString url = variant.getFirmwareUrl();
// B-Plan
if (false) {
ui->CPU_ID_LE->show();
ui->CPU_ID_LABEL->show();
} else {
ui->CPU_ID_LE->hide();
ui->CPU_ID_LABEL->hide();
}
}
void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * firmware)
{
const FirmwareInterface * parent = /*firmware->parent ? firmware->parent : */ firmware;
updateLock = true;
ui->langCombo->clear();
foreach(const char *lang, parent->languages) {
ui->langCombo->addItem(lang);
if (current_firmware_variant.id.endsWith(lang))
ui->langCombo->setCurrentIndex(ui->langCombo->count() - 1);
}
ui->voiceCombo->clear();
foreach(const char *lang, parent->ttslanguages) {
ui->voiceCombo->addItem(lang);
if (current_firmware_variant.id.contains(QString("-tts%1").arg(lang)))
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
}
showVoice(ui->langCombo->count()!=0);
int index = 0;
foreach(QList<Option> opts, parent->opts) {
foreach(Option opt, opts) {
if (index >= optionsCheckBoxes.size()) {
QCheckBox * checkbox = new QCheckBox(ui->profileTab);
ui->optionsLayout->addWidget(checkbox, optionsCheckBoxes.count()/5, optionsCheckBoxes.count()%5, 1, 1);
optionsCheckBoxes.push_back(checkbox);
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
}
QCheckBox *cb = optionsCheckBoxes.at(index++);
if (cb) {
cb->show();
cb->setText(opt.name);
cb->setToolTip(opt.tooltip);
cb->setCheckState(current_firmware_variant.id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
if (opt.name==QString("voice")) {
voice=cb;
showVoice(current_firmware_variant.id.contains(opt.name) ||firmware->voice);
}
}
}
}
for (; index<optionsCheckBoxes.size(); index++) {
QCheckBox *cb = optionsCheckBoxes.at(index);
cb->hide();
cb->setCheckState(Qt::Unchecked);
}
updateLock = false;
QTimer::singleShot(0, this, SLOT(shrink()));
}
void AppPreferencesDialog::shrink()
{
resize(0,0);
}
+24 -9
View File
@@ -6,29 +6,44 @@
#include "eeprominterface.h" #include "eeprominterface.h"
namespace Ui { namespace Ui {
class appPreferencesDialog; class AppPreferencesDialog;
} }
class Joystick; class Joystick;
class appPreferencesDialog : public QDialog class AppPreferencesDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit appPreferencesDialog(QWidget *parent = 0); explicit AppPreferencesDialog(QWidget *parent = 0);
~appPreferencesDialog(); ~AppPreferencesDialog();
Joystick *joystick; Joystick *joystick;
private: private:
int initialRadioType; QList<QCheckBox *> optionsCheckBoxes;
Ui::appPreferencesDialog *ui; bool updateLock;
void showVoice(bool);
void showVoice();
void hideVoice();
void populateLocale();
void populateFirmwareOptions(const FirmwareInterface *);
FirmwareVariant getFirmwareVariant();
QCheckBox * voice;
Ui::AppPreferencesDialog *ui;
void initSettings(); void initSettings();
bool displayImage( QString fileName ); bool displayImage( QString fileName );
void loadProfileString(QString profile, QString label); void loadProfileString(QString profile, QString label);
void loadFromProfile(); void loadFromProfile();
private slots: protected slots:
void shrink();
void firmwareLangChanged();
void baseFirmwareChanged();
void firmwareOptionChanged(bool state);
void firmwareChanged();
void writeValues(); void writeValues();
void on_libraryPathButton_clicked(); void on_libraryPathButton_clicked();
void on_snapshotPathButton_clicked(); void on_snapshotPathButton_clicked();
+284 -209
View File
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>appPreferencesDialog</class> <class>AppPreferencesDialog</class>
<widget class="QDialog" name="appPreferencesDialog"> <widget class="QDialog" name="AppPreferencesDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>736</width> <width>685</width>
<height>514</height> <height>818</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@@ -42,7 +42,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="1" column="1">
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
@@ -52,14 +52,120 @@
<string>Radio Profile</string> <string>Radio Profile</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="10" column="1" colspan="5"> <item row="22" column="5">
<widget class="Line" name="line_6"> <widget class="QPushButton" name="sdPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="downloadVerCB">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="26" column="0">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Default Channel Order</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Build Options</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="langLabel">
<property name="text">
<string>Menu Language</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="24" column="0">
<widget class="QLabel" name="label_14">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Default Stick Mode</string>
</property>
</widget>
</item>
<item row="15" column="5">
<widget class="QPushButton" name="SplashSelect">
<property name="text">
<string>Select Image</string>
</property>
</widget>
</item>
<item row="23" column="1">
<widget class="QLabel" name="lblGeneralSettings">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string notr="true">General Settings Label</string>
</property>
</widget>
</item>
<item row="15" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="11" column="0" colspan="6">
<widget class="Line" name="line_7">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="1" colspan="3"> <item row="10" column="1" colspan="5">
<layout class="QGridLayout" name="optionsLayout"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="CPU_ID_LABEL">
<property name="text">
<string>Processor ID</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="CPU_ID_LE"/>
</item>
<item row="24" column="1" colspan="3">
<widget class="QComboBox" name="stickmodeCB"> <widget class="QComboBox" name="stickmodeCB">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@@ -113,7 +219,26 @@ Mode 4:
</item> </item>
</widget> </widget>
</item> </item>
<item row="13" column="1" colspan="3"> <item row="15" column="0">
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Splash Screen</string>
</property>
</widget>
</item>
<item row="26" column="1" colspan="3">
<widget class="QComboBox" name="channelorderCB"> <widget class="QComboBox" name="channelorderCB">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -261,27 +386,20 @@ Mode 4:
</item> </item>
</widget> </widget>
</item> </item>
<item row="11" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_14">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Default Stick Mode</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text"> <property name="text">
<string>Profile Name</string> <string>Profile Name</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="16" column="1"> <item row="29" column="1">
<spacer name="verticalSpacer_3"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@@ -294,101 +412,14 @@ Mode 4:
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="5" column="0"> <item row="28" column="5">
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Splash Screen</string>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Default Channel Order</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="sdPathLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>SD Structure path</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QLineEdit" name="sdPath">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="15" column="5">
<widget class="QPushButton" name="removeProfileButton"> <widget class="QPushButton" name="removeProfileButton">
<property name="text"> <property name="text">
<string>Remove Profile</string> <string>Remove Profile</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="5"> <item row="15" column="1" colspan="2">
<widget class="QPushButton" name="sdPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QLineEdit" name="SplashFileName"> <widget class="QLineEdit" name="SplashFileName">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
@@ -410,35 +441,14 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="5"> <item row="18" column="5">
<widget class="QPushButton" name="SplashSelect">
<property name="text">
<string>Select Image</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Radio Type</string>
</property>
</widget>
</item>
<item row="8" column="5">
<widget class="QPushButton" name="clearImageButton"> <widget class="QPushButton" name="clearImageButton">
<property name="text"> <property name="text">
<string>Clear Image</string> <string>Clear Image</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1" colspan="5"> <item row="1" column="1">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="profileNameLE"> <widget class="QLineEdit" name="profileNameLE">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@@ -454,7 +464,7 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="18" column="1">
<widget class="QLabel" name="imageLabel"> <widget class="QLabel" name="imageLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
@@ -491,73 +501,156 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="27" column="1" colspan="4">
<widget class="QComboBox" name="radioCB">
<item>
<property name="text">
<string>9X</string>
</property>
</item>
<item>
<property name="text">
<string>9X with m128</string>
</property>
</item>
<item>
<property name="text">
<string>9XR</string>
</property>
</item>
<item>
<property name="text">
<string>9XR with m128</string>
</property>
</item>
<item>
<property name="text">
<string>Gruvin9x Board</string>
</property>
</item>
<item>
<property name="text">
<string>Sky9x Board</string>
</property>
</item>
<item>
<property name="text">
<string>Taranis</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>General Settings</string>
</property>
</widget>
</item>
<item row="14" column="1" colspan="4">
<widget class="QCheckBox" name="renameFirmware"> <widget class="QCheckBox" name="renameFirmware">
<property name="text"> <property name="text">
<string>Append version number to FW file name</string> <string>Append version number to FW file name</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="15" column="1" colspan="4"> <item row="28" column="1" colspan="4">
<widget class="QCheckBox" name="burnFirmware"> <widget class="QCheckBox" name="burnFirmware">
<property name="text"> <property name="text">
<string>Offer to write FW to Tx after download</string> <string>Offer to write FW to Tx after download</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="5"> <item row="8" column="1">
<widget class="QLabel" name="lblGeneralSettings"> <widget class="QComboBox" name="langCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Radio Firmware</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="22" column="1">
<widget class="QLineEdit" name="sdPath">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="20" column="0" colspan="6">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0" colspan="6">
<widget class="Line" name="line_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="21" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text"> <property name="text">
<string notr="true">General Settings Label</string> <string>Other Settings</string>
</property>
</widget>
</item>
<item row="23" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>General Settings</string>
</property>
</widget>
</item>
<item row="22" column="0">
<widget class="QLabel" name="sdPathLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>SD Structure path</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QComboBox" name="voiceCombo">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set language of voice.
May be different from firmware language</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="voiceLabel">
<property name="font">
<font>
<family>Sans Serif</family>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Voice Language</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -1006,7 +1099,6 @@ Mode 4:
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>ge_lineedit</tabstop> <tabstop>ge_lineedit</tabstop>
<tabstop>ge_pathButton</tabstop> <tabstop>ge_pathButton</tabstop>
<tabstop>historySize</tabstop> <tabstop>historySize</tabstop>
@@ -1028,7 +1120,6 @@ Mode 4:
<tabstop>joystickCB</tabstop> <tabstop>joystickCB</tabstop>
<tabstop>joystickChkB</tabstop> <tabstop>joystickChkB</tabstop>
<tabstop>joystickcalButton</tabstop> <tabstop>joystickcalButton</tabstop>
<tabstop>sdPath</tabstop>
<tabstop>SplashFileName</tabstop> <tabstop>SplashFileName</tabstop>
<tabstop>stickmodeCB</tabstop> <tabstop>stickmodeCB</tabstop>
<tabstop>channelorderCB</tabstop> <tabstop>channelorderCB</tabstop>
@@ -1042,12 +1133,12 @@ Mode 4:
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>appPreferencesDialog</receiver> <receiver>AppPreferencesDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>382</x> <x>388</x>
<y>455</y> <y>835</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>157</x> <x>157</x>
@@ -1055,21 +1146,5 @@ Mode 4:
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>appPreferencesDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>402</x>
<y>455</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections> </connections>
</ui> </ui>
+1 -1
View File
@@ -327,7 +327,7 @@ void avrOutputDialog::errorWizard()
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease check advanced burn options to set the correct cpu type.").arg(DeviceStr)); QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease check advanced burn options to set the correct cpu type.").arg(DeviceStr));
} }
else { else {
FirmwareInfo *firmware = GetCurrentFirmware(); FirmwareInterface *firmware = GetCurrentFirmware();
QMessageBox::warning(this, "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->name)); QMessageBox::warning(this, "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->name));
} }
} }
+1 -1
View File
@@ -445,7 +445,7 @@ void burnDialog::on_BurnFlashButton_clicked()
if (hexType==EEPROM_FILE_TYPE) { if (hexType==EEPROM_FILE_TYPE) {
QString calib = g.profile[g.id()].stickPotCalib(); QString calib = g.profile[g.id()].stickPotCalib();
QString trainercalib = g.profile[g.id()].trainerCalib(); QString trainercalib = g.profile[g.id()].trainerCalib();
int potsnum=GetEepromInterface()->getCapability(Pots); int potsnum=GetCurrentFirmware()->getCapability(Pots);
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib(); int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib(); int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier(); int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
+3 -1
View File
@@ -104,7 +104,8 @@ int main(int argc, char *argv[])
QPixmap pixmap = QPixmap(g.profile[g.id()].fwType().contains("taranis") ? ":/images/splasht.png" : ":/images/splash.png"); QPixmap pixmap = QPixmap(g.profile[g.id()].fwType().contains("taranis") ? ":/images/splasht.png" : ":/images/splash.png");
QSplashScreen *splash = new QSplashScreen(pixmap); QSplashScreen *splash = new QSplashScreen(pixmap);
RegisterFirmwares(); RegisterEepromInterfaces();
registerOpenTxFirmwares();
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType()); current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
@@ -124,6 +125,7 @@ int main(int argc, char *argv[])
delete mainWin; delete mainWin;
UnregisterFirmwares(); UnregisterFirmwares();
UnregisterEepromInterfaces();
return result; return result;
} }
+104 -105
View File
@@ -24,39 +24,38 @@ public:
uint8_t models[C9X_MAX_MODELS]; uint8_t models[C9X_MAX_MODELS];
}; };
compareDialog::compareDialog(QWidget *parent, GeneralSettings *gg) : CompareDialog::CompareDialog(QWidget * parent):
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::compareDialog) model1(0),
model2(0),
ui(new Ui::CompareDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
this->setWindowIcon(CompanionIcon("compare.png")); this->setWindowIcon(CompanionIcon("compare.png"));
g_eeGeneral = gg;
eepromInterface = GetEepromInterface();
te = ui->textEdit; te = ui->textEdit;
this->setAcceptDrops(true); this->setAcceptDrops(true);
model1=0;
model2=0; // TODO this is really horrible
g_model1=(ModelData *)malloc(sizeof(ModelData)); g_model1=(ModelData *)malloc(sizeof(ModelData));
g_model2=(ModelData *)malloc(sizeof(ModelData)); g_model2=(ModelData *)malloc(sizeof(ModelData));
modeltemp=(ModelData *)malloc(sizeof(ModelData)); modeltemp=(ModelData *)malloc(sizeof(ModelData));
//setDragDropOverwriteMode(true);
//setDropIndicatorShown(true); //setDragDropOverwriteMode(true);
/* //setDropIndicatorShown(true);
printFrSky(); te->scrollToAnchor("1");
*/
te->scrollToAnchor("1");
} }
void compareDialog::dragMoveEvent(QDragMoveEvent *event) void CompareDialog::dragMoveEvent(QDragMoveEvent *event)
{ {
if (event->mimeData()->hasFormat("application/x-companion")) { if (event->mimeData()->hasFormat("application/x-companion")) {
event->acceptProposedAction(); event->acceptProposedAction();
} else { }
else {
event->ignore(); event->ignore();
} }
} }
void compareDialog::dragEnterEvent(QDragEnterEvent *event) void CompareDialog::dragEnterEvent(QDragEnterEvent *event)
{ {
// accept just text/uri-list mime format // accept just text/uri-list mime format
if (event->mimeData()->hasFormat("application/x-companion")) { if (event->mimeData()->hasFormat("application/x-companion")) {
@@ -66,16 +65,16 @@ void compareDialog::dragEnterEvent(QDragEnterEvent *event)
} }
} }
void compareDialog::dragLeaveEvent(QDragLeaveEvent *event) void CompareDialog::dragLeaveEvent(QDragLeaveEvent *event)
{ {
event->accept(); event->accept();
} }
void compareDialog::printDiff() void CompareDialog::printDiff()
{ {
te->clear(); te->clear();
printSetup(); printSetup();
if (GetEepromInterface()->getCapability(FlightPhases)) { if (GetCurrentFirmware()->getCapability(FlightPhases)) {
printPhases(); printPhases();
} }
printExpos(); printExpos();
@@ -89,7 +88,7 @@ void compareDialog::printDiff()
te->scrollToAnchor("1"); te->scrollToAnchor("1");
} }
void compareDialog::dropEvent(QDropEvent *event) void CompareDialog::dropEvent(QDropEvent *event)
{ {
QLabel *child = qobject_cast<QLabel*>(childAt(event->pos())); QLabel *child = qobject_cast<QLabel*>(childAt(event->pos()));
const QMimeData *mimeData = event->mimeData(); const QMimeData *mimeData = event->mimeData();
@@ -153,7 +152,7 @@ void compareDialog::dropEvent(QDropEvent *event)
} }
} }
void compareDialog::closeEvent(QCloseEvent *event) void CompareDialog::closeEvent(QCloseEvent *event)
{ {
QByteArray ba = curvefile5.toLatin1(); QByteArray ba = curvefile5.toLatin1();
char *name = ba.data(); char *name = ba.data();
@@ -163,12 +162,12 @@ void compareDialog::closeEvent(QCloseEvent *event)
unlink(name); unlink(name);
} }
compareDialog::~compareDialog() CompareDialog::~CompareDialog()
{ {
delete ui; delete ui;
} }
QString compareDialog::doTC(const QString s, const QString color="", bool bold=false) QString CompareDialog::doTC(const QString s, const QString color="", bool bold=false)
{ {
QString str = s; QString str = s;
if(bold) str = "<b>" + str + "</b>"; if(bold) str = "<b>" + str + "</b>";
@@ -176,7 +175,7 @@ QString compareDialog::doTC(const QString s, const QString color="", bool bold=f
return "<td align=center>" + str + "</td>"; return "<td align=center>" + str + "</td>";
} }
QString compareDialog::doTR(const QString s, const QString color="", bool bold=false) QString CompareDialog::doTR(const QString s, const QString color="", bool bold=false)
{ {
QString str = s; QString str = s;
if(bold) str = "<b>" + str + "</b>"; if(bold) str = "<b>" + str + "</b>";
@@ -184,7 +183,7 @@ QString compareDialog::doTR(const QString s, const QString color="", bool bold=f
return "<td align=right>" + str + "</td>"; return "<td align=right>" + str + "</td>";
} }
QString compareDialog::doTL(const QString s, const QString color="", bool bold=false) QString CompareDialog::doTL(const QString s, const QString color="", bool bold=false)
{ {
QString str = s; QString str = s;
if(bold) str = "<b>" + str + "</b>"; if(bold) str = "<b>" + str + "</b>";
@@ -192,14 +191,14 @@ QString compareDialog::doTL(const QString s, const QString color="", bool bold=f
return "<td align=left>" + str + "</td>"; return "<td align=left>" + str + "</td>";
} }
QString compareDialog::fv(const QString name, const QString value, const QString color="green") QString CompareDialog::fv(const QString name, const QString value, const QString color="green")
{ {
return "<b>" + name + ": </b><font color=" +color + ">" + value + "</font><br>"; return "<b>" + name + ": </b><font color=" +color + ">" + value + "</font><br>";
} }
int compareDialog::ModelHasExpo(ExpoData * ExpoArray, ExpoData expo, bool * expoused) int CompareDialog::ModelHasExpo(ExpoData * ExpoArray, ExpoData expo, bool * expoused)
{ {
for (int i=0; i< C9X_MAX_EXPOS; i++) { for (int i=0; i< C9X_MAX_EXPOS; i++) {
if ((memcmp(&expo,&ExpoArray[i],sizeof(ExpoData))==0) && (expoused[i]==false)) { if ((memcmp(&expo,&ExpoArray[i],sizeof(ExpoData))==0) && (expoused[i]==false)) {
@@ -209,7 +208,7 @@ int compareDialog::ModelHasExpo(ExpoData * ExpoArray, ExpoData expo, bool * expo
return -1; return -1;
} }
bool compareDialog::ChannelHasExpo(ExpoData * expoArray, uint8_t destCh) bool CompareDialog::ChannelHasExpo(ExpoData * expoArray, uint8_t destCh)
{ {
for (int i=0; i< C9X_MAX_EXPOS; i++) { for (int i=0; i< C9X_MAX_EXPOS; i++) {
if ((expoArray[i].chn==destCh)&&(expoArray[i].mode!=0)) { if ((expoArray[i].chn==destCh)&&(expoArray[i].mode!=0)) {
@@ -219,7 +218,7 @@ bool compareDialog::ChannelHasExpo(ExpoData * expoArray, uint8_t destCh)
return false; return false;
} }
int compareDialog::ModelHasMix(MixData * mixArray, MixData mix, bool * mixused) int CompareDialog::ModelHasMix(MixData * mixArray, MixData mix, bool * mixused)
{ {
for (int i=0; i< C9X_MAX_MIXERS; i++) { for (int i=0; i< C9X_MAX_MIXERS; i++) {
if ((memcmp(&mix,&mixArray[i],sizeof(MixData))==0) && (mixused[i]==false)) { if ((memcmp(&mix,&mixArray[i],sizeof(MixData))==0) && (mixused[i]==false)) {
@@ -229,7 +228,7 @@ int compareDialog::ModelHasMix(MixData * mixArray, MixData mix, bool * mixused)
return -1; return -1;
} }
bool compareDialog::ChannelHasMix(MixData * mixArray, uint8_t destCh) bool CompareDialog::ChannelHasMix(MixData * mixArray, uint8_t destCh)
{ {
for (int i=0; i< C9X_MAX_MIXERS; i++) { for (int i=0; i< C9X_MAX_MIXERS; i++) {
if (mixArray[i].destCh==destCh) { if (mixArray[i].destCh==destCh) {
@@ -239,7 +238,7 @@ bool compareDialog::ChannelHasMix(MixData * mixArray, uint8_t destCh)
return false; return false;
} }
void compareDialog::printSetup() void CompareDialog::printSetup()
{ {
QString color; QString color;
QString str = "<a name=1></a><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">"; QString str = "<a name=1></a><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
@@ -247,8 +246,8 @@ void compareDialog::printSetup()
str.append("<tr><td><table border=0 cellspacing=0 cellpadding=3 width=\"50%\">"); str.append("<tr><td><table border=0 cellspacing=0 cellpadding=3 width=\"50%\">");
color=getColor1(g_model1->name,g_model2->name); color=getColor1(g_model1->name,g_model2->name);
str.append(fv(tr("Name"), g_model1->name, color)); str.append(fv(tr("Name"), g_model1->name, color));
color=getColor1(eepromInterface->getSize(*g_model1),eepromInterface->getSize(*g_model2)); color=getColor1(GetEepromInterface()->getSize(*g_model1), GetEepromInterface()->getSize(*g_model2));
str.append("<b>"+tr("EEprom Size")+QString(": </b><font color=%2>%1</font><br>").arg(eepromInterface->getSize(*g_model1)).arg(color)); str.append("<b>"+tr("EEprom Size")+QString(": </b><font color=%2>%1</font><br>").arg(GetEepromInterface()->getSize(*g_model1)).arg(color));
color=getColor1(getTimerStr(g_model1->timers[0]), getTimerStr(g_model2->timers[0])); color=getColor1(getTimerStr(g_model1->timers[0]), getTimerStr(g_model2->timers[0]));
str.append(fv(tr("Timer1"), getTimerStr(g_model1->timers[0]), color)); //value, mode, count up/down str.append(fv(tr("Timer1"), getTimerStr(g_model1->timers[0]), color)); //value, mode, count up/down
color=getColor1(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1])); color=getColor1(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1]));
@@ -270,8 +269,8 @@ void compareDialog::printSetup()
str.append("<td><table border=0 cellspacing=0 cellpadding=3 width=\"50%\">"); str.append("<td><table border=0 cellspacing=0 cellpadding=3 width=\"50%\">");
color=getColor2(g_model1->name,g_model2->name); color=getColor2(g_model1->name,g_model2->name);
str.append(fv(tr("Name"), g_model2->name, color)); str.append(fv(tr("Name"), g_model2->name, color));
color=getColor2(eepromInterface->getSize(*g_model1),eepromInterface->getSize(*g_model2)); color=getColor2(GetEepromInterface()->getSize(*g_model1), GetEepromInterface()->getSize(*g_model2));
str.append("<b>"+tr("EEprom Size")+QString(": </b><font color=%2>%1</font><br>").arg(eepromInterface->getSize(*g_model2)).arg(color)); str.append("<b>"+tr("EEprom Size")+QString(": </b><font color=%2>%1</font><br>").arg(GetEepromInterface()->getSize(*g_model2)).arg(color));
color=getColor2(getTimerStr(g_model1->timers[0]), getTimerStr(g_model2->timers[0])); color=getColor2(getTimerStr(g_model1->timers[0]), getTimerStr(g_model2->timers[0]));
str.append(fv(tr("Timer1"), getTimerStr(g_model2->timers[0]),color)); //value, mode, count up/down str.append(fv(tr("Timer1"), getTimerStr(g_model2->timers[0]),color)); //value, mode, count up/down
color=getColor2(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1])); color=getColor2(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1]));
@@ -293,7 +292,7 @@ void compareDialog::printSetup()
te->append(str); te->append(str);
} }
void compareDialog::printPhases() void CompareDialog::printPhases()
{ {
QString color; QString color;
int i,k; int i,k;
@@ -308,7 +307,7 @@ void compareDialog::printPhases()
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i))); str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i)));
} }
str.append("</tr>"); str.append("</tr>");
for (i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (i=0; i<GetCurrentFirmware()->getCapability(FlightPhases); i++) {
PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd1=&g_model1->phaseData[i];
PhaseData *pd2=&g_model2->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i];
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i)); str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
@@ -334,7 +333,7 @@ void compareDialog::printPhases()
str.append("</table>"); str.append("</table>");
int gvars=0; int gvars=0;
int gvarnum=0; int gvarnum=0;
if (GetEepromInterface()->getCapability(HasVariants)) { if (GetCurrentFirmware()->getCapability(HasVariants)) {
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) { if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
gvars=1; gvars=1;
} }
@@ -342,35 +341,35 @@ void compareDialog::printPhases()
gvars=1; gvars=1;
} }
if (gvars==1) { if (gvars==1) {
gvarnum=GetEepromInterface()->getCapability(Gvars); gvarnum=GetCurrentFirmware()->getCapability(Gvars);
} }
if ((gvars==1 && GetEepromInterface()->getCapability(GvarsFlightPhases)) || GetEepromInterface()->getCapability(RotaryEncoders)) { if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightPhases)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
str.append("<br><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">"); str.append("<br><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
str.append("<tr><td style=\"border-style:none;\">&nbsp;</td>"); str.append("<tr><td style=\"border-style:none;\">&nbsp;</td>");
if (GetEepromInterface()->getCapability(GvarsFlightPhases)) { if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) {
str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</td>"); str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</td>");
} }
if (GetEepromInterface()->getCapability(RotaryEncoders)) { if (GetCurrentFirmware()->getCapability(RotaryEncoders)) {
str.append(QString("<td colspan=%1 align=center><b>").arg(GetEepromInterface()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"</td>"); str.append(QString("<td colspan=%1 align=center><b>").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"</td>");
} }
str.append("</tr><tr><td align=center><b>"+tr("Flight mode name")+"</b></td>"); str.append("</tr><tr><td align=center><b>"+tr("Flight mode name")+"</b></td>");
if (GetEepromInterface()->getCapability(GvarsFlightPhases)) { if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) {
for (i=0; i<gvarnum; i++) { for (i=0; i<gvarnum; i++) {
str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model1->gvars_names[i])); str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model1->gvars_names[i]));
} }
} }
for (i=0; i<GetEepromInterface()->getCapability(RotaryEncoders); i++) { for (i=0; i<GetCurrentFirmware()->getCapability(RotaryEncoders); i++) {
str.append(QString("<td align=\"center\"><b>RE%1</b></td>").arg((i==0 ? 'A': 'B'))); str.append(QString("<td align=\"center\"><b>RE%1</b></td>").arg((i==0 ? 'A': 'B')));
} }
str.append("</tr>"); str.append("</tr>");
for (i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (i=0; i<GetCurrentFirmware()->getCapability(FlightPhases); i++) {
PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd1=&g_model1->phaseData[i];
PhaseData *pd2=&g_model2->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i];
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i)); str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
color=getColor1(pd1->name,pd2->name); color=getColor1(pd1->name,pd2->name);
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd1->name).arg(color)); str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd1->name).arg(color));
if (GetEepromInterface()->getCapability(GvarsFlightPhases)) { if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) {
for (k=0; k<gvarnum; k++) { for (k=0; k<gvarnum; k++) {
color=getColor1(pd1->gvars[k],pd2->gvars[k]); color=getColor1(pd1->gvars[k],pd2->gvars[k]);
if (pd1->gvars[k]<=1024) { if (pd1->gvars[k]<=1024) {
@@ -383,7 +382,7 @@ void compareDialog::printPhases()
} }
} }
} }
for (k=0; k<GetEepromInterface()->getCapability(RotaryEncoders); k++) { for (k=0; k<GetCurrentFirmware()->getCapability(RotaryEncoders); k++) {
color=getColor1(pd1->rotaryEncoders[k],pd2->rotaryEncoders[k]); color=getColor1(pd1->rotaryEncoders[k],pd2->rotaryEncoders[k]);
if (pd1->rotaryEncoders[k]<=1024) { if (pd1->rotaryEncoders[k]<=1024) {
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=%2>%1").arg(pd1->rotaryEncoders[k]).arg(color)+"</font></td>"); str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=%2>%1").arg(pd1->rotaryEncoders[k]).arg(color)+"</font></td>");
@@ -409,7 +408,7 @@ void compareDialog::printPhases()
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i))); str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i)));
} }
str.append("</tr>"); str.append("</tr>");
for (i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (i=0; i<GetCurrentFirmware()->getCapability(FlightPhases); i++) {
PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd1=&g_model1->phaseData[i];
PhaseData *pd2=&g_model2->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i];
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i)); str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
@@ -434,32 +433,32 @@ void compareDialog::printPhases()
} }
str.append("</table>"); str.append("</table>");
if ((gvars==1 && GetEepromInterface()->getCapability(GvarsFlightPhases)) || GetEepromInterface()->getCapability(RotaryEncoders)) { if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightPhases)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
str.append("<br><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">"); str.append("<br><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
str.append("<tr><td style=\"border-style:none;\">&nbsp;</td>"); str.append("<tr><td style=\"border-style:none;\">&nbsp;</td>");
if (GetEepromInterface()->getCapability(GvarsFlightPhases)) { if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) {
str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</td>"); str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</td>");
} }
if (GetEepromInterface()->getCapability(RotaryEncoders)) { if (GetCurrentFirmware()->getCapability(RotaryEncoders)) {
str.append(QString("<td colspan=%1 align=center><b>").arg(GetEepromInterface()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"</td>"); str.append(QString("<td colspan=%1 align=center><b>").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"</td>");
} }
str.append("</tr><tr><td align=center ><b>"+tr("Flight mode name")+"</b></td>"); str.append("</tr><tr><td align=center ><b>"+tr("Flight mode name")+"</b></td>");
if (GetEepromInterface()->getCapability(GvarsFlightPhases)) { if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) {
for (i=0; i<gvarnum; i++) { for (i=0; i<gvarnum; i++) {
str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model2->gvars_names[i])); str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model2->gvars_names[i]));
} }
} }
for (i=0; i<GetEepromInterface()->getCapability(RotaryEncoders); i++) { for (i=0; i<GetCurrentFirmware()->getCapability(RotaryEncoders); i++) {
str.append(QString("<td align=\"center\"><b>RE%1</b></td>").arg((i==0 ? 'A': 'B'))); str.append(QString("<td align=\"center\"><b>RE%1</b></td>").arg((i==0 ? 'A': 'B')));
} }
str.append("</tr>"); str.append("</tr>");
for (i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (i=0; i<GetCurrentFirmware()->getCapability(FlightPhases); i++) {
PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd1=&g_model1->phaseData[i];
PhaseData *pd2=&g_model2->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i];
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i)); str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
color=getColor1(pd1->name,pd2->name); color=getColor1(pd1->name,pd2->name);
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd2->name).arg(color)); str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd2->name).arg(color));
if (GetEepromInterface()->getCapability(GvarsFlightPhases)) { if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) {
for (k=0; k<gvarnum; k++) { for (k=0; k<gvarnum; k++) {
color=getColor1(pd1->gvars[k],pd2->gvars[k]); color=getColor1(pd1->gvars[k],pd2->gvars[k]);
if (pd2->gvars[k]<=1024) { if (pd2->gvars[k]<=1024) {
@@ -472,7 +471,7 @@ void compareDialog::printPhases()
} }
} }
} }
for (k=0; k<GetEepromInterface()->getCapability(RotaryEncoders); k++) { for (k=0; k<GetCurrentFirmware()->getCapability(RotaryEncoders); k++) {
color=getColor1(pd1->rotaryEncoders[k],pd2->rotaryEncoders[k]); color=getColor1(pd1->rotaryEncoders[k],pd2->rotaryEncoders[k]);
if (pd2->rotaryEncoders[k]<=1024) { if (pd2->rotaryEncoders[k]<=1024) {
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=%2>%1").arg(pd2->rotaryEncoders[k]).arg(color)+"</font></td>"); str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=%2>%1").arg(pd2->rotaryEncoders[k]).arg(color)+"</font></td>");
@@ -491,20 +490,20 @@ void compareDialog::printPhases()
te->append(str); te->append(str);
} }
void compareDialog::printLimits() void CompareDialog::printLimits()
{ {
QString color; QString color;
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\">"; QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\">";
str.append("<tr><td colspan=2><h2>"+tr("Limits")+"</h2></td></tr>"); str.append("<tr><td colspan=2><h2>"+tr("Limits")+"</h2></td></tr>");
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"50%\">"); str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"50%\">");
if (GetEepromInterface()->getCapability(HasChNames)) { if (GetCurrentFirmware()->getCapability(HasChNames)) {
str.append("<tr><td>"+tr("Name")+"</td><td align=center><b>"+tr("Offset")+"</b></td><td align=center><b>"+tr("Min")+"</b></td><td align=center><b>"+tr("Max")+"</b></td><td align=center><b>"+tr("Invert")+"</b></td></tr>"); str.append("<tr><td>"+tr("Name")+"</td><td align=center><b>"+tr("Offset")+"</b></td><td align=center><b>"+tr("Min")+"</b></td><td align=center><b>"+tr("Max")+"</b></td><td align=center><b>"+tr("Invert")+"</b></td></tr>");
} else { } else {
str.append("<tr><td></td><td align=center><b>"+tr("Offset")+"</b></td><td align=center><b>"+tr("Min")+"</b></td><td align=center><b>"+tr("Max")+"</b></td><td align=center><b>"+tr("Invert")+"</b></td></tr>"); str.append("<tr><td></td><td align=center><b>"+tr("Offset")+"</b></td><td align=center><b>"+tr("Min")+"</b></td><td align=center><b>"+tr("Max")+"</b></td><td align=center><b>"+tr("Invert")+"</b></td></tr>");
} }
for(int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=0; i<GetCurrentFirmware()->getCapability(Outputs); i++) {
str.append("<tr>"); str.append("<tr>");
if (GetEepromInterface()->getCapability(HasChNames)) { if (GetCurrentFirmware()->getCapability(HasChNames)) {
QString name1=g_model1->limitData[i].name; QString name1=g_model1->limitData[i].name;
QString name2=g_model2->limitData[i].name; QString name2=g_model2->limitData[i].name;
color=getColor1(name1,name2); color=getColor1(name1,name2);
@@ -529,9 +528,9 @@ void compareDialog::printLimits()
str.append("</table></td>"); str.append("</table></td>");
str.append("<td><table border=1 cellspacing=0 cellpadding=1 width=\"50%\">"); str.append("<td><table border=1 cellspacing=0 cellpadding=1 width=\"50%\">");
str.append("<tr><td></td><td align=center><b>"+tr("Offset")+"</b></td><td align=center><b>"+tr("Min")+"</b></td><td align=center><b>"+tr("Max")+"</b></td><td align=center><b>"+tr("Invert")+"</b></td></tr>"); str.append("<tr><td></td><td align=center><b>"+tr("Offset")+"</b></td><td align=center><b>"+tr("Min")+"</b></td><td align=center><b>"+tr("Max")+"</b></td><td align=center><b>"+tr("Invert")+"</b></td></tr>");
for(int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=0; i<GetCurrentFirmware()->getCapability(Outputs); i++) {
str.append("<tr>"); str.append("<tr>");
if (GetEepromInterface()->getCapability(HasChNames)) { if (GetCurrentFirmware()->getCapability(HasChNames)) {
QString name1=g_model1->limitData[i].name; QString name1=g_model1->limitData[i].name;
QString name2=g_model2->limitData[i].name; QString name2=g_model2->limitData[i].name;
color=getColor2(name1,name2); color=getColor2(name1,name2);
@@ -557,17 +556,17 @@ void compareDialog::printLimits()
te->append(str); te->append(str);
} }
void compareDialog::printGvars() void CompareDialog::printGvars()
{ {
QString color; QString color;
int gvars=0; int gvars=0;
int gvarnum=0; int gvarnum=0;
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!GetEepromInterface()->getCapability(HasVariants) && GetEepromInterface()->getCapability(Gvars))) { if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!GetCurrentFirmware()->getCapability(HasVariants) && GetCurrentFirmware()->getCapability(Gvars))) {
gvars=1; gvars=1;
gvarnum=GetEepromInterface()->getCapability(Gvars); gvarnum=GetCurrentFirmware()->getCapability(Gvars);
} }
if (!GetEepromInterface()->getCapability(GvarsFlightPhases) && (gvars==1 && GetEepromInterface()->getCapability(Gvars))) { if (!GetCurrentFirmware()->getCapability(GvarsFlightPhases) && (gvars==1 && GetCurrentFirmware()->getCapability(Gvars))) {
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">"; QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
str.append("<tr><td colspan=2><h2>"+tr("Global Variables")+"</h2></td></tr>"); str.append("<tr><td colspan=2><h2>"+tr("Global Variables")+"</h2></td></tr>");
str.append("<tr><td width=50%>"); str.append("<tr><td width=50%>");
@@ -605,7 +604,7 @@ void compareDialog::printGvars()
} }
} }
void compareDialog::printExpos() void CompareDialog::printExpos()
{ {
QString color; QString color;
bool expoused[C9X_MAX_EXPOS]={false}; bool expoused[C9X_MAX_EXPOS]={false};
@@ -614,7 +613,7 @@ void compareDialog::printExpos()
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>"; QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>";
str.append(tr("Expo/Dr Settings")); str.append(tr("Expo/Dr Settings"));
str.append("</h2></td></tr><tr><td><table border=1 cellspacing=0 cellpadding=3>"); str.append("</h2></td></tr><tr><td><table border=1 cellspacing=0 cellpadding=3>");
for(uint8_t i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for(uint8_t i=0; i<GetCurrentFirmware()->getCapability(Outputs); i++) {
if (ChannelHasExpo(g_model1->expoData, i) || ChannelHasExpo(g_model2->expoData, i)) { if (ChannelHasExpo(g_model1->expoData, i) || ChannelHasExpo(g_model2->expoData, i)) {
str.append("<tr>"); str.append("<tr>");
str.append("<td width=\"45%\">"); str.append("<td width=\"45%\">");
@@ -651,12 +650,12 @@ void compareDialog::printExpos()
str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' '); str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' ');
str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;"); str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
if (GetEepromInterface()->getCapability(FlightPhases)) { if (GetCurrentFirmware()->getCapability(FlightPhases)) {
if(ed->phases) { if(ed->phases) {
if (ed->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) { if (ed->phases!=(unsigned int)(1<<GetCurrentFirmware()->getCapability(FlightPhases))-1) {
int mask=1; int mask=1;
int first=0; int first=0;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases);i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(FlightPhases);i++) {
if (!(ed->phases & mask)) { if (!(ed->phases & mask)) {
first++; first++;
} }
@@ -669,7 +668,7 @@ void compareDialog::printExpos()
} }
mask=1; mask=1;
first=1; first=1;
for (int j=0; j<GetEepromInterface()->getCapability(FlightPhases);j++) { for (int j=0; j<GetCurrentFirmware()->getCapability(FlightPhases);j++) {
if (!(ed->phases & mask)) { if (!(ed->phases & mask)) {
PhaseData *pd = &g_model1->phaseData[j]; PhaseData *pd = &g_model1->phaseData[j];
if (!first) { if (!first) {
@@ -729,12 +728,12 @@ void compareDialog::printExpos()
str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' '); str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' ');
str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;"); str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
if (GetEepromInterface()->getCapability(FlightPhases)) { if (GetCurrentFirmware()->getCapability(FlightPhases)) {
if(ed->phases) { if(ed->phases) {
if (ed->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) { if (ed->phases!=(unsigned int)(1<<GetCurrentFirmware()->getCapability(FlightPhases))-1) {
int mask=1; int mask=1;
int first=0; int first=0;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases);i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(FlightPhases);i++) {
if (!(ed->phases & mask)) { if (!(ed->phases & mask)) {
first++; first++;
} }
@@ -747,7 +746,7 @@ void compareDialog::printExpos()
} }
mask=1; mask=1;
first=1; first=1;
for (int j=0; j<GetEepromInterface()->getCapability(FlightPhases);j++) { for (int j=0; j<GetCurrentFirmware()->getCapability(FlightPhases);j++) {
if (!(ed->phases & mask)) { if (!(ed->phases & mask)) {
PhaseData *pd = &g_model2->phaseData[j]; PhaseData *pd = &g_model2->phaseData[j];
if (!first) { if (!first) {
@@ -778,21 +777,21 @@ void compareDialog::printExpos()
te->append(str); te->append(str);
} }
void compareDialog::printMixers() void CompareDialog::printMixers()
{ {
QString color; QString color;
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>"; QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>";
str.append(tr("Mixers")); str.append(tr("Mixers"));
str.append("</h2></td></tr><tr><td><table border=1 cellspacing=0 cellpadding=3>"); str.append("</h2></td></tr><tr><td><table border=1 cellspacing=0 cellpadding=3>");
float scale=GetEepromInterface()->getCapability(SlowScale); float scale=GetCurrentFirmware()->getCapability(SlowScale);
bool mixused[64]={false}; bool mixused[64]={false};
bool mixused2[64]={false}; bool mixused2[64]={false};
for(uint8_t i=1; i<=GetEepromInterface()->getCapability(Outputs); i++) { for(uint8_t i=1; i<=GetCurrentFirmware()->getCapability(Outputs); i++) {
if (ChannelHasMix(g_model1->mixData, i) || ChannelHasMix(g_model2->mixData, i)) { if (ChannelHasMix(g_model1->mixData, i) || ChannelHasMix(g_model2->mixData, i)) {
str.append("<tr>"); str.append("<tr>");
str.append("<td width=\"45%\">"); str.append("<td width=\"45%\">");
str.append("<table border=0 cellspacing=0 cellpadding=0>"); str.append("<table border=0 cellspacing=0 cellpadding=0>");
for (int j=0; j<GetEepromInterface()->getCapability(Mixes); j++) { for (int j=0; j<GetCurrentFirmware()->getCapability(Mixes); j++) {
if (g_model1->mixData[j].destCh==i) { if (g_model1->mixData[j].destCh==i) {
int mix=ModelHasMix(g_model2->mixData, g_model1->mixData[j], mixused); int mix=ModelHasMix(g_model2->mixData, g_model1->mixData[j], mixused);
if (mix>-1) { if (mix>-1) {
@@ -827,12 +826,12 @@ void compareDialog::printMixers()
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale); if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale); if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn); if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
if (GetEepromInterface()->getCapability(FlightPhases)) { if (GetCurrentFirmware()->getCapability(FlightPhases)) {
if(md->phases) { if(md->phases) {
if (md->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) { if (md->phases!=(unsigned int)(1<<GetCurrentFirmware()->getCapability(FlightPhases))-1) {
int mask=1; int mask=1;
int first=0; int first=0;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases);i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(FlightPhases);i++) {
if (!(md->phases & mask)) { if (!(md->phases & mask)) {
first++; first++;
} }
@@ -845,7 +844,7 @@ void compareDialog::printMixers()
} }
mask=1; mask=1;
first=1; first=1;
for (int j=0; j<GetEepromInterface()->getCapability(FlightPhases);j++) { for (int j=0; j<GetCurrentFirmware()->getCapability(FlightPhases);j++) {
if (!(md->phases & mask)) { if (!(md->phases & mask)) {
PhaseData *pd = &g_model1->phaseData[j]; PhaseData *pd = &g_model1->phaseData[j];
if (!first) { if (!first) {
@@ -870,7 +869,7 @@ void compareDialog::printMixers()
str.append("<td width=\"10%\" align=\"center\" valign=\"middle\"><b>"+tr("CH")+QString("%1</b></td>").arg(i,2,10,QChar('0'))); str.append("<td width=\"10%\" align=\"center\" valign=\"middle\"><b>"+tr("CH")+QString("%1</b></td>").arg(i,2,10,QChar('0')));
str.append("<td width=\"45%\">"); str.append("<td width=\"45%\">");
str.append("<table border=0 cellspacing=0 cellpadding=0>"); str.append("<table border=0 cellspacing=0 cellpadding=0>");
for (int j=0; j<GetEepromInterface()->getCapability(Mixes); j++) { for (int j=0; j<GetCurrentFirmware()->getCapability(Mixes); j++) {
if (g_model2->mixData[j].destCh==i) { if (g_model2->mixData[j].destCh==i) {
int mix=ModelHasMix(g_model1->mixData, g_model2->mixData[j],mixused2); int mix=ModelHasMix(g_model1->mixData, g_model2->mixData[j],mixused2);
if (mix>-1) { if (mix>-1) {
@@ -906,12 +905,12 @@ void compareDialog::printMixers()
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale); if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale); if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn); if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
if (GetEepromInterface()->getCapability(FlightPhases)) { if (GetCurrentFirmware()->getCapability(FlightPhases)) {
if(md->phases) { if(md->phases) {
if (md->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) { if (md->phases!=(unsigned int)(1<<GetCurrentFirmware()->getCapability(FlightPhases))-1) {
int mask=1; int mask=1;
int first=0; int first=0;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases);i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(FlightPhases);i++) {
if (!(md->phases & mask)) { if (!(md->phases & mask)) {
first++; first++;
} }
@@ -924,7 +923,7 @@ void compareDialog::printMixers()
} }
mask=1; mask=1;
first=1; first=1;
for (int j=0; j<GetEepromInterface()->getCapability(FlightPhases);j++) { for (int j=0; j<GetCurrentFirmware()->getCapability(FlightPhases);j++) {
if (!(md->phases & mask)) { if (!(md->phases & mask)) {
PhaseData *pd = &g_model2->phaseData[j]; PhaseData *pd = &g_model2->phaseData[j];
if (!first) { if (!first) {
@@ -953,7 +952,7 @@ void compareDialog::printMixers()
te->append(str); te->append(str);
} }
void compareDialog::printCurves() void CompareDialog::printCurves()
{ {
#if 0 #if 0
int i,r,g,b,c; int i,r,g,b,c;
@@ -1033,14 +1032,14 @@ void compareDialog::printCurves()
#endif #endif
} }
void compareDialog::printSwitches() void CompareDialog::printSwitches()
{ {
int sc=0; int sc=0;
QString color; QString color;
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">"; QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>"); str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>");
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">"); str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
QString sw1 = g_model1->customSw[i].toString(*g_model1); QString sw1 = g_model1->customSw[i].toString(*g_model1);
QString sw2 = g_model2->customSw[i].toString(*g_model2); QString sw2 = g_model2->customSw[i].toString(*g_model2);
if (!(sw1.isEmpty() && sw2.isEmpty())) { if (!(sw1.isEmpty() && sw2.isEmpty())) {
@@ -1063,7 +1062,7 @@ void compareDialog::printSwitches()
te->append(str); te->append(str);
} }
void compareDialog::printFSwitches() void CompareDialog::printFSwitches()
{ {
QString color1; QString color1;
QString color2; QString color2;
@@ -1083,7 +1082,7 @@ void compareDialog::printFSwitches()
str.append("<td width=\"7%\" align=\"center\"><b>"+tr("Repeat")+"</b></td>"); str.append("<td width=\"7%\" align=\"center\"><b>"+tr("Repeat")+"</b></td>");
str.append("<td width=\"7%\" align=\"center\"><b>"+tr("Enable")+"</b></td>"); str.append("<td width=\"7%\" align=\"center\"><b>"+tr("Enable")+"</b></td>");
str.append("</tr>"); str.append("</tr>");
for(int i=0; i<GetEepromInterface()->getCapability(CustomFunctions); i++) for(int i=0; i<GetCurrentFirmware()->getCapability(CustomFunctions); i++)
{ {
if (g_model1->funcSw[i].swtch.type || g_model2->funcSw[i].swtch.type) { if (g_model1->funcSw[i].swtch.type || g_model2->funcSw[i].swtch.type) {
if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param)) { if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param)) {
@@ -1142,7 +1141,7 @@ void compareDialog::printFSwitches()
te->append(str); te->append(str);
} }
void compareDialog::printFrSky() void CompareDialog::printFrSky()
{ {
QString color; QString color;
float value1,value2; float value1,value2;
@@ -1212,10 +1211,10 @@ void compareDialog::printFrSky()
str.append("<td align=\"center\"><font color="+color+">"+QString::number(fd1->rssiAlarms[1].value,10)+"</td>"); str.append("<td align=\"center\"><font color="+color+">"+QString::number(fd1->rssiAlarms[1].value,10)+"</td>");
str.append("</table>"); str.append("</table>");
#if 0 #if 0
if (GetEepromInterface()->getCapability(TelemetryBars) || GetEepromInterface()->getCapability(TelemetryCSFields)) { if (GetCurrentFirmware()->getCapability(TelemetryBars) || GetCurrentFirmware()->getCapability(TelemetryCSFields)) {
int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields); int cols=GetCurrentFirmware()->getCapability(TelemetryColsCSFields);
if (cols==0) cols=2; if (cols==0) cols=2;
for (int j=0; j<GetEepromInterface()->getCapability(TelemetryCSFields)/(4*cols); j++) { for (int j=0; j<GetCurrentFirmware()->getCapability(TelemetryCSFields)/(4*cols); j++) {
QString tcols; QString tcols;
QString cwidth; QString cwidth;
QString swidth; QString swidth;
@@ -1331,10 +1330,10 @@ void compareDialog::printFrSky()
str.append("<td align=\"center\"><font color="+color+">"+QString::number(fd2->rssiAlarms[1].value,10)+"</td>"); str.append("<td align=\"center\"><font color="+color+">"+QString::number(fd2->rssiAlarms[1].value,10)+"</td>");
str.append("</table></br>"); str.append("</table></br>");
#if 0 #if 0
if (GetEepromInterface()->getCapability(TelemetryBars) || GetEepromInterface()->getCapability(TelemetryCSFields)) { if (GetCurrentFirmware()->getCapability(TelemetryBars) || GetCurrentFirmware()->getCapability(TelemetryCSFields)) {
int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields); int cols=GetCurrentFirmware()->getCapability(TelemetryColsCSFields);
if (cols==0) cols=2; if (cols==0) cols=2;
for (int j=0; j<GetEepromInterface()->getCapability(TelemetryCSFields)/(4*cols); j++) { for (int j=0; j<GetCurrentFirmware()->getCapability(TelemetryCSFields)/(4*cols); j++) {
QString tcols; QString tcols;
QString cwidth; QString cwidth;
QString swidth; QString swidth;
@@ -1391,7 +1390,7 @@ void compareDialog::printFrSky()
te->append(str); te->append(str);
} }
void compareDialog::on_printButton_clicked() void CompareDialog::on_printButton_clicked()
{ {
QPrinter printer; QPrinter printer;
printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter);
@@ -1402,7 +1401,7 @@ void compareDialog::on_printButton_clicked()
te->print(&printer); te->print(&printer);
} }
void compareDialog::on_printFileButton_clicked() void CompareDialog::on_printFileButton_clicked()
{ {
QPrinter printer; QPrinter printer;
QString filename = QFileDialog::getSaveFileName(this,tr("Select PDF output file"),QString(),"Pdf File(*.pdf)"); QString filename = QFileDialog::getSaveFileName(this,tr("Select PDF output file"),QString(),"Pdf File(*.pdf)");
+9 -11
View File
@@ -7,29 +7,27 @@
#include "eeprominterface.h" #include "eeprominterface.h"
namespace Ui { namespace Ui {
class compareDialog; class CompareDialog;
} }
class compareDialog : public QDialog class CompareDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit compareDialog(QWidget *parent = 0, GeneralSettings *gg = 0); CompareDialog(QWidget *parent);
~CompareDialog();
~compareDialog();
void closeEvent(QCloseEvent *event);
protected:
ModelData * g_model1; ModelData * g_model1;
ModelData * g_model2; ModelData * g_model2;
ModelData * modeltemp; ModelData * modeltemp;
int model1; int model1;
int model2; int model2;
GeneralSettings *g_eeGeneral;
EEPROMInterface *eepromInterface;
private: private:
Ui::compareDialog *ui; void closeEvent(QCloseEvent *event);
Ui::CompareDialog *ui;
QString doTC(const QString s, const QString color, bool bold); QString doTC(const QString s, const QString color, bool bold);
QString doTR(const QString s, const QString color, bool bold); QString doTR(const QString s, const QString color, bool bold);
QString doTL(const QString s, const QString color, bool bold); QString doTL(const QString s, const QString color, bool bold);
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>compareDialog</class> <class>CompareDialog</class>
<widget class="QDialog" name="compareDialog"> <widget class="QDialog" name="CompareDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
+21 -29
View File
@@ -592,7 +592,7 @@ QString LogicalSwitchData::toString(const ModelData & model)
result += RawSwitch(andsw).toString(); result += RawSwitch(andsw).toString();
} }
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) { if (GetCurrentFirmware()->getCapability(LogicalSwitchesExt)) {
if (delay) if (delay)
result += QObject::tr(" Delay %1 sec").arg(delay/10.0); result += QObject::tr(" Delay %1 sec").arg(delay/10.0);
if (duration) if (duration)
@@ -644,7 +644,7 @@ QStringList FuncSwData::toStringList()
result << item.toString(); result << item.toString();
} }
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) { else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
if ( GetEepromInterface()->getCapability(VoicesAsNumbers)) { if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
result << QString("%1").arg(param); result << QString("%1").arg(param);
} else { } else {
result << paramarm; result << paramarm;
@@ -774,7 +774,7 @@ QString FuncSwData::paramToString()
return item.toString(); return item.toString();
} }
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) { else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
if ( GetEepromInterface()->getCapability(VoicesAsNumbers)) { if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
return QString("%1").arg(param); return QString("%1").arg(param);
} else { } else {
return paramarm; return paramarm;
@@ -839,7 +839,7 @@ GeneralSettings::GeneralSettings()
stickMode = g.profile[g.id()].defaultMode(); stickMode = g.profile[g.id()].defaultMode();
QString t_calib=g.profile[g.id()].stickPotCalib(); QString t_calib=g.profile[g.id()].stickPotCalib();
int potsnum=GetEepromInterface()->getCapability(Pots); int potsnum=GetCurrentFirmware()->getCapability(Pots);
if (t_calib.isEmpty()) { if (t_calib.isEmpty()) {
return; return;
} }
@@ -1186,13 +1186,13 @@ ModelData ModelData::removeGlobalVars()
QList<EEPROMInterface *> eepromInterfaces; QList<EEPROMInterface *> eepromInterfaces;
void RegisterEepromInterfaces() void RegisterEepromInterfaces()
{ {
eepromInterfaces.push_back(new OpenTxInterface(BOARD_STOCK)); eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_STOCK));
eepromInterfaces.push_back(new OpenTxInterface(BOARD_M128)); eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_M128));
eepromInterfaces.push_back(new OpenTxInterface(BOARD_GRUVIN9X)); eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_GRUVIN9X));
eepromInterfaces.push_back(new OpenTxInterface(BOARD_SKY9X)); eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_SKY9X));
eepromInterfaces.push_back(new OpenTxInterface(BOARD_TARANIS)); eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS));
if (g.rev4aSupport()) if (g.rev4aSupport())
eepromInterfaces.push_back(new OpenTxInterface(BOARD_TARANIS_REV4a)); eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_REV4a));
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK)); eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK));
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X)); eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X));
eepromInterfaces.push_back(new Ersky9xInterface()); eepromInterfaces.push_back(new Ersky9xInterface());
@@ -1203,31 +1203,23 @@ void RegisterEepromInterfaces()
void UnregisterEepromInterfaces() void UnregisterEepromInterfaces()
{ {
foreach(EEPROMInterface * intf, eepromInterfaces) { foreach(EEPROMInterface * intf, eepromInterfaces) {
qDebug() << "UnregisterEepromInterfaces(): deleting " << QString::number( reinterpret_cast<uint64_t>(intf), 16 ); // qDebug() << "UnregisterEepromInterfaces(): deleting " << QString::number( reinterpret_cast<uint64_t>(intf), 16 );
delete intf; delete intf;
} }
OpenTxEepromCleanup(); OpenTxEepromCleanup();
} }
QList<FirmwareInfo *> firmwares; QList<FirmwareInterface *> firmwares;
FirmwareVariant default_firmware_variant; FirmwareVariant default_firmware_variant;
FirmwareVariant current_firmware_variant; FirmwareVariant current_firmware_variant;
void RegisterFirmwares()
{
RegisterOpen9xFirmwares();
default_firmware_variant = GetFirmwareVariant("opentx-9x-heli-templates-en");
current_firmware_variant = default_firmware_variant;
RegisterEepromInterfaces();
}
void UnregisterFirmwares() void UnregisterFirmwares()
{ {
UnregisterEepromInterfaces(); foreach (FirmwareInterface * f, firmwares) {
UnregisterOpen9xFirmwares(); delete f;
}
} }
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size) bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size)
{ {
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) { foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
@@ -1264,7 +1256,7 @@ FirmwareVariant GetFirmwareVariant(QString id)
{ {
FirmwareVariant result; FirmwareVariant result;
foreach(FirmwareInfo * firmware, firmwares) { foreach(FirmwareInterface * firmware, firmwares) {
if (id.contains(firmware->id+"-") || (!id.contains("-") && id.contains(firmware->id))) { if (id.contains(firmware->id+"-") || (!id.contains("-") && id.contains(firmware->id))) {
result.id = id; result.id = id;
result.firmware = firmware; result.firmware = firmware;
@@ -1276,13 +1268,13 @@ FirmwareVariant GetFirmwareVariant(QString id)
return default_firmware_variant; return default_firmware_variant;
} }
void FirmwareInfo::addOption(const char *option, QString tooltip, uint32_t variant) void FirmwareInterface::addOption(const char *option, QString tooltip, uint32_t variant)
{ {
Option options[] = { { option, tooltip, variant }, { NULL } }; Option options[] = { { option, tooltip, variant }, { NULL } };
addOptions(options); addOptions(options);
} }
unsigned int FirmwareInfo::getVariant(const QString & variantId) unsigned int FirmwareInterface::getVariant(const QString & variantId)
{ {
unsigned int variant = variantBase; unsigned int variant = variantBase;
QStringList options = variantId.mid(id.length()+1).split("-", QString::SkipEmptyParts); QStringList options = variantId.mid(id.length()+1).split("-", QString::SkipEmptyParts);
@@ -1298,17 +1290,17 @@ unsigned int FirmwareInfo::getVariant(const QString & variantId)
return variant; return variant;
} }
void FirmwareInfo::addLanguage(const char *lang) void FirmwareInterface::addLanguage(const char *lang)
{ {
languages.push_back(lang); languages.push_back(lang);
} }
void FirmwareInfo::addTTSLanguage(const char *lang) void FirmwareInterface::addTTSLanguage(const char *lang)
{ {
ttslanguages.push_back(lang); ttslanguages.push_back(lang);
} }
void FirmwareInfo::addOptions(Option options[]) void FirmwareInterface::addOptions(Option options[])
{ {
QList<Option> opts; QList<Option> opts;
for (int i=0; options[i].name; i++) { for (int i=0; options[i].name; i++) {
+75 -65
View File
@@ -504,6 +504,7 @@ class GeneralSettings {
unsigned int switchUnlockStates; unsigned int switchUnlockStates;
unsigned int hw_uartMode; unsigned int hw_uartMode;
unsigned int potsType[8]; unsigned int potsType[8];
unsigned int backlightColor;
}; };
class CurveReference { class CurveReference {
@@ -1129,12 +1130,8 @@ class EEPROMInterface
virtual int getSize(GeneralSettings &) = 0; virtual int getSize(GeneralSettings &) = 0;
virtual int getCapability(const Capability) = 0;
virtual int isAvailable(Protocol proto, int port=0) = 0; virtual int isAvailable(Protocol proto, int port=0) = 0;
virtual SimulatorInterface * getSimulator() { return NULL; }
virtual const int getEEpromSize() = 0; virtual const int getEEpromSize() = 0;
virtual const int getMaxModels() = 0; virtual const int getMaxModels() = 0;
@@ -1243,8 +1240,9 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
model.swashRingData.collectiveSource.index = applyStickMode(model.swashRingData.collectiveSource.index + 1, mode) - 1; model.swashRingData.collectiveSource.index = applyStickMode(model.swashRingData.collectiveSource.index + 1, mode) - 1;
} }
void RegisterFirmwares(); void RegisterEepromInterfaces();
void UnregisterFirmwares(); void UnregisterFirmwares();
void registerOpenTxFirmwares();
bool LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index); bool LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size); bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size);
@@ -1256,50 +1254,27 @@ struct Option {
uint32_t variant; uint32_t variant;
}; };
class FirmwareInfo { class FirmwareInterface {
public:
FirmwareInfo():
parent(NULL),
id(QString::null),
eepromInterface(NULL),
voice(false),
variantBase(0)
{
}
virtual ~FirmwareInfo() public:
virtual ~FirmwareInterface()
{ {
delete eepromInterface; delete eepromInterface;
} }
FirmwareInfo(const QString & id, const QString & name, EEPROMInterface * eepromInterface, const QString & url = QString(), const QString & stamp = QString(), const QString & rnurl = QString(), bool voice = false): FirmwareInterface(const QString & id, const QString & name, const BoardEnum board, EEPROMInterface * eepromInterface, bool voice = false):
parent(NULL),
id(id), id(id),
name(name), name(name),
board(board),
eepromInterface(eepromInterface), eepromInterface(eepromInterface),
url(url),
stamp(stamp),
rnurl(rnurl),
voice(voice), voice(voice),
variantBase(0) variantBase(0)
{ {
} }
FirmwareInfo(const QString & id, EEPROMInterface * eepromInterface, const QString & url, const QString & stamp = QString(), const QString & rnurl = QString(), bool voice=false): inline void setVariantBase(unsigned int variant)
parent(NULL),
id(id),
name(QString::null),
eepromInterface(eepromInterface),
url(url),
stamp(stamp),
rnurl(rnurl),
voice(voice),
variantBase(0)
{ {
} variantBase = variant;
void setVariantBase(unsigned int variant) {
this->variantBase = variant;
} }
unsigned int getVariant(const QString & id); unsigned int getVariant(const QString & id);
@@ -1312,71 +1287,104 @@ class FirmwareInfo {
virtual void addOptions(Option options[]); virtual void addOptions(Option options[]);
QStringList get_options() { inline int saveEEPROM(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, unsigned int version=0)
if (parent) {
return id.mid(parent->id.length()+1).split("-", QString::SkipEmptyParts);
else
return QStringList();
}
int saveEEPROM(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, unsigned int version=0) {
return eepromInterface->save(eeprom, radioData, variant, version); return eepromInterface->save(eeprom, radioData, variant, version);
} }
virtual QString getUrl(const QString &fwId) { virtual QString getStampUrl() = 0;
if (url.contains("%1"))
return url.arg(fwId); virtual QString getReleaseNotesUrl() = 0;
else
return url; virtual QString getFirmwareUrl(QString & id) = 0;
inline BoardEnum getBoard()
{
return board;
} }
virtual QString getRnUrl(const QString &fwId) { inline EEPROMInterface * getEepromInterface()
if (rnurl.contains("%1")) {
return rnurl.arg(fwId); return eepromInterface;
else
return rnurl;
} }
virtual int getCapability(const Capability) = 0;
virtual SimulatorInterface * getSimulator()
{
return NULL;
}
public:
QList<const char *> languages; QList<const char *> languages;
QList<const char *> ttslanguages; QList<const char *> ttslanguages;
QList< QList<Option> > opts; QList< QList<Option> > opts;
FirmwareInfo *parent;
QString id; QString id;
QString name; QString name;
protected:
BoardEnum board;
EEPROMInterface * eepromInterface; EEPROMInterface * eepromInterface;
QString url;
QString stamp; public:
QString rnurl;
bool voice; bool voice;
protected:
unsigned int variantBase; unsigned int variantBase;
private:
FirmwareInterface();
}; };
struct FirmwareVariant { class FirmwareVariant
QString id; {
FirmwareInfo *firmware; public:
unsigned int variant; FirmwareVariant():
firmware(NULL),
variant(0)
{
}
FirmwareVariant(QString & id, FirmwareInterface * firmware, unsigned int variant):
id(id),
firmware(firmware),
variant(variant)
{
}
QString getFirmwareUrl()
{
if (firmware)
return firmware->getFirmwareUrl(id);
else
return "";
}
QString id;
FirmwareInterface * firmware;
unsigned int variant;
}; };
extern QList<FirmwareInfo *> firmwares; extern QList<FirmwareInterface *> firmwares;
extern FirmwareVariant default_firmware_variant; extern FirmwareVariant default_firmware_variant;
extern FirmwareVariant current_firmware_variant; extern FirmwareVariant current_firmware_variant;
FirmwareVariant GetFirmwareVariant(QString id); FirmwareVariant GetFirmwareVariant(QString id);
inline FirmwareInfo * GetFirmware(QString id) inline FirmwareInterface * GetFirmware(QString id)
{ {
return GetFirmwareVariant(id).firmware; return GetFirmwareVariant(id).firmware;
} }
inline FirmwareInfo * GetCurrentFirmware() inline FirmwareInterface * GetCurrentFirmware()
{ {
return current_firmware_variant.firmware; return current_firmware_variant.firmware;
} }
inline EEPROMInterface * GetEepromInterface() inline EEPROMInterface * GetEepromInterface()
{ {
return GetCurrentFirmware()->eepromInterface; return GetCurrentFirmware()->getEepromInterface();
} }
inline unsigned int GetCurrentFirmwareVariant() inline unsigned int GetCurrentFirmwareVariant()
@@ -1384,6 +1392,8 @@ inline unsigned int GetCurrentFirmwareVariant()
return current_firmware_variant.variant; return current_firmware_variant.variant;
} }
void UnregisterEepromInterfaces();
inline int divRoundClosest(const int n, const int d) inline int divRoundClosest(const int n, const int d)
{ {
return ((n < 0) ^ (d < 0)) ? ((n - d/2)/d) : ((n + d/2)/d); return ((n < 0) ^ (d < 0)) ? ((n - d/2)/d) : ((n + d/2)/d);
@@ -200,75 +200,6 @@ int Er9xInterface::getSize(GeneralSettings &settings)
return 0; return 0;
} }
int Er9xInterface::getCapability(const Capability capability)
{
switch (capability) {
case FlightPhases:
return 4;
case Mixes:
return ER9X_MAX_MIXERS;
case PPMExtCtrl:
return 1;
case ModelTrainerEnable:
return 1;
case Timer2ThrTrig:
return 1;
case OffsetWeight:
return 125;
case SoundMod:
return 1;
case SoundPitch:
return 1;
case Haptic:
return 1;
case Timers:
return 1;
case Pots:
return 3;
case Switches:
return 7;
case SwitchesPositions:
return 9;
case CustomFunctions:
return 0;
case LogicalSwitches:
return 12;
case CustomAndSwitches:
return 5;
case CSFunc:
return 13;
case Outputs:
return 16;
case Simulation:
return 1;
case Telemetry:
return TM_HASTELEMETRY|TM_HASWSHH;
case TelemetryUnits:
return 1;
case TelemetryMaxMultiplier:
return 2;
case MaxVolume:
return 7;
case SlowScale:
return 1;
case SlowRange:
return 15;
case LCDWidth:
return 128;
case VoicesAsNumbers:
case HasAltitudeSel:
case HasContrast:
case HasVolume:
case ModelVoice:
case Gvars:
return 7;
case GetThrSwitch:
return DSW_THR;
default:
return 0;
}
}
int Er9xInterface::isAvailable(Protocol prot, int port) int Er9xInterface::isAvailable(Protocol prot, int port)
{ {
switch (prot) { switch (prot) {
@@ -282,13 +213,6 @@ int Er9xInterface::isAvailable(Protocol prot, int port)
} }
} }
SimulatorInterface * Er9xInterface::getSimulator()
{
return NULL; // new Er9xSimulator(this);
}
void Er9xInterface::appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value) void Er9xInterface::appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value)
{ {
QDomElement e = qdoc->createElement(name); QDomElement e = qdoc->createElement(name);
@@ -46,12 +46,8 @@ class Er9xInterface : public EEPROMInterface
virtual int getSize(GeneralSettings &settings); virtual int getSize(GeneralSettings &settings);
virtual int getCapability(const Capability);
virtual int isAvailable(Protocol proto, int port=0); virtual int isAvailable(Protocol proto, int port=0);
virtual SimulatorInterface * getSimulator();
protected: protected:
EFile *efile; EFile *efile;
@@ -244,74 +244,6 @@ int Ersky9xInterface::getSize(GeneralSettings &settings)
return 0; return 0;
} }
int Ersky9xInterface::getCapability(const Capability capability)
{
switch (capability) {
case Mixes:
return ERSKY9X_MAX_MIXERS_V11;
case PPMExtCtrl:
return 1;
case ModelTrainerEnable:
return 1;
case Timer2ThrTrig:
return 1;
case SoundMod:
return 1;
case SoundPitch:
return 1;
case Haptic:
return 1;
case ModelVoice:
return 1;
case Timers:
return 2;
case Pots:
return 3;
case Gvars:
return 7;
case Switches:
return 7;
case SwitchesPositions:
return 9;
case CustomFunctions:
return 0;
case LogicalSwitches:
return ERSKY9X_NUM_CSW_V11;
case CustomAndSwitches:
return 1;
case CSFunc:
return 13;
case Outputs:
return ERSKY9X_NUM_CHNOUT_V11;
case Simulation:
return 1;
case Telemetry:
return TM_HASTELEMETRY|TM_HASWSHH;
case TelemetryUnits:
return 1;
case OptrexDisplay:
return 1;
case HasAltitudeSel:
case HasCurrentCalibration:
case HasVolume:
case HasBrightness:
case HasContrast:
return 1;
case OffsetWeight:
return 125;
case MaxVolume:
return 23;
case TelemetryMaxMultiplier:
return 2;
case LCDWidth:
return 128;
case GetThrSwitch:
return DSW_THR;
default:
return 0;
}
}
int Ersky9xInterface::isAvailable(Protocol prot, int port) int Ersky9xInterface::isAvailable(Protocol prot, int port)
{ {
switch (prot) { switch (prot) {
@@ -325,13 +257,6 @@ int Ersky9xInterface::isAvailable(Protocol prot, int port)
} }
} }
SimulatorInterface * Ersky9xInterface::getSimulator()
{
return NULL; // new Ersky9xSimulator(this);
}
void Ersky9xInterface::appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value) void Ersky9xInterface::appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value)
{ {
QDomElement e = qdoc->createElement(name); QDomElement e = qdoc->createElement(name);
@@ -46,12 +46,8 @@ class Ersky9xInterface : public EEPROMInterface
virtual int getSize(GeneralSettings &settings); virtual int getSize(GeneralSettings &settings);
virtual int getCapability(const Capability);
virtual int isAvailable(Protocol proto, int port=0); virtual int isAvailable(Protocol proto, int port=0);
virtual SimulatorInterface * getSimulator();
protected: protected:
EFile *efile; EFile *efile;
@@ -216,59 +216,6 @@ int Gruvin9xInterface::getSize(GeneralSettings &settings)
return 0; return 0;
} }
int Gruvin9xInterface::getCapability(const Capability capability)
{
switch (capability) {
case Mixes:
return G9X_MAX_MIXERS;
case FlightPhases:
return G9X_MAX_PHASES;
case FlightPhasesHaveFades:
return 1;
case Timers:
return 2;
case Pots:
return 3;
case Switches:
return 7;
case SwitchesPositions:
return 9;
case CustomFunctions:
return 12;
case LogicalSwitches:
return 12;
case CSFunc:
return 13;
case Outputs:
return 16;
case ExtendedTrims:
return 500;
case Simulation:
return true;
case OffsetWeight:
return 125;
case HasContrast:
return true;
case Telemetry:
return TM_HASTELEMETRY|TM_HASWSHH;
case TelemetryMaxMultiplier:
return 1;
case SlowScale:
return 2;
case SlowRange:
return 15;
case LCDWidth:
return 128;
case HasSDLogs:
case Haptic:
return 1;
case GetThrSwitch:
return DSW_THR;
default:
return false;
}
}
int Gruvin9xInterface::isAvailable(Protocol proto, int port) int Gruvin9xInterface::isAvailable(Protocol proto, int port)
{ {
switch (proto) { switch (proto) {
@@ -283,8 +230,3 @@ int Gruvin9xInterface::isAvailable(Protocol proto, int port)
return 0; return 0;
} }
} }
SimulatorInterface * Gruvin9xInterface::getSimulator()
{
return NULL;
}
@@ -47,12 +47,8 @@ class Gruvin9xInterface : public EEPROMInterface
virtual int getSize(GeneralSettings &settings); virtual int getSize(GeneralSettings &settings);
virtual int getCapability(const Capability);
virtual int isAvailable(Protocol proto, int port=0); virtual int isAvailable(Protocol proto, int port=0);
virtual SimulatorInterface * getSimulator();
protected: protected:
template <class T> template <class T>
@@ -106,8 +106,7 @@ uint8_t getStickMode()
using namespace Open9xGruvin9x; using namespace Open9xGruvin9x;
Open9xGruvin9xSimulator::Open9xGruvin9xSimulator(OpenTxInterface * open9xInterface): Open9xGruvin9xSimulator::Open9xGruvin9xSimulator()
open9xInterface(open9xInterface)
{ {
} }
@@ -20,13 +20,13 @@
#include "simulatorinterface.h" #include "simulatorinterface.h"
class RadioData; class RadioData;
class OpenTxInterface; class OpenTxEepromInterface;
class Open9xGruvin9xSimulator : public SimulatorInterface { class Open9xGruvin9xSimulator : public SimulatorInterface {
public: public:
Open9xGruvin9xSimulator(OpenTxInterface *); Open9xGruvin9xSimulator();
virtual void start(QByteArray & eeprom, bool tests=true); virtual void start(QByteArray & eeprom, bool tests=true);
@@ -54,9 +54,6 @@ class Open9xGruvin9xSimulator : public SimulatorInterface {
virtual const char * getError(); virtual const char * getError();
protected:
OpenTxInterface * open9xInterface;
}; };
#endif #endif
@@ -104,8 +104,7 @@ uint8_t getStickMode()
using namespace Open9xM128; using namespace Open9xM128;
Open9xM128Simulator::Open9xM128Simulator(OpenTxInterface * open9xInterface): Open9xM128Simulator::Open9xM128Simulator()
open9xInterface(open9xInterface)
{ {
} }
@@ -20,13 +20,13 @@
#include "simulatorinterface.h" #include "simulatorinterface.h"
class RadioData; class RadioData;
class OpenTxInterface; class OpenTxEepromInterface;
class Open9xM128Simulator : public SimulatorInterface { class Open9xM128Simulator : public SimulatorInterface {
public: public:
Open9xM128Simulator(OpenTxInterface *); Open9xM128Simulator();
virtual void start(QByteArray & eeprom, bool tests=true); virtual void start(QByteArray & eeprom, bool tests=true);
@@ -54,9 +54,6 @@ class Open9xM128Simulator : public SimulatorInterface {
virtual const char * getError(); virtual const char * getError();
protected:
OpenTxInterface * open9xInterface;
}; };
#endif #endif
@@ -135,8 +135,7 @@ uint8_t getStickMode()
using namespace Open9xSky9x; using namespace Open9xSky9x;
Open9xSky9xSimulator::Open9xSky9xSimulator(OpenTxInterface * open9xInterface): Open9xSky9xSimulator::Open9xSky9xSimulator()
open9xInterface(open9xInterface)
{ {
QString path=g.profile[g.id()].sdPath()+"/"; QString path=g.profile[g.id()].sdPath()+"/";
int i=0; int i=0;
@@ -20,13 +20,13 @@
#include "simulatorinterface.h" #include "simulatorinterface.h"
class RadioData; class RadioData;
class OpenTxInterface; class OpenTxEepromInterface;
class Open9xSky9xSimulator : public SimulatorInterface { class Open9xSky9xSimulator : public SimulatorInterface {
public: public:
Open9xSky9xSimulator(OpenTxInterface *); Open9xSky9xSimulator();
virtual void start(QByteArray & eeprom, bool tests=true); virtual void start(QByteArray & eeprom, bool tests=true);
@@ -54,9 +54,6 @@ class Open9xSky9xSimulator : public SimulatorInterface {
virtual const char * getError(); virtual const char * getError();
protected:
OpenTxInterface * open9xInterface;
}; };
#endif #endif
@@ -176,8 +176,7 @@ void resetTrims()
using namespace Open9xX9D; using namespace Open9xX9D;
OpentxTaranisSimulator::OpentxTaranisSimulator(OpenTxInterface * open9xInterface): OpentxTaranisSimulator::OpentxTaranisSimulator()
open9xInterface(open9xInterface)
{ {
taranisSimulatorBoard = GetEepromInterface()->getBoard(); taranisSimulatorBoard = GetEepromInterface()->getBoard();
QString path=g.profile[g.id()].sdPath()+"/"; QString path=g.profile[g.id()].sdPath()+"/";
@@ -20,13 +20,13 @@
#include "simulatorinterface.h" #include "simulatorinterface.h"
class RadioData; class RadioData;
class OpenTxInterface; class OpenTxEepromInterface;
class OpentxTaranisSimulator : public SimulatorInterface { class OpentxTaranisSimulator : public SimulatorInterface {
public: public:
OpentxTaranisSimulator(OpenTxInterface *); OpentxTaranisSimulator();
virtual void start(QByteArray & eeprom, bool tests=true); virtual void start(QByteArray & eeprom, bool tests=true);
@@ -54,9 +54,6 @@ class OpentxTaranisSimulator : public SimulatorInterface {
virtual const char * getError(); virtual const char * getError();
protected:
OpenTxInterface * open9xInterface;
}; };
#endif #endif
@@ -2180,7 +2180,7 @@ class FrskyField: public StructField {
rssiConversionTable[1] = RSSIConversionTable(1); rssiConversionTable[1] = RSSIConversionTable(1);
if (IS_ARM(board)) { if (IS_ARM(board)) {
for (int i=0; i<2; i++) { for (int i=0; i < ((version >= 216) ? 4 : 2); i++) {
Append(new UnsignedField<8>(frsky.channels[i].ratio, "Ratio")); Append(new UnsignedField<8>(frsky.channels[i].ratio, "Ratio"));
Append(new SignedField<12>(frsky.channels[i].offset, "Offset")); Append(new SignedField<12>(frsky.channels[i].offset, "Offset"));
Append(new UnsignedField<4>(frsky.channels[i].type, "Type")); Append(new UnsignedField<4>(frsky.channels[i].type, "Type"));
@@ -2475,7 +2475,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (board==BOARD_SKY9X && version >= 216) { if (board==BOARD_SKY9X && version >= 216) {
internalField.Append(new UnsignedField<8>(modelData.nPotsToWarn)); internalField.Append(new UnsignedField<8>(modelData.nPotsToWarn));
for (int i=0; i < GetEepromInterface()->getCapability(Pots); i++) { for (int i=0; i < GetCurrentFirmware()->getCapability(Pots); i++) {
internalField.Append(new SignedField<8>(modelData.potPosition[i])); internalField.Append(new SignedField<8>(modelData.potPosition[i]));
} }
} }
@@ -2499,7 +2499,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new ZCharField<4>(modelData.inputNames[i])); internalField.Append(new ZCharField<4>(modelData.inputNames[i]));
} }
internalField.Append(new UnsignedField<8>(modelData.nPotsToWarn)); internalField.Append(new UnsignedField<8>(modelData.nPotsToWarn));
for (int i=0; i < GetEepromInterface()->getCapability(Pots); i++) { for (int i=0; i < GetCurrentFirmware()->getCapability(Pots); i++) {
internalField.Append(new SignedField<8>(modelData.potPosition[i])); internalField.Append(new SignedField<8>(modelData.potPosition[i]));
} }
} }
@@ -2693,6 +2693,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
internalField.Append(new UnsignedField<2>(potsType[i])); internalField.Append(new UnsignedField<2>(potsType[i]));
} }
internalField.Append(new UnsignedField<8>(generalData.backlightColor));
} }
} }
} }
+311 -311
View File
@@ -43,18 +43,18 @@ size_t SizeOfArray( T(&)[ N ] )
return N; return N;
} }
OpenTxInterface::OpenTxInterface(BoardEnum board): OpenTxEepromInterface::OpenTxEepromInterface(BoardEnum board):
EEPROMInterface(board), EEPROMInterface(board),
efile(new EFile()) efile(new EFile())
{ {
} }
OpenTxInterface::~OpenTxInterface() OpenTxEepromInterface::~OpenTxEepromInterface()
{ {
delete efile; delete efile;
} }
const char * OpenTxInterface::getName() const char * OpenTxEepromInterface::getName()
{ {
switch (board) { switch (board) {
case BOARD_STOCK: case BOARD_STOCK:
@@ -74,7 +74,7 @@ const char * OpenTxInterface::getName()
} }
} }
const int OpenTxInterface::getEEpromSize() const int OpenTxEepromInterface::getEEpromSize()
{ {
switch (board) { switch (board) {
case BOARD_STOCK: case BOARD_STOCK:
@@ -94,7 +94,7 @@ const int OpenTxInterface::getEEpromSize()
} }
} }
const int OpenTxInterface::getMaxModels() const int OpenTxEepromInterface::getMaxModels()
{ {
if (IS_ARM(board)) if (IS_ARM(board))
return 60; return 60;
@@ -107,7 +107,7 @@ const int OpenTxInterface::getMaxModels()
} }
template <class T> template <class T>
bool OpenTxInterface::loadModel(ModelData &model, uint8_t *data, int index, unsigned int stickMode) bool OpenTxEepromInterface::loadModel(ModelData &model, uint8_t *data, int index, unsigned int stickMode)
{ {
T _model; T _model;
@@ -140,7 +140,7 @@ bool OpenTxInterface::loadModel(ModelData &model, uint8_t *data, int index, unsi
} }
template <class T> template <class T>
bool OpenTxInterface::loadModelVariant(unsigned int index, ModelData &model, uint8_t *data, unsigned int version, unsigned int variant) bool OpenTxEepromInterface::loadModelVariant(unsigned int index, ModelData &model, uint8_t *data, unsigned int version, unsigned int variant)
{ {
T open9xModel(model, board, version, variant); T open9xModel(model, board, version, variant);
@@ -167,7 +167,7 @@ bool OpenTxInterface::loadModelVariant(unsigned int index, ModelData &model, uin
return true; return true;
} }
bool OpenTxInterface::loadModel(uint8_t version, ModelData &model, uint8_t *data, int index, unsigned int variant, unsigned int stickMode) bool OpenTxEepromInterface::loadModel(uint8_t version, ModelData &model, uint8_t *data, int index, unsigned int variant, unsigned int stickMode)
{ {
if (version == 201) { if (version == 201) {
return loadModel<Open9xModelData_v201>(model, data, index, stickMode); return loadModel<Open9xModelData_v201>(model, data, index, stickMode);
@@ -248,7 +248,7 @@ bool OpenTxInterface::loadModel(uint8_t version, ModelData &model, uint8_t *data
} }
template <class T> template <class T>
bool OpenTxInterface::loadGeneral(GeneralSettings &settings, unsigned int version) bool OpenTxEepromInterface::loadGeneral(GeneralSettings &settings, unsigned int version)
{ {
QByteArray eepromData(sizeof(settings), 0); // GeneralSettings should be always bigger than the EEPROM struct QByteArray eepromData(sizeof(settings), 0); // GeneralSettings should be always bigger than the EEPROM struct
T open9xSettings(settings, board, version); T open9xSettings(settings, board, version);
@@ -264,7 +264,7 @@ bool OpenTxInterface::loadGeneral(GeneralSettings &settings, unsigned int versio
} }
template <class T> template <class T>
bool OpenTxInterface::saveGeneral(GeneralSettings &settings, BoardEnum board, uint32_t version, uint32_t variant) bool OpenTxEepromInterface::saveGeneral(GeneralSettings &settings, BoardEnum board, uint32_t version, uint32_t variant)
{ {
T open9xSettings(settings, board, version, variant); T open9xSettings(settings, board, version, variant);
// open9xSettings.Dump(); // open9xSettings.Dump();
@@ -275,7 +275,7 @@ bool OpenTxInterface::saveGeneral(GeneralSettings &settings, BoardEnum board, ui
} }
template <class T> template <class T>
bool OpenTxInterface::saveModel(unsigned int index, ModelData &model, unsigned int version, unsigned int variant) bool OpenTxEepromInterface::saveModel(unsigned int index, ModelData &model, unsigned int version, unsigned int variant)
{ {
T open9xModel(model, board, version, variant); T open9xModel(model, board, version, variant);
// open9xModel.Dump(); // open9xModel.Dump();
@@ -285,12 +285,12 @@ bool OpenTxInterface::saveModel(unsigned int index, ModelData &model, unsigned i
return (sz == eeprom.size()); return (sz == eeprom.size());
} }
bool OpenTxInterface::loadxml(RadioData &radioData, QDomDocument &doc) bool OpenTxEepromInterface::loadxml(RadioData &radioData, QDomDocument &doc)
{ {
return false; return false;
} }
bool OpenTxInterface::load(RadioData &radioData, const uint8_t *eeprom, int size) bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
{ {
std::cout << "trying " << getName() << " import..."; std::cout << "trying " << getName() << " import...";
@@ -352,7 +352,7 @@ bool OpenTxInterface::load(RadioData &radioData, const uint8_t *eeprom, int size
return true; return true;
} }
int OpenTxInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version) int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
{ {
EEPROMWarnings.clear(); EEPROMWarnings.clear();
@@ -364,6 +364,7 @@ int OpenTxInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t varian
version = 216; version = 216;
break; break;
case BOARD_GRUVIN9X: case BOARD_GRUVIN9X:
case BOARD_MEGA2560:
version = 216; version = 216;
break; break;
case BOARD_M128: case BOARD_M128:
@@ -405,7 +406,7 @@ int OpenTxInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t varian
return size; return size;
} }
int OpenTxInterface::getSize(ModelData &model) int OpenTxEepromInterface::getSize(ModelData &model)
{ {
if (board == BOARD_SKY9X) if (board == BOARD_SKY9X)
return 0; return 0;
@@ -428,7 +429,7 @@ int OpenTxInterface::getSize(ModelData &model)
return efile->size(0); return efile->size(0);
} }
int OpenTxInterface::getSize(GeneralSettings &settings) int OpenTxEepromInterface::getSize(GeneralSettings &settings)
{ {
if (board == BOARD_SKY9X) if (board == BOARD_SKY9X)
return 0; return 0;
@@ -448,7 +449,7 @@ int OpenTxInterface::getSize(GeneralSettings &settings)
return efile->size(0); return efile->size(0);
} }
int OpenTxInterface::getCapability(const Capability capability) int OpenTxFirmware::getCapability(const Capability capability)
{ {
switch (capability) { switch (capability) {
case ModelImage: case ModelImage:
@@ -692,7 +693,7 @@ int OpenTxInterface::getCapability(const Capability capability)
} }
} }
int OpenTxInterface::isAvailable(Protocol proto, int port) int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
{ {
if (IS_TARANIS(board)) { if (IS_TARANIS(board)) {
switch (port) { switch (port) {
@@ -777,31 +778,14 @@ int OpenTxInterface::isAvailable(Protocol proto, int port)
} }
} }
SimulatorInterface * OpenTxInterface::getSimulator()
{
switch (board) {
case BOARD_STOCK:
return new Open9xSimulator(this);
case BOARD_M128:
return new Open9xM128Simulator(this);
case BOARD_GRUVIN9X:
return new Open9xGruvin9xSimulator(this);
case BOARD_SKY9X:
return new Open9xSky9xSimulator(this);
case BOARD_TARANIS:
case BOARD_TARANIS_REV4a:
return new OpentxTaranisSimulator(this);
default:
return NULL;
}
}
template<typename T, size_t SIZE> template<typename T, size_t SIZE>
size_t getSizeA(T (&)[SIZE]) { size_t getSizeA(T (&)[SIZE]) {
return SIZE; return SIZE;
} }
bool OpenTxInterface::checkVersion(unsigned int version) bool OpenTxEepromInterface::checkVersion(unsigned int version)
{ {
switch(version) { switch(version) {
case 201: case 201:
@@ -867,7 +851,7 @@ bool OpenTxInterface::checkVersion(unsigned int version)
return true; return true;
} }
bool OpenTxInterface::checkVariant(unsigned int version, unsigned int variant) bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
{ {
if (board == BOARD_M128 && !(variant & 0x8000)) { if (board == BOARD_M128 && !(variant & 0x8000)) {
if (version == 212) { if (version == 212) {
@@ -889,7 +873,7 @@ bool OpenTxInterface::checkVariant(unsigned int version, unsigned int variant)
} }
} }
bool OpenTxInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
{ {
std::cout << "trying " << getName() << " backup import..."; std::cout << "trying " << getName() << " backup import...";
@@ -930,311 +914,327 @@ bool OpenTxInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esiz
return true; return true;
} }
QString geturl( int board) QString OpenTxFirmware::getFirmwareUrl(QString & id)
{ {
QString url = g.compileServer(); QString url = g.compileServer();
if (url.isEmpty()){ if (url.isEmpty()){
url= OPENTX_FIRMWARE_DOWNLOADS; url = OPENTX_FIRMWARE_DOWNLOADS;
g.compileServer(url); g.compileServer(url);
} }
switch(board) { switch(board) {
case BOARD_STOCK: case BOARD_STOCK:
case BOARD_M128: case BOARD_M128:
case BOARD_GRUVIN9X: case BOARD_GRUVIN9X:
url.append("/getfw.php?fw=%1.hex"); url.append(QString("/getfw.php?fw=%1.hex").arg(id));
break; break;
case BOARD_SKY9X: case BOARD_SKY9X:
case BOARD_TARANIS: case BOARD_TARANIS:
case BOARD_TARANIS_REV4a: case BOARD_TARANIS_REV4a:
url.append("/getfw.php?fw=%1.bin"); url.append(QString("/getfw.php?fw=%1.bin").arg(id));
break; break;
default: default:
url.clear(); url.clear();
break; break;
} }
return url; return url;
} }
QString getstamp( int board) QString OpenTxFirmware::getReleaseNotesUrl()
{ {
QString url = g.compileServer(); QString url = g.compileServer();
if (url.isEmpty()){ if (url.isEmpty()){
url= OPENTX_FIRMWARE_DOWNLOADS; url = OPENTX_FIRMWARE_DOWNLOADS;
g.compileServer(url); g.compileServer(url);
} }
url.append("/stamp-opentx-"); url.append("/releasenotes-");
switch(board) { switch(board) {
case BOARD_STOCK: case BOARD_STOCK:
url.append("9x.txt"); case BOARD_M128:
break; case BOARD_GRUVIN9X:
case BOARD_M128: case BOARD_SKY9X:
url.append("9x128.txt"); url.append("9x.txt");
break; break;
case BOARD_GRUVIN9X: case BOARD_TARANIS:
url.append("gruvin9x.txt"); case BOARD_TARANIS_REV4a:
break; url.append("taranis.txt");
case BOARD_SKY9X: break;
url.append("sky9x.txt"); default:
break; url.clear();
case BOARD_TARANIS: break;
case BOARD_TARANIS_REV4a: }
url.append("taranis.txt"); return url;
break;
default:
url.clear();
break;
}
return url;
} }
QString getrnurl( int board) QString OpenTxFirmware::getStampUrl()
{ {
QString url = g.compileServer(); QString url = g.compileServer();
if (url.isEmpty()){ if (url.isEmpty()){
url= OPENTX_FIRMWARE_DOWNLOADS; url= OPENTX_FIRMWARE_DOWNLOADS;
g.compileServer(url); g.compileServer(url);
} }
url.append("/releasenotes-"); url.append("/stamp-opentx-");
switch(board) { switch(board) {
case BOARD_STOCK: case BOARD_STOCK:
case BOARD_M128: url.append("9x.txt");
case BOARD_GRUVIN9X: break;
case BOARD_SKY9X: case BOARD_M128:
url.append("9x.txt"); url.append("9x128.txt");
break; break;
case BOARD_TARANIS: case BOARD_GRUVIN9X:
case BOARD_TARANIS_REV4a: url.append("gruvin9x.txt");
url.append("taranis.txt"); break;
break; case BOARD_SKY9X:
default: url.append("sky9x.txt");
url.clear(); break;
break; case BOARD_TARANIS:
} case BOARD_TARANIS_REV4a:
return url; url.append("taranis.txt");
break;
default:
url.clear();
break;
}
return url;
} }
void RegisterOpen9xFirmwares() SimulatorInterface * OpenTxFirmware::getSimulator()
{ {
Open9xFirmware * open9x; switch (board) {
case BOARD_STOCK:
return new Open9xSimulator();
case BOARD_M128:
return new Open9xM128Simulator();
case BOARD_GRUVIN9X:
return new Open9xGruvin9xSimulator();
case BOARD_SKY9X:
return new Open9xSky9xSimulator();
case BOARD_TARANIS:
case BOARD_TARANIS_REV4a:
return new OpentxTaranisSimulator();
default:
return NULL;
}
}
void registerOpenTxFirmwares()
{
OpenTxFirmware * openTx;
Option ext_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "telemetrez", QObject::tr("Support for telemetry easy board"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } }; Option ext_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "telemetrez", QObject::tr("Support for telemetry easy board"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } };
Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } }; Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } };
Option extr_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } }; Option extr_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } };
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE at field") }, { "faimode", QObject::tr("FAI MODE always enabled") }, { NULL } }; Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE at field") }, { "faimode", QObject::tr("FAI MODE always enabled") }, { NULL } };
/* 9x board */ /* 9x board */
open9x = new Open9xFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), new OpenTxInterface(BOARD_STOCK), geturl(BOARD_STOCK), getstamp(BOARD_STOCK), getrnurl(BOARD_STOCK), false); openTx = new OpenTxFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), BOARD_STOCK, false);
open9x->addOptions(ext_options); openTx->addOptions(ext_options);
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu")); openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
open9x->addOption("nosplash", QObject::tr("No splash screen")); openTx->addOption("nosplash", QObject::tr("No splash screen"));
open9x->addOption("nofp", QObject::tr("No flight modes")); openTx->addOption("nofp", QObject::tr("No flight modes"));
open9x->addOption("nocurves", QObject::tr("Disable curves menus")); openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
open9x->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); openTx->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
open9x->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); openTx->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
open9x->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); openTx->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED open9x->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); // NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
open9x->addOption("DSM2", QObject::tr("Support for DSM2 modules")); openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
open9x->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
open9x->addOption("ppmus", QObject::tr("Channel values displayed in us")); openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
open9x->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
open9x->addOption("symlimits", QObject::tr("Symetrical Limits")); openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
open9x->addOptions(nav_options); openTx->addOptions(nav_options);
open9x->addOption("sp22", QObject::tr("SmartieParts 2.2 Backlight support")); openTx->addOption("sp22", QObject::tr("SmartieParts 2.2 Backlight support"));
open9x->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
open9x->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
open9x->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); openTx->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
open9x->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
open9x->addOption("battgraph", QObject::tr("Battery graph")); openTx->addOption("battgraph", QObject::tr("Battery graph"));
open9x->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
open9x->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
open9x->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
open9x->addOption("pgbar", QObject::tr("EEprom write progress bar")); openTx->addOption("pgbar", QObject::tr("EEprom write progress bar"));
open9x->addOption("imperial", QObject::tr("Imperial units")); openTx->addOption("imperial", QObject::tr("Imperial units"));
open9x->addOption("nowshh", QObject::tr("No Winged Shadow How High support")); openTx->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
open9x->addOption("novario", QObject::tr("No vario support")); openTx->addOption("novario", QObject::tr("No vario support"));
open9x->addOption("nogps", QObject::tr("No GPS support")); openTx->addOption("nogps", QObject::tr("No GPS support"));
open9x->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen")); openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
open9x->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors")); openTx->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors"));
open9x->addOptions(fai_options); openTx->addOptions(fai_options);
firmwares.push_back(open9x); firmwares.push_back(openTx);
/* 9x board with M128 chip */ /* 9x board with M128 chip */
open9x = new Open9xFirmware("opentx-9x128", QObject::tr("OpenTX for M128 / 9X board"), new OpenTxInterface(BOARD_M128), geturl(BOARD_M128), getstamp(BOARD_M128),getrnurl(BOARD_M128), false); openTx = new OpenTxFirmware("opentx-9x128", QObject::tr("OpenTX for M128 / 9X board"), BOARD_M128, false);
open9x->addOptions(ext_options); openTx->addOptions(ext_options);
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu")); openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
open9x->addOption("nosplash", QObject::tr("No splash screen")); openTx->addOption("nosplash", QObject::tr("No splash screen"));
open9x->addOption("nofp", QObject::tr("No flight modes")); openTx->addOption("nofp", QObject::tr("No flight modes"));
open9x->addOption("nocurves", QObject::tr("Disable curves menus")); openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
open9x->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); openTx->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
open9x->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); openTx->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
open9x->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); openTx->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED open9x->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); // NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
open9x->addOption("DSM2", QObject::tr("Support for DSM2 modules")); openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
open9x->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
open9x->addOption("ppmus", QObject::tr("Channel values displayed in us")); openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
open9x->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
open9x->addOption("symlimits", QObject::tr("Symetrical Limits")); openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
open9x->addOptions(nav_options); openTx->addOptions(nav_options);
open9x->addOption("sp22", QObject::tr("SmartieParts 2.2 Backlight support")); openTx->addOption("sp22", QObject::tr("SmartieParts 2.2 Backlight support"));
open9x->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
open9x->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
open9x->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); openTx->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
open9x->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
open9x->addOption("battgraph", QObject::tr("Battery graph")); openTx->addOption("battgraph", QObject::tr("Battery graph"));
open9x->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
open9x->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
open9x->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
open9x->addOption("pgbar", QObject::tr("EEprom write Progress bar")); openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
open9x->addOption("imperial", QObject::tr("Imperial units")); openTx->addOption("imperial", QObject::tr("Imperial units"));
open9x->addOptions(fai_options); openTx->addOptions(fai_options);
firmwares.push_back(open9x); firmwares.push_back(openTx);
/* 9XR board */ /* 9XR board */
open9x = new Open9xFirmware("opentx-9xr", QObject::tr("OpenTX for 9XR"), new OpenTxInterface(BOARD_STOCK), geturl(BOARD_STOCK), getstamp(BOARD_STOCK),getrnurl(BOARD_STOCK), false); openTx = new OpenTxFirmware("opentx-9xr", QObject::tr("OpenTX for 9XR"), BOARD_STOCK, false);
open9x->addOptions(extr_options); openTx->addOptions(extr_options);
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu")); openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
open9x->addOption("nosplash", QObject::tr("No splash screen")); openTx->addOption("nosplash", QObject::tr("No splash screen"));
open9x->addOption("nofp", QObject::tr("No flight modes")); openTx->addOption("nofp", QObject::tr("No flight modes"));
open9x->addOption("nocurves", QObject::tr("Disable curves menus")); openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
open9x->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); openTx->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
open9x->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); openTx->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
open9x->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); openTx->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED open9x->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); // NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
open9x->addOption("DSM2", QObject::tr("Support for DSM2 modules")); openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
open9x->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
open9x->addOption("ppmus", QObject::tr("Channel values displayed in us")); openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
open9x->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
open9x->addOption("symlimits", QObject::tr("Symetrical Limits")); openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
open9x->addOption("potscroll", QObject::tr("Pots use in menus navigation")); openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
open9x->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
open9x->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
open9x->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
open9x->addOption("battgraph", QObject::tr("Battery graph")); openTx->addOption("battgraph", QObject::tr("Battery graph"));
open9x->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
open9x->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
open9x->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
open9x->addOption("pgbar", QObject::tr("EEprom write Progress bar")); openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
open9x->addOption("imperial", QObject::tr("Imperial units")); openTx->addOption("imperial", QObject::tr("Imperial units"));
open9x->addOption("nowshh", QObject::tr("No Winged Shadow How High support")); openTx->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
open9x->addOption("novario", QObject::tr("No vario support")); openTx->addOption("novario", QObject::tr("No vario support"));
open9x->addOption("nogps", QObject::tr("No GPS support")); openTx->addOption("nogps", QObject::tr("No GPS support"));
open9x->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen")); openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
open9x->addOptions(fai_options); openTx->addOptions(fai_options);
firmwares.push_back(open9x); firmwares.push_back(openTx);
/* 9XR board with M128 chip */ /* 9XR board with M128 chip */
open9x = new Open9xFirmware("opentx-9xr128", QObject::tr("OpenTX for 9XR with M128 chip"), new OpenTxInterface(BOARD_M128), geturl(BOARD_M128), getstamp(BOARD_M128),getrnurl(BOARD_M128), false); openTx = new OpenTxFirmware("opentx-9xr128", QObject::tr("OpenTX for 9XR with M128 chip"), BOARD_M128, false);
open9x->addOptions(extr_options); openTx->addOptions(extr_options);
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu")); openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
open9x->addOption("nosplash", QObject::tr("No splash screen")); openTx->addOption("nosplash", QObject::tr("No splash screen"));
open9x->addOption("nofp", QObject::tr("No flight modes")); openTx->addOption("nofp", QObject::tr("No flight modes"));
open9x->addOption("nocurves", QObject::tr("Disable curves menus")); openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
open9x->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); openTx->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
open9x->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); openTx->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
open9x->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); openTx->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED open9x->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); // NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
open9x->addOption("DSM2", QObject::tr("Support for DSM2 modules")); openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
open9x->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
open9x->addOption("ppmus", QObject::tr("Channel values displayed in us")); openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
open9x->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
open9x->addOption("symlimits", QObject::tr("Symetrical Limits")); openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
open9x->addOption("potscroll", QObject::tr("Pots use in menus navigation")); openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
open9x->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
open9x->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
open9x->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
open9x->addOption("battgraph", QObject::tr("Battery graph")); openTx->addOption("battgraph", QObject::tr("Battery graph"));
open9x->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
open9x->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
open9x->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
open9x->addOption("pgbar", QObject::tr("EEprom write Progress bar")); openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
open9x->addOption("imperial", QObject::tr("Imperial units")); openTx->addOption("imperial", QObject::tr("Imperial units"));
open9x->addOptions(fai_options); openTx->addOptions(fai_options);
firmwares.push_back(open9x); firmwares.push_back(openTx);
/* Gruvin9x board */ /* Gruvin9x board */
open9x = new Open9xFirmware("opentx-gruvin9x", QObject::tr("OpenTX for Gruvin9x board / 9X"), new OpenTxInterface(BOARD_GRUVIN9X), geturl(BOARD_GRUVIN9X), getstamp(BOARD_GRUVIN9X),getrnurl(BOARD_GRUVIN9X), false); openTx = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("OpenTX for Gruvin9x board / 9X"), BOARD_GRUVIN9X, false);
open9x->setVariantBase(FRSKY_VARIANT); openTx->setVariantBase(FRSKY_VARIANT);
open9x->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu")); openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
open9x->addOption("nofp", QObject::tr("No flight modes")); openTx->addOption("nofp", QObject::tr("No flight modes"));
open9x->addOption("nocurves", QObject::tr("Disable curves menus")); openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
open9x->addOption("sdcard", QObject::tr("Support for SD memory card")); openTx->addOption("sdcard", QObject::tr("Support for SD memory card"));
open9x->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); openTx->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
open9x->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } }; Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
open9x->addOptions(dsm2_options); openTx->addOptions(dsm2_options);
open9x->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
open9x->addOption("ppmus", QObject::tr("Channel values displayed in us")); openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
open9x->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
open9x->addOption("symlimits", QObject::tr("Symetrical Limits")); openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
open9x->addOption("potscroll", QObject::tr("Pots use in menus navigation")); openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
open9x->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
open9x->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
open9x->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); openTx->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
open9x->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
open9x->addOption("battgraph", QObject::tr("Battery graph")); openTx->addOption("battgraph", QObject::tr("Battery graph"));
open9x->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
open9x->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
open9x->addOption("pgbar", QObject::tr("EEprom write Progress bar")); openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
open9x->addOption("imperial", QObject::tr("Imperial units")); openTx->addOption("imperial", QObject::tr("Imperial units"));
open9x->addOptions(fai_options); openTx->addOptions(fai_options);
firmwares.push_back(open9x); firmwares.push_back(openTx);
#ifndef __APPLE__ #ifndef __APPLE__
/* SKY9X board */ /* SKY9X board */
open9x = new Open9xFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), new OpenTxInterface(BOARD_SKY9X), geturl(BOARD_SKY9X), getstamp(BOARD_SKY9X),getrnurl(BOARD_SKY9X), true); openTx = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X, true);
open9x->setVariantBase(FRSKY_VARIANT); openTx->setVariantBase(FRSKY_VARIANT);
open9x->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support")); openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
open9x->addOption("templates", QObject::tr("Enable TEMPLATES menu")); openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
open9x->addOption("nofp", QObject::tr("No flight modes")); openTx->addOption("nofp", QObject::tr("No flight modes"));
open9x->addOption("nocurves", QObject::tr("Disable curves menus")); openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
open9x->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
open9x->addOption("ppmus", QObject::tr("Channel values displayed in us")); openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
open9x->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
open9x->addOption("symlimits", QObject::tr("Symetrical Limits")); openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
open9x->addOption("potscroll", QObject::tr("Pots use in menus navigation")); openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
open9x->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
open9x->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
open9x->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); openTx->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
open9x->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
open9x->addOption("battgraph", QObject::tr("Battery graph")); openTx->addOption("battgraph", QObject::tr("Battery graph"));
open9x->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
open9x->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
open9x->addOption("tsticks", QObject::tr("Use FrSky Taranis sticks in a 9X/9XR")); openTx->addOption("tsticks", QObject::tr("Use FrSky Taranis sticks in a 9X/9XR"));
open9x->addOption("bluetooth", QObject::tr("Bluetooth interface")); openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
open9x->addOptions(fai_options); openTx->addOptions(fai_options);
firmwares.push_back(open9x); firmwares.push_back(openTx);
#endif #endif
/* Taranis board */ /* Taranis board */
open9x = new Open9xFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), new OpenTxInterface(BOARD_TARANIS), geturl(BOARD_TARANIS), getstamp(BOARD_TARANIS),getrnurl(BOARD_TARANIS), true); openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS, true);
open9x->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support")); openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
open9x->addOption("notemplates", QObject::tr("Disable TEMPLATES menu")); openTx->addOption("notemplates", QObject::tr("Disable TEMPLATES menu"));
open9x->addOption("nogvars", QObject::tr("Disable Global variables")); openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
open9x->addOption("ppmus", QObject::tr("Channel values displayed in us")); openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
open9x->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
open9x->addOptions(fai_options); openTx->addOptions(fai_options);
firmwares.push_back(open9x); firmwares.push_back(openTx);
if (g.rev4aSupport()) { if (g.rev4aSupport()) {
open9x = new Open9xFirmware("opentx-taranisrev4a", QObject::tr("OpenTX for FrSky Taranis Rev4a"), new OpenTxInterface(BOARD_TARANIS_REV4a), geturl(BOARD_TARANIS_REV4a), getstamp(BOARD_TARANIS_REV4a),getrnurl(BOARD_TARANIS), true); openTx = new OpenTxFirmware("opentx-taranisrev4a", QObject::tr("OpenTX for FrSky Taranis Rev4a"), BOARD_TARANIS_REV4a, true);
open9x->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support")); openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
open9x->addOption("notemplates", QObject::tr("Disable TEMPLATES menu")); openTx->addOption("notemplates", QObject::tr("Disable TEMPLATES menu"));
open9x->addOption("nogvars", QObject::tr("Disable Global variables")); openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
open9x->addOption("ppmus", QObject::tr("Channel values displayed in us")); openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
open9x->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
open9x->addOptions(fai_options); openTx->addOptions(fai_options);
firmwares.push_back(open9x); firmwares.push_back(openTx);
} }
default_firmware_variant = GetFirmwareVariant("opentx-9x-heli-templates-en");
current_firmware_variant = default_firmware_variant;
} }
void UnregisterOpen9xFirmwares()
{
foreach (FirmwareInfo * f, firmwares) {
qDebug() << "UnregisterOpen9xFirmwares(): deleting " << QString::number(reinterpret_cast<uint64_t>(f), 16 );
delete f;
}
}
@@ -23,13 +23,13 @@
class EFile; class EFile;
class OpenTxInterface : public EEPROMInterface class OpenTxEepromInterface : public EEPROMInterface
{ {
public: public:
OpenTxInterface(BoardEnum board); OpenTxEepromInterface(BoardEnum board);
virtual ~OpenTxInterface(); virtual ~OpenTxEepromInterface();
virtual const char * getName(); virtual const char * getName();
@@ -49,12 +49,8 @@ class OpenTxInterface : public EEPROMInterface
virtual int getSize(GeneralSettings &); virtual int getSize(GeneralSettings &);
virtual int getCapability(const Capability);
virtual int isAvailable(Protocol proto, int port=0); virtual int isAvailable(Protocol proto, int port=0);
virtual SimulatorInterface * getSimulator();
protected: protected:
bool checkVersion(unsigned int version); bool checkVersion(unsigned int version);
@@ -82,10 +78,10 @@ class OpenTxInterface : public EEPROMInterface
}; };
class Open9xFirmware: public FirmwareInfo { class OpenTxFirmware: public FirmwareInterface {
public: public:
Open9xFirmware(const QString & id, const QString & name, EEPROMInterface * eepromInterface, const QString & url = QString(), const QString & stamp = QString(), const QString & rnurl = QString(), bool voice = false): OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board, bool voice = false):
FirmwareInfo(id, name, eepromInterface, url, stamp, rnurl, voice) FirmwareInterface(id, name, board, new OpenTxEepromInterface(board), voice)
{ {
addLanguage("en"); addLanguage("en");
addLanguage("fr"); addLanguage("fr");
@@ -109,61 +105,19 @@ class Open9xFirmware: public FirmwareInfo {
addTTSLanguage("es"); addTTSLanguage("es");
} }
virtual unsigned int getEepromVersion(unsigned int revision) { virtual QString getStampUrl();
switch(this->eepromInterface->getBoard()) {
case BOARD_SKY9X: virtual QString getReleaseNotesUrl();
if (revision == 0)
return 212; virtual QString getFirmwareUrl(QString & id);
if (revision >= 1217)
return 212; virtual int getCapability(const Capability);
if (revision >= 1174)
return 211; virtual SimulatorInterface * getSimulator();
if (revision >= 1031)
return 210;
if (revision >= 791)
return 209;
if (revision >= 641)
return 208;
break;
case BOARD_GRUVIN9X:
if (revision == 0)
return 211;
if (revision >= 1217)
return 211;
if (revision >= 1174)
return 210;
if (revision >= 791)
return 209;
if (revision >= 641)
return 208;
if (revision >= 547)
return 207;
break;
default:
if (revision == 0)
return 211;
if (revision >= 1217)
return 211;
if (revision >= 1174)
return 210;
if (revision >= 791)
return 209;
if (revision >= 641)
return 208;
break;
}
if (revision >= 321)
return 205;
else if (revision >= 217)
return 204;
else if (revision >= 184)
return 203;
else
return 202;
}
}; };
void RegisterOpen9xFirmwares(); void registerOpenTxFirmwares();
void UnregisterOpen9xFirmwares();
#endif #endif
@@ -110,8 +110,7 @@ uint8_t getStickMode()
using namespace Open9x; using namespace Open9x;
Open9xSimulator::Open9xSimulator(OpenTxInterface * open9xInterface): Open9xSimulator::Open9xSimulator()
open9xInterface(open9xInterface)
{ {
#define INIT_IMPORT #define INIT_IMPORT
#include "simulatorimport.h" #include "simulatorimport.h"
@@ -144,7 +143,6 @@ void Open9xSimulator::start(QByteArray & eeprom, bool tests)
void Open9xSimulator::start(const char * filename, bool tests) void Open9xSimulator::start(const char * filename, bool tests)
{ {
// open9xInterface->save(&Open9x::eeprom[0], radioData, SIMU_STOCK_VARIANTS);
StartEepromThread(filename); StartEepromThread(filename);
StartMainThread(tests); StartMainThread(tests);
} }
@@ -19,13 +19,13 @@
#include "simulatorinterface.h" #include "simulatorinterface.h"
class OpenTxInterface; class OpenTxEepromInterface;
class Open9xSimulator : public SimulatorInterface { class Open9xSimulator : public SimulatorInterface {
public: public:
Open9xSimulator(OpenTxInterface *); Open9xSimulator();
virtual void start(QByteArray & eeprom, bool tests=true); virtual void start(QByteArray & eeprom, bool tests=true);
@@ -53,10 +53,6 @@ class Open9xSimulator : public SimulatorInterface {
virtual const char * getError(); virtual const char * getError();
protected:
OpenTxInterface * open9xInterface;
}; };
#endif #endif
@@ -140,45 +140,6 @@ int Th9xInterface::getSize(GeneralSettings &settings)
return 0; return 0;
} }
int Th9xInterface::getCapability(const Capability capability)
{
switch (capability) {
case Mixes:
return TH9X_MAX_MIXERS;
case Timers:
return 1;
case Pots:
return 3;
case Switches:
return 7;
case SwitchesPositions:
return 9;
case CustomFunctions:
return 0;
case LogicalSwitches:
return TH9X_MAX_SWITCHES;
case Outputs:
return 8;
case OffsetWeight:
return 125;
case Simulation:
return 1;
case HasContrast:
case CSFunc:
return 13;
case SlowScale:
return 1;
case SlowRange:
return 10;
case LCDWidth:
return 128;
case GetThrSwitch:
return DSW_THR;
default:
return 0;
}
}
int Th9xInterface::isAvailable(Protocol proto, int port) int Th9xInterface::isAvailable(Protocol proto, int port)
{ {
switch (proto) { switch (proto) {
@@ -192,9 +153,3 @@ int Th9xInterface::isAvailable(Protocol proto, int port)
return 0; return 0;
} }
} }
SimulatorInterface * Th9xInterface::getSimulator()
{
return NULL; // new Th9xSimulator(this);
}
@@ -46,12 +46,8 @@ class Th9xInterface : public EEPROMInterface
virtual int getSize(GeneralSettings &); virtual int getSize(GeneralSettings &);
virtual int getCapability(const Capability);
virtual int isAvailable(Protocol proto, int port=0); virtual int isAvailable(Protocol proto, int port=0);
virtual SimulatorInterface * getSimulator();
protected: protected:
EFile *efile; EFile *efile;
+24 -290
View File
@@ -7,316 +7,50 @@
#include <QDesktopServices> #include <QDesktopServices>
#include <QtGui> #include <QtGui>
fwPreferencesDialog::fwPreferencesDialog(QWidget *parent) : FirmwarePreferencesDialog::FirmwarePreferencesDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::fwPreferencesDialog), ui(new Ui::FirmwarePreferencesDialog)
updateLock(false)
{ {
ui->setupUi(this); ui->setupUi(this);
setWindowIcon(CompanionIcon("fwpreferences.png")); setWindowIcon(CompanionIcon("fwpreferences.png"));
QCheckBox * OptionCheckBox[]= {
ui->optionCheckBox_1, ui->optionCheckBox_2, ui->optionCheckBox_3, ui->optionCheckBox_4, ui->optionCheckBox_5, ui->optionCheckBox_6, ui->optionCheckBox_7,
ui->optionCheckBox_8, ui->optionCheckBox_9, ui->optionCheckBox_10, ui->optionCheckBox_11, ui->optionCheckBox_12, ui->optionCheckBox_13, ui->optionCheckBox_14,
ui->optionCheckBox_15,ui->optionCheckBox_16, ui->optionCheckBox_17, ui->optionCheckBox_18, ui->optionCheckBox_19, ui->optionCheckBox_20, ui->optionCheckBox_21,
ui->optionCheckBox_22, ui->optionCheckBox_23, ui->optionCheckBox_24, ui->optionCheckBox_25, ui->optionCheckBox_26, ui->optionCheckBox_27, ui->optionCheckBox_28,
ui->optionCheckBox_29, ui->optionCheckBox_30, ui->optionCheckBox_31, ui->optionCheckBox_32, ui->optionCheckBox_33, ui->optionCheckBox_34, ui->optionCheckBox_35,
ui->optionCheckBox_36, ui->optionCheckBox_37, ui->optionCheckBox_38, ui->optionCheckBox_39, ui->optionCheckBox_40, ui->optionCheckBox_41, ui->optionCheckBox_42,
NULL };
voice=NULL;
connect(ui->langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
connect(ui->voiceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
for (int i=0; OptionCheckBox[i]; i++) {
optionsCheckBoxes.push_back(OptionCheckBox[i]);
connect(OptionCheckBox[i], SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
}
initSettings(); initSettings();
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
shrink();
} }
FirmwarePreferencesDialog::~FirmwarePreferencesDialog()
fwPreferencesDialog::~fwPreferencesDialog()
{ {
delete ui; delete ui;
} }
void fwPreferencesDialog::showVoice(bool show) void FirmwarePreferencesDialog::initSettings()
{ {
if (show) ui->fwTypeLbl->setText(g.profile[g.id()].fwType());
showVoice(); int revision = g.fwRev.get(g.profile[g.id()].fwType());
else if (revision > 0)
hideVoice(); ui->lastRevisionLbl->setText(QString("%1").arg(revision));
} }
void fwPreferencesDialog::showVoice() void FirmwarePreferencesDialog::on_checkFWUpdates_clicked()
{
ui->voiceLine->show();
ui->voiceLabel->show();
ui->voiceCombo->show();
ui->voice_dnld->show();
}
void fwPreferencesDialog::hideVoice()
{
ui->voiceLine->hide();
ui->voiceLabel->hide();
ui->voiceCombo->hide();
ui->voice_dnld->hide();
QTimer::singleShot(0, this, SLOT(shrink()));
}
void fwPreferencesDialog::shrink()
{
resize(0,0);
}
void fwPreferencesDialog::baseFirmwareChanged()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
voice=NULL;
foreach(FirmwareInfo * firmware, firmwares) {
if (firmware->id == selected_firmware) {
showVoice(firmware->voice);
populateFirmwareOptions(firmware);
break;
}
}
firmwareChanged();
}
FirmwareVariant fwPreferencesDialog::getFirmwareVariant()
{
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
bool voice=false;
foreach(FirmwareInfo * firmware, firmwares) {
if (firmware->id == selected_firmware) {
QString id = firmware->id;
foreach(QCheckBox *cb, optionsCheckBoxes) {
if (cb->isChecked()) {
if (cb->text()=="voice" && cb->isChecked())
voice=true;
id += QString("-") + cb->text();
}
}
if (! firmware->eepromInterface->getCapability(MultiLangVoice)) {
if (ui->voiceCombo->count() && (voice || firmware->voice))
id += QString("-tts") + ui->voiceCombo->currentText();
}
if (ui->langCombo->count())
id += QString("-") + ui->langCombo->currentText();
return GetFirmwareVariant(id);
}
}
// Should never occur...
return default_firmware_variant;
}
void fwPreferencesDialog::firmwareOptionChanged(bool state)
{
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
FirmwareInfo * firmware=NULL;
if (cb && state) {
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
foreach(firmware, firmwares) {
if (firmware->id == selected_firmware) {
foreach(QList<Option> opts, firmware->opts) {
foreach(Option opt, opts) {
if (cb->text() == opt.name) {
foreach(Option other, opts) {
if (other.name != opt.name) {
foreach(QCheckBox *ocb, optionsCheckBoxes) {
if (ocb->text() == other.name)
ocb->setChecked(false);
}
}
}
if (voice) {
showVoice(voice->isChecked());
}
return firmwareChanged();
}
}
}
}
}
} else if (cb && !state) {
if (cb->text()=="voice") {
hideVoice();
}
}
if (voice) {
showVoice(voice->isChecked());
} else if (firmware) {
if (firmware->voice) {
showVoice();
}
}
return firmwareChanged();
}
void fwPreferencesDialog::firmwareLangChanged()
{
firmwareChanged();
}
void fwPreferencesDialog::firmwareChanged()
{
if (updateLock)
return;
FirmwareVariant variant = getFirmwareVariant();
QString stamp;
stamp.append(variant.firmware->stamp);
ui->fw_dnld->setEnabled(!variant.firmware->getUrl(variant.id).isNull());
QString url=variant.firmware->getUrl(variant.id);
// B-Plan
if (false) {
ui->CPU_ID_LE->show();
ui->CPU_ID_LABEL->show();
} else {
ui->CPU_ID_LE->hide();
ui->CPU_ID_LABEL->hide();
}
int fwrev = g.fwRev.get(variant.id);
if (fwrev != 0) {
ui->FwInfo->setText(tr("Last downloaded release: %1").arg(fwrev));
if (!stamp.isEmpty()) {
ui->checkFWUpdates->show();
} else {
ui->checkFWUpdates->hide();
}
}
else {
if (ui->fw_dnld->isEnabled()) {
ui->FwInfo->setText(tr("The selected firmware has never been downloaded by Companion."));
ui->checkFWUpdates->hide();
}
else {
ui->FwInfo->setText(tr("The selected firmware cannot be downloaded by Companion."));
ui->checkFWUpdates->hide();
}
}
}
void fwPreferencesDialog::writeValues()
{
g.cpuId( ui->CPU_ID_LE->text() );
current_firmware_variant = getFirmwareVariant();
g.profile[g.id()].fwType( current_firmware_variant.id );
}
void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware)
{
const FirmwareInfo * parent = firmware->parent ? firmware->parent : firmware;
updateLock = true;
ui->langCombo->clear();
foreach(const char *lang, parent->languages) {
ui->langCombo->addItem(lang);
if (current_firmware_variant.id.endsWith(lang))
ui->langCombo->setCurrentIndex(ui->langCombo->count() - 1);
}
ui->voiceCombo->clear();
foreach(const char *lang, parent->ttslanguages) {
ui->voiceCombo->addItem(lang);
if (current_firmware_variant.id.contains(QString("-tts%1").arg(lang)))
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
}
showVoice(ui->langCombo->count()!=0);
int index = 0;
foreach(QList<Option> opts, parent->opts) {
foreach(Option opt, opts) {
if (index >= optionsCheckBoxes.size()) {
qDebug() << "This firmware needs more options checkboxes!";
}
else {
QCheckBox *cb = optionsCheckBoxes.at(index++);
if (cb) {
cb->show();
cb->setText(opt.name);
cb->setToolTip(opt.tooltip);
cb->setCheckState(current_firmware_variant.id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
if (opt.name==QString("voice")) {
voice=cb;
showVoice(current_firmware_variant.id.contains(opt.name) ||firmware->voice);
}
}
}
}
}
for (; index<optionsCheckBoxes.size(); index++) {
QCheckBox *cb = optionsCheckBoxes.at(index);
cb->hide();
cb->setCheckState(Qt::Unchecked);
}
updateLock = false;
QTimer::singleShot(0, this, SLOT(shrink()));
}
void fwPreferencesDialog::initSettings()
{
ui->CPU_ID_LE->setText(g.cpuId());
FirmwareInfo * current_firmware = GetCurrentFirmware();
foreach(FirmwareInfo * firmware, firmwares) {
ui->downloadVerCB->addItem(firmware->name, firmware->id);
if (current_firmware == firmware) {
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
}
}
baseFirmwareChanged();
firmwareChanged();
}
void fwPreferencesDialog::on_checkFWUpdates_clicked()
{
FirmwareVariant variant = getFirmwareVariant();
if (g.profile[g.id()].burnFirmware()) {
current_firmware_variant = variant;
g.profile[g.id()].fwType( variant.id );
}
MainWindow * mw = (MainWindow *)this->parent();
mw->checkForUpdates(true, variant.id);
firmwareChanged();
}
void fwPreferencesDialog::on_fw_dnld_clicked()
{ {
MainWindow * mw = (MainWindow *)this->parent(); MainWindow * mw = (MainWindow *)this->parent();
FirmwareVariant variant = getFirmwareVariant(); QString fwType = g.profile[g.id()].fwType();
writeValues(); mw->checkForUpdates(true, fwType);
if (!variant.firmware->getUrl(variant.id).isNull()) { initSettings();
if (g.profile[g.id()].burnFirmware()) {
current_firmware_variant = getFirmwareVariant();
g.profile[g.id()].fwType( current_firmware_variant.id );
}
mw->downloadLatestFW(current_firmware_variant.firmware, current_firmware_variant.id);
}
firmwareChanged();
} }
void fwPreferencesDialog::on_voice_dnld_clicked() void FirmwarePreferencesDialog::on_fw_dnld_clicked()
{
MainWindow * mw = (MainWindow *)this->parent();
mw->downloadLatestFW(current_firmware_variant);
initSettings();
}
void FirmwarePreferencesDialog::on_voice_dnld_clicked()
{ {
QString url="http://fw.opentx.it/voices/"; QString url="http://fw.opentx.it/voices/";
FirmwareVariant variant = getFirmwareVariant(); QString fwType = g.profile[g.id()].fwType();
url.append(QString("%1/%2/").arg(variant.firmware->id).arg(ui->voiceCombo->currentText())); QStringList list = fwType.split("-");
QString firmware = QString("%1-%2").arg(list[0]).arg(list[1]);
url.append(QString("%1/%2/").arg(firmware).arg(ui->voiceCombo->currentText()));
QDesktopServices::openUrl(url); QDesktopServices::openUrl(url);
} }
+8 -24
View File
@@ -6,40 +6,24 @@
#include "eeprominterface.h" #include "eeprominterface.h"
namespace Ui { namespace Ui {
class fwPreferencesDialog; class FirmwarePreferencesDialog;
} }
class Joystick; class Joystick;
class fwPreferencesDialog : public QDialog class FirmwarePreferencesDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit fwPreferencesDialog(QWidget *parent = 0); explicit FirmwarePreferencesDialog(QWidget *parent = 0);
~fwPreferencesDialog(); ~FirmwarePreferencesDialog();
private: private:
Ui::fwPreferencesDialog *ui; Ui::FirmwarePreferencesDialog *ui;
QList<QCheckBox *> optionsCheckBoxes;
bool updateLock;
void showVoice(bool);
void showVoice();
void hideVoice();
void populateLocale();
void populateFirmwareOptions(const FirmwareInfo *);
FirmwareVariant getFirmwareVariant();
void initSettings(); void initSettings();
QCheckBox * voice;
private slots: private slots:
void shrink();
void writeValues();
void firmwareLangChanged();
void baseFirmwareChanged();
void firmwareOptionChanged(bool state);
void firmwareChanged();
void on_fw_dnld_clicked(); void on_fw_dnld_clicked();
void on_voice_dnld_clicked(); void on_voice_dnld_clicked();
void on_checkFWUpdates_clicked(); void on_checkFWUpdates_clicked();
+110 -695
View File
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>fwPreferencesDialog</class> <class>FirmwarePreferencesDialog</class>
<widget class="QDialog" name="fwPreferencesDialog"> <widget class="QDialog" name="FirmwarePreferencesDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>620</width> <width>416</width>
<height>437</height> <height>153</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@@ -32,488 +32,13 @@
<property name="margin"> <property name="margin">
<number>6</number> <number>6</number>
</property> </property>
<item row="38" column="5"> <item row="24" column="5">
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="11" column="3">
<widget class="QCheckBox" name="optionCheckBox_14">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="15" column="5">
<widget class="QCheckBox" name="optionCheckBox_32">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="11" column="5">
<widget class="QCheckBox" name="optionCheckBox_16">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="langLabel">
<property name="text">
<string>Menu Language</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QCheckBox" name="optionCheckBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="17" column="2">
<widget class="QCheckBox" name="optionCheckBox_37">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="15" column="2">
<widget class="QCheckBox" name="optionCheckBox_29">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QCheckBox" name="optionCheckBox_1">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="10" column="5">
<widget class="QCheckBox" name="optionCheckBox_12">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="3">
<widget class="QComboBox" name="downloadVerCB">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QComboBox" name="langCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="5" column="2" colspan="3">
<widget class="QLineEdit" name="CPU_ID_LE"/>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Firmware Type</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="5">
<widget class="QCheckBox" name="optionCheckBox_4">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="14" column="5">
<widget class="QCheckBox" name="optionCheckBox_28">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="18" column="3">
<widget class="QCheckBox" name="optionCheckBox_42">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QCheckBox" name="optionCheckBox_5">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="12" column="2">
<widget class="QCheckBox" name="optionCheckBox_17">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="16" column="4">
<widget class="QCheckBox" name="optionCheckBox_35">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="16" column="5">
<widget class="QCheckBox" name="optionCheckBox_36">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="11" column="2">
<widget class="QCheckBox" name="optionCheckBox_13">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="14" column="3">
<widget class="QCheckBox" name="optionCheckBox_26">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="18" column="2">
<widget class="QCheckBox" name="optionCheckBox_41">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="12" column="3">
<widget class="QCheckBox" name="optionCheckBox_18">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="10" column="4">
<widget class="QCheckBox" name="optionCheckBox_11">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="13" column="2">
<widget class="QCheckBox" name="optionCheckBox_21">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="12" column="5">
<widget class="QCheckBox" name="optionCheckBox_20">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="16" column="2">
<widget class="QCheckBox" name="optionCheckBox_33">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="13" column="5">
<widget class="QCheckBox" name="optionCheckBox_24">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="13" column="4">
<widget class="QCheckBox" name="optionCheckBox_23">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="13" column="3">
<widget class="QCheckBox" name="optionCheckBox_22">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="9" column="3">
<widget class="QCheckBox" name="optionCheckBox_6">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="17" column="3">
<widget class="QCheckBox" name="optionCheckBox_38">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="16" column="3">
<widget class="QCheckBox" name="optionCheckBox_34">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="15" column="4">
<widget class="QCheckBox" name="optionCheckBox_31">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="15" column="3">
<widget class="QCheckBox" name="optionCheckBox_30">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="14" column="4">
<widget class="QCheckBox" name="optionCheckBox_27">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -530,7 +55,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="21" column="0"> <item row="7" column="0">
<widget class="QLabel" name="voiceLabel"> <widget class="QLabel" name="voiceLabel">
<property name="font"> <property name="font">
<font> <font>
@@ -540,11 +65,11 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Voice Language</string> <string>Voice</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="21" column="2"> <item row="7" column="2">
<widget class="QComboBox" name="voiceCombo"> <widget class="QComboBox" name="voiceCombo">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@@ -556,155 +81,119 @@
<string>Set language of voice. <string>Set language of voice.
May be different from firmware language</string> May be different from firmware language</string>
</property> </property>
<item>
<property name="text">
<string>en</string>
</property>
</item>
<item>
<property name="text">
<string>cz</string>
</property>
</item>
<item>
<property name="text">
<string>de</string>
</property>
</item>
<item>
<property name="text">
<string>es</string>
</property>
</item>
<item>
<property name="text">
<string>fr</string>
</property>
</item>
<item>
<property name="text">
<string>it</string>
</property>
</item>
<item>
<property name="text">
<string>pl</string>
</property>
</item>
<item>
<property name="text">
<string>pt</string>
</property>
</item>
<item>
<property name="text">
<string>se</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item row="21" column="5"> <item row="7" column="5">
<widget class="QPushButton" name="voice_dnld"> <widget class="QPushButton" name="voice_dnld">
<property name="text"> <property name="text">
<string>Download Voice</string> <string>Download Voice</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="2"> <item row="5" column="5">
<widget class="QCheckBox" name="optionCheckBox_9">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="10" column="3">
<widget class="QCheckBox" name="optionCheckBox_10">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="18" column="5">
<widget class="QPushButton" name="fw_dnld"> <widget class="QPushButton" name="fw_dnld">
<property name="text"> <property name="text">
<string>Download FW</string> <string>Download FW</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0" colspan="2"> <item row="7" column="3">
<widget class="QLabel" name="label_2"> <spacer name="horizontalSpacer_2">
<property name="text"> <property name="orientation">
<string>Options</string> <enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="0" colspan="6">
<widget class="Line" name="voiceLine">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="12" column="4"> <item row="23" column="0" colspan="6">
<widget class="QCheckBox" name="optionCheckBox_19"> <widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="font">
<font>
<family>Sans Serif</family>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text"> <property name="text">
<string notr="true">CheckBox</string> <string>Firmware</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="5"> <item row="0" column="2" colspan="4">
<widget class="QCheckBox" name="optionCheckBox_8"> <widget class="QLabel" name="fwTypeLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="14" column="2">
<widget class="QCheckBox" name="optionCheckBox_25">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="9" column="4">
<widget class="QCheckBox" name="optionCheckBox_7">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="11" column="4">
<widget class="QCheckBox" name="optionCheckBox_15">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="8" column="4">
<widget class="QCheckBox" name="optionCheckBox_3">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="CPU_ID_LABEL">
<property name="text">
<string>Processor ID</string>
</property>
</widget>
</item>
<item row="17" column="4">
<widget class="QCheckBox" name="optionCheckBox_39">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">CheckBox</string>
</property>
</widget>
</item>
<item row="4" column="2" colspan="4">
<widget class="QLabel" name="FwInfo">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -712,34 +201,21 @@ May be different from firmware language</string>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">FwInfo</string> <string notr="true">FwType</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="17" column="5"> <item row="3" column="2" colspan="2">
<widget class="QCheckBox" name="optionCheckBox_40"> <widget class="QLabel" name="lastRevisionLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string notr="true">CheckBox</string> <string>-</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="20" column="1" colspan="5"> <item row="3" column="0">
<widget class="Line" name="voiceLine"> <widget class="QLabel" name="label">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>Latest Download</string>
</property>
</widget>
</item>
<item row="37" column="1" colspan="5">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
@@ -747,51 +223,6 @@ May be different from firmware language</string>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>buttonBox</tabstop> <tabstop>buttonBox</tabstop>
<tabstop>downloadVerCB</tabstop>
<tabstop>CPU_ID_LE</tabstop>
<tabstop>langCombo</tabstop>
<tabstop>optionCheckBox_2</tabstop>
<tabstop>optionCheckBox_1</tabstop>
<tabstop>optionCheckBox_3</tabstop>
<tabstop>optionCheckBox_4</tabstop>
<tabstop>optionCheckBox_5</tabstop>
<tabstop>optionCheckBox_6</tabstop>
<tabstop>optionCheckBox_7</tabstop>
<tabstop>optionCheckBox_8</tabstop>
<tabstop>optionCheckBox_9</tabstop>
<tabstop>optionCheckBox_10</tabstop>
<tabstop>optionCheckBox_11</tabstop>
<tabstop>optionCheckBox_12</tabstop>
<tabstop>optionCheckBox_13</tabstop>
<tabstop>optionCheckBox_14</tabstop>
<tabstop>optionCheckBox_15</tabstop>
<tabstop>optionCheckBox_16</tabstop>
<tabstop>optionCheckBox_17</tabstop>
<tabstop>optionCheckBox_18</tabstop>
<tabstop>optionCheckBox_19</tabstop>
<tabstop>optionCheckBox_20</tabstop>
<tabstop>optionCheckBox_21</tabstop>
<tabstop>optionCheckBox_22</tabstop>
<tabstop>optionCheckBox_23</tabstop>
<tabstop>optionCheckBox_24</tabstop>
<tabstop>optionCheckBox_25</tabstop>
<tabstop>optionCheckBox_26</tabstop>
<tabstop>optionCheckBox_27</tabstop>
<tabstop>optionCheckBox_28</tabstop>
<tabstop>optionCheckBox_29</tabstop>
<tabstop>optionCheckBox_30</tabstop>
<tabstop>optionCheckBox_31</tabstop>
<tabstop>optionCheckBox_32</tabstop>
<tabstop>optionCheckBox_33</tabstop>
<tabstop>optionCheckBox_34</tabstop>
<tabstop>optionCheckBox_35</tabstop>
<tabstop>optionCheckBox_36</tabstop>
<tabstop>optionCheckBox_37</tabstop>
<tabstop>optionCheckBox_38</tabstop>
<tabstop>optionCheckBox_39</tabstop>
<tabstop>optionCheckBox_40</tabstop>
<tabstop>optionCheckBox_41</tabstop>
<tabstop>optionCheckBox_42</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="companion.qrc"/> <include location="companion.qrc"/>
@@ -800,32 +231,16 @@ May be different from firmware language</string>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>fwPreferencesDialog</receiver> <receiver>FirmwarePreferencesDialog</receiver>
<slot>accept()</slot> <slot>close()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>370</x> <x>345</x>
<y>49</y> <y>133</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>157</x> <x>207</x>
<y>274</y> <y>76</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>fwPreferencesDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>390</x>
<y>55</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
+22 -22
View File
@@ -83,7 +83,7 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
switchDefPosEditLock=true; switchDefPosEditLock=true;
populateBacklightCB(ui->backlightswCB, g_eeGeneral.backlightMode); populateBacklightCB(ui->backlightswCB, g_eeGeneral.backlightMode);
bool voice = current_firmware_variant.id.contains("voice"); bool voice = current_firmware_variant.id.contains("voice");
if (!GetEepromInterface()->getCapability(MultiLangVoice)) { if (!GetCurrentFirmware()->getCapability(MultiLangVoice)) {
ui->VoiceLang_label->hide(); ui->VoiceLang_label->hide();
ui->voiceLang_CB->hide(); ui->voiceLang_CB->hide();
} else { } else {
@@ -102,11 +102,11 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
mavbaudEditLock=false; mavbaudEditLock=false;
} }
if (!GetEepromInterface()->getCapability(HasContrast)) { if (!GetCurrentFirmware()->getCapability(HasContrast)) {
ui->contrastSB->hide(); ui->contrastSB->hide();
ui->label_contrast->hide(); ui->label_contrast->hide();
} }
if (!GetEepromInterface()->getCapability(HasSoundMixer)) { if (!GetCurrentFirmware()->getCapability(HasSoundMixer)) {
ui->beepVolume_SL->hide(); ui->beepVolume_SL->hide();
ui->beepVolume_label->hide(); ui->beepVolume_label->hide();
ui->varioVolume_SL->hide(); ui->varioVolume_SL->hide();
@@ -131,28 +131,28 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->varioPMax_SB->setValue(700+(g_eeGeneral.varioPitch*10)+1000+(g_eeGeneral.varioRange*10)); ui->varioPMax_SB->setValue(700+(g_eeGeneral.varioPitch*10)+1000+(g_eeGeneral.varioRange*10));
ui->varioR0_SB->setValue(500+(g_eeGeneral.varioRepeat*10)); ui->varioR0_SB->setValue(500+(g_eeGeneral.varioRepeat*10));
} }
if (!GetEepromInterface()->getCapability(HasFAIMode)) { if (!GetCurrentFirmware()->getCapability(HasFAIMode)) {
ui->faimode_CB->hide(); ui->faimode_CB->hide();
ui->label_faimode->hide(); ui->label_faimode->hide();
} }
else { else {
ui->faimode_CB->setChecked(g_eeGeneral.fai); ui->faimode_CB->setChecked(g_eeGeneral.fai);
} }
if (!GetEepromInterface()->getCapability( HasPxxCountry)) { if (!GetCurrentFirmware()->getCapability( HasPxxCountry)) {
ui->countrycode_label->hide(); ui->countrycode_label->hide();
ui->countrycode_CB->hide(); ui->countrycode_CB->hide();
layout()->removeItem(ui->pxxCountry); layout()->removeItem(ui->pxxCountry);
} else { } else {
ui->countrycode_CB->setCurrentIndex(g_eeGeneral.countryCode); ui->countrycode_CB->setCurrentIndex(g_eeGeneral.countryCode);
} }
if (!GetEepromInterface()->getCapability( HasGeneralUnits)) { if (!GetCurrentFirmware()->getCapability( HasGeneralUnits)) {
ui->units_label->hide(); ui->units_label->hide();
ui->units_CB->hide(); ui->units_CB->hide();
} else { } else {
ui->units_CB->setCurrentIndex(g_eeGeneral.imperial); ui->units_CB->setCurrentIndex(g_eeGeneral.imperial);
} }
if (!GetEepromInterface()->getCapability(TelemetryTimeshift)) { if (!GetCurrentFirmware()->getCapability(TelemetryTimeshift)) {
ui->label_timezone->hide(); ui->label_timezone->hide();
ui->timezoneSB->hide(); ui->timezoneSB->hide();
ui->timezoneSB->setDisabled(true); ui->timezoneSB->setDisabled(true);
@@ -162,24 +162,24 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->gpsFormatCB->setCurrentIndex(g_eeGeneral.gpsFormat); ui->gpsFormatCB->setCurrentIndex(g_eeGeneral.gpsFormat);
ui->timezoneSB->setValue(g_eeGeneral.timezone); ui->timezoneSB->setValue(g_eeGeneral.timezone);
if (!GetEepromInterface()->getCapability(OptrexDisplay)) { if (!GetCurrentFirmware()->getCapability(OptrexDisplay)) {
ui->label_displayType->hide(); ui->label_displayType->hide();
ui->displayTypeCB->setDisabled(true); ui->displayTypeCB->setDisabled(true);
ui->displayTypeCB->hide(); ui->displayTypeCB->hide();
} }
if (!GetEepromInterface()->getCapability(HasVolume) && !voice) { if (!GetCurrentFirmware()->getCapability(HasVolume) && !voice) {
ui->volume_SB->hide(); ui->volume_SB->hide();
ui->volume_SB->setDisabled(true); ui->volume_SB->setDisabled(true);
ui->label_volume->hide(); ui->label_volume->hide();
} else { } else {
ui->volume_SB->setMaximum(GetEepromInterface()->getCapability(MaxVolume)); ui->volume_SB->setMaximum(GetCurrentFirmware()->getCapability(MaxVolume));
} }
if (!GetEepromInterface()->getCapability(HasBrightness)) { if (!GetCurrentFirmware()->getCapability(HasBrightness)) {
ui->BLBright_SB->hide(); ui->BLBright_SB->hide();
ui->BLBright_SB->setDisabled(true); ui->BLBright_SB->setDisabled(true);
ui->label_BLBright->hide(); ui->label_BLBright->hide();
} }
if (!GetEepromInterface()->getCapability(HasCurrentCalibration)) { if (!GetCurrentFirmware()->getCapability(HasCurrentCalibration)) {
ui->CurrentCalib_SB->hide(); ui->CurrentCalib_SB->hide();
ui->CurrentCalib_SB->setDisabled(true); ui->CurrentCalib_SB->setDisabled(true);
ui->label_CurrentCalib->hide(); ui->label_CurrentCalib->hide();
@@ -187,31 +187,31 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->tabWidget->setCurrentIndex(0); ui->tabWidget->setCurrentIndex(0);
if (!GetEepromInterface()->getCapability(SoundMod)) { if (!GetCurrentFirmware()->getCapability(SoundMod)) {
ui->soundModeCB->setDisabled(true); ui->soundModeCB->setDisabled(true);
ui->label_soundMode->hide(); ui->label_soundMode->hide();
ui->soundModeCB->hide(); ui->soundModeCB->hide();
} }
if (!GetEepromInterface()->getCapability(SoundPitch)) { if (!GetCurrentFirmware()->getCapability(SoundPitch)) {
ui->speakerPitchSB->setDisabled(true); ui->speakerPitchSB->setDisabled(true);
ui->label_speakerPitch->hide(); ui->label_speakerPitch->hide();
ui->speakerPitchSB->hide(); ui->speakerPitchSB->hide();
} }
if (!GetEepromInterface()->getCapability(Haptic)) { if (!GetCurrentFirmware()->getCapability(Haptic)) {
ui->hapticStrengthSB->setDisabled(true); ui->hapticStrengthSB->setDisabled(true);
ui->hapticStrengthSB->hide(); ui->hapticStrengthSB->hide();
ui->label_hapticStrengthSB->hide(); ui->label_hapticStrengthSB->hide();
} }
if (!GetEepromInterface()->getCapability(HapticMode)) { if (!GetCurrentFirmware()->getCapability(HapticMode)) {
ui->hapticmodeCB->setDisabled(true); ui->hapticmodeCB->setDisabled(true);
ui->hapticmodeCB->hide(); ui->hapticmodeCB->hide();
ui->label_hapticmode->hide(); ui->label_hapticmode->hide();
} }
int renumber=GetEepromInterface()->getCapability(RotaryEncoders); int renumber=GetCurrentFirmware()->getCapability(RotaryEncoders);
if (renumber==0) { if (renumber==0) {
ui->re_label->hide(); ui->re_label->hide();
ui->re_CB->hide(); ui->re_CB->hide();
@@ -247,7 +247,7 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->trnMode_4->setCurrentIndex(g_eeGeneral.trainer.mix[3].mode); ui->trnMode_4->setCurrentIndex(g_eeGeneral.trainer.mix[3].mode);
ui->trnChn_4->setCurrentIndex(g_eeGeneral.trainer.mix[3].src); ui->trnChn_4->setCurrentIndex(g_eeGeneral.trainer.mix[3].src);
ui->trnWeight_4->setValue(g_eeGeneral.trainer.mix[3].weight); ui->trnWeight_4->setValue(g_eeGeneral.trainer.mix[3].weight);
int potsnum=GetEepromInterface()->getCapability(Pots); int potsnum=GetCurrentFirmware()->getCapability(Pots);
if (potsnum==3) { if (potsnum==3) {
ui->label_pot4->hide(); ui->label_pot4->hide();
ui->ana8Neg->hide(); ui->ana8Neg->hide();
@@ -261,7 +261,7 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
connect(tpmsld[i], SIGNAL(valueChanged(int)),this,SLOT(unlockSwitchEdited())); connect(tpmsld[i], SIGNAL(valueChanged(int)),this,SLOT(unlockSwitchEdited()));
} }
if (GetEepromInterface()->getCapability(MultiposPots)) { if (GetCurrentFirmware()->getCapability(MultiposPots)) {
ui->pot1Type->setCurrentIndex(g_eeGeneral.potsType[0]); ui->pot1Type->setCurrentIndex(g_eeGeneral.potsType[0]);
ui->pot2Type->setCurrentIndex(g_eeGeneral.potsType[1]); ui->pot2Type->setCurrentIndex(g_eeGeneral.potsType[1]);
ui->pot3Type->setCurrentIndex(g_eeGeneral.potsType[2]); ui->pot3Type->setCurrentIndex(g_eeGeneral.potsType[2]);
@@ -334,7 +334,7 @@ void GeneralEdit::setValues()
ui->beeperCB->setCurrentIndex(g_eeGeneral.beeperMode+2); ui->beeperCB->setCurrentIndex(g_eeGeneral.beeperMode+2);
ui->channelorderCB->setCurrentIndex(g_eeGeneral.templateSetup); ui->channelorderCB->setCurrentIndex(g_eeGeneral.templateSetup);
ui->stickmodeCB->setCurrentIndex(g_eeGeneral.stickMode); ui->stickmodeCB->setCurrentIndex(g_eeGeneral.stickMode);
if (!GetEepromInterface()->getCapability(HapticLength)) { if (!GetCurrentFirmware()->getCapability(HapticLength)) {
ui->label_HL->hide(); ui->label_HL->hide();
ui->hapticLengthCB->hide(); ui->hapticLengthCB->hide();
} else { } else {
@@ -911,7 +911,7 @@ void GeneralEdit::on_calretrieve_PB_clicked()
{ {
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt(); int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString calib=g.profile[profile_id].stickPotCalib(); QString calib=g.profile[profile_id].stickPotCalib();
int potsnum=GetEepromInterface()->getCapability(Pots); int potsnum=GetCurrentFirmware()->getCapability(Pots);
if (calib.isEmpty()) { if (calib.isEmpty()) {
return; return;
} else { } else {
@@ -1021,7 +1021,7 @@ void GeneralEdit::on_calstore_PB_clicked()
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt(); int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString name=g.profile[profile_id].name(); QString name=g.profile[profile_id].name();
int potsnum=GetEepromInterface()->getCapability(Pots); int potsnum=GetCurrentFirmware()->getCapability(Pots);
if (name.isEmpty()) { if (name.isEmpty()) {
ui->calstore_PB->setDisabled(true); ui->calstore_PB->setDisabled(true);
return; return;
+34 -58
View File
@@ -62,7 +62,7 @@ QString getInputStr(ModelData & model, int index)
{ {
QString result; QString result;
if (GetEepromInterface()->getCapability(VirtualInputs)) { if (GetCurrentFirmware()->getCapability(VirtualInputs)) {
result = model.inputNames[index]; result = model.inputNames[index];
if (result.isEmpty()) { if (result.isEmpty()) {
result = QObject::tr("Input%1").arg(index+1, 2, 10, QChar('0')); result = QObject::tr("Input%1").arg(index+1, 2, 10, QChar('0'));
@@ -126,7 +126,7 @@ QString getProtocolStr(const int proto)
void populatePhasesCB(QComboBox *b, int value) void populatePhasesCB(QComboBox *b, int value)
{ {
for (int i=-GetEepromInterface()->getCapability(FlightPhases); i<=GetEepromInterface()->getCapability(FlightPhases); i++) { for (int i=-GetCurrentFirmware()->getCapability(FlightPhases); i<=GetCurrentFirmware()->getCapability(FlightPhases); i++) {
if (i < 0) if (i < 0)
b->addItem(QObject::tr("!Flight mode %1").arg(-i-1), i); b->addItem(QObject::tr("!Flight mode %1").arg(-i-1), i);
else if (i > 0) else if (i > 0)
@@ -134,13 +134,13 @@ void populatePhasesCB(QComboBox *b, int value)
else else
b->addItem(QObject::tr("----"), 0); b->addItem(QObject::tr("----"), 0);
} }
b->setCurrentIndex(value + GetEepromInterface()->getCapability(FlightPhases)); b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightPhases));
} }
bool gvarsEnabled() bool gvarsEnabled()
{ {
int gvars=0; int gvars=0;
if (GetEepromInterface()->getCapability(HasVariants)) { if (GetCurrentFirmware()->getCapability(HasVariants)) {
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) { if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
gvars=1; gvars=1;
} }
@@ -278,7 +278,7 @@ void CurveGroup::update()
break; break;
case CurveReference::CURVE_REF_CUSTOM: case CurveReference::CURVE_REF_CUSTOM:
{ {
int numcurves = GetEepromInterface()->getCapability(NumCurves); int numcurves = GetCurrentFirmware()->getCapability(NumCurves);
if (lastType != curve.type) { if (lastType != curve.type) {
lastType = curve.type; lastType = curve.type;
curveValueCB->clear(); curveValueCB->clear();
@@ -330,7 +330,7 @@ void CurveGroup::valuesChanged()
curve = CurveReference(CurveReference::CURVE_REF_FUNC, curveValueCB->currentIndex()); curve = CurveReference(CurveReference::CURVE_REF_FUNC, curveValueCB->currentIndex());
break; break;
case 3: case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetEepromInterface()->getCapability(NumCurves)); curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetCurrentFirmware()->getCapability(NumCurves));
break; break;
} }
@@ -341,7 +341,7 @@ void CurveGroup::valuesChanged()
void populateGvarUseCB(QComboBox *b, unsigned int phase) void populateGvarUseCB(QComboBox *b, unsigned int phase)
{ {
b->addItem(QObject::tr("Own value")); b->addItem(QObject::tr("Own value"));
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(FlightPhases); i++) {
if (i != (int)phase) { if (i != (int)phase) {
b->addItem(QObject::tr("Flight mode %1 value").arg(i)); b->addItem(QObject::tr("Flight mode %1 value").arg(i));
} }
@@ -376,7 +376,7 @@ void populateAndSwitchCB(QComboBox *b, const RawSwitch & value)
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
for (int i=1; i<=GetEepromInterface()->getCapability(SwitchesPositions); i++) { for (int i=1; i<=GetCurrentFirmware()->getCapability(SwitchesPositions); i++) {
item = RawSwitch(SWITCH_TYPE_SWITCH, i); item = RawSwitch(SWITCH_TYPE_SWITCH, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
@@ -402,13 +402,13 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
} }
for (int i=-GetEepromInterface()->getCapability(LogicalSwitches); i<0; i++) { for (int i=-GetCurrentFirmware()->getCapability(LogicalSwitches); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i); item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
} }
for (int i=-GetEepromInterface()->getCapability(RotaryEncoders); i<0; i++) { for (int i=-GetCurrentFirmware()->getCapability(RotaryEncoders); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_ROTARY_ENCODER, i); item = RawSwitch(SWITCH_TYPE_ROTARY_ENCODER, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
@@ -420,17 +420,17 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
} }
for (int i=GetEepromInterface()->getCapability(MultiposPots)-1; i>=0; i--) { for (int i=GetCurrentFirmware()->getCapability(MultiposPots)-1; i>=0; i--) {
if (generalSettings.potsType[i] == 2/* TODO constant*/) { if (generalSettings.potsType[i] == 2/* TODO constant*/) {
for (int j=-GetEepromInterface()->getCapability(MultiposPotsPositions); j<0; j++) { for (int j=-GetCurrentFirmware()->getCapability(MultiposPotsPositions); j<0; j++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i*GetEepromInterface()->getCapability(MultiposPotsPositions)+j); item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i*GetCurrentFirmware()->getCapability(MultiposPotsPositions)+j);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
} }
} }
} }
for (int i=-GetEepromInterface()->getCapability(SwitchesPositions); i<0; i++) { for (int i=-GetCurrentFirmware()->getCapability(SwitchesPositions); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_SWITCH, i); item = RawSwitch(SWITCH_TYPE_SWITCH, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
@@ -449,16 +449,16 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
} }
for (int i=1; i<=GetEepromInterface()->getCapability(SwitchesPositions); i++) { for (int i=1; i<=GetCurrentFirmware()->getCapability(SwitchesPositions); i++) {
item = RawSwitch(SWITCH_TYPE_SWITCH, i); item = RawSwitch(SWITCH_TYPE_SWITCH, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
} }
for (int i=0; i<GetEepromInterface()->getCapability(MultiposPots); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(MultiposPots); i++) {
if (generalSettings.potsType[i] == 2/* TODO constant*/) { if (generalSettings.potsType[i] == 2/* TODO constant*/) {
for (int j=1; j<=GetEepromInterface()->getCapability(MultiposPotsPositions); j++) { for (int j=1; j<=GetCurrentFirmware()->getCapability(MultiposPotsPositions); j++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i*GetEepromInterface()->getCapability(MultiposPotsPositions)+j); item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i*GetCurrentFirmware()->getCapability(MultiposPotsPositions)+j);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
} }
@@ -471,13 +471,13 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
} }
for (int i=1; i<=GetEepromInterface()->getCapability(RotaryEncoders); i++) { for (int i=1; i<=GetCurrentFirmware()->getCapability(RotaryEncoders); i++) {
item = RawSwitch(SWITCH_TYPE_ROTARY_ENCODER, i); item = RawSwitch(SWITCH_TYPE_ROTARY_ENCODER, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
} }
for (int i=1; i<=GetEepromInterface()->getCapability(LogicalSwitches); i++) { for (int i=1; i<=GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i); item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1); if (item == value) b->setCurrentIndex(b->count()-1);
@@ -499,7 +499,7 @@ void populateGVCB(QComboBox *b, int value)
b->clear(); b->clear();
int pgvars = GetEepromInterface()->getCapability(Gvars); int pgvars = GetCurrentFirmware()->getCapability(Gvars);
for (int i=-pgvars; i<=-1; i++) { for (int i=-pgvars; i<=-1; i++) {
int16_t gval = (int16_t)(-10000+i); int16_t gval = (int16_t)(-10000+i);
b->addItem(QObject::tr("-GV%1").arg(-i), gval); b->addItem(QObject::tr("-GV%1").arg(-i), gval);
@@ -543,7 +543,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
} }
if (flags & POPULATE_VIRTUAL_INPUTS) { if (flags & POPULATE_VIRTUAL_INPUTS) {
int virtualInputs = GetEepromInterface()->getCapability(VirtualInputs); int virtualInputs = GetCurrentFirmware()->getCapability(VirtualInputs);
for (int i=0; i<virtualInputs; i++) { for (int i=0; i<virtualInputs; i++) {
item = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i, &model); item = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i, &model);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
@@ -552,12 +552,12 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
} }
if (flags & POPULATE_SOURCES) { if (flags & POPULATE_SOURCES) {
for (int i=0; i<4+GetEepromInterface()->getCapability(Pots); i++) { for (int i=0; i<4+GetCurrentFirmware()->getCapability(Pots); i++) {
item = RawSource(SOURCE_TYPE_STICK, i); item = RawSource(SOURCE_TYPE_STICK, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1); if (item == source) b->setCurrentIndex(b->count()-1);
} }
for (int i=0; i<GetEepromInterface()->getCapability(RotaryEncoders); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(RotaryEncoders); i++) {
item = RawSource(SOURCE_TYPE_ROTARY_ENCODER, i); item = RawSource(SOURCE_TYPE_ROTARY_ENCODER, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1); if (item == source) b->setCurrentIndex(b->count()-1);
@@ -579,13 +579,13 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
} }
if (flags & POPULATE_SWITCHES) { if (flags & POPULATE_SWITCHES) {
for (int i=0; i<GetEepromInterface()->getCapability(Switches); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(Switches); i++) {
item = RawSource(SOURCE_TYPE_SWITCH, i); item = RawSource(SOURCE_TYPE_SWITCH, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1); if (item == source) b->setCurrentIndex(b->count()-1);
} }
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
item = RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i); item = RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1); if (item == source) b->setCurrentIndex(b->count()-1);
@@ -599,13 +599,13 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
if (item == source) b->setCurrentIndex(b->count()-1); if (item == source) b->setCurrentIndex(b->count()-1);
} }
for (int i=0; i<GetEepromInterface()->getCapability(TrainerInputs); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(TrainerInputs); i++) {
item = RawSource(SOURCE_TYPE_PPM, i); item = RawSource(SOURCE_TYPE_PPM, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1); if (item == source) b->setCurrentIndex(b->count()-1);
} }
for (int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(Outputs); i++) {
item = RawSource(SOURCE_TYPE_CH, i); item = RawSource(SOURCE_TYPE_CH, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1); if (item == source) b->setCurrentIndex(b->count()-1);
@@ -628,7 +628,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
} }
if (flags & POPULATE_GVARS) { if (flags & POPULATE_GVARS) {
for (int i=0; i<GetEepromInterface()->getCapability(Gvars); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(Gvars); i++) {
item = RawSource(SOURCE_TYPE_GVAR, i); item = RawSource(SOURCE_TYPE_GVAR, i);
b->addItem(item.toString(), item.toValue()); b->addItem(item.toString(), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1); if (item == source) b->setCurrentIndex(b->count()-1);
@@ -775,7 +775,7 @@ QString getFrSkyProtocol(int protocol)
{ {
switch(protocol) { switch(protocol) {
case 2: case 2:
if ((GetEepromInterface()->getCapability(Telemetry) & TM_HASWSHH)) if ((GetCurrentFirmware()->getCapability(Telemetry) & TM_HASWSHH))
return QObject::tr("Winged Shadow How High"); return QObject::tr("Winged Shadow How High");
else else
return QObject::tr("Winged Shadow How High (not supported)"); return QObject::tr("Winged Shadow How High (not supported)");
@@ -830,7 +830,7 @@ QString getProtocol(ModelData * g_model)
QString getPhasesStr(unsigned int phases, ModelData & model) QString getPhasesStr(unsigned int phases, ModelData & model)
{ {
int numphases = GetEepromInterface()->getCapability(FlightPhases); int numphases = GetCurrentFirmware()->getCapability(FlightPhases);
if (numphases && phases) { if (numphases && phases) {
QString str; QString str;
@@ -906,7 +906,7 @@ CompanionIcon::CompanionIcon(QString baseimage)
void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx) void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
{ {
SimulatorInterface * si = GetEepromInterface()->getSimulator(); SimulatorInterface * si = GetCurrentFirmware()->getSimulator();
if (si) { if (si) {
delete si; delete si;
RadioData * simuData = new RadioData(radioData); RadioData * simuData = new RadioData(radioData);
@@ -918,14 +918,14 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
if (radioData.generalSettings.stickMode & 1) { if (radioData.generalSettings.stickMode & 1) {
flags |= SIMULATOR_FLAGS_STICK_MODE_LEFT; flags |= SIMULATOR_FLAGS_STICK_MODE_LEFT;
} }
BoardEnum board = GetEepromInterface()->getBoard(); BoardEnum board = GetCurrentFirmware()->getBoard();
SimulatorDialog * sd; SimulatorDialog * sd;
if (IS_TARANIS(board)) if (IS_TARANIS(board))
sd = new SimulatorDialogTaranis(parent, flags); sd = new SimulatorDialogTaranis(parent, flags);
else else
sd = new SimulatorDialog9X(parent, flags); sd = new SimulatorDialog9X(parent, flags);
QByteArray eeprom(GetEepromInterface()->getEEpromSize(), 0); QByteArray eeprom(GetEepromInterface()->getEEpromSize(), 0);
GetEepromInterface()->save((uint8_t *)eeprom.data(), *simuData, GetEepromInterface()->getCapability(SimulatorVariant)); GetEepromInterface()->save((uint8_t *)eeprom.data(), *simuData, GetCurrentFirmware()->getCapability(SimulatorVariant));
delete simuData; delete simuData;
sd->start(eeprom); sd->start(eeprom);
sd->exec(); sd->exec();
@@ -958,27 +958,3 @@ QPixmap makePixMap( QImage image, QString firmwareType )
} }
return(QPixmap::fromImage(image)); return(QPixmap::fromImage(image));
} }
int getRadioType(QString firmwareType)
{
if (firmwareType.contains( "taranis" )) return 6;
if (firmwareType.contains( "sky9x" )) return 5;
if (firmwareType.contains( "gruvin9x")) return 4;
if (firmwareType.contains( "9xr128" )) return 3;
if (firmwareType.contains( "9xr" )) return 2;
if (firmwareType.contains( "9x128" )) return 1;
return 0; // 9x
}
QString getDefaultFwType( int radioType )
{
switch (radioType){
case 6: return "opentx-taranis-en";
case 5: return "opentx-sky9x-en";
case 4: return "opentx-gruvin9x-en";
case 3: return "opentx-9xr128-en";
case 2: return "opentx-9xr-en";
case 1: return "opentx-9x128-en";
default: return "opentx-9x-en";
}
}
+1 -7
View File
@@ -6,7 +6,7 @@
extern const QColor colors[C9X_MAX_CURVES]; extern const QColor colors[C9X_MAX_CURVES];
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetEepromInterface()->getCapability(LogicalSwitches)-1) #define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetCurrentFirmware()->getCapability(LogicalSwitches)-1)
//convert from mode 1 to mode generalSettings.stickMode //convert from mode 1 to mode generalSettings.stickMode
//NOTICE! => 1..4 -> 1..4 //NOTICE! => 1..4 -> 1..4
@@ -128,10 +128,4 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx);
// Format a pixmap to fit on the radio using a specific firmware // Format a pixmap to fit on the radio using a specific firmware
QPixmap makePixMap( QImage image, QString firmwareType ); QPixmap makePixMap( QImage image, QString firmwareType );
// Return a radio type derived from a firmware type string
int getRadioType(QString firmwareType);
// Return the default firmware string for a specified radio
QString getDefaultFwType( int radioType );
#endif // HELPERS_H #endif // HELPERS_H
+30 -30
View File
@@ -198,7 +198,7 @@ void MainWindow::checkForUpdates(bool ignoreSettings, QString & fwId)
check1done = true; check1done = true;
check2done = true; check2done = true;
fwToUpdate = fwId; fwToUpdate = fwId;
QString stamp = GetFirmware(fwToUpdate)->stamp; QString stamp = GetFirmware(fwToUpdate)->getStampUrl();
if (!stamp.isEmpty()) { if (!stamp.isEmpty()) {
if (g.autoCheckFw() || ignoreSettings) { if (g.autoCheckFw() || ignoreSettings) {
@@ -299,15 +299,15 @@ void MainWindow::updateDownloaded()
} }
} }
void MainWindow::downloadLatestFW(FirmwareInfo * firmware, const QString & firmwareId) void MainWindow::downloadLatestFW(FirmwareVariant & firmware)
{ {
QString url, ext, cpuid; QString url, ext, cpuid;
url = firmware->getUrl(firmwareId); url = firmware.getFirmwareUrl();
cpuid=g.cpuId(); cpuid=g.cpuId();
ext = url.mid(url.lastIndexOf(".")); ext = url.mid(url.lastIndexOf("."));
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.flashDir() + "/" + firmwareId + ext); QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.flashDir() + "/" + firmware.id + ext);
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
downloadedFW = firmwareId; downloadedFW = firmware.id;
needRename=true; needRename=true;
g.profile[g.id()].fwName( fileName ); g.profile[g.id()].fwName( fileName );
if (!cpuid.isEmpty()) { if (!cpuid.isEmpty()) {
@@ -468,7 +468,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount()); layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
if (OldFwRev == 0) { if (OldFwRev == 0) {
showcheckForUpdatesResult = false; // update is available - do not show dialog showcheckForUpdatesResult = false; // update is available - do not show dialog
QString rn = GetFirmware(fwToUpdate)->rnurl; QString rn = GetFirmware(fwToUpdate)->getReleaseNotesUrl();
QAbstractButton *rnButton = NULL; QAbstractButton *rnButton = NULL;
msgBox.setWindowTitle("Companion"); msgBox.setWindowTitle("Companion");
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nVersion %2 is available.\nDo you want to download it now ?").arg(fwToUpdate).arg(NewFwRev)); msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nVersion %2 is available.\nDo you want to download it now ?").arg(fwToUpdate).arg(NewFwRev));
@@ -495,9 +495,10 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
} else { } else {
ignore = true; ignore = true;
} }
} else if (NewFwRev > OldFwRev) { }
else if (NewFwRev > OldFwRev) {
showcheckForUpdatesResult = false; // update is available - do not show dialog showcheckForUpdatesResult = false; // update is available - do not show dialog
QString rn = GetFirmware(fwToUpdate)->rnurl; QString rn = GetFirmware(fwToUpdate)->getReleaseNotesUrl();
QAbstractButton *rnButton; QAbstractButton *rnButton;
msgBox.setText("Companion"); msgBox.setText("Companion");
msgBox.setInformativeText(tr("A new version of %1 firmware is available (current %2 - newer %3).\nDo you want to download it now ?").arg(fwToUpdate).arg(OldFwRev).arg(NewFwRev)); msgBox.setInformativeText(tr("A new version of %1 firmware is available (current %2 - newer %3).\nDo you want to download it now ?").arg(fwToUpdate).arg(OldFwRev).arg(NewFwRev));
@@ -536,7 +537,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
} }
} else if (download == true) { } else if (download == true) {
if (warning>0) { if (warning>0) {
QString rn = GetFirmware(fwToUpdate)->rnurl; QString rn = GetFirmware(fwToUpdate)->getReleaseNotesUrl();
if (!rn.isEmpty()) { if (!rn.isEmpty()) {
int ret2 = QMessageBox::warning(this, "Companion", tr("Release notes contain very important informations. Do you want to see them now ?"), QMessageBox::Yes | QMessageBox::No); int ret2 = QMessageBox::warning(this, "Companion", tr("Release notes contain very important informations. Do you want to see them now ?"), QMessageBox::Yes | QMessageBox::No);
if (ret2 == QMessageBox::Yes) { if (ret2 == QMessageBox::Yes) {
@@ -546,7 +547,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
} }
} }
downloadedFW = fwToUpdate; downloadedFW = fwToUpdate;
QString url = GetFirmware(fwToUpdate)->getUrl(fwToUpdate); QString url = GetFirmwareVariant(fwToUpdate).getFirmwareUrl();
QString ext = url.mid(url.lastIndexOf(".")); QString ext = url.mid(url.lastIndexOf("."));
needRename=false; needRename=false;
bool addversion=g.profile[g.id()].renameFwFiles(); bool addversion=g.profile[g.id()].renameFwFiles();
@@ -716,14 +717,14 @@ void MainWindow::loadProfile() //TODO Load all variables - Also HW!
void MainWindow::appPrefs() void MainWindow::appPrefs()
{ {
appPreferencesDialog *pd = new appPreferencesDialog(this); AppPreferencesDialog *pd = new AppPreferencesDialog(this);
pd->exec(); pd->exec();
updateMenus(); updateMenus();
} }
void MainWindow::fwPrefs() void MainWindow::fwPrefs()
{ {
fwPreferencesDialog *pd = new fwPreferencesDialog(this); FirmwarePreferencesDialog *pd = new FirmwarePreferencesDialog(this);
pd->exec(); pd->exec();
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) { foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget()); MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
@@ -746,11 +747,12 @@ void MainWindow::changelog()
void MainWindow::fwchangelog() void MainWindow::fwchangelog()
{ {
FirmwareInfo *currfirm = GetCurrentFirmware(); FirmwareInterface *currfirm = GetCurrentFirmware();
QString rn=currfirm->rnurl; QString rn=currfirm->getReleaseNotesUrl();
if (rn.isEmpty()) { if (rn.isEmpty()) {
QMessageBox::information(this, tr("Firmware updates"), tr("Current firmware does not provide release notes informations.")); QMessageBox::information(this, tr("Firmware updates"), tr("Current firmware does not provide release notes informations."));
} else { }
else {
contributorsDialog *cd = new contributorsDialog(this,2, rn); contributorsDialog *cd = new contributorsDialog(this,2, rn);
cd->exec(); cd->exec();
} }
@@ -1257,7 +1259,7 @@ bool MainWindow::isValidEEPROM(QString eepromfile)
bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString flashFile) bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString flashFile)
{ {
FirmwareInfo *firmware = GetCurrentFirmware(); FirmwareInterface *firmware = GetCurrentFirmware();
FlashInterface flash(flashFile); FlashInterface flash(flashFile);
if (!flash.isValid()) if (!flash.isValid())
return false; return false;
@@ -1290,9 +1292,6 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString
version = fwEEprom.toInt(); version = fwEEprom.toInt();
} }
} }
else {
version = ((Open9xFirmware *)firmware)->getEepromVersion(revision);
}
} }
QFile file(backupFile); QFile file(backupFile);
@@ -1490,8 +1489,9 @@ void MainWindow::burnFuses()
void MainWindow::compare() void MainWindow::compare()
{ {
compareDialog *fd = new compareDialog(this); CompareDialog *fd = new CompareDialog(this);
fd->show(); fd->show();
delete fd;
} }
void MainWindow::logFile() void MainWindow::logFile()
@@ -1546,17 +1546,17 @@ void MainWindow::updateMenus()
MdiChild *MainWindow::createMdiChild() MdiChild *MainWindow::createMdiChild()
{ {
MdiChild *child = new MdiChild; MdiChild *child = new MdiChild();
mdiArea->addSubWindow(child); mdiArea->addSubWindow(child);
if(!child->parentWidget()->isMaximized() && !child->parentWidget()->isMinimized()) if(!child->parentWidget()->isMaximized() && !child->parentWidget()->isMinimized())
child->parentWidget()->resize(400, 400); child->parentWidget()->resize(400, 400);
connect(child, SIGNAL(copyAvailable(bool)),cutAct, SLOT(setEnabled(bool))); connect(child, SIGNAL(copyAvailable(bool)),cutAct, SLOT(setEnabled(bool)));
connect(child, SIGNAL(copyAvailable(bool)),copyAct, SLOT(setEnabled(bool))); connect(child, SIGNAL(copyAvailable(bool)),copyAct, SLOT(setEnabled(bool)));
connect(child, SIGNAL(copyAvailable(bool)),simulateAct, SLOT(setEnabled(bool))); connect(child, SIGNAL(copyAvailable(bool)),simulateAct, SLOT(setEnabled(bool)));
connect(child, SIGNAL(copyAvailable(bool)),printAct, SLOT(setEnabled(bool))); connect(child, SIGNAL(copyAvailable(bool)),printAct, SLOT(setEnabled(bool)));
return child; return child;
} }
QAction * MainWindow::addAct(QString icon, QString sName, QString lName, QKeySequence::StandardKey shortcut, const char *slot, QObject *slotObj) QAction * MainWindow::addAct(QString icon, QString sName, QString lName, QKeySequence::StandardKey shortcut, const char *slot, QObject *slotObj)
+7 -7
View File
@@ -63,24 +63,24 @@ QT_END_NAMESPACE
class MainWindow : public QMainWindow class MainWindow : public QMainWindow
{ {
friend class fwPreferencesDialog; friend class FirmwarePreferencesDialog;
friend class MdiChild; // TODO GetAvrdudeArgs could be external to this class friend class MdiChild; // TODO GetAvrdudeArgs could be external to this class
Q_OBJECT Q_OBJECT
public: public:
MainWindow(); MainWindow();
protected: protected:
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
void dragEnterEvent(QDragEnterEvent *event); void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event); void dropEvent(QDropEvent *event);
public slots: public slots:
void downloadLatestFW(FirmwareInfo *firmware, const QString & firmwareId); void downloadLatestFW(FirmwareVariant & firmware);
private slots: private slots:
void openDocURL(); void openDocURL();
void setLanguage(QString langString); void setLanguage(QString langString);
@@ -157,7 +157,7 @@ private slots:
QMenu * createProfilesMenu(); QMenu * createProfilesMenu();
void autoClose(); void autoClose();
private: private:
void createActions(); void createActions();
QAction * addAct(QString, QString, QString, QKeySequence::StandardKey, const char *, QObject *slotObj=NULL); QAction * addAct(QString, QString, QString, QKeySequence::StandardKey, const char *, QObject *slotObj=NULL);
QAction * addAct(QActionGroup *, QString, QString, const char *); QAction * addAct(QActionGroup *, QString, QString, const char *);
+12 -8
View File
@@ -66,6 +66,7 @@
MdiChild::MdiChild(): MdiChild::MdiChild():
QWidget(), QWidget(),
ui(new Ui::mdiChild), ui(new Ui::mdiChild),
firmware(GetCurrentFirmware()),
isUntitled(true), isUntitled(true),
fileChanged(false) fileChanged(false)
{ {
@@ -103,7 +104,7 @@ void MdiChild::qSleep(int ms)
void MdiChild::eepromInterfaceChanged() void MdiChild::eepromInterfaceChanged()
{ {
ui->modelsList->refreshList(); ui->modelsList->refreshList();
ui->SimulateTxButton->setEnabled(GetEepromInterface()->getCapability(Simulation)); ui->SimulateTxButton->setEnabled(GetCurrentFirmware()/*firmware*/->getCapability(Simulation));
updateTitle(); updateTitle();
} }
@@ -181,7 +182,7 @@ void MdiChild::modelEdit()
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
checkAndInitModel( row ); checkAndInitModel( row );
ModelData &model = radioData.models[row - 1]; ModelData &model = radioData.models[row - 1];
ModelEdit *t = new ModelEdit(radioData, (row - 1), false, this); ModelEdit *t = new ModelEdit(this, radioData, (row - 1), GetCurrentFirmware()/*firmware*/);
t->setWindowTitle(tr("Editing model %1: ").arg(row) + model.name); t->setWindowTitle(tr("Editing model %1: ").arg(row) + model.name);
connect(t, SIGNAL(modified()), this, SLOT(setModified())); connect(t, SIGNAL(modified()), this, SLOT(setModified()));
t->show(); t->show();
@@ -663,15 +664,18 @@ void MdiChild::simulate()
void MdiChild::print(int model, QString filename) void MdiChild::print(int model, QString filename)
{ {
if (model>=0 && !filename.isEmpty()) { PrintDialog * pd = NULL;
printDialog *pd = new printDialog(this, &radioData.generalSettings, &radioData.models[model], filename); if (model>=0 && !filename.isEmpty()) {
pd->show(); pd = new PrintDialog(this, GetCurrentFirmware()/*firmware*/, &radioData.generalSettings, &radioData.models[model], filename);
} }
else { else if (ui->modelsList->currentRow() > 0) {
if(ui->modelsList->currentRow()<1) return; pd = new PrintDialog(this, GetCurrentFirmware()/*firmware*/, &radioData.generalSettings, &radioData.models[ui->modelsList->currentRow()-1]);
printDialog *pd = new printDialog(this, &radioData.generalSettings, &radioData.models[ui->modelsList->currentRow()-1]); }
if (pd) {
pd->show(); pd->show();
delete pd;
} }
} }
+8 -6
View File
@@ -59,7 +59,7 @@ class MdiChild : public QWidget
Q_OBJECT Q_OBJECT
public: public:
MdiChild(); MdiChild();
~MdiChild(); ~MdiChild();
@@ -78,18 +78,18 @@ public:
void eepromInterfaceChanged(); void eepromInterfaceChanged();
void setEEpromAvail(int eavail); void setEEpromAvail(int eavail);
signals: signals:
void copyAvailable(bool val); void copyAvailable(bool val);
protected: protected:
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
private slots: private slots:
void documentWasModified(); void documentWasModified();
void on_SimulateTxButton_clicked(); void on_SimulateTxButton_clicked();
void qSleep(int ms); void qSleep(int ms);
public slots: public slots:
void checkAndInitModel(int row); void checkAndInitModel(int row);
void generalEdit(); void generalEdit();
void modelEdit(); void modelEdit();
@@ -105,7 +105,7 @@ public slots:
void setModified(); void setModified();
void updateTitle(); void updateTitle();
private: private:
bool maybeSave(); bool maybeSave();
void setCurrentFile(const QString &fileName); void setCurrentFile(const QString &fileName);
QString strippedName(const QString &fullFileName); QString strippedName(const QString &fullFileName);
@@ -115,6 +115,8 @@ private:
Ui::mdiChild *ui; Ui::mdiChild *ui;
QString curFile; QString curFile;
FirmwareInterface * firmware;
RadioData radioData; RadioData radioData;
bool isUntitled; bool isUntitled;
+12 -12
View File
@@ -6,14 +6,14 @@
#include <QCheckBox> #include <QCheckBox>
#include <QDoubleSpinBox> #include <QDoubleSpinBox>
Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & generalSettings): Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings) ModelPanel(parent, model, generalSettings, firmware)
{ {
QGridLayout * gridLayout = new QGridLayout(this); QGridLayout * gridLayout = new QGridLayout(this);
bool minimize = false; bool minimize = false;
int col = 1; int col = 1;
if (GetEepromInterface()->getCapability(ChannelsName)) if (firmware->getCapability(ChannelsName))
{ {
minimize=true; minimize=true;
addLabel(gridLayout, tr("Name"), col++); addLabel(gridLayout, tr("Name"), col++);
@@ -24,12 +24,12 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
addLabel(gridLayout, tr("Direction"), col++, minimize); addLabel(gridLayout, tr("Direction"), col++, minimize);
if (IS_TARANIS(GetEepromInterface()->getBoard())) if (IS_TARANIS(GetEepromInterface()->getBoard()))
addLabel(gridLayout, tr("Curve"), col++, minimize); addLabel(gridLayout, tr("Curve"), col++, minimize);
if (GetEepromInterface()->getCapability(PPMCenter)) if (firmware->getCapability(PPMCenter))
addLabel(gridLayout, tr("PPM Center"), col++, minimize); addLabel(gridLayout, tr("PPM Center"), col++, minimize);
if (GetEepromInterface()->getCapability(SYMLimits)) if (firmware->getCapability(SYMLimits))
addLabel(gridLayout, tr("Linear Subtrim"), col++, true); addLabel(gridLayout, tr("Linear Subtrim"), col++, true);
for (int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for (int i=0; i<firmware->getCapability(Outputs); i++) {
col = 0; col = 0;
// Channel label // Channel label
@@ -39,7 +39,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
gridLayout->addWidget(label, i+1, col++, 1, 1); gridLayout->addWidget(label, i+1, col++, 1, 1);
// Channel name // Channel name
int nameLen = GetEepromInterface()->getCapability(ChannelsName); int nameLen = firmware->getCapability(ChannelsName);
if (nameLen > 0) { if (nameLen > 0) {
QLineEdit * name = new QLineEdit(this); QLineEdit * name = new QLineEdit(this);
name->setProperty("index", i); name->setProperty("index", i);
@@ -103,7 +103,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
if (IS_TARANIS(GetEepromInterface()->getBoard())) { if (IS_TARANIS(GetEepromInterface()->getBoard())) {
QComboBox * curveCB = new QComboBox(this); QComboBox * curveCB = new QComboBox(this);
curveCB->setProperty("index", i); curveCB->setProperty("index", i);
int numcurves = GetEepromInterface()->getCapability(NumCurves); int numcurves = firmware->getCapability(NumCurves);
for (int j=-numcurves; j<=numcurves; j++) { for (int j=-numcurves; j<=numcurves; j++) {
curveCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, j).toString(), j); curveCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, j).toString(), j);
} }
@@ -113,7 +113,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
} }
// PPM center // PPM center
if (GetEepromInterface()->getCapability(PPMCenter)) { if (firmware->getCapability(PPMCenter)) {
QSpinBox * center = new QSpinBox(this); QSpinBox * center = new QSpinBox(this);
center->setProperty("index", i); center->setProperty("index", i);
center->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); center->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
@@ -126,7 +126,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
} }
// Symetrical limits // Symetrical limits
if (GetEepromInterface()->getCapability(SYMLimits)) { if (firmware->getCapability(SYMLimits)) {
QCheckBox * symlimits = new QCheckBox(this); QCheckBox * symlimits = new QCheckBox(this);
symlimits->setProperty("index", i); symlimits->setProperty("index", i);
symlimits->setChecked(model.limitData[i].symetrical); symlimits->setChecked(model.limitData[i].symetrical);
@@ -135,7 +135,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
} }
} }
// Push the rows up // Push the rows up
addVSpring(gridLayout, 0,GetEepromInterface()->getCapability(Outputs)+1); addVSpring(gridLayout, 0,firmware->getCapability(Outputs)+1);
} }
Channels::~Channels() Channels::~Channels()
@@ -188,7 +188,7 @@ void Channels::maxEdited()
void Channels::refreshExtendedLimits() void Channels::refreshExtendedLimits()
{ {
for (int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for (int i=0; i<firmware->getCapability(Outputs); i++) {
QDoubleSpinBox * minDSB = minSpins[i]; QDoubleSpinBox * minDSB = minSpins[i];
QDoubleSpinBox * maxDSB = maxSpins[i]; QDoubleSpinBox * maxDSB = maxSpins[i];
+1 -1
View File
@@ -9,7 +9,7 @@ class Channels : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
Channels(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); Channels(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
~Channels(); ~Channels();
private: private:
+10 -10
View File
@@ -92,8 +92,8 @@ float curveSymmetricalX(float x, float coeff, float yMin, float yMid, float yMax
return y; return y;
} }
Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSettings): Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
ui(new Ui::Curves), ui(new Ui::Curves),
currentCurve(0) currentCurve(0)
{ {
@@ -101,7 +101,7 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
lock = true; lock = true;
if (!GetEepromInterface()->getCapability(HasCvNames)) { if (!firmware->getCapability(HasCvNames)) {
ui->curveName->hide(); ui->curveName->hide();
ui->curveNameLabel->hide(); ui->curveNameLabel->hide();
} }
@@ -110,7 +110,7 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
scene->setItemIndexMethod(QGraphicsScene::NoIndex); scene->setItemIndexMethod(QGraphicsScene::NoIndex);
ui->curvePreview->setScene(scene); ui->curvePreview->setScene(scene);
for (int i=0; i<GetEepromInterface()->getCapability(NumCurves); i++) { for (int i=0; i<firmware->getCapability(NumCurves); i++) {
visibleCurves[i] = false; visibleCurves[i] = false;
// The reset curve button // The reset curve button
@@ -164,7 +164,7 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
ui->pointsLayout->addWidget(spnx[i], i, 1, 1, 1); ui->pointsLayout->addWidget(spnx[i], i, 1, 1, 1);
bool insert; bool insert;
if (GetEepromInterface()->getCapability(EnhancedCurves)) { if (firmware->getCapability(EnhancedCurves)) {
insert = (i >= 1); insert = (i >= 1);
} }
else { else {
@@ -220,7 +220,7 @@ void Curves::update()
{ {
lock = true; lock = true;
if (GetEepromInterface()->getCapability(HasCvNames)) { if (firmware->getCapability(HasCvNames)) {
ui->curveName->setText(model.curves[currentCurve].name); ui->curveName->setText(model.curves[currentCurve].name);
} }
@@ -242,7 +242,7 @@ void Curves::updateCurveType()
int index = 0; int index = 0;
if (GetEepromInterface()->getCapability(EnhancedCurves)) { if (firmware->getCapability(EnhancedCurves)) {
index = model.curves[currentCurve].count - 2; index = model.curves[currentCurve].count - 2;
} }
else { else {
@@ -288,7 +288,7 @@ void Curves::updateCurve()
pen.setWidth(1); pen.setWidth(1);
pen.setStyle(Qt::SolidLine); pen.setStyle(Qt::SolidLine);
int numcurves = GetEepromInterface()->getCapability(NumCurves); int numcurves = firmware->getCapability(NumCurves);
for (int k=0; k<numcurves; k++) { for (int k=0; k<numcurves; k++) {
pen.setColor(colors[k]); pen.setColor(colors[k]);
if (currentCurve!=k && visibleCurves[k]) { if (currentCurve!=k && visibleCurves[k]) {
@@ -406,7 +406,7 @@ void Curves::onNodeUnfocus()
bool Curves::allowCurveType(int points, CurveData::CurveType type) bool Curves::allowCurveType(int points, CurveData::CurveType type)
{ {
int numcurves = GetEepromInterface()->getCapability(NumCurves); int numcurves = firmware->getCapability(NumCurves);
int totalpoints = 0; int totalpoints = 0;
for (int i=0; i<numcurves; i++) { for (int i=0; i<numcurves; i++) {
@@ -415,7 +415,7 @@ bool Curves::allowCurveType(int points, CurveData::CurveType type)
totalpoints += cvPoints + (cvType==CurveData::CURVE_TYPE_CUSTOM ? cvPoints-2 : 0); totalpoints += cvPoints + (cvType==CurveData::CURVE_TYPE_CUSTOM ? cvPoints-2 : 0);
} }
int fwpoints = GetEepromInterface()->getCapability(NumCurvePoints); int fwpoints = firmware->getCapability(NumCurvePoints);
if (totalpoints > fwpoints) { if (totalpoints > fwpoints) {
QMessageBox::warning(this, "companion", tr("Not enough free points in EEPROM to store the curve.")); QMessageBox::warning(this, "companion", tr("Not enough free points in EEPROM to store the curve."));
return false; return false;
+1 -1
View File
@@ -21,7 +21,7 @@ class Curves : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
Curves(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); Curves(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~Curves(); virtual ~Curves();
virtual void update(); virtual void update();
+16 -16
View File
@@ -47,8 +47,8 @@ void RepeatComboBox::update()
setCurrentIndex(value); setCurrentIndex(value);
} }
CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings): CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
initialized(false) initialized(false)
#if defined(PHONON) #if defined(PHONON)
, ,
@@ -66,9 +66,9 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
addEmptyLabel(gridLayout, 5 ); addEmptyLabel(gridLayout, 5 );
lock = true; lock = true;
int num_fsw = GetEepromInterface()->getCapability(CustomFunctions); int num_fsw = firmware->getCapability(CustomFunctions);
if (!GetEepromInterface()->getCapability(VoicesAsNumbers)) { if (!firmware->getCapability(VoicesAsNumbers)) {
for (int i=0; i<num_fsw; i++) { for (int i=0; i<num_fsw; i++) {
if (model.funcSw[i].func==FuncPlayPrompt || model.funcSw[i].func==FuncBackgroundMusic) { if (model.funcSw[i].func==FuncPlayPrompt || model.funcSw[i].func==FuncBackgroundMusic) {
QString temp = model.funcSw[i].paramarm; QString temp = model.funcSw[i].paramarm;
@@ -87,7 +87,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
lang="en"; lang="en";
path.append(lang); path.append(lang);
QDir qd(path); QDir qd(path);
int vml= GetEepromInterface()->getCapability(VoicesMaxLength)+4; int vml= firmware->getCapability(VoicesMaxLength)+4;
if (qd.exists()) { if (qd.exists()) {
QStringList filters; QStringList filters;
filters << "*.wav" << "*.WAV"; filters << "*.wav" << "*.WAV";
@@ -227,7 +227,7 @@ void CustomFunctionsPanel::playMusic()
QDir qd(path); QDir qd(path);
QString track; QString track;
if (qd.exists()) { if (qd.exists()) {
if (GetEepromInterface()->getCapability(VoicesAsNumbers)) { if (firmware->getCapability(VoicesAsNumbers)) {
track = path + QString("/%1.wav").arg(int(fswtchParam[index]->value()), 4, 10, (const QChar)'0'); track = path + QString("/%1.wav").arg(int(fswtchParam[index]->value()), 4, 10, (const QChar)'0');
} }
else { else {
@@ -360,7 +360,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_ENABLE; widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_ENABLE;
} }
else if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) { else if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) {
if (index != FuncBackgroundMusic && GetEepromInterface()->getCapability(HasFuncRepeat)) { if (index != FuncBackgroundMusic && firmware->getCapability(HasFuncRepeat)) {
widgetsMask |= CUSTOM_FUNCTION_REPEAT; widgetsMask |= CUSTOM_FUNCTION_REPEAT;
fswtchRepeat[i]->update(); fswtchRepeat[i]->update();
} }
@@ -370,7 +370,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_REPEAT; widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_REPEAT;
} }
else if (index==FuncPlayPrompt || index==FuncPlayBoth) { else if (index==FuncPlayPrompt || index==FuncPlayBoth) {
if (GetEepromInterface()->getCapability(VoicesAsNumbers)) { if (firmware->getCapability(VoicesAsNumbers)) {
fswtchParam[i]->setDecimals(0); fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1); fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(0); fswtchParam[i]->setMinimum(0);
@@ -407,7 +407,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM; widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (modified) { if (modified) {
memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm)); memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm));
int vml = GetEepromInterface()->getCapability(VoicesMaxLength); int vml = firmware->getCapability(VoicesMaxLength);
if (fswtchParamArmT[i]->currentText() != "----") { if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY; widgetsMask |= CUSTOM_FUNCTION_PLAY;
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) { for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
@@ -427,7 +427,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM; widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (modified) { if (modified) {
memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm)); memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm));
int vml=GetEepromInterface()->getCapability(VoicesMaxLength); int vml=firmware->getCapability(VoicesMaxLength);
if (fswtchParamArmT[i]->currentText() != "----") { if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY; widgetsMask |= CUSTOM_FUNCTION_PLAY;
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(),vml); j++) { for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(),vml); j++) {
@@ -476,7 +476,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
void CustomFunctionsPanel::update() void CustomFunctionsPanel::update()
{ {
lock = true; lock = true;
for (int i=0; i<GetEepromInterface()->getCapability(CustomFunctions); i++) { for (int i=0; i<firmware->getCapability(CustomFunctions); i++) {
if (!initialized) { if (!initialized) {
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, POPULATE_ONOFF); populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, POPULATE_ONOFF);
populateFuncCB(fswtchFunc[i], model.funcSw[i].func); populateFuncCB(fswtchFunc[i], model.funcSw[i].func);
@@ -562,24 +562,24 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
b->clear(); b->clear();
for (unsigned int i=0; i<FuncCount; i++) { for (unsigned int i=0; i<FuncCount; i++) {
b->addItem(FuncSwData(AssignFunc(i)).funcToString()); b->addItem(FuncSwData(AssignFunc(i)).funcToString());
if (!GetEepromInterface()->getCapability(HasVolume)) { if (!firmware->getCapability(HasVolume)) {
if (i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) { if (i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) {
QModelIndex index = b->model()->index(i, 0); QModelIndex index = b->model()->index(i, 0);
QVariant v(0); QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1); b->model()->setData(index, v, Qt::UserRole - 1);
} }
} }
if ((i==FuncPlayHaptic) && !GetEepromInterface()->getCapability(Haptic)) { if ((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) {
QModelIndex index = b->model()->index(i, 0); QModelIndex index = b->model()->index(i, 0);
QVariant v(0); QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1); b->model()->setData(index, v, Qt::UserRole - 1);
} }
if ((i==FuncPlayBoth) && !GetEepromInterface()->getCapability(HasBeeper)) { if ((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) {
QModelIndex index = b->model()->index(i, 0); QModelIndex index = b->model()->index(i, 0);
QVariant v(0); QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1); b->model()->setData(index, v, Qt::UserRole - 1);
} }
if ((i==FuncLogs) && !GetEepromInterface()->getCapability(HasSDLogs)) { if ((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) {
QModelIndex index = b->model()->index(i, 0); QModelIndex index = b->model()->index(i, 0);
QVariant v(0); QVariant v(0);
b->model()->setData(index, v, Qt::UserRole - 1); b->model()->setData(index, v, Qt::UserRole - 1);
@@ -640,7 +640,7 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, const ModelData & m
qs.append( QObject::tr("Timer2")); qs.append( QObject::tr("Timer2"));
qs.append( QObject::tr("All")); qs.append( QObject::tr("All"));
qs.append( QObject::tr("Telemetry")); qs.append( QObject::tr("Telemetry"));
int reCount = GetEepromInterface()->getCapability(RotaryEncoders); int reCount = firmware->getCapability(RotaryEncoders);
if (reCount == 1) { if (reCount == 1) {
qs.append( QObject::tr("Rotary Encoder")); qs.append( QObject::tr("Rotary Encoder"));
} }
+1 -1
View File
@@ -36,7 +36,7 @@ class CustomFunctionsPanel : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
CustomFunctionsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); CustomFunctionsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
~CustomFunctionsPanel(); ~CustomFunctionsPanel();
virtual void update(); virtual void update();
+12 -11
View File
@@ -2,11 +2,12 @@
#include "ui_expodialog.h" #include "ui_expodialog.h"
#include "helpers.h" #include "helpers.h"
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, GeneralSettings & generalSettings, char * inputName) : ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, GeneralSettings & generalSettings, FirmwareInterface * firmware, char * inputName) :
QDialog(parent), QDialog(parent),
ui(new Ui::ExpoDialog), ui(new Ui::ExpoDialog),
model(model), model(model),
generalSettings(generalSettings), generalSettings(generalSettings),
firmware(firmware),
ed(expoData), ed(expoData),
inputName(inputName) inputName(inputName)
{ {
@@ -28,7 +29,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->sideCB->setCurrentIndex(ed->mode-1); ui->sideCB->setCurrentIndex(ed->mode-1);
if (!GetEepromInterface()->getCapability(FlightPhases)) { if (!firmware->getCapability(FlightPhases)) {
ui->label_phases->hide(); ui->label_phases->hide();
for (int i=0; i<9; i++) { for (int i=0; i<9; i++) {
lb_fp[i]->hide(); lb_fp[i]->hide();
@@ -43,13 +44,13 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
} }
mask <<= 1; mask <<= 1;
} }
for (int i=GetEepromInterface()->getCapability(FlightPhases); i<9;i++) { for (int i=firmware->getCapability(FlightPhases); i<9;i++) {
lb_fp[i]->hide(); lb_fp[i]->hide();
cb_fp[i]->hide(); cb_fp[i]->hide();
} }
} }
if (GetEepromInterface()->getCapability(VirtualInputs)) { if (firmware->getCapability(VirtualInputs)) {
ui->inputName->setMaxLength(4); ui->inputName->setMaxLength(4);
populateSourceCB(ui->sourceCB, ed->srcRaw, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | POPULATE_TELEMETRY); populateSourceCB(ui->sourceCB, ed->srcRaw, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | POPULATE_TELEMETRY);
ui->sourceCB->removeItem(0); ui->sourceCB->removeItem(0);
@@ -69,7 +70,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->trimCB->addItem(tr("Ail"), 4); ui->trimCB->addItem(tr("Ail"), 4);
ui->trimCB->setCurrentIndex(1 - ed->carryTrim); ui->trimCB->setCurrentIndex(1 - ed->carryTrim);
int expolength = GetEepromInterface()->getCapability(HasExpoNames); int expolength = firmware->getCapability(HasExpoNames);
if (!expolength) { if (!expolength) {
ui->lineNameLabel->hide(); ui->lineNameLabel->hide();
ui->lineName->hide(); ui->lineName->hide();
@@ -96,7 +97,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
for (int i=0; i<9; i++) { for (int i=0; i<9; i++) {
connect(cb_fp[i], SIGNAL(toggled(bool)), this, SLOT(valuesChanged())); connect(cb_fp[i], SIGNAL(toggled(bool)), this, SLOT(valuesChanged()));
} }
if (GetEepromInterface()->getCapability(VirtualInputs)) if (firmware->getCapability(VirtualInputs))
connect(ui->inputName, SIGNAL(editingFinished()), this, SLOT(valuesChanged())); connect(ui->inputName, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
QTimer::singleShot(0, this, SLOT(shrink())); QTimer::singleShot(0, this, SLOT(shrink()));
@@ -111,7 +112,7 @@ ExpoDialog::~ExpoDialog()
void ExpoDialog::updateScale() void ExpoDialog::updateScale()
{ {
if (GetEepromInterface()->getCapability(VirtualInputs) && ed->srcRaw.type == SOURCE_TYPE_TELEMETRY) { if (firmware->getCapability(VirtualInputs) && ed->srcRaw.type == SOURCE_TYPE_TELEMETRY) {
RawSourceRange range = ed->srcRaw.getRange(); RawSourceRange range = ed->srcRaw.getRange();
ui->scaleLabel->show(); ui->scaleLabel->show();
ui->scale->show(); ui->scale->show();
@@ -153,11 +154,11 @@ void ExpoDialog::valuesChanged()
ed->phases<<=1; ed->phases<<=1;
} }
ed->phases>>=1; ed->phases>>=1;
if (GetEepromInterface()->getCapability(FlightPhases)) { if (firmware->getCapability(FlightPhases)) {
int zeros=0; int zeros=0;
int ones=0; int ones=0;
int phtemp=ed->phases; int phtemp=ed->phases;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (int i=0; i<firmware->getCapability(FlightPhases); i++) {
if (phtemp & 1) { if (phtemp & 1) {
ones++; ones++;
} }
@@ -168,7 +169,7 @@ void ExpoDialog::valuesChanged()
} }
if (zeros==1) { if (zeros==1) {
phtemp=ed->phases; phtemp=ed->phases;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (int i=0; i<firmware->getCapability(FlightPhases); i++) {
if ((phtemp & 1)==0) { if ((phtemp & 1)==0) {
break; break;
} }
@@ -177,7 +178,7 @@ void ExpoDialog::valuesChanged()
} }
else if (ones==1) { else if (ones==1) {
phtemp=ed->phases; phtemp=ed->phases;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (int i=0; i<firmware->getCapability(FlightPhases); i++) {
if (phtemp & 1) { if (phtemp & 1) {
break; break;
} }
+2 -1
View File
@@ -14,7 +14,7 @@ namespace Ui {
class ExpoDialog : public QDialog { class ExpoDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, GeneralSettings & generalSettings, char * inputName); ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, GeneralSettings & generalSettings, FirmwareInterface * firmware, char * inputName);
~ExpoDialog(); ~ExpoDialog();
protected: protected:
@@ -28,6 +28,7 @@ class ExpoDialog : public QDialog {
Ui::ExpoDialog * ui; Ui::ExpoDialog * ui;
ModelData & model; ModelData & model;
GeneralSettings & generalSettings; GeneralSettings & generalSettings;
FirmwareInterface * firmware;
ExpoData * ed; ExpoData * ed;
char * inputName; char * inputName;
GVarGroup * gvGroup; GVarGroup * gvGroup;
+20 -20
View File
@@ -5,24 +5,24 @@
#include <QComboBox> #include <QComboBox>
#include <QGridLayout> #include <QGridLayout>
FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings): FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
ui(new Ui::FlightMode), ui(new Ui::FlightMode),
phaseIdx(phaseIdx), phaseIdx(phaseIdx),
phase(model.phaseData[phaseIdx]), phase(model.phaseData[phaseIdx]),
reCount(GetEepromInterface()->getCapability(RotaryEncoders)), reCount(firmware->getCapability(RotaryEncoders)),
gvCount(((!GetEepromInterface()->getCapability(HasVariants)) || (GetCurrentFirmwareVariant() & GVARS_VARIANT)) ? gvCount(((!firmware->getCapability(HasVariants)) || (GetCurrentFirmwareVariant() & GVARS_VARIANT)) ?
GetEepromInterface()->getCapability(Gvars) : 0) firmware->getCapability(Gvars) : 0)
{ {
ui->setupUi(this); ui->setupUi(this);
int modesCount = GetEepromInterface()->getCapability(FlightPhases); int modesCount = firmware->getCapability(FlightPhases);
// Phase name // Phase name
QRegExp rx(CHAR_FOR_NAMES_REGEX); QRegExp rx(CHAR_FOR_NAMES_REGEX);
if (modesCount) { if (modesCount) {
ui->name->setValidator(new QRegExpValidator(rx, this)); ui->name->setValidator(new QRegExpValidator(rx, this));
ui->name->setMaxLength(GetEepromInterface()->getCapability(FlightModesName)); ui->name->setMaxLength(firmware->getCapability(FlightModesName));
connect(ui->name, SIGNAL(editingFinished()), this, SLOT(phaseName_editingFinished())); connect(ui->name, SIGNAL(editingFinished()), this, SLOT(phaseName_editingFinished()));
} }
else { else {
@@ -39,9 +39,9 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera
} }
// FadeIn / FadeOut // FadeIn / FadeOut
if (GetEepromInterface()->getCapability(FlightPhasesHaveFades)) { if (firmware->getCapability(FlightPhasesHaveFades)) {
int scale = GetEepromInterface()->getCapability(SlowScale); int scale = firmware->getCapability(SlowScale);
int range = GetEepromInterface()->getCapability(SlowRange); int range = firmware->getCapability(SlowRange);
ui->fadeIn->setMaximum(float(range)/scale); ui->fadeIn->setMaximum(float(range)/scale);
ui->fadeIn->setSingleStep(1.0/scale); ui->fadeIn->setSingleStep(1.0/scale);
ui->fadeIn->setDecimals((scale==1 ? 0 :1) ); ui->fadeIn->setDecimals((scale==1 ? 0 :1) );
@@ -130,7 +130,7 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera
label->setText(tr("GVAR%1").arg(i+1)); label->setText(tr("GVAR%1").arg(i+1));
gvLayout->addWidget(label, i, col++, 1, 1); gvLayout->addWidget(label, i, col++, 1, 1);
// GVar name // GVar name
int nameLen = GetEepromInterface()->getCapability(GvarsName); int nameLen = firmware->getCapability(GvarsName);
if (nameLen > 0) { if (nameLen > 0) {
gvNames[i] = new QLineEdit(ui->gvGB); gvNames[i] = new QLineEdit(ui->gvGB);
gvNames[i]->setProperty("index", i); gvNames[i]->setProperty("index", i);
@@ -183,12 +183,12 @@ void FlightMode::update()
{ {
ui->name->setText(phase.name); ui->name->setText(phase.name);
int scale = GetEepromInterface()->getCapability(SlowScale); int scale = firmware->getCapability(SlowScale);
ui->fadeIn->setValue(float(phase.fadeIn)/scale); ui->fadeIn->setValue(float(phase.fadeIn)/scale);
ui->fadeOut->setValue(float(phase.fadeOut)/scale); ui->fadeOut->setValue(float(phase.fadeOut)/scale);
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
int trimsMax = GetEepromInterface()->getCapability(ExtendedTrims); int trimsMax = firmware->getCapability(ExtendedTrims);
if (trimsMax == 0 || !model.extendedTrims) { if (trimsMax == 0 || !model.extendedTrims) {
trimsMax = 125; trimsMax = 125;
} }
@@ -249,7 +249,7 @@ void FlightMode::phaseSwitch_currentIndexChanged(int index)
void FlightMode::phaseFadeIn_editingFinished() void FlightMode::phaseFadeIn_editingFinished()
{ {
QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(sender()); QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(sender());
int scale = GetEepromInterface()->getCapability(SlowScale); int scale = firmware->getCapability(SlowScale);
phase.fadeIn = round(spinBox->value()*scale); phase.fadeIn = round(spinBox->value()*scale);
emit modified(); emit modified();
} }
@@ -257,7 +257,7 @@ void FlightMode::phaseFadeIn_editingFinished()
void FlightMode::phaseFadeOut_editingFinished() void FlightMode::phaseFadeOut_editingFinished()
{ {
QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(sender()); QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(sender());
int scale = GetEepromInterface()->getCapability(SlowScale); int scale = firmware->getCapability(SlowScale);
phase.fadeOut = round(spinBox->value()*scale); phase.fadeOut = round(spinBox->value()*scale);
emit modified(); emit modified();
} }
@@ -418,14 +418,14 @@ void FlightMode::phaseTrimSlider_valueChanged()
/**********************************************************/ /**********************************************************/
FlightModes::FlightModes(QWidget * parent, ModelData & model, GeneralSettings & generalSettings): FlightModes::FlightModes(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
modesCount(GetEepromInterface()->getCapability(FlightPhases)) modesCount(firmware->getCapability(FlightPhases))
{ {
QGridLayout * gridLayout = new QGridLayout(this); QGridLayout * gridLayout = new QGridLayout(this);
tabWidget = new QTabWidget(this); tabWidget = new QTabWidget(this);
for (int i=0; i<modesCount; i++) { for (int i=0; i<modesCount; i++) {
FlightMode *tab = new FlightMode(tabWidget, model, i, generalSettings); FlightMode *tab = new FlightMode(tabWidget, model, i, generalSettings, firmware);
tab->setProperty("index", i); tab->setProperty("index", i);
panels << tab; panels << tab;
connect(tab, SIGNAL(modified()), this, SLOT(onPhaseModified())); connect(tab, SIGNAL(modified()), this, SLOT(onPhaseModified()));
@@ -449,7 +449,7 @@ QString FlightModes::getTabName(int index)
{ {
QString result = tr("Flight Mode %1").arg(index); QString result = tr("Flight Mode %1").arg(index);
const char *name = model.phaseData[index].name; const char *name = model.phaseData[index].name;
if (GetEepromInterface()->getCapability(FlightModesName) && strlen(name) > 0) { if (firmware->getCapability(FlightModesName) && strlen(name) > 0) {
result += tr(" (%1)").arg(name); result += tr(" (%1)").arg(name);
} }
else if (index == 0) { else if (index == 0) {
+2 -2
View File
@@ -18,7 +18,7 @@ class FlightMode : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
FlightMode(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings); FlightMode(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~FlightMode(); virtual ~FlightMode();
virtual void update(); virtual void update();
@@ -66,7 +66,7 @@ class FlightModes : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
FlightModes(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); FlightModes(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~FlightModes(); virtual ~FlightModes();
virtual void update(); virtual void update();
+2 -2
View File
@@ -2,8 +2,8 @@
#include "ui_heli.h" #include "ui_heli.h"
#include "helpers.h" #include "helpers.h"
HeliPanel::HeliPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings): HeliPanel::HeliPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
ui(new Ui::Heli) ui(new Ui::Heli)
{ {
ui->setupUi(this); ui->setupUi(this);
+1 -1
View File
@@ -12,7 +12,7 @@ class HeliPanel : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
HeliPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); HeliPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
~HeliPanel(); ~HeliPanel();
void update(); void update();
+10 -10
View File
@@ -3,8 +3,8 @@
#include "expodialog.h" #include "expodialog.h"
#include "helpers.h" #include "helpers.h"
InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings): InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
expoInserted(false) expoInserted(false)
{ {
QGridLayout * exposLayout = new QGridLayout(this); QGridLayout * exposLayout = new QGridLayout(this);
@@ -47,7 +47,7 @@ void InputsPanel::update()
{ {
lock = true; lock = true;
int inputsCount = GetEepromInterface()->getCapability(VirtualInputs); int inputsCount = firmware->getCapability(VirtualInputs);
if (inputsCount == 0) if (inputsCount == 0)
inputsCount = NUM_STICKS; inputsCount = NUM_STICKS;
@@ -75,20 +75,20 @@ void InputsPanel::update()
} }
if (curDest!=(int)md->chn) { if (curDest!=(int)md->chn) {
if (GetEepromInterface()->getCapability(VirtualInputs)) if (firmware->getCapability(VirtualInputs))
str = QString("%1").arg(getInputStr(model, md->chn), -8, ' '); str = QString("%1").arg(getInputStr(model, md->chn), -8, ' ');
else else
str = getInputStr(model, md->chn); str = getInputStr(model, md->chn);
curDest = md->chn; curDest = md->chn;
} }
else { else {
if (GetEepromInterface()->getCapability(VirtualInputs)) if (firmware->getCapability(VirtualInputs))
str = " "; str = " ";
else else
str = " "; str = " ";
} }
if (GetEepromInterface()->getCapability(VirtualInputs)) { if (firmware->getCapability(VirtualInputs)) {
str += " " + tr("Source(%1)").arg(md->srcRaw.toString()); str += " " + tr("Source(%1)").arg(md->srcRaw.toString());
if (md->carryTrim>0) { if (md->carryTrim>0) {
str += " " + tr("No Trim"); str += " " + tr("No Trim");
@@ -113,7 +113,7 @@ void InputsPanel::update()
if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch(%1)").arg(md->swtch.toString()); if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch(%1)").arg(md->swtch.toString());
if (GetEepromInterface()->getCapability(HasExpoNames)) { if (firmware->getCapability(HasExpoNames)) {
QString expoName = md->name; QString expoName = md->name;
if (!expoName.isEmpty()) str += QString(" [%1]").arg(expoName); if (!expoName.isEmpty()) str += QString(" [%1]").arg(expoName);
} }
@@ -171,13 +171,13 @@ void InputsPanel::gm_openExpo(int index)
emit modified(); emit modified();
update(); update();
if (GetEepromInterface()->getCapability(VirtualInputs)) if (firmware->getCapability(VirtualInputs))
strcpy(inputName, model.inputNames[mixd.chn]); strcpy(inputName, model.inputNames[mixd.chn]);
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings, inputName); ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings, firmware, inputName);
if (g->exec()) { if (g->exec()) {
model.expoData[index] = mixd; model.expoData[index] = mixd;
if (GetEepromInterface()->getCapability(VirtualInputs)) if (firmware->getCapability(VirtualInputs))
strcpy(model.inputNames[mixd.chn], inputName); strcpy(model.inputNames[mixd.chn], inputName);
emit modified(); emit modified();
update(); update();
+1 -1
View File
@@ -9,7 +9,7 @@ class InputsPanel : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~InputsPanel(); virtual ~InputsPanel();
virtual void update(); virtual void update();
+11 -11
View File
@@ -7,8 +7,8 @@
#include <QDoubleSpinBox> #include <QDoubleSpinBox>
#include "helpers.h" #include "helpers.h"
LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings): LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
selectedSwitch(0) selectedSwitch(0)
{ {
QGridLayout * gridLayout = new QGridLayout(this); QGridLayout * gridLayout = new QGridLayout(this);
@@ -18,13 +18,13 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
addLabel(gridLayout, tr("V1"), col++); addLabel(gridLayout, tr("V1"), col++);
addLabel(gridLayout, tr("V2"), col++); addLabel(gridLayout, tr("V2"), col++);
addLabel(gridLayout, tr("AND Switch"), col++); addLabel(gridLayout, tr("AND Switch"), col++);
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) { if (firmware->getCapability(LogicalSwitchesExt)) {
addLabel(gridLayout, tr("Duration"), col++); addLabel(gridLayout, tr("Duration"), col++);
addLabel(gridLayout, tr("Delay"), col++); addLabel(gridLayout, tr("Delay"), col++);
} }
lock = true; lock = true;
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) { for (int i=0; i<firmware->getCapability(LogicalSwitches); i++) {
// The label // The label
QLabel * label = new QLabel(this); QLabel * label = new QLabel(this);
label->setProperty("index", i); label->setProperty("index", i);
@@ -90,7 +90,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
connect(cswitchAnd[i], SIGNAL(currentIndexChanged(int)), this, SLOT(andEdited(int))); connect(cswitchAnd[i], SIGNAL(currentIndexChanged(int)), this, SLOT(andEdited(int)));
gridLayout->addWidget(cswitchAnd[i], i+1, 4); gridLayout->addWidget(cswitchAnd[i], i+1, 4);
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) { if (firmware->getCapability(LogicalSwitchesExt)) {
// Duration // Duration
cswitchDuration[i] = new QDoubleSpinBox(this); cswitchDuration[i] = new QDoubleSpinBox(this);
cswitchDuration[i]->setProperty("index", i); cswitchDuration[i]->setProperty("index", i);
@@ -115,7 +115,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
} }
} }
// Push rows upward // Push rows upward
addVSpring(gridLayout,0,GetEepromInterface()->getCapability(LogicalSwitches)+1); addVSpring(gridLayout,0,firmware->getCapability(LogicalSwitches)+1);
lock = false; lock = false;
} }
@@ -276,7 +276,7 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
{ {
case LS_FAMILY_VOFS: case LS_FAMILY_VOFS:
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE; mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE;
populateSourceCB(cswitchSource1[i], source, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0)); populateSourceCB(cswitchSource1[i], source, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
cswitchOffset[i]->setDecimals(range.decimals); cswitchOffset[i]->setDecimals(range.decimals);
cswitchOffset[i]->setSingleStep(range.step); cswitchOffset[i]->setSingleStep(range.step);
if (model.customSw[i].func == LS_FN_DPOS || model.customSw[i].func == LS_FN_DAPOS) { if (model.customSw[i].func == LS_FN_DPOS || model.customSw[i].func == LS_FN_DAPOS) {
@@ -304,8 +304,8 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
break; break;
case LS_FAMILY_VCOMP: case LS_FAMILY_VCOMP:
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE; mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0)); populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), model, POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0)); populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), model, POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
break; break;
case LS_FAMILY_TIMER: case LS_FAMILY_TIMER:
mask |= VALUE1_VISIBLE | VALUE2_VISIBLE; mask |= VALUE1_VISIBLE | VALUE2_VISIBLE;
@@ -331,7 +331,7 @@ void LogicalSwitchesPanel::updateLine(int i)
setSwitchWidgetVisibility(i); setSwitchWidgetVisibility(i);
lock = true; lock = true;
populateAndSwitchCB(cswitchAnd[i], RawSwitch(model.customSw[i].andsw)); populateAndSwitchCB(cswitchAnd[i], RawSwitch(model.customSw[i].andsw));
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) { if (firmware->getCapability(LogicalSwitchesExt)) {
cswitchDuration[i]->setValue(model.customSw[i].duration/10.0); cswitchDuration[i]->setValue(model.customSw[i].duration/10.0);
cswitchDelay[i]->setValue(model.customSw[i].delay/10.0); cswitchDelay[i]->setValue(model.customSw[i].delay/10.0);
} }
@@ -340,7 +340,7 @@ void LogicalSwitchesPanel::updateLine(int i)
void LogicalSwitchesPanel::update() void LogicalSwitchesPanel::update()
{ {
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) { for (int i=0; i<firmware->getCapability(LogicalSwitches); i++) {
updateLine(i); updateLine(i);
} }
} }
+1 -1
View File
@@ -10,7 +10,7 @@ class LogicalSwitchesPanel : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
LogicalSwitchesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); LogicalSwitchesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~LogicalSwitchesPanel(); virtual ~LogicalSwitchesPanel();
virtual void update(); virtual void update();
+12 -11
View File
@@ -3,11 +3,12 @@
#include "eeprominterface.h" #include "eeprominterface.h"
#include "helpers.h" #include "helpers.h"
MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, GeneralSettings & generalSettings) : MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, GeneralSettings & generalSettings, FirmwareInterface * firmware) :
QDialog(parent), QDialog(parent),
ui(new Ui::MixerDialog), ui(new Ui::MixerDialog),
model(model), model(model),
generalSettings(generalSettings), generalSettings(generalSettings),
firmware(firmware),
md(mixdata), md(mixdata),
lock(false) lock(false)
{ {
@@ -21,7 +22,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
populateSourceCB(ui->sourceCB, md->srcRaw, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS); populateSourceCB(ui->sourceCB, md->srcRaw, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
ui->sourceCB->removeItem(0); ui->sourceCB->removeItem(0);
int limit = GetEepromInterface()->getCapability(OffsetWeight); int limit = firmware->getCapability(OffsetWeight);
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit); gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit); gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
@@ -29,12 +30,12 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
ui->MixDR_CB->setChecked(md->noExpo==0); ui->MixDR_CB->setChecked(md->noExpo==0);
if (GetEepromInterface()->getCapability(VirtualInputs) || !GetEepromInterface()->getCapability(MixesWithoutExpo)) { if (firmware->getCapability(VirtualInputs) || !firmware->getCapability(MixesWithoutExpo)) {
ui->MixDR_CB->hide(); ui->MixDR_CB->hide();
ui->label_MixDR->hide(); ui->label_MixDR->hide();
} }
if (!GetEepromInterface()->getCapability(VirtualInputs)) { if (!firmware->getCapability(VirtualInputs)) {
ui->trimCB->addItem(tr("Rud")); ui->trimCB->addItem(tr("Rud"));
ui->trimCB->addItem(tr("Ele")); ui->trimCB->addItem(tr("Ele"));
ui->trimCB->addItem(tr("Thr")); ui->trimCB->addItem(tr("Thr"));
@@ -43,7 +44,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
ui->trimCB->setCurrentIndex(1 - md->carryTrim); ui->trimCB->setCurrentIndex(1 - md->carryTrim);
int namelength = GetEepromInterface()->getCapability(HasMixerNames); int namelength = firmware->getCapability(HasMixerNames);
if (!namelength) { if (!namelength) {
ui->label_name->hide(); ui->label_name->hide();
ui->mixerName->hide(); ui->mixerName->hide();
@@ -54,7 +55,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
ui->mixerName->setValidator(new QRegExpValidator(rx, this)); ui->mixerName->setValidator(new QRegExpValidator(rx, this));
ui->mixerName->setText(md->name); ui->mixerName->setText(md->name);
if (!GetEepromInterface()->getCapability(FlightPhases)) { if (!firmware->getCapability(FlightPhases)) {
ui->label_phases->hide(); ui->label_phases->hide();
for (int i=0; i<9; i++) { for (int i=0; i<9; i++) {
lb_fp[i]->hide(); lb_fp[i]->hide();
@@ -69,7 +70,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
} }
mask <<= 1; mask <<= 1;
} }
for (int i=GetEepromInterface()->getCapability(FlightPhases); i<9;i++) { for (int i=firmware->getCapability(FlightPhases); i<9;i++) {
lb_fp[i]->hide(); lb_fp[i]->hide();
cb_fp[i]->hide(); cb_fp[i]->hide();
} }
@@ -78,8 +79,8 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
populateSwitchCB(ui->switchesCB, md->swtch, generalSettings); populateSwitchCB(ui->switchesCB, md->swtch, generalSettings);
ui->warningCB->setCurrentIndex(md->mixWarn); ui->warningCB->setCurrentIndex(md->mixWarn);
ui->mltpxCB->setCurrentIndex(md->mltpx); ui->mltpxCB->setCurrentIndex(md->mltpx);
int scale=GetEepromInterface()->getCapability(SlowScale); int scale=firmware->getCapability(SlowScale);
float range=GetEepromInterface()->getCapability(SlowRange); float range=firmware->getCapability(SlowRange);
ui->slowDownSB->setMaximum(range/scale); ui->slowDownSB->setMaximum(range/scale);
ui->slowDownSB->setSingleStep(1.0/scale); ui->slowDownSB->setSingleStep(1.0/scale);
ui->slowDownSB->setDecimals((scale==1 ? 0 :1)); ui->slowDownSB->setDecimals((scale==1 ? 0 :1));
@@ -142,7 +143,7 @@ void MixerDialog::valuesChanged()
lock = true; lock = true;
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 }; QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
md->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt(), &model); md->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt(), &model);
if (!GetEepromInterface()->getCapability(VirtualInputs) && GetEepromInterface()->getCapability(MixesWithoutExpo)) { if (!firmware->getCapability(VirtualInputs) && firmware->getCapability(MixesWithoutExpo)) {
bool drVisible = (md->srcRaw.type == SOURCE_TYPE_STICK && md->srcRaw.index < NUM_STICKS); bool drVisible = (md->srcRaw.type == SOURCE_TYPE_STICK && md->srcRaw.index < NUM_STICKS);
ui->MixDR_CB->setEnabled(drVisible); ui->MixDR_CB->setEnabled(drVisible);
ui->label_MixDR->setEnabled(drVisible); ui->label_MixDR->setEnabled(drVisible);
@@ -152,7 +153,7 @@ void MixerDialog::valuesChanged()
md->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt()); md->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
md->mixWarn = ui->warningCB->currentIndex(); md->mixWarn = ui->warningCB->currentIndex();
md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex(); md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex();
int scale=GetEepromInterface()->getCapability(SlowScale); int scale=firmware->getCapability(SlowScale);
md->delayDown = round(ui->delayDownSB->value()*scale); md->delayDown = round(ui->delayDownSB->value()*scale);
md->delayUp = round(ui->delayUpSB->value()*scale); md->delayUp = round(ui->delayUpSB->value()*scale);
md->speedDown = round(ui->slowDownSB->value()*scale); md->speedDown = round(ui->slowDownSB->value()*scale);
+2 -1
View File
@@ -14,7 +14,7 @@ namespace Ui {
class MixerDialog : public QDialog { class MixerDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, GeneralSettings & generalSettings); MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, GeneralSettings & generalSettings, FirmwareInterface * firmware);
~MixerDialog(); ~MixerDialog();
protected: protected:
@@ -28,6 +28,7 @@ class MixerDialog : public QDialog {
Ui::MixerDialog *ui; Ui::MixerDialog *ui;
ModelData & model; ModelData & model;
GeneralSettings & generalSettings; GeneralSettings & generalSettings;
FirmwareInterface * firmware;
MixData *md; MixData *md;
bool lock; bool lock;
GVarGroup * gvWeightGroup; GVarGroup * gvWeightGroup;
+20 -20
View File
@@ -3,8 +3,8 @@
// #include <QMessageBox> // #include <QMessageBox>
// #include "expodialog.h" // #include "expodialog.h"
MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings): MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
mixInserted(false), mixInserted(false),
highlightedSource(0) highlightedSource(0)
{ {
@@ -46,10 +46,10 @@ MixesPanel::~MixesPanel()
QString MixesPanel::getChannelLabel(int curDest) QString MixesPanel::getChannelLabel(int curDest)
{ {
QString str; QString str;
int outputs = GetEepromInterface()->getCapability(Outputs);
str = QObject::tr("CH%1").arg(curDest); str = QObject::tr("CH%1").arg(curDest);
// TODO not nice, Qt brings a function for that, I don't remember right now
(str.length() < 4) ? str.append(" ") : str.append(" "); (str.length() < 4) ? str.append(" ") : str.append(" ");
if (GetEepromInterface()->getCapability(HasChNames)) { if (firmware->getCapability(HasChNames)) {
QString name = model.limitData[curDest-1].name; QString name = model.limitData[curDest-1].name;
if (!name.isEmpty()) { if (!name.isEmpty()) {
name = QString("(") + name + QString(")"); name = QString("(") + name + QString(")");
@@ -68,9 +68,9 @@ void MixesPanel::update()
MixerlistWidget->clear(); MixerlistWidget->clear();
unsigned int curDest = 0; unsigned int curDest = 0;
int i; int i;
unsigned int outputs = GetEepromInterface()->getCapability(Outputs); unsigned int outputs = firmware->getCapability(Outputs);
for (i=0; i<GetEepromInterface()->getCapability(Mixes); i++) { for (i=0; i<firmware->getCapability(Mixes); i++) {
MixData *md = &model.mixData[i]; MixData *md = &model.mixData[i];
// qDebug() << "md->destCh: " << md->destCh; // qDebug() << "md->destCh: " << md->destCh;
if (md->destCh==0 || md->destCh>outputs) continue; if (md->destCh==0 || md->destCh>outputs) continue;
@@ -185,7 +185,7 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset))); if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset)));
if (md->curve.value) str += " " + Qt::escape(md->curve.toString()); if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
int scale = GetEepromInterface()->getCapability(SlowScale); int scale = firmware->getCapability(SlowScale);
if (scale == 0) if (scale == 0)
scale = 1; scale = 1;
if (md->delayDown || md->delayUp) if (md->delayDown || md->delayUp)
@@ -193,7 +193,7 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
if (md->speedDown || md->speedUp) if (md->speedDown || md->speedUp)
str += Qt::escape(tr(" Slow(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale)); str += Qt::escape(tr(" Slow(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale));
if (md->mixWarn) str += Qt::escape(tr(" Warn(%1)").arg(md->mixWarn)); if (md->mixWarn) str += Qt::escape(tr(" Warn(%1)").arg(md->mixWarn));
if (GetEepromInterface()->getCapability(HasMixerNames)) { if (firmware->getCapability(HasMixerNames)) {
QString MixerName; QString MixerName;
MixerName.append(md->name); MixerName.append(md->name);
if (!MixerName.isEmpty()) { if (!MixerName.isEmpty()) {
@@ -206,14 +206,14 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
bool MixesPanel::gm_insertMix(int idx) bool MixesPanel::gm_insertMix(int idx)
{ {
if (idx<0 || idx>=GetEepromInterface()->getCapability(Mixes) || model.mixData[GetEepromInterface()->getCapability(Mixes)-1].destCh > 0) { if (idx<0 || idx>=firmware->getCapability(Mixes) || model.mixData[firmware->getCapability(Mixes)-1].destCh > 0) {
QMessageBox::information(this, "companion", tr("Not enough available mixers!")); QMessageBox::information(this, "companion", tr("Not enough available mixers!"));
return false; return false;
} }
int i = model.mixData[idx].destCh; int i = model.mixData[idx].destCh;
memmove(&model.mixData[idx+1],&model.mixData[idx], memmove(&model.mixData[idx+1],&model.mixData[idx],
(GetEepromInterface()->getCapability(Mixes)-(idx+1))*sizeof(MixData) ); (firmware->getCapability(Mixes)-(idx+1))*sizeof(MixData) );
memset(&model.mixData[idx],0,sizeof(MixData)); memset(&model.mixData[idx],0,sizeof(MixData));
model.mixData[idx].srcRaw = RawSource(SOURCE_TYPE_NONE); model.mixData[idx].srcRaw = RawSource(SOURCE_TYPE_NONE);
model.mixData[idx].destCh = i; model.mixData[idx].destCh = i;
@@ -224,19 +224,19 @@ bool MixesPanel::gm_insertMix(int idx)
void MixesPanel::gm_deleteMix(int index) void MixesPanel::gm_deleteMix(int index)
{ {
memmove(&model.mixData[index],&model.mixData[index+1], memmove(&model.mixData[index],&model.mixData[index+1],
(GetEepromInterface()->getCapability(Mixes)-(index+1))*sizeof(MixData)); (firmware->getCapability(Mixes)-(index+1))*sizeof(MixData));
memset(&model.mixData[GetEepromInterface()->getCapability(Mixes)-1],0,sizeof(MixData)); memset(&model.mixData[firmware->getCapability(Mixes)-1],0,sizeof(MixData));
} }
void MixesPanel::gm_openMix(int index) void MixesPanel::gm_openMix(int index)
{ {
if(index<0 || index>=GetEepromInterface()->getCapability(Mixes)) return; if(index<0 || index>=firmware->getCapability(Mixes)) return;
MixData mixd(model.mixData[index]); MixData mixd(model.mixData[index]);
emit modified(); emit modified();
update(); update();
MixerDialog *g = new MixerDialog(this, model, &mixd, generalSettings); MixerDialog *g = new MixerDialog(this, model, &mixd, generalSettings, firmware);
if(g->exec()) { if(g->exec()) {
model.mixData[index] = mixd; model.mixData[index] = mixd;
emit modified(); emit modified();
@@ -254,8 +254,8 @@ void MixesPanel::gm_openMix(int index)
int MixesPanel::getMixerIndex(unsigned int dch) int MixesPanel::getMixerIndex(unsigned int dch)
{ {
int i = 0; int i = 0;
while ((model.mixData[i].destCh<=dch) && (model.mixData[i].destCh) && (i<GetEepromInterface()->getCapability(Mixes))) i++; while ((model.mixData[i].destCh<=dch) && (model.mixData[i].destCh) && (i<firmware->getCapability(Mixes))) i++;
if(i==GetEepromInterface()->getCapability(Mixes)) return -1; if(i==firmware->getCapability(Mixes)) return -1;
return i; return i;
} }
@@ -291,7 +291,7 @@ QList<int> MixesPanel::createMixListFromSelected()
QList<int> list; QList<int> list;
foreach(QListWidgetItem *item, MixerlistWidget->selectedItems()) { foreach(QListWidgetItem *item, MixerlistWidget->selectedItems()) {
int idx= item->data(Qt::UserRole).toByteArray().at(0); int idx= item->data(Qt::UserRole).toByteArray().at(0);
if(idx>=0 && idx<GetEepromInterface()->getCapability(Mixes)) list << idx; if(idx>=0 && idx<firmware->getCapability(Mixes)) list << idx;
} }
return list; return list;
} }
@@ -364,7 +364,7 @@ void MixesPanel::pasteMixerMimeData(const QMimeData * mimeData, int destIdx)
int i = 0; int i = 0;
while(i<mxData.size()) { while(i<mxData.size()) {
idx++; idx++;
if(idx==GetEepromInterface()->getCapability(Mixes)) break; if(idx==firmware->getCapability(Mixes)) break;
if (!gm_insertMix(idx)) if (!gm_insertMix(idx))
break; break;
@@ -510,7 +510,7 @@ void MixesPanel::mixerlistWidget_KeyPress(QKeyEvent *event)
int MixesPanel::gm_moveMix(int idx, bool dir) //true=inc=down false=dec=up int MixesPanel::gm_moveMix(int idx, bool dir) //true=inc=down false=dec=up
{ {
if(idx>GetEepromInterface()->getCapability(Mixes) || (idx==GetEepromInterface()->getCapability(Mixes) && dir)) return idx; if(idx>firmware->getCapability(Mixes) || (idx==firmware->getCapability(Mixes) && dir)) return idx;
int tdx = dir ? idx+1 : idx-1; int tdx = dir ? idx+1 : idx-1;
MixData &src=model.mixData[idx]; MixData &src=model.mixData[idx];
@@ -519,7 +519,7 @@ int MixesPanel::gm_moveMix(int idx, bool dir) //true=inc=down false=dec=up
if (src.destCh == 1 && !dir) if (src.destCh == 1 && !dir)
return idx; return idx;
unsigned int outputs = GetEepromInterface()->getCapability(Outputs); unsigned int outputs = firmware->getCapability(Outputs);
if((src.destCh==0) || (src.destCh>outputs) || (tgt.destCh>outputs)) return idx; if((src.destCh==0) || (src.destCh>outputs) || (tgt.destCh>outputs)) return idx;
if (tgt.destCh!=src.destCh) { if (tgt.destCh!=src.destCh) {
+1 -1
View File
@@ -10,7 +10,7 @@ class MixesPanel : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~MixesPanel(); virtual ~MixesPanel();
virtual void update(); virtual void update();
+15 -14
View File
@@ -14,31 +14,32 @@
#include "appdata.h" #include "appdata.h"
#include <QScrollArea> #include <QScrollArea>
ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool isNew, QWidget *parent) : ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, FirmwareInterface * firmware) :
QDialog(parent), QDialog(parent),
ui(new Ui::ModelEdit), ui(new Ui::ModelEdit),
modelId(modelId), modelId(modelId),
model(radioData.models[modelId]), model(radioData.models[modelId]),
generalSettings(radioData.generalSettings) generalSettings(radioData.generalSettings),
firmware(firmware)
{ {
ui->setupUi(this); ui->setupUi(this);
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"));
Setup * setupPanel = new Setup(this, model, generalSettings); SetupPanel * setupPanel = new SetupPanel(this, model, generalSettings, firmware);
addTab(setupPanel, tr("Setup")); addTab(setupPanel, tr("Setup"));
addTab(new HeliPanel(this, model, generalSettings), tr("Heli")); addTab(new HeliPanel(this, model, generalSettings, firmware), tr("Heli"));
addTab(new FlightModes(this, model, generalSettings), tr("Flight Modes")); addTab(new FlightModes(this, model, generalSettings, firmware), tr("Flight Modes"));
addTab(new InputsPanel(this, model, generalSettings), tr("Inputs")); addTab(new InputsPanel(this, model, generalSettings, firmware), tr("Inputs"));
addTab(new MixesPanel(this, model, generalSettings), tr("Mixes")); addTab(new MixesPanel(this, model, generalSettings, firmware), tr("Mixes"));
Channels * chnPanel = new Channels(this, model, generalSettings); Channels * chnPanel = new Channels(this, model, generalSettings, firmware);
addTab(chnPanel, tr("Servos")); addTab(chnPanel, tr("Servos"));
addTab(new Curves(this, model, generalSettings), tr("Curves")); addTab(new Curves(this, model, generalSettings, firmware), tr("Curves"));
addTab(new LogicalSwitchesPanel(this, model, generalSettings), tr("Logical Switches")); addTab(new LogicalSwitchesPanel(this, model, generalSettings, firmware), tr("Logical Switches"));
if (GetEepromInterface()->getCapability(CustomFunctions)) if (firmware->getCapability(CustomFunctions))
addTab(new CustomFunctionsPanel(this, model, generalSettings), tr("Special Functions")); addTab(new CustomFunctionsPanel(this, model, generalSettings, firmware), tr("Special Functions"));
if (GetEepromInterface()->getCapability(Telemetry) & TM_HASTELEMETRY) if (firmware->getCapability(Telemetry) & TM_HASTELEMETRY)
addTab(new TelemetryPanel(this, model, generalSettings), tr("Telemetry")); addTab(new TelemetryPanel(this, model, generalSettings, firmware), tr("Telemetry"));
connect(setupPanel, SIGNAL(extendedLimitsToggled()), chnPanel, SLOT(refreshExtendedLimits())); connect(setupPanel, SIGNAL(extendedLimitsToggled()), chnPanel, SLOT(refreshExtendedLimits()));
} }
+2 -1
View File
@@ -13,7 +13,7 @@ class ModelEdit : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit ModelEdit(RadioData & radioData, int modelId , bool openWizard =false, bool inNew =false, QWidget *parent = 0); ModelEdit(QWidget * parent, RadioData & radioData, int modelId, FirmwareInterface * firmware);
~ModelEdit(); ~ModelEdit();
protected: protected:
@@ -32,6 +32,7 @@ class ModelEdit : public QDialog
int modelId; int modelId;
ModelData & model; ModelData & model;
GeneralSettings & generalSettings; GeneralSettings & generalSettings;
FirmwareInterface * firmware;
QVector<ModelPanel *> panels; QVector<ModelPanel *> panels;
void addTab(ModelPanel *panel, QString text); void addTab(ModelPanel *panel, QString text);
+2 -1
View File
@@ -1,10 +1,11 @@
#include "modelpanel.h" #include "modelpanel.h"
#include <QLabel> #include <QLabel>
ModelPanel::ModelPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings): ModelPanel::ModelPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
QWidget(parent), QWidget(parent),
model(model), model(model),
generalSettings(generalSettings), generalSettings(generalSettings),
firmware(firmware),
lock(false) lock(false)
{ {
} }
+2 -1
View File
@@ -10,7 +10,7 @@ class ModelPanel : public QWidget
Q_OBJECT Q_OBJECT
public: public:
ModelPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); ModelPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~ModelPanel(); virtual ~ModelPanel();
signals: signals:
@@ -22,6 +22,7 @@ class ModelPanel : public QWidget
protected: protected:
ModelData & model; ModelData & model;
GeneralSettings & generalSettings; GeneralSettings & generalSettings;
FirmwareInterface * firmware;
bool lock; bool lock;
void addLabel(QGridLayout * gridLayout, QString text, int col, bool mimimize=false); void addLabel(QGridLayout * gridLayout, QString text, int col, bool mimimize=false);
void addEmptyLabel(QGridLayout * gridLayout, int col); void addEmptyLabel(QGridLayout * gridLayout, int col);
+48 -48
View File
@@ -5,8 +5,8 @@
#include "helpers.h" #include "helpers.h"
#include "appdata.h" #include "appdata.h"
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings): TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
timer(timer), timer(timer),
ui(new Ui::Timer) ui(new Ui::Timer)
{ {
@@ -17,7 +17,7 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
// Mode // Mode
populateSwitchCB(ui->mode, timer.mode, generalSettings, POPULATE_TIMER_MODES); populateSwitchCB(ui->mode, timer.mode, generalSettings, POPULATE_TIMER_MODES);
if (!GetEepromInterface()->getCapability(PermTimers)) { if (!firmware->getCapability(PermTimers)) {
ui->persistent->hide(); ui->persistent->hide();
ui->persistentValue->hide(); ui->persistentValue->hide();
} }
@@ -41,7 +41,7 @@ void TimerPanel::update()
int sec = timer.val % 60; int sec = timer.val % 60;
ui->value->setTime(QTime(0, min, sec)); ui->value->setTime(QTime(0, min, sec));
if (GetEepromInterface()->getCapability(PermTimers)) { if (firmware->getCapability(PermTimers)) {
int sign = 1; int sign = 1;
int pvalue = timer.pvalue; int pvalue = timer.pvalue;
if (pvalue < 0) { if (pvalue < 0) {
@@ -94,8 +94,8 @@ void TimerPanel::on_minuteBeep_toggled(bool checked)
/******************************************************************************/ /******************************************************************************/
ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, GeneralSettings & generalSettings, int moduleIdx): ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, GeneralSettings & generalSettings, FirmwareInterface * firmware, int moduleIdx):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
module(module), module(module),
moduleIdx(moduleIdx), moduleIdx(moduleIdx),
ui(new Ui::Module) ui(new Ui::Module)
@@ -112,7 +112,7 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
else { else {
ui->label_trainerMode->hide(); ui->label_trainerMode->hide();
ui->trainerMode->hide(); ui->trainerMode->hide();
if (GetEepromInterface()->getCapability(NumModules) > 1) { if (firmware->getCapability(NumModules) > 1) {
if (moduleIdx == 0) if (moduleIdx == 0)
label = tr("Internal Radio System"); label = tr("Internal Radio System");
else else
@@ -132,7 +132,7 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
} }
} }
if (GetEepromInterface()->getCapability(HasFailsafe)) { if (firmware->getCapability(HasFailsafe)) {
for (int i=0; i<16; i++) { for (int i=0; i<16; i++) {
QLabel * label = new QLabel(this); QLabel * label = new QLabel(this);
label->setText(QString::number(i+1)); label->setText(QString::number(i+1));
@@ -211,7 +211,7 @@ void ModulePanel::update()
ui->channelsCount->setVisible(mask & MASK_CHANNELS_RANGE); ui->channelsCount->setVisible(mask & MASK_CHANNELS_RANGE);
ui->channelsCount->setEnabled(mask & MASK_CHANNELS_COUNT); ui->channelsCount->setEnabled(mask & MASK_CHANNELS_COUNT);
ui->channelsCount->setValue(module.channelsCount); ui->channelsCount->setValue(module.channelsCount);
ui->channelsCount->setSingleStep(GetEepromInterface()->getCapability(HasPPMStart) ? 1 : 2); ui->channelsCount->setSingleStep(firmware->getCapability(HasPPMStart) ? 1 : 2);
// PPM settings fields // PPM settings fields
ui->label_ppmPolarity->setVisible(mask & MASK_PPM_FIELDS); ui->label_ppmPolarity->setVisible(mask & MASK_PPM_FIELDS);
@@ -223,10 +223,10 @@ void ModulePanel::update()
ui->label_ppmFrameLength->setVisible(mask & MASK_PPM_FIELDS); ui->label_ppmFrameLength->setVisible(mask & MASK_PPM_FIELDS);
ui->ppmFrameLength->setVisible(mask & MASK_PPM_FIELDS); ui->ppmFrameLength->setVisible(mask & MASK_PPM_FIELDS);
ui->ppmFrameLength->setMinimum(module.channelsCount*(model.extendedLimits ? 2.250 :2)+3.5); ui->ppmFrameLength->setMinimum(module.channelsCount*(model.extendedLimits ? 2.250 :2)+3.5);
ui->ppmFrameLength->setMaximum(GetEepromInterface()->getCapability(PPMFrameLength)); ui->ppmFrameLength->setMaximum(firmware->getCapability(PPMFrameLength));
ui->ppmFrameLength->setValue(22.5+((double)module.ppmFrameLength)*0.5); ui->ppmFrameLength->setValue(22.5+((double)module.ppmFrameLength)*0.5);
if (GetEepromInterface()->getCapability(HasFailsafe)) { if (firmware->getCapability(HasFailsafe)) {
ui->label_failsafeMode->setVisible(mask & MASK_FAILSAFES); ui->label_failsafeMode->setVisible(mask & MASK_FAILSAFES);
ui->failsafeMode->setVisible(mask & MASK_FAILSAFES); ui->failsafeMode->setVisible(mask & MASK_FAILSAFES);
ui->failsafeMode->setCurrentIndex(module.failsafeMode); ui->failsafeMode->setCurrentIndex(module.failsafeMode);
@@ -323,8 +323,8 @@ void ModulePanel::onFailsafeSpinChanged(double value)
/******************************************************************************/ /******************************************************************************/
Setup::Setup(QWidget *parent, ModelData & model, GeneralSettings & generalSettings): SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
ui(new Ui::Setup) ui(new Ui::Setup)
{ {
lock = true; lock = true;
@@ -336,23 +336,23 @@ Setup::Setup(QWidget *parent, ModelData & model, GeneralSettings & generalSettin
ui->name->setMaxLength(IS_TARANIS(GetEepromInterface()->getBoard()) ? 12 : 10); ui->name->setMaxLength(IS_TARANIS(GetEepromInterface()->getBoard()) ? 12 : 10);
for (int i=0; i<C9X_MAX_TIMERS; i++) { for (int i=0; i<C9X_MAX_TIMERS; i++) {
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings); timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware);
ui->gridLayout->addWidget(timers[i], 1+i, 1); ui->gridLayout->addWidget(timers[i], 1+i, 1);
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified())); connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
} }
for (int i=0; i<GetEepromInterface()->getCapability(NumModules); i++) { for (int i=0; i<firmware->getCapability(NumModules); i++) {
modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, i); modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, firmware, i);
ui->modulesLayout->addWidget(modules[i]); ui->modulesLayout->addWidget(modules[i]);
connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified())); connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified()));
} }
if (GetEepromInterface()->getCapability(ModelTrainerEnable)) { if (firmware->getCapability(ModelTrainerEnable)) {
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, -1); modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, firmware, -1);
ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]); ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
} }
if (GetEepromInterface()->getCapability(ModelImage)) { if (firmware->getCapability(ModelImage)) {
QStringList items; QStringList items;
items.append(""); items.append("");
QString path = g.profile[g.id()].sdPath(); QString path = g.profile[g.id()].sdPath();
@@ -399,13 +399,13 @@ Setup::Setup(QWidget *parent, ModelData & model, GeneralSettings & generalSettin
ui->imagePreview->hide(); ui->imagePreview->hide();
} }
if (!GetEepromInterface()->getCapability(HasDisplayText)) { if (!firmware->getCapability(HasDisplayText)) {
ui->displayText->hide(); ui->displayText->hide();
} }
// Beep Center checkboxes // Beep Center checkboxes
int analogs = 4 + GetEepromInterface()->getCapability(Pots); int analogs = 4 + firmware->getCapability(Pots);
for (int i=0; i<analogs+GetEepromInterface()->getCapability(RotaryEncoders); i++) { for (int i=0; i<analogs+firmware->getCapability(RotaryEncoders); i++) {
QCheckBox * checkbox = new QCheckBox(this); QCheckBox * checkbox = new QCheckBox(this);
checkbox->setProperty("index", i); checkbox->setProperty("index", i);
checkbox->setText(i<analogs ? AnalogString(i) : RotaryEncoderString(i-analogs)); checkbox->setText(i<analogs ? AnalogString(i) : RotaryEncoderString(i-analogs));
@@ -415,7 +415,7 @@ Setup::Setup(QWidget *parent, ModelData & model, GeneralSettings & generalSettin
} }
// Startup switches warnings // Startup switches warnings
for (int i=0; i<GetEepromInterface()->getCapability(Switches)-1; i++) { for (int i=0; i<firmware->getCapability(Switches)-1; i++) {
QLabel * label = new QLabel(this); QLabel * label = new QLabel(this);
QSlider * slider = new QSlider(this); QSlider * slider = new QSlider(this);
QCheckBox * cb = new QCheckBox(this); QCheckBox * cb = new QCheckBox(this);
@@ -449,11 +449,11 @@ Setup::Setup(QWidget *parent, ModelData & model, GeneralSettings & generalSettin
startupSwitchesSliders << slider; startupSwitchesSliders << slider;
startupSwitchesCheckboxes << cb; startupSwitchesCheckboxes << cb;
} }
ui->switchesStartupLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, GetEepromInterface()->getCapability(Switches)); ui->switchesStartupLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, firmware->getCapability(Switches));
// Pot warnings // Pot warnings
if(IS_TARANIS(GetEepromInterface()->getBoard())) { if(IS_TARANIS(GetEepromInterface()->getBoard())) {
for (int i=0; i<GetEepromInterface()->getCapability(Pots); i++) { for (int i=0; i<firmware->getCapability(Pots); i++) {
QCheckBox * cb = new QCheckBox(this); QCheckBox * cb = new QCheckBox(this);
cb->setProperty("index", i+1); cb->setProperty("index", i+1);
cb->setText(AnalogString(i+4)); cb->setText(AnalogString(i+4));
@@ -469,43 +469,43 @@ Setup::Setup(QWidget *parent, ModelData & model, GeneralSettings & generalSettin
lock = false; lock = false;
} }
Setup::~Setup() SetupPanel::~SetupPanel()
{ {
delete ui; delete ui;
} }
void Setup::on_extendedLimits_toggled(bool checked) void SetupPanel::on_extendedLimits_toggled(bool checked)
{ {
model.extendedLimits = checked; model.extendedLimits = checked;
emit extendedLimitsToggled(); emit extendedLimitsToggled();
emit modified(); emit modified();
} }
void Setup::on_throttleWarning_toggled(bool checked) void SetupPanel::on_throttleWarning_toggled(bool checked)
{ {
model.disableThrottleWarning = !checked; model.disableThrottleWarning = !checked;
emit modified(); emit modified();
} }
void Setup::on_throttleReverse_toggled(bool checked) void SetupPanel::on_throttleReverse_toggled(bool checked)
{ {
model.throttleReversed = checked; model.throttleReversed = checked;
emit modified(); emit modified();
} }
void Setup::on_extendedTrims_toggled(bool checked) void SetupPanel::on_extendedTrims_toggled(bool checked)
{ {
model.extendedTrims = checked; model.extendedTrims = checked;
emit modified(); emit modified();
} }
void Setup::on_trimIncrement_currentIndexChanged(int index) void SetupPanel::on_trimIncrement_currentIndexChanged(int index)
{ {
model.trimInc = index-2; model.trimInc = index-2;
emit modified(); emit modified();
} }
void Setup::on_throttleSource_currentIndexChanged(int index) void SetupPanel::on_throttleSource_currentIndexChanged(int index)
{ {
if (!lock) { if (!lock) {
model.thrTraceSrc = ui->throttleSource->itemData(index).toInt(); model.thrTraceSrc = ui->throttleSource->itemData(index).toInt();
@@ -513,14 +513,14 @@ void Setup::on_throttleSource_currentIndexChanged(int index)
} }
} }
void Setup::on_name_editingFinished() void SetupPanel::on_name_editingFinished()
{ {
int length = ui->name->maxLength(); int length = ui->name->maxLength();
strncpy(model.name, ui->name->text().toAscii(), length); strncpy(model.name, ui->name->text().toAscii(), length);
emit modified(); emit modified();
} }
void Setup::on_image_currentIndexChanged(int index) void SetupPanel::on_image_currentIndexChanged(int index)
{ {
if (!lock) { if (!lock) {
strncpy(model.bitmap, ui->image->currentText().toAscii(), 10); strncpy(model.bitmap, ui->image->currentText().toAscii(), 10);
@@ -552,7 +552,7 @@ void Setup::on_image_currentIndexChanged(int index)
} }
} }
void Setup::populateThrottleSourceCB() void SetupPanel::populateThrottleSourceCB()
{ {
const QString sources9x[] = { QObject::tr("THR"), QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")}; const QString sources9x[] = { QObject::tr("THR"), QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
const QString sourcesTaranis[] = { QObject::tr("THR"), QObject::tr("S1"), QObject::tr("S2"), QObject::tr("S3"), QObject::tr("LS"), QObject::tr("RS")}; const QString sourcesTaranis[] = { QObject::tr("THR"), QObject::tr("S1"), QObject::tr("S2"), QObject::tr("S3"), QObject::tr("LS"), QObject::tr("RS")};
@@ -585,7 +585,7 @@ void Setup::populateThrottleSourceCB()
lock = false; lock = false;
} }
void Setup::update() void SetupPanel::update()
{ {
ui->name->setText(model.name); ui->name->setText(model.name);
@@ -615,20 +615,20 @@ void Setup::update()
modules[i]->update(); modules[i]->update();
} }
void Setup::updateBeepCenter() void SetupPanel::updateBeepCenter()
{ {
for (int i=0; i<centerBeepCheckboxes.size(); i++) { for (int i=0; i<centerBeepCheckboxes.size(); i++) {
centerBeepCheckboxes[i]->setChecked(model.beepANACenter & (0x01 << i)); centerBeepCheckboxes[i]->setChecked(model.beepANACenter & (0x01 << i));
} }
} }
void Setup::updateStartupSwitches() void SetupPanel::updateStartupSwitches()
{ {
lock = true; lock = true;
unsigned int switchStates = model.switchWarningStates; unsigned int switchStates = model.switchWarningStates;
for (int i=0; i<GetEepromInterface()->getCapability(Switches)-1; i++) { for (int i=0; i<firmware->getCapability(Switches)-1; i++) {
QSlider * slider = startupSwitchesSliders[i]; QSlider * slider = startupSwitchesSliders[i];
QCheckBox * cb = startupSwitchesCheckboxes[i]; QCheckBox * cb = startupSwitchesCheckboxes[i];
bool enabled = !(model.nSwToWarn & (1 << i)); bool enabled = !(model.nSwToWarn & (1 << i));
@@ -647,7 +647,7 @@ void Setup::updateStartupSwitches()
lock = false; lock = false;
} }
void Setup::startupSwitchEdited(int value) void SetupPanel::startupSwitchEdited(int value)
{ {
if (!lock) { if (!lock) {
int shift = 0; int shift = 0;
@@ -686,7 +686,7 @@ void Setup::startupSwitchEdited(int value)
} }
} }
void Setup::startupSwitchToggled(bool checked) void SetupPanel::startupSwitchToggled(bool checked)
{ {
if (!lock) { if (!lock) {
int index = sender()->property("index").toInt()-1; int index = sender()->property("index").toInt()-1;
@@ -701,7 +701,7 @@ void Setup::startupSwitchToggled(bool checked)
} }
} }
void Setup::updatePotWarnings() void SetupPanel::updatePotWarnings()
{ {
lock = true; lock = true;
int mode = model.nPotsToWarn >> 6; int mode = model.nPotsToWarn >> 6;
@@ -719,7 +719,7 @@ void Setup::updatePotWarnings()
lock = false; lock = false;
} }
void Setup::potWarningToggled(bool checked) void SetupPanel::potWarningToggled(bool checked)
{ {
if (!lock) { if (!lock) {
int index = sender()->property("index").toInt()-1; int index = sender()->property("index").toInt()-1;
@@ -734,7 +734,7 @@ void Setup::potWarningToggled(bool checked)
} }
} }
void Setup::on_potWarningMode_currentIndexChanged(int index) void SetupPanel::on_potWarningMode_currentIndexChanged(int index)
{ {
if (!lock) { if (!lock) {
int mask = 0xC0; int mask = 0xC0;
@@ -746,19 +746,19 @@ void Setup::on_potWarningMode_currentIndexChanged(int index)
} }
} }
void Setup::on_displayText_toggled(bool checked) void SetupPanel::on_displayText_toggled(bool checked)
{ {
model.displayText = checked; model.displayText = checked;
emit modified(); emit modified();
} }
void Setup::on_throttleTrim_toggled(bool checked) void SetupPanel::on_throttleTrim_toggled(bool checked)
{ {
model.thrTrim = checked; model.thrTrim = checked;
emit modified(); emit modified();
} }
void Setup::onBeepCenterToggled(bool checked) void SetupPanel::onBeepCenterToggled(bool checked)
{ {
if (!lock) { if (!lock) {
int index = sender()->property("index").toInt(); int index = sender()->property("index").toInt();
@@ -771,7 +771,7 @@ void Setup::onBeepCenterToggled(bool checked)
} }
} }
void Setup::onChildModified() void SetupPanel::onChildModified()
{ {
emit modified(); emit modified();
} }
+5 -5
View File
@@ -20,7 +20,7 @@ class TimerPanel : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings); TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~TimerPanel(); virtual ~TimerPanel();
virtual void update(); virtual void update();
@@ -42,7 +42,7 @@ class ModulePanel : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, GeneralSettings & generalSettings, int moduleIdx); ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, GeneralSettings & generalSettings, FirmwareInterface * firmware, int moduleIdx);
virtual ~ModulePanel(); virtual ~ModulePanel();
virtual void update(); virtual void update();
@@ -66,13 +66,13 @@ class ModulePanel : public ModelPanel
QVector<QDoubleSpinBox *> failsafeSpins; QVector<QDoubleSpinBox *> failsafeSpins;
}; };
class Setup : public ModelPanel class SetupPanel : public ModelPanel
{ {
Q_OBJECT Q_OBJECT
public: public:
Setup(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~Setup(); virtual ~SetupPanel();
virtual void update(); virtual void update();
+28 -28
View File
@@ -5,8 +5,8 @@
#include "helpers.h" #include "helpers.h"
#include "appdata.h" #include "appdata.h"
TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog): TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
QWidget(parent), ModelPanel(parent, model, generalSettings, firmware),
ui(new Ui::TelemetryAnalog), ui(new Ui::TelemetryAnalog),
analog(analog), analog(analog),
lock(false) lock(false)
@@ -17,11 +17,11 @@ TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog):
if (analog.type==0 || analog.type==1 || analog.type==2) { if (analog.type==0 || analog.type==1 || analog.type==2) {
ui->RatioSB->setDecimals(1); ui->RatioSB->setDecimals(1);
ui->RatioSB->setMaximum(25.5*GetEepromInterface()->getCapability(TelemetryMaxMultiplier)); ui->RatioSB->setMaximum(25.5*firmware->getCapability(TelemetryMaxMultiplier));
} }
else { else {
ui->RatioSB->setDecimals(0); ui->RatioSB->setDecimals(0);
ui->RatioSB->setMaximum(255*GetEepromInterface()->getCapability(TelemetryMaxMultiplier)); ui->RatioSB->setMaximum(255*firmware->getCapability(TelemetryMaxMultiplier));
} }
ui->RatioSB->setValue(ratio); ui->RatioSB->setValue(ratio);
@@ -43,7 +43,7 @@ TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog):
ui->alarm2Label->setText(tr("Critical Alarm")); ui->alarm2Label->setText(tr("Critical Alarm"));
} }
if (!(GetEepromInterface()->getCapability(Telemetry) & TM_HASOFFSET)) { if (!(firmware->getCapability(Telemetry) & TM_HASOFFSET)) {
ui->CalibSB->hide(); ui->CalibSB->hide();
ui->CalibLabel->hide(); ui->CalibLabel->hide();
} }
@@ -87,11 +87,11 @@ void TelemetryAnalog::on_UnitCB_currentIndexChanged(int index)
case 1: case 1:
case 2: case 2:
ui->RatioSB->setDecimals(1); ui->RatioSB->setDecimals(1);
ui->RatioSB->setMaximum(25.5*GetEepromInterface()->getCapability(TelemetryMaxMultiplier)); ui->RatioSB->setMaximum(25.5*firmware->getCapability(TelemetryMaxMultiplier));
break; break;
default: default:
ui->RatioSB->setDecimals(0); ui->RatioSB->setDecimals(0);
ui->RatioSB->setMaximum(255*GetEepromInterface()->getCapability(TelemetryMaxMultiplier)); ui->RatioSB->setMaximum(255*firmware->getCapability(TelemetryMaxMultiplier));
break; break;
} }
ui->RatioSB->setValue(ratio); ui->RatioSB->setValue(ratio);
@@ -280,15 +280,15 @@ TelemetryAnalog::~TelemetryAnalog()
/******************************************************/ /******************************************************/
TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen, GeneralSettings & generalSettings): TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
ui(new Ui::TelemetryCustomScreen), ui(new Ui::TelemetryCustomScreen),
screen(screen) screen(screen)
{ {
ui->setupUi(this); ui->setupUi(this);
for (int l=0; l<4; l++) { for (int l=0; l<4; l++) {
for (int c=0; c<GetEepromInterface()->getCapability(TelemetryCustomScreensFieldsPerLine); c++) { for (int c=0; c<firmware->getCapability(TelemetryCustomScreensFieldsPerLine); c++) {
fieldsCB[l][c] = new QComboBox(this); fieldsCB[l][c] = new QComboBox(this);
fieldsCB[l][c]->setProperty("index", c + (l<<8)); fieldsCB[l][c]->setProperty("index", c + (l<<8));
populateTelemetrySourceCB(fieldsCB[l][c], screen.body.lines[l].source[c], l==3, model.frsky.usrProto); populateTelemetrySourceCB(fieldsCB[l][c], screen.body.lines[l].source[c], l==3, model.frsky.usrProto);
@@ -366,7 +366,7 @@ void TelemetryCustomScreen::update()
if (screen.type == 0) { if (screen.type == 0) {
for (int l=0; l<4; l++) { for (int l=0; l<4; l++) {
for (int c=0; c<GetEepromInterface()->getCapability(TelemetryCustomScreensFieldsPerLine); c++) { for (int c=0; c<firmware->getCapability(TelemetryCustomScreensFieldsPerLine); c++) {
fieldsCB[l][c]->setCurrentIndex(screen.body.lines[l].source[c]); fieldsCB[l][c]->setCurrentIndex(screen.body.lines[l].source[c]);
} }
} }
@@ -465,26 +465,26 @@ void TelemetryCustomScreen::barMaxChanged(double value)
/******************************************************/ /******************************************************/
TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings): TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings), ModelPanel(parent, model, generalSettings, firmware),
ui(new Ui::Telemetry) ui(new Ui::Telemetry)
{ {
ui->setupUi(this); ui->setupUi(this);
if (GetEepromInterface()->getCapability(NoTelemetryProtocol)) { if (firmware->getCapability(NoTelemetryProtocol)) {
model.frsky.usrProto = 1; model.frsky.usrProto = 1;
} }
analogs[0] = new TelemetryAnalog(this, model.frsky.channels[0]); analogs[0] = new TelemetryAnalog(this, model.frsky.channels[0], model, generalSettings, firmware);
ui->A1Layout->addWidget(analogs[0]); ui->A1Layout->addWidget(analogs[0]);
connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified())); connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified()));
analogs[1] = new TelemetryAnalog(this, model.frsky.channels[1]); analogs[1] = new TelemetryAnalog(this, model.frsky.channels[1], model, generalSettings, firmware);
ui->A2Layout->addWidget(analogs[1]); ui->A2Layout->addWidget(analogs[1]);
connect(analogs[1], SIGNAL(modified()), this, SLOT(onAnalogModified())); connect(analogs[1], SIGNAL(modified()), this, SLOT(onAnalogModified()));
for (int i=0; i<GetEepromInterface()->getCapability(TelemetryCustomScreens); i++) { for (int i=0; i<firmware->getCapability(TelemetryCustomScreens); i++) {
TelemetryCustomScreen * tab = new TelemetryCustomScreen(this, model, model.frsky.screens[i], generalSettings); TelemetryCustomScreen * tab = new TelemetryCustomScreen(this, model, model.frsky.screens[i], generalSettings, firmware);
ui->customScreens->addTab(tab, tr("Telemetry screen %1").arg(i+1)); ui->customScreens->addTab(tab, tr("Telemetry screen %1").arg(i+1));
} }
@@ -508,7 +508,7 @@ void TelemetryPanel::setup()
lock=true; lock=true;
//frsky Settings //frsky Settings
if (!GetEepromInterface()->getCapability(TelemetryRSSIModel) ) { if (!firmware->getCapability(TelemetryRSSIModel) ) {
ui->RSSIGB->hide(); ui->RSSIGB->hide();
} }
ui->rssiAlarm1SB->setValue(model.frsky.rssiAlarms[0].value); ui->rssiAlarm1SB->setValue(model.frsky.rssiAlarms[0].value);
@@ -524,7 +524,7 @@ void TelemetryPanel::setup()
ui->rssiAlarm2Label->setText(tr("Critical Alarm")); ui->rssiAlarm2Label->setText(tr("Critical Alarm"));
} }
if (!GetEepromInterface()->getCapability(HasAltitudeSel)) { if (!firmware->getCapability(HasAltitudeSel)) {
ui->AltitudeGPS_ChkB->hide(); ui->AltitudeGPS_ChkB->hide();
} }
else { else {
@@ -538,7 +538,7 @@ void TelemetryPanel::setup()
ui->AltitudeToolbar_ChkB->hide(); ui->AltitudeToolbar_ChkB->hide();
} }
int varioCap = GetEepromInterface()->getCapability(HasVario); int varioCap = firmware->getCapability(HasVario);
if (!varioCap) { if (!varioCap) {
ui->varioLimitMax_DSB->hide(); ui->varioLimitMax_DSB->hide();
ui->varioLimitMinOff_ChkB->hide(); ui->varioLimitMinOff_ChkB->hide();
@@ -554,7 +554,7 @@ void TelemetryPanel::setup()
ui->varioSource_label->hide(); ui->varioSource_label->hide();
} }
else { else {
if (!GetEepromInterface()->getCapability(HasVarioSink)) { if (!firmware->getCapability(HasVarioSink)) {
ui->varioLimitMinOff_ChkB->hide(); ui->varioLimitMinOff_ChkB->hide();
ui->varioLimitMin_DSB->hide(); ui->varioLimitMin_DSB->hide();
ui->varioLimitCenterMin_DSB->hide(); ui->varioLimitCenterMin_DSB->hide();
@@ -584,18 +584,18 @@ void TelemetryPanel::setup()
} }
} }
if (!(GetEepromInterface()->getCapability(HasAltitudeSel)||GetEepromInterface()->getCapability(HasVario))) { if (!(firmware->getCapability(HasAltitudeSel)||firmware->getCapability(HasVario))) {
ui->altimetryGB->hide(); ui->altimetryGB->hide();
} }
if (GetEepromInterface()->getCapability(NoTelemetryProtocol)) { if (firmware->getCapability(NoTelemetryProtocol)) {
ui->frskyProtoCB->setDisabled(true); ui->frskyProtoCB->setDisabled(true);
} }
else { else {
ui->frskyProtoCB->setEnabled(true); ui->frskyProtoCB->setEnabled(true);
} }
if (!GetEepromInterface()->getCapability(TelemetryUnits)) { if (!firmware->getCapability(TelemetryUnits)) {
ui->frskyUnitsCB->setDisabled(true); ui->frskyUnitsCB->setDisabled(true);
int index=0; int index=0;
if (firmware_id.contains("imperial")) { if (firmware_id.contains("imperial")) {
@@ -604,7 +604,7 @@ void TelemetryPanel::setup()
ui->frskyUnitsCB->setCurrentIndex(index); ui->frskyUnitsCB->setCurrentIndex(index);
} }
if ((GetEepromInterface()->getCapability(Telemetry)&TM_HASWSHH)) { if ((firmware->getCapability(Telemetry)&TM_HASWSHH)) {
ui->frskyProtoCB->addItem(tr("Winged Shadow How High")); ui->frskyProtoCB->addItem(tr("Winged Shadow How High"));
} }
else { else {
@@ -612,7 +612,7 @@ void TelemetryPanel::setup()
} }
ui->variousGB->hide(); ui->variousGB->hide();
if (!(GetEepromInterface()->getCapability(HasFasOffset)) && !(firmware_id.contains("fasoffset"))) { if (!(firmware->getCapability(HasFasOffset)) && !(firmware_id.contains("fasoffset"))) {
ui->fasOffset_label->hide(); ui->fasOffset_label->hide();
ui->fasOffset_DSB->hide(); ui->fasOffset_DSB->hide();
} }
@@ -621,7 +621,7 @@ void TelemetryPanel::setup()
ui->variousGB->show(); ui->variousGB->show();
} }
if (!(GetEepromInterface()->getCapability(HasMahPersistent))) { if (!(firmware->getCapability(HasMahPersistent))) {
ui->mahCount_label->hide(); ui->mahCount_label->hide();
ui->mahCount_SB->hide(); ui->mahCount_SB->hide();
ui->mahCount_ChkB->hide(); ui->mahCount_ChkB->hide();
+5 -5
View File
@@ -12,14 +12,14 @@ namespace Ui {
class Telemetry; class Telemetry;
} }
class TelemetryAnalog : public QWidget class TelemetryAnalog: public ModelPanel
{ {
Q_OBJECT Q_OBJECT
friend class TelemetryPanel; friend class TelemetryPanel;
public: public:
TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog); TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~TelemetryAnalog(); virtual ~TelemetryAnalog();
signals: signals:
@@ -45,12 +45,12 @@ class TelemetryAnalog : public QWidget
void update(); void update();
}; };
class TelemetryCustomScreen : public ModelPanel class TelemetryCustomScreen: public ModelPanel
{ {
Q_OBJECT Q_OBJECT
public: public:
TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen, GeneralSettings & generalSettings); TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen, GeneralSettings & generalSettings, FirmwareInterface * firmware);
~TelemetryCustomScreen(); ~TelemetryCustomScreen();
void update(); void update();
@@ -79,7 +79,7 @@ class TelemetryPanel : public ModelPanel
Q_OBJECT Q_OBJECT
public: public:
TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings); TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
virtual ~TelemetryPanel(); virtual ~TelemetryPanel();
signals: signals:
+8 -8
View File
@@ -10,7 +10,7 @@ void ModelEdit::setCurve(uint8_t c, int8_t ar[])
{ {
int len=sizeof(ar)/sizeof(int8_t); int len=sizeof(ar)/sizeof(int8_t);
if (GetEepromInterface()->getCapability(NumCurves)>c) { if (firmware->getCapability(NumCurves)>c) {
if (len<9) { if (len<9) {
model.curves[c].count=5; model.curves[c].count=5;
model.curves[c].custom=false; model.curves[c].custom=false;
@@ -100,7 +100,7 @@ void Templates::applyNumericTemplate(uint64_t tpl)
for (int i=0; i<10 ; i++) { for (int i=0; i<10 ; i++) {
rx[i]=false; rx[i]=false;
} }
int thrsw=GetEepromInterface()->getCapability(GetThrSwitch); int thrsw=firmware->getCapability(GetThrSwitch);
MixData *md = &model.mixData[0]; MixData *md = &model.mixData[0];
uint8_t spo2ch=(tpl & 0x0F); uint8_t spo2ch=(tpl & 0x0F);
tpl>>=4; tpl>>=4;
@@ -554,7 +554,7 @@ void Templates::applyTemplate(uint8_t idx)
int8_t heli_ar4[] = {-30, -15, 0, 50, 100}; int8_t heli_ar4[] = {-30, -15, 0, 50, 100};
int8_t heli_ar5[] = {-100, -50, 0, 50, 100}; int8_t heli_ar5[] = {-100, -50, 0, 50, 100};
int thrsw=GetEepromInterface()->getCapability(GetThrSwitch); int thrsw=firmware->getCapability(GetThrSwitch);
MixData *md = &model.mixData[0]; MixData *md = &model.mixData[0];
//CC(STK) -> vSTK //CC(STK) -> vSTK
@@ -715,7 +715,7 @@ void Templates::applyTemplate(uint8_t idx)
bool found=true; bool found=true;
while (found) { while (found) {
found=false; found=false;
for (int i=0; i< GetEepromInterface()->getCapability(Mixes); i++) { for (int i=0; i< firmware->getCapability(Mixes); i++) {
if (model.mixData[i].destCh==6) { if (model.mixData[i].destCh==6) {
gm_deleteMix(i); gm_deleteMix(i);
found=true; found=true;
@@ -827,7 +827,7 @@ void Templates::applyTemplate(uint8_t idx)
bool found=true; bool found=true;
while (found) { while (found) {
found=false; found=false;
for (int i=0; i< GetEepromInterface()->getCapability(Mixes); i++) { for (int i=0; i< firmware->getCapability(Mixes); i++) {
if (model.mixData[i].destCh==5) { if (model.mixData[i].destCh==5) {
gm_deleteMix(i); gm_deleteMix(i);
found=true; found=true;
@@ -867,11 +867,11 @@ void Templates::applyTemplate(uint8_t idx)
MixData* Templates::setDest(uint8_t dch) MixData* Templates::setDest(uint8_t dch)
{ {
uint8_t i = 0; uint8_t i = 0;
while ((g_model.mixData[i].destCh<=dch) && (g_model.mixData[i].destCh) && (i<GetEepromInterface()->getCapability(Mixes))) i++; while ((g_model.mixData[i].destCh<=dch) && (g_model.mixData[i].destCh) && (i<firmware->getCapability(Mixes))) i++;
if(i==GetEepromInterface()->getCapability(Mixes)) return &g_model.mixData[0]; if(i==firmware->getCapability(Mixes)) return &g_model.mixData[0];
memmove(&g_model.mixData[i+1],&g_model.mixData[i], memmove(&g_model.mixData[i+1],&g_model.mixData[i],
(GetEepromInterface()->getCapability(Mixes)-(i+1))*sizeof(MixData) ); (firmware->getCapability(Mixes)-(i+1))*sizeof(MixData) );
memset(&g_model.mixData[i],0,sizeof(MixData)); memset(&g_model.mixData[i],0,sizeof(MixData));
g_model.mixData[i].destCh = dch; g_model.mixData[i].destCh = dch;
return &g_model.mixData[i]; return &g_model.mixData[i];
+80 -79
View File
@@ -14,16 +14,16 @@
#define ISIZE 200 // curve image size #define ISIZE 200 // curve image size
#define ISIZEW 400 // curve image size #define ISIZEW 400 // curve image size
printDialog::printDialog(QWidget *parent, GeneralSettings *gg, ModelData *gm, QString filename) : PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralSettings *gg, ModelData *gm, QString filename) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::printDialog) firmware(firmware),
g_eeGeneral(gg),
g_model(gm),
printfilename(filename),
ui(new Ui::PrintDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
this->setWindowIcon(CompanionIcon("print.png")); this->setWindowIcon(CompanionIcon("print.png"));
g_model = gm;
g_eeGeneral = gg;
printfilename=filename;
eepromInterface = GetEepromInterface();
te = ui->textEdit; te = ui->textEdit;
setWindowTitle(tr("Setup for: ") + g_model->name); setWindowTitle(tr("Setup for: ") + g_model->name);
@@ -32,13 +32,14 @@ printDialog::printDialog(QWidget *parent, GeneralSettings *gg, ModelData *gm, QS
if (modelname.isEmpty()) { if (modelname.isEmpty()) {
curvefile5=QString("%1/curve5.png").arg(qd->tempPath()); curvefile5=QString("%1/curve5.png").arg(qd->tempPath());
curvefile9=QString("%1/curve9.png").arg(qd->tempPath()); curvefile9=QString("%1/curve9.png").arg(qd->tempPath());
} else { }
else {
curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname); curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname);
curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname); curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname);
} }
printSetup(); printSetup();
int gvars=0; int gvars=0;
if (GetEepromInterface()->getCapability(HasVariants)) { if (firmware->getCapability(HasVariants)) {
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) { if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
gvars=1; gvars=1;
} }
@@ -66,7 +67,7 @@ printDialog::printDialog(QWidget *parent, GeneralSettings *gg, ModelData *gm, QS
} }
} }
void printDialog::closeEvent(QCloseEvent *event) void PrintDialog::closeEvent(QCloseEvent *event)
{ {
if (printfilename.isEmpty()) { if (printfilename.isEmpty()) {
QByteArray ba = curvefile5.toLatin1(); QByteArray ba = curvefile5.toLatin1();
@@ -78,7 +79,7 @@ void printDialog::closeEvent(QCloseEvent *event)
} }
} }
printDialog::~printDialog() PrintDialog::~PrintDialog()
{ {
delete ui; delete ui;
} }
@@ -107,15 +108,15 @@ QString doTL(const QString s, const QString color="", bool bold=false)
return "<td align=left>" + str + "</td>"; return "<td align=left>" + str + "</td>";
} }
QString printDialog::fv(const QString name, const QString value) QString PrintDialog::fv(const QString name, const QString value)
{ {
return "<b>" + name + ": </b><font color=green>" + value + "</font><br>"; return "<b>" + name + ": </b><font color=green>" + value + "</font><br>";
} }
void printDialog::printSetup() void PrintDialog::printSetup()
{ {
int gvars=0; int gvars=0;
if (GetEepromInterface()->getCapability(HasVariants)) { if (firmware->getCapability(HasVariants)) {
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) { if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
gvars=1; gvars=1;
} }
@@ -123,15 +124,15 @@ void printDialog::printSetup()
gvars=1; gvars=1;
} }
QString str = "<a name=1></a><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">"; QString str = "<a name=1></a><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
str.append(QString("<tr><td colspan=%1 ><table border=0 width=\"100%\"><tr><td><h1>").arg((GetEepromInterface()->getCapability(FlightPhases) && gvars==0) ? 2 : 1)); str.append(QString("<tr><td colspan=%1 ><table border=0 width=\"100%\"><tr><td><h1>").arg((firmware->getCapability(FlightPhases) && gvars==0) ? 2 : 1));
str.append(g_model->name); str.append(g_model->name);
str.append("&nbsp;("); str.append("&nbsp;(");
str.append(eepromInterface->getName()); str.append(firmware->getEepromInterface()->getName());
str.append(")</h1></td><td align=right valign=top NOWRAP><font size=-1>"+tr("printed on: %1").arg(QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate))+"</font></td></tr></table></td></tr><tr><td><table border=0 cellspacing=0 cellpadding=3>"); str.append(")</h1></td><td align=right valign=top NOWRAP><font size=-1>"+tr("printed on: %1").arg(QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate))+"</font></td></tr></table></td></tr><tr><td><table border=0 cellspacing=0 cellpadding=3>");
str.append("<tr><td><h2>"+tr("General Model Settings")+"</h2></td></tr>"); str.append("<tr><td><h2>"+tr("General Model Settings")+"</h2></td></tr>");
str.append("<tr><td>"); str.append("<tr><td>");
str.append(fv(tr("Name"), g_model->name)); str.append(fv(tr("Name"), g_model->name));
str.append("<b>"+tr("EEprom Size")+QString(": </b><font color=green>%1</font><br>").arg(eepromInterface->getSize(*g_model))); str.append("<b>"+tr("EEprom Size")+QString(": </b><font color=green>%1</font><br>").arg(firmware->getEepromInterface()->getSize(*g_model)));
str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down
str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down
str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay, str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay,
@@ -151,19 +152,19 @@ void printDialog::printSetup()
te->append(str); te->append(str);
} }
QString printDialog::printPhases() QString PrintDialog::printPhases()
{ {
int gvars=0; int gvars=0;
int gvarnum=0; int gvarnum=0;
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!GetEepromInterface()->getCapability(HasVariants) && GetEepromInterface()->getCapability(Gvars))) { if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!firmware->getCapability(HasVariants) && firmware->getCapability(Gvars))) {
if (GetEepromInterface()->getCapability(GvarsFlightPhases)) { if (firmware->getCapability(GvarsFlightPhases)) {
gvars=1; gvars=1;
gvarnum=GetEepromInterface()->getCapability(Gvars); gvarnum=firmware->getCapability(Gvars);
} }
} }
QString str=""; QString str="";
str.append(QString("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=%1><h2>").arg(gvars==0 ? 8+GetEepromInterface()->getCapability(RotaryEncoders) : 8+gvarnum+GetEepromInterface()->getCapability(RotaryEncoders))); str.append(QString("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=%1><h2>").arg(gvars==0 ? 8+firmware->getCapability(RotaryEncoders) : 8+gvarnum+firmware->getCapability(RotaryEncoders)));
str.append(tr("Flight modes Settings")); str.append(tr("Flight modes Settings"));
str.append("</h2></td></tr><tr><td style=\"border-style:none;\">&nbsp;</td><td colspan=2 align=center><b>"); str.append("</h2></td></tr><tr><td style=\"border-style:none;\">&nbsp;</td><td colspan=2 align=center><b>");
str.append(tr("Fades")+"</b></td>"); str.append(tr("Fades")+"</b></td>");
@@ -171,8 +172,8 @@ QString printDialog::printPhases()
if (gvars) { if (gvars) {
str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</b></td>"); str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</b></td>");
} }
if (GetEepromInterface()->getCapability(RotaryEncoders)) { if (firmware->getCapability(RotaryEncoders)) {
str.append(QString("<td colspan=%1 align=center><b>").arg(GetEepromInterface()->getCapability(RotaryEncoders))+tr("Rot.Enc.")+"</b></td>"); str.append(QString("<td colspan=%1 align=center><b>").arg(firmware->getCapability(RotaryEncoders))+tr("Rot.Enc.")+"</b></td>");
} }
str.append("<td rowspan=2 align=\"center\" valign=\"bottom\"><b>"+tr("Switch")+"</b></td></tr><tr><td align=center width=\"90\"><b>"+tr("Flight mode name")); str.append("<td rowspan=2 align=\"center\" valign=\"bottom\"><b>"+tr("Switch")+"</b></td></tr><tr><td align=center width=\"90\"><b>"+tr("Flight mode name"));
str.append("</b></td><td align=center width=\"30\"><b>"+tr("IN")+"</b></td><td align=center width=\"30\"><b>"+tr("OUT")+"</b></td>"); str.append("</b></td><td align=center width=\"30\"><b>"+tr("IN")+"</b></td><td align=center width=\"30\"><b>"+tr("OUT")+"</b></td>");
@@ -184,11 +185,11 @@ QString printDialog::printPhases()
str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model->gvars_names[i])); str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model->gvars_names[i]));
} }
} }
for (int i=0; i<GetEepromInterface()->getCapability(RotaryEncoders); i++) { for (int i=0; i<firmware->getCapability(RotaryEncoders); i++) {
str.append(QString("<td align=\"center\"><b>RE%1</b></td>").arg((i==0 ? 'A': 'B'))); str.append(QString("<td align=\"center\"><b>RE%1</b></td>").arg((i==0 ? 'A': 'B')));
} }
str.append("</tr>"); str.append("</tr>");
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (int i=0; i<firmware->getCapability(FlightPhases); i++) {
PhaseData *pd=&g_model->phaseData[i]; PhaseData *pd=&g_model->phaseData[i];
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> <font size=+1 face='Courier New' color=green>%2</font></td><td width=\"30\" align=\"right\"><font size=+1 face='Courier New' color=green>%3</font></td><td width=\"30\" align=\"right\"><font size=+1 face='Courier New' color=green>%4</font></td>").arg(i).arg(pd->name).arg(pd->fadeIn).arg(pd->fadeOut)); str.append("<tr><td><b>"+tr("FM")+QString("%1</b> <font size=+1 face='Courier New' color=green>%2</font></td><td width=\"30\" align=\"right\"><font size=+1 face='Courier New' color=green>%3</font></td><td width=\"30\" align=\"right\"><font size=+1 face='Courier New' color=green>%4</font></td>").arg(i).arg(pd->name).arg(pd->fadeIn).arg(pd->fadeOut));
for (int k=0; k<4; k++) { for (int k=0; k<4; k++) {
@@ -210,7 +211,7 @@ QString printDialog::printPhases()
} }
} }
} }
for (int k=0; k<GetEepromInterface()->getCapability(RotaryEncoders); k++) { for (int k=0; k<firmware->getCapability(RotaryEncoders); k++) {
if (pd->rotaryEncoders[k]<=1024) { if (pd->rotaryEncoders[k]<=1024) {
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1").arg(pd->rotaryEncoders[k])+"</font></td>"); str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1").arg(pd->rotaryEncoders[k])+"</font></td>");
} }
@@ -227,7 +228,7 @@ QString printDialog::printPhases()
return(str); return(str);
} }
void printDialog::printExpo() void PrintDialog::printExpo()
{ {
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td><h2>"; QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td><h2>";
str.append(tr("Expo/Dr Settings")); str.append(tr("Expo/Dr Settings"));
@@ -264,12 +265,12 @@ void printDialog::printExpo()
str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight,true)).rightJustified(6, ' '); str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight,true)).rightJustified(6, ' ');
str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;"); str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
if (GetEepromInterface()->getCapability(FlightPhases)) { if (firmware->getCapability(FlightPhases)) {
if(ed->phases) { if(ed->phases) {
if (ed->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) { if (ed->phases!=(unsigned int)(1<<firmware->getCapability(FlightPhases))-1) {
int mask=1; int mask=1;
int first=0; int first=0;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases);i++) { for (int i=0; i<firmware->getCapability(FlightPhases);i++) {
if (!(ed->phases & mask)) { if (!(ed->phases & mask)) {
first++; first++;
} }
@@ -282,7 +283,7 @@ void printDialog::printExpo()
} }
mask=1; mask=1;
first=1; first=1;
for (int j=0; j<GetEepromInterface()->getCapability(FlightPhases);j++) { for (int j=0; j<firmware->getCapability(FlightPhases);j++) {
if (!(ed->phases & mask)) { if (!(ed->phases & mask)) {
PhaseData *pd = &g_model->phaseData[j]; PhaseData *pd = &g_model->phaseData[j];
if (!first) { if (!first) {
@@ -303,7 +304,7 @@ void printDialog::printExpo()
if (ed->swtch.type) if (ed->swtch.type)
str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString());
str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;"); str += ed->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
if (GetEepromInterface()->getCapability(HasExpoNames)) { if (firmware->getCapability(HasExpoNames)) {
QString ExpoName; QString ExpoName;
ExpoName.append(ed->name); ExpoName.append(ed->name);
if (!ExpoName.isEmpty()) { if (!ExpoName.isEmpty()) {
@@ -318,21 +319,21 @@ void printDialog::printExpo()
} }
void printDialog::printMixes() void PrintDialog::printMixes()
{ {
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>"; QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>";
str.append(tr("Mixers")); str.append(tr("Mixers"));
str.append("</h2></td></tr><tr><td><table border=0 cellspacing=0 cellpadding=3>"); str.append("</h2></td></tr><tr><td><table border=0 cellspacing=0 cellpadding=3>");
unsigned int lastCHN = 255; unsigned int lastCHN = 255;
for(int i=0; i<GetEepromInterface()->getCapability(Mixes); i++) { for(int i=0; i<firmware->getCapability(Mixes); i++) {
MixData *md = &g_model->mixData[i]; MixData *md = &g_model->mixData[i];
if(!md->destCh || md->destCh>(unsigned int)GetEepromInterface()->getCapability(Outputs) ) break; if(!md->destCh || md->destCh>(unsigned int)firmware->getCapability(Outputs) ) break;
str.append("<tr><td><font size=+1 face='Courier New'><b>"); str.append("<tr><td><font size=+1 face='Courier New'><b>");
if(lastCHN!=md->destCh) { if(lastCHN!=md->destCh) {
lastCHN=md->destCh; lastCHN=md->destCh;
QString chname=tr("CH")+QString("%1 ").arg(lastCHN,2,10,QChar('0')); QString chname=tr("CH")+QString("%1 ").arg(lastCHN,2,10,QChar('0'));
if (GetEepromInterface()->getCapability(HasChNames)) { if (firmware->getCapability(HasChNames)) {
QString name=g_model->limitData[md->destCh-1].name; QString name=g_model->limitData[md->destCh-1].name;
if (!name.isEmpty()) { if (!name.isEmpty()) {
name.append(" "); name.append(" ");
@@ -356,16 +357,16 @@ void printDialog::printMixes()
if (md->carryTrim) str += " " + tr("noTrim"); if (md->carryTrim) str += " " + tr("noTrim");
if (md->sOffset) str += " "+ tr("Offset") + QString(" %1").arg(getGVarString(md->sOffset)); if (md->sOffset) str += " "+ tr("Offset") + QString(" %1").arg(getGVarString(md->sOffset));
str += md->curve.toString().replace("<", "&lt;").replace(">", "&gt;"); str += md->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
float scale=GetEepromInterface()->getCapability(SlowScale); float scale=firmware->getCapability(SlowScale);
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale); if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale); if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn); if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
if (GetEepromInterface()->getCapability(FlightPhases)) { if (firmware->getCapability(FlightPhases)) {
if(md->phases) { if(md->phases) {
if (md->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) { if (md->phases!=(unsigned int)(1<<firmware->getCapability(FlightPhases))-1) {
int mask=1; int mask=1;
int first=0; int first=0;
for (int i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) { for (int i=0; i<firmware->getCapability(FlightPhases); i++) {
if (!(md->phases & mask)) { if (!(md->phases & mask)) {
first++; first++;
} }
@@ -378,7 +379,7 @@ void printDialog::printMixes()
} }
mask=1; mask=1;
first=1; first=1;
for (int j=0; j<GetEepromInterface()->getCapability(FlightPhases);j++) { for (int j=0; j<firmware->getCapability(FlightPhases);j++) {
if (!(md->phases & mask)) { if (!(md->phases & mask)) {
PhaseData *pd = &g_model->phaseData[j]; PhaseData *pd = &g_model->phaseData[j];
if (!first) { if (!first) {
@@ -396,7 +397,7 @@ void printDialog::printMixes()
} }
} }
} }
if (GetEepromInterface()->getCapability(HasMixerNames)) { if (firmware->getCapability(HasMixerNames)) {
QString MixerName; QString MixerName;
MixerName.append(md->name); MixerName.append(md->name);
if (!MixerName.isEmpty()) { if (!MixerName.isEmpty()) {
@@ -409,41 +410,41 @@ void printDialog::printMixes()
te->append(str); te->append(str);
} }
void printDialog::printLimits() void PrintDialog::printLimits()
{ {
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">"; QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
int numcol; int numcol;
numcol=(GetEepromInterface()->getCapability(Outputs)+1)>17 ? 17:GetEepromInterface()->getCapability(Outputs)+1; numcol=(firmware->getCapability(Outputs)+1)>17 ? 17:firmware->getCapability(Outputs)+1;
str.append(QString("<tr><td colspan=%1><h2>").arg(numcol)+tr("Limits")+"</h2></td></tr>"); str.append(QString("<tr><td colspan=%1><h2>").arg(numcol)+tr("Limits")+"</h2></td></tr>");
str.append("<tr><td>&nbsp;</td>"); str.append("<tr><td>&nbsp;</td>");
if (GetEepromInterface()->getCapability(Outputs)<17) { if (firmware->getCapability(Outputs)<17) {
for(int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true));
} }
str.append("</tr>"); str.append("</tr>");
if (GetEepromInterface()->getCapability(HasChNames)) { if (firmware->getCapability(HasChNames)) {
str.append("<tr><td><b>"+tr("Name")+"</b></td>"); str.append("<tr><td><b>"+tr("Name")+"</b></td>");
for(int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(g_model->limitData[i].name,"green")); str.append(doTR(g_model->limitData[i].name,"green"));
} }
} }
str.append("<tr><td><b>"+tr("Offset")+"</b></td>"); str.append("<tr><td><b>"+tr("Offset")+"</b></td>");
for(int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green"));
} }
str.append("</tr>"); str.append("</tr>");
str.append("<tr><td><b>"+tr("Min")+"</b></td>"); str.append("<tr><td><b>"+tr("Min")+"</b></td>");
for(int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number(g_model->limitData[i].min),"green")); str.append(doTR(QString::number(g_model->limitData[i].min),"green"));
} }
str.append("</tr>"); str.append("</tr>");
str.append("<tr><td><b>"+tr("Max")+"</b></td>"); str.append("<tr><td><b>"+tr("Max")+"</b></td>");
for(int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number(g_model->limitData[i].max),"green")); str.append(doTR(QString::number(g_model->limitData[i].max),"green"));
} }
str.append("</tr>"); str.append("</tr>");
str.append("<tr><td><b>"+tr("Invert")+"</b></td>"); str.append("<tr><td><b>"+tr("Invert")+"</b></td>");
for(int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green"));
} }
} else { } else {
@@ -451,7 +452,7 @@ void printDialog::printLimits()
str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true));
} }
str.append("</tr>"); str.append("</tr>");
if (GetEepromInterface()->getCapability(HasChNames)) { if (firmware->getCapability(HasChNames)) {
str.append("<tr><td><b>"+tr("Name")+"</b></td>"); str.append("<tr><td><b>"+tr("Name")+"</b></td>");
for(int i=0; i<16; i++) { for(int i=0; i<16; i++) {
str.append(doTR(g_model->limitData[i].name,"green")); str.append(doTR(g_model->limitData[i].name,"green"));
@@ -479,33 +480,33 @@ void printDialog::printLimits()
str.append("</tr>"); str.append("</tr>");
str.append(QString("<tr><td colspan=%1>&nbsp;").arg(numcol)+"</td></tr>"); str.append(QString("<tr><td colspan=%1>&nbsp;").arg(numcol)+"</td></tr>");
str.append("<tr><td>&nbsp;</td>"); str.append("<tr><td>&nbsp;</td>");
for(int i=16; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=16; i<firmware->getCapability(Outputs); i++) {
str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true));
} }
str.append("</tr>"); str.append("</tr>");
if (GetEepromInterface()->getCapability(HasChNames)) { if (firmware->getCapability(HasChNames)) {
str.append("<tr><td><b>"+tr("Name")+"</b></td>"); str.append("<tr><td><b>"+tr("Name")+"</b></td>");
for(int i=16; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=16; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(g_model->limitData[i].name,"green")); str.append(doTR(g_model->limitData[i].name,"green"));
} }
} }
str.append("<tr><td><b>"+tr("Offset")+"</b></td>"); str.append("<tr><td><b>"+tr("Offset")+"</b></td>");
for(int i=16; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=16; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green"));
} }
str.append("</tr>"); str.append("</tr>");
str.append("<tr><td><b>"+tr("Min")+"</b></td>"); str.append("<tr><td><b>"+tr("Min")+"</b></td>");
for(int i=16; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=16; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number(g_model->limitData[i].min),"green")); str.append(doTR(QString::number(g_model->limitData[i].min),"green"));
} }
str.append("</tr>"); str.append("</tr>");
str.append("<tr><td><b>"+tr("Max")+"</b></td>"); str.append("<tr><td><b>"+tr("Max")+"</b></td>");
for(int i=16; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=16; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number(g_model->limitData[i].max),"green")); str.append(doTR(QString::number(g_model->limitData[i].max),"green"));
} }
str.append("</tr>"); str.append("</tr>");
str.append("<tr><td><b>"+tr("Invert")+"</b></td>"); str.append("<tr><td><b>"+tr("Invert")+"</b></td>");
for(int i=16; i<GetEepromInterface()->getCapability(Outputs); i++) { for(int i=16; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green"));
} }
} }
@@ -515,7 +516,7 @@ void printDialog::printLimits()
te->append(str); te->append(str);
} }
void printDialog::printCurves() void PrintDialog::printCurves()
{ {
int i,r,g,b,c,count; int i,r,g,b,c,count;
char buffer[16]; char buffer[16];
@@ -524,7 +525,7 @@ void printDialog::printCurves()
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-before:auto;\" width=\"100%\"><tr><td><h2>"; QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-before:auto;\" width=\"100%\"><tr><td><h2>";
str.append(tr("Curves")); str.append(tr("Curves"));
str.append("</h2></td></tr><tr><td>"); str.append("</h2></td></tr><tr><td>");
int numcurves=GetEepromInterface()->getCapability(NumCurves); int numcurves=firmware->getCapability(NumCurves);
if (numcurves==0) { if (numcurves==0) {
numcurves=16; numcurves=16;
} }
@@ -622,14 +623,14 @@ void printDialog::printCurves()
te->append(str); te->append(str);
} }
void printDialog::printSwitches() void PrintDialog::printSwitches()
{ {
int sc=0; int sc=0;
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">"; QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>"); str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>");
str.append("<tr><td><table border=0 cellspacing=0 cellpadding=3>"); str.append("<tr><td><table border=0 cellspacing=0 cellpadding=3>");
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) { for (int i=0; i<firmware->getCapability(LogicalSwitches); i++) {
if (g_model->customSw[i].func) { if (g_model->customSw[i].func) {
str.append("<tr>"); str.append("<tr>");
if (i<9) { if (i<9) {
@@ -649,15 +650,15 @@ void printDialog::printSwitches()
te->append(str); te->append(str);
} }
void printDialog::printGvars() void PrintDialog::printGvars()
{ {
int gvars=0; int gvars=0;
int gvarnum=0; int gvarnum=0;
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!GetEepromInterface()->getCapability(HasVariants) && GetEepromInterface()->getCapability(Gvars))) { if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!firmware->getCapability(HasVariants) && firmware->getCapability(Gvars))) {
gvars=1; gvars=1;
gvarnum=GetEepromInterface()->getCapability(Gvars); gvarnum=firmware->getCapability(Gvars);
} }
if (!GetEepromInterface()->getCapability(GvarsFlightPhases) && (gvars==1 && GetEepromInterface()->getCapability(Gvars))) { if (!firmware->getCapability(GvarsFlightPhases) && (gvars==1 && firmware->getCapability(Gvars))) {
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">"; QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
str.append("<tr><td><h2>"+tr("Global Variables")+"</h2></td></tr>"); str.append("<tr><td><h2>"+tr("Global Variables")+"</h2></td></tr>");
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=3 width=100>"); str.append("<tr><td><table border=1 cellspacing=0 cellpadding=3 width=100>");
@@ -679,7 +680,7 @@ void printDialog::printGvars()
} }
} }
void printDialog::printFSwitches() void PrintDialog::printFSwitches()
{ {
int sc=0; int sc=0;
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">"; QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
@@ -691,7 +692,7 @@ void printDialog::printFSwitches()
str.append(doTL(tr("Repeat"), "", true)); str.append(doTL(tr("Repeat"), "", true));
str.append(doTL(tr("Enabled"), "", true)); str.append(doTL(tr("Enabled"), "", true));
str.append("</tr>"); str.append("</tr>");
for(int i=0; i<GetEepromInterface()->getCapability(CustomFunctions); i++) { for(int i=0; i<firmware->getCapability(CustomFunctions); i++) {
if (g_model->funcSw[i].swtch.type!=SWITCH_TYPE_NONE) { if (g_model->funcSw[i].swtch.type!=SWITCH_TYPE_NONE) {
str.append("<tr>"); str.append("<tr>");
str.append(doTC(g_model->funcSw[i].swtch.toString(),"green")); str.append(doTC(g_model->funcSw[i].swtch.toString(),"green"));
@@ -718,7 +719,7 @@ void printDialog::printFSwitches()
te->append(str); te->append(str);
} }
void printDialog::printFrSky() void PrintDialog::printFrSky()
{ {
int tc=0; int tc=0;
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">"; QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
@@ -756,10 +757,10 @@ void printDialog::printFrSky()
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Blades")+"</b></td><td colspan=8 align=\"left\">"+fd->blades+"</td></tr>"); str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Blades")+"</b></td><td colspan=8 align=\"left\">"+fd->blades+"</td></tr>");
str.append("<tr><td colspan=10 align=\"Left\" height=\"4px\"></td></tr></table>"); str.append("<tr><td colspan=10 align=\"Left\" height=\"4px\"></td></tr></table>");
#if 0 #if 0
if (GetEepromInterface()->getCapability(TelemetryBars) || (GetEepromInterface()->getCapability(TelemetryCSFields))) { if (firmware->getCapability(TelemetryBars) || (firmware->getCapability(TelemetryCSFields))) {
int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields); int cols=firmware->getCapability(TelemetryColsCSFields);
if (cols==0) cols=2; if (cols==0) cols=2;
for (int j=0; j<GetEepromInterface()->getCapability(TelemetryCSFields)/(4*cols); j++ ) { for (int j=0; j<firmware->getCapability(TelemetryCSFields)/(4*cols); j++ ) {
if (fd->screens[j].type==0) { if (fd->screens[j].type==0) {
if (cols==2) { if (cols==2) {
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=3 align=\"Left\"><b>"+tr("Custom Telemetry View")+"</b></td></tr>"); str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=3 align=\"Left\"><b>"+tr("Custom Telemetry View")+"</b></td></tr>");
@@ -804,7 +805,7 @@ void printDialog::printFrSky()
te->append(str); te->append(str);
} }
void printDialog::on_printButton_clicked() void PrintDialog::on_printButton_clicked()
{ {
QPrinter printer; QPrinter printer;
printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter);
@@ -815,7 +816,7 @@ void printDialog::on_printButton_clicked()
te->print(&printer); te->print(&printer);
} }
void printDialog::on_printFileButton_clicked() void PrintDialog::on_printFileButton_clicked()
{ {
QString fn = QFileDialog::getSaveFileName(this,tr("Select PDF output file"),QString(),tr("ODF files (*.odt);;PDF Files(*.pdf);;HTML-Files (*.htm *.html);;All Files (*)")); QString fn = QFileDialog::getSaveFileName(this,tr("Select PDF output file"),QString(),tr("ODF files (*.odt);;PDF Files(*.pdf);;HTML-Files (*.htm *.html);;All Files (*)"));
if (fn.isEmpty()) if (fn.isEmpty())
@@ -835,7 +836,7 @@ void printDialog::on_printFileButton_clicked()
} }
} }
void printDialog::printToFile() void PrintDialog::printToFile()
{ {
if (printfilename.isEmpty()) if (printfilename.isEmpty())
return; return;
@@ -854,7 +855,7 @@ void printDialog::printToFile()
} }
} }
void printDialog::autoClose() void PrintDialog::autoClose()
{ {
this->close(); this->close();
} }
+9 -8
View File
@@ -7,26 +7,27 @@
#include "eeprominterface.h" #include "eeprominterface.h"
namespace Ui { namespace Ui {
class printDialog; class PrintDialog;
} }
class printDialog : public QDialog class PrintDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit printDialog(QWidget *parent = 0, GeneralSettings *gg = 0, ModelData *gm = 0, QString filename=""); explicit PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralSettings *gg, ModelData *gm, QString filename="");
~printDialog(); ~PrintDialog();
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
ModelData *g_model; FirmwareInterface * firmware;
GeneralSettings *g_eeGeneral; GeneralSettings * g_eeGeneral;
EEPROMInterface *eepromInterface; ModelData * g_model;
QString printfilename; QString printfilename;
private: private:
Ui::printDialog *ui; Ui::PrintDialog *ui;
void printSetup(); void printSetup();
QString printPhases(); QString printPhases();
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>printDialog</class> <class>PrintDialog</class>
<widget class="QDialog" name="printDialog"> <widget class="QDialog" name="PrintDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
+5 -5
View File
@@ -335,7 +335,7 @@ void SimulatorDialog::initUi(T * ui)
windowName = tr("Simulating Radio (%1)").arg(txInterface->getName()); windowName = tr("Simulating Radio (%1)").arg(txInterface->getName());
setWindowTitle(windowName); setWindowTitle(windowName);
simulator = txInterface->getSimulator(); simulator = GetCurrentFirmware()->getSimulator();
lcd->setData(simulator->getLcd(), lcdWidth, 64, lcdDepth); lcd->setData(simulator->getLcd(), lcdWidth, 64, lcdDepth);
if (flags & SIMULATOR_FLAGS_STICK_MODE_LEFT) { if (flags & SIMULATOR_FLAGS_STICK_MODE_LEFT) {
@@ -349,7 +349,7 @@ void SimulatorDialog::initUi(T * ui)
setTrims(); setTrims();
int outputs = std::min(16, txInterface->getCapability(Outputs)); int outputs = std::min(16, GetCurrentFirmware()->getCapability(Outputs));
for (int i=0; i<outputs; i++) { for (int i=0; i<outputs; i++) {
int column = i / (outputs/2); int column = i / (outputs/2);
int line = i % (outputs/2); int line = i % (outputs/2);
@@ -390,7 +390,7 @@ void SimulatorDialog::initUi(T * ui)
channelsLayout->addWidget(value, line, column == 0 ? 2 : 3, 1, 1); channelsLayout->addWidget(value, line, column == 0 ? 2 : 3, 1, 1);
} }
int switches = txInterface->getCapability(LogicalSwitches); int switches = GetCurrentFirmware()->getCapability(LogicalSwitches);
for (int i=0; i<switches; i++) { for (int i=0; i<switches; i++) {
QFrame * swtch = new QFrame(tabWidget); QFrame * swtch = new QFrame(tabWidget);
swtch->setAutoFillBackground(true); swtch->setAutoFillBackground(true);
@@ -689,7 +689,7 @@ void SimulatorDialog::setValues()
Trims trims; Trims trims;
simulator->getTrims(trims); simulator->getTrims(trims);
for (int i=0; i<std::min(16, GetEepromInterface()->getCapability(Outputs)); i++) { for (int i=0; i<std::min(16, GetCurrentFirmware()->getCapability(Outputs)); i++) {
channelSliders[i]->setValue(chVal(outputs.chans[i])); channelSliders[i]->setValue(chVal(outputs.chans[i]));
channelValues[i]->setText(QString("%1").arg((qreal)outputs.chans[i]*100/1024, 0, 'f', 1)); channelValues[i]->setText(QString("%1").arg((qreal)outputs.chans[i]*100/1024, 0, 'f', 1));
} }
@@ -703,7 +703,7 @@ void SimulatorDialog::setValues()
QString CSWITCH_ON = "QLabel { background-color: #4CC417 }"; QString CSWITCH_ON = "QLabel { background-color: #4CC417 }";
QString CSWITCH_OFF = "QLabel { }"; QString CSWITCH_OFF = "QLabel { }";
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) { for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
logicalSwitchLabels[i]->setStyleSheet(outputs.vsw[i] ? CSWITCH_ON : CSWITCH_OFF); logicalSwitchLabels[i]->setStyleSheet(outputs.vsw[i] ? CSWITCH_ON : CSWITCH_OFF);
} }
+3 -1
View File
@@ -99,7 +99,9 @@ int main(int argc, char *argv[])
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
RegisterFirmwares(); RegisterEepromInterfaces();
registerOpenTxFirmwares();
SimulatorDialog *dialog; SimulatorDialog *dialog;
const char * eepromFileName; const char * eepromFileName;
QString fileName; QString fileName;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -8726,7 +8726,7 @@ m2560 for v4.1 boards</source>
<message> <message>
<location filename="../contributorsdialog.cpp" line="23"/> <location filename="../contributorsdialog.cpp" line="23"/>
<source>People who have contributed to this project</source> <source>People who have contributed to this project</source>
<translation>Personnes qui ont contribué au projet</translation> <translation>Donateurs supportant le projet</translation>
</message> </message>
<message> <message>
<location filename="../contributorsdialog.cpp" line="52"/> <location filename="../contributorsdialog.cpp" line="52"/>
+56 -54
View File
@@ -225,12 +225,12 @@
<message> <message>
<location filename="../modeledit/curves.ui" line="68"/> <location filename="../modeledit/curves.ui" line="68"/>
<source>Fixed X</source> <source>Fixed X</source>
<translation type="unfinished"></translation> <translation>Stałe X</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/curves.ui" line="73"/> <location filename="../modeledit/curves.ui" line="73"/>
<source>Custom X</source> <source>Custom X</source>
<translation type="unfinished"></translation> <translation>Własny X</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/curves.ui" line="82"/> <location filename="../modeledit/curves.ui" line="82"/>
@@ -567,13 +567,13 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location filename="../modeledit/expodialog.ui" line="36"/> <location filename="../modeledit/expodialog.ui" line="36"/>
<source>Source for the mixer.</source> <source>Source for the mixer.</source>
<translation type="unfinished"></translation> <translation>Źródło miksera.</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/expodialog.ui" line="269"/> <location filename="../modeledit/expodialog.ui" line="269"/>
<source>Switch used to enable the line. <source>Switch used to enable the line.
If blank then the input is considered to be &quot;ON&quot; all the time.</source> If blank then the input is considered to be &quot;ON&quot; all the time.</source>
<translation type="unfinished"></translation> <translation>Przełącznik używany do akrywacji linii. Jeśli puste linia jest uznawana za aktywną cały czas.</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/expodialog.ui" line="285"/> <location filename="../modeledit/expodialog.ui" line="285"/>
@@ -593,7 +593,7 @@ If blank then the input is considered to be &quot;ON&quot; all the time.</source
<message> <message>
<location filename="../modeledit/expodialog.ui" line="388"/> <location filename="../modeledit/expodialog.ui" line="388"/>
<source>Curve applied to the source.</source> <source>Curve applied to the source.</source>
<translation type="unfinished"></translation> <translation>Krzywa załączona do źródła.</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/expodialog.cpp" line="17"/> <location filename="../modeledit/expodialog.cpp" line="17"/>
@@ -630,7 +630,7 @@ If blank then the input is considered to be &quot;ON&quot; all the time.</source
<message> <message>
<location filename="../wizarddialog.cpp" line="739"/> <location filename="../wizarddialog.cpp" line="739"/>
<source>Throttle Channel:</source> <source>Throttle Channel:</source>
<translation type="unfinished"></translation> <translation>Kanał gazu:</translation>
</message> </message>
<message> <message>
<location filename="../wizarddialog.cpp" line="741"/> <location filename="../wizarddialog.cpp" line="741"/>
@@ -1357,12 +1357,12 @@ To ustawienie jest używane przez szablony, określa jakie wyjście przypisane j
<message> <message>
<location filename="../generaledit.ui" line="543"/> <location filename="../generaledit.ui" line="543"/>
<source>Default Channel Order</source> <source>Default Channel Order</source>
<translation type="unfinished">Bazowa kolejność kanałów</translation> <translation>Bazowa kolejność kanałów</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="686"/> <location filename="../generaledit.ui" line="686"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Channel order&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Defines the order of the default mixes created on a new model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Channel order&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Defines the order of the default mixes created on a new model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation> <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Kolejność kanałów&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Definiuje kolejność standardowych mikserów dla nowego modelu.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="703"/> <location filename="../generaledit.ui" line="703"/>
@@ -1527,42 +1527,42 @@ To ustawienie jest używane przez szablony, określa jakie wyjście przypisane j
<message> <message>
<location filename="../generaledit.ui" line="2384"/> <location filename="../generaledit.ui" line="2384"/>
<source>Pot. 4</source> <source>Pot. 4</source>
<translation type="unfinished"></translation> <translation>Potencj. 4</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="2398"/> <location filename="../generaledit.ui" line="2398"/>
<source>Pot. 3</source> <source>Pot. 3</source>
<translation type="unfinished"></translation> <translation>Potencj. 3</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="2418"/> <location filename="../generaledit.ui" line="2418"/>
<source>Pot. 2</source> <source>Pot. 2</source>
<translation type="unfinished"></translation> <translation>Potencj. 2</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="2425"/> <location filename="../generaledit.ui" line="2425"/>
<source>Pot. 1</source> <source>Pot. 1</source>
<translation type="unfinished"></translation> <translation>Potencj. 1</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="2452"/> <location filename="../generaledit.ui" line="2452"/>
<source>Stick 3</source> <source>Stick 3</source>
<translation type="unfinished"></translation> <translation>Drążek 3</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="2489"/> <location filename="../generaledit.ui" line="2489"/>
<source>Stick 1</source> <source>Stick 1</source>
<translation type="unfinished"></translation> <translation>Drążek 1</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="2538"/> <location filename="../generaledit.ui" line="2538"/>
<source>Stick 2</source> <source>Stick 2</source>
<translation type="unfinished"></translation> <translation>Drążek 2</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="2623"/> <location filename="../generaledit.ui" line="2623"/>
<source>Stick 4</source> <source>Stick 4</source>
<translation type="unfinished"></translation> <translation>Drążek 4</translation>
</message> </message>
<message> <message>
<location filename="../generaledit.ui" line="3170"/> <location filename="../generaledit.ui" line="3170"/>
@@ -1994,7 +1994,7 @@ Jesteś pewien ?</translation>
<message> <message>
<location filename="../wizarddialog.cpp" line="774"/> <location filename="../wizarddialog.cpp" line="774"/>
<source>Throttle Channel:</source> <source>Throttle Channel:</source>
<translation type="unfinished"></translation> <translation>Kanał gazu:</translation>
</message> </message>
<message> <message>
<location filename="../wizarddialog.cpp" line="776"/> <location filename="../wizarddialog.cpp" line="776"/>
@@ -2045,7 +2045,7 @@ Jesteś pewien ?</translation>
<message> <message>
<location filename="../modeledit/inputs.cpp" line="23"/> <location filename="../modeledit/inputs.cpp" line="23"/>
<source>Clear All Inputs</source> <source>Clear All Inputs</source>
<translation type="unfinished"></translation> <translation>Wyczyść wszystkie wejścia</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/inputs.cpp" line="92"/> <location filename="../modeledit/inputs.cpp" line="92"/>
@@ -2344,13 +2344,13 @@ Jesteś pewien ?</translation>
<message> <message>
<location filename="../mainwindow.cpp" line="280"/> <location filename="../mainwindow.cpp" line="280"/>
<source>A new release of Companion is available, please check the OpenTX website!</source> <source>A new release of Companion is available, please check the OpenTX website!</source>
<translation type="unfinished"></translation> <translation>Nowe wydanie Companion jest dostępne, proszę sprawdzić stronę OpenTX!</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="344"/> <location filename="../mainwindow.cpp" line="344"/>
<location filename="../mainwindow.cpp" line="383"/> <location filename="../mainwindow.cpp" line="383"/>
<source>Not enough memory for all the selected firmware options</source> <source>Not enough memory for all the selected firmware options</source>
<translation type="unfinished"></translation> <translation>Za mało pamięci dla wybranej konfiguracji firmware</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="347"/> <location filename="../mainwindow.cpp" line="347"/>
@@ -2492,32 +2492,32 @@ Chcesz pobrać teraz?</translation>
<message> <message>
<location filename="../mainwindow.cpp" line="1614"/> <location filename="../mainwindow.cpp" line="1614"/>
<source>New</source> <source>New</source>
<translation type="unfinished"></translation> <translation>Nowy</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="1615"/> <location filename="../mainwindow.cpp" line="1615"/>
<source>Open...</source> <source>Open...</source>
<translation type="unfinished"></translation> <translation>Otwórz...</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="1616"/> <location filename="../mainwindow.cpp" line="1616"/>
<source>Save</source> <source>Save</source>
<translation type="unfinished">Zapisz</translation> <translation>Zapisz</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="1617"/> <location filename="../mainwindow.cpp" line="1617"/>
<source>Save As...</source> <source>Save As...</source>
<translation type="unfinished"></translation> <translation>Zapisz jako...</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="1620"/> <location filename="../mainwindow.cpp" line="1620"/>
<source>Copy Model</source> <source>Copy Model</source>
<translation type="unfinished"></translation> <translation>Kopiuj Model</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="1621"/> <location filename="../mainwindow.cpp" line="1621"/>
<source>Paste Model</source> <source>Paste Model</source>
<translation type="unfinished"></translation> <translation>Wklej Model</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="1651"/> <location filename="../mainwindow.cpp" line="1651"/>
@@ -2972,7 +2972,7 @@ Chcesz pobrać teraz?</translation>
<message> <message>
<location filename="../mainwindow.cpp" line="1684"/> <location filename="../mainwindow.cpp" line="1684"/>
<source>Recent Files</source> <source>Recent Files</source>
<translation type="unfinished"></translation> <translation>Ostatnie Pliki</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="1830"/> <location filename="../mainwindow.cpp" line="1830"/>
@@ -3423,7 +3423,7 @@ Czy mimo wszystko zapisać?</translation>
<message> <message>
<location filename="../mainwindow.cpp" line="1846"/> <location filename="../mainwindow.cpp" line="1846"/>
<source>Show the list of radio profiles</source> <source>Show the list of radio profiles</source>
<translation type="unfinished"></translation> <translation>Pokaż listę profili radia</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="1886"/> <location filename="../mainwindow.cpp" line="1886"/>
@@ -3836,7 +3836,7 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location filename="../modeledit/mixerdialog.cpp" line="19"/> <location filename="../modeledit/mixerdialog.cpp" line="19"/>
<source>DEST -&gt; CH%1</source> <source>DEST -&gt; CH%1</source>
<translation type="unfinished">Cel -&gt; KAN%1</translation> <translation>Cel -&gt; KAN%1</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/mixerdialog.cpp" line="38"/> <location filename="../modeledit/mixerdialog.cpp" line="38"/>
@@ -3963,12 +3963,12 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location filename="../modeledit/mixes.cpp" line="469"/> <location filename="../modeledit/mixes.cpp" line="469"/>
<source>&amp;Toggle highlight</source> <source>&amp;Toggle highlight</source>
<translation type="unfinished"></translation> <translation>&amp;Przełącz podświetlenie</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/mixes.cpp" line="469"/> <location filename="../modeledit/mixes.cpp" line="469"/>
<source>Ctrl+T</source> <source>Ctrl+T</source>
<translation type="unfinished"></translation> <translation>Ctrl+T</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/mixes.cpp" line="471"/> <location filename="../modeledit/mixes.cpp" line="471"/>
@@ -4002,7 +4002,7 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location filename="../modeledit/mixes.cpp" line="473"/> <location filename="../modeledit/mixes.cpp" line="473"/>
<source>C&amp;ut</source> <source>C&amp;ut</source>
<translation type="unfinished"></translation> <translation>&amp;Wytnij</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/mixes.cpp" line="474"/> <location filename="../modeledit/mixes.cpp" line="474"/>
@@ -4352,17 +4352,17 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location filename="../modeledit/setup_module.ui" line="91"/> <location filename="../modeledit/setup_module.ui" line="91"/>
<source>CH </source> <source>CH </source>
<translation type="unfinished"></translation> <translation>Kan</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/setup_module.ui" line="198"/> <location filename="../modeledit/setup_module.ui" line="198"/>
<source> us</source> <source> us</source>
<translation type="unfinished"></translation> <translation> us</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/setup_module.ui" line="313"/> <location filename="../modeledit/setup_module.ui" line="313"/>
<source> ms</source> <source> ms</source>
<translation type="unfinished"> ms</translation> <translation> ms</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/setup_module.ui" line="391"/> <location filename="../modeledit/setup_module.ui" line="391"/>
@@ -4443,7 +4443,7 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location filename="../wizarddialog.cpp" line="809"/> <location filename="../wizarddialog.cpp" line="809"/>
<source>Throttle Channel:</source> <source>Throttle Channel:</source>
<translation type="unfinished"></translation> <translation>Kanał gazu:</translation>
</message> </message>
<message> <message>
<location filename="../wizarddialog.cpp" line="811"/> <location filename="../wizarddialog.cpp" line="811"/>
@@ -4939,7 +4939,7 @@ p, li { white-space: pre-wrap; }
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1217"/> <location filename="../firmwares/opentx/opentxinterface.cpp" line="1217"/>
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1227"/> <location filename="../firmwares/opentx/opentxinterface.cpp" line="1227"/>
<source>Channel values displayed in us</source> <source>Channel values displayed in us</source>
<translation type="unfinished"></translation> <translation>Wartosći kanałów wyswietlone w us</translation>
</message> </message>
<message> <message>
<source>In model setup menus automatically set source by moving some of them</source> <source>In model setup menus automatically set source by moving some of them</source>
@@ -5223,7 +5223,7 @@ p, li { white-space: pre-wrap; }
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1174"/> <location filename="../firmwares/opentx/opentxinterface.cpp" line="1174"/>
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1199"/> <location filename="../firmwares/opentx/opentxinterface.cpp" line="1199"/>
<source>In model setup menus automatically set source by moving the control</source> <source>In model setup menus automatically set source by moving the control</source>
<translation type="unfinished"></translation> <translation>W menu ustawień modelu automatycznie wybierz źródło poprzez poruszenie nim</translation>
</message> </message>
<message> <message>
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1044"/> <location filename="../firmwares/opentx/opentxinterface.cpp" line="1044"/>
@@ -5233,7 +5233,7 @@ p, li { white-space: pre-wrap; }
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1175"/> <location filename="../firmwares/opentx/opentxinterface.cpp" line="1175"/>
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1200"/> <location filename="../firmwares/opentx/opentxinterface.cpp" line="1200"/>
<source>In model setup menus automatically set switch by moving the control</source> <source>In model setup menus automatically set switch by moving the control</source>
<translation type="unfinished"></translation> <translation>W menu ustawień modelu automatycznie wybierz źródło poprzez poruszenie nim</translation>
</message> </message>
<message> <message>
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1094"/> <location filename="../firmwares/opentx/opentxinterface.cpp" line="1094"/>
@@ -6427,14 +6427,16 @@ Zespół OpenTX/Companion.</translation>
<message> <message>
<location filename="../firmwares/opentx/open9xStockeeprom.cpp" line="92"/> <location filename="../firmwares/opentx/open9xStockeeprom.cpp" line="92"/>
<source>Simultaneous usage of expo and curves is no longer supported in OpenTX</source> <source>Simultaneous usage of expo and curves is no longer supported in OpenTX</source>
<translation type="unfinished"></translation> <translation>Jednoczesne użycie expo i krzywych nie jest dłużej wspierane w OpenTX</translation>
</message> </message>
<message> <message>
<location filename="../warnings.h" line="5"/> <location filename="../warnings.h" line="5"/>
<source>Thank you for upgrading to OpenTX 2.0. This is a major upgrade that adds and modifies a lot of things, so please make sure that you read release notes carefully to learn about the changes, and thoroughly check each of your models for proper function. <source>Thank you for upgrading to OpenTX 2.0. This is a major upgrade that adds and modifies a lot of things, so please make sure that you read release notes carefully to learn about the changes, and thoroughly check each of your models for proper function.
The OpenTX Team.</source> The OpenTX Team.</source>
<translation type="unfinished"></translation> <translation>Dziękujemy za zupgradowanie do OpenTX 2.0. Ten duży upgrade dodaje i zmienia wiele rzeczy, zatem prosimy upewnić się, że dokładnie przeczytałeś informacje o wydaniu i zapoznałeś się ze zmianami oraz sprawdziłes ustawienia wszystkich swoich modeli czy działają prawidłowo.
Zespół OpenTX.</translation>
</message> </message>
</context> </context>
<context> <context>
@@ -6569,12 +6571,12 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również
<message> <message>
<location filename="../modeledit/setup.ui" line="156"/> <location filename="../modeledit/setup.ui" line="156"/>
<source>Timer 2</source> <source>Timer 2</source>
<translation type="unfinished"></translation> <translation>Timer 2</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/setup.ui" line="172"/> <location filename="../modeledit/setup.ui" line="172"/>
<source>Timer 1</source> <source>Timer 1</source>
<translation type="unfinished"></translation> <translation>Timer 1</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/setup.ui" line="190"/> <location filename="../modeledit/setup.ui" line="190"/>
@@ -6970,7 +6972,7 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również
<message> <message>
<location filename="../modeledit/telemetry.ui" line="537"/> <location filename="../modeledit/telemetry.ui" line="537"/>
<source>CELS</source> <source>CELS</source>
<translation type="unfinished"></translation> <translation>Ogniwa</translation>
</message> </message>
<message> <message>
<location filename="../modeledit/telemetry.ui" line="583"/> <location filename="../modeledit/telemetry.ui" line="583"/>
@@ -7633,17 +7635,17 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również
<message> <message>
<location filename="../wizarddialog.cpp" line="70"/> <location filename="../wizarddialog.cpp" line="70"/>
<source>Most aircraft have a main wing and a tail with control surfaces. Flying wings and delta winged aircraft only have a single wing. The main control surface on a standard wing controls the roll of the aircraft. This surface is called an aileron.&lt;br&gt;The control surface of a delta wing controls both roll and pitch. This surface is called an elevon. </source> <source>Most aircraft have a main wing and a tail with control surfaces. Flying wings and delta winged aircraft only have a single wing. The main control surface on a standard wing controls the roll of the aircraft. This surface is called an aileron.&lt;br&gt;The control surface of a delta wing controls both roll and pitch. This surface is called an elevon. </source>
<translation type="unfinished"></translation> <translation>Większość samolotów posiada powierzchnie sterowe na skrzydłach i ogonie. Latające skrzydło oraz delta posada tylko sterowanie na skrzydłach. Główne powierzchnie sterowe starndardowych skrzydeł powodują obórt samolotu w osi podłużnej. Są to lotki.&lt;br&gt; Powierzchnie sterowe na skrzydle w delcie i latającym skrzydle działają jako lotki i ster wysokości. Są to sterolotki.</translation>
</message> </message>
<message> <message>
<location filename="../wizarddialog.cpp" line="74"/> <location filename="../wizarddialog.cpp" line="74"/>
<source>Models use one or two channels to control the ailerons.&lt;br&gt;A so called Y-cable can be used to connect a single receiver channel to two separate aileron servos. If your servos are connected by a Y-cable you should select the single-servo option.&lt;br&gt;&lt;br&gt;Aileron - Spektrum: CH2, Futaba: CH1</source> <source>Models use one or two channels to control the ailerons.&lt;br&gt;A so called Y-cable can be used to connect a single receiver channel to two separate aileron servos. If your servos are connected by a Y-cable you should select the single-servo option.&lt;br&gt;&lt;br&gt;Aileron - Spektrum: CH2, Futaba: CH1</source>
<translation type="unfinished"></translation> <translation>Większość modelu używa jednego lub 2ch kanałów do sterowania lotkami.&lt;br&gt;&lt;br&gt;Przez tzw. Y-kabel mogą być kontrolowane 2 serwa na jednym kanale. Jeśli używasz Y-kabla wybierz opcję z jednym serwem.&lt;br&gt;&lt;br&gt; Lotki - Spektrum: Kan2, Futaba: Kan1</translation>
</message> </message>
<message> <message>
<location filename="../wizarddialog.cpp" line="85"/> <location filename="../wizarddialog.cpp" line="85"/>
<source>Models use one or two channels to control the elevons.&lt;br&gt;A so called Y-cable can be used to connect single a receiver channel to two separate elevon servos. If your servos are connected by a Y-cable you should select the single-servo option.</source> <source>Models use one or two channels to control the elevons.&lt;br&gt;A so called Y-cable can be used to connect single a receiver channel to two separate elevon servos. If your servos are connected by a Y-cable you should select the single-servo option.</source>
<translation type="unfinished"></translation> <translation>Model używa jednego lub dwóch kanałów do kontrolowania sterolotek.&lt;br&gt;Przez tzw. Y-kabel mogą być kontrolowane 2 serwa na jednym kanale. Jeśli używasz Y-kabla wybierz opcję z jednym serwem.</translation>
</message> </message>
<message> <message>
<source>Most aircraft have a main wing and a tail with control surfaces. Flying wings and delta winged aircraft only have a single wing. The main control surface on a standard wing controlls the roll of the aircraft. This surface is called an aileron.&lt;br&gt;The control surface of a delta wing controls both roll and elevation. This surface is called an elevon. </source> <source>Most aircraft have a main wing and a tail with control surfaces. Flying wings and delta winged aircraft only have a single wing. The main control surface on a standard wing controlls the roll of the aircraft. This surface is called an aileron.&lt;br&gt;The control surface of a delta wing controls both roll and elevation. This surface is called an elevon. </source>
@@ -7773,12 +7775,12 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również
<message> <message>
<location filename="../apppreferencesdialog.ui" line="137"/> <location filename="../apppreferencesdialog.ui" line="137"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Channel order&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Defines the order of the default mixes created on a new model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Channel order&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Defines the order of the default mixes created on a new model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation> <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Kolejność kanałów&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Definiuje kolejność standardowych mikserów dla nowego modelu.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message> </message>
<message> <message>
<location filename="../apppreferencesdialog.ui" line="319"/> <location filename="../apppreferencesdialog.ui" line="319"/>
<source>Default Channel Order</source> <source>Default Channel Order</source>
<translation type="unfinished">Bazowa kolejność kanałów</translation> <translation>Bazowa kolejność kanałów</translation>
</message> </message>
<message> <message>
<location filename="../apppreferencesdialog.ui" line="536"/> <location filename="../apppreferencesdialog.ui" line="536"/>
@@ -8853,7 +8855,7 @@ m2560 dla platformy V4</translation>
<message> <message>
<location filename="../burndialog.cpp" line="356"/> <location filename="../burndialog.cpp" line="356"/>
<source>Profile image %1 is invalid.</source> <source>Profile image %1 is invalid.</source>
<translation type="unfinished"></translation> <translation>Obraz profilu %1 nieprawidłowy.</translation>
</message> </message>
<message> <message>
<location filename="../burndialog.cpp" line="372"/> <location filename="../burndialog.cpp" line="372"/>
@@ -9171,7 +9173,7 @@ m2560 dla platformy V4</translation>
<message> <message>
<location filename="../comparedialog.cpp" line="974"/> <location filename="../comparedialog.cpp" line="974"/>
<source>5 Point Curves</source> <source>5 Point Curves</source>
<translation type="unfinished"></translation> <translation>5-cio punktowe Krzywe</translation>
</message> </message>
<message> <message>
<location filename="../comparedialog.cpp" line="995"/> <location filename="../comparedialog.cpp" line="995"/>
@@ -9365,7 +9367,7 @@ m2560 dla platformy V4</translation>
<message> <message>
<location filename="../comparedialog.cpp" line="1004"/> <location filename="../comparedialog.cpp" line="1004"/>
<source>9 Point Curves</source> <source>9 Point Curves</source>
<translation type="unfinished"></translation> <translation>9-cio punktowe Krzywe</translation>
</message> </message>
<message> <message>
<location filename="../comparedialog.cpp" line="1077"/> <location filename="../comparedialog.cpp" line="1077"/>
@@ -9534,7 +9536,7 @@ m2560 dla platformy V4</translation>
<message> <message>
<location filename="../customizesplashdialog.cpp" line="228"/> <location filename="../customizesplashdialog.cpp" line="228"/>
<source>Cannot load profile image %1.</source> <source>Cannot load profile image %1.</source>
<translation type="unfinished"></translation> <translation>Nie mogę załadować obrazu Profilu %1.</translation>
</message> </message>
<message> <message>
<location filename="../customizesplashdialog.cpp" line="242"/> <location filename="../customizesplashdialog.cpp" line="242"/>
@@ -10096,7 +10098,7 @@ Tlačítkem Zrušit přerušíte kalibraci</translation>
<message> <message>
<location filename="../logsdialog.ui" line="111"/> <location filename="../logsdialog.ui" line="111"/>
<source>Reset</source> <source>Reset</source>
<translation type="unfinished">Zresetuj</translation> <translation>Zesetuj</translation>
</message> </message>
<message> <message>
<location filename="../logsdialog.ui" line="135"/> <location filename="../logsdialog.ui" line="135"/>
+4 -4
View File
@@ -67,13 +67,13 @@ void WizMix::addMix(ModelData &model, Input input, int weight, int channel, int
} }
else if (input==FLAPS_INPUT){ else if (input==FLAPS_INPUT){
// There ought to be some kind of constants for switches somewhere... // There ought to be some kind of constants for switches somewhere...
maxMixSwitch( "Flaps Up", model.mixData[mixIndex++], channel+1, isTaranis ? 1 :-3 , weight); //SA-UP or ELE-UP maxMixSwitch((char *)"Flaps Up", model.mixData[mixIndex++], channel+1, isTaranis ? 1 :-3 , weight); //SA-UP or ELE-UP
maxMixSwitch( "Flaps Down", model.mixData[mixIndex++], channel+1, isTaranis ? 3 : 3 , -weight); //SA-DOWN or ELE-DOWN maxMixSwitch((char *)"Flaps Down", model.mixData[mixIndex++], channel+1, isTaranis ? 3 : 3 , -weight); //SA-DOWN or ELE-DOWN
} }
else if (input==AIRBRAKES_INPUT){ else if (input==AIRBRAKES_INPUT){
maxMixSwitch( "Airbrk Off", model.mixData[mixIndex++], channel+1, isTaranis ? 13 :-2 , -weight); //SE-UP or RUD-UP maxMixSwitch((char *)"Airbrk Off", model.mixData[mixIndex++], channel+1, isTaranis ? 13 :-2 , -weight); //SE-UP or RUD-UP
maxMixSwitch( "Airbrk On", model.mixData[mixIndex++], channel+1, isTaranis ? 15 : 2 , weight); //SE-DOWN or RUD-DOWN maxMixSwitch((char *)"Airbrk On", model.mixData[mixIndex++], channel+1, isTaranis ? 15 : 2 , weight); //SE-DOWN or RUD-DOWN
} }
} }
} }
+5 -3
View File
@@ -116,14 +116,16 @@ void saveGeneralSettings(GeneralSettings & settings, global_settings & gs)
void saveModel(ModelData & m, model & xm) void saveModel(ModelData & m, model & xm)
{ {
/* TODO
model::timer_sequence & timer_sequence (xm.timer()); model::timer_sequence & timer_sequence (xm.timer());
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
TimerData & t = m.timers[i]; TimerData & t = m.timers[i];
/* TODO if (t.mode) { if (t.mode) {
timer xt(TimerSwitch::value(t.mode+TMR_NUM_OPTION), direction::value(t.dir), timer::value_type(t.val/3600, (t.val%3600)/60, t.val%60)); timer xt(TimerSwitch::value(t.mode+TMR_NUM_OPTION), direction::value(t.dir), timer::value_type(t.val/3600, (t.val%3600)/60, t.val%60));
timer_sequence.push_back(xt); timer_sequence.push_back(xt);
} */ }
} }
*/
if (m.moduleData[0].protocol != PPM || m.moduleData[0].channelsCount != 8 || m.moduleData[0].ppmDelay != 300 || m.moduleData[0].ppmPulsePol != 0) { if (m.moduleData[0].protocol != PPM || m.moduleData[0].channelsCount != 8 || m.moduleData[0].ppmDelay != 300 || m.moduleData[0].ppmPulsePol != 0) {
modulation mod; modulation mod;
mod.type(modulation::type_type::value(m.moduleData[0].protocol)); mod.type(modulation::type_type::value(m.moduleData[0].protocol));
+1 -1
View File
@@ -788,7 +788,7 @@ void AudioQueue::pause(uint16_t len)
bool AudioQueue::isPlaying(uint8_t id) bool AudioQueue::isPlaying(uint8_t id)
{ {
if (normalContext.fragment.id == id || backgroundContext.fragment.id == id) if (normalContext.fragment.id == id || (isFunctionActive(FUNCTION_BACKGND_MUSIC) && backgroundContext.fragment.id == id))
return true; return true;
uint8_t i = ridx; uint8_t i = ridx;
+4 -2
View File
@@ -342,7 +342,7 @@ int ConvertTelemetrySource_215_to_216(int source)
if (source >= TELEM_A3) if (source >= TELEM_A3)
source += 2; source += 2;
// ASpd and dTE added + 5 reserve // ASpd and dTE added + 5 reserve
if (source >= TELEM_ASPD) if (source >= TELEM_ASPEED)
source += 7; source += 7;
// A3 and A4 MIN added // A3 and A4 MIN added
if (source >= TELEM_MIN_A3) if (source >= TELEM_MIN_A3)
@@ -833,7 +833,9 @@ void ConvertModel_215_to_216(ModelData &model)
memcpy(g_model.gvars[i].name, oldModel.gvar_names[i], LEN_GVAR_NAME); memcpy(g_model.gvars[i].name, oldModel.gvar_names[i], LEN_GVAR_NAME);
} }
memcpy(&g_model.frsky, &oldModel.frsky, sizeof(oldModel.frsky)); memcpy(&g_model.frsky, &oldModel.frsky, 2*sizeof(FrSkyChannelData));
// gap for A3-A4
memcpy(((uint8_t *)&g_model.frsky) + 4*sizeof(FrSkyChannelData), ((uint8_t *)&oldModel.frsky) + 2*sizeof(FrSkyChannelData), sizeof(oldModel.frsky) - 2*sizeof(FrSkyChannelData));
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
if (g_model.frsky.screensType & (1<<i)) { if (g_model.frsky.screensType & (1<<i)) {
// gauges // gauges
+15 -25
View File
@@ -305,11 +305,6 @@ void displayTopBar()
x -= 12; x -= 12;
} }
/* SD ICON, not really needed
if (sdMounted()) {
LCD_NOTIF_ICON(x, ICON_SD);
} */
/* Audio volume */ /* Audio volume */
if (requiredSpeakerVolume == 0) if (requiredSpeakerVolume == 0)
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER0); LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER0);
@@ -717,26 +712,21 @@ void menuMainView(uint8_t event)
} }
else { else {
// Logical Switches // Logical Switches
uint8_t sw = 0; lcd_puts(TRIM_RH_X - TRIM_LEN/2 + 5, 6*FH-1, "LS 1-32");
for (uint8_t line=0; line<4; line++) { for (uint8_t sw=0; sw<NUM_LOGICAL_SWITCH; sw++) {
uint8_t y = LCD_H/2-7+line*8; div_t qr = div(sw, 10);
lcd_rect(LCD_W/2+7*FW-1, y-1, 6*8+1, 7); uint8_t y = 13 + 11 * qr.quot;
for (uint8_t col=0; col<8; col++) { uint8_t x = TRIM_RH_X - TRIM_LEN + qr.rem*5 + (qr.rem >= 5 ? 3 : 0);
uint8_t x = LCD_W/2+7*FW-1+col*(FW); LogicalSwitchData * cs = cswAddress(sw);
if (col > 0) if (cs->func == LS_FUNC_NONE) {
lcd_vline(x, y, 5); lcd_hline(x, y+6, 4);
if (getSwitch(SWSRC_SW1+sw)) { lcd_hline(x, y+7, 4);
lcd_plot(x+1, y); }
lcd_plot(x+2, y+1); else if (getSwitch(SWSRC_SW1+sw)) {
lcd_plot(x+3, y+2); lcd_filled_rect(x, y, 4, 8);
lcd_plot(x+4, y+3); }
lcd_plot(x+5, y+4); else {
lcd_plot(x+1, y+4); lcd_rect(x, y, 4, 8);
lcd_plot(x+2, y+3);
lcd_plot(x+4, y+1);
lcd_plot(x+5, y);
}
sw++;
} }
} }
} }
+3 -2
View File
@@ -1245,11 +1245,12 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val,
putsTelemetryValue(x, y, val, UNIT_RAW, att|PREC2); putsTelemetryValue(x, y, val, UNIT_RAW, att|PREC2);
break; break;
case TELEM_VSPD-1: case TELEM_VSPEED-1:
putsTelemetryValue(x, y, div10_and_round(val), UNIT_RAW, att|PREC1); putsTelemetryValue(x, y, div10_and_round(val), UNIT_RAW, att|PREC1);
break; break;
case TELEM_ASPD-1: case TELEM_ASPEED-1:
case TELEM_MAX_ASPEED-1:
putsTelemetryValue(x, y, val, UNIT_KTS, att); putsTelemetryValue(x, y, val, UNIT_KTS, att);
break; break;
+6 -4
View File
@@ -280,7 +280,8 @@ enum uartModes {
#define EXTRA_GENERAL_FIELDS \ #define EXTRA_GENERAL_FIELDS \
EXTRA_GENERAL_FIELDS_ARM \ EXTRA_GENERAL_FIELDS_ARM \
uint8_t uart3Mode; \ uint8_t uart3Mode; \
uint8_t potsType; uint8_t potsType; \
uint8_t backlightColor;
#elif defined(CPUARM) #elif defined(CPUARM)
#define EXTRA_GENERAL_FIELDS EXTRA_GENERAL_FIELDS_ARM #define EXTRA_GENERAL_FIELDS EXTRA_GENERAL_FIELDS_ARM
#elif defined(PXX) #elif defined(PXX)
@@ -1015,8 +1016,8 @@ enum TelemetrySource {
TELEM_ACCy, TELEM_ACCy,
TELEM_ACCz, TELEM_ACCz,
TELEM_HDG, TELEM_HDG,
TELEM_VSPD, TELEM_VSPEED,
TELEM_ASPD, TELEM_ASPEED,
TELEM_DTE, TELEM_DTE,
#if defined(CPUARM) #if defined(CPUARM)
TELEM_RESERVE1, TELEM_RESERVE1,
@@ -1135,7 +1136,7 @@ enum FrskyVoltsSource {
#if defined(CPUARM) #if defined(CPUARM)
#define MAX_FRSKY_SCREENS 3 #define MAX_FRSKY_SCREENS 3
PACK(typedef struct t_FrSkyData { PACK(typedef struct t_FrSkyData {
FrSkyChannelData channels[2]; FrSkyChannelData channels[4];
uint8_t usrProto; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh, 3=Halcyon uint8_t usrProto; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh, 3=Halcyon
uint8_t voltsSource:7; uint8_t voltsSource:7;
uint8_t altitudeDisplayed:1; uint8_t altitudeDisplayed:1;
@@ -1187,6 +1188,7 @@ PACK(typedef struct t_MavlinkData {
#endif #endif
enum SwashType { enum SwashType {
SWASH_TYPE_NONE,
SWASH_TYPE_120, SWASH_TYPE_120,
SWASH_TYPE_120X, SWASH_TYPE_120X,
SWASH_TYPE_140, SWASH_TYPE_140,
+19 -11
View File
@@ -983,9 +983,9 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS)
if (ed->srcRaw == ovwrIdx) if (ed->srcRaw == ovwrIdx)
v = ovwrValue; v = ovwrValue;
#if defined(HELI) #if defined(HELI)
else if (ed->srcRaw == MIXSRC_Ele && g_model.swashR.value) else if (ed->srcRaw == MIXSRC_Ele)
v = heliAnas[ELE_STICK]; v = heliAnas[ELE_STICK];
else if (ed->srcRaw == MIXSRC_Ail && g_model.swashR.value) else if (ed->srcRaw == MIXSRC_Ail)
v = heliAnas[AIL_STICK]; v = heliAnas[AIL_STICK];
#endif #endif
else { else {
@@ -1035,6 +1035,13 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS)
virtualInputsTrims[cur_chn] = ed->srcRaw - MIXSRC_Rud; virtualInputsTrims[cur_chn] = ed->srcRaw - MIXSRC_Rud;
else else
virtualInputsTrims[cur_chn] = -1; virtualInputsTrims[cur_chn] = -1;
#if defined(HELI)
if (ed->srcRaw == MIXSRC_Ele)
heliAnas[ELE_STICK] = v;
else if (ed->srcRaw == MIXSRC_Ail)
heliAnas[AIL_STICK] = v;
#endif
#endif #endif
anas[cur_chn] = v; anas[cur_chn] = v;
@@ -1316,8 +1323,8 @@ getvalue_t getValue(uint8_t i)
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCy) return frskyData.hub.accelY; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCy) return frskyData.hub.accelY;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCz) return frskyData.hub.accelZ; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCz) return frskyData.hub.accelZ;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_HDG) return frskyData.hub.gpsCourse_bp; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_HDG) return frskyData.hub.gpsCourse_bp;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_VSPD) return frskyData.hub.varioSpeed; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_VSPEED) return frskyData.hub.varioSpeed;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ASPD) return frskyData.hub.airSpeed; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ASPEED) return frskyData.hub.airSpeed;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_DTE) return frskyData.hub.dTE; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_DTE) return frskyData.hub.dTE;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_MIN_A1) return frskyData.analog[0].min; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_MIN_A1) return frskyData.analog[0].min;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_MIN_A2) return frskyData.analog[1].min; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_MIN_A2) return frskyData.analog[1].min;
@@ -2071,7 +2078,7 @@ getvalue_t convert16bitsTelemValue(uint8_t channel, ls_telemetry_value_t value)
result = value * 100; result = value * 100;
break; break;
#endif #endif
case TELEM_VSPD: case TELEM_VSPEED:
result = value * 10; result = value * 10;
break; break;
@@ -2134,7 +2141,7 @@ getvalue_t convert8bitsTelemValue(uint8_t channel, ls_telemetry_value_t value)
case TELEM_CONSUMPTION: case TELEM_CONSUMPTION:
result = value * 20; result = value * 20;
break; break;
case TELEM_VSPD: case TELEM_VSPEED:
result = ((getvalue_t)value - 125) * 10; result = ((getvalue_t)value - 125) * 10;
break; break;
#endif #endif
@@ -3200,10 +3207,10 @@ void evalInputs(uint8_t mode)
#if defined(HELI) #if defined(HELI)
if (d && (ch==ELE_STICK || ch==AIL_STICK)) { if (d && (ch==ELE_STICK || ch==AIL_STICK)) {
v = (int32_t(v) * calc100toRESX(g_model.swashR.value)) / int32_t(d); v = (int32_t(v) * calc100toRESX(g_model.swashR.value)) / int32_t(d);
#if defined(PCBTARANIS)
heliAnas[ch] = v;
#endif
} }
#if defined(PCBTARANIS)
heliAnas[ch] = v;
#endif
#endif #endif
#if !defined(PCBTARANIS) #if !defined(PCBTARANIS)
@@ -3313,11 +3320,12 @@ PLAY_FUNCTION(playValue, uint8_t idx)
PLAY_NUMBER(div10_and_round(val), 1+UNIT_G, PREC1); PLAY_NUMBER(div10_and_round(val), 1+UNIT_G, PREC1);
break; break;
case MIXSRC_FIRST_TELEM+TELEM_VSPD-1: case MIXSRC_FIRST_TELEM+TELEM_VSPEED-1:
PLAY_NUMBER(div10_and_round(val), 1+UNIT_METERS_PER_SECOND, PREC1); PLAY_NUMBER(div10_and_round(val), 1+UNIT_METERS_PER_SECOND, PREC1);
break; break;
case MIXSRC_FIRST_TELEM+TELEM_ASPD-1: case MIXSRC_FIRST_TELEM+TELEM_ASPEED-1:
case MIXSRC_FIRST_TELEM+TELEM_MAX_ASPEED-1:
PLAY_NUMBER(val, 1+UNIT_KTS, 0); PLAY_NUMBER(val, 1+UNIT_KTS, 0);
break; break;
+2 -2
View File
@@ -179,7 +179,7 @@ long Open9xSim::onKeypress(FXObject*,FXSelector,void*v)
return 0; return 0;
} }
long Open9xSim::onTimeout(FXObject*,FXSelector,void*) long Open9xSim::onTimeout(FXObject*, FXSelector, void*)
{ {
if(hasFocus()) { if(hasFocus()) {
static int keys1[]={ static int keys1[]={
@@ -284,7 +284,7 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*)
per10ms(); per10ms();
refreshDiplay(); refreshDiplay();
getApp()->addTimeout(this,2,5); getApp()->addTimeout(this, 2, 10);
return 0; return 0;
} }
+1 -1
View File
@@ -82,7 +82,7 @@ enum CzechPrompts {
CZ_PROMPT_ACCELy = CZ_PROMPT_LABELS_BASE+TELEM_ACCy, CZ_PROMPT_ACCELy = CZ_PROMPT_LABELS_BASE+TELEM_ACCy,
CZ_PROMPT_ACCELz = CZ_PROMPT_LABELS_BASE+TELEM_ACCz, CZ_PROMPT_ACCELz = CZ_PROMPT_LABELS_BASE+TELEM_ACCz,
CZ_PROMPT_HDG = CZ_PROMPT_LABELS_BASE+TELEM_HDG, CZ_PROMPT_HDG = CZ_PROMPT_LABELS_BASE+TELEM_HDG,
CZ_PROMPT_VARIO = CZ_PROMPT_LABELS_BASE+TELEM_VSPD, CZ_PROMPT_VARIO = CZ_PROMPT_LABELS_BASE+TELEM_VSPEED,
}; };
+1 -1
View File
@@ -83,7 +83,7 @@ enum GermanPrompts {
DE_PROMPT_ACCELy = DE_PROMPT_LABELS_BASE+TELEM_ACCy, DE_PROMPT_ACCELy = DE_PROMPT_LABELS_BASE+TELEM_ACCy,
DE_PROMPT_ACCELz = DE_PROMPT_LABELS_BASE+TELEM_ACCz, DE_PROMPT_ACCELz = DE_PROMPT_LABELS_BASE+TELEM_ACCz,
DE_PROMPT_HDG = DE_PROMPT_LABELS_BASE+TELEM_HDG, DE_PROMPT_HDG = DE_PROMPT_LABELS_BASE+TELEM_HDG,
DE_PROMPT_VARIO = DE_PROMPT_LABELS_BASE+TELEM_VSPD, DE_PROMPT_VARIO = DE_PROMPT_LABELS_BASE+TELEM_VSPEED,
}; };
+1 -1
View File
@@ -107,7 +107,7 @@ enum SpanishPrompts {
ES_PROMPT_ACCELy = ES_PROMPT_LABELS_BASE+TELEM_ACCy, ES_PROMPT_ACCELy = ES_PROMPT_LABELS_BASE+TELEM_ACCy,
ES_PROMPT_ACCELz = ES_PROMPT_LABELS_BASE+TELEM_ACCz, ES_PROMPT_ACCELz = ES_PROMPT_LABELS_BASE+TELEM_ACCz,
ES_PROMPT_HDG = ES_PROMPT_LABELS_BASE+TELEM_HDG, ES_PROMPT_HDG = ES_PROMPT_LABELS_BASE+TELEM_HDG,
ES_PROMPT_VARIO = ES_PROMPT_LABELS_BASE+TELEM_VSPD, ES_PROMPT_VARIO = ES_PROMPT_LABELS_BASE+TELEM_VSPEED,
}; };
+1 -1
View File
@@ -86,7 +86,7 @@ enum FrenchPrompts {
FR_PROMPT_ACCELy = FR_PROMPT_LABELS_BASE+TELEM_ACCy, FR_PROMPT_ACCELy = FR_PROMPT_LABELS_BASE+TELEM_ACCy,
FR_PROMPT_ACCELz = FR_PROMPT_LABELS_BASE+TELEM_ACCz, FR_PROMPT_ACCELz = FR_PROMPT_LABELS_BASE+TELEM_ACCz,
FR_PROMPT_HDG = FR_PROMPT_LABELS_BASE+TELEM_HDG, FR_PROMPT_HDG = FR_PROMPT_LABELS_BASE+TELEM_HDG,
FR_PROMPT_VARIO = FR_PROMPT_LABELS_BASE+TELEM_VSPD, FR_PROMPT_VARIO = FR_PROMPT_LABELS_BASE+TELEM_VSPEED,
FR_PROMPT_VIRGULE_BASE = 180, //,0 - ,9 FR_PROMPT_VIRGULE_BASE = 180, //,0 - ,9
}; };
+1 -1
View File
@@ -79,7 +79,7 @@ enum ItalianPrompts {
IT_PROMPT_ACCELy = IT_PROMPT_LABELS_BASE+TELEM_ACCy, IT_PROMPT_ACCELy = IT_PROMPT_LABELS_BASE+TELEM_ACCy,
IT_PROMPT_ACCELz = IT_PROMPT_LABELS_BASE+TELEM_ACCz, IT_PROMPT_ACCELz = IT_PROMPT_LABELS_BASE+TELEM_ACCz,
IT_PROMPT_HDG = IT_PROMPT_LABELS_BASE+TELEM_HDG, IT_PROMPT_HDG = IT_PROMPT_LABELS_BASE+TELEM_HDG,
IT_PROMPT_VARIO = IT_PROMPT_LABELS_BASE+TELEM_VSPD, IT_PROMPT_VARIO = IT_PROMPT_LABELS_BASE+TELEM_VSPEED,
}; };
+1 -1
View File
@@ -83,7 +83,7 @@ enum PolishPrompts {
PL_PROMPT_ACCELy = PL_PROMPT_LABELS_BASE+TELEM_ACCy, PL_PROMPT_ACCELy = PL_PROMPT_LABELS_BASE+TELEM_ACCy,
PL_PROMPT_ACCELz = PL_PROMPT_LABELS_BASE+TELEM_ACCz, PL_PROMPT_ACCELz = PL_PROMPT_LABELS_BASE+TELEM_ACCz,
PL_PROMPT_HDG = PL_PROMPT_LABELS_BASE+TELEM_HDG, PL_PROMPT_HDG = PL_PROMPT_LABELS_BASE+TELEM_HDG,
PL_PROMPT_VARIO = PL_PROMPT_LABELS_BASE+TELEM_VSPD, PL_PROMPT_VARIO = PL_PROMPT_LABELS_BASE+TELEM_VSPEED,
}; };
+1 -1
View File
@@ -102,7 +102,7 @@ enum PortuguesePrompts {
PT_PROMPT_ACCELy = PT_PROMPT_LABELS_BASE+TELEM_ACCy, PT_PROMPT_ACCELy = PT_PROMPT_LABELS_BASE+TELEM_ACCy,
PT_PROMPT_ACCELz = PT_PROMPT_LABELS_BASE+TELEM_ACCz, PT_PROMPT_ACCELz = PT_PROMPT_LABELS_BASE+TELEM_ACCz,
PT_PROMPT_HDG = PT_PROMPT_LABELS_BASE+TELEM_HDG, PT_PROMPT_HDG = PT_PROMPT_LABELS_BASE+TELEM_HDG,
PT_PROMPT_VARIO = PT_PROMPT_LABELS_BASE+TELEM_VSPD, PT_PROMPT_VARIO = PT_PROMPT_LABELS_BASE+TELEM_VSPEED,
}; };
+1 -1
View File
@@ -97,7 +97,7 @@ enum SlovakPrompts {
SK_PROMPT_ACCELy = SK_PROMPT_LABELS_BASE+TELEM_ACCy, SK_PROMPT_ACCELy = SK_PROMPT_LABELS_BASE+TELEM_ACCy,
SK_PROMPT_ACCELz = SK_PROMPT_LABELS_BASE+TELEM_ACCz, SK_PROMPT_ACCELz = SK_PROMPT_LABELS_BASE+TELEM_ACCz,
SK_PROMPT_HDG = SK_PROMPT_LABELS_BASE+TELEM_HDG, SK_PROMPT_HDG = SK_PROMPT_LABELS_BASE+TELEM_HDG,
SK_PROMPT_VARIO = SK_PROMPT_LABELS_BASE+TELEM_VSPD, SK_PROMPT_VARIO = SK_PROMPT_LABELS_BASE+TELEM_VSPEED,
}; };
+1 -1
View File
@@ -244,7 +244,7 @@ def ttsFr():
systemSounds.append((s, filename(PROMPT_SYSTEM_BASE+110+i))) systemSounds.append((s, filename(PROMPT_SYSTEM_BASE+110+i)))
for i, s in enumerate(["virgule", "et", "moins"]): for i, s in enumerate(["virgule", "et", "moins"]):
systemSounds.append((s, filename(PROMPT_SYSTEM_BASE+119+i))) systemSounds.append((s, filename(PROMPT_SYSTEM_BASE+119+i)))
for i, s in enumerate(["volts", u"ampères", u"mètres seconde", "", "km heure", u"mètres", u"degrés", "pourcents", u"milli ampères", u"milli ampères / heure", "watt", "db", "pieds", "knotts", "heure", "minute", "seconde", "tours par minute", "g"]): for i, s in enumerate(["volts", u"ampères", u"mètres seconde", "", "kilomètre heure", u"mètres", u"degrés", "pourcents", u"milli ampères", u"milli ampères / heure", "watt", "db", "pieds", "miles par heure", "heure", "minute", "seconde", "tours par minute", "g"]):
systemSounds.append((s, filename(PROMPT_SYSTEM_BASE+125+i))) systemSounds.append((s, filename(PROMPT_SYSTEM_BASE+125+i)))
for i, s in enumerate(["timer", "", "tension", "tension", u"émission", u"réception", "altitude", "moteur", for i, s in enumerate(["timer", "", "tension", "tension", u"émission", u"réception", "altitude", "moteur",
"essence", u"température", u"température", "vitesse", "distance", "altitude", u"élément lipo", "essence", u"température", u"température", "vitesse", "distance", "altitude", u"élément lipo",