@@ -193,6 +193,8 @@ QString SensorData::unitString() const
|
|||||||
return QObject::tr("mAh");
|
return QObject::tr("mAh");
|
||||||
case UNIT_WATTS:
|
case UNIT_WATTS:
|
||||||
return QObject::tr("W");
|
return QObject::tr("W");
|
||||||
|
case UNIT_MILLIWATTS:
|
||||||
|
return QObject::tr("mW");
|
||||||
case UNIT_DB:
|
case UNIT_DB:
|
||||||
return QObject::tr("dB");
|
return QObject::tr("dB");
|
||||||
case UNIT_RPMS:
|
case UNIT_RPMS:
|
||||||
@@ -201,6 +203,8 @@ QString SensorData::unitString() const
|
|||||||
return QObject::tr("g");
|
return QObject::tr("g");
|
||||||
case UNIT_DEGREE:
|
case UNIT_DEGREE:
|
||||||
return QObject::trUtf8("°");
|
return QObject::trUtf8("°");
|
||||||
|
case UNIT_RADIANS:
|
||||||
|
return QObject::trUtf8("Rad");
|
||||||
case UNIT_HOURS:
|
case UNIT_HOURS:
|
||||||
return QObject::tr("hours");
|
return QObject::tr("hours");
|
||||||
case UNIT_MINUTES:
|
case UNIT_MINUTES:
|
||||||
@@ -1061,11 +1065,11 @@ GeneralSettings::GeneralSettings()
|
|||||||
calibSpanNeg[i] = 0x180;
|
calibSpanNeg[i] = 0x180;
|
||||||
calibSpanPos[i] = 0x180;
|
calibSpanPos[i] = 0x180;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<GetCurrentFirmware()->getCapability(Switches); i++) {
|
for (int i=0; i<GetCurrentFirmware()->getCapability(Switches); i++) {
|
||||||
switchConfig[i] = GetCurrentFirmware()->getSwitch(i).type;
|
switchConfig[i] = GetCurrentFirmware()->getSwitch(i).type;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoardEnum board = GetEepromInterface()->getBoard();
|
BoardEnum board = GetEepromInterface()->getBoard();
|
||||||
if (board == BOARD_HORUS) {
|
if (board == BOARD_HORUS) {
|
||||||
potConfig[0] = POT_WITH_DETENT;
|
potConfig[0] = POT_WITH_DETENT;
|
||||||
@@ -1194,7 +1198,7 @@ GeneralSettings::GeneralSettings()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(themeName, "default");
|
strcpy(themeName, "default");
|
||||||
ThemeOptionData option1 = { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0 };
|
ThemeOptionData option1 = { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0 };
|
||||||
memcpy(&themeOptionValue[0], option1, sizeof(ThemeOptionData));
|
memcpy(&themeOptionValue[0], option1, sizeof(ThemeOptionData));
|
||||||
@@ -1719,7 +1723,7 @@ QString getBoardName(BoardEnum board)
|
|||||||
case BOARD_TARANIS_X9DP:
|
case BOARD_TARANIS_X9DP:
|
||||||
return "Taranis X9D+";
|
return "Taranis X9D+";
|
||||||
case BOARD_TARANIS_X9E:
|
case BOARD_TARANIS_X9E:
|
||||||
return "Taranis X9E";
|
return "Taranis X9E";
|
||||||
case BOARD_SKY9X:
|
case BOARD_SKY9X:
|
||||||
return "Sky9x";
|
return "Sky9x";
|
||||||
case BOARD_9XRPRO:
|
case BOARD_9XRPRO:
|
||||||
@@ -1727,7 +1731,7 @@ QString getBoardName(BoardEnum board)
|
|||||||
case BOARD_AR9X:
|
case BOARD_AR9X:
|
||||||
return "AR9X";
|
return "AR9X";
|
||||||
case BOARD_HORUS:
|
case BOARD_HORUS:
|
||||||
return "Horus";
|
return "Horus";
|
||||||
default:
|
default:
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -971,10 +971,12 @@ class SensorData {
|
|||||||
UNIT_PERCENT,
|
UNIT_PERCENT,
|
||||||
UNIT_MAH,
|
UNIT_MAH,
|
||||||
UNIT_WATTS,
|
UNIT_WATTS,
|
||||||
|
UNIT_MILLIWATTS,
|
||||||
UNIT_DB,
|
UNIT_DB,
|
||||||
UNIT_RPMS,
|
UNIT_RPMS,
|
||||||
UNIT_G,
|
UNIT_G,
|
||||||
UNIT_DEGREE,
|
UNIT_DEGREE,
|
||||||
|
UNIT_RADIANS,
|
||||||
UNIT_MILLILITERS,
|
UNIT_MILLILITERS,
|
||||||
UNIT_FLOZ,
|
UNIT_FLOZ,
|
||||||
UNIT_HOURS,
|
UNIT_HOURS,
|
||||||
@@ -1041,7 +1043,7 @@ class SensorData {
|
|||||||
#if 0
|
#if 0
|
||||||
class CustomScreenOptionData {
|
class CustomScreenOptionData {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CustomScreenZoneData {
|
class CustomScreenZoneData {
|
||||||
@@ -1053,7 +1055,7 @@ class CustomScreenZoneData {
|
|||||||
class CustomScreenData {
|
class CustomScreenData {
|
||||||
public:
|
public:
|
||||||
CustomScreenData();
|
CustomScreenData();
|
||||||
|
|
||||||
char layoutName[10+1];
|
char layoutName[10+1];
|
||||||
CustomScreenZoneData zones[];
|
CustomScreenZoneData zones[];
|
||||||
CustomScreenOptionData options[];
|
CustomScreenOptionData options[];
|
||||||
@@ -1131,11 +1133,11 @@ class ModelData {
|
|||||||
SensorData sensorData[CPN_MAX_SENSORS];
|
SensorData sensorData[CPN_MAX_SENSORS];
|
||||||
|
|
||||||
unsigned int toplcdTimer;
|
unsigned int toplcdTimer;
|
||||||
|
|
||||||
CustomScreenData customScreenData[5];
|
CustomScreenData customScreenData[5];
|
||||||
|
|
||||||
TopbarData topbarData;
|
TopbarData topbarData;
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
void setDefaultInputs(const GeneralSettings & settings);
|
void setDefaultInputs(const GeneralSettings & settings);
|
||||||
@@ -1303,7 +1305,7 @@ class GeneralSettings {
|
|||||||
char themeName[8+1];
|
char themeName[8+1];
|
||||||
typedef uint8_t ThemeOptionData[8+1];
|
typedef uint8_t ThemeOptionData[8+1];
|
||||||
ThemeOptionData themeOptionValue[5];
|
ThemeOptionData themeOptionValue[5];
|
||||||
|
|
||||||
struct SwitchInfo {
|
struct SwitchInfo {
|
||||||
SwitchInfo(unsigned int index, unsigned int position):
|
SwitchInfo(unsigned int index, unsigned int position):
|
||||||
index(index),
|
index(index),
|
||||||
@@ -1325,13 +1327,13 @@ class RadioData {
|
|||||||
public:
|
public:
|
||||||
GeneralSettings generalSettings;
|
GeneralSettings generalSettings;
|
||||||
ModelData models[CPN_MAX_MODELS];
|
ModelData models[CPN_MAX_MODELS];
|
||||||
|
|
||||||
void setCurrentModel(unsigned int index)
|
void setCurrentModel(unsigned int index)
|
||||||
{
|
{
|
||||||
generalSettings.currModelIndex = index;
|
generalSettings.currModelIndex = index;
|
||||||
strcpy(generalSettings.currModelFilename, models[index].filename);
|
strcpy(generalSettings.currModelFilename, models[index].filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getNextModelFilename()
|
QString getNextModelFilename()
|
||||||
{
|
{
|
||||||
char filename[sizeof(ModelData::filename)];
|
char filename[sizeof(ModelData::filename)];
|
||||||
@@ -1479,7 +1481,7 @@ class EEPROMInterface
|
|||||||
virtual unsigned long load(RadioData &radioData, const uint8_t * eeprom, int size) = 0;
|
virtual unsigned long load(RadioData &radioData, const uint8_t * eeprom, int size) = 0;
|
||||||
|
|
||||||
virtual unsigned long loadBackup(RadioData & radioData, const uint8_t * eeprom, int esize, int index) = 0;
|
virtual unsigned long loadBackup(RadioData & radioData, const uint8_t * eeprom, int esize, int index) = 0;
|
||||||
|
|
||||||
virtual unsigned long loadxml(RadioData & radioData, QDomDocument &doc) = 0;
|
virtual unsigned long loadxml(RadioData & radioData, QDomDocument &doc) = 0;
|
||||||
|
|
||||||
virtual int save(uint8_t * eeprom, RadioData & radioData, uint8_t version=0, uint32_t variant=0) = 0;
|
virtual int save(uint8_t * eeprom, RadioData & radioData, uint8_t version=0, uint32_t variant=0) = 0;
|
||||||
@@ -1491,11 +1493,11 @@ class EEPROMInterface
|
|||||||
virtual const int getEEpromSize() = 0;
|
virtual const int getEEpromSize() = 0;
|
||||||
|
|
||||||
virtual const int getMaxModels() = 0;
|
virtual const int getMaxModels() = 0;
|
||||||
|
|
||||||
virtual int loadFile(RadioData & radioData, const QString & filename) = 0;
|
virtual int loadFile(RadioData & radioData, const QString & filename) = 0;
|
||||||
|
|
||||||
virtual int saveFile(const RadioData & radioData, const QString & filename) = 0;
|
virtual int saveFile(const RadioData & radioData, const QString & filename) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
BoardEnum board;
|
BoardEnum board;
|
||||||
@@ -1638,7 +1640,7 @@ struct Option {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Firmware {
|
class Firmware {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Firmware(const QString & id, const QString & name, const BoardEnum board, EEPROMInterface * eepromInterface):
|
Firmware(const QString & id, const QString & name, const BoardEnum board, EEPROMInterface * eepromInterface):
|
||||||
id(id),
|
id(id),
|
||||||
@@ -1720,29 +1722,29 @@ class Firmware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual int getCapability(Capability) = 0;
|
virtual int getCapability(Capability) = 0;
|
||||||
|
|
||||||
enum SwitchType {
|
enum SwitchType {
|
||||||
SWITCH_NONE,
|
SWITCH_NONE,
|
||||||
SWITCH_TOGGLE,
|
SWITCH_TOGGLE,
|
||||||
SWITCH_2POS,
|
SWITCH_2POS,
|
||||||
SWITCH_3POS
|
SWITCH_3POS
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Switch {
|
struct Switch {
|
||||||
SwitchType type;
|
SwitchType type;
|
||||||
const char * name;
|
const char * name;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual Switch getSwitch(unsigned int index) = 0;
|
virtual Switch getSwitch(unsigned int index) = 0;
|
||||||
|
|
||||||
virtual QString getAnalogInputName(unsigned int index) = 0;
|
virtual QString getAnalogInputName(unsigned int index) = 0;
|
||||||
|
|
||||||
virtual QTime getMaxTimerStart() = 0;
|
virtual QTime getMaxTimerStart() = 0;
|
||||||
|
|
||||||
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
||||||
|
|
||||||
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
|
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
|
||||||
|
|
||||||
const int getFlashSize();
|
const int getFlashSize();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -2935,6 +2935,7 @@ class SensorField: public TransformedField {
|
|||||||
TransformedField(internalField),
|
TransformedField(internalField),
|
||||||
internalField("Sensor"),
|
internalField("Sensor"),
|
||||||
sensor(sensor),
|
sensor(sensor),
|
||||||
|
version(version),
|
||||||
_param(0)
|
_param(0)
|
||||||
{
|
{
|
||||||
internalField.Append(new UnsignedField<16>(_id, "id/persistentValue"));
|
internalField.Append(new UnsignedField<16>(_id, "id/persistentValue"));
|
||||||
@@ -2997,12 +2998,21 @@ class SensorField: public TransformedField {
|
|||||||
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION || sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE)
|
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION || sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE)
|
||||||
sensor.amps = _sources[0];
|
sensor.amps = _sources[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version < 218) {
|
||||||
|
if (sensor.unit > SensorData::UNIT_WATTS)
|
||||||
|
sensor.unit++;
|
||||||
|
if (sensor.unit > SensorData::UNIT_DEGREE)
|
||||||
|
sensor.unit++;
|
||||||
|
}
|
||||||
|
|
||||||
eepromImportDebug() << QString("imported %1").arg(internalField.getName());
|
eepromImportDebug() << QString("imported %1").arg(internalField.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
StructField internalField;
|
StructField internalField;
|
||||||
SensorData & sensor;
|
SensorData & sensor;
|
||||||
|
unsigned int version;
|
||||||
unsigned int _id;
|
unsigned int _id;
|
||||||
unsigned int _subid;
|
unsigned int _subid;
|
||||||
unsigned int _instance;
|
unsigned int _instance;
|
||||||
|
|||||||
@@ -439,6 +439,11 @@
|
|||||||
<string>W</string>
|
<string>W</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>mW</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>dBm</string>
|
<string>dBm</string>
|
||||||
@@ -459,6 +464,11 @@
|
|||||||
<string>°</string>
|
<string>°</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Rad</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>mL</string>
|
<string>mL</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user