Commit 07a9ab08 authored by Michael Carpenter's avatar Michael Carpenter

Addition of Retract/Neutral/Control angles to CameraGimbal config screen

parent 50d01b95
......@@ -95,7 +95,54 @@ CameraGimbalConfig::CameraGimbalConfig(QWidget *parent) : AP2ConfigWidget(parent
connect(ui.shutterDurationSpinBox,SIGNAL(editingFinished()),this,SLOT(updateShutter()));
connect(ui.shutterChannelComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(updateShutter()));
connect(ui.retractXSpinBox,SIGNAL(editingFinished()),this,SLOT(updateRetractAngles()));
connect(ui.retractYSpinBox,SIGNAL(editingFinished()),this,SLOT(updateRetractAngles()));
connect(ui.retractZSpinBox,SIGNAL(editingFinished()),this,SLOT(updateRetractAngles()));
connect(ui.controlXSpinBox,SIGNAL(editingFinished()),this,SLOT(updateControlAngles()));
connect(ui.controlYSpinBox,SIGNAL(editingFinished()),this,SLOT(updateControlAngles()));
connect(ui.controlZSpinBox,SIGNAL(editingFinished()),this,SLOT(updateControlAngles()));
connect(ui.neutralXSpinBox,SIGNAL(editingFinished()),this,SLOT(updateNeutralAngles()));
connect(ui.neutralYSpinBox,SIGNAL(editingFinished()),this,SLOT(updateNeutralAngles()));
connect(ui.neutralZSpinBox,SIGNAL(editingFinished()),this,SLOT(updateNeutralAngles()));
}
void CameraGimbalConfig::updateRetractAngles()
{
if (!m_uas)
{
showNullMAVErrorMessageBox();
return;
}
m_uas->getParamManager()->setParameter(1,"MNT_RETRACT_X",ui.retractXSpinBox->value());
m_uas->getParamManager()->setParameter(1,"MNT_RETRACT_Y",ui.retractYSpinBox->value());
m_uas->getParamManager()->setParameter(1,"MNT_RETRACT_Z",ui.retractZSpinBox->value());
}
void CameraGimbalConfig::updateNeutralAngles()
{
if (!m_uas)
{
showNullMAVErrorMessageBox();
return;
}
m_uas->getParamManager()->setParameter(1,"MNT_NEUTRAL_X",ui.neutralXSpinBox->value());
m_uas->getParamManager()->setParameter(1,"MNT_NEUTRAL_Y",ui.neutralYSpinBox->value());
m_uas->getParamManager()->setParameter(1,"MNT_NEUTRAL_Z",ui.neutralZSpinBox->value());
}
void CameraGimbalConfig::updateControlAngles()
{
if (!m_uas)
{
showNullMAVErrorMessageBox();
return;
}
m_uas->getParamManager()->setParameter(1,"MNT_CONTROL_X",ui.controlXSpinBox->value());
m_uas->getParamManager()->setParameter(1,"MNT_CONTROL_Y",ui.controlYSpinBox->value());
m_uas->getParamManager()->setParameter(1,"MNT_CONTROL_Z",ui.controlZSpinBox->value());
}
void CameraGimbalConfig::updateTilt()
......
......@@ -18,7 +18,9 @@ private slots:
void updateRoll();
void updatePan();
void updateShutter();
void updateRetractAngles();
void updateNeutralAngles();
void updateControlAngles();
private:
Ui::CameraGimbalConfig ui;
QString m_shutterPrefix;
......
......@@ -123,7 +123,7 @@
<item row="0" column="3" colspan="2">
<widget class="QCheckBox" name="tiltStabilizeCheckBox">
<property name="text">
<string>CheckBox</string>
<string>Stabilize Tilt</string>
</property>
</widget>
</item>
......@@ -191,7 +191,7 @@
<number>100</number>
</property>
<property name="value">
<number>-100</number>
<number>0</number>
</property>
</widget>
</item>
......@@ -297,7 +297,7 @@
<item row="0" column="3" colspan="2">
<widget class="QCheckBox" name="rollStabilizeCheckBox">
<property name="text">
<string>CheckBox</string>
<string>Stabilize Roll</string>
</property>
</widget>
</item>
......@@ -471,7 +471,7 @@
<item row="0" column="3" colspan="2">
<widget class="QCheckBox" name="panStabilizeCheckBox">
<property name="text">
<string>CheckBox</string>
<string>Stabilize Pan</string>
</property>
</widget>
</item>
......@@ -726,15 +726,236 @@
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>720</x>
<y>70</y>
<width>120</width>
<height>80</height>
<x>590</x>
<y>60</y>
<width>171</width>
<height>131</height>
</rect>
</property>
<property name="title">
<string>Retract Angles</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_33">
<property name="text">
<string>X</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_41">
<property name="text">
<string>Y</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_30">
<property name="text">
<string>Z</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QSpinBox" name="retractXSpinBox">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="retractYSpinBox">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="retractZSpinBox">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">
<rect>
<x>590</x>
<y>210</y>
<width>171</width>
<height>131</height>
</rect>
</property>
<property name="title">
<string>GroupBox</string>
<string>Neutral Angles</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label_42">
<property name="text">
<string>X</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_43">
<property name="text">
<string>Y</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_44">
<property name="text">
<string>Z</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QSpinBox" name="neutralXSpinBox">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="neutralYSpinBox">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="neutralZSpinBox">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_3">
<property name="geometry">
<rect>
<x>590</x>
<y>360</y>
<width>171</width>
<height>131</height>
</rect>
</property>
<property name="title">
<string>Control Angles</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QLabel" name="label_45">
<property name="text">
<string>X</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_46">
<property name="text">
<string>Y</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_47">
<property name="text">
<string>Z</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QSpinBox" name="controlXSpinBox">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="controlYSpinBox">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="controlZSpinBox">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<resources>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment