From ff8e1e4f5ac95a810488e477e5256c26758975f1 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 12 Jun 2012 08:31:06 +0200 Subject: [PATCH] Minor tweaks and improvements --- images/style-mission.css | 17 +++++++++-------- src/uas/UAS.cc | 4 +++- src/ui/MAVLinkDecoder.cc | 4 +++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/images/style-mission.css b/images/style-mission.css index 7a19cadb8..a1f78db1c 100644 --- a/images/style-mission.css +++ b/images/style-mission.css @@ -184,13 +184,14 @@ QDoubleSpinBox::down-button { } QPushButton { - font-weight: bold; + /*font-weight: bold; min-height: 18px; max-height: 18px; + min-width: 60px;*/ border: 2px solid #4A4A4F; - border-radius: 5px; - padding-left: 5px; - padding-right: 5px; + border-radius: 3px; + padding-left: 8px; + padding-right: 8px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #232228, stop: 1 #020208); } @@ -206,11 +207,11 @@ QPushButton:pressed { QToolButton { font-weight: bold; - min-height: 16px; + min-height: 18px; min-width: 24px; max-height: 18px; border: 2px solid #4A4A4F; - border-radius: 5px; + border-radius: 3px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #232228, stop: 1 #020208); } @@ -225,8 +226,8 @@ QToolButton:pressed { } QToolTip { - background-color: #090909; - border: 1px solid #379AC3; + background-color: #090909; + border: 1px solid #379AC3; border-radius: 3px; color: #DDDDDF; } diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 1ecba13ee..d2dbb3b33 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -743,7 +743,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) mavlink_param_value_t value; mavlink_msg_param_value_decode(&message, &value); QByteArray bytes(value.param_id, MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN); - QString parameterName = QString(bytes); + // Construct a string stopping at the first NUL (0) character, else copy the whole + // byte array (max MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN, so safe) + QString parameterName(bytes); int component = message.compid; mavlink_param_union_t val; val.param_float = value.param_value; diff --git a/src/ui/MAVLinkDecoder.cc b/src/ui/MAVLinkDecoder.cc index f62fd8b68..08aa30168 100644 --- a/src/ui/MAVLinkDecoder.cc +++ b/src/ui/MAVLinkDecoder.cc @@ -28,8 +28,10 @@ MAVLinkDecoder::MAVLinkDecoder(MAVLinkProtocol* protocol, QObject *parent) : messageFilter.insert(MAVLINK_MSG_ID_MISSION_COUNT, false); messageFilter.insert(MAVLINK_MSG_ID_MISSION_ACK, false); messageFilter.insert(MAVLINK_MSG_ID_DATA_STREAM, false); - #ifdef MAVLINK_ENABLED_PIXHAWK + #ifdef MAVLINK_MSG_ID_ENCAPSULATED_DATA messageFilter.insert(MAVLINK_MSG_ID_ENCAPSULATED_DATA, false); + #endif + #ifdef MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE messageFilter.insert(MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, false); #endif messageFilter.insert(MAVLINK_MSG_ID_EXTENDED_MESSAGE, false); -- 2.22.0