Merge pull request #2225 from opentx/griebd/companion_batt_meter_range_on_next_2195
Add Battery Meter Range on Companion
This commit is contained in:
+22
-12
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author - Kjell Kernen
|
* Author - Kjell Kernen
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
@@ -314,6 +314,8 @@ int Profile::gsStickMode() const { return _gsStickMode; }
|
|||||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||||
int Profile::vBatCalib() const { return _vBatCalib; }
|
int Profile::vBatCalib() const { return _vBatCalib; }
|
||||||
int Profile::vBatWarn() const { return _vBatWarn; }
|
int Profile::vBatWarn() const { return _vBatWarn; }
|
||||||
|
int Profile::vBatMin() const { return _vBatMin; }
|
||||||
|
int Profile::vBatMax() const { return _vBatMax; }
|
||||||
|
|
||||||
// Set declarations
|
// Set declarations
|
||||||
void Profile::name (const QString x) { store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::name (const QString x) { store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
@@ -339,6 +341,8 @@ void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStic
|
|||||||
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
|
void Profile::vBatMin (const int x) { store(x, _vBatMin, "VbatMin" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
|
void Profile::vBatMax (const int x) { store(x, _vBatMax, "VbatMax" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Profile::Profile()
|
Profile::Profile()
|
||||||
@@ -346,7 +350,7 @@ Profile::Profile()
|
|||||||
index = -1;
|
index = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The default copy operator can not be used since the index variable would be destroyed
|
// The default copy operator can not be used since the index variable would be destroyed
|
||||||
Profile& Profile::operator=(const Profile& rhs)
|
Profile& Profile::operator=(const Profile& rhs)
|
||||||
{
|
{
|
||||||
name ( rhs.name() );
|
name ( rhs.name() );
|
||||||
@@ -370,6 +374,8 @@ Profile& Profile::operator=(const Profile& rhs)
|
|||||||
ppmMultiplier( rhs.ppmMultiplier() );
|
ppmMultiplier( rhs.ppmMultiplier() );
|
||||||
vBatCalib ( rhs.vBatCalib() );
|
vBatCalib ( rhs.vBatCalib() );
|
||||||
vBatWarn ( rhs.vBatWarn() );
|
vBatWarn ( rhs.vBatWarn() );
|
||||||
|
vBatMin ( rhs.vBatMin() );
|
||||||
|
vBatMax ( rhs.vBatMax() );
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -414,6 +420,8 @@ void Profile::initFwVariables()
|
|||||||
_ppmMultiplier = 0;
|
_ppmMultiplier = 0;
|
||||||
_vBatCalib = 0;
|
_vBatCalib = 0;
|
||||||
_vBatWarn = 0;
|
_vBatWarn = 0;
|
||||||
|
_vBatMin = 0;
|
||||||
|
_vBatMax = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::init(int newIndex)
|
void Profile::init(int newIndex)
|
||||||
@@ -465,6 +473,8 @@ void Profile::flush()
|
|||||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
|
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
|
getset( _vBatMin, "VbatMin" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
|
getset( _vBatMax, "VbatMax" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -577,39 +587,39 @@ AppData::AppData()
|
|||||||
for (int i=0; i<MAX_JOYSTICKS; i++)
|
for (int i=0; i<MAX_JOYSTICKS; i++)
|
||||||
joystick[i].init( i );
|
joystick[i].init( i );
|
||||||
|
|
||||||
// Copy existing 2.0.16 settings if present
|
// Copy existing 2.0.16 settings if present
|
||||||
QSettings settings(COMPANY, PRODUCT);
|
QSettings settings(COMPANY, PRODUCT);
|
||||||
if (profile[0].name().isEmpty())
|
if (profile[0].name().isEmpty())
|
||||||
{
|
{
|
||||||
QSettings settings20("OpenTX", "Companion 2.0");
|
QSettings settings20("OpenTX", "Companion 2.0");
|
||||||
|
|
||||||
QStringList keys = settings20.allKeys();
|
QStringList keys = settings20.allKeys();
|
||||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||||
{
|
{
|
||||||
settings.setValue(*i, settings20.value(*i));
|
settings.setValue(*i, settings20.value(*i));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Reload profiles
|
//Reload profiles
|
||||||
for (int i=0; i<MAX_PROFILES; i++)
|
for (int i=0; i<MAX_PROFILES; i++)
|
||||||
profile[i].init( i );
|
profile[i].init( i );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Else copy existing <2.0.16 settings if present
|
// Else copy existing <2.0.16 settings if present
|
||||||
if (profile[0].name().isEmpty())
|
if (profile[0].name().isEmpty())
|
||||||
{
|
{
|
||||||
QSettings pre2016settings("OpenTX", "OpenTX Companion");
|
QSettings pre2016settings("OpenTX", "OpenTX Companion");
|
||||||
|
|
||||||
QStringList keys = pre2016settings.allKeys();
|
QStringList keys = pre2016settings.allKeys();
|
||||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||||
{
|
{
|
||||||
settings.setValue(*i, pre2016settings.value(*i));
|
settings.setValue(*i, pre2016settings.value(*i));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Reload profiles
|
//Reload profiles
|
||||||
for (int i=0; i<MAX_PROFILES; i++)
|
for (int i=0; i<MAX_PROFILES; i++)
|
||||||
profile[i].init( i );
|
profile[i].init( i );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Else import settings from companion9x if present
|
// Else import settings from companion9x if present
|
||||||
if (profile[0].name().isEmpty())
|
if (profile[0].name().isEmpty())
|
||||||
{
|
{
|
||||||
@@ -657,7 +667,7 @@ AppData::AppData()
|
|||||||
settings.remove("patchImage");
|
settings.remove("patchImage");
|
||||||
settings.remove("rename_firmware_files");
|
settings.remove("rename_firmware_files");
|
||||||
settings.remove("sdPath");
|
settings.remove("sdPath");
|
||||||
settings.remove("SplashFileName");
|
settings.remove("SplashFileName");
|
||||||
settings.remove("startup_check_companion9x");
|
settings.remove("startup_check_companion9x");
|
||||||
settings.remove("wizardEnable");
|
settings.remove("wizardEnable");
|
||||||
|
|
||||||
|
|||||||
+10
-4
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author - Kjell Kernen
|
* Author - Kjell Kernen
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// All temporary and permanent global variables are defined here to make
|
// All temporary and permanent global variables are defined here to make
|
||||||
// initialization and storage safe and visible.
|
// initialization and storage safe and visible.
|
||||||
// Do not access variables in QSettings directly, it is not type safe!
|
// Do not access variables in QSettings directly, it is not type safe!
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class CompStoreObj
|
|||||||
void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||||
void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
|
void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
|
||||||
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
||||||
};
|
};
|
||||||
|
|
||||||
class FwRevision: protected CompStoreObj
|
class FwRevision: protected CompStoreObj
|
||||||
{
|
{
|
||||||
@@ -127,6 +127,8 @@ class Profile: protected CompStoreObj
|
|||||||
int _ppmMultiplier;
|
int _ppmMultiplier;
|
||||||
int _vBatCalib;
|
int _vBatCalib;
|
||||||
int _vBatWarn;
|
int _vBatWarn;
|
||||||
|
int _vBatMin;
|
||||||
|
int _vBatMax;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// All the get definitions
|
// All the get definitions
|
||||||
@@ -153,6 +155,8 @@ class Profile: protected CompStoreObj
|
|||||||
int ppmMultiplier() const;
|
int ppmMultiplier() const;
|
||||||
int vBatCalib() const;
|
int vBatCalib() const;
|
||||||
int vBatWarn() const;
|
int vBatWarn() const;
|
||||||
|
int vBatMin() const;
|
||||||
|
int vBatMax() const;
|
||||||
|
|
||||||
// All the set definitions
|
// All the set definitions
|
||||||
void name (const QString);
|
void name (const QString);
|
||||||
@@ -178,6 +182,8 @@ class Profile: protected CompStoreObj
|
|||||||
void ppmMultiplier (const int);
|
void ppmMultiplier (const int);
|
||||||
void vBatCalib (const int);
|
void vBatCalib (const int);
|
||||||
void vBatWarn (const int);
|
void vBatWarn (const int);
|
||||||
|
void vBatMin (const int);
|
||||||
|
void vBatMax (const int);
|
||||||
|
|
||||||
Profile();
|
Profile();
|
||||||
Profile& operator=(const Profile&);
|
Profile& operator=(const Profile&);
|
||||||
@@ -269,7 +275,7 @@ class AppData: protected CompStoreObj
|
|||||||
QString avrdudeLocation();
|
QString avrdudeLocation();
|
||||||
QString dfuArguments();
|
QString dfuArguments();
|
||||||
QString dfuLocation();
|
QString dfuLocation();
|
||||||
QString lastFw();
|
QString lastFw();
|
||||||
QString locale();
|
QString locale();
|
||||||
QString mcu();
|
QString mcu();
|
||||||
QString programmer();
|
QString programmer();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||||
*
|
*
|
||||||
* Based on th9x -> http://code.google.com/p/th9x/
|
* Based on th9x -> http://code.google.com/p/th9x/
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -325,9 +325,9 @@ class RawSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString toString(const ModelData * model = NULL);
|
QString toString(const ModelData * model = NULL);
|
||||||
|
|
||||||
RawSourceRange getRange(const ModelData * model, const GeneralSettings & settings, unsigned int flags=0) const;
|
RawSourceRange getRange(const ModelData * model, const GeneralSettings & settings, unsigned int flags=0) const;
|
||||||
|
|
||||||
bool operator == ( const RawSource & other) {
|
bool operator == ( const RawSource & other) {
|
||||||
return (this->type == other.type) && (this->index == other.index);
|
return (this->type == other.type) && (this->index == other.index);
|
||||||
}
|
}
|
||||||
@@ -1171,16 +1171,16 @@ class GeneralSettings {
|
|||||||
unsigned int index;
|
unsigned int index;
|
||||||
unsigned int position;
|
unsigned int position;
|
||||||
};
|
};
|
||||||
|
|
||||||
static SwitchInfo switchInfoFromSwitchPositionTaranis(unsigned int index);
|
static SwitchInfo switchInfoFromSwitchPositionTaranis(unsigned int index);
|
||||||
bool switchPositionAllowedTaranis(int index) const;
|
bool switchPositionAllowedTaranis(int index) const;
|
||||||
bool switchSourceAllowedTaranis(int index) const;
|
bool switchSourceAllowedTaranis(int index) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RadioData {
|
class RadioData {
|
||||||
public:
|
public:
|
||||||
GeneralSettings generalSettings;
|
GeneralSettings generalSettings;
|
||||||
ModelData models[C9X_MAX_MODELS];
|
ModelData models[C9X_MAX_MODELS];
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Capability {
|
enum Capability {
|
||||||
@@ -1285,7 +1285,8 @@ enum Capability {
|
|||||||
MavlinkTelemetry,
|
MavlinkTelemetry,
|
||||||
HasInputDiff,
|
HasInputDiff,
|
||||||
HasMixerExpo,
|
HasMixerExpo,
|
||||||
MixersMonitor
|
MixersMonitor,
|
||||||
|
HasBatMeterRange
|
||||||
};
|
};
|
||||||
|
|
||||||
class SimulatorInterface;
|
class SimulatorInterface;
|
||||||
@@ -1305,15 +1306,15 @@ class EEPROMInterface
|
|||||||
virtual bool load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
|
virtual bool load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
|
||||||
|
|
||||||
virtual bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
|
virtual bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
|
||||||
|
|
||||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc) = 0;
|
virtual bool loadxml(RadioData &radioData, QDomDocument &doc) = 0;
|
||||||
|
|
||||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0) = 0;
|
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0) = 0;
|
||||||
|
|
||||||
virtual int getSize(ModelData &) = 0;
|
virtual int getSize(ModelData &) = 0;
|
||||||
|
|
||||||
virtual int getSize(GeneralSettings &) = 0;
|
virtual int getSize(GeneralSettings &) = 0;
|
||||||
|
|
||||||
virtual int isAvailable(Protocol proto, int port=0) = 0;
|
virtual int isAvailable(Protocol proto, int port=0) = 0;
|
||||||
|
|
||||||
virtual const int getEEpromSize() = 0;
|
virtual const int getEEpromSize() = 0;
|
||||||
|
|||||||
@@ -766,6 +766,8 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
|||||||
return (IS_TARANIS(board) ? true : false);
|
return (IS_TARANIS(board) ? true : false);
|
||||||
case MixersMonitor:
|
case MixersMonitor:
|
||||||
return id.contains("mixersmon") ? 1 : 0;
|
return id.contains("mixersmon") ? 1 : 0;
|
||||||
|
case HasBatMeterRange:
|
||||||
|
return (IS_TARANIS(board) ? true : false);
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
|||||||
QString HapticSet = g.profile[profile_id].haptic();
|
QString HapticSet = g.profile[profile_id].haptic();
|
||||||
QString SpeakerSet = g.profile[profile_id].speaker();
|
QString SpeakerSet = g.profile[profile_id].speaker();
|
||||||
QString CountrySet = g.profile[profile_id].countryCode();
|
QString CountrySet = g.profile[profile_id].countryCode();
|
||||||
|
|
||||||
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
||||||
QString Byte;
|
QString Byte;
|
||||||
int16_t byte16;
|
int16_t byte16;
|
||||||
@@ -121,6 +121,10 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
|||||||
generalSettings.currentCalib=currentCalib;
|
generalSettings.currentCalib=currentCalib;
|
||||||
generalSettings.vBatCalib=vBatCalib;
|
generalSettings.vBatCalib=vBatCalib;
|
||||||
generalSettings.vBatWarn=vBatWarn;
|
generalSettings.vBatWarn=vBatWarn;
|
||||||
|
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||||
|
generalSettings.vBatMin = (int8_t) g.profile[profile_id].vBatMin();
|
||||||
|
generalSettings.vBatMax = (int8_t) g.profile[profile_id].vBatMax();
|
||||||
|
}
|
||||||
generalSettings.PPM_Multiplier=PPM_Multiplier;
|
generalSettings.PPM_Multiplier=PPM_Multiplier;
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, radio calibration was not retrieved"));
|
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, radio calibration was not retrieved"));
|
||||||
@@ -197,7 +201,7 @@ void GeneralEdit::on_calstore_PB_clicked()
|
|||||||
else {
|
else {
|
||||||
QString calib=g.profile[profile_id].stickPotCalib();
|
QString calib=g.profile[profile_id].stickPotCalib();
|
||||||
if (!(calib.isEmpty())) {
|
if (!(calib.isEmpty())) {
|
||||||
int ret = QMessageBox::question(this, "Companion",
|
int ret = QMessageBox::question(this, "Companion",
|
||||||
tr("Do you want to store calibration in %1 profile<br>overwriting existing calibration?").arg(name) ,
|
tr("Do you want to store calibration in %1 profile<br>overwriting existing calibration?").arg(name) ,
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if (ret == QMessageBox::No) {
|
if (ret == QMessageBox::No) {
|
||||||
@@ -219,6 +223,10 @@ void GeneralEdit::on_calstore_PB_clicked()
|
|||||||
g.profile[profile_id].vBatCalib( generalSettings.vBatCalib );
|
g.profile[profile_id].vBatCalib( generalSettings.vBatCalib );
|
||||||
g.profile[profile_id].currentCalib( generalSettings.currentCalib );
|
g.profile[profile_id].currentCalib( generalSettings.currentCalib );
|
||||||
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
|
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
|
||||||
|
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||||
|
g.profile[profile_id].vBatMin( generalSettings.vBatMin );
|
||||||
|
g.profile[profile_id].vBatMax( generalSettings.vBatMax );
|
||||||
|
}
|
||||||
g.profile[profile_id].ppmMultiplier( generalSettings.PPM_Multiplier );
|
g.profile[profile_id].ppmMultiplier( generalSettings.PPM_Multiplier );
|
||||||
g.profile[profile_id].gsStickMode( generalSettings.stickMode );
|
g.profile[profile_id].gsStickMode( generalSettings.stickMode );
|
||||||
g.profile[profile_id].display( QString("%1%2%3").arg((generalSettings.optrexDisplay ? 1:0), 2, 16, QChar('0')).arg((uint8_t)generalSettings.contrast, 2, 16, QChar('0')).arg((uint8_t)generalSettings.backlightBright, 2, 16, QChar('0')) );
|
g.profile[profile_id].display( QString("%1%2%3").arg((generalSettings.optrexDisplay ? 1:0), 2, 16, QChar('0')).arg((uint8_t)generalSettings.contrast, 2, 16, QChar('0')).arg((uint8_t)generalSettings.backlightBright, 2, 16, QChar('0')) );
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
|
GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
|
||||||
GeneralPanel(parent, generalSettings, firmware),
|
GeneralPanel(parent, generalSettings, firmware),
|
||||||
ui(new Ui::GeneralSetup)
|
ui(new Ui::GeneralSetup)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
@@ -242,6 +242,14 @@ GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & general
|
|||||||
}
|
}
|
||||||
ui->blAlarm_ChkB->setChecked(generalSettings.flashBeep);
|
ui->blAlarm_ChkB->setChecked(generalSettings.flashBeep);
|
||||||
|
|
||||||
|
if (!GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||||
|
ui->batMeterRangeLabel->hide();
|
||||||
|
ui->HasBatMeterMinRangeLabel->hide();
|
||||||
|
ui->HasBatMeterMaxRangeLabel->hide();
|
||||||
|
ui->vBatMinDSB->hide();
|
||||||
|
ui->vBatMaxDSB->hide();
|
||||||
|
}
|
||||||
|
|
||||||
disableMouseScrolling();
|
disableMouseScrolling();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,14 +360,19 @@ void GeneralSetupPanel::setValues()
|
|||||||
ui->speakerPitchSB->setValue(generalSettings.speakerPitch);
|
ui->speakerPitchSB->setValue(generalSettings.speakerPitch);
|
||||||
ui->hapticStrength->setValue(generalSettings.hapticStrength);
|
ui->hapticStrength->setValue(generalSettings.hapticStrength);
|
||||||
ui->hapticmodeCB->setCurrentIndex(generalSettings.hapticMode+2);
|
ui->hapticmodeCB->setCurrentIndex(generalSettings.hapticMode+2);
|
||||||
|
|
||||||
|
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||||
|
ui->vBatMinDSB->setValue((double)(generalSettings.vBatMin + 90) / 10);
|
||||||
|
ui->vBatMaxDSB->setValue((double)(generalSettings.vBatMax + 120) / 10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSetupPanel::on_faimode_CB_stateChanged(int)
|
void GeneralSetupPanel::on_faimode_CB_stateChanged(int)
|
||||||
{
|
{
|
||||||
if (ui->faimode_CB->isChecked()) {
|
if (ui->faimode_CB->isChecked()) {
|
||||||
int ret = QMessageBox::question(this, "Companion",
|
int ret = QMessageBox::question(this, "Companion",
|
||||||
tr("If you enable FAI, you loose the vario, the play functions, the telemetry screen.\nThis function cannot be disabled by the radio.\nAre you sure ?") ,
|
tr("If you enable FAI, you loose the vario, the play functions, the telemetry screen.\nThis function cannot be disabled by the radio.\nAre you sure ?") ,
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if (ret==QMessageBox::Yes) {
|
if (ret==QMessageBox::Yes) {
|
||||||
generalSettings.fai = true;
|
generalSettings.fai = true;
|
||||||
}
|
}
|
||||||
@@ -375,58 +388,58 @@ void GeneralSetupPanel::on_faimode_CB_stateChanged(int)
|
|||||||
|
|
||||||
void GeneralSetupPanel::on_speakerPitchSB_editingFinished()
|
void GeneralSetupPanel::on_speakerPitchSB_editingFinished()
|
||||||
{
|
{
|
||||||
generalSettings.speakerPitch = ui->speakerPitchSB->value();
|
generalSettings.speakerPitch = ui->speakerPitchSB->value();
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSetupPanel::on_hapticStrength_valueChanged()
|
void GeneralSetupPanel::on_hapticStrength_valueChanged()
|
||||||
{
|
{
|
||||||
generalSettings.hapticStrength = ui->hapticStrength->value();
|
generalSettings.hapticStrength = ui->hapticStrength->value();
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSetupPanel::on_soundModeCB_currentIndexChanged(int index)
|
void GeneralSetupPanel::on_soundModeCB_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
generalSettings.speakerMode = index;
|
generalSettings.speakerMode = index;
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GeneralSetupPanel::on_splashScreenChkB_stateChanged(int )
|
void GeneralSetupPanel::on_splashScreenChkB_stateChanged(int )
|
||||||
{
|
{
|
||||||
generalSettings.splashMode = ui->splashScreenChkB->isChecked() ? 0 : 1;
|
generalSettings.splashMode = ui->splashScreenChkB->isChecked() ? 0 : 1;
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSetupPanel::on_splashScreenDuration_currentIndexChanged(int index)
|
void GeneralSetupPanel::on_splashScreenDuration_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
generalSettings.splashDuration = 3-index;
|
generalSettings.splashDuration = 3-index;
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GeneralSetupPanel::on_beepVolume_SL_valueChanged()
|
void GeneralSetupPanel::on_beepVolume_SL_valueChanged()
|
||||||
{
|
{
|
||||||
generalSettings.beepVolume=ui->beepVolume_SL->value();
|
generalSettings.beepVolume=ui->beepVolume_SL->value();
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSetupPanel::on_wavVolume_SL_valueChanged()
|
void GeneralSetupPanel::on_wavVolume_SL_valueChanged()
|
||||||
{
|
{
|
||||||
generalSettings.wavVolume=ui->wavVolume_SL->value();
|
generalSettings.wavVolume=ui->wavVolume_SL->value();
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSetupPanel::on_varioVolume_SL_valueChanged()
|
void GeneralSetupPanel::on_varioVolume_SL_valueChanged()
|
||||||
{
|
{
|
||||||
generalSettings.varioVolume=ui->varioVolume_SL->value();
|
generalSettings.varioVolume=ui->varioVolume_SL->value();
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSetupPanel::on_bgVolume_SL_valueChanged()
|
void GeneralSetupPanel::on_bgVolume_SL_valueChanged()
|
||||||
{
|
{
|
||||||
generalSettings.backgroundVolume=ui->bgVolume_SL->value();
|
generalSettings.backgroundVolume=ui->bgVolume_SL->value();
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSetupPanel::on_varioP0_SB_editingFinished()
|
void GeneralSetupPanel::on_varioP0_SB_editingFinished()
|
||||||
@@ -472,6 +485,18 @@ void GeneralSetupPanel::on_battwarningDSB_editingFinished()
|
|||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeneralSetupPanel::on_vBatMinDSB_editingFinished()
|
||||||
|
{
|
||||||
|
generalSettings.vBatMin = ui->vBatMinDSB->value() * 10 - 90;
|
||||||
|
emit modified();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GeneralSetupPanel::on_vBatMaxDSB_editingFinished()
|
||||||
|
{
|
||||||
|
generalSettings.vBatMax = ui->vBatMaxDSB->value() * 10 - 120;
|
||||||
|
emit modified();
|
||||||
|
}
|
||||||
|
|
||||||
void GeneralSetupPanel::on_re_CB_currentIndexChanged(int index)
|
void GeneralSetupPanel::on_re_CB_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
generalSettings.reNavigation = ui->re_CB->currentIndex();
|
generalSettings.reNavigation = ui->re_CB->currentIndex();
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class GeneralSetupPanel : public GeneralPanel
|
|||||||
void on_backlightautoSB_editingFinished();
|
void on_backlightautoSB_editingFinished();
|
||||||
|
|
||||||
void on_battwarningDSB_editingFinished();
|
void on_battwarningDSB_editingFinished();
|
||||||
|
void on_vBatMinDSB_editingFinished();
|
||||||
|
void on_vBatMaxDSB_editingFinished();
|
||||||
void on_contrastSB_editingFinished();
|
void on_contrastSB_editingFinished();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>758</width>
|
<width>758</width>
|
||||||
<height>635</height>
|
<height>661</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -230,6 +230,24 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="11" column="4">
|
||||||
|
<widget class="QComboBox" name="backlightswCB">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string>This is the switch selectrion for turning on the backlight (if installed).
|
||||||
|
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="16" column="4">
|
<item row="16" column="4">
|
||||||
<layout class="QHBoxLayout" name="backlightColor_Layout">
|
<layout class="QHBoxLayout" name="backlightColor_Layout">
|
||||||
<item>
|
<item>
|
||||||
@@ -324,20 +342,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="1">
|
|
||||||
<widget class="QComboBox" name="displayTypeCB">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Standard</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Optrex</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="29" column="0">
|
<item row="29" column="0">
|
||||||
<widget class="QLabel" name="ro_label">
|
<widget class="QLabel" name="ro_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -1242,16 +1246,6 @@ Acceptable values are 5v..10v</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
|
||||||
<widget class="QLabel" name="label_contrast">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string extracomment="Screen Contrast [20-45]"/>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Contrast</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="11" column="1">
|
<item row="11" column="1">
|
||||||
<widget class="QSpinBox" name="inactimerSB">
|
<widget class="QSpinBox" name="inactimerSB">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -1354,31 +1348,6 @@ Acceptable values are 5v..10v</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="4">
|
|
||||||
<widget class="QComboBox" name="backlightswCB">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="statusTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string>This is the switch selectrion for turning on the backlight (if installed).
|
|
||||||
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="10" column="0">
|
|
||||||
<widget class="QLabel" name="label_displayType">
|
|
||||||
<property name="text">
|
|
||||||
<string>LCD Display Type</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="17" column="0">
|
<item row="17" column="0">
|
||||||
<widget class="QLabel" name="mavbaud_label">
|
<widget class="QLabel" name="mavbaud_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -1386,34 +1355,6 @@ Acceptable values are 5v..10v</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="1">
|
|
||||||
<widget class="QSpinBox" name="contrastSB">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="statusTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>45</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>25</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="3">
|
<item row="2" column="3">
|
||||||
<widget class="QLabel" name="label_volume">
|
<widget class="QLabel" name="label_volume">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -1949,6 +1890,140 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="0">
|
||||||
|
<widget class="QLabel" name="label_displayType">
|
||||||
|
<property name="text">
|
||||||
|
<string>LCD Display Type</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="1">
|
||||||
|
<widget class="QComboBox" name="displayTypeCB">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Standard</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Optrex</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_contrast">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string extracomment="Screen Contrast [20-45]"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Contrast</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QSpinBox" name="contrastSB">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>45</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>25</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<widget class="QLabel" name="batMeterRangeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Battery Meter Range</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="batMeterRangeLayout" stretch="0,1,0,1">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="HasBatMeterMinRangeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Min</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="vBatMinDSB">
|
||||||
|
<property name="prefix">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string notr="true">v</string>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>4.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>16.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>9.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="HasBatMeterMaxRangeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Max</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="vBatMaxDSB">
|
||||||
|
<property name="prefix">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string notr="true">v</string>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>4.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>16.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>12.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|||||||
Reference in New Issue
Block a user