Unverified Commit 37050a59 authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #7625 from mavlink/customTweaks

Custom tweaks
parents 800b2236 2998176c
...@@ -61,7 +61,7 @@ Button { ...@@ -61,7 +61,7 @@ Button {
width: height width: height
sourceSize.height: parent.height sourceSize.height: parent.height
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
color: qgcPal.buttonText color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
source: "/qmlimages/PaperPlane.svg" source: "/qmlimages/PaperPlane.svg"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
...@@ -71,13 +71,13 @@ Button { ...@@ -71,13 +71,13 @@ Button {
QGCLabel { QGCLabel {
text: qsTr("Vehicle ") + (vehicle ? vehicle.id : qsTr("None")) text: qsTr("Vehicle ") + (vehicle ? vehicle.id : qsTr("None"))
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
color: qgcPal.buttonText color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
} }
Row { Row {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
text: vehicle ? vehicle.flightMode : qsTr("None") text: vehicle ? vehicle.flightMode : qsTr("None")
color: qgcPal.buttonText color: button.checked ? qgcPal.buttonHighlightText : qgcPal.buttonText
} }
Rectangle { Rectangle {
height: ScreenTools.defaultFontPixelHeight * 0.5 height: ScreenTools.defaultFontPixelHeight * 0.5
......
...@@ -491,7 +491,7 @@ Item { ...@@ -491,7 +491,7 @@ Item {
id: multiVehicleSelector id: multiVehicleSelector
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: ScreenTools.defaultFontPixelWidth anchors.bottomMargin: ScreenTools.defaultFontPixelWidth * 1.5
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.multiVehicleManager.vehicles.count > 1 visible: QGroundControl.multiVehicleManager.vehicles.count > 1
...@@ -501,6 +501,9 @@ Item { ...@@ -501,6 +501,9 @@ Item {
property var _vehicle: QGroundControl.multiVehicleManager.vehicles.get(modelData) property var _vehicle: QGroundControl.multiVehicleManager.vehicles.get(modelData)
vehicle: _vehicle vehicle: _vehicle
checked: (_vehicle && activeVehicle) ? _vehicle.id === activeVehicle.id : false checked: (_vehicle && activeVehicle) ? _vehicle.id === activeVehicle.id : false
onClicked: {
QGroundControl.multiVehicleManager.activeVehicle = _vehicle
}
} }
} }
} }
......
...@@ -281,7 +281,7 @@ CustomPlugin::paletteOverride(QString colorName, QGCPalette::PaletteColorInfo_t& ...@@ -281,7 +281,7 @@ CustomPlugin::paletteOverride(QString colorName, QGCPalette::PaletteColorInfo_t&
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#9d9d9d"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#9d9d9d");
} }
else if (colorName == QStringLiteral("buttonHighlight")) { else if (colorName == QStringLiteral("buttonHighlight")) {
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor("#6EF880"); colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor("#F3BC5E");
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor("#222a35"); colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor("#222a35");
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor("#edcfb4"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor("#edcfb4");
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#e4e4e4"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#e4e4e4");
...@@ -299,9 +299,9 @@ CustomPlugin::paletteOverride(QString colorName, QGCPalette::PaletteColorInfo_t& ...@@ -299,9 +299,9 @@ CustomPlugin::paletteOverride(QString colorName, QGCPalette::PaletteColorInfo_t&
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#585858"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#585858");
} }
else if (colorName == QStringLiteral("primaryButtonText")) { else if (colorName == QStringLiteral("primaryButtonText")) {
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor("#ffffff"); colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupEnabled] = QColor("#29313A");
colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor("#777c89"); colorInfo[QGCPalette::Dark][QGCPalette::ColorGroupDisabled] = QColor("#777c89");
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor("#ffffff"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupEnabled] = QColor("#29313A");
colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#cad0d0"); colorInfo[QGCPalette::Light][QGCPalette::ColorGroupDisabled] = QColor("#cad0d0");
} }
else if (colorName == QStringLiteral("textField")) { else if (colorName == QStringLiteral("textField")) {
......
...@@ -104,6 +104,7 @@ MockLink::MockLink(SharedLinkConfigurationPointer& config) ...@@ -104,6 +104,7 @@ MockLink::MockLink(SharedLinkConfigurationPointer& config)
_adsbVehicleCoordinate = QGeoCoordinate(_vehicleLatitude, _vehicleLongitude).atDistanceAndAzimuth(1000, _adsbAngle); _adsbVehicleCoordinate = QGeoCoordinate(_vehicleLatitude, _vehicleLongitude).atDistanceAndAzimuth(1000, _adsbAngle);
_adsbVehicleCoordinate.setAltitude(100); _adsbVehicleCoordinate.setAltitude(100);
_runningTime.start();
} }
MockLink::~MockLink(void) MockLink::~MockLink(void)
...@@ -176,6 +177,7 @@ void MockLink::_run1HzTasks(void) ...@@ -176,6 +177,7 @@ void MockLink::_run1HzTasks(void)
_sendHighLatency2(); _sendHighLatency2();
} else { } else {
_sendVibration(); _sendVibration();
_sendSysStatus();
_sendADSBVehicles(); _sendADSBVehicles();
if (!qgcApp()->runningUnitTests()) { if (!qgcApp()->runningUnitTests()) {
// Sending RC Channels during unit test breaks RC tests which does it's own RC simulation // Sending RC Channels during unit test breaks RC tests which does it's own RC simulation
...@@ -357,6 +359,28 @@ void MockLink::_sendHighLatency2(void) ...@@ -357,6 +359,28 @@ void MockLink::_sendHighLatency2(void)
respondWithMavlinkMessage(msg); respondWithMavlinkMessage(msg);
} }
void MockLink::_sendSysStatus(void)
{
if(_batteryRemaining > 50) {
_batteryRemaining = static_cast<int8_t>(100 - (_runningTime.elapsed() / 1000));
}
mavlink_message_t msg;
mavlink_msg_sys_status_pack_chan(
_vehicleSystemId,
_vehicleComponentId,
static_cast<uint8_t>(_mavlinkChannel),
&msg,
0, // onboard_control_sensors_present
0, // onboard_control_sensors_enabled
0, // onboard_control_sensors_health
250, // load
4200 * 4, // voltage_battery
8000, // current_battery
_batteryRemaining, // battery_remaining
0,0,0,0,0,0);
respondWithMavlinkMessage(msg);
}
void MockLink::_sendVibration(void) void MockLink::_sendVibration(void)
{ {
mavlink_message_t msg; mavlink_message_t msg;
......
...@@ -196,6 +196,7 @@ private: ...@@ -196,6 +196,7 @@ private:
void _sendHomePosition(void); void _sendHomePosition(void);
void _sendGpsRawInt(void); void _sendGpsRawInt(void);
void _sendVibration(void); void _sendVibration(void);
void _sendSysStatus(void);
void _sendStatusTextMessages(void); void _sendStatusTextMessages(void);
void _respondWithAutopilotVersion(void); void _respondWithAutopilotVersion(void);
void _sendRCChannels(void); void _sendRCChannels(void);
...@@ -226,6 +227,9 @@ private: ...@@ -226,6 +227,9 @@ private:
uint32_t _mavCustomMode; uint32_t _mavCustomMode;
uint8_t _mavState; uint8_t _mavState;
QTime _runningTime;
int8_t _batteryRemaining = 100;
MAV_AUTOPILOT _firmwareType; MAV_AUTOPILOT _firmwareType;
MAV_TYPE _vehicleType; MAV_TYPE _vehicleType;
double _vehicleLatitude; double _vehicleLatitude;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment