1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

Started working on the multi receiver support

This commit is contained in:
zedamota 2011-08-04 16:58:41 +01:00
parent 2a1b830eaa
commit 5d0095f00d
10 changed files with 260 additions and 1601 deletions

View File

@ -37,7 +37,8 @@ HEADERS += configplugin.h \
calibration.h \
defaultattitudewidget.h \
smartsavebutton.h \
defaulthwsettingswidget.h
defaulthwsettingswidget.h \
inputchannelform.h
SOURCES += configplugin.cpp \
configgadgetconfiguration.cpp \
@ -65,7 +66,8 @@ SOURCES += configplugin.cpp \
alignment-calibration.cpp \
defaultattitudewidget.cpp \
smartsavebutton.cpp \
defaulthwsettingswidget.cpp
defaulthwsettingswidget.cpp \
inputchannelform.cpp
FORMS += \
airframe.ui \
@ -78,6 +80,7 @@ FORMS += \
output.ui \
ccattitude.ui \
defaultattitude.ui \
defaulthwsettings.ui
defaulthwsettings.ui \
inputchannelform.ui
RESOURCES += configgadget.qrc

View File

@ -46,606 +46,53 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent)
m_config = new Ui_InputWidget();
m_config->setupUi(this);
setupButtons(m_config->saveRCInputToRAM,m_config->saveRCInputToSD);
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
// First of all, put all the channel widgets into lists, so that we can
// manipulate those:
inMaxLabels << m_config->ch0Max
<< m_config->ch1Max
<< m_config->ch2Max
<< m_config->ch3Max
<< m_config->ch4Max
<< m_config->ch5Max
<< m_config->ch6Max
<< m_config->ch7Max;
inMinLabels << m_config->ch0Min
<< m_config->ch1Min
<< m_config->ch2Min
<< m_config->ch3Min
<< m_config->ch4Min
<< m_config->ch5Min
<< m_config->ch6Min
<< m_config->ch7Min;
inSliders << m_config->inSlider0
<< m_config->inSlider1
<< m_config->inSlider2
<< m_config->inSlider3
<< m_config->inSlider4
<< m_config->inSlider5
<< m_config->inSlider6
<< m_config->inSlider7;
inRevCheckboxes << m_config->ch0Rev
<< m_config->ch1Rev
<< m_config->ch2Rev
<< m_config->ch3Rev
<< m_config->ch4Rev
<< m_config->ch5Rev
<< m_config->ch6Rev
<< m_config->ch7Rev;
inChannelAssign << m_config->ch0Assign
<< m_config->ch1Assign
<< m_config->ch2Assign
<< m_config->ch3Assign
<< m_config->ch4Assign
<< m_config->ch5Assign
<< m_config->ch6Assign
<< m_config->ch7Assign;
// Now connect the widget to the ManualControlCommand / Channel UAVObject
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(objManager->getObject(QString("ManualControlCommand")));
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateChannels(UAVObject*)));
// Register for ManualControlSettings changes:
obj = dynamic_cast<UAVDataObject*>(objManager->getObject(QString("ManualControlSettings")));
connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(refreshValues()));
// Get the receiver types supported by OpenPilot and fill the corresponding
// dropdown menu:
obj = dynamic_cast<UAVDataObject*>(objManager->getObject(QString("ManualControlSettings")));
UAVObjectField * field;
// Fill in the dropdown menus for the channel RC Input assignement.
QStringList channelsList;
channelsList << "None";
QList<UAVObjectField*> fieldList = obj->getFields();
foreach (UAVObjectField* field, fieldList) {
if (field->getUnits().contains("channel")) {
channelsList.append(field->getName());
}
UAVDataObject * obj = dynamic_cast<UAVDataObject*>(objManager->getObject(QString("ManualControlSettings")));
UAVObjectField * field = obj->getField(QString("ChannelGroups"));
int index=0;
foreach(QString name,field->getElementNames())
{
inputChannelForm * inp=new inputChannelForm(this,index==0);
m_config->advancedPage->layout()->addWidget(inp);
inp->ui->channelName->setText(name);
addUAVObjectToWidgetRelation("ManualControlSettings","ChannelGroups",inp->ui->channelGroup,index);
addUAVObjectToWidgetRelation("ManualControlSettings","ChannelNumber",inp->ui->channelNumber,index);
addUAVObjectToWidgetRelation("ManualControlSettings","ChannelMin",inp->ui->channelMin,index);
addUAVObjectToWidgetRelation("ManualControlSettings","ChannelNeutral",inp->ui->channelNeutral,index);
addUAVObjectToWidgetRelation("ManualControlSettings","ChannelMax",inp->ui->channelMax,index);
++index;
}
m_config->ch0Assign->addItems(channelsList);
m_config->ch1Assign->addItems(channelsList);
m_config->ch2Assign->addItems(channelsList);
m_config->ch3Assign->addItems(channelsList);
m_config->ch4Assign->addItems(channelsList);
m_config->ch5Assign->addItems(channelsList);
m_config->ch6Assign->addItems(channelsList);
m_config->ch7Assign->addItems(channelsList);
addUAVObjectToWidgetRelation("ManualControlSettings","FlightModePosition",m_config->fmsModePos1,0);
addUAVObjectToWidgetRelation("ManualControlSettings","FlightModePosition",m_config->fmsModePos2,1);
addUAVObjectToWidgetRelation("ManualControlSettings","FlightModePosition",m_config->fmsModePos3,2);
// And the flight mode settings:
field = obj->getField(QString("FlightModePosition"));
m_config->fmsModePos1->addItems(field->getOptions());
m_config->fmsModePos2->addItems(field->getOptions());
m_config->fmsModePos3->addItems(field->getOptions());
field = obj->getField(QString("Stabilization1Settings"));
channelsList.clear();
channelsList.append(field->getOptions());
m_config->fmsSsPos1Roll->addItems(channelsList);
m_config->fmsSsPos1Pitch->addItems(channelsList);
m_config->fmsSsPos1Yaw->addItems(channelsList);
m_config->fmsSsPos2Roll->addItems(channelsList);
m_config->fmsSsPos2Pitch->addItems(channelsList);
m_config->fmsSsPos2Yaw->addItems(channelsList);
m_config->fmsSsPos3Roll->addItems(channelsList);
m_config->fmsSsPos3Pitch->addItems(channelsList);
m_config->fmsSsPos3Yaw->addItems(channelsList);
addUAVObjectToWidgetRelation("ManualControlSettings","Stabilization1Settings",m_config->fmsSsPos1Roll,"Roll");
addUAVObjectToWidgetRelation("ManualControlSettings","Stabilization2Settings",m_config->fmsSsPos2Roll,"Roll");
addUAVObjectToWidgetRelation("ManualControlSettings","Stabilization3Settings",m_config->fmsSsPos3Roll,"Roll");
addUAVObjectToWidgetRelation("ManualControlSettings","Stabilization1Settings",m_config->fmsSsPos1Pitch,"Pitch");
addUAVObjectToWidgetRelation("ManualControlSettings","Stabilization2Settings",m_config->fmsSsPos2Pitch,"Pitch");
addUAVObjectToWidgetRelation("ManualControlSettings","Stabilization3Settings",m_config->fmsSsPos3Pitch,"Pitch");
addUAVObjectToWidgetRelation("ManualControlSettings","Stabilization1Settings",m_config->fmsSsPos1Yaw,"Yaw");
addUAVObjectToWidgetRelation("ManualControlSettings","Stabilization2Settings",m_config->fmsSsPos2Yaw,"Yaw");
addUAVObjectToWidgetRelation("ManualControlSettings","Stabilization3Settings",m_config->fmsSsPos3Yaw,"Yaw");
// And the Armin configurations:
field = obj->getField(QString("Arming"));
m_config->armControl->clear();
m_config->armControl->addItems(field->getOptions());
connect(m_config->saveRCInputToSD, SIGNAL(clicked()), this, SLOT(saveRCInputObject()));
connect(m_config->saveRCInputToRAM, SIGNAL(clicked()), this, SLOT(sendRCInputUpdate()));
enableControls(false);
refreshValues();
connect(parent, SIGNAL(autopilotConnected()),this, SLOT(onAutopilotConnect()));
connect(parent, SIGNAL(autopilotDisconnected()), this, SLOT(onAutopilotDisconnect()));
connect(m_config->ch0Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool)));
connect(m_config->ch1Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool)));
connect(m_config->ch2Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool)));
connect(m_config->ch3Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool)));
connect(m_config->ch4Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool)));
connect(m_config->ch5Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool)));
connect(m_config->ch6Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool)));
connect(m_config->ch7Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool)));
connect(m_config->doRCInputCalibration,SIGNAL(stateChanged(int)),this,SLOT(updateTips(int)));
firstUpdate = true;
addUAVObjectToWidgetRelation("ManualControlSettings","Arming",m_config->armControl);
addUAVObjectToWidgetRelation("ManualControlSettings","armTimeout",m_config->armTimeout,0,1000);
populateWidgets();
refreshWidgetsValues();
// Connect the help button
connect(m_config->inputHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
updateTips(Qt::Unchecked);
}
ConfigInputWidget::~ConfigInputWidget()
{
// Do nothing
}
/**
Slot called whenever we revert a signal
*/
void ConfigInputWidget::reverseCheckboxClicked(bool state)
{
QObject* obj = sender();
int i = inRevCheckboxes.indexOf((QCheckBox*)obj);
inSliders[i]->setInvertedAppearance(state);
int max = inMaxLabels[i]->text().toInt();
int min = inMinLabels[i]->text().toInt();
if ((state && (max>min)) ||
(!state && (max < min))) {
inMaxLabels[i]->setText(QString::number(min));
inMinLabels[i]->setText(QString::number(max));
}
}
// ************************************
/*
Enable or disable some controls depending on whether we are connected
or not to the board. Actually, this i mostly useless IMHO, I don't
know who added this into the code (Ed's note)
*/
void ConfigInputWidget::enableControls(bool enable)
{
//m_config->saveRCInputToRAM->setEnabled(enable);
m_config->saveRCInputToSD->setEnabled(enable);
m_config->doRCInputCalibration->setEnabled(enable);
}
/********************************
* Input settings
*******************************/
/**
Request the current config from the board
*/
void ConfigInputWidget::refreshValues()
{
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("ManualControlSettings")));
Q_ASSERT(obj);
//obj->requestUpdate();
UAVObjectField *field;
// Now update all the slider values:
UAVObjectField *field_max = obj->getField(QString("ChannelMax"));
UAVObjectField *field_min = obj->getField(QString("ChannelMin"));
UAVObjectField *field_neu = obj->getField(QString("ChannelNeutral"));
Q_ASSERT(field_max);
Q_ASSERT(field_min);
Q_ASSERT(field_neu);
for (int i = 0; i < 8; i++) {
QVariant max = field_max->getValue(i);
QVariant min = field_min->getValue(i);
QVariant neutral = field_neu->getValue(i);
inMaxLabels[i]->setText(max.toString());
inMinLabels[i]->setText(min.toString());
if (max.toInt()> min.toInt()) {
inRevCheckboxes[i]->setChecked(false);
inSliders[i]->setMaximum(max.toInt());
inSliders[i]->setMinimum(min.toInt());
} else {
inRevCheckboxes[i]->setChecked(true);
inSliders[i]->setMaximum(min.toInt());
inSliders[i]->setMinimum(max.toInt());
}
inSliders[i]->setValue(neutral.toInt());
}
// Update receiver type
field = obj->getField(QString("InputMode"));
m_config->receiverType->setText(field->getValue().toString());
// Reset all channel assignement dropdowns:
foreach (QComboBox *combo, inChannelAssign) {
combo->setCurrentIndex(0);
}
// Update all channels assignements
QList<UAVObjectField *> fieldList = obj->getFields();
foreach (UAVObjectField *field, fieldList) {
if (field->getUnits().contains("channel"))
assignChannel(obj, field->getName());
}
// Update all the flight mode settingsin the relevant tab
field = obj->getField(QString("FlightModePosition"));
m_config->fmsModePos1->setCurrentIndex((m_config->fmsModePos1->findText(field->getValue(0).toString())));
m_config->fmsModePos2->setCurrentIndex((m_config->fmsModePos2->findText(field->getValue(1).toString())));
m_config->fmsModePos3->setCurrentIndex((m_config->fmsModePos3->findText(field->getValue(2).toString())));
field = obj->getField(QString("Stabilization1Settings"));
m_config->fmsSsPos1Roll->setCurrentIndex(m_config->fmsSsPos1Roll->findText(field->getValue(field->getElementNames().indexOf("Roll")).toString()));
m_config->fmsSsPos1Pitch->setCurrentIndex(m_config->fmsSsPos1Pitch->findText(field->getValue(field->getElementNames().indexOf("Pitch")).toString()));
m_config->fmsSsPos1Yaw->setCurrentIndex(m_config->fmsSsPos1Yaw->findText(field->getValue(field->getElementNames().indexOf("Yaw")).toString()));
field = obj->getField(QString("Stabilization2Settings"));
m_config->fmsSsPos2Roll->setCurrentIndex(m_config->fmsSsPos2Roll->findText(field->getValue(field->getElementNames().indexOf("Roll")).toString()));
m_config->fmsSsPos2Pitch->setCurrentIndex(m_config->fmsSsPos2Pitch->findText(field->getValue(field->getElementNames().indexOf("Pitch")).toString()));
m_config->fmsSsPos2Yaw->setCurrentIndex(m_config->fmsSsPos2Yaw->findText(field->getValue(field->getElementNames().indexOf("Yaw")).toString()));
field = obj->getField(QString("Stabilization3Settings"));
m_config->fmsSsPos3Roll->setCurrentIndex(m_config->fmsSsPos3Roll->findText(field->getValue(field->getElementNames().indexOf("Roll")).toString()));
m_config->fmsSsPos3Pitch->setCurrentIndex(m_config->fmsSsPos3Pitch->findText(field->getValue(field->getElementNames().indexOf("Pitch")).toString()));
m_config->fmsSsPos3Yaw->setCurrentIndex(m_config->fmsSsPos3Yaw->findText(field->getValue(field->getElementNames().indexOf("Yaw")).toString()));
// Load the arming settings
field = obj->getField(QString("Arming"));
m_config->armControl->setCurrentIndex(m_config->armControl->findText(field->getValue().toString()));
field = obj->getField(QString("ArmedTimeout"));
m_config->armTimeout->setValue(field->getValue().toInt()/1000);
}
/**
* Sends the config to the board, without saving to the SD card
*/
void ConfigInputWidget::sendRCInputUpdate()
{
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(objManager->getObject(QString("ManualControlSettings")));
Q_ASSERT(obj);
// Now update all fields from the sliders:
QString fieldName = QString("ChannelMax");
UAVObjectField * field = obj->getField(fieldName);
for (int i = 0; i < 8; i++) {
field->setValue(inMaxLabels[i]->text().toInt(), i);
}
fieldName = QString("ChannelMin");
field = obj->getField(fieldName);
for (int i = 0; i < 8; i++) {
field->setValue(inMinLabels[i]->text().toInt(), i);
}
fieldName = QString("ChannelNeutral");
field = obj->getField(fieldName);
for (int i = 0; i < 8; i++)
field->setValue(inSliders[i]->value(), i);
// Set Roll/Pitch/Yaw/Etc assignement:
// Rule: if two channels have the same setting (which is wrong!) the higher channel
// will get the setting.
// First, reset all channel assignements:
QList<UAVObjectField*> fieldList = obj->getFields();
foreach (UAVObjectField* field, fieldList) {
if (field->getUnits().contains("channel")) {
field->setValue(field->getOptions().last());
}
}
// Then assign according to current GUI state:
if (m_config->ch0Assign->currentIndex() != 0) {
field = obj->getField(m_config->ch0Assign->currentText());
field->setValue(field->getOptions().at(0)); // -> This way we don't depend on channel naming convention
}
if (m_config->ch1Assign->currentIndex() != 0) {
field = obj->getField(m_config->ch1Assign->currentText());
field->setValue(field->getOptions().at(1));
}
if (m_config->ch2Assign->currentIndex() != 0) {
field = obj->getField(m_config->ch2Assign->currentText());
field->setValue(field->getOptions().at(2));
}
if (m_config->ch3Assign->currentIndex() != 0) {
field = obj->getField(m_config->ch3Assign->currentText());
field->setValue(field->getOptions().at(3));
}
if (m_config->ch4Assign->currentIndex() != 0) {
field = obj->getField(m_config->ch4Assign->currentText());
field->setValue(field->getOptions().at(4));
}
if (m_config->ch5Assign->currentIndex() != 0) {
field = obj->getField(m_config->ch5Assign->currentText());
field->setValue(field->getOptions().at(5));
}
if (m_config->ch6Assign->currentIndex() != 0) {
field = obj->getField(m_config->ch6Assign->currentText());
field->setValue(field->getOptions().at(6));
}
if (m_config->ch7Assign->currentIndex() != 0) {
field = obj->getField(m_config->ch7Assign->currentText());
field->setValue(field->getOptions().at(7));
}
// Send all the flight mode settings
field = obj->getField(QString("FlightModePosition"));
field->setValue(m_config->fmsModePos1->currentText(),0);
field->setValue(m_config->fmsModePos2->currentText(),1);
field->setValue(m_config->fmsModePos3->currentText(),2);
field = obj->getField(QString("Stabilization1Settings"));
field->setValue(m_config->fmsSsPos1Roll->currentText(), field->getElementNames().indexOf("Roll"));
field->setValue(m_config->fmsSsPos1Pitch->currentText(), field->getElementNames().indexOf("Pitch"));
field->setValue(m_config->fmsSsPos1Yaw->currentText(), field->getElementNames().indexOf("Yaw"));
field = obj->getField(QString("Stabilization2Settings"));
field->setValue(m_config->fmsSsPos2Roll->currentText(), field->getElementNames().indexOf("Roll"));
field->setValue(m_config->fmsSsPos2Pitch->currentText(), field->getElementNames().indexOf("Pitch"));
field->setValue(m_config->fmsSsPos2Yaw->currentText(), field->getElementNames().indexOf("Yaw"));
field = obj->getField(QString("Stabilization3Settings"));
field->setValue(m_config->fmsSsPos3Roll->currentText(), field->getElementNames().indexOf("Roll"));
field->setValue(m_config->fmsSsPos3Pitch->currentText(), field->getElementNames().indexOf("Pitch"));
field->setValue(m_config->fmsSsPos3Yaw->currentText(), field->getElementNames().indexOf("Yaw"));
// Save the arming settings
field = obj->getField(QString("Arming"));
field->setValue(m_config->armControl->currentText());
field = obj->getField(QString("ArmedTimeout"));
field->setValue(m_config->armTimeout->value()*1000);
// ... and send to the OP Board
obj->updated();
}
/**
Sends the config to the board and request saving into the SD card
*/
void ConfigInputWidget::saveRCInputObject()
{
// Send update so that the latest value is saved
sendRCInputUpdate();
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("ManualControlSettings")));
Q_ASSERT(obj);
saveObjectToSD(obj);
}
/**
* Set the dropdown option for a channel Input assignement
*/
void ConfigInputWidget::assignChannel(UAVDataObject *obj, QString str)
{
UAVObjectField* field = obj->getField(str);
QStringList options = field->getOptions();
switch (options.indexOf(field->getValue().toString())) {
case 0:
m_config->ch0Assign->setCurrentIndex(m_config->ch0Assign->findText(str));
break;
case 1:
m_config->ch1Assign->setCurrentIndex(m_config->ch0Assign->findText(str));
break;
case 2:
m_config->ch2Assign->setCurrentIndex(m_config->ch0Assign->findText(str));
break;
case 3:
m_config->ch3Assign->setCurrentIndex(m_config->ch0Assign->findText(str));
break;
case 4:
m_config->ch4Assign->setCurrentIndex(m_config->ch0Assign->findText(str));
break;
case 5:
m_config->ch5Assign->setCurrentIndex(m_config->ch0Assign->findText(str));
break;
case 6:
m_config->ch6Assign->setCurrentIndex(m_config->ch0Assign->findText(str));
break;
case 7:
m_config->ch7Assign->setCurrentIndex(m_config->ch0Assign->findText(str));
break;
}
}
/**
* Updates the slider positions and min/max values
*
*/
void ConfigInputWidget::updateChannels(UAVObject* controlCommand)
{
QString fieldName = QString("Connected");
UAVObjectField *field = controlCommand->getField(fieldName);
if (field->getValue().toBool())
{
m_config->RCInputConnected->setText("RC Receiver connected");
m_config->lblMissingInputs->setText("");
}
else
{
m_config->RCInputConnected->setText("RC Receiver not connected or invalid input configuration (missing channels)");
receiverHelp();
}
if (m_config->doRCInputCalibration->isChecked()) {
if (firstUpdate) {
// Increase the data rate from the board so that the sliders
// move faster
UAVObject::Metadata mdata = controlCommand->getMetadata();
mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC;
mccDataRate = mdata.flightTelemetryUpdatePeriod;
mdata.flightTelemetryUpdatePeriod = 150;
controlCommand->setMetadata(mdata);
// Also protect the user by setting all values to zero
// and making the ActuatorCommand object readonly
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("ActuatorCommand")));
mdata = obj->getMetadata();
mdata.flightAccess = UAVObject::ACCESS_READONLY;
obj->setMetadata(mdata);
UAVObjectField *field = obj->getField("Channel");
for (uint i=0; i< field->getNumElements(); i++) {
field->setValue(0,i);
}
obj->updated();
// OP-534: make sure the airframe can NEVER arm
obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("ManualControlSettings")));
field = obj->getField("Arming");
field->setValue("Always Disarmed");
obj->updated();
// Last, make sure the user won't apply/save during calibration
m_config->saveRCInputToRAM->setEnabled(false);
m_config->saveRCInputToSD->setEnabled(false);
// Reset all slider values to zero
field = controlCommand->getField(QString("Channel"));
for (int i = 0; i < 8; i++)
updateChannelInSlider(inSliders[i], inMinLabels[i], inMaxLabels[i], field->getValue(i).toInt(),inRevCheckboxes[i]->isChecked());
firstUpdate = false;
// Tell a few things to the user:
QMessageBox msgBox;
msgBox.setText(tr("Arming Settings are now set to Always Disarmed for your safety."));
msgBox.setDetailedText(tr("You will have to reconfigure arming settings yourself afterwards."));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();
}
field = controlCommand->getField(QString("Channel"));
for (int i = 0; i < 8; i++)
updateChannelInSlider(inSliders[i], inMinLabels[i], inMaxLabels[i], field->getValue(i).toInt(),inRevCheckboxes[i]->isChecked());
}
else {
if (!firstUpdate) {
// Restore original data rate from the board:
UAVObject::Metadata mdata = controlCommand->getMetadata();
mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC;
mdata.flightTelemetryUpdatePeriod = mccDataRate;
controlCommand->setMetadata(mdata);
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("ActuatorCommand")));
mdata = obj->getMetadata();
mdata.flightAccess = UAVObject::ACCESS_READWRITE;
obj->setMetadata(mdata);
// Set some slider values to better defaults
// Find some channels first
int throttleChannel = -1;
int fmChannel = -1;
for (int i=0; i < inChannelAssign.length(); i++) {
if (inChannelAssign.at(i)->currentText() == "Throttle") {
// TODO: this is very ugly, because this relies on the name of the
// channel input, everywhere else in the gadget we don't rely on the
// naming...
throttleChannel = i;
}
if (inChannelAssign.at(i)->currentText() == "FlightMode") {
// TODO: this is very ugly, because this relies on the name of the
// channel input, everywhere else in the gadget we don't rely on the
// naming...
fmChannel = i;
}
}
// Throttle neutral defaults to 2% of range
if (throttleChannel > -1) {
inSliders.at(throttleChannel)->setValue(
inSliders.at(throttleChannel)->minimum() +
(inSliders.at(throttleChannel)->maximum()-
inSliders.at(throttleChannel)->minimum())*0.02);
}
// Flight mode at 50% of range:
if (fmChannel > -1) {
inSliders.at(fmChannel)->setValue(
inSliders.at(fmChannel)->minimum()+
(inSliders.at(fmChannel)->maximum()-
inSliders.at(fmChannel)->minimum())*0.5);
}
m_config->saveRCInputToRAM->setEnabled(true);
m_config->saveRCInputToSD->setEnabled(true);
}
firstUpdate = true;
}
//Update the Flight mode channel slider
ManualControlSettings * manualSettings = ManualControlSettings::GetInstance(getObjectManager());
ManualControlSettings::DataFields manualSettingsData = manualSettings->getData();
uint chIndex = manualSettingsData.FlightMode;
if (chIndex < manualSettings->FLIGHTMODE_NONE) {
float valueScaled;
int chMin = manualSettingsData.ChannelMin[chIndex];
int chMax = manualSettingsData.ChannelMax[chIndex];
int chNeutral = manualSettingsData.ChannelNeutral[chIndex];
int value = controlCommand->getField("Channel")->getValue(chIndex).toInt();
if ((chMax > chMin && value >= chNeutral) || (chMin > chMax && value <= chNeutral))
{
if (chMax != chNeutral)
valueScaled = (float)(value - chNeutral) / (float)(chMax - chNeutral);
else
valueScaled = 0;
}
else
{
if (chMin != chNeutral)
valueScaled = (float)(value - chNeutral) / (float)(chNeutral - chMin);
else
valueScaled = 0;
}
if(valueScaled < -(1.0 / 3.0))
m_config->fmsSlider->setValue(-100);
else if (valueScaled > (1.0/3.0))
m_config->fmsSlider->setValue(100);
else
m_config->fmsSlider->setValue(0);
}
}
void ConfigInputWidget::updateChannelInSlider(QSlider *slider, QLabel *min, QLabel *max, int value, bool reversed)
{
if (!slider || !min || !max)
return;
if (firstUpdate) {
// Reset all the min/max values of the progress bar since we are starting the calibration.
slider->setMaximum(value);
slider->setMinimum(value);
slider->setValue(value);
max->setText(QString::number(value));
min->setText(QString::number(value));
return;
}
if (value > 0) {
// avoids glitches...
if (value > slider->maximum()) {
slider->setMaximum(value);
if (reversed)
min->setText(QString::number(value));
else
max->setText(QString::number(value));
}
if (value < slider->minimum()) {
slider->setMinimum(value);
if (reversed)
max->setText(QString::number(value));
else
min->setText(QString::number(value));
}
slider->setValue(value);
}
// Do nothing
}
void ConfigInputWidget::openHelp()
@ -653,77 +100,5 @@ void ConfigInputWidget::openHelp()
QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/Input+Configuration", QUrl::StrictMode) );
}
void ConfigInputWidget::receiverHelp()
{
QString unassigned;
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
UAVDataObject* controlCommand = dynamic_cast<UAVDataObject*>(objManager->getObject(QString("ManualControlSettings")));
UAVObjectField *field;
field= controlCommand->getField("Roll");
if(field->getValue().toString()=="None")
unassigned.append("Roll");
field =controlCommand->getField("Pitch");
if(field->getValue().toString()=="None")
{
if(unassigned.length()>0)
unassigned.append(", ");
unassigned.append("Pitch");
}
field =controlCommand->getField("Yaw");
if(field->getValue().toString()=="None")
{
if(unassigned.length()>0)
unassigned.append(", ");
unassigned.append("Yaw");
}
field =controlCommand->getField("Throttle");
if(field->getValue().toString()=="None")
{
if(unassigned.length()>0)
unassigned.append(", ");
unassigned.append("Throttle");
}
field =controlCommand->getField("FlightMode");
if(field->getValue().toString()=="None")
{
if(unassigned.length()>0)
unassigned.append(", ");
unassigned.append("FlightMode");
}
if(unassigned.length()>0)
m_config->lblMissingInputs->setText(QString("Channels left to assign: ")+unassigned);
else
m_config->lblMissingInputs->setText("");
}
void ConfigInputWidget::updateTips(int value)
{
if(value==Qt::Checked)
{
m_config->ch0Cur->setToolTip("Current channel value");
m_config->ch1Cur->setToolTip("Current channel value");
m_config->ch2Cur->setToolTip("Current channel value");
m_config->ch3Cur->setToolTip("Current channel value");
m_config->ch4Cur->setToolTip("Current channel value");
m_config->ch5Cur->setToolTip("Current channel value");
m_config->ch6Cur->setToolTip("Current channel value");
m_config->ch7Cur->setToolTip("Current channel value");
}
else
{
m_config->ch0Cur->setToolTip("Channel neutral point");
m_config->ch1Cur->setToolTip("Channel neutral point");
m_config->ch2Cur->setToolTip("Channel neutral point");
m_config->ch3Cur->setToolTip("Channel neutral point");
m_config->ch4Cur->setToolTip("Channel neutral point");
m_config->ch5Cur->setToolTip("Channel neutral point");
m_config->ch6Cur->setToolTip("Channel neutral point");
m_config->ch7Cur->setToolTip("Channel neutral point");
}
}

