1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Merge branch 'next' of ssh://git.openpilot.org/OpenPilot into pt/CC3D_Release

Conflicts:
	ground/openpilotgcs/src/plugins/config/camerastabilization.ui
	ground/openpilotgcs/src/plugins/config/configcamerastabilizationwidget.cpp
	ground/openpilotgcs/src/plugins/config/configcamerastabilizationwidget.h
	ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp
This commit is contained in:
PT_Dreamer 2012-08-21 17:05:36 +01:00
commit 8bb94e052b
6 changed files with 1170 additions and 1256 deletions

View File

@ -6,855 +6,808 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>820</width> <width>720</width>
<height>845</height> <height>739</height>
</rect> </rect>
</property> </property>
<property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<property name="autoFillBackground"> <layout class="QVBoxLayout" name="verticalLayout_3">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6" stretch="0,0,0">
<property name="spacing">
<number>12</number>
</property>
<property name="margin">
<number>12</number>
</property>
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QScrollArea" name="scrollArea">
<property name="autoFillBackground"> <property name="frameShape">
<bool>false</bool> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="currentIndex"> <property name="widgetResizable">
<number>0</number> <bool>true</bool>
</property> </property>
<property name="elideMode"> <widget class="QWidget" name="scrollAreaWidgetContents_2">
<enum>Qt::ElideMiddle</enum> <property name="geometry">
</property> <rect>
<widget class="QWidget" name="CameraStabilization"> <x>0</x>
<property name="autoFillBackground"> <y>0</y>
<bool>false</bool> <width>702</width>
<height>660</height>
</rect>
</property> </property>
<attribute name="title"> <layout class="QVBoxLayout" name="verticalLayout_2">
<string>Camera Stabilization</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>12</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item> <item>
<widget class="QScrollArea" name="scrollArea"> <widget class="QCheckBox" name="enableCameraStabilization">
<property name="palette"> <property name="focusPolicy">
<palette> <enum>Qt::StrongFocus</enum>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property> </property>
<property name="autoFillBackground"> <property name="text">
<bool>false</bool> <string>Enable CameraStabilization module</string>
</property> </property>
<property name="frameShape"> </widget>
<enum>QFrame::NoFrame</enum> </item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>After enabling the module, you must power cycle before using and configuring.</string>
</property> </property>
<property name="frameShadow"> </widget>
<enum>QFrame::Plain</enum> </item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="widgetResizable"> </widget>
<bool>true</bool> </item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents_2"> <property name="sizeType">
<property name="geometry"> <enum>QSizePolicy::Preferred</enum>
<rect> </property>
<x>0</x> <property name="sizeHint" stdset="0">
<y>0</y> <size>
<width>790</width> <width>20</width>
<height>678</height> <height>10</height>
</rect> </size>
</property> </property>
<property name="autoFillBackground"> </spacer>
<bool>true</bool> </item>
</property> <item>
<layout class="QVBoxLayout" name="verticalLayout_3"> <widget class="QGroupBox" name="groupBox_5">
<property name="spacing"> <property name="sizePolicy">
<number>12</number> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
</property> <horstretch>0</horstretch>
<item> <verstretch>0</verstretch>
<widget class="QGroupBox" name="groupBox_4"> </sizepolicy>
<property name="title"> </property>
<string/> <property name="minimumSize">
</property> <size>
<layout class="QVBoxLayout" name="verticalLayout_2"> <width>0</width>
<property name="leftMargin"> <height>100</height>
<number>12</number> </size>
</property> </property>
<item> <property name="title">
<widget class="QCheckBox" name="enableCameraStabilization"> <string>Basic Settings (Stabilization)</string>
<property name="focusPolicy"> </property>
<enum>Qt::StrongFocus</enum> <layout class="QGridLayout" name="gridLayout_9">
</property> <item row="2" column="3">
<property name="text"> <widget class="QSpinBox" name="yawOutputRange">
<string>Enable CameraStabilization module</string> <property name="focusPolicy">
</property> <enum>Qt::StrongFocus</enum>
</widget> </property>
</item> <property name="toolTip">
<item> <string>Camera yaw angle for 100% output value, deg.
<widget class="QLabel" name="label_7">
<property name="text">
<string>After enabling you must power cycle your board before using and configuring</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>131</height>
</size>
</property>
<property name="title">
<string>Basic Settings (Stabilization)</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_9">
<property name="leftMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<item row="3" column="3">
<widget class="QSpinBox" name="yawOutputRange">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Camera yaw angle for 100% output value, deg.
This value should be tuned for particular gimbal and servo. You also This value should be tuned for particular gimbal and servo. You also
have to define channel output range using Output configuration tab.</string> have to define channel output range using Output configuration tab.</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>180</number> <number>180</number>
</property> </property>
<property name="value"> <property name="value">
<number>20</number> <number>20</number>
</property> </property>
</widget> <property name="objrelation" stdset="0">
</item> <stringlist>
<item row="3" column="2"> <string>objname:CameraStabSettings</string>
<widget class="QSpinBox" name="pitchOutputRange"> <string>fieldname:OutputRange</string>
<property name="focusPolicy"> <string>element:Yaw</string>
<enum>Qt::StrongFocus</enum> <string>haslimits:no</string>
</property> <string>scale:1</string>
<property name="toolTip"> <string>buttongroup:1</string>
<string>Camera pitch angle for 100% output value, deg. </stringlist>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QSpinBox" name="pitchOutputRange">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Camera pitch angle for 100% output value, deg.
This value should be tuned for particular gimbal and servo. You also This value should be tuned for particular gimbal and servo. You also
have to define channel output range using Output configuration tab.</string> have to define channel output range using Output configuration tab.</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>180</number> <number>180</number>
</property> </property>
<property name="value"> <property name="value">
<number>20</number> <number>20</number>
</property> </property>
</widget> <property name="objrelation" stdset="0">
</item> <stringlist>
<item row="3" column="1"> <string>objname:CameraStabSettings</string>
<widget class="QSpinBox" name="rollOutputRange"> <string>fieldname:OutputRange</string>
<property name="focusPolicy"> <string>element:Pitch</string>
<enum>Qt::StrongFocus</enum> <string>haslimits:no</string>
</property> <string>scale:1</string>
<property name="toolTip"> <string>buttongroup:1</string>
<string>Camera roll angle for 100% output value, deg. </stringlist>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="rollOutputRange">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Camera roll angle for 100% output value, deg.
This value should be tuned for particular gimbal and servo. You also This value should be tuned for particular gimbal and servo. You also
have to define channel output range using Output configuration tab.</string> have to define channel output range using Output configuration tab.</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>180</number> <number>180</number>
</property> </property>
<property name="value"> <property name="value">
<number>20</number> <number>20</number>
</property> </property>
</widget> <property name="objrelation" stdset="0">
</item> <stringlist>
<item row="2" column="3"> <string>objname:CameraStabSettings</string>
<widget class="QComboBox" name="yawChannel"> <string>fieldname:OutputRange</string>
<property name="focusPolicy"> <string>element:Roll</string>
<enum>Qt::StrongFocus</enum> <string>haslimits:no</string>
</property> <string>scale:1</string>
<property name="toolTip"> <string>buttongroup:1</string>
<string>Yaw output channel for camera gimbal</string> </stringlist>
</property> </property>
<item> </widget>
<property name="text"> </item>
<string>None</string> <item row="1" column="3">
</property> <widget class="QComboBox" name="yawChannel">
</item> <property name="focusPolicy">
</widget> <enum>Qt::StrongFocus</enum>
</item> </property>
<item row="2" column="2"> <property name="toolTip">
<widget class="QComboBox" name="pitchChannel"> <string>Yaw output channel for camera gimbal</string>
<property name="focusPolicy"> </property>
<enum>Qt::StrongFocus</enum> <item>
</property> <property name="text">
<property name="toolTip"> <string>None</string>
<string>Pitch output channel for camera gimbal</string> </property>
</property> </item>
<item> </widget>
<property name="text"> </item>
<string>None</string> <item row="1" column="2">
</property> <widget class="QComboBox" name="pitchChannel">
</item> <property name="focusPolicy">
</widget> <enum>Qt::StrongFocus</enum>
</item> </property>
<item row="2" column="1"> <property name="toolTip">
<widget class="QComboBox" name="rollChannel"> <string>Pitch output channel for camera gimbal</string>
<property name="focusPolicy"> </property>
<enum>Qt::StrongFocus</enum> <item>
</property> <property name="text">
<property name="toolTip"> <string>None</string>
<string>Roll output channel for camera gimbal</string> </property>
</property> </item>
<item> </widget>
<property name="text"> </item>
<string>None</string> <item row="1" column="1">
</property> <widget class="QComboBox" name="rollChannel">
</item> <property name="focusPolicy">
</widget> <enum>Qt::StrongFocus</enum>
</item> </property>
<item row="2" column="0"> <property name="toolTip">
<widget class="QLabel" name="label_42"> <string>Roll output channel for camera gimbal</string>
<property name="text"> </property>
<string>Output Channel</string> <item>
</property> <property name="text">
</widget> <string>None</string>
</item> </property>
<item row="3" column="0"> </item>
<widget class="QLabel" name="label_43"> </widget>
<property name="text"> </item>
<string>Output Range</string> <item row="1" column="0">
</property> <widget class="QLabel" name="label_42">
</widget> <property name="text">
</item> <string>Output Channel</string>
<item row="1" column="3"> </property>
<widget class="QLabel" name="label_44"> </widget>
<property name="sizePolicy"> </item>
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <item row="2" column="0">
<horstretch>0</horstretch> <widget class="QLabel" name="label_43">
<verstretch>0</verstretch> <property name="text">
</sizepolicy> <string>Output Range</string>
</property> </property>
<property name="minimumSize"> </widget>
<size> </item>
<width>0</width> <item row="0" column="3">
<height>16</height> <widget class="QLabel" name="label_44">
</size> <property name="styleSheet">
</property> <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
border-radius: 5; border-radius: 5;
font: bold 12px; font: bold 12px;
margin:1px;</string> margin:1px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Yaw</string> <string>Yaw</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="0" column="2">
<widget class="QLabel" name="label_45"> <widget class="QLabel" name="label_45">
<property name="sizePolicy"> <property name="styleSheet">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
border-radius: 5; border-radius: 5;
font: bold 12px; font: bold 12px;
margin:1px;</string> margin:1px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Pitch</string> <string>Pitch</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="0" column="1">
<widget class="QLabel" name="label_46"> <widget class="QLabel" name="label_46">
<property name="sizePolicy"> <property name="styleSheet">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
border-radius: 5; border-radius: 5;
font: bold 12px; font: bold 12px;
margin:1px;</string> margin:1px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Roll</string> <string>Roll</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="Line" name="line"> <widget class="QGroupBox" name="groupBox">
<property name="enabled"> <property name="sizePolicy">
<bool>true</bool> <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
</property> <horstretch>0</horstretch>
<property name="orientation"> <verstretch>0</verstretch>
<enum>Qt::Horizontal</enum> </sizepolicy>
</property> </property>
</widget> <property name="minimumSize">
</item> <size>
<item> <width>0</width>
<spacer name="verticalSpacer_3"> <height>204</height>
<property name="orientation"> </size>
<enum>Qt::Vertical</enum> </property>
</property> <property name="title">
<property name="sizeType"> <string>Advanced Settings (Control)</string>
<enum>QSizePolicy::Preferred</enum> </property>
</property> <layout class="QGridLayout" name="gridLayout_8">
<property name="sizeHint" stdset="0"> <item row="0" column="3">
<size> <widget class="QLabel" name="label_32">
<width>20</width> <property name="styleSheet">
<height>10</height> <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>266</height>
</size>
</property>
<property name="title">
<string>Advanced Settings (Control)</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<property name="leftMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<item row="1" column="3">
<widget class="QLabel" name="label_32">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
border-radius: 5; border-radius: 5;
font: bold 12px; font: bold 12px;
margin:1px;</string> margin:1px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Yaw</string> <string>Yaw</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="0" column="2">
<widget class="QLabel" name="label_33"> <widget class="QLabel" name="label_33">
<property name="sizePolicy"> <property name="styleSheet">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
border-radius: 5; border-radius: 5;
font: bold 12px; font: bold 12px;
margin:1px;</string> margin:1px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Pitch</string> <string>Pitch</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="0" column="1">
<widget class="QLabel" name="label_34"> <widget class="QLabel" name="label_34">
<property name="sizePolicy"> <property name="styleSheet">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
border-radius: 5; border-radius: 5;
font: bold 12px; font: bold 12px;
margin:1px;</string> margin:1px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Roll</string> <string>Roll</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="1" column="3">
<widget class="QComboBox" name="yawInputChannel"> <widget class="QComboBox" name="yawInputChannel">
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Input channel to control camera yaw <string>Input channel to control camera yaw
Don't forget to map this channel using Input configuration tab.</string> Don't forget to map this channel using Input configuration tab.</string>
</property> </property>
<item> <property name="objrelation" stdset="0">
<property name="text"> <stringlist>
<string>None</string> <string>objname:CameraStabSettings</string>
</property> <string>fieldname:Input</string>
</item> <string>element:Yaw</string>
</widget> <string>buttongroup:1</string>
</item> </stringlist>
<item row="2" column="2"> </property>
<widget class="QComboBox" name="pitchInputChannel"> <item>
<property name="focusPolicy"> <property name="text">
<enum>Qt::StrongFocus</enum> <string>None</string>
</property> </property>
<property name="toolTip"> </item>
<string>Input channel to control camera pitch </widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="pitchInputChannel">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Input channel to control camera pitch
Don't forget to map this channel using Input configuration tab.</string> Don't forget to map this channel using Input configuration tab.</string>
</property> </property>
<item> <property name="objrelation" stdset="0">
<property name="text"> <stringlist>
<string>None</string> <string>objname:CameraStabSettings</string>
</property> <string>fieldname:Input</string>
</item> <string>element:Pitch</string>
</widget> <string>buttongroup:1</string>
</item> </stringlist>
<item row="2" column="1"> </property>
<widget class="QComboBox" name="rollInputChannel"> <item>
<property name="focusPolicy"> <property name="text">
<enum>Qt::StrongFocus</enum> <string>None</string>
</property> </property>
<property name="toolTip"> </item>
<string>Input channel to control camera roll </widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="rollInputChannel">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Input channel to control camera roll
Don't forget to map this channel using Input configuration tab.</string> Don't forget to map this channel using Input configuration tab.</string>
</property> </property>
<item> <property name="objrelation" stdset="0">
<property name="text"> <stringlist>
<string>None</string> <string>objname:CameraStabSettings</string>
</property> <string>fieldname:Input</string>
</item> <string>element:Roll</string>
</widget> <string>buttongroup:1</string>
</item> </stringlist>
<item row="2" column="0"> </property>
<widget class="QLabel" name="label_35"> <item>
<property name="text"> <property name="text">
<string>Input Channel</string> <string>None</string>
</property> </property>
</widget> </item>
</item> </widget>
<item row="3" column="3"> </item>
<widget class="QComboBox" name="yawStabilizationMode"> <item row="1" column="0">
<property name="focusPolicy"> <widget class="QLabel" name="label_35">
<enum>Qt::StrongFocus</enum> <property name="text">
</property> <string>Input Channel</string>
<property name="toolTip"> </property>
<string>Axis stabilization mode </widget>
</item>
<item row="2" column="3">
<widget class="QComboBox" name="yawStabilizationMode">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Axis stabilization mode
Attitude: camera tracks level for the axis. Input controls the deflection. Attitude: camera tracks level for the axis. Input controls the deflection.
AxisLock: camera remembers tracking attitude. Input controls the rate of deflection.</string> AxisLock: camera remembers tracking attitude. Input controls the rate of deflection.</string>
</property> </property>
<item> <property name="objrelation" stdset="0">
<property name="text"> <stringlist>
<string>Attitude</string> <string>objname:CameraStabSettings</string>
</property> <string>fieldname:StabilizationMode</string>
</item> <string>element:Yaw</string>
</widget> <string>buttongroup:1</string>
</item> </stringlist>
<item row="4" column="3"> </property>
<widget class="QSpinBox" name="yawInputRange"> <item>
<property name="focusPolicy"> <property name="text">
<enum>Qt::StrongFocus</enum> <string>Attitude</string>
</property> </property>
<property name="toolTip"> </item>
<string>Maximum camera yaw deflection for 100% input in Attitude mode, deg.</string> </widget>
</property> </item>
<property name="maximum"> <item row="3" column="3">
<number>180</number> <widget class="QSpinBox" name="yawInputRange">
</property> <property name="focusPolicy">
<property name="value"> <enum>Qt::StrongFocus</enum>
<number>20</number> </property>
</property> <property name="toolTip">
</widget> <string>Maximum camera yaw deflection for 100% input in Attitude mode, deg.</string>
</item> </property>
<item row="5" column="3"> <property name="maximum">
<widget class="QSpinBox" name="yawInputRate"> <number>180</number>
<property name="focusPolicy"> </property>
<enum>Qt::StrongFocus</enum> <property name="value">
</property> <number>20</number>
<property name="toolTip"> </property>
<string>Maximum camera yaw rate for 100% input in AxisLock mode, deg/s.</string> <property name="objrelation" stdset="0">
</property> <stringlist>
<property name="maximum"> <string>objname:CameraStabSettings</string>
<number>180</number> <string>fieldname:InputRange</string>
</property> <string>element:Yaw</string>
<property name="value"> <string>haslimits:no</string>
<number>50</number> <string>scale:1</string>
</property> <string>buttongroup:1</string>
</widget> </stringlist>
</item> </property>
<item row="6" column="3"> </widget>
<widget class="QSpinBox" name="yawResponseTime"> </item>
<property name="focusPolicy"> <item row="4" column="3">
<enum>Qt::StrongFocus</enum> <widget class="QSpinBox" name="yawInputRate">
</property> <property name="focusPolicy">
<property name="toolTip"> <enum>Qt::StrongFocus</enum>
<string>Input low-pass filter response time for yaw axis, ms. </property>
<property name="toolTip">
<string>Maximum camera yaw rate for 100% input in AxisLock mode, deg/s.</string>
</property>
<property name="maximum">
<number>180</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:CameraStabSettings</string>
<string>fieldname:InputRate</string>
<string>element:Yaw</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:1</string>
</stringlist>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QSpinBox" name="yawResponseTime">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Input low-pass filter response time for yaw axis, ms.
This option smoothes the stick input. Zero value disables LPF.</string> This option smoothes the stick input. Zero value disables LPF.</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>1000</number> <number>1000</number>
</property> </property>
<property name="value"> <property name="value">
<number>150</number> <number>150</number>
</property> </property>
</widget> <property name="objrelation" stdset="0">
</item> <stringlist>
<item row="3" column="2"> <string>objname:CameraStabSettings</string>
<widget class="QComboBox" name="pitchStabilizationMode"> <string>fieldname:ResponseTime</string>
<property name="focusPolicy"> <string>element:Yaw</string>
<enum>Qt::StrongFocus</enum> <string>haslimits:no</string>
</property> <string>scale:1</string>
<property name="toolTip"> <string>buttongroup:1</string>
<string>Axis stabilization mode </stringlist>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="pitchStabilizationMode">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Axis stabilization mode
Attitude: camera tracks level for the axis. Input controls the deflection. Attitude: camera tracks level for the axis. Input controls the deflection.
AxisLock: camera remembers tracking attitude. Input controls the rate of deflection.</string> AxisLock: camera remembers tracking attitude. Input controls the rate of deflection.</string>
</property> </property>
<item> <property name="objrelation" stdset="0">
<property name="text"> <stringlist>
<string>Attitude</string> <string>objname:CameraStabSettings</string>
</property> <string>fieldname:StabilizationMode</string>
</item> <string>element:Pitch</string>
</widget> <string>buttongroup:1</string>
</item> </stringlist>
<item row="4" column="2"> </property>
<widget class="QSpinBox" name="pitchInputRange"> <item>
<property name="focusPolicy"> <property name="text">
<enum>Qt::StrongFocus</enum> <string>Attitude</string>
</property> </property>
<property name="toolTip"> </item>
<string>Maximum camera pitch deflection for 100% input in Attitude mode, deg.</string> </widget>
</property> </item>
<property name="maximum"> <item row="3" column="2">
<number>180</number> <widget class="QSpinBox" name="pitchInputRange">
</property> <property name="focusPolicy">
<property name="value"> <enum>Qt::StrongFocus</enum>
<number>20</number> </property>
</property> <property name="toolTip">
</widget> <string>Maximum camera pitch deflection for 100% input in Attitude mode, deg.</string>
</item> </property>
<item row="5" column="2"> <property name="maximum">
<widget class="QSpinBox" name="pitchInputRate"> <number>180</number>
<property name="focusPolicy"> </property>
<enum>Qt::StrongFocus</enum> <property name="value">
</property> <number>20</number>
<property name="toolTip"> </property>
<string>Maximum camera pitch rate for 100% input in AxisLock mode, deg/s.</string> <property name="objrelation" stdset="0">
</property> <stringlist>
<property name="maximum"> <string>objname:CameraStabSettings</string>
<number>180</number> <string>fieldname:InputRange</string>
</property> <string>element:Pitch</string>
<property name="value"> <string>haslimits:no</string>
<number>50</number> <string>scale:1</string>
</property> <string>buttongroup:1</string>
</widget> </stringlist>
</item> </property>
<item row="6" column="2"> </widget>
<widget class="QSpinBox" name="pitchResponseTime"> </item>
<property name="focusPolicy"> <item row="4" column="2">
<enum>Qt::StrongFocus</enum> <widget class="QSpinBox" name="pitchInputRate">
</property> <property name="focusPolicy">
<property name="toolTip"> <enum>Qt::StrongFocus</enum>
<string>Input low-pass filter response time for pitch axis, ms. </property>
<property name="toolTip">
<string>Maximum camera pitch rate for 100% input in AxisLock mode, deg/s.</string>
</property>
<property name="maximum">
<number>180</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:CameraStabSettings</string>
<string>fieldname:InputRate</string>
<string>element:Pitch</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:1</string>
</stringlist>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QSpinBox" name="pitchResponseTime">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Input low-pass filter response time for pitch axis, ms.
This option smoothes the stick input. Zero value disables LPF.</string> This option smoothes the stick input. Zero value disables LPF.</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>1000</number> <number>1000</number>
</property> </property>
<property name="value"> <property name="value">
<number>150</number> <number>150</number>
</property> </property>
</widget> <property name="objrelation" stdset="0">
</item> <stringlist>
<item row="3" column="1"> <string>objname:CameraStabSettings</string>
<widget class="QComboBox" name="rollStabilizationMode"> <string>fieldname:ResponseTime</string>
<property name="focusPolicy"> <string>element:Pitch</string>
<enum>Qt::StrongFocus</enum> <string>haslimits:no</string>
</property> <string>scale:1</string>
<property name="toolTip"> <string>buttongroup:1</string>
<string>Axis stabilization mode </stringlist>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="rollStabilizationMode">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Axis stabilization mode
Attitude: camera tracks level for the axis. Input controls the deflection. Attitude: camera tracks level for the axis. Input controls the deflection.
AxisLock: camera remembers tracking attitude. Input controls the rate of deflection.</string> AxisLock: camera remembers tracking attitude. Input controls the rate of deflection.</string>
</property> </property>
<item> <property name="objrelation" stdset="0">
<property name="text"> <stringlist>
<string>Attitude</string> <string>objname:CameraStabSettings</string>
</property> <string>fieldname:StabilizationMode</string>
</item> <string>element:Roll</string>
</widget> <string>buttongroup:1</string>
</item> </stringlist>
<item row="4" column="1"> </property>
<widget class="QSpinBox" name="rollInputRange"> <item>
<property name="focusPolicy"> <property name="text">
<enum>Qt::StrongFocus</enum> <string>Attitude</string>
</property> </property>
<property name="toolTip"> </item>
<string>Maximum camera roll deflection for 100% input in Attitude mode, deg.</string> </widget>
</property> </item>
<property name="maximum"> <item row="3" column="1">
<number>180</number> <widget class="QSpinBox" name="rollInputRange">
</property> <property name="focusPolicy">
<property name="value"> <enum>Qt::StrongFocus</enum>
<number>20</number> </property>
</property> <property name="toolTip">
</widget> <string>Maximum camera roll deflection for 100% input in Attitude mode, deg.</string>
</item> </property>
<item row="5" column="1"> <property name="maximum">
<widget class="QSpinBox" name="rollInputRate"> <number>180</number>
<property name="focusPolicy"> </property>
<enum>Qt::StrongFocus</enum> <property name="value">
</property> <number>20</number>
<property name="toolTip"> </property>
<string>Maximum camera roll rate for 100% input in AxisLock mode, deg/s.</string> <property name="objrelation" stdset="0">
</property> <stringlist>
<property name="maximum"> <string>objname:CameraStabSettings</string>
<number>180</number> <string>fieldname:InputRange</string>
</property> <string>element:Roll</string>
<property name="value"> <string>haslimits:no</string>
<number>50</number> <string>scale:1</string>
</property> <string>buttongroup:1</string>
</widget> </stringlist>
</item> </property>
<item row="6" column="1"> </widget>
<widget class="QSpinBox" name="rollResponseTime"> </item>
<property name="focusPolicy"> <item row="4" column="1">
<enum>Qt::StrongFocus</enum> <widget class="QSpinBox" name="rollInputRate">
</property> <property name="focusPolicy">
<property name="toolTip"> <enum>Qt::StrongFocus</enum>
<string>Input low-pass filter response time for roll axis, ms. </property>
<property name="toolTip">
<string>Maximum camera roll rate for 100% input in AxisLock mode, deg/s.</string>
</property>
<property name="maximum">
<number>180</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:CameraStabSettings</string>
<string>fieldname:InputRate</string>
<string>element:Roll</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:1</string>
</stringlist>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="rollResponseTime">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Input low-pass filter response time for roll axis, ms.
This option smoothes the stick input. Zero value disables LPF.</string> This option smoothes the stick input. Zero value disables LPF.</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>1000</number> <number>1000</number>
</property> </property>
<property name="value"> <property name="value">
<number>150</number> <number>150</number>
</property> </property>
</widget> <property name="objrelation" stdset="0">
</item> <stringlist>
<item row="7" column="0"> <string>objname:CameraStabSettings</string>
<widget class="QLabel" name="label_36"> <string>fieldname:ResponseTime</string>
<property name="text"> <string>element:Roll</string>
<string>MaxAxisLockRate</string> <string>haslimits:no</string>
</property> <string>scale:1</string>
</widget> <string>buttongroup:1</string>
</item> </stringlist>
<item row="6" column="0"> </property>
<widget class="QLabel" name="label_37"> </widget>
<property name="text"> </item>
<string>Response Time</string> <item row="6" column="0">
</property> <widget class="QLabel" name="label_36">
</widget> <property name="text">
</item> <string>MaxAxisLockRate</string>
<item row="5" column="0"> </property>
<widget class="QLabel" name="label_38"> </widget>
<property name="text"> </item>
<string>Input Rate</string> <item row="5" column="0">
</property> <widget class="QLabel" name="label_37">
</widget> <property name="text">
</item> <string>Response Time</string>
<item row="4" column="0"> </property>
<widget class="QLabel" name="label_39"> </widget>
<property name="text"> </item>
<string>Input Range</string> <item row="4" column="0">
</property> <widget class="QLabel" name="label_38">
</widget> <property name="text">
</item> <string>Input Rate</string>
<item row="3" column="0"> </property>
<widget class="QLabel" name="label_40"> </widget>
<property name="text"> </item>
<string>Stabilization Mode</string> <item row="3" column="0">
</property> <widget class="QLabel" name="label_39">
</widget> <property name="text">
</item> <string>Input Range</string>
<item row="7" column="2" colspan="2"> </property>
<widget class="QLabel" name="label_41"> </widget>
<property name="text"> </item>
<string>(the same value for Roll, Pitch, Yaw)</string> <item row="2" column="0">
</property> <widget class="QLabel" name="label_40">
</widget> <property name="text">
</item> <string>Stabilization Mode</string>
<item row="7" column="1"> </property>
<widget class="QDoubleSpinBox" name="MaxAxisLockRate"> </widget>
<property name="focusPolicy"> </item>
<enum>Qt::StrongFocus</enum> <item row="6" column="2" colspan="2">
</property> <widget class="QLabel" name="label_41">
<property name="toolTip"> <property name="text">
<string>Stick input deadband for all axes in AxisLock mode, deg/s. <string>(the same value for Roll, Pitch, Yaw)</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="MaxAxisLockRate">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Stick input deadband for all axes in AxisLock mode, deg/s.
When stick input is within the MaxAxisLockRate range, camera tracks When stick input is within the MaxAxisLockRate range, camera tracks
current attitude. Otherwise it starts moving according to input with current attitude. Otherwise it starts moving according to input with
@ -862,222 +815,211 @@ rate depending on input value.
If you have drift in your Tx controls, you may want to increase this If you have drift in your Tx controls, you may want to increase this
value.</string> value.</string>
</property> </property>
<property name="decimals"> <property name="decimals">
<number>1</number> <number>1</number>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.100000000000000</double> <double>0.100000000000000</double>
</property> </property>
<property name="value"> <property name="value">
<double>1.000000000000000</double> <double>1.000000000000000</double>
</property> </property>
</widget> <property name="objrelation" stdset="0">
</item> <stringlist>
</layout> <string>objname:CameraStabSettings</string>
</widget> <string>fieldname:MaxAxisLockRate</string>
</item> <string>haslimits:no</string>
<item> <string>scale:1</string>
<spacer name="verticalSpacer"> <string>buttongroup:1</string>
<property name="orientation"> </stringlist>
<enum>Qt::Vertical</enum> </property>
</property> </widget>
<property name="sizeHint" stdset="0"> </item>
<size> </layout>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_3"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="autoFillBackground"> <item>
<bool>false</bool> <widget class="QLabel" name="message">
</property> <property name="text">
<property name="title"> <string/>
<string>Messages</string> </property>
</property> </widget>
<layout class="QHBoxLayout" name="horizontalLayout"> </item>
<property name="leftMargin"> <item>
<number>9</number> <layout class="QHBoxLayout" name="submitButtons">
</property> <item>
<item> <widget class="QFrame" name="frame">
<widget class="QLabel" name="message"> <property name="frameShape">
<property name="text"> <enum>QFrame::StyledPanel</enum>
<string/> </property>
</property> <property name="frameShadow">
</widget> <enum>QFrame::Raised</enum>
</item> </property>
</layout> </widget>
</widget> </item>
</item> <item>
<item> <spacer name="horizontalSpacer">
<widget class="QGroupBox" name="groupBox_2"> <property name="orientation">
<property name="sizePolicy"> <enum>Qt::Horizontal</enum>
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> </property>
<horstretch>0</horstretch> <property name="sizeHint" stdset="0">
<verstretch>0</verstretch> <size>
</sizepolicy> <width>40</width>
</property> <height>20</height>
<property name="minimumSize"> </size>
<size> </property>
<width>0</width> </spacer>
<height>45</height> </item>
</size> <item>
</property> <widget class="QPushButton" name="camerastabilizationHelp">
<property name="title"> <property name="sizePolicy">
<string/> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</property> <horstretch>0</horstretch>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <verstretch>0</verstretch>
<property name="spacing"> </sizepolicy>
<number>4</number> </property>
</property> <property name="maximumSize">
<property name="topMargin"> <size>
<number>0</number> <width>32</width>
</property> <height>32</height>
<property name="bottomMargin"> </size>
<number>0</number> </property>
</property> <property name="font">
<item> <font>
<spacer name="horizontalSpacer"> <kerning>true</kerning>
<property name="orientation"> </font>
<enum>Qt::Horizontal</enum> </property>
</property> <property name="text">
<property name="sizeHint" stdset="0"> <string/>
<size> </property>
<width>456</width> <property name="icon">
<height>20</height> <iconset resource="../coreplugin/core.qrc">
</size> <normaloff>:/core/images/helpicon.svg</normaloff>:/core/images/helpicon.svg</iconset>
</property> </property>
</spacer> <property name="iconSize">
</item> <size>
<item> <width>32</width>
<widget class="QPushButton" name="camerastabilizationHelp"> <height>32</height>
<property name="sizePolicy"> </size>
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> </property>
<horstretch>0</horstretch> <property name="shortcut">
<verstretch>0</verstretch> <string>Ctrl+S</string>
</sizepolicy> </property>
</property> <property name="default">
<property name="maximumSize"> <bool>false</bool>
<size> </property>
<width>32</width> <property name="flat">
<height>26</height> <bool>true</bool>
</size> </property>
</property> <property name="objrelation" stdset="0">
<property name="font"> <stringlist>
<font> <string>button:help</string>
<kerning>true</kerning> <string>url:http://wiki.openpilot.org/display/Doc/Camera+Stabilization+Configuration</string>
</font> </stringlist>
</property> </property>
<property name="text"> </widget>
<string/> </item>
</property> <item>
<property name="icon"> <widget class="QPushButton" name="camerastabilizationResetToDefaults">
<iconset resource="../coreplugin/core.qrc"> <property name="toolTip">
<normaloff>:/core/images/helpicon.svg</normaloff>:/core/images/helpicon.svg</iconset> <string>Load default CameraStabilization settings except output channels into GCS.
</property>
<property name="iconSize">
<size>
<width>25</width>
<height>25</height>
</size>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/x/cACrAQ</string>
</stringlist>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="camerastabilizationResetToDefaults">
<property name="minimumSize">
<size>
<width>140</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Load default CameraStabilization settings except output channels
Loaded settings are not applied automatically. You have to click the Loaded settings are not applied automatically. You have to click the
Apply or Save button afterwards.</string> Apply or Save button afterwards.</string>
</property> </property>
<property name="styleSheet"> <property name="text">
<string notr="true"/> <string>Reset To Defaults</string>
</property> </property>
<property name="text"> <property name="objrelation" stdset="0">
<string>Reset To Defaults</string> <stringlist>
</property> <string>button:default</string>
</widget> <string>buttongroup:1</string>
</item> </stringlist>
<item> </property>
<widget class="QPushButton" name="camerastabilizationSaveRAM"> </widget>
<property name="minimumSize"> </item>
<size> <item>
<width>78</width> <widget class="QPushButton" name="pushButton">
<height>16</height> <property name="toolTip">
</size> <string>Reloads saved CameraStabilization settings except output channels
</property> from board into GCS. Useful if you have accidentally changed some
<property name="toolTip"> settings.
<string>Send settings to the board but do not save to the non-volatile memory</string>
</property> Loaded settings are not applied automatically. You have to click the
<property name="styleSheet"> Apply or Save button afterwards.</string>
<string notr="true"/> </property>
</property> <property name="text">
<property name="text"> <string>Reload Board Data</string>
<string>Apply</string> </property>
</property> <property name="objrelation" stdset="0">
</widget> <stringlist>
</item> <string>button:reload</string>
<item> <string>buttongroup:1</string>
<widget class="QPushButton" name="camerastabilizationSaveSD"> </stringlist>
<property name="minimumSize"> </property>
<size> </widget>
<width>71</width> </item>
<height>16</height> <item>
</size> <widget class="QPushButton" name="camerastabilizationSaveRAM">
</property> <property name="toolTip">
<property name="toolTip"> <string>Send settings to the board but do not save to the non-volatile memory</string>
<string>Send settings to the board and save to the non-volatile memory</string> </property>
</property> <property name="text">
<property name="styleSheet"> <string>Apply</string>
<string notr="true"/> </property>
</property> <property name="objrelation" stdset="0">
<property name="text"> <stringlist>
<string>Save</string> <string>button:apply</string>
</property> </stringlist>
<property name="checked"> </property>
<bool>false</bool> </widget>
</property> </item>
</widget> <item>
</item> <widget class="QPushButton" name="camerastabilizationSaveSD">
</layout> <property name="toolTip">
</widget> <string>Send settings to the board and save to the non-volatile memory</string>
</property>
<property name="text">
<string>Save</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:save</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>enableCameraStabilization</tabstop>
<tabstop>rollChannel</tabstop> <tabstop>rollChannel</tabstop>
<tabstop>pitchChannel</tabstop> <tabstop>pitchChannel</tabstop>
<tabstop>yawChannel</tabstop> <tabstop>yawChannel</tabstop>
@ -1100,7 +1042,7 @@ Apply or Save button afterwards.</string>
<tabstop>pitchResponseTime</tabstop> <tabstop>pitchResponseTime</tabstop>
<tabstop>yawResponseTime</tabstop> <tabstop>yawResponseTime</tabstop>
<tabstop>MaxAxisLockRate</tabstop> <tabstop>MaxAxisLockRate</tabstop>
<tabstop>camerastabilizationResetToDefaults</tabstop> <tabstop>camerastabilizationHelp</tabstop>
<tabstop>camerastabilizationSaveRAM</tabstop> <tabstop>camerastabilizationSaveRAM</tabstop>
<tabstop>camerastabilizationSaveSD</tabstop> <tabstop>camerastabilizationSaveSD</tabstop>
<tabstop>scrollArea</tabstop> <tabstop>scrollArea</tabstop>

