mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Implemented UI code for new ccpm options checkboxes and sliders
This commit is contained in:
parent
86f5d63045
commit
6ad60a7971
@ -843,7 +843,7 @@
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="ccmpCollectivePassthrough">
|
||||
<widget class="QCheckBox" name="ccpmCollectivePassthrough">
|
||||
<property name="text">
|
||||
<string>Collective Pass through</string>
|
||||
</property>
|
||||
@ -870,12 +870,12 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<layout class="QHBoxLayout" name="ccpmCollectiveChannelBox">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="ccpmEngineLabel_2">
|
||||
<widget class="QLabel" name="ccpmCollectiveChLabel">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@ -900,12 +900,15 @@
|
||||
<property name="text">
|
||||
<string>Collective Ch</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="ccpmCollectiveChannel">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1003,7 +1006,7 @@
|
||||
<item>
|
||||
<widget class="QSlider" name="ccpmRevoSlider">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
@ -1430,7 +1433,7 @@
|
||||
<item>
|
||||
<widget class="QSlider" name="ccpmCyclicScale">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
@ -1548,7 +1551,7 @@
|
||||
<item>
|
||||
<widget class="QSlider" name="ccpmRollScale">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
@ -1666,7 +1669,7 @@
|
||||
<item>
|
||||
<widget class="QSlider" name="ccpmCollectiveScale">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
@ -1784,7 +1787,7 @@
|
||||
<item>
|
||||
<widget class="QSlider" name="ccpmPitchScale">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
|
@ -185,6 +185,8 @@ ConfigccpmWidget::ConfigccpmWidget(QWidget *parent) : ConfigTaskWidget(parent)
|
||||
m_ccpm->ccpmServoYChannel->setCurrentIndex(8);
|
||||
m_ccpm->ccpmServoZChannel->addItems(channels);
|
||||
m_ccpm->ccpmServoZChannel->setCurrentIndex(8);
|
||||
m_ccpm->ccpmCollectiveChannel->addItems(channels);
|
||||
m_ccpm->ccpmCollectiveChannel->setCurrentIndex(8);
|
||||
|
||||
QStringList Types;
|
||||
Types << "CCPM 2 Servo 90º" << "CCPM 3 Servo 120º" << "CCPM 3 Servo 140º" << "FP 2 Servo 90º" << "Custom - User Angles" << "Custom - Advanced Settings" ;
|
||||
@ -197,6 +199,8 @@ ConfigccpmWidget::ConfigccpmWidget(QWidget *parent) : ConfigTaskWidget(parent)
|
||||
//disable changing number of points in curves until UAVObjects have more than 5
|
||||
m_ccpm->NumCurvePoints->setEnabled(0);
|
||||
|
||||
|
||||
|
||||
UpdateType();
|
||||
|
||||
//connect(m_ccpm->saveccpmToSD, SIGNAL(clicked()), this, SLOT(saveccpmUpdate()));
|
||||
@ -237,6 +241,12 @@ ConfigccpmWidget::ConfigccpmWidget(QWidget *parent) : ConfigTaskWidget(parent)
|
||||
connect(m_ccpm->SwashLvlCancelButton, SIGNAL(clicked()), this, SLOT(SwashLvlCancelButtonPressed()));
|
||||
connect(m_ccpm->SwashLvlFinishButton, SIGNAL(clicked()), this, SLOT(SwashLvlFinishButtonPressed()));
|
||||
|
||||
connect(m_ccpm->ccpmCollectivePassthrough, SIGNAL(clicked()), this, SLOT(UpdatCCPMUIOptions()));
|
||||
connect(m_ccpm->ccpmLinkCyclic, SIGNAL(clicked()), this, SLOT(UpdatCCPMUIOptions()));
|
||||
connect(m_ccpm->ccpmLinkRoll, SIGNAL(clicked()), this, SLOT(UpdatCCPMUIOptions()));
|
||||
|
||||
|
||||
|
||||
|
||||
// connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestccpmUpdate()));
|
||||
|
||||
@ -253,6 +263,7 @@ void ConfigccpmWidget::UpdateType()
|
||||
QString TypeText;
|
||||
double AdjustmentAngle=0;
|
||||
|
||||
UpdatCCPMUIOptions();
|
||||
|
||||
TypeInt = m_ccpm->ccpmType->count() - m_ccpm->ccpmType->currentIndex()-1;
|
||||
TypeText = m_ccpm->ccpmType->currentText();
|
||||
@ -362,6 +373,9 @@ void ConfigccpmWidget::UpdateType()
|
||||
m_ccpm->ccpmAdvancedSettingsTable->verticalHeader()->width())/6);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//update UI
|
||||
ccpmSwashplateUpdate();
|
||||
|
||||
@ -827,6 +841,47 @@ void ConfigccpmWidget::UpdateMixer()
|
||||
/**************************
|
||||
* ccpm settings
|
||||
**************************/
|
||||
/*
|
||||
Get the state of the UI check boxes and change the visibility of sliders
|
||||
*/
|
||||
void ConfigccpmWidget::UpdatCCPMUIOptions()
|
||||
{
|
||||
int ccpmCollectivePassthroughState;
|
||||
int ccpmLinkCyclicState;
|
||||
int ccpmLinkRollState;
|
||||
|
||||
//get the user options
|
||||
ccpmCollectivePassthroughState=m_ccpm->ccpmCollectivePassthrough->isChecked();
|
||||
ccpmLinkCyclicState=m_ccpm->ccpmLinkCyclic->isChecked();
|
||||
ccpmLinkRollState=m_ccpm->ccpmLinkRoll->isChecked();
|
||||
|
||||
//set which sliders are user...
|
||||
m_ccpm->ccpmRevoMixingBox->setVisible(0);
|
||||
|
||||
m_ccpm->ccpmPitchMixingBox->setVisible(!ccpmCollectivePassthroughState&&ccpmLinkCyclicState);
|
||||
m_ccpm->ccpmCollectiveScalingBox->setVisible(ccpmCollectivePassthroughState||!ccpmLinkCyclicState);
|
||||
|
||||
m_ccpm->ccpmCollectiveChLabel->setVisible(ccpmCollectivePassthroughState);
|
||||
m_ccpm->ccpmCollectiveChannel->setVisible(ccpmCollectivePassthroughState);
|
||||
|
||||
|
||||
|
||||
m_ccpm->ccpmCyclicScalingBox->setVisible((ccpmCollectivePassthroughState||!ccpmLinkCyclicState)&&ccpmLinkRollState);
|
||||
if (ccpmLinkCyclicState)
|
||||
{
|
||||
m_ccpm->ccpmPitchScalingBox->setVisible(0);
|
||||
m_ccpm->ccpmRollScalingBox->setVisible(0);
|
||||
m_ccpm->ccpmLinkRoll->setVisible(0);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ccpm->ccpmPitchScalingBox->setVisible(!ccpmLinkRollState);
|
||||
m_ccpm->ccpmRollScalingBox->setVisible(!ccpmLinkRollState);
|
||||
m_ccpm->ccpmLinkRoll->setVisible(1);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
Request the current value of the SystemSettings which holds the ccpm type
|
||||
*/
|
||||
|
@ -103,6 +103,8 @@ private:
|
||||
void SwashLvlCancelButtonPressed();
|
||||
void SwashLvlFinishButtonPressed();
|
||||
|
||||
void UpdatCCPMUIOptions();
|
||||
|
||||
void enableSwashplateLevellingControl(bool state);
|
||||
void setSwashplateLevel(int percent);
|
||||
void SwashLvlSpinBoxChanged(int value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user