View File

@ -34,7 +34,8 @@
#include "uavobject.h"
#include <QtGui/QWidget>
#include <QList>
#include "inputchannelform.h"
#include "ui_inputchannelform.h"
class Ui_InputWidget;
class ConfigInputWidget: public ConfigTaskWidget
@ -50,36 +51,9 @@ public slots:
private:
Ui_InputWidget *m_config;
QList<QSlider> sliders;
void updateChannelInSlider(QSlider *slider, QLabel *min, QLabel *max, int value, bool reversed);
void assignChannel(UAVDataObject *obj, QString str);
void assignOutputChannel(UAVDataObject *obj, QString str);
int mccDataRate;
UAVObject::Metadata accInitialData;
QList<QSlider*> inSliders;
QList<QLabel*> inMaxLabels;
QList<QLabel*> inMinLabels;
QList<QLabel*> inNeuLabels;
QList<QCheckBox*> inRevCheckboxes;
QList<QComboBox*> inChannelAssign;
bool firstUpdate;
virtual void enableControls(bool enable);
void receiverHelp();
private slots:
void updateChannels(UAVObject* obj);
virtual void refreshValues();
void sendRCInputUpdate();
void saveRCInputObject();
void reverseCheckboxClicked(bool state);
void openHelp();
void updateTips(int);
};
#endif

