Cleaning work in Companion
This commit is contained in:
@@ -495,7 +495,6 @@ class GeneralSettings {
|
|||||||
bool disableBG;
|
bool disableBG;
|
||||||
unsigned int splashMode;
|
unsigned int splashMode;
|
||||||
int splashDuration;
|
int splashDuration;
|
||||||
uint8_t filterInput; // TODO enum
|
|
||||||
unsigned int backlightDelay;
|
unsigned int backlightDelay;
|
||||||
bool blightinv;
|
bool blightinv;
|
||||||
bool stickScroll;
|
bool stickScroll;
|
||||||
@@ -798,15 +797,6 @@ class FrSkyAlarmData {
|
|||||||
void clear() { memset(this, 0, sizeof(FrSkyAlarmData)); }
|
void clear() { memset(this, 0, sizeof(FrSkyAlarmData)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class FrSkyErAlarmData {
|
|
||||||
public:
|
|
||||||
FrSkyErAlarmData() { clear(); }
|
|
||||||
uint8_t frskyAlarmType ;
|
|
||||||
uint8_t frskyAlarmLimit ;
|
|
||||||
uint8_t frskyAlarmSound ;
|
|
||||||
void clear() { memset(this, 0, sizeof(FrSkyErAlarmData)); }
|
|
||||||
};
|
|
||||||
|
|
||||||
class FrSkyRSSIAlarm {
|
class FrSkyRSSIAlarm {
|
||||||
public:
|
public:
|
||||||
FrSkyRSSIAlarm() { clear(0, 50); }
|
FrSkyRSSIAlarm() { clear(0, 50); }
|
||||||
@@ -990,7 +980,6 @@ class ModelData {
|
|||||||
|
|
||||||
bool used;
|
bool used;
|
||||||
char name[12+1];
|
char name[12+1];
|
||||||
uint8_t modelVoice;
|
|
||||||
TimerData timers[2];
|
TimerData timers[2];
|
||||||
bool thrTrim; // Enable Throttle Trim
|
bool thrTrim; // Enable Throttle Trim
|
||||||
bool thrExpo; // Enable Throttle Expo
|
bool thrExpo; // Enable Throttle Expo
|
||||||
@@ -1013,8 +1002,7 @@ class ModelData {
|
|||||||
LogicalSwitchData customSw[C9X_NUM_CSW];
|
LogicalSwitchData customSw[C9X_NUM_CSW];
|
||||||
FuncSwData funcSw[C9X_MAX_CUSTOM_FUNCTIONS];
|
FuncSwData funcSw[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||||
SwashRingData swashRingData;
|
SwashRingData swashRingData;
|
||||||
unsigned int thrTraceSrc;
|
unsigned int thrTraceSrc;
|
||||||
int8_t traineron; // 0 disable trainer, 1 allow trainer
|
|
||||||
unsigned int modelId;
|
unsigned int modelId;
|
||||||
unsigned int switchWarningStates;
|
unsigned int switchWarningStates;
|
||||||
unsigned int nSwToWarn;
|
unsigned int nSwToWarn;
|
||||||
@@ -1024,9 +1012,6 @@ class ModelData {
|
|||||||
// TODO structure
|
// TODO structure
|
||||||
char gvars_names[C9X_MAX_GVARS][6+1];
|
char gvars_names[C9X_MAX_GVARS][6+1];
|
||||||
bool gvars_popups[C9X_MAX_GVARS];
|
bool gvars_popups[C9X_MAX_GVARS];
|
||||||
uint8_t gvsource[5];
|
|
||||||
uint8_t bt_telemetry;
|
|
||||||
uint8_t numVoice;
|
|
||||||
MavlinkData mavlink;
|
MavlinkData mavlink;
|
||||||
unsigned int telemetryProtocol;
|
unsigned int telemetryProtocol;
|
||||||
FrSkyData frsky;
|
FrSkyData frsky;
|
||||||
|
|||||||
@@ -356,7 +356,6 @@ t_Er9xModelData::operator ModelData ()
|
|||||||
{
|
{
|
||||||
ModelData c9x;
|
ModelData c9x;
|
||||||
c9x.used = true;
|
c9x.used = true;
|
||||||
c9x.modelVoice = modelVoice;
|
|
||||||
getEEPROMString(c9x.name, name, sizeof(name));
|
getEEPROMString(c9x.name, name, sizeof(name));
|
||||||
c9x.timers[0].mode = getEr9xTimerMode(tmrMode);
|
c9x.timers[0].mode = getEr9xTimerMode(tmrMode);
|
||||||
c9x.timers[0].dir = tmrDir;
|
c9x.timers[0].dir = tmrDir;
|
||||||
@@ -375,8 +374,6 @@ t_Er9xModelData::operator ModelData ()
|
|||||||
c9x.moduleData[0].protocol = PPM;
|
c9x.moduleData[0].protocol = PPM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c9x.traineron= traineron;
|
|
||||||
// c9x.t2throttle = t2throttle;
|
|
||||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||||
c9x.thrTrim = thrTrim;
|
c9x.thrTrim = thrTrim;
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ Ersky9xGeneral::operator GeneralSettings ()
|
|||||||
result.splashMode = disableSplashScreen;
|
result.splashMode = disableSplashScreen;
|
||||||
result.disablePotScroll=(disablePotScroll==1);
|
result.disablePotScroll=(disablePotScroll==1);
|
||||||
result.disableBG=(disableBG==1);
|
result.disableBG=(disableBG==1);
|
||||||
result.filterInput = filterInput;
|
|
||||||
result.templateSetup = templateSetup;
|
result.templateSetup = templateSetup;
|
||||||
result.PPM_Multiplier = PPM_Multiplier;
|
result.PPM_Multiplier = PPM_Multiplier;
|
||||||
getEEPROMString(result.ownerName, ownerName, sizeof(ownerName));
|
getEEPROMString(result.ownerName, ownerName, sizeof(ownerName));
|
||||||
@@ -507,8 +506,6 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
|||||||
c9x.moduleData[0].protocol = PPM;
|
c9x.moduleData[0].protocol = PPM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c9x.traineron= traineron;
|
|
||||||
// c9x.t2throttle = t2throttle;
|
|
||||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||||
c9x.thrTrim = thrTrim;
|
c9x.thrTrim = thrTrim;
|
||||||
@@ -628,8 +625,6 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
|||||||
c9x.moduleData[0].protocol = PPM;
|
c9x.moduleData[0].protocol = PPM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c9x.traineron= traineron;
|
|
||||||
// c9x.t2throttle = t2throttle;
|
|
||||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||||
c9x.thrTrim = thrTrim;
|
c9x.thrTrim = thrTrim;
|
||||||
@@ -732,7 +727,7 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
|||||||
// }
|
// }
|
||||||
for (int i=0; i<5;i++) {
|
for (int i=0; i<5;i++) {
|
||||||
c9x.phaseData[0].gvars[i]=gvars[i].gvar;
|
c9x.phaseData[0].gvars[i]=gvars[i].gvar;
|
||||||
c9x.gvsource[i]=gvars[i].gvsource;
|
// c9x.gvsource[i]=gvars[i].gvsource;
|
||||||
}
|
}
|
||||||
return c9x;
|
return c9x;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
|
|||||||
result.flashBeep = flashBeep;
|
result.flashBeep = flashBeep;
|
||||||
result.splashMode = disableSplashScreen;
|
result.splashMode = disableSplashScreen;
|
||||||
result.enableTelemetryAlarm = enableTelemetryAlarm;
|
result.enableTelemetryAlarm = enableTelemetryAlarm;
|
||||||
result.filterInput = filterInput;
|
|
||||||
result.templateSetup = templateSetup;
|
result.templateSetup = templateSetup;
|
||||||
result.PPM_Multiplier = PPM_Multiplier;
|
result.PPM_Multiplier = PPM_Multiplier;
|
||||||
// TODO frskyRssiAlarms[2];
|
// TODO frskyRssiAlarms[2];
|
||||||
@@ -153,7 +152,6 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
|
|||||||
result.flashBeep = flashBeep;
|
result.flashBeep = flashBeep;
|
||||||
result.splashMode = disableSplashScreen;
|
result.splashMode = disableSplashScreen;
|
||||||
result.enableTelemetryAlarm = enableTelemetryAlarm;
|
result.enableTelemetryAlarm = enableTelemetryAlarm;
|
||||||
result.filterInput = filterInput;
|
|
||||||
result.templateSetup = templateSetup;
|
result.templateSetup = templateSetup;
|
||||||
result.PPM_Multiplier = PPM_Multiplier;
|
result.PPM_Multiplier = PPM_Multiplier;
|
||||||
// TODO frskyRssiAlarms[2];
|
// TODO frskyRssiAlarms[2];
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ Th9xGeneral::operator GeneralSettings ()
|
|||||||
}
|
}
|
||||||
result.stickMode = stickMode;
|
result.stickMode = stickMode;
|
||||||
result.inactivityTimer = inactivityMin;
|
result.inactivityTimer = inactivityMin;
|
||||||
result.filterInput = adcFilt;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,8 @@ MainWindow::MainWindow():
|
|||||||
if (!(printing && (model >=0 && model<GetEepromInterface()->getMaxModels()) && !printfilename.isEmpty() )) {
|
if (!(printing && (model >=0 && model<GetEepromInterface()->getMaxModels()) && !printfilename.isEmpty() )) {
|
||||||
statusBar()->showMessage(tr("File loaded"), 2000);
|
statusBar()->showMessage(tr("File loaded"), 2000);
|
||||||
child->show();
|
child->show();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
child->show();
|
child->show();
|
||||||
child->print(model,printfilename);
|
child->print(model,printfilename);
|
||||||
child->close();
|
child->close();
|
||||||
@@ -1472,8 +1473,9 @@ MdiChild *MainWindow::createMdiChild()
|
|||||||
{
|
{
|
||||||
MdiChild * child = new MdiChild();
|
MdiChild * child = new MdiChild();
|
||||||
mdiArea->addSubWindow(child);
|
mdiArea->addSubWindow(child);
|
||||||
if(!child->parentWidget()->isMaximized() && !child->parentWidget()->isMinimized())
|
if (!child->parentWidget()->isMaximized() && !child->parentWidget()->isMinimized()) {
|
||||||
child->parentWidget()->resize(400, 400);
|
child->parentWidget()->resize(400, 400);
|
||||||
|
}
|
||||||
|
|
||||||
connect(child, SIGNAL(copyAvailable(bool)),cutAct, SLOT(setEnabled(bool)));
|
connect(child, SIGNAL(copyAvailable(bool)),cutAct, SLOT(setEnabled(bool)));
|
||||||
connect(child, SIGNAL(copyAvailable(bool)),copyAct, SLOT(setEnabled(bool)));
|
connect(child, SIGNAL(copyAvailable(bool)),copyAct, SLOT(setEnabled(bool)));
|
||||||
|
|||||||
@@ -71,13 +71,13 @@ MdiChild::MdiChild():
|
|||||||
fileChanged(false)
|
fileChanged(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowIcon(CompanionIcon("open.png"));
|
setWindowIcon(CompanionIcon("open.png"));
|
||||||
ui->SimulateTxButton->setIcon(CompanionIcon("simulate.png"));
|
ui->SimulateTxButton->setIcon(CompanionIcon("simulate.png"));
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
eepromInterfaceChanged();
|
eepromInterfaceChanged();
|
||||||
|
|
||||||
if(!(this->isMaximized() || this->isMinimized())) {
|
if (!(this->isMaximized() || this->isMinimized())) {
|
||||||
adjustSize();
|
adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -299,14 +299,6 @@ void FlightModePanel::GVName_editingFinished()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlightModePanel::GVSource_currentIndexChanged(int index)
|
|
||||||
{
|
|
||||||
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
|
|
||||||
int gvar = comboBox->property("index").toInt();
|
|
||||||
model.gvsource[gvar] = index;
|
|
||||||
emit modified();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FlightModePanel::phaseGVUse_currentIndexChanged(int index)
|
void FlightModePanel::phaseGVUse_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ class FlightModePanel : public ModelPanel
|
|||||||
void phaseTrim_valueChanged();
|
void phaseTrim_valueChanged();
|
||||||
void phaseTrimSlider_valueChanged();
|
void phaseTrimSlider_valueChanged();
|
||||||
void GVName_editingFinished();
|
void GVName_editingFinished();
|
||||||
void GVSource_currentIndexChanged(int index);
|
|
||||||
void phaseGVValue_editingFinished();
|
void phaseGVValue_editingFinished();
|
||||||
void phaseGVUse_currentIndexChanged(int index);
|
void phaseGVUse_currentIndexChanged(int index);
|
||||||
void phaseGVPopupToggled(bool checked);
|
void phaseGVPopupToggled(bool checked);
|
||||||
|
|||||||
@@ -105,8 +105,6 @@ void saveGeneralSettings(GeneralSettings & settings, global_settings & gs)
|
|||||||
}
|
}
|
||||||
/* TODO if (settings.disableSplashScreen)
|
/* TODO if (settings.disableSplashScreen)
|
||||||
gs.splash_screen(false); */
|
gs.splash_screen(false); */
|
||||||
if (settings.filterInput)
|
|
||||||
gs.filter_input(filter_input::value(settings.filterInput));
|
|
||||||
/* TODO if (settings.backlightDelay)
|
/* TODO if (settings.backlightDelay)
|
||||||
gs.light_auto_off_timer(settings.lightAutoOff); */
|
gs.light_auto_off_timer(settings.lightAutoOff); */
|
||||||
gs.default_channel_order(settings.templateSetup);
|
gs.default_channel_order(settings.templateSetup);
|
||||||
|
|||||||
Reference in New Issue
Block a user