View File

@ -2,7 +2,7 @@
****************************************************************************** ******************************************************************************
* *
* @file configcamerastabilizationwidget.cpp * @file configcamerastabilizationwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011-2012.
* @addtogroup GCSPlugins GCS Plugins * @addtogroup GCSPlugins GCS Plugins
* @{ * @{
* @addtogroup ConfigPlugin Config Plugin * @addtogroup ConfigPlugin Config Plugin
@ -30,73 +30,51 @@
#include "mixersettings.h" #include "mixersettings.h"
#include "actuatorcommand.h" #include "actuatorcommand.h"
#include <QDebug>
#include <QDesktopServices>
#include <QUrl>
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/generalsettings.h>
ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent) ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent)
{ {
// TODO: this widget should use the addUAVObjectToWidgetRelation()
m_camerastabilization = new Ui_CameraStabilizationWidget(); m_camerastabilization = new Ui_CameraStabilizationWidget();
m_camerastabilization->setupUi(this); m_camerastabilization->setupUi(this);
ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance();
Core::Internal::GeneralSettings * settings=pm->getObject<Core::Internal::GeneralSettings>();
if(!settings->useExpertMode())
m_camerastabilization->camerastabilizationSaveRAM->setVisible(false);
QComboBox *outputs[3] = { // These widgets don't have direct relation to UAVObjects
// and need special processing
QComboBox *outputs[] = {
m_camerastabilization->rollChannel, m_camerastabilization->rollChannel,
m_camerastabilization->pitchChannel, m_camerastabilization->pitchChannel,
m_camerastabilization->yawChannel, m_camerastabilization->yawChannel,
}; };
const int NUM_OUTPUTS = sizeof(outputs) / sizeof(outputs[0]);
QComboBox *inputs[3] = { // Populate widgets with channel numbers
m_camerastabilization->rollInputChannel, for (int i = 0; i < NUM_OUTPUTS; i++) {
m_camerastabilization->pitchInputChannel,
m_camerastabilization->yawInputChannel,
};
QComboBox *stabilizationMode[3] = {
m_camerastabilization->rollStabilizationMode,
m_camerastabilization->pitchStabilizationMode,
m_camerastabilization->yawStabilizationMode,
};
CameraStabSettings *cameraStab = CameraStabSettings::GetInstance(getObjectManager());
CameraStabSettings::DataFields cameraStabData = cameraStab->getData();
for (int i = 0; i < 3; i++) {
outputs[i]->clear(); outputs[i]->clear();
outputs[i]->addItem("None"); outputs[i]->addItem("None");
for (quint32 j = 0; j < ActuatorCommand::CHANNEL_NUMELEM; j++) for (quint32 j = 0; j < ActuatorCommand::CHANNEL_NUMELEM; j++)
outputs[i]->addItem(QString("Channel %1").arg(j+1)); outputs[i]->addItem(QString("Channel %1").arg(j+1));
UAVObjectField *field;
field = cameraStab->getField("Input");
Q_ASSERT(field);
inputs[i]->clear();
inputs[i]->addItems(field->getOptions());
inputs[i]->setCurrentIndex(cameraStabData.Input[i]);
field = cameraStab->getField("StabilizationMode");
Q_ASSERT(field);
stabilizationMode[i]->clear();
stabilizationMode[i]->addItems(field->getOptions());
stabilizationMode[i]->setCurrentIndex(cameraStabData.StabilizationMode[i]);
} }
connectUpdates(); // Load UAVObjects to widget relations from UI file
// using objrelation dynamic property
// Connect buttons
connect(m_camerastabilization->camerastabilizationResetToDefaults, SIGNAL(clicked()), this, SLOT(resetToDefaults()));
connect(m_camerastabilization->camerastabilizationSaveRAM, SIGNAL(clicked()), this, SLOT(applySettings()));
connect(m_camerastabilization->camerastabilizationSaveSD, SIGNAL(clicked()), this, SLOT(saveSettings()));
autoLoadWidgets(); autoLoadWidgets();
// Add some widgets to track their UI dirty state and handle smartsave
addWidget(m_camerastabilization->enableCameraStabilization);
addWidget(m_camerastabilization->rollChannel);
addWidget(m_camerastabilization->pitchChannel);
addWidget(m_camerastabilization->yawChannel);
// Add some UAVObjects to monitor their changes in addition to autoloaded ones.
// Note also that we want to reload some UAVObjects by "Reload" button and have
// to pass corresponding reload group numbers (defined also in objrelation property)
// to the montitor. We don't reload HwSettings (module enable state) but reload
// output channels.
QList<int> reloadGroups;
reloadGroups << 1;
addUAVObject("HwSettings");
addUAVObject("MixerSettings", &reloadGroups);
// To set special widgets to defaults when requested
connect(this, SIGNAL(defaultRequested(int)), this, SLOT(defaultRequestedSlot(int)));
disableMouseWheelEvents(); disableMouseWheelEvents();
} }
@ -105,52 +83,32 @@ ConfigCameraStabilizationWidget::~ConfigCameraStabilizationWidget()
// Do nothing // Do nothing
} }
void ConfigCameraStabilizationWidget::connectUpdates() /*
* This overridden function refreshes widgets which have no direct relation
* to any of UAVObjects. It saves their dirty state first because update comes
* from UAVObjects, and then restores it. Aftewards it calls base class
* function to take care of other widgets which were dynamically added.
*/
void ConfigCameraStabilizationWidget::refreshWidgetsValues(UAVObject *obj)
{ {
// Now connect the widget to the StabilizationSettings object bool dirty = isDirty();
connect(MixerSettings::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshValues()));
connect(CameraStabSettings::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshValues()));
// TODO: This will need to support both CC and OP later
connect(HwSettings::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshValues()));
}
void ConfigCameraStabilizationWidget::disconnectUpdates() // Set module enable checkbox from OptionalModules UAVObject item.
{ // It needs special processing because ConfigTaskWidget uses TRUE/FALSE
// Now connect the widget to the StabilizationSettings object // for QCheckBox, but OptionalModules uses Enabled/Disabled enum values.
disconnect(MixerSettings::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshValues()));
disconnect(CameraStabSettings::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshValues()));
// TODO: This will need to support both CC and OP later
disconnect(HwSettings::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshValues()));
}
/**
* @brief Populate the gui settings into the appropriate
* UAV structures
*/
void ConfigCameraStabilizationWidget::applySettings()
{
// Enable or disable the settings
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager()); HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
HwSettings::DataFields hwSettingsData = hwSettings->getData(); HwSettings::DataFields hwSettingsData = hwSettings->getData();
hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTAB] =
m_camerastabilization->enableCameraStabilization->isChecked() ?
HwSettings::OPTIONALMODULES_ENABLED :
HwSettings::OPTIONALMODULES_DISABLED;
// Update the mixer settings m_camerastabilization->enableCameraStabilization->setChecked(
hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTAB] == HwSettings::OPTIONALMODULES_ENABLED);
// Load mixer outputs which are mapped to camera controls
MixerSettings *mixerSettings = MixerSettings::GetInstance(getObjectManager()); MixerSettings *mixerSettings = MixerSettings::GetInstance(getObjectManager());
MixerSettings::DataFields mixerSettingsData = mixerSettings->getData(); MixerSettings::DataFields mixerSettingsData = mixerSettings->getData();
const int NUM_MIXERS = 10;
QComboBox *outputs[3] = {
m_camerastabilization->rollChannel,
m_camerastabilization->pitchChannel,
m_camerastabilization->yawChannel,
};
// TODO: Need to reformat object so types are an // TODO: Need to reformat object so types are an
// array themselves. This gets really awkward // array themselves. This gets really awkward
quint8 * mixerTypes[NUM_MIXERS] = { quint8 *mixerTypes[] = {
&mixerSettingsData.Mixer1Type, &mixerSettingsData.Mixer1Type,
&mixerSettingsData.Mixer2Type, &mixerSettingsData.Mixer2Type,
&mixerSettingsData.Mixer3Type, &mixerSettingsData.Mixer3Type,
@ -162,182 +120,140 @@ void ConfigCameraStabilizationWidget::applySettings()
&mixerSettingsData.Mixer9Type, &mixerSettingsData.Mixer9Type,
&mixerSettingsData.Mixer10Type, &mixerSettingsData.Mixer10Type,
}; };
const int NUM_MIXERS = sizeof(mixerTypes) / sizeof(mixerTypes[0]);
m_camerastabilization->message->setText(""); QComboBox *outputs[] = {
for (int i = 0; i < 3; i++)
{
// Channel 1 is second entry, so becomes zero
int mixerNum = outputs[i]->currentIndex() - 1;
if ( mixerNum >= 0 && // Short circuit in case of none
*mixerTypes[mixerNum] != MixerSettings::MIXER1TYPE_DISABLED &&
(*mixerTypes[mixerNum] != MixerSettings::MIXER1TYPE_CAMERAROLL + i) ) {
// If the mixer channel already to something that isn't what we are
// about to set it to reset to none
outputs[i]->setCurrentIndex(0);
m_camerastabilization->message->setText("One of the channels is already assigned, reverted to none");
} else {
// Make sure no other channels have this output set
for (int j = 0; j < NUM_MIXERS; j++)
if (*mixerTypes[j] == (MixerSettings::MIXER1TYPE_CAMERAROLL + i))
*mixerTypes[j] = MixerSettings::MIXER1TYPE_DISABLED;
// If this channel is assigned to one of the outputs that is not disabled
// set it
if(mixerNum >= 0 && mixerNum < NUM_MIXERS)
*mixerTypes[mixerNum] = MixerSettings::MIXER1TYPE_CAMERAROLL + i;
}
}
// Update the settings
CameraStabSettings *cameraStab = CameraStabSettings::GetInstance(getObjectManager());
CameraStabSettings::DataFields cameraStabData = cameraStab->getData();
cameraStabData.OutputRange[CameraStabSettings::OUTPUTRANGE_ROLL] = m_camerastabilization->rollOutputRange->value();
cameraStabData.OutputRange[CameraStabSettings::OUTPUTRANGE_PITCH] = m_camerastabilization->pitchOutputRange->value();
cameraStabData.OutputRange[CameraStabSettings::OUTPUTRANGE_YAW] = m_camerastabilization->yawOutputRange->value();
cameraStabData.Input[CameraStabSettings::INPUT_ROLL] = m_camerastabilization->rollInputChannel->currentIndex();
cameraStabData.Input[CameraStabSettings::INPUT_PITCH] = m_camerastabilization->pitchInputChannel->currentIndex();
cameraStabData.Input[CameraStabSettings::INPUT_YAW] = m_camerastabilization->yawInputChannel->currentIndex();
cameraStabData.StabilizationMode[CameraStabSettings::STABILIZATIONMODE_ROLL] = m_camerastabilization->rollStabilizationMode->currentIndex();
cameraStabData.StabilizationMode[CameraStabSettings::STABILIZATIONMODE_PITCH] = m_camerastabilization->pitchStabilizationMode->currentIndex();
cameraStabData.StabilizationMode[CameraStabSettings::STABILIZATIONMODE_YAW] = m_camerastabilization->yawStabilizationMode->currentIndex();
cameraStabData.InputRange[CameraStabSettings::INPUTRANGE_ROLL] = m_camerastabilization->rollInputRange->value();
cameraStabData.InputRange[CameraStabSettings::INPUTRANGE_PITCH] = m_camerastabilization->pitchInputRange->value();
cameraStabData.InputRange[CameraStabSettings::INPUTRANGE_YAW] = m_camerastabilization->yawInputRange->value();
cameraStabData.InputRate[CameraStabSettings::INPUTRATE_ROLL] = m_camerastabilization->rollInputRate->value();
cameraStabData.InputRate[CameraStabSettings::INPUTRATE_PITCH] = m_camerastabilization->pitchInputRate->value();
cameraStabData.InputRate[CameraStabSettings::INPUTRATE_YAW] = m_camerastabilization->yawInputRate->value();
cameraStabData.ResponseTime[CameraStabSettings::RESPONSETIME_ROLL] = m_camerastabilization->rollResponseTime->value();
cameraStabData.ResponseTime[CameraStabSettings::RESPONSETIME_PITCH] = m_camerastabilization->pitchResponseTime->value();
cameraStabData.ResponseTime[CameraStabSettings::RESPONSETIME_YAW] = m_camerastabilization->yawResponseTime->value();
cameraStabData.MaxAxisLockRate = m_camerastabilization->MaxAxisLockRate->value();
// Because multiple objects are updated, and all of them trigger the callback
// they must be done together (if update one then load settings from second
// the first update would wipe the UI controls). However to be extra cautious
// I'm also disabling updates during the setting to the UAVObjects
disconnectUpdates();
hwSettings->setData(hwSettingsData);
mixerSettings->setData(mixerSettingsData);
cameraStab->setData(cameraStabData);
connectUpdates();
}
/**
* Push settings into UAV objects then save them
*/
void ConfigCameraStabilizationWidget::saveSettings()
{
applySettings();
UAVObject *obj = HwSettings::GetInstance(getObjectManager());
saveObjectToSD(obj);
obj = MixerSettings::GetInstance(getObjectManager());
saveObjectToSD(obj);
obj = CameraStabSettings::GetInstance(getObjectManager());
saveObjectToSD(obj);
}
/**
* Refresh UI with new settings of CameraStabSettings object
* (either from active configuration or just loaded defaults
* to be applied or saved)
*/
void ConfigCameraStabilizationWidget::refreshUIValues(CameraStabSettings::DataFields &cameraStabData)
{
m_camerastabilization->rollOutputRange->setValue(cameraStabData.OutputRange[CameraStabSettings::OUTPUTRANGE_ROLL]);
m_camerastabilization->pitchOutputRange->setValue(cameraStabData.OutputRange[CameraStabSettings::OUTPUTRANGE_PITCH]);
m_camerastabilization->yawOutputRange->setValue(cameraStabData.OutputRange[CameraStabSettings::OUTPUTRANGE_YAW]);
m_camerastabilization->rollInputChannel->setCurrentIndex(cameraStabData.Input[CameraStabSettings::INPUT_ROLL]);
m_camerastabilization->pitchInputChannel->setCurrentIndex(cameraStabData.Input[CameraStabSettings::INPUT_PITCH]);
m_camerastabilization->yawInputChannel->setCurrentIndex(cameraStabData.Input[CameraStabSettings::INPUT_YAW]);
m_camerastabilization->rollStabilizationMode->setCurrentIndex(cameraStabData.StabilizationMode[CameraStabSettings::STABILIZATIONMODE_ROLL]);
m_camerastabilization->pitchStabilizationMode->setCurrentIndex(cameraStabData.StabilizationMode[CameraStabSettings::STABILIZATIONMODE_PITCH]);
m_camerastabilization->yawStabilizationMode->setCurrentIndex(cameraStabData.StabilizationMode[CameraStabSettings::STABILIZATIONMODE_YAW]);
m_camerastabilization->rollInputRange->setValue(cameraStabData.InputRange[CameraStabSettings::INPUTRANGE_ROLL]);
m_camerastabilization->pitchInputRange->setValue(cameraStabData.InputRange[CameraStabSettings::INPUTRANGE_PITCH]);
m_camerastabilization->yawInputRange->setValue(cameraStabData.InputRange[CameraStabSettings::INPUTRANGE_YAW]);
m_camerastabilization->rollInputRate->setValue(cameraStabData.InputRate[CameraStabSettings::INPUTRATE_ROLL]);
m_camerastabilization->pitchInputRate->setValue(cameraStabData.InputRate[CameraStabSettings::INPUTRATE_PITCH]);
m_camerastabilization->yawInputRate->setValue(cameraStabData.InputRate[CameraStabSettings::INPUTRATE_YAW]);
m_camerastabilization->rollResponseTime->setValue(cameraStabData.ResponseTime[CameraStabSettings::RESPONSETIME_ROLL]);
m_camerastabilization->pitchResponseTime->setValue(cameraStabData.ResponseTime[CameraStabSettings::RESPONSETIME_PITCH]);
m_camerastabilization->yawResponseTime->setValue(cameraStabData.ResponseTime[CameraStabSettings::RESPONSETIME_YAW]);
m_camerastabilization->MaxAxisLockRate->setValue(cameraStabData.MaxAxisLockRate);
}
void ConfigCameraStabilizationWidget::refreshValues()
{
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
HwSettings::DataFields hwSettingsData = hwSettings->getData();
m_camerastabilization->enableCameraStabilization->setChecked(
hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTAB] ==
HwSettings::OPTIONALMODULES_ENABLED);
CameraStabSettings *cameraStabSettings = CameraStabSettings::GetInstance(getObjectManager());
CameraStabSettings::DataFields cameraStabData = cameraStabSettings->getData();
refreshUIValues(cameraStabData);
MixerSettings *mixerSettings = MixerSettings::GetInstance(getObjectManager());
MixerSettings::DataFields mixerSettingsData = mixerSettings->getData();
const int NUM_MIXERS = 10;
QComboBox *outputs[3] = {
m_camerastabilization->rollChannel, m_camerastabilization->rollChannel,
m_camerastabilization->pitchChannel, m_camerastabilization->pitchChannel,
m_camerastabilization->yawChannel m_camerastabilization->yawChannel
}; };
const int NUM_OUTPUTS = sizeof(outputs) / sizeof(outputs[0]);
// TODO: Need to reformat object so types are an for (int i = 0; i < NUM_OUTPUTS; i++) {
// array themselves. This gets really awkward // Default to none if not found.
quint8 * mixerTypes[NUM_MIXERS] = { // Then search for any mixer channels set to this
&mixerSettingsData.Mixer1Type,
&mixerSettingsData.Mixer2Type,
&mixerSettingsData.Mixer3Type,
&mixerSettingsData.Mixer4Type,
&mixerSettingsData.Mixer5Type,
&mixerSettingsData.Mixer6Type,
&mixerSettingsData.Mixer7Type,
&mixerSettingsData.Mixer8Type,
&mixerSettingsData.Mixer9Type,
&mixerSettingsData.Mixer10Type,
};
for (int i = 0; i < 3; i++)
{
// Default to none if not found. Then search for any mixer channels set to
// this
outputs[i]->setCurrentIndex(0); outputs[i]->setCurrentIndex(0);
for (int j = 0; j < NUM_MIXERS; j++) for (int j = 0; j < NUM_MIXERS; j++)
if (*mixerTypes[j] == (MixerSettings::MIXER1TYPE_CAMERAROLL + i) && if (*mixerTypes[j] == (MixerSettings::MIXER1TYPE_CAMERAROLL + i) &&
outputs[i]->currentIndex() != (j + 1)) outputs[i]->currentIndex() != (j + 1))
outputs[i]->setCurrentIndex(j + 1); outputs[i]->setCurrentIndex(j + 1);
} }
setDirty(dirty);
ConfigTaskWidget::refreshWidgetsValues(obj);
} }
void ConfigCameraStabilizationWidget::resetToDefaults() /*
* This overridden function updates UAVObjects which have no direct relation
* to any of widgets. Aftewards it calls base class function to take care of
* other object to widget relations which were dynamically added.
*/
void ConfigCameraStabilizationWidget::updateObjectsFromWidgets()
{ {
CameraStabSettings cameraStabDefaults; // Save state of the module enable checkbox first
CameraStabSettings::DataFields defaults = cameraStabDefaults.getData(); HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
refreshUIValues(defaults); quint8 value = m_camerastabilization->enableCameraStabilization->isChecked() ?
HwSettings::OPTIONALMODULES_ENABLED : HwSettings::OPTIONALMODULES_DISABLED;
hwSettings->setOptionalModules(HwSettings::OPTIONALMODULES_CAMERASTAB,value);
// Update mixer channels which were mapped to camera outputs in case they are
// not used for other function yet
MixerSettings *mixerSettings = MixerSettings::GetInstance(getObjectManager());
MixerSettings::DataFields mixerSettingsData = mixerSettings->getData();
// TODO: Need to reformat object so types are an
// array themselves. This gets really awkward
quint8 *mixerTypes[] = {
&mixerSettingsData.Mixer1Type,
&mixerSettingsData.Mixer2Type,
&mixerSettingsData.Mixer3Type,
&mixerSettingsData.Mixer4Type,
&mixerSettingsData.Mixer5Type,
&mixerSettingsData.Mixer6Type,
&mixerSettingsData.Mixer7Type,
&mixerSettingsData.Mixer8Type,
&mixerSettingsData.Mixer9Type,
&mixerSettingsData.Mixer10Type,
};
const int NUM_MIXERS = sizeof(mixerTypes) / sizeof(mixerTypes[0]);
QComboBox *outputs[] = {
m_camerastabilization->rollChannel,
m_camerastabilization->pitchChannel,
m_camerastabilization->yawChannel
};
const int NUM_OUTPUTS = sizeof(outputs) / sizeof(outputs[0]);
m_camerastabilization->message->setText("");
bool widgetUpdated;
do {
widgetUpdated = false;
for (int i = 0; i < NUM_OUTPUTS; i++) {
// Channel 1 is second entry, so becomes zero
int mixerNum = outputs[i]->currentIndex() - 1;
if ((mixerNum >= 0) && // Short circuit in case of none
(*mixerTypes[mixerNum] != MixerSettings::MIXER1TYPE_DISABLED) &&
(*mixerTypes[mixerNum] != MixerSettings::MIXER1TYPE_CAMERAROLL + i) ) {
// If the mixer channel already mapped to something, it should not be
// used for camera output, we reset it to none
outputs[i]->setCurrentIndex(0);
m_camerastabilization->message->setText("One of the channels is already assigned, reverted to none");
// Loop again or we may have inconsistent widget and UAVObject
widgetUpdated = true;
} else {
// Make sure no other channels have this output set
for (int j = 0; j < NUM_MIXERS; j++)
if (*mixerTypes[j] == (MixerSettings::MIXER1TYPE_CAMERAROLL + i))
*mixerTypes[j] = MixerSettings::MIXER1TYPE_DISABLED;
// If this channel is assigned to one of the outputs that is not disabled
// set it
if ((mixerNum >= 0) && (mixerNum < NUM_MIXERS))
*mixerTypes[mixerNum] = MixerSettings::MIXER1TYPE_CAMERAROLL + i;
}
}
} while(widgetUpdated);
mixerSettings->setData(mixerSettingsData);
ConfigTaskWidget::updateObjectsFromWidgets();
} }
void ConfigCameraStabilizationWidget::enableControls(bool enable) /*
* This slot function is called when "Default" button is clicked.
* All special widgets which belong to the group passed should be set here.
*/
void ConfigCameraStabilizationWidget::defaultRequestedSlot(int group)
{ {
m_camerastabilization->camerastabilizationResetToDefaults->setEnabled(enable); Q_UNUSED(group);
m_camerastabilization->camerastabilizationSaveSD->setEnabled(enable);
m_camerastabilization->camerastabilizationSaveRAM->setEnabled(enable); // Here is the example of how to reset the state of QCheckBox. It is
// commented out because we normally don't want to reset the module
// enable state to default "disabled" (or we don't care about values at all).
// But if you want, you could use the dirtyClone() function to get default
// values of an object and then use them to set a widget state.
//
//HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
//HwSettings *hwSettingsDefault=(HwSettings*)hwSettings->dirtyClone();
//HwSettings::DataFields hwSettingsData = hwSettingsDefault->getData();
//m_camerastabilization->enableCameraStabilization->setChecked(
// hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTAB] == HwSettings::OPTIONALMODULES_ENABLED);
// For outputs we set them all to none, so don't use any UAVObject to get defaults
QComboBox *outputs[] = {
m_camerastabilization->rollChannel,
m_camerastabilization->pitchChannel,
m_camerastabilization->yawChannel,
};
const int NUM_OUTPUTS = sizeof(outputs) / sizeof(outputs[0]);
for (int i = 0; i < NUM_OUTPUTS; i++) {
outputs[i]->setCurrentIndex(0);
}
} }
/** /**

View File

@ -41,20 +41,14 @@ class ConfigCameraStabilizationWidget: public ConfigTaskWidget
public: public:
ConfigCameraStabilizationWidget(QWidget *parent = 0); ConfigCameraStabilizationWidget(QWidget *parent = 0);
~ConfigCameraStabilizationWidget(); ~ConfigCameraStabilizationWidget();
private: private:
Ui_CameraStabilizationWidget *m_camerastabilization; Ui_CameraStabilizationWidget *m_camerastabilization;
virtual void enableControls(bool enable); void refreshWidgetsValues(UAVObject *obj);
void refreshUIValues(CameraStabSettings::DataFields &cameraStabData); void updateObjectsFromWidgets();
private slots: private slots:
void resetToDefaults(); void defaultRequestedSlot(int group);
void applySettings();
void saveSettings();
void refreshValues();
protected:
void connectUpdates();
void disconnectUpdates();
}; };
#endif // CONFIGCAMERASTABILIZATIONWIDGET_H #endif // CONFIGCAMERASTABILIZATIONWIDGET_H

View File

@ -58,9 +58,18 @@ void ConfigTaskWidget::addWidget(QWidget * widget)
* Add an object to the management system * Add an object to the management system
* @param objectName name of the object to add to the management system * @param objectName name of the object to add to the management system
*/ */
void ConfigTaskWidget::addUAVObject(QString objectName) void ConfigTaskWidget::addUAVObject(QString objectName,QList<int> * reloadGroups)
{ {
addUAVObjectToWidgetRelation(objectName,"",NULL); addUAVObjectToWidgetRelation(objectName,"",NULL,0,1,false,reloadGroups);
}
void ConfigTaskWidget::addUAVObject(UAVObject *objectName, QList<int> *reloadGroups)
{
QString objstr;
if(objectName)
objstr=objectName->getName();
addUAVObject(objstr, reloadGroups);
} }
/** /**
* Add an UAVObject field to widget relation to the management system * Add an UAVObject field to widget relation to the management system
@ -79,6 +88,17 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString fiel
Q_ASSERT(_field); Q_ASSERT(_field);
addUAVObjectToWidgetRelation(object,field,widget,_field->getElementNames().indexOf(index)); addUAVObjectToWidgetRelation(object,field,widget,_field->getElementNames().indexOf(index));
} }
void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField * field, QWidget *widget, QString index)
{
QString objstr;
QString fieldstr;
if(obj)
objstr=obj->getName();
if(field)
fieldstr=field->getName();
addUAVObjectToWidgetRelation(objstr, fieldstr, widget, index);
}
/** /**
* Add a UAVObject field to widget relation to the management system * Add a UAVObject field to widget relation to the management system
* @param object name of the object to add * @param object name of the object to add
@ -104,6 +124,28 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString fiel
} }
addUAVObjectToWidgetRelation(object, field, widget,index,scale,isLimited,defaultReloadGroups,instID); addUAVObjectToWidgetRelation(object, field, widget,index,scale,isLimited,defaultReloadGroups,instID);
} }
void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField *field, QWidget *widget, QString element, double scale, bool isLimited, QList<int> *defaultReloadGroups, quint32 instID)
{
QString objstr;
QString fieldstr;
if(obj)
objstr=obj->getName();
if(field)
fieldstr=field->getName();
addUAVObjectToWidgetRelation(objstr, fieldstr, widget, element, scale, isLimited, defaultReloadGroups, instID);
}
void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject * obj,UAVObjectField * field, QWidget * widget, int index,double scale,bool isLimited,QList<int>* defaultReloadGroups, quint32 instID)
{
QString objstr;
QString fieldstr;
if(obj)
objstr=obj->getName();
if(field)
fieldstr=field->getName();
addUAVObjectToWidgetRelation(objstr,fieldstr,widget,index,scale,isLimited,defaultReloadGroups,instID);
}
/** /**
* Add an UAVObject field to widget relation to the management system * Add an UAVObject field to widget relation to the management system
* @param object name of the object to add * @param object name of the object to add
@ -149,7 +191,21 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString fiel
} }
if(widget==NULL) if(widget==NULL)
{ {
// do nothing if(defaultReloadGroups && obj)
{
foreach(int i,*defaultReloadGroups)
{
if(this->defaultReloadGroups.contains(i))
{
this->defaultReloadGroups.value(i)->append(ow);
}
else
{
this->defaultReloadGroups.insert(i,new QList<objectToWidget*>());
this->defaultReloadGroups.value(i)->append(ow);
}
}
}
} }
else else
{ {
@ -177,10 +233,6 @@ ConfigTaskWidget::~ConfigTaskWidget()
if(oTw) if(oTw)
delete oTw; delete oTw;
} }
if(timeOut)
{
delete timeOut;
}
} }
void ConfigTaskWidget::saveObjectToSD(UAVObject *obj) void ConfigTaskWidget::saveObjectToSD(UAVObject *obj)
@ -225,7 +277,7 @@ void ConfigTaskWidget::onAutopilotDisconnect()
invalidateObjects(); invalidateObjects();
} }
void ConfigTaskWidget::forceConnectedState() void ConfigTaskWidget::forceConnectedState()//dynamic widgets don't recieve the connected signal. This should be called instead.
{ {
isConnected=true; isConnected=true;
setDirty(false); setDirty(false);
@ -554,7 +606,7 @@ bool ConfigTaskWidget::addShadowWidget(QString object, QString field, QWidget *w
{ {
foreach(objectToWidget * oTw,objOfInterest) foreach(objectToWidget * oTw,objOfInterest)
{ {
if(!oTw->object || !oTw->widget) if(!oTw->object || !oTw->widget || !oTw->field)
continue; continue;
if(oTw->object->getName()==object && oTw->field->getName()==field && oTw->index==index && oTw->object->getInstID()==instID) if(oTw->object->getName()==object && oTw->field->getName()==field && oTw->index==index && oTw->object->getInstID()==instID)
{ {
@ -711,10 +763,12 @@ void ConfigTaskWidget::autoLoadWidgets()
forceShadowUpdates(); forceShadowUpdates();
foreach(objectToWidget * ow,objOfInterest) foreach(objectToWidget * ow,objOfInterest)
{ {
qDebug()<<"Master:"<<ow->widget->objectName(); if(ow->widget)
qDebug()<<"Master:"<<ow->widget->objectName();
foreach(shadow * sh,ow->shadowsList) foreach(shadow * sh,ow->shadowsList)
{ {
qDebug()<<"Child"<<sh->widget->objectName(); if(sh->widget)
qDebug()<<"Child"<<sh->widget->objectName();
} }
} }
} }
@ -783,10 +837,11 @@ void ConfigTaskWidget::addReloadButton(QPushButton *button, int buttonGroup)
void ConfigTaskWidget::defaultButtonClicked() void ConfigTaskWidget::defaultButtonClicked()
{ {
int group=sender()->property("group").toInt(); int group=sender()->property("group").toInt();
emit defaultRequested(group);
QList<objectToWidget*> * list=defaultReloadGroups.value(group); QList<objectToWidget*> * list=defaultReloadGroups.value(group);
foreach(objectToWidget * oTw,*list) foreach(objectToWidget * oTw,*list)
{ {
if(!oTw->object) if(!oTw->object || !oTw->field)
continue; continue;
UAVDataObject * temp=((UAVDataObject*)oTw->object)->dirtyClone(); UAVDataObject * temp=((UAVDataObject*)oTw->object)->dirtyClone();
setWidgetFromField(oTw->widget,temp->getField(oTw->field->getName()),oTw->index,oTw->scale,oTw->isLimited); setWidgetFromField(oTw->widget,temp->getField(oTw->field->getName()),oTw->index,oTw->scale,oTw->isLimited);
@ -797,9 +852,8 @@ void ConfigTaskWidget::defaultButtonClicked()
*/ */
void ConfigTaskWidget::reloadButtonClicked() void ConfigTaskWidget::reloadButtonClicked()
{ {
QPushButton * button=qobject_cast<QPushButton*>(sender()); if(timeOut)
if(button) return;
button->setEnabled(false);
int group=sender()->property("group").toInt(); int group=sender()->property("group").toInt();
QList<objectToWidget*> * list=defaultReloadGroups.value(group,NULL); QList<objectToWidget*> * list=defaultReloadGroups.value(group,NULL);
if(!list) if(!list)
@ -834,7 +888,8 @@ void ConfigTaskWidget::reloadButtonClicked()
if(timeOut->isActive()) if(timeOut->isActive())
{ {
oTw->object->requestUpdate(); oTw->object->requestUpdate();
setWidgetFromField(oTw->widget,oTw->field,oTw->index,oTw->scale,oTw->isLimited); if(oTw->widget)
setWidgetFromField(oTw->widget,oTw->field,oTw->index,oTw->scale,oTw->isLimited);
} }
timeOut->stop(); timeOut->stop();
} }
@ -849,8 +904,6 @@ void ConfigTaskWidget::reloadButtonClicked()
delete timeOut; delete timeOut;
timeOut=NULL; timeOut=NULL;
} }
if(button)
button->setEnabled(true);
} }
/** /**

View File

@ -103,12 +103,19 @@ public:
UAVObjectManager* getObjectManager(); UAVObjectManager* getObjectManager();
static double listMean(QList<double> list); static double listMean(QList<double> list);
void addUAVObject(QString objectName); void addUAVObject(QString objectName, QList<int> *reloadGroups=NULL);
void addUAVObject(UAVObject * objectName, QList<int> *reloadGroups=NULL);
void addWidget(QWidget * widget); void addWidget(QWidget * widget);
void addUAVObjectToWidgetRelation(QString object,QString field,QWidget * widget,int index=0,double scale=1,bool isLimited=false,QList<int>* defaultReloadGroups=0,quint32 instID=0); void addUAVObjectToWidgetRelation(QString object,QString field,QWidget * widget,int index=0,double scale=1,bool isLimited=false,QList<int>* defaultReloadGroups=0,quint32 instID=0);
void addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField * field, QWidget *widget, int index=0, double scale=1, bool isLimited=false, QList<int> *defaultReloadGroups=0, quint32 instID=0);
void addUAVObjectToWidgetRelation(QString object,QString field,QWidget * widget,QString element,double scale,bool isLimited=false,QList<int>* defaultReloadGroups=0,quint32 instID=0); void addUAVObjectToWidgetRelation(QString object,QString field,QWidget * widget,QString element,double scale,bool isLimited=false,QList<int>* defaultReloadGroups=0,quint32 instID=0);
void addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField * field,QWidget * widget,QString element,double scale,bool isLimited=false,QList<int>* defaultReloadGroups=0,quint32 instID=0);
void addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString index); void addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString index);
void addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField * field, QWidget *widget, QString index);
//BUTTONS// //BUTTONS//
void addApplySaveButtons(QPushButton * update,QPushButton * save); void addApplySaveButtons(QPushButton * update,QPushButton * save);
@ -150,6 +157,7 @@ signals:
void autoPilotConnected(); void autoPilotConnected();
//fired when the autopilot disconnects //fired when the autopilot disconnects
void autoPilotDisconnected(); void autoPilotDisconnected();
void defaultRequested(int group);
private slots: private slots:
void objectUpdated(UAVObject*); void objectUpdated(UAVObject*);
void defaultButtonClicked(); void defaultButtonClicked();

View File

@ -162,6 +162,7 @@ void smartSaveButton::setObjects(QList<UAVDataObject *> list)
void smartSaveButton::addObject(UAVDataObject * obj) void smartSaveButton::addObject(UAVDataObject * obj)
{ {
Q_ASSERT(obj);
if(!objects.contains(obj)) if(!objects.contains(obj))
objects.append(obj); objects.append(obj);
} }