View File

@ -43,13 +43,24 @@ void ConfigTaskWidget::addUAVObject(QString objectName)
{
addUAVObjectToWidgetRelation(objectName,"",NULL);
}
void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget * widget)
void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget * widget, QString index)
{
UAVObject *obj=NULL;
UAVObjectField *_field=NULL;
obj = objManager->getObject(QString(object));
_field = obj->getField(QString(field));
addUAVObjectToWidgetRelation(object,field,widget,_field->getElementNames().indexOf(index));
}
void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget * widget, int index,int scale)
{
UAVObject *obj=NULL;
UAVObjectField *_field=NULL;
if(!object.isEmpty())
{
obj = objManager->getObject(QString(object));
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues()));
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues()));
}
//smartsave->addObject(obj);
if(!field.isEmpty() && obj)
_field = obj->getField(QString(field));
@ -57,6 +68,8 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString fiel
ow->field=_field;
ow->object=obj;
ow->widget=widget;
ow->index=index;
ow->scale=scale;
objOfInterest.append(ow);
if(obj)
smartsave->addObject(obj);
@ -156,11 +169,15 @@ void ConfigTaskWidget::populateWidgets()
else if(QComboBox * cb=qobject_cast<QComboBox *>(ow->widget))
{
cb->addItems(ow->field->getOptions());
cb->setCurrentIndex(cb->findText(ow->field->getValue().toString()));
cb->setCurrentIndex(cb->findText(ow->field->getValue(ow->index).toString()));
}
else if(QLabel * cb=qobject_cast<QLabel *>(ow->widget))
{
cb->setText(ow->field->getValue().toString());
cb->setText(ow->field->getValue(ow->index).toString());
}
else if(QSpinBox * cb=qobject_cast<QSpinBox *>(ow->widget))
{
cb->setValue(ow->field->getValue(ow->index).toInt()/ow->scale);
}
}
setDirty(dirtyBack);
@ -177,11 +194,15 @@ void ConfigTaskWidget::refreshWidgetsValues()
}
else if(QComboBox * cb=qobject_cast<QComboBox *>(ow->widget))
{
cb->setCurrentIndex(cb->findText(ow->field->getValue().toString()));
cb->setCurrentIndex(cb->findText(ow->field->getValue(ow->index).toString()));
}
else if(QLabel * cb=qobject_cast<QLabel *>(ow->widget))
{
cb->setText(ow->field->getValue().toString());
cb->setText(ow->field->getValue(ow->index).toString());
}
else if(QSpinBox * cb=qobject_cast<QSpinBox *>(ow->widget))
{
cb->setValue(ow->field->getValue(ow->index).toInt()/ow->scale);
}
}
setDirty(dirtyBack);
@ -197,11 +218,15 @@ void ConfigTaskWidget::updateObjectsFromWidgets()
}
else if(QComboBox * cb=qobject_cast<QComboBox *>(ow->widget))
{
ow->field->setValue(cb->currentText());
ow->field->setValue(cb->currentText(),ow->index);
}
else if(QLabel * cb=qobject_cast<QLabel *>(ow->widget))
{
ow->field->setValue(cb->text());
ow->field->setValue(cb->text(),ow->index);
}
else if(QSpinBox * cb=qobject_cast<QSpinBox *>(ow->widget))
{
ow->field->setValue(cb->value()* ow->scale,ow->index);
}
}
}

