1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

Merge remote-tracking branch 'origin/OP-452_InputConfiguration'

This commit is contained in:
James Cotton 2011-05-02 03:40:59 -05:00
commit d9221fac06
3 changed files with 27 additions and 24 deletions

View File

@ -199,17 +199,6 @@ static void manualControlTask(void *parameters)
if (!ManualControlCommandReadOnly(&cmd)) {
// Check settings, if error raise alarm
if (settings.Roll >= MANUALCONTROLSETTINGS_ROLL_NONE ||
settings.Pitch >= MANUALCONTROLSETTINGS_PITCH_NONE ||
settings.Yaw >= MANUALCONTROLSETTINGS_YAW_NONE ||
settings.Throttle >= MANUALCONTROLSETTINGS_THROTTLE_NONE ||
settings.FlightMode >= MANUALCONTROLSETTINGS_FLIGHTMODE_NONE) {
AlarmsSet(SYSTEMALARMS_ALARM_MANUALCONTROL, SYSTEMALARMS_ALARM_CRITICAL);
cmd.Connected = MANUALCONTROLCOMMAND_CONNECTED_FALSE;
ManualControlCommandSet(&cmd);
continue;
}
// Read channel values in us
// TODO: settings.InputMode is currently ignored because PIOS will not allow runtime
// selection of PWM and PPM. The configuration is currently done at compile time in
@ -225,6 +214,18 @@ static void manualControlTask(void *parameters)
scaledChannel[n] = scaleChannel(cmd.Channel[n], settings.ChannelMax[n], settings.ChannelMin[n], settings.ChannelNeutral[n], 0);
}
// Check settings, if error raise alarm
if (settings.Roll >= MANUALCONTROLSETTINGS_ROLL_NONE ||
settings.Pitch >= MANUALCONTROLSETTINGS_PITCH_NONE ||
settings.Yaw >= MANUALCONTROLSETTINGS_YAW_NONE ||
settings.Throttle >= MANUALCONTROLSETTINGS_THROTTLE_NONE ||
settings.FlightMode >= MANUALCONTROLSETTINGS_FLIGHTMODE_NONE) {
AlarmsSet(SYSTEMALARMS_ALARM_MANUALCONTROL, SYSTEMALARMS_ALARM_CRITICAL);
cmd.Connected = MANUALCONTROLCOMMAND_CONNECTED_FALSE;
ManualControlCommandSet(&cmd);
continue;
}
// Scale channels to -1 -> +1 range
cmd.Roll = scaledChannel[settings.Roll];
cmd.Pitch = scaledChannel[settings.Pitch];

View File

@ -575,9 +575,9 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand)
QString fieldName = QString("Connected");
UAVObjectField *field = controlCommand->getField(fieldName);
if (field->getValue().toBool())
m_config->RCInputConnected->setText("RC Receiver Connected");
m_config->RCInputConnected->setText("RC Receiver connected");
else
m_config->RCInputConnected->setText("RC Receiver Not Connected");
m_config->RCInputConnected->setText("RC Receiver not connected or invalid input configuration (missing channels)");
if (m_config->doRCInputCalibration->isChecked()) {
if (firstUpdate) {

View File

@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -919,10 +919,10 @@ Neutral should be put at the bottom of the slider for the throttle.</string>
<widget class="QLabel" name="RCInputConnected">
<property name="geometry">
<rect>
<x>250</x>
<y>10</y>
<width>311</width>
<height>20</height>
<x>270</x>
<y>0</y>
<width>251</width>
<height>41</height>
</rect>
</property>
<property name="font">
@ -936,7 +936,10 @@ Neutral should be put at the bottom of the slider for the throttle.</string>
<string>Indicates whether OpenPilot is getting a signal from the RC receiver.</string>
</property>
<property name="text">
<string>RC Receiver Not Connected</string>
<string>RC Receiver not connected or invalid input configuration (missing channels)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QComboBox" name="receiverType">
@ -976,17 +979,16 @@ Neutral should be put at the bottom of the slider for the throttle.</string>
<rect>
<x>20</x>
<y>310</y>
<width>531</width>
<height>41</height>
<width>561</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; color:#ff0000;&quot;&gt;BEWARE: make sure your engines are not connected&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; color:#ff0000;&quot;&gt;when running calibration!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:600; color:#ff0000;&quot;&gt;BEWARE: make sure your engines are not connected when running calibration!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QSlider" name="inSlider0">