Merge remote-tracking branch 'origin/next' into andreas/Issue020_ThrWarnPotsAndTransmitterFix_Merged
|
@ -155,7 +155,6 @@ SET( companion_SRCS
|
||||||
modelslist.cpp
|
modelslist.cpp
|
||||||
mountlist.cpp
|
mountlist.cpp
|
||||||
avroutputdialog.cpp
|
avroutputdialog.cpp
|
||||||
preferencesdialog.cpp
|
|
||||||
apppreferencesdialog.cpp
|
apppreferencesdialog.cpp
|
||||||
fwpreferencesdialog.cpp
|
fwpreferencesdialog.cpp
|
||||||
burnconfigdialog.cpp
|
burnconfigdialog.cpp
|
||||||
|
@ -178,7 +177,6 @@ SET( companion_SRCS
|
||||||
|
|
||||||
SET( companion_MOC_HDRS
|
SET( companion_MOC_HDRS
|
||||||
avroutputdialog.h
|
avroutputdialog.h
|
||||||
preferencesdialog.h
|
|
||||||
apppreferencesdialog.h
|
apppreferencesdialog.h
|
||||||
fwpreferencesdialog.h
|
fwpreferencesdialog.h
|
||||||
burnconfigdialog.h
|
burnconfigdialog.h
|
||||||
|
@ -214,7 +212,6 @@ SET( companion_UIS
|
||||||
comparedialog.ui
|
comparedialog.ui
|
||||||
fusesdialog.ui
|
fusesdialog.ui
|
||||||
logsdialog.ui
|
logsdialog.ui
|
||||||
preferencesdialog.ui
|
|
||||||
apppreferencesdialog.ui
|
apppreferencesdialog.ui
|
||||||
fwpreferencesdialog.ui
|
fwpreferencesdialog.ui
|
||||||
simulatordialog.ui
|
simulatordialog.ui
|
||||||
|
|
|
@ -14,7 +14,7 @@ appPreferencesDialog::appPreferencesDialog(QWidget *parent) :
|
||||||
ui(new Ui::appPreferencesDialog)
|
ui(new Ui::appPreferencesDialog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowIcon(CompanionIcon("preferences.png"));
|
setWindowIcon(CompanionIcon("apppreferences.png"));
|
||||||
initSettings();
|
initSettings();
|
||||||
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
|
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
|
||||||
#ifndef JOYSTICKS
|
#ifndef JOYSTICKS
|
||||||
|
@ -56,8 +56,19 @@ void appPreferencesDialog::writeValues()
|
||||||
settings.remove("js_ctrl");
|
settings.remove("js_ctrl");
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow * mw = (MainWindow *)this->parent();
|
settings.setValue("default_channel_order", ui->channelorderCB->currentIndex());
|
||||||
mw->unloadProfile();
|
settings.setValue("default_mode", ui->stickmodeCB->currentIndex());
|
||||||
|
settings.setValue("rename_firmware_files", ui->renameFirmware->isChecked());
|
||||||
|
settings.setValue("burnFirmware", ui->burnFirmware->isChecked());
|
||||||
|
settings.setValue("profileId", ui->profileIndexLE->text());
|
||||||
|
settings.setValue("Name", ui->profileNameLE->text());
|
||||||
|
settings.setValue("sdPath", ui->sdPath->text());
|
||||||
|
settings.setValue("SplashFileName", ui->SplashFileName->text());
|
||||||
|
if (!ui->SplashFileName->text().isEmpty())
|
||||||
|
settings.setValue("SplashImage", "");
|
||||||
|
settings.setValue("firmware", ui->firmwareLE->text());
|
||||||
|
|
||||||
|
saveProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
void appPreferencesDialog::on_snapshotPathButton_clicked()
|
void appPreferencesDialog::on_snapshotPathButton_clicked()
|
||||||
|
@ -75,6 +86,7 @@ void appPreferencesDialog::initSettings()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
ui->snapshotClipboardCKB->setChecked(settings.value("snapshot_to_clipboard", false).toBool());
|
ui->snapshotClipboardCKB->setChecked(settings.value("snapshot_to_clipboard", false).toBool());
|
||||||
|
ui->burnFirmware->setChecked(settings.value("burnFirmware", true).toBool());
|
||||||
|
|
||||||
QString Path=settings.value("snapshotPath", "").toString();
|
QString Path=settings.value("snapshotPath", "").toString();
|
||||||
if (QDir(Path).exists()) {
|
if (QDir(Path).exists()) {
|
||||||
|
@ -142,6 +154,26 @@ void appPreferencesDialog::initSettings()
|
||||||
ui->joystickcalButton->setDisabled(true);
|
ui->joystickcalButton->setDisabled(true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
// Profile Tab Inits
|
||||||
|
ui->channelorderCB->setCurrentIndex(settings.value("default_channel_order", 0).toInt());
|
||||||
|
ui->stickmodeCB->setCurrentIndex(settings.value("default_mode", 1).toInt());
|
||||||
|
ui->renameFirmware->setChecked(settings.value("rename_firmware_files", false).toBool());
|
||||||
|
Path=settings.value("sdPath", "").toString();
|
||||||
|
if (QDir(Path).exists()) {
|
||||||
|
ui->sdPath->setText(Path);
|
||||||
|
}
|
||||||
|
ui->profileIndexLE->setText(settings.value("profileId", "").toString());
|
||||||
|
ui->profileNameLE->setText(settings.value("Name", "").toString());
|
||||||
|
|
||||||
|
QString fileName=settings.value("SplashFileName","").toString();
|
||||||
|
if (!fileName.isEmpty()) {
|
||||||
|
QFile file(fileName);
|
||||||
|
if (file.exists()){
|
||||||
|
ui->SplashFileName->setText(fileName);
|
||||||
|
displayImage( fileName );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ui->firmwareLE->setText(settings.value("firmware","").toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void appPreferencesDialog::on_libraryPathButton_clicked()
|
void appPreferencesDialog::on_libraryPathButton_clicked()
|
||||||
|
@ -222,3 +254,142 @@ void appPreferencesDialog::on_joystickcalButton_clicked() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// ******** Profile tab functions
|
||||||
|
|
||||||
|
void appPreferencesDialog::on_sdPathButton_clicked()
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), settings.value("sdPath").toString());
|
||||||
|
if (!fileName.isEmpty()) {
|
||||||
|
ui->sdPath->setText(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void appPreferencesDialog::saveProfile()
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
|
QString profile=QString("profile") + settings.value("profileId").toString();
|
||||||
|
QString name=ui->profileNameLE->text();
|
||||||
|
if (name.isEmpty()) {
|
||||||
|
name = profile;
|
||||||
|
ui->profileNameLE->setText(name);
|
||||||
|
}
|
||||||
|
settings.beginGroup("Profiles");
|
||||||
|
settings.beginGroup(profile);
|
||||||
|
settings.setValue("Name",name);
|
||||||
|
settings.setValue("default_channel_order", ui->channelorderCB->currentIndex());
|
||||||
|
settings.setValue("default_mode", ui->stickmodeCB->currentIndex());
|
||||||
|
settings.setValue("burnFirmware", ui->burnFirmware->isChecked());
|
||||||
|
settings.setValue("rename_firmware_files", ui->renameFirmware->isChecked());
|
||||||
|
settings.setValue("sdPath", ui->sdPath->text());
|
||||||
|
settings.setValue("SplashFileName", ui->SplashFileName->text());
|
||||||
|
settings.setValue("firmware", ui->firmwareLE->text());
|
||||||
|
settings.endGroup();
|
||||||
|
settings.endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void appPreferencesDialog::loadProfileString(QString profile, QString label)
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
QString value;
|
||||||
|
|
||||||
|
settings.beginGroup("Profiles");
|
||||||
|
settings.beginGroup(profile);
|
||||||
|
value = settings.value(label).toString();
|
||||||
|
settings.endGroup();
|
||||||
|
settings.endGroup();
|
||||||
|
|
||||||
|
settings.setValue( label, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
void appPreferencesDialog::loadProfile()
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
QString profile=QString("profile") + settings.value("profileId").toString();
|
||||||
|
|
||||||
|
loadProfileString( profile, "Name" );
|
||||||
|
loadProfileString( profile, "default_channel_order" );
|
||||||
|
loadProfileString( profile, "default_mode" );
|
||||||
|
loadProfileString( profile, "burnFirmware" );
|
||||||
|
loadProfileString( profile, "rename_firmware_files" );
|
||||||
|
loadProfileString( profile, "sdPath" );
|
||||||
|
loadProfileString( profile, "SplashFileName" );
|
||||||
|
loadProfileString( profile, "firmware" );
|
||||||
|
}
|
||||||
|
|
||||||
|
void appPreferencesDialog::on_removeProfileButton_clicked()
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
QString profileId = settings.value("profileId").toString();
|
||||||
|
if ( profileId == "1" )
|
||||||
|
QMessageBox::information(this, tr("Not possible to remove profile"), tr("The default profile can not be removed."));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QString profile=QString("profile") + profileId;
|
||||||
|
settings.beginGroup("Profiles");
|
||||||
|
settings.remove(profile);
|
||||||
|
settings.endGroup();
|
||||||
|
settings.setValue("profileId", "1");
|
||||||
|
|
||||||
|
loadProfile();
|
||||||
|
initSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool appPreferencesDialog::displayImage( QString fileName )
|
||||||
|
{
|
||||||
|
QImage image(fileName);
|
||||||
|
if (image.isNull())
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int width=ui->imageLabel->width();
|
||||||
|
ui->imageLabel->setPixmap(QPixmap::fromImage(image.scaled(width, 64)));
|
||||||
|
if (width==212) {
|
||||||
|
image=image.convertToFormat(QImage::Format_RGB32);
|
||||||
|
QRgb col;
|
||||||
|
int gray, height = image.height();
|
||||||
|
for (int i = 0; i < width; ++i) {
|
||||||
|
for (int j = 0; j < height; ++j) {
|
||||||
|
col = image.pixel(i, j);
|
||||||
|
gray = qGray(col);
|
||||||
|
image.setPixel(i, j, qRgb(gray, gray, gray));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ui->imageLabel->setPixmap(QPixmap::fromImage(image));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->imageLabel->setPixmap(QPixmap::fromImage(image.convertToFormat(QImage::Format_Mono)));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void appPreferencesDialog::on_SplashSelect_clicked()
|
||||||
|
{
|
||||||
|
QString supportedImageFormats;
|
||||||
|
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
||||||
|
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
QString fileName = QFileDialog::getOpenFileName(this,
|
||||||
|
tr("Open Image to load"), settings.value("lastImagesDir").toString(), tr("Images (%1)").arg(supportedImageFormats));
|
||||||
|
|
||||||
|
if (!fileName.isEmpty()) {
|
||||||
|
settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath());
|
||||||
|
|
||||||
|
if (displayImage(fileName))
|
||||||
|
ui->SplashFileName->setText(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void appPreferencesDialog::on_clearImageButton_clicked() {
|
||||||
|
ui->imageLabel->clear();
|
||||||
|
ui->SplashFileName->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,10 @@ public:
|
||||||
private:
|
private:
|
||||||
Ui::appPreferencesDialog *ui;
|
Ui::appPreferencesDialog *ui;
|
||||||
void initSettings();
|
void initSettings();
|
||||||
|
bool displayImage( QString fileName );
|
||||||
|
void saveProfile();
|
||||||
|
void loadProfileString(QString profile, QString label);
|
||||||
|
void loadProfile();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void writeValues();
|
void writeValues();
|
||||||
|
@ -31,6 +35,12 @@ private slots:
|
||||||
void on_snapshotClipboardCKB_clicked();
|
void on_snapshotClipboardCKB_clicked();
|
||||||
void on_backupPathButton_clicked();
|
void on_backupPathButton_clicked();
|
||||||
void on_ge_pathButton_clicked();
|
void on_ge_pathButton_clicked();
|
||||||
|
|
||||||
|
void on_sdPathButton_clicked();
|
||||||
|
void on_removeProfileButton_clicked();
|
||||||
|
void on_SplashSelect_clicked();
|
||||||
|
void on_clearImageButton_clicked();
|
||||||
|
|
||||||
#ifdef JOYSTICKS
|
#ifdef JOYSTICKS
|
||||||
void on_joystickChkB_clicked();
|
void on_joystickChkB_clicked();
|
||||||
void on_joystickcalButton_clicked();
|
void on_joystickcalButton_clicked();
|
||||||
|
|
|
@ -7,19 +7,128 @@
|
||||||
#include "splashlibrary.h"
|
#include "splashlibrary.h"
|
||||||
#include "flashinterface.h"
|
#include "flashinterface.h"
|
||||||
|
|
||||||
|
//*** Side Class ***
|
||||||
|
|
||||||
Side::Side(){
|
Side::Side(){
|
||||||
imageLabel = 0;
|
imageLabel = 0;
|
||||||
fileNameEdit = 0;
|
fileNameEdit = 0;
|
||||||
saveButton = 0;
|
saveButton = 0;
|
||||||
source=new Source;
|
saveToFileName = new QString("");
|
||||||
*source = UNDEFINED;
|
source = new Source(UNDEFINED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Side::copyImage( Side side ){
|
void Side::copyImage( Side side )
|
||||||
if ((*source!=UNDEFINED) && (*side.source!=UNDEFINED))
|
{
|
||||||
|
if ((*source!=UNDEFINED) && (*side.source!=UNDEFINED))
|
||||||
imageLabel->setPixmap(*side.imageLabel->pixmap());
|
imageLabel->setPixmap(*side.imageLabel->pixmap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Side::displayImage( QString fileName, Source pictSource )
|
||||||
|
{
|
||||||
|
QImage image;
|
||||||
|
|
||||||
|
if (fileName.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (pictSource == FW ){
|
||||||
|
FlashInterface flash(fileName);
|
||||||
|
if (!flash.hasSplash())
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
image = flash.getSplash();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
image.load(fileName);
|
||||||
|
}
|
||||||
|
if (image.isNull()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (imageLabel->width()==424) {
|
||||||
|
image=image.convertToFormat(QImage::Format_RGB32);
|
||||||
|
QRgb col;
|
||||||
|
int gray;
|
||||||
|
int width = image.width();
|
||||||
|
int height = image.height();
|
||||||
|
for (int i = 0; i < width; ++i) {
|
||||||
|
for (int j = 0; j < height; ++j) {
|
||||||
|
col = image.pixel(i, j);
|
||||||
|
gray = qGray(col);
|
||||||
|
image.setPixel(i, j, qRgb(gray, gray, gray));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
imageLabel->setPixmap(QPixmap::fromImage(image.scaled(imageLabel->width()/2, imageLabel->height()/2)));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
imageLabel->setPixmap(QPixmap::fromImage(image.scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Mono)));
|
||||||
|
}
|
||||||
|
switch (pictSource){
|
||||||
|
case FW:
|
||||||
|
fileNameEdit->setText(QObject::tr("FW: %1").arg(fileName));
|
||||||
|
*saveToFileName = fileName;
|
||||||
|
*source=FW;
|
||||||
|
break;
|
||||||
|
case PICT:
|
||||||
|
fileNameEdit->setText(QObject::tr("Pict: %1").arg(fileName));
|
||||||
|
*saveToFileName = fileName;
|
||||||
|
*source=PICT;
|
||||||
|
break;
|
||||||
|
case PROFILE:
|
||||||
|
fileNameEdit->setText(QObject::tr("Profile image"));
|
||||||
|
*saveToFileName = fileName;
|
||||||
|
*source=PROFILE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
saveButton->setEnabled(true);
|
||||||
|
libraryButton->setEnabled(true);
|
||||||
|
invertButton->setEnabled(true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Side::refreshImage()
|
||||||
|
{
|
||||||
|
return displayImage( *saveToFileName, *source );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Side::saveImage()
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
|
if (*source == FW )
|
||||||
|
{
|
||||||
|
FlashInterface flash(*saveToFileName);
|
||||||
|
if (!flash.hasSplash()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
QImage image = imageLabel->pixmap()->toImage().scaled(flash.getSplashWidth(), flash.getSplashHeight());
|
||||||
|
if (flash.setSplash(image) && (flash.saveFlash(*saveToFileName) > 0)) {
|
||||||
|
settings.setValue("lastFlashDir", QFileInfo(*saveToFileName).dir().absolutePath());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (*source == PICT) {
|
||||||
|
QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
|
||||||
|
if (image.save(*saveToFileName)) {
|
||||||
|
settings.setValue("lastImagesDir", QFileInfo(*saveToFileName).dir().absolutePath());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (*source == PROFILE) {
|
||||||
|
QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
|
||||||
|
if (!image.save(*saveToFileName)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//*** customizeSplashDialog Class ***
|
||||||
|
|
||||||
customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
|
customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::customizeSplashDialog)
|
ui(new Ui::customizeSplashDialog)
|
||||||
|
@ -39,6 +148,7 @@ customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
|
||||||
left.invertButton = ui->leftInvertButton;
|
left.invertButton = ui->leftInvertButton;
|
||||||
right.invertButton = ui->rightInvertButton;
|
right.invertButton = ui->rightInvertButton;
|
||||||
|
|
||||||
|
loadProfile(left);
|
||||||
resize(0,0);
|
resize(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,25 +172,10 @@ void customizeSplashDialog::loadFirmware(Side side)
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open"), settings.value("lastFlashDir").toString(), FLASH_FILES_FILTER);
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Open"), settings.value("lastFlashDir").toString(), FLASH_FILES_FILTER);
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
QFile file(fileName);
|
if (!side.displayImage( fileName, FW ))
|
||||||
if (fileName.isEmpty() || !file.exists())
|
QMessageBox::critical(this, tr("Error"), tr("Cannot load embedded FW image from %1.").arg(fileName));
|
||||||
return;
|
else
|
||||||
|
|
||||||
FlashInterface flash(fileName);
|
|
||||||
if (!flash.hasSplash()) {
|
|
||||||
QMessageBox::information(this, tr("Error"), tr("Could not find bitmap to replace in file"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
side.saveButton->setEnabled(true);
|
|
||||||
side.imageLabel->setPixmap(QPixmap::fromImage(flash.getSplash()));
|
|
||||||
side.imageLabel->setFixedSize(flash.getSplashWidth()*2,flash.getSplashHeight()*2);
|
|
||||||
side.fileNameEdit->setText(fileName);
|
|
||||||
settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath());
|
settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath());
|
||||||
*side.source=FW;
|
|
||||||
side.saveButton->setEnabled(true);
|
|
||||||
side.libraryButton->setEnabled(true);
|
|
||||||
side.invertButton->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,46 +191,25 @@ void customizeSplashDialog::loadPicture(Side side)
|
||||||
QString fileName = QFileDialog::getOpenFileName(this,
|
QString fileName = QFileDialog::getOpenFileName(this,
|
||||||
tr("Open Image to load"), settings.value("lastImagesDir").toString(), tr("Images (%1)").arg(supportedImageFormats));
|
tr("Open Image to load"), settings.value("lastImagesDir").toString(), tr("Images (%1)").arg(supportedImageFormats));
|
||||||
|
|
||||||
if (fileName.isEmpty()){
|
if (!fileName.isEmpty()) {
|
||||||
return;
|
if (!side.displayImage( fileName, PICT ))
|
||||||
|
QMessageBox::critical(this, tr("Error"), tr("Cannot load the image file %1.").arg(fileName));
|
||||||
|
else
|
||||||
|
settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath());
|
||||||
}
|
}
|
||||||
QImage image(fileName);
|
|
||||||
if (image.isNull()) {
|
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (side.imageLabel->width()==424) {
|
|
||||||
image=image.convertToFormat(QImage::Format_RGB32);
|
|
||||||
QRgb col;
|
|
||||||
int gray;
|
|
||||||
int width = image.width();
|
|
||||||
int height = image.height();
|
|
||||||
for (int i = 0; i < width; ++i)
|
|
||||||
{
|
|
||||||
for (int j = 0; j < height; ++j)
|
|
||||||
{
|
|
||||||
col = image.pixel(i, j);
|
|
||||||
gray = qGray(col);
|
|
||||||
image.setPixel(i, j, qRgb(gray, gray, gray));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
side.imageLabel->setPixmap(QPixmap::fromImage(image.scaled(side.imageLabel->width()/2, side.imageLabel->height()/2)));
|
|
||||||
} else {
|
|
||||||
side.imageLabel->setPixmap(QPixmap::fromImage(image.scaled(side.imageLabel->width()/2, side.imageLabel->height()/2).convertToFormat(QImage::Format_Mono)));
|
|
||||||
}
|
|
||||||
|
|
||||||
settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath());
|
|
||||||
side.fileNameEdit->setText(fileName);
|
|
||||||
*side.source=PICT;
|
|
||||||
side.saveButton->setEnabled(true);
|
|
||||||
side.libraryButton->setEnabled(true);
|
|
||||||
side.invertButton->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);}
|
void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);}
|
||||||
void customizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);}
|
void customizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);}
|
||||||
void customizeSplashDialog::loadProfile(Side side)
|
void customizeSplashDialog::loadProfile(Side side)
|
||||||
{
|
{
|
||||||
|
QSettings settings;
|
||||||
|
QString fileName=settings.value("SplashFileName","").toString();
|
||||||
|
|
||||||
|
if (!fileName.isEmpty()) {
|
||||||
|
if (!side.displayImage( fileName, PROFILE ))
|
||||||
|
QMessageBox::critical(this, tr("Error"), tr("Cannot load the profile image %1.").arg(fileName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void customizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
|
void customizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
|
||||||
|
@ -143,67 +217,26 @@ void customizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicke
|
||||||
void customizeSplashDialog::libraryButton_clicked( Side side )
|
void customizeSplashDialog::libraryButton_clicked( Side side )
|
||||||
{
|
{
|
||||||
QString fileName;
|
QString fileName;
|
||||||
|
|
||||||
splashLibrary *ld = new splashLibrary(this,&fileName);
|
splashLibrary *ld = new splashLibrary(this,&fileName);
|
||||||
ld->exec();
|
ld->exec();
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
QImage image(fileName);
|
if (!side.displayImage( fileName, UNDEFINED ))
|
||||||
if (image.isNull()) {
|
QMessageBox::critical(this, tr("Error"), tr("Cannot load the library image %1.").arg(fileName));
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (side.imageLabel->width()==424) {
|
|
||||||
image=image.convertToFormat(QImage::Format_RGB32);
|
|
||||||
QRgb col;
|
|
||||||
int gray;
|
|
||||||
int width = image.width();
|
|
||||||
int height = image.height();
|
|
||||||
for (int i = 0; i < width; ++i)
|
|
||||||
{
|
|
||||||
for (int j = 0; j < height; ++j)
|
|
||||||
{
|
|
||||||
col = image.pixel(i, j);
|
|
||||||
gray = qGray(col);
|
|
||||||
image.setPixel(i, j, qRgb(gray, gray, gray));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
side.imageLabel->setPixmap(QPixmap::fromImage(image.scaled(side.imageLabel->width()/2, side.imageLabel->height()/2)));
|
|
||||||
} else {
|
|
||||||
side.imageLabel->setPixmap(QPixmap::fromImage(image.scaled(side.imageLabel->width()/2, side.imageLabel->height()/2).convertToFormat(QImage::Format_Mono)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void customizeSplashDialog::on_leftSaveButton_clicked(){saveButton_clicked(left);}
|
void customizeSplashDialog::on_leftSaveButton_clicked(){saveButton_clicked(left);}
|
||||||
void customizeSplashDialog::on_rightSaveButton_clicked(){saveButton_clicked(right);}
|
void customizeSplashDialog::on_rightSaveButton_clicked(){saveButton_clicked(right);}
|
||||||
void customizeSplashDialog::saveButton_clicked(Side side)
|
void customizeSplashDialog::saveButton_clicked( Side side )
|
||||||
{
|
{
|
||||||
QSettings settings;
|
if (side.saveImage()){
|
||||||
QString fileName = side.fileNameEdit->text();
|
QMessageBox::information(this, tr("File Saved"), tr("The image was saved to the file %1").arg(*side.saveToFileName));
|
||||||
|
if ( !side.refreshImage()){
|
||||||
if (*side.source == FW)
|
QMessageBox::critical(this, tr("Image Refresh Error"), tr("Failed to refresh image from file %1").arg(*side.saveToFileName));
|
||||||
{
|
|
||||||
FlashInterface flash(fileName);
|
|
||||||
if (!flash.hasSplash()) {
|
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Could not store image in firmware file %1").arg(fileName));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QImage image = side.imageLabel->pixmap()->toImage().scaled(flash.getSplashWidth(), flash.getSplashHeight());
|
|
||||||
if (flash.setSplash(image) && (flash.saveFlash(fileName) > 0))
|
|
||||||
settings.setValue("lastFlashDir", QFileInfo(fileName).dir().absolutePath());
|
|
||||||
else
|
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Could not store image in firmware file %1").arg(fileName));
|
|
||||||
}
|
|
||||||
else if (*side.source == PICT)
|
|
||||||
{
|
|
||||||
if (!fileName.isEmpty()) {
|
|
||||||
QImage image = side.imageLabel->pixmap()->toImage().scaled(side.imageLabel->width()/2, side.imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
|
|
||||||
if (image.save(fileName))
|
|
||||||
settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath());
|
|
||||||
else
|
|
||||||
QMessageBox::critical(this, tr("Error"), tr("The image file %1 could not be stored").arg(fileName));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
QMessageBox::critical(this, tr("File Save Error"), tr("Failed to write image to %1").arg(*side.saveToFileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
void customizeSplashDialog::on_leftInvertButton_clicked(){invertButton_clicked(left);}
|
void customizeSplashDialog::on_leftInvertButton_clicked(){invertButton_clicked(left);}
|
||||||
|
|
|
@ -17,6 +17,9 @@ class Side
|
||||||
public:
|
public:
|
||||||
Side();
|
Side();
|
||||||
void copyImage( Side );
|
void copyImage( Side );
|
||||||
|
bool displayImage( QString fileName, Source source );
|
||||||
|
bool saveImage();
|
||||||
|
bool refreshImage();
|
||||||
|
|
||||||
QLabel *imageLabel;
|
QLabel *imageLabel;
|
||||||
QLineEdit *fileNameEdit;
|
QLineEdit *fileNameEdit;
|
||||||
|
@ -24,6 +27,9 @@ public:
|
||||||
QPushButton *invertButton;
|
QPushButton *invertButton;
|
||||||
QToolButton *libraryButton;
|
QToolButton *libraryButton;
|
||||||
|
|
||||||
|
QString *saveToFileName;
|
||||||
|
|
||||||
|
private:
|
||||||
Source *source;
|
Source *source;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -254,6 +254,16 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="leftLoadProfileButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Load Profile</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="leftLoadFwButton">
|
<widget class="QPushButton" name="leftLoadFwButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -268,16 +278,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="leftLoadProfileButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Load Profile</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -550,6 +550,16 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="rightLoadProfileButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Load Profile</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="rightLoadFwButton">
|
<widget class="QPushButton" name="rightLoadFwButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
|
@ -567,16 +577,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="rightLoadProfileButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Load Profile</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_3">
|
<spacer name="horizontalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -625,12 +625,17 @@
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>leftFileNameEdit</tabstop>
|
<tabstop>leftFileNameEdit</tabstop>
|
||||||
<tabstop>leftInvertButton</tabstop>
|
<tabstop>leftInvertButton</tabstop>
|
||||||
|
<tabstop>leftLibraryButton</tabstop>
|
||||||
|
<tabstop>leftLoadProfileButton</tabstop>
|
||||||
|
<tabstop>leftLoadFwButton</tabstop>
|
||||||
<tabstop>leftLoadPictButton</tabstop>
|
<tabstop>leftLoadPictButton</tabstop>
|
||||||
<tabstop>leftSaveButton</tabstop>
|
<tabstop>leftSaveButton</tabstop>
|
||||||
<tabstop>copyLeftToRightButton</tabstop>
|
<tabstop>copyLeftToRightButton</tabstop>
|
||||||
<tabstop>copyRightToLeftButton</tabstop>
|
<tabstop>copyRightToLeftButton</tabstop>
|
||||||
<tabstop>rightFileNameEdit</tabstop>
|
<tabstop>rightFileNameEdit</tabstop>
|
||||||
<tabstop>rightInvertButton</tabstop>
|
<tabstop>rightInvertButton</tabstop>
|
||||||
|
<tabstop>rightLibraryButton</tabstop>
|
||||||
|
<tabstop>rightLoadProfileButton</tabstop>
|
||||||
<tabstop>rightLoadFwButton</tabstop>
|
<tabstop>rightLoadFwButton</tabstop>
|
||||||
<tabstop>rightLoadPictButton</tabstop>
|
<tabstop>rightLoadPictButton</tabstop>
|
||||||
<tabstop>rightSaveButton</tabstop>
|
<tabstop>rightSaveButton</tabstop>
|
||||||
|
|
|
@ -734,7 +734,7 @@ GeneralSettings::GeneralSettings()
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
templateSetup = settings.value("default_channel_order", 0).toInt();
|
templateSetup = settings.value("default_channel_order", 0).toInt();
|
||||||
stickMode = settings.value("default_mode", 1).toInt();
|
stickMode = settings.value("default_mode", 1).toInt();
|
||||||
int profile_id = settings.value("ActiveProfile", 0).toInt();
|
int profile_id = settings.value("profileId", 0).toInt();
|
||||||
if (profile_id>0) {
|
if (profile_id>0) {
|
||||||
settings.beginGroup("Profiles");
|
settings.beginGroup("Profiles");
|
||||||
QString profile=QString("profile%1").arg(profile_id);
|
QString profile=QString("profile%1").arg(profile_id);
|
||||||
|
|
|
@ -12,7 +12,7 @@ fwPreferencesDialog::fwPreferencesDialog(QWidget *parent) :
|
||||||
updateLock(false)
|
updateLock(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowIcon(CompanionIcon("preferences.png"));
|
setWindowIcon(CompanionIcon("fwpreferences.png"));
|
||||||
|
|
||||||
QCheckBox * OptionCheckBox[]= {
|
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_1, ui->optionCheckBox_2, ui->optionCheckBox_3, ui->optionCheckBox_4, ui->optionCheckBox_5, ui->optionCheckBox_6, ui->optionCheckBox_7,
|
||||||
|
@ -38,7 +38,7 @@ fwPreferencesDialog::fwPreferencesDialog(QWidget *parent) :
|
||||||
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
|
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
|
||||||
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
|
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
|
||||||
|
|
||||||
resize(0,0);
|
shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,32 +47,43 @@ fwPreferencesDialog::~fwPreferencesDialog()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fwPreferencesDialog::showVoice(bool show)
|
||||||
|
{
|
||||||
|
if (show)
|
||||||
|
showVoice();
|
||||||
|
else
|
||||||
|
hideVoice();
|
||||||
|
}
|
||||||
|
|
||||||
|
void fwPreferencesDialog::showVoice()
|
||||||
|
{
|
||||||
|
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()
|
void fwPreferencesDialog::baseFirmwareChanged()
|
||||||
{
|
{
|
||||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||||
voice=NULL;
|
voice=NULL;
|
||||||
foreach(FirmwareInfo * firmware, firmwares) {
|
foreach(FirmwareInfo * firmware, firmwares) {
|
||||||
if (firmware->id == selected_firmware) {
|
if (firmware->id == selected_firmware) {
|
||||||
if (firmware->voice) {
|
showVoice(firmware->voice);
|
||||||
ui->voiceLabel->show();
|
|
||||||
ui->voiceCombo->show();
|
|
||||||
ui->voice_dnld->show();
|
|
||||||
ui->sdPathButton->show();
|
|
||||||
ui->sdPath->show();
|
|
||||||
ui->sdPathLabel->show();
|
|
||||||
ui->voiceLabel->setEnabled(true);
|
|
||||||
ui->voiceCombo->setEnabled(true);
|
|
||||||
ui->voice_dnld->setEnabled(true);
|
|
||||||
ui->sdPathButton->setEnabled(true);
|
|
||||||
ui->sdPath->setEnabled(true);
|
|
||||||
} else {
|
|
||||||
ui->voiceLabel->hide();
|
|
||||||
ui->voiceCombo->hide();
|
|
||||||
ui->voice_dnld->hide();
|
|
||||||
ui->sdPathButton->hide();
|
|
||||||
ui->sdPath->hide();
|
|
||||||
ui->sdPathLabel->hide();
|
|
||||||
}
|
|
||||||
populateFirmwareOptions(firmware);
|
populateFirmwareOptions(firmware);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -109,11 +120,6 @@ FirmwareVariant fwPreferencesDialog::getFirmwareVariant()
|
||||||
return default_firmware_variant;
|
return default_firmware_variant;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fwPreferencesDialog::firmwareLangChanged()
|
|
||||||
{
|
|
||||||
firmwareChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void fwPreferencesDialog::firmwareOptionChanged(bool state)
|
void fwPreferencesDialog::firmwareOptionChanged(bool state)
|
||||||
{
|
{
|
||||||
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
|
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
|
||||||
|
@ -134,19 +140,7 @@ void fwPreferencesDialog::firmwareOptionChanged(bool state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (voice) {
|
if (voice) {
|
||||||
if (voice->isChecked()) {
|
showVoice(voice->isChecked());
|
||||||
ui->voiceLabel->setEnabled(true);
|
|
||||||
ui->voiceCombo->setEnabled(true);
|
|
||||||
ui->voice_dnld->setEnabled(true);
|
|
||||||
ui->sdPathButton->setEnabled(true);
|
|
||||||
ui->sdPath->setEnabled(true);
|
|
||||||
} else {
|
|
||||||
ui->voiceLabel->setDisabled(true);
|
|
||||||
ui->voiceCombo->setDisabled(true);
|
|
||||||
ui->voice_dnld->setDisabled(true);
|
|
||||||
ui->sdPathButton->setDisabled(true);
|
|
||||||
ui->sdPath->setDisabled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return firmwareChanged();
|
return firmwareChanged();
|
||||||
|
@ -157,37 +151,24 @@ void fwPreferencesDialog::firmwareOptionChanged(bool state)
|
||||||
}
|
}
|
||||||
} else if (cb && !state) {
|
} else if (cb && !state) {
|
||||||
if (cb->text()=="voice") {
|
if (cb->text()=="voice") {
|
||||||
ui->voiceLabel->setDisabled(true);
|
hideVoice();
|
||||||
ui->voiceCombo->setDisabled(true);
|
|
||||||
ui->voice_dnld->setDisabled(true);
|
|
||||||
ui->sdPathButton->setEnabled(true);
|
|
||||||
ui->sdPath->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (voice ) {
|
if (voice) {
|
||||||
if (voice->isChecked()) {
|
showVoice(voice->isChecked());
|
||||||
ui->voiceLabel->setEnabled(true);
|
|
||||||
ui->voiceCombo->setEnabled(true);
|
|
||||||
ui->voice_dnld->setEnabled(true);
|
|
||||||
} else {
|
|
||||||
ui->voiceLabel->setDisabled(true);
|
|
||||||
ui->voiceCombo->setDisabled(true);
|
|
||||||
ui->voice_dnld->setDisabled(true);
|
|
||||||
ui->sdPathButton->setDisabled(true);
|
|
||||||
ui->sdPath->setDisabled(true);
|
|
||||||
}
|
|
||||||
} else if (firmware) {
|
} else if (firmware) {
|
||||||
if (firmware->voice) {
|
if (firmware->voice) {
|
||||||
ui->voiceLabel->setEnabled(true);
|
showVoice();
|
||||||
ui->voiceCombo->setEnabled(true);
|
|
||||||
ui->voice_dnld->setEnabled(true);
|
|
||||||
ui->sdPathButton->setEnabled(true);
|
|
||||||
ui->sdPath->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return firmwareChanged();
|
return firmwareChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fwPreferencesDialog::firmwareLangChanged()
|
||||||
|
{
|
||||||
|
firmwareChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void fwPreferencesDialog::firmwareChanged()
|
void fwPreferencesDialog::firmwareChanged()
|
||||||
{
|
{
|
||||||
if (updateLock)
|
if (updateLock)
|
||||||
|
@ -233,21 +214,10 @@ void fwPreferencesDialog::firmwareChanged()
|
||||||
void fwPreferencesDialog::writeValues()
|
void fwPreferencesDialog::writeValues()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.setValue("default_channel_order", ui->channelorderCB->currentIndex());
|
|
||||||
settings.setValue("default_mode", ui->stickmodeCB->currentIndex());
|
|
||||||
settings.setValue("cpu_id", ui->CPU_ID_LE->text());
|
settings.setValue("cpu_id", ui->CPU_ID_LE->text());
|
||||||
settings.setValue("rename_firmware_files", ui->renameFirmware->isChecked());
|
|
||||||
settings.setValue("burnFirmware", ui->burnFirmware->isChecked());
|
|
||||||
current_firmware_variant = getFirmwareVariant();
|
current_firmware_variant = getFirmwareVariant();
|
||||||
settings.setValue("firmware", current_firmware_variant.id);
|
settings.setValue("firmware", current_firmware_variant.id);
|
||||||
settings.setValue("profileId", ui->ProfSlot_SB->value());
|
|
||||||
settings.setValue("sdPath", ui->sdPath->text());
|
|
||||||
settings.setValue("SplashFileName", ui->SplashFileName->text());
|
|
||||||
if (!ui->SplashFileName->text().isEmpty())
|
|
||||||
settings.setValue("SplashImage", "");
|
|
||||||
|
|
||||||
MainWindow * mw = (MainWindow *)this->parent();
|
|
||||||
mw->unloadProfile();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware)
|
void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware)
|
||||||
|
@ -269,14 +239,7 @@ void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware)
|
||||||
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ui->langCombo->count()) {
|
showVoice(ui->langCombo->count()!=0);
|
||||||
ui->langCombo->show();
|
|
||||||
ui->langLabel->show();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui->langCombo->hide();
|
|
||||||
ui->langLabel->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
foreach(QList<Option> opts, parent->opts) {
|
foreach(QList<Option> opts, parent->opts) {
|
||||||
|
@ -294,25 +257,7 @@ void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware)
|
||||||
|
|
||||||
if (opt.name==QString("voice")) {
|
if (opt.name==QString("voice")) {
|
||||||
voice=cb;
|
voice=cb;
|
||||||
ui->voiceLabel->show();
|
showVoice(current_firmware_variant.id.contains(opt.name) ||firmware->voice);
|
||||||
ui->voiceCombo->show();
|
|
||||||
ui->voice_dnld->show();
|
|
||||||
ui->sdPathButton->show();
|
|
||||||
ui->sdPath->show();
|
|
||||||
ui->sdPathLabel->show();
|
|
||||||
if (current_firmware_variant.id.contains(opt.name) ||firmware->voice) {
|
|
||||||
ui->voiceLabel->setEnabled(true);
|
|
||||||
ui->voiceCombo->setEnabled(true);
|
|
||||||
ui->voice_dnld->setEnabled(true);
|
|
||||||
ui->sdPathButton->setEnabled(true);
|
|
||||||
ui->sdPath->setEnabled(true);
|
|
||||||
} else {
|
|
||||||
ui->voiceLabel->setDisabled(true);
|
|
||||||
ui->voiceCombo->setDisabled(true);
|
|
||||||
ui->voice_dnld->setDisabled(true);
|
|
||||||
ui->sdPathButton->setDisabled(true);
|
|
||||||
ui->sdPath->setDisabled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,16 +276,8 @@ void fwPreferencesDialog::populateFirmwareOptions(const FirmwareInfo * firmware)
|
||||||
void fwPreferencesDialog::initSettings()
|
void fwPreferencesDialog::initSettings()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
ui->channelorderCB->setCurrentIndex(settings.value("default_channel_order", 0).toInt());
|
|
||||||
ui->stickmodeCB->setCurrentIndex(settings.value("default_mode", 1).toInt());
|
|
||||||
ui->renameFirmware->setChecked(settings.value("rename_firmware_files", false).toBool());
|
|
||||||
ui->burnFirmware->setChecked(settings.value("burnFirmware", true).toBool());
|
|
||||||
ui->CPU_ID_LE->setText(settings.value("cpu_id", "").toString());
|
|
||||||
QString Path=settings.value("sdPath", "").toString();
|
|
||||||
if (QDir(Path).exists()) {
|
|
||||||
ui->sdPath->setText(Path);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ui->CPU_ID_LE->setText(settings.value("cpu_id", "").toString());
|
||||||
FirmwareInfo * current_firmware = GetCurrentFirmware();
|
FirmwareInfo * current_firmware = GetCurrentFirmware();
|
||||||
|
|
||||||
foreach(FirmwareInfo * firmware, firmwares) {
|
foreach(FirmwareInfo * firmware, firmwares) {
|
||||||
|
@ -351,27 +288,31 @@ void fwPreferencesDialog::initSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
baseFirmwareChanged();
|
baseFirmwareChanged();
|
||||||
|
|
||||||
ui->ProfSlot_SB->setValue(settings.value("profileId", 1).toInt());
|
|
||||||
on_ProfSlot_SB_valueChanged();
|
|
||||||
QString fileName=settings.value("SplashFileName","").toString();
|
|
||||||
if (!fileName.isEmpty()) {
|
|
||||||
QFile file(fileName);
|
|
||||||
if (file.exists()){
|
|
||||||
ui->SplashFileName->setText(fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
firmwareChanged();
|
firmwareChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fwPreferencesDialog::on_checkFWUpdates_clicked()
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
|
FirmwareVariant variant = getFirmwareVariant();
|
||||||
|
if (settings.value("burnFirmware", true).toBool()) {
|
||||||
|
current_firmware_variant = variant;
|
||||||
|
settings.setValue("firmware", variant.id);
|
||||||
|
}
|
||||||
|
MainWindow * mw = (MainWindow *)this->parent();
|
||||||
|
mw->checkForUpdates(true, variant.id);
|
||||||
|
firmwareChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void fwPreferencesDialog::on_fw_dnld_clicked()
|
void fwPreferencesDialog::on_fw_dnld_clicked()
|
||||||
{
|
{
|
||||||
|
QSettings settings;
|
||||||
MainWindow * mw = (MainWindow *)this->parent();
|
MainWindow * mw = (MainWindow *)this->parent();
|
||||||
FirmwareVariant variant = getFirmwareVariant();
|
FirmwareVariant variant = getFirmwareVariant();
|
||||||
writeValues();
|
writeValues();
|
||||||
if (!variant.firmware->getUrl(variant.id).isNull()) {
|
if (!variant.firmware->getUrl(variant.id).isNull()) {
|
||||||
if (ui->burnFirmware->isChecked()) {
|
if (settings.value("burnFirmware", true).toBool()) {
|
||||||
QSettings settings;
|
|
||||||
current_firmware_variant = getFirmwareVariant();
|
current_firmware_variant = getFirmwareVariant();
|
||||||
settings.setValue("firmware", current_firmware_variant.id);
|
settings.setValue("firmware", current_firmware_variant.id);
|
||||||
}
|
}
|
||||||
|
@ -382,126 +323,10 @@ void fwPreferencesDialog::on_fw_dnld_clicked()
|
||||||
|
|
||||||
void fwPreferencesDialog::on_voice_dnld_clicked()
|
void fwPreferencesDialog::on_voice_dnld_clicked()
|
||||||
{
|
{
|
||||||
ui->ProfSave_PB->setEnabled(true);
|
|
||||||
QString url="http://fw.opentx.it/voices/";
|
QString url="http://fw.opentx.it/voices/";
|
||||||
FirmwareVariant variant = getFirmwareVariant();
|
FirmwareVariant variant = getFirmwareVariant();
|
||||||
url.append(QString("%1/%2/").arg(variant.firmware->id).arg(ui->voiceCombo->currentText()));
|
url.append(QString("%1/%2/").arg(variant.firmware->id).arg(ui->voiceCombo->currentText()));
|
||||||
QDesktopServices::openUrl(url);
|
QDesktopServices::openUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fwPreferencesDialog::on_sdPathButton_clicked()
|
|
||||||
{
|
|
||||||
QSettings settings;
|
|
||||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), settings.value("sdPath").toString());
|
|
||||||
if (!fileName.isEmpty()) {
|
|
||||||
ui->sdPath->setText(fileName);
|
|
||||||
}
|
|
||||||
ui->ProfSave_PB->setEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void fwPreferencesDialog::on_ProfSlot_SB_valueChanged()
|
|
||||||
{
|
|
||||||
QSettings settings;
|
|
||||||
settings.beginGroup("Profiles");
|
|
||||||
QString profile=QString("profile%1").arg(ui->ProfSlot_SB->value());
|
|
||||||
settings.beginGroup(profile);
|
|
||||||
QString name=settings.value("Name","").toString();
|
|
||||||
ui->ProfName_LE->setText(name);
|
|
||||||
/* if (!(name.isEmpty())) {
|
|
||||||
QString firmwarename=settings.value("firmware", default_firmware_id).toString();
|
|
||||||
FirmwareInfo * fw = getFirmware(firmwarename);
|
|
||||||
int i=0;
|
|
||||||
foreach(FirmwareInfo * firmware, firmwares) {
|
|
||||||
if (fw == firmware) {
|
|
||||||
qDebug() << fw->id;
|
|
||||||
qDebug() << firmware->id;
|
|
||||||
qDebug() << i;
|
|
||||||
ui->downloadVerCB->setCurrentIndex(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
baseFirmwareChanged();
|
|
||||||
populateFirmwareOptions(fw);
|
|
||||||
}*/
|
|
||||||
settings.endGroup();
|
|
||||||
settings.endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
void fwPreferencesDialog::on_ProfSave_PB_clicked()
|
|
||||||
{
|
|
||||||
QSettings settings;
|
|
||||||
settings.beginGroup("Profiles");
|
|
||||||
QString profile=QString("profile%1").arg(ui->ProfSlot_SB->value());
|
|
||||||
QString name=ui->ProfName_LE->text();
|
|
||||||
if (name.isEmpty()) {
|
|
||||||
int ret = QMessageBox::question(this, "Companion",
|
|
||||||
tr("Profile name is empty, profile slot %1 will be deleted.<br>Are you sure ?").arg(ui->ProfSlot_SB->value()) ,
|
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
|
||||||
if (ret==QMessageBox::Yes) {
|
|
||||||
settings.remove(profile);
|
|
||||||
} else {
|
|
||||||
settings.beginGroup(profile);
|
|
||||||
ui->ProfName_LE->setText(settings.value("Name","").toString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
settings.beginGroup(profile);
|
|
||||||
settings.setValue("Name",name);
|
|
||||||
settings.setValue("default_channel_order", ui->channelorderCB->currentIndex());
|
|
||||||
settings.setValue("default_mode", ui->stickmodeCB->currentIndex());
|
|
||||||
settings.setValue("burnFirmware", ui->burnFirmware->isChecked());
|
|
||||||
settings.setValue("rename_firmware_files", ui->renameFirmware->isChecked());
|
|
||||||
settings.setValue("sdPath", ui->sdPath->text());
|
|
||||||
settings.setValue("SplashFileName", ui->SplashFileName->text());
|
|
||||||
current_firmware_variant = getFirmwareVariant();
|
|
||||||
settings.setValue("firmware", current_firmware_variant.id);
|
|
||||||
settings.endGroup();
|
|
||||||
settings.endGroup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void fwPreferencesDialog::on_SplashSelect_clicked()
|
|
||||||
{
|
|
||||||
QString supportedImageFormats;
|
|
||||||
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
|
||||||
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
|
||||||
}
|
|
||||||
|
|
||||||
QSettings settings;
|
|
||||||
QString fileName = QFileDialog::getOpenFileName(this,
|
|
||||||
tr("Open Image to load"), settings.value("lastImagesDir").toString(), tr("Images (%1)").arg(supportedImageFormats));
|
|
||||||
|
|
||||||
if (!fileName.isEmpty()) {
|
|
||||||
settings.setValue("lastImagesDir", QFileInfo(fileName).dir().absolutePath());
|
|
||||||
QImage image(fileName);
|
|
||||||
if (image.isNull()) {
|
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load %1.").arg(fileName));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ui->SplashFileName->setText(fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void fwPreferencesDialog::on_clearImageButton_clicked() {
|
|
||||||
ui->SplashFileName->clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void fwPreferencesDialog::on_checkFWUpdates_clicked()
|
|
||||||
{
|
|
||||||
FirmwareVariant variant = getFirmwareVariant();
|
|
||||||
if (ui->burnFirmware->isChecked()) {
|
|
||||||
QSettings settings;
|
|
||||||
current_firmware_variant = variant;
|
|
||||||
settings.setValue("firmware", variant.id);
|
|
||||||
}
|
|
||||||
MainWindow * mw = (MainWindow *)this->parent();
|
|
||||||
mw->checkForUpdates(true, variant.id);
|
|
||||||
firmwareChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void fwPreferencesDialog::shrink()
|
|
||||||
{
|
|
||||||
resize(0,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,9 @@ private:
|
||||||
QList<QCheckBox *> optionsCheckBoxes;
|
QList<QCheckBox *> optionsCheckBoxes;
|
||||||
bool updateLock;
|
bool updateLock;
|
||||||
|
|
||||||
|
void showVoice(bool);
|
||||||
|
void showVoice();
|
||||||
|
void hideVoice();
|
||||||
void populateLocale();
|
void populateLocale();
|
||||||
void populateFirmwareOptions(const FirmwareInfo *);
|
void populateFirmwareOptions(const FirmwareInfo *);
|
||||||
FirmwareVariant getFirmwareVariant();
|
FirmwareVariant getFirmwareVariant();
|
||||||
|
@ -39,12 +42,7 @@ private slots:
|
||||||
void firmwareChanged();
|
void firmwareChanged();
|
||||||
void on_fw_dnld_clicked();
|
void on_fw_dnld_clicked();
|
||||||
void on_voice_dnld_clicked();
|
void on_voice_dnld_clicked();
|
||||||
void on_sdPathButton_clicked();
|
|
||||||
void on_checkFWUpdates_clicked();
|
void on_checkFWUpdates_clicked();
|
||||||
void on_ProfSlot_SB_valueChanged();
|
|
||||||
void on_ProfSave_PB_clicked();
|
|
||||||
void on_SplashSelect_clicked();
|
|
||||||
void on_clearImageButton_clicked();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FWPREFERENCESDIALOG_H
|
#endif // FWPREFERENCESDIALOG_H
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>620</width>
|
<width>620</width>
|
||||||
<height>658</height>
|
<height>437</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -32,181 +32,13 @@
|
||||||
<property name="margin">
|
<property name="margin">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="21" column="5">
|
<item row="38" column="5">
|
||||||
<widget class="QPushButton" name="voice_dnld">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Download Voice</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="standardButtons">
|
||||||
</item>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
<item row="35" column="2" colspan="3">
|
|
||||||
<widget class="QCheckBox" name="burnFirmware">
|
|
||||||
<property name="text">
|
|
||||||
<string>Offer to write FW to Tx after download</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="10" column="2">
|
|
||||||
<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>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>CheckBox</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="18" column="5">
|
|
||||||
<widget class="QPushButton" name="fw_dnld">
|
|
||||||
<property name="text">
|
|
||||||
<string>Download FW</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Options</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="12" column="4">
|
|
||||||
<widget class="QCheckBox" name="optionCheckBox_19">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>CheckBox</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="5">
|
|
||||||
<widget class="QCheckBox" name="optionCheckBox_8">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>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>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>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>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>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>CheckBox</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="2" colspan="4">
|
|
||||||
<widget class="QLabel" name="FwInfo">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>FwInfo</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="17" column="5">
|
|
||||||
<widget class="QCheckBox" name="optionCheckBox_40">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>CheckBox</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -223,6 +55,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>CheckBox</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="11" column="5">
|
<item row="11" column="5">
|
||||||
<widget class="QCheckBox" name="optionCheckBox_16">
|
<widget class="QCheckBox" name="optionCheckBox_16">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -246,35 +91,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="32" column="0" colspan="2">
|
|
||||||
<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="33" column="0" colspan="2">
|
|
||||||
<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>Channel Order</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="2">
|
<item row="8" column="2">
|
||||||
<widget class="QCheckBox" name="optionCheckBox_2">
|
<widget class="QCheckBox" name="optionCheckBox_2">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -301,60 +117,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="32" column="2" colspan="2">
|
|
||||||
<widget class="QComboBox" name="stickmodeCB">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>190</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string>Mode selection:
|
|
||||||
|
|
||||||
Mode 1:
|
|
||||||
Left stick: Elevator, Rudder
|
|
||||||
Right stick: Throttle, Aileron
|
|
||||||
|
|
||||||
Mode 2:
|
|
||||||
Left stick: Throttle, Rudder
|
|
||||||
Right stick: Elevator, Aileron
|
|
||||||
|
|
||||||
Mode 3:
|
|
||||||
Left stick: Elevator, Aileron
|
|
||||||
Right stick: Throttle, Rudder
|
|
||||||
|
|
||||||
Mode 4:
|
|
||||||
Left stick: Throttle, Aileron
|
|
||||||
Right stick: Elevator, Rudder
|
|
||||||
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Mode 1 (RUD ELE THR AIL)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Mode 2 (RUD THR ELE AIL)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Mode 3 (AIL ELE THR RUD)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Mode 4 (AIL THR ELE RUD)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="15" column="2">
|
<item row="15" column="2">
|
||||||
<widget class="QCheckBox" name="optionCheckBox_29">
|
<widget class="QCheckBox" name="optionCheckBox_29">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -394,6 +156,9 @@ Mode 4:
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="2" colspan="3">
|
||||||
|
<widget class="QComboBox" name="downloadVerCB"/>
|
||||||
|
</item>
|
||||||
<item row="7" column="2">
|
<item row="7" column="2">
|
||||||
<widget class="QComboBox" name="langCombo">
|
<widget class="QComboBox" name="langCombo">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -410,8 +175,8 @@ Mode 4:
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2" colspan="3">
|
<item row="5" column="2" colspan="3">
|
||||||
<widget class="QComboBox" name="downloadVerCB"/>
|
<widget class="QLineEdit" name="CPU_ID_LE"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
|
@ -436,159 +201,6 @@ Mode 4:
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="2" colspan="3">
|
|
||||||
<widget class="QLineEdit" name="CPU_ID_LE"/>
|
|
||||||
</item>
|
|
||||||
<item row="33" column="2" colspan="2">
|
|
||||||
<widget class="QComboBox" name="channelorderCB">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>75</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string>Channel order
|
|
||||||
|
|
||||||
This is used by the templated to determine which channel goes to what number output.</string>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>R E T A</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>R E A T</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>R T E A</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>R T A E</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>R A E T</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>R A T E</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>E R T A</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>E R A T</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>E T R A</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>E T A R</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>E A R T</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>E A T R</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>T R E A</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>T R A E</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>T E R A</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>T E A R</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>T A R E</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>T A E R</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>A R E T</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>A R T E</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>A E R T</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>A E T R</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>A T R E</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>A T E R</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="5">
|
<item row="8" column="5">
|
||||||
<widget class="QCheckBox" name="optionCheckBox_4">
|
<widget class="QCheckBox" name="optionCheckBox_4">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -641,19 +253,6 @@ This is used by the templated to determine which channel goes to what number out
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>CheckBox</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="12" column="2">
|
<item row="12" column="2">
|
||||||
<widget class="QCheckBox" name="optionCheckBox_17">
|
<widget class="QCheckBox" name="optionCheckBox_17">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -914,40 +513,6 @@ This is used by the templated to determine which channel goes to what number out
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="34" column="2" colspan="3">
|
|
||||||
<widget class="QCheckBox" name="renameFirmware">
|
|
||||||
<property name="text">
|
|
||||||
<string>Append version number to FW file name</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="46" column="5">
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="23" column="0">
|
|
||||||
<widget class="QLabel" name="label_16">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Sans Serif</family>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Profile</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="5">
|
<item row="3" column="5">
|
||||||
<widget class="QPushButton" name="checkFWUpdates">
|
<widget class="QPushButton" name="checkFWUpdates">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
|
@ -961,37 +526,6 @@ This is used by the templated to determine which channel goes to what number out
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="25" column="2" colspan="3">
|
|
||||||
<widget class="QLineEdit" name="SplashFileName">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="21" column="2">
|
|
||||||
<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="25" column="5">
|
|
||||||
<widget class="QPushButton" name="SplashSelect">
|
|
||||||
<property name="text">
|
|
||||||
<string>Open Image</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="21" column="0">
|
<item row="21" column="0">
|
||||||
<widget class="QLabel" name="voiceLabel">
|
<widget class="QLabel" name="voiceLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
|
@ -1006,109 +540,202 @@ May be different from firmware language</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="25" column="0">
|
<item row="21" column="2">
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QComboBox" name="voiceCombo">
|
||||||
<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="32" column="5">
|
|
||||||
<widget class="QPushButton" name="clearImageButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Clear Image</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="23" column="3" colspan="2">
|
|
||||||
<widget class="QLineEdit" name="ProfName_LE"/>
|
|
||||||
</item>
|
|
||||||
<item row="23" column="2">
|
|
||||||
<widget class="QSpinBox" name="ProfSlot_SB">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>50</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="toolTip">
|
||||||
<number>1</number>
|
<string>Set language of voice.
|
||||||
</property>
|
May be different from firmware language</string>
|
||||||
<property name="maximum">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="22" column="0" colspan="6">
|
<item row="21" column="5">
|
||||||
<widget class="Line" name="line_5">
|
<widget class="QPushButton" name="voice_dnld">
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="20" column="0" colspan="6">
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="45" column="0" colspan="6">
|
|
||||||
<widget class="Line" name="line_6">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="24" column="5">
|
|
||||||
<widget class="QPushButton" name="sdPathButton">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open Folder</string>
|
<string>Download Voice</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="24" column="2" colspan="3">
|
<item row="10" column="2">
|
||||||
<widget class="QLineEdit" name="sdPath">
|
<widget class="QCheckBox" name="optionCheckBox_9">
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="24" column="0">
|
|
||||||
<widget class="QLabel" name="sdPathLabel">
|
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>SD Structure path</string>
|
<string>CheckBox</string>
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="35" column="5">
|
<item row="10" column="3">
|
||||||
<widget class="QPushButton" name="ProfSave_PB">
|
<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">
|
<property name="text">
|
||||||
<string>Save Profile</string>
|
<string>CheckBox</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="18" column="5">
|
||||||
|
<widget class="QPushButton" name="fw_dnld">
|
||||||
|
<property name="text">
|
||||||
|
<string>Download FW</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Options</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="4">
|
||||||
|
<widget class="QCheckBox" name="optionCheckBox_19">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>CheckBox</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="5">
|
||||||
|
<widget class="QCheckBox" name="optionCheckBox_8">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>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>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>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>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>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>CheckBox</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="2" colspan="4">
|
||||||
|
<widget class="QLabel" name="FwInfo">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>FwInfo</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="17" column="5">
|
||||||
|
<widget class="QCheckBox" name="optionCheckBox_40">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>CheckBox</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="20" column="1" colspan="5">
|
||||||
|
<widget class="Line" name="voiceLine">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</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>
|
||||||
|
@ -1161,10 +788,6 @@ May be different from firmware language</string>
|
||||||
<tabstop>optionCheckBox_40</tabstop>
|
<tabstop>optionCheckBox_40</tabstop>
|
||||||
<tabstop>optionCheckBox_41</tabstop>
|
<tabstop>optionCheckBox_41</tabstop>
|
||||||
<tabstop>optionCheckBox_42</tabstop>
|
<tabstop>optionCheckBox_42</tabstop>
|
||||||
<tabstop>stickmodeCB</tabstop>
|
|
||||||
<tabstop>channelorderCB</tabstop>
|
|
||||||
<tabstop>renameFirmware</tabstop>
|
|
||||||
<tabstop>burnFirmware</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="companion.qrc"/>
|
<include location="companion.qrc"/>
|
||||||
|
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 17 KiB |
|
@ -124,12 +124,6 @@ MainWindow::MainWindow():
|
||||||
updateMenus();
|
updateMenus();
|
||||||
|
|
||||||
readSettings();
|
readSettings();
|
||||||
FirmwareInfo *firmware = GetCurrentFirmware();
|
|
||||||
if (ActiveProfile) {
|
|
||||||
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
|
|
||||||
} else {
|
|
||||||
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
|
|
||||||
}
|
|
||||||
setUnifiedTitleAndToolBarOnMac(true);
|
setUnifiedTitleAndToolBarOnMac(true);
|
||||||
this->setWindowIcon(QIcon(":/icon.png"));
|
this->setWindowIcon(QIcon(":/icon.png"));
|
||||||
this->setIconSize(QSize(32,32));
|
this->setIconSize(QSize(32,32));
|
||||||
|
@ -752,23 +746,20 @@ void MainWindow::loadProfile()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
QAction *action = qobject_cast<QAction *>(sender());
|
QAction *action = qobject_cast<QAction *>(sender());
|
||||||
int chord,defmod, burnfw;
|
|
||||||
bool renfw;
|
|
||||||
|
|
||||||
if (action) {
|
if (action) {
|
||||||
int profnum=action->data().toInt();
|
int profnum=action->data().toInt();
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.setValue("ActiveProfile",profnum);
|
settings.setValue("profileId",profnum);
|
||||||
settings.beginGroup("Profiles");
|
settings.beginGroup("Profiles");
|
||||||
QString profile=QString("profile%1").arg(profnum);
|
QString profile=QString("profile%1").arg(profnum);
|
||||||
settings.beginGroup(profile);
|
settings.beginGroup(profile);
|
||||||
ActiveProfile=profnum;
|
QString profileName=settings.value("Name", "").toString();
|
||||||
ActiveProfileName=settings.value("Name", "").toString();
|
int chord=settings.value("default_channel_order", 0).toInt();
|
||||||
chord=settings.value("default_channel_order", 0).toInt();
|
int defmod=settings.value("default_mode", 0).toInt();
|
||||||
defmod=settings.value("default_mode", 0).toInt();
|
bool burnfw=settings.value("burnFirmware", false).toBool();
|
||||||
burnfw=settings.value("burnFirmware", 0).toInt();
|
|
||||||
QString sdPath=settings.value("sdPath", ".").toString();
|
QString sdPath=settings.value("sdPath", ".").toString();
|
||||||
renfw=settings.value("rename_firmware_files", false).toBool();
|
bool renfw=settings.value("rename_firmware_files", false).toBool();
|
||||||
QString SplashFileName=settings.value("SplashFileName","").toString();
|
QString SplashFileName=settings.value("SplashFileName","").toString();
|
||||||
QString SplashImage=settings.value("SplashImage", "").toString();
|
QString SplashImage=settings.value("SplashImage", "").toString();
|
||||||
QString firmware_id=settings.value("firmware", default_firmware_variant.id).toString();
|
QString firmware_id=settings.value("firmware", default_firmware_variant.id).toString();
|
||||||
|
@ -777,6 +768,7 @@ void MainWindow::loadProfile()
|
||||||
settings.setValue("firmware", firmware_id);
|
settings.setValue("firmware", firmware_id);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
settings.setValue("Name", profileName );
|
||||||
settings.setValue("default_channel_order", chord);
|
settings.setValue("default_channel_order", chord);
|
||||||
settings.setValue("default_mode", defmod);
|
settings.setValue("default_mode", defmod);
|
||||||
settings.setValue("burnFirmware", burnfw);
|
settings.setValue("burnFirmware", burnfw);
|
||||||
|
@ -785,46 +777,15 @@ void MainWindow::loadProfile()
|
||||||
settings.setValue("SplashFileName", SplashFileName);
|
settings.setValue("SplashFileName", SplashFileName);
|
||||||
settings.setValue("SplashImage", SplashImage);
|
settings.setValue("SplashImage", SplashImage);
|
||||||
settings.setValue("firmware", firmware_id);
|
settings.setValue("firmware", firmware_id);
|
||||||
settings.setValue("profileId", profnum);
|
|
||||||
current_firmware_variant = GetFirmwareVariant(firmware_id);
|
current_firmware_variant = GetFirmwareVariant(firmware_id);
|
||||||
FirmwareInfo *firmware = GetCurrentFirmware();
|
|
||||||
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
|
|
||||||
// settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath());
|
|
||||||
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
|
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
|
||||||
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
|
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
|
||||||
mdiChild->eepromInterfaceChanged();
|
mdiChild->eepromInterfaceChanged();
|
||||||
}
|
}
|
||||||
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::unloadProfile()
|
updateMenus();
|
||||||
{
|
|
||||||
ActiveProfile=0;
|
|
||||||
ActiveProfileName="";
|
|
||||||
QSettings settings;
|
|
||||||
settings.setValue("ActiveProfile", 0);
|
|
||||||
FirmwareInfo *firmware = GetCurrentFirmware();
|
|
||||||
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::preferences()
|
|
||||||
{
|
|
||||||
preferencesDialog *pd = new preferencesDialog(this);
|
|
||||||
pd->exec();
|
|
||||||
FirmwareInfo *firmware = GetCurrentFirmware();
|
|
||||||
if (ActiveProfile) {
|
|
||||||
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
|
|
||||||
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
|
|
||||||
mdiChild->eepromInterfaceChanged();
|
|
||||||
}
|
|
||||||
updateMenus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::appPreferences()
|
void MainWindow::appPreferences()
|
||||||
|
@ -838,14 +799,6 @@ void MainWindow::fwPreferences()
|
||||||
{
|
{
|
||||||
fwPreferencesDialog *pd = new fwPreferencesDialog(this);
|
fwPreferencesDialog *pd = new fwPreferencesDialog(this);
|
||||||
pd->exec();
|
pd->exec();
|
||||||
FirmwareInfo *firmware = GetCurrentFirmware();
|
|
||||||
if (ActiveProfile) {
|
|
||||||
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
|
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
|
||||||
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
|
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
|
||||||
mdiChild->eepromInterfaceChanged();
|
mdiChild->eepromInterfaceChanged();
|
||||||
|
@ -1640,19 +1593,9 @@ void MainWindow::updateMenus()
|
||||||
compareAct->setEnabled(activeMdiChild());
|
compareAct->setEnabled(activeMdiChild());
|
||||||
updateRecentFileActions();
|
updateRecentFileActions();
|
||||||
updateProfilesActions();
|
updateProfilesActions();
|
||||||
bool notfound=true;
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.beginGroup("Profiles");
|
setWindowTitle(tr("OpenTX Companion - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->name).arg(settings.value("profileId").toString()));
|
||||||
for (int i=0; i<MAX_PROFILES; i++) {
|
|
||||||
QString profile=QString("profile%1").arg(i+1);
|
|
||||||
settings.beginGroup(profile);
|
|
||||||
QString name=settings.value("Name","").toString();
|
|
||||||
if (!name.isEmpty()) {
|
|
||||||
notfound=false;
|
|
||||||
}
|
|
||||||
settings.endGroup();
|
|
||||||
}
|
|
||||||
profileButton->setDisabled(notfound);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MdiChild *MainWindow::createMdiChild()
|
MdiChild *MainWindow::createMdiChild()
|
||||||
|
@ -1701,16 +1644,12 @@ void MainWindow::createActions()
|
||||||
logsAct->setStatusTip(tr("Open log file"));
|
logsAct->setStatusTip(tr("Open log file"));
|
||||||
connect(logsAct, SIGNAL(triggered()), this, SLOT(logFile()));
|
connect(logsAct, SIGNAL(triggered()), this, SLOT(logFile()));
|
||||||
|
|
||||||
preferencesAct = new QAction(tr("&Old Preferences Dialog..."), this);
|
appPreferencesAct = new QAction(CompanionIcon("apppreferences.png"), tr("&Setting..."), this);
|
||||||
preferencesAct->setStatusTip(tr("Used the old Preferences Dialog"));
|
appPreferencesAct->setStatusTip(tr("Edit Settings"));
|
||||||
connect(preferencesAct, SIGNAL(triggered()), this, SLOT(preferences()));
|
|
||||||
|
|
||||||
appPreferencesAct = new QAction(CompanionIcon("apppreferences.png"), tr("&Application Preferences..."), this);
|
|
||||||
appPreferencesAct->setStatusTip(tr("Edit application preferences"));
|
|
||||||
connect(appPreferencesAct, SIGNAL(triggered()), this, SLOT(appPreferences()));
|
connect(appPreferencesAct, SIGNAL(triggered()), this, SLOT(appPreferences()));
|
||||||
|
|
||||||
fwPreferencesAct = new QAction(CompanionIcon("fwpreferences.png"), tr("&Downloads and Profiles..."), this);
|
fwPreferencesAct = new QAction(CompanionIcon("fwpreferences.png"), tr("&Downloads..."), this);
|
||||||
fwPreferencesAct->setStatusTip(tr("Firmware and voice file downloads as well as profile definition."));
|
fwPreferencesAct->setStatusTip(tr("Download firmware and voice files"));
|
||||||
connect(fwPreferencesAct, SIGNAL(triggered()), this, SLOT(fwPreferences()));
|
connect(fwPreferencesAct, SIGNAL(triggered()), this, SLOT(fwPreferences()));
|
||||||
|
|
||||||
checkForUpdatesAct = new QAction(CompanionIcon("update.png"), tr("&Check for updates..."), this);
|
checkForUpdatesAct = new QAction(CompanionIcon("update.png"), tr("&Check for updates..."), this);
|
||||||
|
@ -1833,6 +1772,9 @@ void MainWindow::createActions()
|
||||||
connect(profileActs[i], SIGNAL(triggered()), this, SLOT(loadProfile()));
|
connect(profileActs[i], SIGNAL(triggered()), this, SLOT(loadProfile()));
|
||||||
}
|
}
|
||||||
updateProfilesActions();
|
updateProfilesActions();
|
||||||
|
createProfileAct = new QAction(tr("New Profile"), this);
|
||||||
|
createProfileAct->setStatusTip(tr("Create a new Radio Setting Profile"));
|
||||||
|
connect(createProfileAct, SIGNAL(triggered()), this, SLOT(createProfile()));
|
||||||
|
|
||||||
classicThemeAct = new QAction(tr("Classic"), this);
|
classicThemeAct = new QAction(tr("Classic"), this);
|
||||||
classicThemeAct->setStatusTip(tr("The multicolor classical Companion icon theme"));
|
classicThemeAct->setStatusTip(tr("The multicolor classical Companion icon theme"));
|
||||||
|
@ -1917,7 +1859,6 @@ void MainWindow::createMenus()
|
||||||
|
|
||||||
{
|
{
|
||||||
QMenu *recentFileMenu=new QMenu(tr("Recent Files"));
|
QMenu *recentFileMenu=new QMenu(tr("Recent Files"));
|
||||||
QMenu *profilesMenu=new QMenu(tr("Firmware Profiles"));
|
|
||||||
QMenu *languageMenu=new QMenu(tr("Set Menu Language"));
|
QMenu *languageMenu=new QMenu(tr("Set Menu Language"));
|
||||||
QMenu *themeMenu=new QMenu(tr("Set Icon Theme"));
|
QMenu *themeMenu=new QMenu(tr("Set Icon Theme"));
|
||||||
QMenu *iconThemeSizeMenu=new QMenu(tr("Set Icon Size"));
|
QMenu *iconThemeSizeMenu=new QMenu(tr("Set Icon Size"));
|
||||||
|
@ -1939,11 +1880,7 @@ void MainWindow::createMenus()
|
||||||
fileMenu->addAction(compareAct);
|
fileMenu->addAction(compareAct);
|
||||||
fileMenu->addSeparator();
|
fileMenu->addSeparator();
|
||||||
fileMenu->addAction(fwPreferencesAct);
|
fileMenu->addAction(fwPreferencesAct);
|
||||||
fileMenu->addMenu(profilesMenu);
|
fileMenu->addMenu(createProfilesMenu());
|
||||||
|
|
||||||
profilesMenu->setIcon(CompanionIcon("profiles.png"));
|
|
||||||
for (int i=0; i<MAX_PROFILES; ++i)
|
|
||||||
profilesMenu->addAction(profileActs[i]);
|
|
||||||
fileMenu->addAction(exitAct);
|
fileMenu->addAction(exitAct);
|
||||||
|
|
||||||
editMenu = menuBar()->addMenu(tr("&Edit"));
|
editMenu = menuBar()->addMenu(tr("&Edit"));
|
||||||
|
@ -1977,7 +1914,6 @@ void MainWindow::createMenus()
|
||||||
settingsMenu->addSeparator();
|
settingsMenu->addSeparator();
|
||||||
settingsMenu->addAction(appPreferencesAct);
|
settingsMenu->addAction(appPreferencesAct);
|
||||||
settingsMenu->addAction(customizeSplashAct);
|
settingsMenu->addAction(customizeSplashAct);
|
||||||
settingsMenu->addAction(preferencesAct);
|
|
||||||
settingsMenu->addAction(burnConfigAct);
|
settingsMenu->addAction(burnConfigAct);
|
||||||
|
|
||||||
burnMenu = menuBar()->addMenu(tr("&Read/Write"));
|
burnMenu = menuBar()->addMenu(tr("&Read/Write"));
|
||||||
|
@ -2021,9 +1957,15 @@ QMenu *MainWindow::createRecentFileMenu()
|
||||||
|
|
||||||
QMenu *MainWindow::createProfilesMenu()
|
QMenu *MainWindow::createProfilesMenu()
|
||||||
{
|
{
|
||||||
QMenu *profilesMenu = new QMenu(this);
|
QMenu *profilesMenu=new QMenu(tr("Radio Settings Profiles"));
|
||||||
for ( int i = 0; i < MAX_PROFILES; ++i)
|
int i;
|
||||||
|
for ( i = 0; i < MAX_PROFILES; ++i) {
|
||||||
profilesMenu->addAction(profileActs[i]);
|
profilesMenu->addAction(profileActs[i]);
|
||||||
|
}
|
||||||
|
if ( i>0 )
|
||||||
|
profilesMenu->addSeparator();
|
||||||
|
profilesMenu->addAction(createProfileAct);
|
||||||
|
profilesMenu->setIcon(CompanionIcon("profiles.png"));
|
||||||
return profilesMenu;
|
return profilesMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2039,11 +1981,14 @@ void MainWindow::createToolBars()
|
||||||
case 1:
|
case 1:
|
||||||
size=QSize(24,24);
|
size=QSize(24,24);
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
size=QSize(32,32);
|
||||||
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
size=QSize(48,48);
|
size=QSize(48,48);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
size=QSize(32,32);
|
size=QSize(24,24);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fileToolBar = addToolBar(tr("File"));
|
fileToolBar = addToolBar(tr("File"));
|
||||||
|
@ -2051,11 +1996,11 @@ void MainWindow::createToolBars()
|
||||||
fileToolBar->setObjectName("File");
|
fileToolBar->setObjectName("File");
|
||||||
fileToolBar->addAction(newAct);
|
fileToolBar->addAction(newAct);
|
||||||
fileToolBar->addAction(openAct);
|
fileToolBar->addAction(openAct);
|
||||||
QToolButton * recentToolButton = new QToolButton;
|
QToolButton * recentToolButton = new QToolButton;
|
||||||
recentToolButton->setPopupMode(QToolButton::InstantPopup);
|
recentToolButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
recentToolButton->setMenu(createRecentFileMenu());
|
recentToolButton->setMenu(createRecentFileMenu());
|
||||||
recentToolButton->setIcon(CompanionIcon("recentdocument.png"));
|
recentToolButton->setIcon(CompanionIcon("recentdocument.png"));
|
||||||
recentToolButton->setToolTip(tr("Recent Files"));
|
recentToolButton->setToolTip(tr("Recent Files"));
|
||||||
fileToolBar->addWidget(recentToolButton);
|
fileToolBar->addWidget(recentToolButton);
|
||||||
fileToolBar->addAction(saveAct);
|
fileToolBar->addAction(saveAct);
|
||||||
fileToolBar->addAction(logsAct);
|
fileToolBar->addAction(logsAct);
|
||||||
|
@ -2063,24 +2008,12 @@ void MainWindow::createToolBars()
|
||||||
fileToolBar->addAction(appPreferencesAct);
|
fileToolBar->addAction(appPreferencesAct);
|
||||||
fileToolBar->addAction(fwPreferencesAct);
|
fileToolBar->addAction(fwPreferencesAct);
|
||||||
fileToolBar->addAction(customizeSplashAct);
|
fileToolBar->addAction(customizeSplashAct);
|
||||||
profileButton = new QToolButton;
|
profileButton = new QToolButton;
|
||||||
profileButton->setPopupMode(QToolButton::InstantPopup);
|
profileButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
profileButton->setMenu(createProfilesMenu());
|
profileButton->setMenu(createProfilesMenu());
|
||||||
profileButton->setIcon(CompanionIcon("profiles.png"));
|
profileButton->setIcon(CompanionIcon("profiles.png"));
|
||||||
profileButton->setToolTip(tr("Firmware Profiles"));
|
profileButton->setToolTip(tr("Firmware Profiles"));
|
||||||
fileToolBar->addWidget(profileButton);
|
fileToolBar->addWidget(profileButton);
|
||||||
bool notfound=true;
|
|
||||||
settings.beginGroup("Profiles");
|
|
||||||
for (int i=0; i<MAX_PROFILES; i++) {
|
|
||||||
QString profile=QString("profile%1").arg(i+1);
|
|
||||||
settings.beginGroup(profile);
|
|
||||||
QString name=settings.value("Name","").toString();
|
|
||||||
if (!name.isEmpty()) {
|
|
||||||
notfound=false;
|
|
||||||
}
|
|
||||||
settings.endGroup();
|
|
||||||
}
|
|
||||||
profileButton->setDisabled(notfound);
|
|
||||||
fileToolBar->addSeparator();
|
fileToolBar->addSeparator();
|
||||||
fileToolBar->addAction(simulateAct);
|
fileToolBar->addAction(simulateAct);
|
||||||
fileToolBar->addAction(printAct);
|
fileToolBar->addAction(printAct);
|
||||||
|
@ -2092,7 +2025,6 @@ void MainWindow::createToolBars()
|
||||||
editToolBar->addAction(cutAct);
|
editToolBar->addAction(cutAct);
|
||||||
editToolBar->addAction(copyAct);
|
editToolBar->addAction(copyAct);
|
||||||
editToolBar->addAction(pasteAct);
|
editToolBar->addAction(pasteAct);
|
||||||
|
|
||||||
|
|
||||||
burnToolBar = new QToolBar(tr("Write"));
|
burnToolBar = new QToolBar(tr("Write"));
|
||||||
addToolBar( Qt::LeftToolBarArea, burnToolBar );
|
addToolBar( Qt::LeftToolBarArea, burnToolBar );
|
||||||
|
@ -2128,14 +2060,10 @@ void MainWindow::readSettings()
|
||||||
checkCompanion9x = settings.value("startup_check_companion", true).toBool();
|
checkCompanion9x = settings.value("startup_check_companion", true).toBool();
|
||||||
checkFW = settings.value("startup_check_fw", true).toBool();
|
checkFW = settings.value("startup_check_fw", true).toBool();
|
||||||
MaxRecentFiles =settings.value("history_size",10).toInt();
|
MaxRecentFiles =settings.value("history_size",10).toInt();
|
||||||
ActiveProfile=settings.value("activeprofile",0).toInt();
|
if (settings.value("profileId",0).toInt() == 0)
|
||||||
if (ActiveProfile) {
|
{
|
||||||
settings.beginGroup("Profiles");
|
createProfile();
|
||||||
QString profile=QString("profile%1").arg(ActiveProfile);
|
settings.setValue("profileId", "1");
|
||||||
settings.beginGroup(profile);
|
|
||||||
ActiveProfileName=settings.value("Name","").toString();
|
|
||||||
settings.endGroup();
|
|
||||||
settings.endGroup();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2189,6 +2117,8 @@ void MainWindow::updateProfilesActions()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
int activeProfile = settings.value("profileId").toInt();
|
||||||
|
|
||||||
settings.beginGroup("Profiles");
|
settings.beginGroup("Profiles");
|
||||||
for (i=0; i<MAX_PROFILES; i++) {
|
for (i=0; i<MAX_PROFILES; i++) {
|
||||||
QString profile=QString("profile%1").arg(i+1);
|
QString profile=QString("profile%1").arg(i+1);
|
||||||
|
@ -2199,14 +2129,43 @@ void MainWindow::updateProfilesActions()
|
||||||
profileActs[i]->setText(text);
|
profileActs[i]->setText(text);
|
||||||
profileActs[i]->setData(i+1);
|
profileActs[i]->setData(i+1);
|
||||||
profileActs[i]->setVisible(true);
|
profileActs[i]->setVisible(true);
|
||||||
|
if ((i+1) == activeProfile)
|
||||||
|
profileActs[i]->setIcon(CompanionIcon("arrow-right.png"));
|
||||||
|
else
|
||||||
|
profileActs[i]->setIcon(CompanionIcon(""));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
profileActs[i]->setVisible(false);
|
profileActs[i]->setVisible(false);
|
||||||
}
|
}
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
// separatorAct->setVisible(numRecentFiles > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::createProfile()
|
||||||
|
{
|
||||||
|
int firstFreeIndex = 0;
|
||||||
|
QSettings settings;
|
||||||
|
settings.beginGroup("Profiles");
|
||||||
|
for (int i=0; firstFreeIndex ==0 && i<MAX_PROFILES; i++) {
|
||||||
|
QString profile=QString("profile%1").arg(i+1);
|
||||||
|
settings.beginGroup(profile);
|
||||||
|
QString name=settings.value("Name","").toString();
|
||||||
|
if (name.isEmpty())
|
||||||
|
firstFreeIndex = i+1;
|
||||||
|
settings.endGroup();
|
||||||
|
}
|
||||||
|
settings.endGroup();
|
||||||
|
if (firstFreeIndex == 0) // Could not find free index
|
||||||
|
return;
|
||||||
|
|
||||||
|
settings.beginGroup("Profiles");
|
||||||
|
settings.beginGroup(QString("profile%1").arg(firstFreeIndex));
|
||||||
|
settings.setValue("Name",QString("profile%1").arg(firstFreeIndex));
|
||||||
|
settings.endGroup();
|
||||||
|
settings.endGroup();
|
||||||
|
|
||||||
|
updateMenus();
|
||||||
|
}
|
||||||
|
|
||||||
QString MainWindow::strippedName(const QString &fullFileName)
|
QString MainWindow::strippedName(const QString &fullFileName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,6 @@ QT_END_NAMESPACE
|
||||||
|
|
||||||
class MainWindow : public QMainWindow
|
class MainWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
friend class preferencesDialog;
|
|
||||||
friend class fwPreferencesDialog;
|
friend class fwPreferencesDialog;
|
||||||
friend class MdiChild; // TODO GetAvrdudeArgs could be external to this class
|
friend class MdiChild; // TODO GetAvrdudeArgs could be external to this class
|
||||||
|
|
||||||
|
@ -80,7 +79,6 @@ protected:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void downloadLatestFW(FirmwareInfo *firmware, const QString & firmwareId);
|
void downloadLatestFW(FirmwareInfo *firmware, const QString & firmwareId);
|
||||||
void unloadProfile();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void openDocumentURL();
|
void openDocumentURL();
|
||||||
|
@ -146,10 +144,10 @@ private slots:
|
||||||
void compare();
|
void compare();
|
||||||
void print();
|
void print();
|
||||||
void loadBackup();
|
void loadBackup();
|
||||||
void preferences();
|
|
||||||
void appPreferences();
|
void appPreferences();
|
||||||
void fwPreferences();
|
void fwPreferences();
|
||||||
void updateMenus();
|
void updateMenus();
|
||||||
|
void createProfile();
|
||||||
MdiChild *createMdiChild();
|
MdiChild *createMdiChild();
|
||||||
void setActiveSubWindow(QWidget *window);
|
void setActiveSubWindow(QWidget *window);
|
||||||
QMenu * createRecentFileMenu();
|
QMenu * createRecentFileMenu();
|
||||||
|
@ -191,7 +189,6 @@ private:
|
||||||
QString installer_fileName;
|
QString installer_fileName;
|
||||||
QString downloadedFW;
|
QString downloadedFW;
|
||||||
QString downloadedFWFilename;
|
QString downloadedFWFilename;
|
||||||
QString ActiveProfileName;
|
|
||||||
downloadDialog * downloadDialog_forWait;
|
downloadDialog * downloadDialog_forWait;
|
||||||
|
|
||||||
bool checkCompanion9x;
|
bool checkCompanion9x;
|
||||||
|
@ -199,7 +196,7 @@ private:
|
||||||
bool needRename;
|
bool needRename;
|
||||||
bool showcheckForUpdatesResult;
|
bool showcheckForUpdatesResult;
|
||||||
int MaxRecentFiles;
|
int MaxRecentFiles;
|
||||||
int ActiveProfile;
|
// int ActiveProfile;
|
||||||
int currentFWrev;
|
int currentFWrev;
|
||||||
int currentFWrev_temp;
|
int currentFWrev_temp;
|
||||||
int NewFwRev;
|
int NewFwRev;
|
||||||
|
@ -224,7 +221,6 @@ private:
|
||||||
QAction *saveAct;
|
QAction *saveAct;
|
||||||
QAction *saveAsAct;
|
QAction *saveAsAct;
|
||||||
QAction *exitAct;
|
QAction *exitAct;
|
||||||
QAction *preferencesAct;
|
|
||||||
QAction *appPreferencesAct;
|
QAction *appPreferencesAct;
|
||||||
QAction *fwPreferencesAct;
|
QAction *fwPreferencesAct;
|
||||||
QAction *checkForUpdatesAct;
|
QAction *checkForUpdatesAct;
|
||||||
|
@ -253,6 +249,7 @@ private:
|
||||||
QAction *logsAct;
|
QAction *logsAct;
|
||||||
QAction *recentFileActs[MAX_RECENT];
|
QAction *recentFileActs[MAX_RECENT];
|
||||||
QAction *profileActs[MAX_PROFILES];
|
QAction *profileActs[MAX_PROFILES];
|
||||||
|
QAction *createProfileAct;
|
||||||
QAction *classicThemeAct;
|
QAction *classicThemeAct;
|
||||||
QAction *monoThemeAct;
|
QAction *monoThemeAct;
|
||||||
QAction *monoBlueThemeAct;
|
QAction *monoBlueThemeAct;
|
||||||
|
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 876 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.2 KiB |
3
radio/src/.gitignore
vendored
|
@ -10,3 +10,6 @@
|
||||||
/*.o
|
/*.o
|
||||||
/*.bin
|
/*.bin
|
||||||
/*.lst
|
/*.lst
|
||||||
|
/SCRIPTS
|
||||||
|
/SOUNDS
|
||||||
|
/LOGS
|
||||||
|
|
|
@ -111,8 +111,6 @@ PACK(typedef struct {
|
||||||
}) MixData_v215;
|
}) MixData_v215;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PACK(typedef struct {
|
PACK(typedef struct {
|
||||||
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||||
uint16_t start:12;
|
uint16_t start:12;
|
||||||
|
@ -220,15 +218,38 @@ void ConvertGeneralSettings_215_to_216(EEGeneral &settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
|
int ConvertSource_215_to_216(int source, bool insertZero=false)
|
||||||
|
{
|
||||||
|
if (insertZero)
|
||||||
|
source += 1;
|
||||||
|
// Virtual Inputs and Lua Outputs added
|
||||||
|
if (source > 0)
|
||||||
|
source += MAX_INPUTS + MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS;
|
||||||
|
// 4 GVARS added
|
||||||
|
if (source > MIXSRC_GVAR1+4)
|
||||||
|
source += 4;
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
int ConvertSwitch_215_to_216(int swtch)
|
int ConvertSwitch_215_to_216(int swtch)
|
||||||
{
|
{
|
||||||
if (swtch <= SWSRC_LAST_SWITCH)
|
if (swtch < 0)
|
||||||
|
return -ConvertSwitch_215_to_216(-swtch);
|
||||||
|
else if (swtch <= SWSRC_LAST_SWITCH)
|
||||||
return swtch;
|
return swtch;
|
||||||
else
|
else
|
||||||
return swtch + (2*4) + (2*6); // 4 trims and 2 * 6-pos added as switches
|
return swtch + (2*4) + (2*6); // 4 trims and 2 * 6-pos added as switches
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
inline int ConvertSwitch_215_to_216(int swtch)
|
int ConvertSource_215_to_216(int source, bool removeZero=false)
|
||||||
|
{
|
||||||
|
// 4 GVARS added
|
||||||
|
if (source > MIXSRC_GVAR1+4)
|
||||||
|
source += 4;
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ConvertSwitch_215_to_216(int swtch)
|
||||||
{
|
{
|
||||||
if (swtch <= SWSRC_LAST_SWITCH)
|
if (swtch <= SWSRC_LAST_SWITCH)
|
||||||
return swtch;
|
return swtch;
|
||||||
|
@ -250,22 +271,28 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||||
// Mixes: GVARS in weight moved from 512 to 4096 and -512 to -4096, because GVARS may be used in limits [-1250:1250]
|
// Mixes: GVARS in weight moved from 512 to 4096 and -512 to -4096, because GVARS may be used in limits [-1250:1250]
|
||||||
// Switches: two 6-pos pots added, REa added to Sky9x
|
// Switches: two 6-pos pots added, REa added to Sky9x
|
||||||
|
|
||||||
TRACE("Model conversion from v215 to v216");
|
|
||||||
|
|
||||||
assert(sizeof(ModelData_v215) <= sizeof(ModelData));
|
assert(sizeof(ModelData_v215) <= sizeof(ModelData));
|
||||||
|
|
||||||
ModelData_v215 oldModel;
|
ModelData_v215 oldModel;
|
||||||
memcpy(&oldModel, &model, sizeof(oldModel));
|
memcpy(&oldModel, &model, sizeof(oldModel));
|
||||||
memset(&model, 0, sizeof(ModelData));
|
memset(&model, 0, sizeof(ModelData));
|
||||||
|
|
||||||
|
char name[LEN_MODEL_NAME+1];
|
||||||
|
zchar2str(name, oldModel.header.name, LEN_MODEL_NAME);
|
||||||
|
TRACE("Model %s conversion from v215 to v216", name);
|
||||||
|
|
||||||
memcpy(&g_model.header, &oldModel.header, sizeof(g_model.header));
|
memcpy(&g_model.header, &oldModel.header, sizeof(g_model.header));
|
||||||
for (uint8_t i=0; i<2; i++) {
|
for (uint8_t i=0; i<2; i++) {
|
||||||
g_model.timers[i].mode = oldModel.timers[i].mode;
|
TimerData & timer = g_model.timers[i];
|
||||||
g_model.timers[i].start = oldModel.timers[i].start;
|
if (oldModel.timers[i].mode >= TMRMODE_FIRST_SWITCH)
|
||||||
g_model.timers[i].minuteBeep = oldModel.timers[i].minuteBeep;
|
timer.mode = TMRMODE_FIRST_SWITCH + ConvertSwitch_215_to_216(oldModel.timers[i].mode - TMRMODE_FIRST_SWITCH + 1) - 1;
|
||||||
g_model.timers[i].persistent = oldModel.timers[i].persistent;
|
else
|
||||||
g_model.timers[i].countdownBeep = oldModel.timers[i].countdownBeep;
|
timer.mode = oldModel.timers[i].mode;
|
||||||
g_model.timers[i].value = oldModel.timers[i].value;
|
timer.start = oldModel.timers[i].start;
|
||||||
|
timer.minuteBeep = oldModel.timers[i].minuteBeep;
|
||||||
|
timer.persistent = oldModel.timers[i].persistent;
|
||||||
|
timer.countdownBeep = oldModel.timers[i].countdownBeep;
|
||||||
|
timer.value = oldModel.timers[i].value;
|
||||||
}
|
}
|
||||||
g_model.protocol = oldModel.protocol;
|
g_model.protocol = oldModel.protocol;
|
||||||
g_model.thrTrim = oldModel.thrTrim;
|
g_model.thrTrim = oldModel.thrTrim;
|
||||||
|
@ -277,43 +304,44 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||||
g_model.beepANACenter = oldModel.beepANACenter;
|
g_model.beepANACenter = oldModel.beepANACenter;
|
||||||
|
|
||||||
for (uint8_t i=0; i<64; i++) {
|
for (uint8_t i=0; i<64; i++) {
|
||||||
|
MixData & mix = g_model.mixData[i];
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
g_model.mixData[i].destCh = oldModel.mixData[i].destCh;
|
mix.destCh = oldModel.mixData[i].destCh;
|
||||||
g_model.mixData[i].phases = oldModel.mixData[i].phases;
|
mix.phases = oldModel.mixData[i].phases;
|
||||||
g_model.mixData[i].mltpx = oldModel.mixData[i].mltpx;
|
mix.mltpx = oldModel.mixData[i].mltpx;
|
||||||
g_model.mixData[i].weight = oldModel.mixData[i].weight;
|
mix.weight = oldModel.mixData[i].weight;
|
||||||
g_model.mixData[i].swtch = ConvertSwitch_215_to_216(oldModel.mixData[i].swtch);
|
mix.swtch = ConvertSwitch_215_to_216(oldModel.mixData[i].swtch);
|
||||||
if (oldModel.mixData[i].curveMode==0/*differential*/) {
|
if (oldModel.mixData[i].curveMode==0/*differential*/) {
|
||||||
g_model.mixData[i].curve.type = CURVE_REF_DIFF;
|
mix.curve.type = CURVE_REF_DIFF;
|
||||||
g_model.mixData[i].curve.value = oldModel.mixData[i].curveParam;
|
mix.curve.value = oldModel.mixData[i].curveParam;
|
||||||
}
|
}
|
||||||
else if (oldModel.mixData[i].curveParam <= 6) {
|
else if (oldModel.mixData[i].curveParam <= 6) {
|
||||||
g_model.mixData[i].curve.type = CURVE_REF_FUNC;
|
mix.curve.type = CURVE_REF_FUNC;
|
||||||
g_model.mixData[i].curve.value = oldModel.mixData[i].curveParam;
|
mix.curve.value = oldModel.mixData[i].curveParam;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g_model.mixData[i].curve.type = CURVE_REF_CUSTOM;
|
mix.curve.type = CURVE_REF_CUSTOM;
|
||||||
g_model.mixData[i].curve.value = oldModel.mixData[i].curveParam - 6;
|
mix.curve.value = oldModel.mixData[i].curveParam - 6;
|
||||||
}
|
}
|
||||||
g_model.mixData[i].mixWarn = oldModel.mixData[i].mixWarn;
|
mix.mixWarn = oldModel.mixData[i].mixWarn;
|
||||||
g_model.mixData[i].delayUp = oldModel.mixData[i].delayUp;
|
mix.delayUp = oldModel.mixData[i].delayUp;
|
||||||
g_model.mixData[i].delayDown = oldModel.mixData[i].delayDown;
|
mix.delayDown = oldModel.mixData[i].delayDown;
|
||||||
g_model.mixData[i].speedUp = oldModel.mixData[i].speedUp;
|
mix.speedUp = oldModel.mixData[i].speedUp;
|
||||||
g_model.mixData[i].speedDown = oldModel.mixData[i].speedDown;
|
mix.speedDown = oldModel.mixData[i].speedDown;
|
||||||
g_model.mixData[i].srcRaw = oldModel.mixData[i].srcRaw;
|
mix.srcRaw = oldModel.mixData[i].srcRaw;
|
||||||
if (g_model.mixData[i].srcRaw > 4 || oldModel.mixData[i].noExpo)
|
if (mix.srcRaw > 4 || oldModel.mixData[i].noExpo)
|
||||||
g_model.mixData[i].srcRaw += MAX_INPUTS + MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS;
|
mix.srcRaw = ConvertSource_215_to_216(mix.srcRaw);
|
||||||
g_model.mixData[i].offset = oldModel.mixData[i].offset;
|
mix.offset = oldModel.mixData[i].offset;
|
||||||
memcpy(g_model.mixData[i].name, oldModel.mixData[i].name, LEN_EXPOMIX_NAME);
|
memcpy(mix.name, oldModel.mixData[i].name, LEN_EXPOMIX_NAME);
|
||||||
#else
|
#else
|
||||||
memcpy(&g_model.mixData[i], &oldModel.mixData[i], sizeof(g_model.mixData[i]));
|
memcpy(&mix, &oldModel.mixData[i], sizeof(mix));
|
||||||
#endif
|
#endif
|
||||||
if (g_model.mixData[i].weight <= -508)
|
if (mix.weight <= -508)
|
||||||
g_model.mixData[i].weight = g_model.mixData[i].weight + 512 - 4096;
|
mix.weight = mix.weight + 512 - 4096;
|
||||||
else if (g_model.mixData[i].weight >= 507)
|
else if (mix.weight >= 507)
|
||||||
g_model.mixData[i].weight = g_model.mixData[i].weight - 512 + 4096;
|
mix.weight = mix.weight - 512 + 4096;
|
||||||
else
|
else
|
||||||
g_model.mixData[i].offset = g_model.mixData[i].offset * g_model.mixData[i].weight / 100;
|
mix.offset = mix.offset * mix.weight / 100;
|
||||||
}
|
}
|
||||||
for (uint8_t i=0; i<32; i++) {
|
for (uint8_t i=0; i<32; i++) {
|
||||||
g_model.limitData[i].min = 10 * oldModel.limitData[i].min;
|
g_model.limitData[i].min = 10 * oldModel.limitData[i].min;
|
||||||
|
@ -414,63 +442,65 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||||
sw.andsw = oldModel.customSw[i].andsw;
|
sw.andsw = oldModel.customSw[i].andsw;
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
uint8_t cstate = cswFamily(sw.func);
|
uint8_t cstate = cswFamily(sw.func);
|
||||||
if (cstate == LS_FAMILY_OFS || cstate == LS_FAMILY_COMP || cstate == LS_FAMILY_DIFF) {
|
if (cstate == LS_FAMILY_BOOL) {
|
||||||
if (sw.v1 > 0) sw.v1 += MAX_INPUTS + MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS;
|
sw.v1 = ConvertSwitch_215_to_216(sw.v1);
|
||||||
if (sw.v1 > MIXSRC_GVAR1+4) sw.v1 += 4;
|
sw.v2 = ConvertSwitch_215_to_216(sw.v2);
|
||||||
}
|
}
|
||||||
if (cstate == LS_FAMILY_OFS || cstate == LS_FAMILY_DIFF) {
|
else if (cstate == LS_FAMILY_OFS || cstate == LS_FAMILY_COMP || cstate == LS_FAMILY_DIFF) {
|
||||||
if (sw.v1 >= MIXSRC_FIRST_TELEM) {
|
sw.v1 = ConvertSource_215_to_216(sw.v1);
|
||||||
switch ((uint8_t)sw.v1) {
|
if (cstate == LS_FAMILY_OFS || cstate == LS_FAMILY_DIFF) {
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_TM1-1:
|
if (sw.v1 >= MIXSRC_FIRST_TELEM) {
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_TM2-1:
|
switch ((uint8_t)sw.v1) {
|
||||||
sw.v2 = (sw.v2+128) * 3;
|
case MIXSRC_FIRST_TELEM + TELEM_TM1-1:
|
||||||
break;
|
case MIXSRC_FIRST_TELEM + TELEM_TM2-1:
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_ALT-1:
|
sw.v2 = (sw.v2+128) * 3;
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_GPSALT-1:
|
break;
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_MIN_ALT-1:
|
case MIXSRC_FIRST_TELEM + TELEM_ALT-1:
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_MAX_ALT-1:
|
case MIXSRC_FIRST_TELEM + TELEM_GPSALT-1:
|
||||||
sw.v2 = (sw.v2+128) * 8 - 500;
|
case MIXSRC_FIRST_TELEM + TELEM_MIN_ALT-1:
|
||||||
break;
|
case MIXSRC_FIRST_TELEM + TELEM_MAX_ALT-1:
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_RPM-1:
|
sw.v2 = (sw.v2+128) * 8 - 500;
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_MAX_RPM-1:
|
break;
|
||||||
sw.v2 = (sw.v2+128) * 50;
|
case MIXSRC_FIRST_TELEM + TELEM_RPM-1:
|
||||||
break;
|
case MIXSRC_FIRST_TELEM + TELEM_MAX_RPM-1:
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_T1-1:
|
sw.v2 = (sw.v2+128) * 50;
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_T2-1:
|
break;
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_MAX_T1-1:
|
case MIXSRC_FIRST_TELEM + TELEM_T1-1:
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_MAX_T2-1:
|
case MIXSRC_FIRST_TELEM + TELEM_T2-1:
|
||||||
sw.v2 = (sw.v2+128) + 30;
|
case MIXSRC_FIRST_TELEM + TELEM_MAX_T1-1:
|
||||||
break;
|
case MIXSRC_FIRST_TELEM + TELEM_MAX_T2-1:
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_CELL-1:
|
sw.v2 = (sw.v2+128) + 30;
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_HDG-1:
|
break;
|
||||||
sw.v2 = (sw.v2+128) * 2;
|
case MIXSRC_FIRST_TELEM + TELEM_CELL-1:
|
||||||
break;
|
case MIXSRC_FIRST_TELEM + TELEM_HDG-1:
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_DIST-1:
|
sw.v2 = (sw.v2+128) * 2;
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_MAX_DIST-1:
|
break;
|
||||||
sw.v2 = (sw.v2+128) * 8;
|
case MIXSRC_FIRST_TELEM + TELEM_DIST-1:
|
||||||
break;
|
case MIXSRC_FIRST_TELEM + TELEM_MAX_DIST-1:
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_CURRENT-1:
|
sw.v2 = (sw.v2+128) * 8;
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_POWER-1:
|
break;
|
||||||
sw.v2 = (sw.v2+128) * 5;
|
case MIXSRC_FIRST_TELEM + TELEM_CURRENT-1:
|
||||||
break;
|
case MIXSRC_FIRST_TELEM + TELEM_POWER-1:
|
||||||
case MIXSRC_FIRST_TELEM + TELEM_CONSUMPTION-1:
|
sw.v2 = (sw.v2+128) * 5;
|
||||||
sw.v2 = (sw.v2+128) * 20;
|
break;
|
||||||
break;
|
case MIXSRC_FIRST_TELEM + TELEM_CONSUMPTION-1:
|
||||||
default:
|
sw.v2 = (sw.v2+128) * 20;
|
||||||
sw.v2 += 128;
|
break;
|
||||||
break;
|
default:
|
||||||
|
sw.v2 += 128;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (cstate == LS_FAMILY_COMP) {
|
||||||
if (cstate == LS_FAMILY_COMP) {
|
sw.v2 = ConvertSource_215_to_216(sw.v2);
|
||||||
if (sw.v2 > 0) sw.v2 += MAX_INPUTS + MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS;
|
}
|
||||||
if (sw.v2 > MIXSRC_GVAR1+4) sw.v2 += 4;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
for (uint8_t i=0; i<32; i++) {
|
for (uint8_t i=0; i<32; i++) {
|
||||||
CustomFnData & fn = g_model.funcSw[i];
|
CustomFnData & fn = g_model.funcSw[i];
|
||||||
fn.swtch = oldModel.funcSw[i].swtch;
|
fn.swtch = ConvertSwitch_215_to_216(oldModel.funcSw[i].swtch);
|
||||||
fn.func = oldModel.funcSw[i].func;
|
fn.func = oldModel.funcSw[i].func;
|
||||||
if (fn.func <= 15) {
|
if (fn.func <= 15) {
|
||||||
fn.all.param = fn.func;
|
fn.all.param = fn.func;
|
||||||
|
@ -537,17 +567,13 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||||
}
|
}
|
||||||
if (fn.func == FUNC_PLAY_VALUE || fn.func == FUNC_VOLUME || (IS_ADJUST_GV_FUNC(fn.func) && fn.all.mode == FUNC_ADJUST_GVAR_SOURCE)) {
|
if (fn.func == FUNC_PLAY_VALUE || fn.func == FUNC_VOLUME || (IS_ADJUST_GV_FUNC(fn.func) && fn.all.mode == FUNC_ADJUST_GVAR_SOURCE)) {
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
fn.all.param += 1 + MAX_INPUTS + MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS;
|
fn.all.param = ConvertSource_215_to_216(fn.all.param, true);
|
||||||
#endif
|
#endif
|
||||||
if (fn.all.param > MIXSRC_GVAR1+4) fn.all.param += 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_model.swashR = oldModel.swashR;
|
g_model.swashR = oldModel.swashR;
|
||||||
#if defined(PCBTARANIS)
|
g_model.swashR.collectiveSource = ConvertSource_215_to_216(g_model.swashR.collectiveSource);
|
||||||
if (g_model.swashR.collectiveSource > 0) g_model.swashR.collectiveSource += MAX_INPUTS + MAX_SCRIPTS*MAX_SCRIPT_OUTPUTS;
|
|
||||||
if (g_model.swashR.collectiveSource > MIXSRC_GVAR1+4) g_model.swashR.collectiveSource += 4;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (uint8_t i=0; i<9; i++) {
|
for (uint8_t i=0; i<9; i++) {
|
||||||
memcpy(&g_model.phaseData[i], &oldModel.phaseData[i], sizeof(oldModel.phaseData[i])); // the last 4 gvars will remain blank
|
memcpy(&g_model.phaseData[i], &oldModel.phaseData[i], sizeof(oldModel.phaseData[i])); // the last 4 gvars will remain blank
|
||||||
|
|
|
@ -4543,10 +4543,11 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
// CSW params
|
// CSW params
|
||||||
uint8_t cstate = cswFamily(cs->func);
|
uint8_t cstate = cswFamily(cs->func);
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
int16_t v1_min=0, v1_max=MIXSRC_LAST_TELEM, v2_min=0, v2_max=MIXSRC_LAST_TELEM;
|
int16_t v1_unsigned=(uint8_t)cs->v1, v1_min=0, v1_max=MIXSRC_LAST_TELEM, v2_min=0, v2_max=MIXSRC_LAST_TELEM;
|
||||||
int16_t v3_min=0, v3_max=100;
|
int16_t v3_min=0, v3_max=100;
|
||||||
#else
|
#else
|
||||||
int8_t v1_min=0, v1_max=MIXSRC_LAST_TELEM, v2_min=0, v2_max=MIXSRC_LAST_TELEM;
|
int8_t v1_min=0, v1_max=MIXSRC_LAST_TELEM, v2_min=0, v2_max=MIXSRC_LAST_TELEM;
|
||||||
|
uint8_t v1_unsigned = cs->v1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
|
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
|
||||||
|
@ -4582,7 +4583,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (cstate == LS_FAMILY_COMP) {
|
else if (cstate == LS_FAMILY_COMP) {
|
||||||
putsMixerSource(CSW_2ND_COLUMN, y, cs->v1, attr1);
|
putsMixerSource(CSW_2ND_COLUMN, y, v1_unsigned, attr1);
|
||||||
putsMixerSource(CSW_3RD_COLUMN, y, cs->v2, attr2);
|
putsMixerSource(CSW_3RD_COLUMN, y, cs->v2, attr2);
|
||||||
INCDEC_SET_FLAG(INCDEC_SOURCE);
|
INCDEC_SET_FLAG(INCDEC_SOURCE);
|
||||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||||
|
@ -4596,7 +4597,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
INCDEC_ENABLE_CHECK(NULL);
|
INCDEC_ENABLE_CHECK(NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
putsMixerSource(CSW_2ND_COLUMN, y, cs->v1, attr1);
|
putsMixerSource(CSW_2ND_COLUMN, y, v1_unsigned, attr1);
|
||||||
if (horz == 1) {
|
if (horz == 1) {
|
||||||
INCDEC_SET_FLAG(INCDEC_SOURCE);
|
INCDEC_SET_FLAG(INCDEC_SOURCE);
|
||||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||||
|
@ -4606,11 +4607,11 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
INCDEC_ENABLE_CHECK(NULL);
|
INCDEC_ENABLE_CHECK(NULL);
|
||||||
}
|
}
|
||||||
#if defined(FRSKY)
|
#if defined(FRSKY)
|
||||||
if (cs->v1 >= MIXSRC_FIRST_TELEM) {
|
if (v1_unsigned >= MIXSRC_FIRST_TELEM) {
|
||||||
putsTelemetryChannel(CSW_3RD_COLUMN, y, cs->v1 - MIXSRC_FIRST_TELEM, convertCswTelemValue(cs), LEFT|attr2);
|
putsTelemetryChannel(CSW_3RD_COLUMN, y, v1_unsigned - MIXSRC_FIRST_TELEM, convertCswTelemValue(cs), LEFT|attr2);
|
||||||
v2_max = maxTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1);
|
v2_max = maxTelemValue(v1_unsigned - MIXSRC_FIRST_TELEM + 1);
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
v2_min = minTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1);
|
v2_min = minTelemValue(v1_unsigned - MIXSRC_FIRST_TELEM + 1);
|
||||||
if (cs->v2 < v2_min || cs->v2 > v2_max) {
|
if (cs->v2 < v2_min || cs->v2 > v2_max) {
|
||||||
cs->v2 = 0;
|
cs->v2 = 0;
|
||||||
eeDirty(EE_MODEL);
|
eeDirty(EE_MODEL);
|
||||||
|
@ -4635,8 +4636,8 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
v2_min = -125; v2_max = 125;
|
v2_min = -125; v2_max = 125;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (cs->v1 >= MIXSRC_FIRST_TELEM) {
|
if (v1_unsigned >= MIXSRC_FIRST_TELEM) {
|
||||||
putsTelemetryChannel(CSW_3RD_COLUMN, y, cs->v1 - MIXSRC_FIRST_TELEM, convertCswTelemValue(cs), LEFT|attr2);
|
putsTelemetryChannel(CSW_3RD_COLUMN, y, v1_unsigned - MIXSRC_FIRST_TELEM, convertCswTelemValue(cs), LEFT|attr2);
|
||||||
v2_min = -128; v2_max = 127;
|
v2_min = -128; v2_max = 127;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -4711,17 +4712,17 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LS_FIELD_V1:
|
case LS_FIELD_V1:
|
||||||
cs->v1 = CHECK_INCDEC_PARAM(event, cs->v1, v1_min, v1_max);
|
cs->v1 = CHECK_INCDEC_PARAM(event, v1_unsigned, v1_min, v1_max);
|
||||||
break;
|
break;
|
||||||
case LS_FIELD_V2:
|
case LS_FIELD_V2:
|
||||||
cs->v2 = CHECK_INCDEC_PARAM(event, cs->v2, v2_min, v2_max);
|
cs->v2 = CHECK_INCDEC_PARAM(event, cs->v2, v2_min, v2_max);
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
if (cstate==LS_FAMILY_OFS && cs->v1!=0 && event==EVT_KEY_LONG(KEY_ENTER)) {
|
if (cstate==LS_FAMILY_OFS && v1_unsigned!=0 && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
getvalue_t x = getValue(cs->v1);
|
getvalue_t x = getValue(v1_unsigned);
|
||||||
if (cs->v1 < MIXSRC_GVAR1)
|
if (v1_unsigned < MIXSRC_GVAR1)
|
||||||
cs->v2 = calcRESXto100(x);
|
cs->v2 = calcRESXto100(x);
|
||||||
else if (cs->v1 - MIXSRC_FIRST_TELEM + 1 == TELEM_ALT)
|
else if (v1_unsigned - MIXSRC_FIRST_TELEM + 1 == TELEM_ALT)
|
||||||
cs->v2 *= 100;
|
cs->v2 *= 100;
|
||||||
eeDirty(EE_MODEL);
|
eeDirty(EE_MODEL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,14 +164,10 @@ void varioWakeup()
|
||||||
|
|
||||||
if (verticalSpeed < 0 || (int16_t)(s_varioTmr-tmr10ms) < 0) {
|
if (verticalSpeed < 0 || (int16_t)(s_varioTmr-tmr10ms) < 0) {
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
uint16_t SoundVarioBeepTime;
|
int SoundVarioBeepTime;
|
||||||
uint16_t SoundVarioBeepFreq;
|
int SoundVarioBeepFreq;
|
||||||
if (verticalSpeed > 0) {
|
if (verticalSpeed > 0) {
|
||||||
if (verticalSpeed > 1276) {
|
SoundVarioBeepTime = min(5, 320 - (verticalSpeed >> 2));
|
||||||
SoundVarioBeepTime=5;
|
|
||||||
} else {
|
|
||||||
SoundVarioBeepTime = 320 - (verticalSpeed >> 2);
|
|
||||||
}
|
|
||||||
SoundVarioBeepFreq = 1000 + verticalSpeed;
|
SoundVarioBeepFreq = 1000 + verticalSpeed;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -1404,11 +1404,14 @@ enum MixSources {
|
||||||
#define MIN_POINTS 3
|
#define MIN_POINTS 3
|
||||||
#define MAX_POINTS 17
|
#define MAX_POINTS 17
|
||||||
|
|
||||||
#define TMRMODE_NONE 0
|
enum TimerModes {
|
||||||
#define TMRMODE_ABS 1
|
TMRMODE_NONE,
|
||||||
#define TMRMODE_THR 2
|
TMRMODE_ABS,
|
||||||
#define TMRMODE_THR_REL 3
|
TMRMODE_THR,
|
||||||
#define TMRMODE_THR_TRG 4
|
TMRMODE_THR_REL,
|
||||||
|
TMRMODE_THR_TRG,
|
||||||
|
TMRMODE_FIRST_SWITCH
|
||||||
|
};
|
||||||
|
|
||||||
#define COUNTDOWN_SILENT 0
|
#define COUNTDOWN_SILENT 0
|
||||||
#define COUNTDOWN_BEEPS 1
|
#define COUNTDOWN_BEEPS 1
|
||||||
|
@ -1504,7 +1507,7 @@ enum FailsafeModes {
|
||||||
#define BeepANACenter uint8_t
|
#define BeepANACenter uint8_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PACK(typedef struct t_ModelHeader {
|
PACK(typedef struct {
|
||||||
char name[LEN_MODEL_NAME]; // must be first for eeLoadModelName
|
char name[LEN_MODEL_NAME]; // must be first for eeLoadModelName
|
||||||
uint8_t modelId;
|
uint8_t modelId;
|
||||||
MODELDATA_BITMAP
|
MODELDATA_BITMAP
|
||||||
|
|
|
@ -201,7 +201,7 @@ char idx2char(int8_t idx)
|
||||||
return ' ';
|
return ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(CPUARM)
|
||||||
int8_t char2idx(char c)
|
int8_t char2idx(char c)
|
||||||
{
|
{
|
||||||
if (c == '_') return 37;
|
if (c == '_') return 37;
|
||||||
|
@ -1248,6 +1248,7 @@ getvalue_t getValue(uint8_t i)
|
||||||
else if (i==MIXSRC_SF) return (switchState(SW_SF0) ? -1024 : 1024);
|
else if (i==MIXSRC_SF) return (switchState(SW_SF0) ? -1024 : 1024);
|
||||||
else if (i==MIXSRC_SG) return (switchState(SW_SG0) ? -1024 : (switchState(SW_SG1) ? 0 : 1024));
|
else if (i==MIXSRC_SG) return (switchState(SW_SG0) ? -1024 : (switchState(SW_SG1) ? 0 : 1024));
|
||||||
else if (i==MIXSRC_SH) return (switchState(SW_SH0) ? -1024 : 1024);
|
else if (i==MIXSRC_SH) return (switchState(SW_SH0) ? -1024 : 1024);
|
||||||
|
else if (i<=MIXSRC_LAST_CSW) return getSwitch(SWSRC_FIRST_CSW+i-MIXSRC_FIRST_CSW) ? 1024 : -1024;
|
||||||
#else
|
#else
|
||||||
else if (i==MIXSRC_3POS) return (getSwitch(SW_ID0-SW_BASE+1) ? -1024 : (getSwitch(SW_ID1-SW_BASE+1) ? 0 : 1024));
|
else if (i==MIXSRC_3POS) return (getSwitch(SW_ID0-SW_BASE+1) ? -1024 : (getSwitch(SW_ID1-SW_BASE+1) ? 0 : 1024));
|
||||||
// don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning
|
// don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning
|
||||||
|
@ -1255,10 +1256,9 @@ getvalue_t getValue(uint8_t i)
|
||||||
else if (i==MIXSRC_3POS2) return (getSwitch(SW_ID3-SW_BASE+1) ? -1024 : (getSwitch(SW_ID4-SW_BASE+1) ? 0 : 1024));
|
else if (i==MIXSRC_3POS2) return (getSwitch(SW_ID3-SW_BASE+1) ? -1024 : (getSwitch(SW_ID4-SW_BASE+1) ? 0 : 1024));
|
||||||
// don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning
|
// don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning
|
||||||
#endif
|
#endif
|
||||||
|
else if (i<=MIXSRC_LAST_CSW) return getSwitch(SWSRC_THR+i-MIXSRC_THR) ? 1024 : -1024;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
else if (i<=MIXSRC_LAST_CSW) return getSwitch(SWSRC_FIRST_CSW+i-MIXSRC_FIRST_CSW) ? 1024 : -1024;
|
|
||||||
|
|
||||||
else if (i<=MIXSRC_LAST_PPM) { int16_t x = g_ppmIns[i-MIXSRC_FIRST_PPM]; if (i<MIXSRC_FIRST_PPM+NUM_CAL_PPM) { x-= g_eeGeneral.trainer.calib[i-MIXSRC_FIRST_PPM]; } return x*2; }
|
else if (i<=MIXSRC_LAST_PPM) { int16_t x = g_ppmIns[i-MIXSRC_FIRST_PPM]; if (i<MIXSRC_FIRST_PPM+NUM_CAL_PPM) { x-= g_eeGeneral.trainer.calib[i-MIXSRC_FIRST_PPM]; } return x*2; }
|
||||||
else if (i<=MIXSRC_LAST_CH) return ex_chans[i-MIXSRC_CH1];
|
else if (i<=MIXSRC_LAST_CH) return ex_chans[i-MIXSRC_CH1];
|
||||||
|
|
||||||
|
|
|
@ -749,7 +749,7 @@ extern uint8_t pxxFlag[NUM_MODULES];
|
||||||
#define ZCHAR_MAX (LEN_STD_CHARS + LEN_SPECIAL_CHARS)
|
#define ZCHAR_MAX (LEN_STD_CHARS + LEN_SPECIAL_CHARS)
|
||||||
|
|
||||||
char idx2char(int8_t idx);
|
char idx2char(int8_t idx);
|
||||||
#if defined(PCBTARANIS)
|
#if defined(CPUARM)
|
||||||
int8_t char2idx(char c);
|
int8_t char2idx(char c);
|
||||||
void str2zchar(char *dest, const char *src, int size);
|
void str2zchar(char *dest, const char *src, int size);
|
||||||
void zchar2str(char *dest, const char *src, int size);
|
void zchar2str(char *dest, const char *src, int size);
|
||||||
|
|