View File

@ -54,6 +54,8 @@ public:
UAVObject * object;
UAVObjectField * field;
QWidget * widget;
int index;
int scale;
};
ConfigTaskWidget(QWidget *parent = 0);
@ -63,10 +65,12 @@ public:
static double listMean(QList<double> list);
void addUAVObject(QString objectName);
void addWidget(QWidget * widget);
void addUAVObjectToWidgetRelation(QString object,QString field,QWidget * widget);
void addUAVObjectToWidgetRelation(QString object,QString field,QWidget * widget,int index=0,int scale=1);
void setupButtons(QPushButton * update,QPushButton * save);
bool isDirty();
void setDirty(bool value);
void addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString index);
public slots:
void onAutopilotDisconnect();
void onAutopilotConnect();
@ -75,6 +79,7 @@ private slots:
virtual void refreshValues();
virtual void updateObjectsFromWidgets();
private:
QStringList objectsList;
QList <objectToWidget*> objOfInterest;
ExtensionSystem::PluginManager *pm;
UAVObjectManager *objManager;

View File

@ -25,770 +25,11 @@
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Receiver Type:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="5">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="RCInputConnected">
<property name="minimumSize">
<size>
<width>234</width>
<height>54</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Indicates whether OpenPilot is getting a signal from the RC receiver.</string>
</property>
<property name="text">
<string>RC Receiver not connected or invalid input configuration (missing channels)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="9">
<widget class="QLabel" name="label">
<property name="text">
<string>Rev.</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QComboBox" name="ch0Assign">
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="frame">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="5" colspan="3">
<widget class="QSlider" name="inSlider0">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
<property name="value">
<number>1500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="8">
<widget class="QLabel" name="ch0Max">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Maximum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>2000</string>
</property>
</widget>
</item>
<item row="1" column="9">
<widget class="QCheckBox" name="ch0Rev">
<property name="toolTip">
<string>Check this to reverse the channel.
(Useful for transmitters without channel
reversal capabilities).</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QComboBox" name="ch1Assign"/>
</item>
<item row="2" column="5" colspan="3">
<widget class="QSlider" name="inSlider1">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
<property name="value">
<number>1500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="8">
<widget class="QLabel" name="ch1Max">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Maximum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>2000</string>
</property>
</widget>
</item>
<item row="2" column="9">
<widget class="QCheckBox" name="ch1Rev">
<property name="toolTip">
<string>Check this to reverse the channel.
(Useful for transmitters without channel
reversal capabilities).</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QComboBox" name="ch2Assign"/>
</item>
<item row="3" column="5" colspan="3">
<widget class="QSlider" name="inSlider2">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
<property name="value">
<number>1500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="8">
<widget class="QLabel" name="ch2Max">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Maximum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>2000</string>
</property>
</widget>
</item>
<item row="3" column="9">
<widget class="QCheckBox" name="ch2Rev">
<property name="toolTip">
<string>Check this to reverse the channel.
(Useful for transmitters without channel
reversal capabilities).</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QComboBox" name="ch3Assign"/>
</item>
<item row="4" column="5" colspan="3">
<widget class="QSlider" name="inSlider3">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
<property name="value">
<number>1500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="8">
<widget class="QLabel" name="ch3Max">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Maximum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>2000</string>
</property>
</widget>
</item>
<item row="4" column="9">
<widget class="QCheckBox" name="ch3Rev">
<property name="toolTip">
<string>Check this to reverse the channel.
(Useful for transmitters without channel
reversal capabilities).</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QComboBox" name="ch4Assign"/>
</item>
<item row="5" column="5" colspan="3">
<widget class="QSlider" name="inSlider4">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
<property name="value">
<number>1500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="8">
<widget class="QLabel" name="ch4Max">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Maximum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>2000</string>
</property>
</widget>
</item>
<item row="5" column="9">
<widget class="QCheckBox" name="ch4Rev">
<property name="toolTip">
<string>Check this to reverse the channel.
(Useful for transmitters without channel
reversal capabilities).</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QComboBox" name="ch5Assign"/>
</item>
<item row="6" column="5" colspan="3">
<widget class="QSlider" name="inSlider5">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
<property name="value">
<number>1500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="8">
<widget class="QLabel" name="ch5Max">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Maximum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>2000</string>
</property>
</widget>
</item>
<item row="6" column="9">
<widget class="QCheckBox" name="ch5Rev">
<property name="toolTip">
<string>Check this to reverse the channel.
(Useful for transmitters without channel
reversal capabilities).</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QComboBox" name="ch6Assign"/>
</item>
<item row="7" column="5" colspan="3">
<widget class="QSlider" name="inSlider6">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
<property name="value">
<number>1500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="7" column="8">
<widget class="QLabel" name="ch6Max">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Maximum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>2000</string>
</property>
</widget>
</item>
<item row="7" column="9">
<widget class="QCheckBox" name="ch6Rev">
<property name="toolTip">
<string>Check this to reverse the channel.
(Useful for transmitters without channel
reversal capabilities).</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QComboBox" name="ch7Assign"/>
</item>
<item row="8" column="5" colspan="3">
<widget class="QSlider" name="inSlider7">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
<property name="value">
<number>1500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="8" column="8">
<widget class="QLabel" name="ch7Max">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Maximum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>2000</string>
</property>
</widget>
</item>
<item row="8" column="9">
<widget class="QCheckBox" name="ch7Rev">
<property name="toolTip">
<string>Check this to reverse the channel.
(Useful for transmitters without channel
reversal capabilities).</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="14" column="0" colspan="10">
<widget class="QLabel" name="label_20">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>BEWARE: make sure your engines are not connected when running calibration!
</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="10">
<widget class="QLabel" name="lblMissingInputs">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="doRCInputCalibration">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Start calibrating the RC Inputs.
Uncheck/Check to restart calibration.
During calibration: move your RC controls over their whole range,
then leave them on Neutral, uncheck calibration and save.
Neutral should be put at the bottom of the slider for the throttle.</string>
</property>
<property name="text">
<string>Run Calibration</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="receiverType">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="ch0Min">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Minimum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLabel" name="ch1Min">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Minimum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QLabel" name="ch2Min">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Minimum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QLabel" name="ch3Min">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Minimum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QLabel" name="ch4Min">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Minimum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QLabel" name="ch5Min">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Minimum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="4">
<widget class="QLabel" name="ch6Min">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Minimum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="4">
<widget class="QLabel" name="ch7Min">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Minimum channel pulse width&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(microseconds)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="ch0Cur">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Current channel value.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1500</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="ch1Cur">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Current channel value.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1500</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="ch2Cur">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Current channel value.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1500</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="ch3Cur">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Current channel value.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1500</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="ch4Cur">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Current channel value.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1500</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="ch5Cur">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Current channel value.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1500</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="ch6Cur">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Current channel value.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1500</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="ch7Cur">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;Current channel value.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>1500</string>
</property>
<widget class="QStackedWidget" name="stackedWidget">
<widget class="QWidget" name="advancedPage">
<layout class="QVBoxLayout" name="verticalLayout_4"/>
</widget>
<widget class="QWidget" name="page"/>
</widget>
</item>
</layout>
@ -1243,14 +484,6 @@ Applies and Saves all settings to SD</string>
</layout>
</widget>
<tabstops>
<tabstop>ch0Assign</tabstop>
<tabstop>ch1Assign</tabstop>
<tabstop>ch2Assign</tabstop>
<tabstop>ch3Assign</tabstop>
<tabstop>ch4Assign</tabstop>
<tabstop>ch5Assign</tabstop>
<tabstop>ch6Assign</tabstop>
<tabstop>ch7Assign</tabstop>
<tabstop>fmsSlider</tabstop>
<tabstop>fmsModePos3</tabstop>
<tabstop>fmsSsPos3Roll</tabstop>
@ -1268,134 +501,5 @@ Applies and Saves all settings to SD</string>
<resources>
<include location="../coreplugin/core.qrc"/>
</resources>
<connections>
<connection>
<sender>inSlider0</sender>
<signal>valueChanged(int)</signal>
<receiver>ch0Cur</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>291</x>
<y>93</y>
</hint>
<hint type="destinationlabel">
<x>150</x>
<y>104</y>
</hint>
</hints>
</connection>
<connection>
<sender>inSlider1</sender>
<signal>valueChanged(int)</signal>
<receiver>ch1Cur</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>283</x>
<y>137</y>
</hint>
<hint type="destinationlabel">
<x>160</x>
<y>138</y>
</hint>
</hints>
</connection>
<connection>
<sender>inSlider2</sender>
<signal>valueChanged(int)</signal>
<receiver>ch2Cur</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>341</x>
<y>163</y>
</hint>
<hint type="destinationlabel">
<x>156</x>
<y>167</y>
</hint>
</hints>
</connection>
<connection>
<sender>inSlider3</sender>
<signal>valueChanged(int)</signal>
<receiver>ch3Cur</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>283</x>
<y>211</y>
</hint>
<hint type="destinationlabel">
<x>159</x>
<y>210</y>
</hint>
</hints>
</connection>
<connection>
<sender>inSlider4</sender>
<signal>valueChanged(int)</signal>
<receiver>ch4Cur</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>287</x>
<y>239</y>
</hint>
<hint type="destinationlabel">
<x>156</x>
<y>242</y>
</hint>
</hints>
</connection>
<connection>
<sender>inSlider5</sender>
<signal>valueChanged(int)</signal>
<receiver>ch5Cur</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>309</x>
<y>272</y>
</hint>
<hint type="destinationlabel">
<x>164</x>
<y>276</y>
</hint>
</hints>
</connection>
<connection>
<sender>inSlider6</sender>
<signal>valueChanged(int)</signal>
<receiver>ch6Cur</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>282</x>
<y>300</y>
</hint>
<hint type="destinationlabel">
<x>144</x>
<y>311</y>
</hint>
</hints>
</connection>
<connection>
<sender>inSlider7</sender>
<signal>valueChanged(int)</signal>
<receiver>ch7Cur</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>278</x>
<y>339</y>
</hint>
<hint type="destinationlabel">
<x>168</x>
<y>340</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View File

