1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

Merge remote-tracking branch 'origin/next' into thread/OP-1222_FW_Wizard

Conflicts:
	ground/openpilotgcs/src/libs/sdlgamepad/sdlgamepad.pro.user
This commit is contained in:
m_thread 2014-09-08 21:48:33 +02:00
commit 1a68ba062d
10 changed files with 112 additions and 146 deletions

1
.gitignore vendored
View File

@ -34,6 +34,7 @@ ground/openpilotgcs/.settings
/ground/uavobjgenerator/uavobjgenerator.pro.user /ground/uavobjgenerator/uavobjgenerator.pro.user
/ground/uavobjects/uavobjects.pro.user /ground/uavobjects/uavobjects.pro.user
/ground/ground.pro.user /ground/ground.pro.user
/ground/openpilotgcs/src/libs/sdlgamepad.pro.user
# Misc artifacts # Misc artifacts
/ground/openpilotgcs/share/openpilotgcs/sounds/normalize.exe /ground/openpilotgcs/share/openpilotgcs/sounds/normalize.exe

View File

@ -250,7 +250,7 @@ static void PIOS_SBus_UpdateState(struct pios_sbus_state *state, uint8_t b)
state->received_data[state->byte_count - 1] = b; state->received_data[state->byte_count - 1] = b;
state->byte_count++; state->byte_count++;
} else { } else {
if (b == SBUS_EOF_BYTE || (b % SBUS_R7008SB_EOF_COUNTER_MASK) == SBUS_R7008SB_EOF_BYTE) { if (b == SBUS_EOF_BYTE || (b & SBUS_R7008SB_EOF_COUNTER_MASK) == 0) {
/* full frame received */ /* full frame received */
uint8_t flags = state->received_data[SBUS_FRAME_LENGTH - 3]; uint8_t flags = state->received_data[SBUS_FRAME_LENGTH - 3];
if (flags & SBUS_FLAG_FL) { if (flags & SBUS_FLAG_FL) {

View File

@ -66,8 +66,7 @@
#define SBUS_FLAG_FL 0x04 #define SBUS_FLAG_FL 0x04
#define SBUS_FLAG_FS 0x08 #define SBUS_FLAG_FS 0x08
#define SBUS_R7008SB_EOF_COUNTER_MASK 0xCF #define SBUS_R7008SB_EOF_COUNTER_MASK 0xCB
#define SBUS_R7008SB_EOF_BYTE 0x04
/* /*
* S.Bus protocol provides 16 proportional and 2 discrete channels. * S.Bus protocol provides 16 proportional and 2 discrete channels.

View File

@ -97,7 +97,8 @@ macx {
GCS_QT_PLUGINS_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5/plugins GCS_QT_PLUGINS_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5/plugins
GCS_QT_QML_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5/qml GCS_QT_QML_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5/qml
TOOLS_DIR = $$clean_path($$GCS_SOURCE_TREE/../../tools) TOOLS_DIR = $$(OPENPILOT_TOOLS_DIR)
isEmpty(TOOLS_DIR):TOOLS_DIR = $$clean_path($$GCS_SOURCE_TREE/../../tools)
QT_INSTALL_DIR = $$clean_path($$[QT_INSTALL_LIBS]/../../../..) QT_INSTALL_DIR = $$clean_path($$[QT_INSTALL_LIBS]/../../../..)
equals(QT_INSTALL_DIR, $$TOOLS_DIR) { equals(QT_INSTALL_DIR, $$TOOLS_DIR) {
copyqt = 1 copyqt = 1

View File

@ -1779,7 +1779,7 @@
<showTileGridLines>false</showTileGridLines> <showTileGridLines>false</showTileGridLines>
<uavSymbol>mapquad.png</uavSymbol> <uavSymbol>mapquad.png</uavSymbol>
<useMemoryCache>true</useMemoryCache> <useMemoryCache>true</useMemoryCache>
<useOpenGL>true</useOpenGL> <useOpenGL>false</useOpenGL>
</data> </data>
</Google__PCT__20Sat> </Google__PCT__20Sat>
<Memory__PCT__20Only> <Memory__PCT__20Only>
@ -1799,7 +1799,7 @@
<showTileGridLines>false</showTileGridLines> <showTileGridLines>false</showTileGridLines>
<uavSymbol>airplanepip.png</uavSymbol> <uavSymbol>airplanepip.png</uavSymbol>
<useMemoryCache>true</useMemoryCache> <useMemoryCache>true</useMemoryCache>
<useOpenGL>true</useOpenGL> <useOpenGL>false</useOpenGL>
</data> </data>
</Memory__PCT__20Only> </Memory__PCT__20Only>
<default> <default>
@ -1819,7 +1819,7 @@
<showTileGridLines>false</showTileGridLines> <showTileGridLines>false</showTileGridLines>
<uavSymbol>mapquad.png</uavSymbol> <uavSymbol>mapquad.png</uavSymbol>
<useMemoryCache>true</useMemoryCache> <useMemoryCache>true</useMemoryCache>
<useOpenGL>true</useOpenGL> <useOpenGL>false</useOpenGL>
</data> </data>
</default> </default>
</OPMapGadget> </OPMapGadget>

View File

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.2, 2014-08-23T10:12:28. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">-1</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<value type="QByteArray">{6e1a7efe-f107-41f3-9383-31e878c1f556}</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">15</value>
</data>
</qtcreator>

View File

@ -126,6 +126,17 @@ void ConfigOutputWidget::enableControls(bool enable)
ui->channelOutTest->setEnabled(enable); ui->channelOutTest->setEnabled(enable);
} }
/**
Force update all channels with the values in the OutputChannelForms.
*/
void ConfigOutputWidget::sendAllChannelTests()
{
for (unsigned int i = 0; i < ActuatorCommand::CHANNEL_NUMELEM; i++) {
OutputChannelForm *form = getOutputChannelForm(i);
sendChannelTest(i, form->neutral());
}
}
/** /**
Toggles the channel testing mode by making the GCS take over Toggles the channel testing mode by making the GCS take over
the ActuatorCommand objects the ActuatorCommand objects
@ -178,6 +189,11 @@ void ConfigOutputWidget::runChannelTests(bool state)
} }
obj->setMetadata(mdata); obj->setMetadata(mdata);
obj->updated(); obj->updated();
// Setup the correct initial channel values when the channel testing mode is turned on.
if (state) {
sendAllChannelTests();
}
} }
OutputChannelForm *ConfigOutputWidget::getOutputChannelForm(const int index) const OutputChannelForm *ConfigOutputWidget::getOutputChannelForm(const int index) const

View File

@ -58,7 +58,11 @@ private:
void updateChannelInSlider(QSlider *slider, QLabel *min, QLabel *max, QCheckBox *rev, int value); void updateChannelInSlider(QSlider *slider, QLabel *min, QLabel *max, QCheckBox *rev, int value);
void assignOutputChannel(UAVDataObject *obj, QString &str); void assignOutputChannel(UAVDataObject *obj, QString &str);
OutputChannelForm *getOutputChannelForm(const int index) const; OutputChannelForm *getOutputChannelForm(const int index) const;
void sendAllChannelTests();
int mccDataRate; int mccDataRate;
UAVObject::Metadata accInitialData; UAVObject::Metadata accInitialData;

View File

@ -120,6 +120,9 @@ margin:1px;</string>
<property name="buttonSymbols"> <property name="buttonSymbols">
<enum>QAbstractSpinBox::UpDownArrows</enum> <enum>QAbstractSpinBox::UpDownArrows</enum>
</property> </property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="maximum"> <property name="maximum">
<number>9999</number> <number>9999</number>
</property> </property>
@ -670,6 +673,9 @@ margin:1px;</string>
<property name="buttonSymbols"> <property name="buttonSymbols">
<enum>QAbstractSpinBox::UpDownArrows</enum> <enum>QAbstractSpinBox::UpDownArrows</enum>
</property> </property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="maximum"> <property name="maximum">
<number>9999</number> <number>9999</number>
</property> </property>
@ -762,6 +768,9 @@ margin:1px;</string>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="maximum"> <property name="maximum">
<number>9999</number> <number>9999</number>
</property> </property>

View File

@ -76,8 +76,10 @@ QIODevice *LoggingConnection::openDevice(const QString &deviceName)
QString fileName = QFileDialog::getOpenFileName(NULL, tr("Open file"), QString(""), tr("OpenPilot Log (*.opl)")); QString fileName = QFileDialog::getOpenFileName(NULL, tr("Open file"), QString(""), tr("OpenPilot Log (*.opl)"));
if (!fileName.isNull()) { if (!fileName.isNull()) {
startReplay(fileName); startReplay(fileName);
return &logFile;
} }
return &logFile;
return NULL;
} }
void LoggingConnection::startReplay(QString file) void LoggingConnection::startReplay(QString file)