@ -0,0 +1,29 @@
#include "inputchannelform.h"
#include "ui_inputchannelform.h"
inputChannelForm::inputChannelForm(QWidget *parent,bool showlegend) :
QWidget(parent),
ui(new Ui::inputChannelForm)
{
ui->setupUi(this);
if(!showlegend)
{
layout()->removeWidget(ui->legend0);
layout()->removeWidget(ui->legend1);
layout()->removeWidget(ui->legend2);
layout()->removeWidget(ui->legend3);
layout()->removeWidget(ui->legend4);
layout()->removeWidget(ui->legend5);
delete ui->legend0;
delete ui->legend1;
delete ui->legend2;
delete ui->legend3;
delete ui->legend4;
delete ui->legend5;
}
}
inputChannelForm::~inputChannelForm()
{
delete ui;
}

View File

@ -0,0 +1,23 @@
#ifndef INPUTCHANNELFORM_H
#define INPUTCHANNELFORM_H
#include <QWidget>
#include "configinputwidget.h"
namespace Ui {
class inputChannelForm;
}
class inputChannelForm : public QWidget
{
Q_OBJECT
public:
explicit inputChannelForm(QWidget *parent = 0,bool showlegend=false);
~inputChannelForm();
friend class ConfigInputWidget;
private:
Ui::inputChannelForm *ui;
};
#endif // INPUTCHANNELFORM_H

View File

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>inputChannelForm</class>
<widget class="QWidget" name="inputChannelForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>389</width>
<height>57</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="3">
<widget class="QLabel" name="legend2">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Number</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="legend3">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Min</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="legend0">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Function</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="legend1">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Group</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="channelName">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="channelGroup"/>
</item>
<item row="1" column="3">
<widget class="QSpinBox" name="channelNumber">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="legend4">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Neutral</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QSpinBox" name="channelMin">
<property name="maximum">
<number>9999</number>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QSpinBox" name="channelNeutral">
<property name="maximum">
<number>9999</number>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QLabel" name="legend5">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Max</string>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QSpinBox" name="channelMax">
<property name="maximum">
<number>9999</number>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -35,7 +35,9 @@ void smartSaveButton::processClick()
connect(&timer,SIGNAL(timeout()),&loop,SLOT(quit()));
obj->updated();
timer.start(1000);
qDebug()<<"begin loop";
loop.exec();
qDebug()<<"end loop";
timer.stop();
disconnect(obj,SIGNAL(transactionCompleted(UAVObject*,bool)),this,SLOT(transaction_finished(UAVObject*, bool)));
disconnect(&timer,SIGNAL(timeout()),&loop,SLOT(quit()));