Skip to content

Commit 0b92220

Browse files
committed
Remove enum to support older Qt versions, fix debian package dependencies
1 parent 2ee2879 commit 0b92220

File tree

8 files changed

+36
-19
lines changed

8 files changed

+36
-19
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
extplane-panel (2.0.1) UNRELEASED; urgency=low
2+
3+
* 2.0.1, Fixed dependencies
4+
5+
-- Ville Ranki <ville.ranki@iki.fi> Thu, 19 Sep 2019 12:34:56 +0300
6+
17
extplane-panel (2.0.0) UNRELEASED; urgency=low
28

39
* 2.0, QML based ui. Trying to return debian packaging.

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Homepage: https://github.com/vranki/ExtPlane-Panel
88

99
Package: extplane-panel
1010
Architecture: any
11-
Depends: ${shlibs:Depends}, ${misc:Depends},
11+
Depends: ${shlibs:Depends}, ${misc:Depends}, qml-module-qt-labs-settings, qml-module-qtquick-layouts, qml-module-qtquick-window2, qml-module-qtquick2, qml-module-qtquick-dialogs, qml-module-qtquick-controls
1212
Description: An external, networked cockpit panel for X-Plane flight simulator and a couple of others.
1313
It is possible to run this panel on the same computer or another computer on the
1414
network to display cockpit instruments from remote X-Plane.

qmlui/UnitConverter.qml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import QtQuick 2.0
22

33
Item {
44
property real valueIn: 0
5-
property real valueOut: convertUnit(valueIn)
5+
readonly property real valueOut: valueIn * scaleFactor
66
property int inUnit: 0
77
property int outUnit: 0
88
readonly property real scaleFactor: unitTable[inUnit] * (1/unitTable[outUnit])
99
readonly property string inUnitName: unitNames[inUnit]
1010
readonly property string outUnitName: unitNames[outUnit]
1111

12+
/*
13+
// Enums supprted in Qt >= 5.10 - enable when it time comes.
1214
enum Unit {
1315
NoUnit,
1416
VelocityKnots,
@@ -23,12 +25,22 @@ Item {
2325
TurnRateRPM,
2426
TurnRateRadiansPerSecond
2527
}
28+
*/
29+
readonly property int uNoUnit: 0
30+
readonly property int uVelocityKnots: 1
31+
readonly property int uVelocityMS: 2
32+
readonly property int uVelocityKMH: 3
33+
readonly property int uVelocityFPM: 4
34+
readonly property int uDistanceMeters: 5
35+
readonly property int uDistanceFeet: 6
36+
readonly property int uPressurehPa: 7
37+
readonly property int uPressureInHG: 8
38+
readonly property int uPressureBar: 9
39+
readonly property int uTurnRateRPM: 10
40+
readonly property int uTurnRateRadiansPerSecond: 11
41+
2642
// Conversion table from unit to SI standard unit
2743
readonly property var unitTable: [1, 0.514444, 1, 0.277778, 0.00508, 1, 0.3048, 1, 33.86, 1000, 1, 9.549296586]
2844
// Unit names
2945
readonly property var unitNames: ["No unit", "Knots", "m/s", "km/h", "fpm", "m", "ft", "hPa", "InHg", "Bar", "RPM", "Rad/s"]
30-
31-
function convertUnit(value) {
32-
return value * scaleFactor
33-
}
3446
}

qmlui/panelitems/needle/AirspeedIndicator.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ PanelItems.PanelItem {
1313

1414
Panel.UnitConverter {
1515
id: unitConverter
16-
inUnit: Panel.UnitConverter.Unit.VelocityKnots
17-
outUnit: settings.isKmh ? Panel.UnitConverter.Unit.VelocityKMH : Panel.UnitConverter.Unit.VelocityKnots
16+
inUnit: uVelocityKnots
17+
outUnit: settings.isKmh ? uVelocityKMH : uVelocityKnots
1818
}
1919

2020
DataRef {

qmlui/panelitems/needle/Altimeter.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ PanelItems.PanelItem {
1111

1212
Panel.UnitConverter {
1313
id: altitudeConverter
14-
inUnit: Panel.UnitConverter.Unit.DistanceFeet
15-
outUnit: settings.isMs ? Panel.UnitConverter.Unit.DistanceMeters : Panel.UnitConverter.Unit.DistanceFeet
14+
inUnit: uDistanceFeet
15+
outUnit: settings.isMs ? uDistanceMeters : uDistanceFeet
1616
}
1717
Panel.UnitConverter {
1818
id: pressureConverter
19-
inUnit: Panel.UnitConverter.Unit.PressureInHG
20-
outUnit: settings.isMs ? Panel.UnitConverter.Unit.PressurehPa : Panel.UnitConverter.Unit.PressureInHG
19+
inUnit: uPressureInHG
20+
outUnit: settings.isMs ? uPressurehPa : uPressureInHG
2121
}
2222

2323
DataRef {

qmlui/panelitems/needle/EngineRpm.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ PanelItems.PanelItem {
2121
}
2222
Panel.UnitConverter {
2323
id: radianConverter
24-
inUnit: Panel.UnitConverter.TurnRateRadiansPerSecond
25-
outUnit: Panel.UnitConverter.TurnRateRPM
24+
inUnit: uTurnRateRadiansPerSecond
25+
outUnit: uTurnRateRPM
2626
}
2727

2828
CircularGauge {

qmlui/panelitems/needle/Variometer.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ PanelItems.PanelItem {
1111

1212
Panel.UnitConverter {
1313
id: unitConverter
14-
inUnit: Panel.UnitConverter.Unit.VelocityFPM
15-
outUnit: settings.isMs ? Panel.UnitConverter.Unit.VelocityMS : Panel.UnitConverter.Unit.VelocityFPM
14+
inUnit: uVelocityFPM
15+
outUnit: settings.isMs ? uVelocityMS : uVelocityFPM
1616
}
1717
Panel.UnitConverter {
1818
id: laminarUnitConverter
19-
inUnit: Panel.UnitConverter.Unit.VelocityMS
20-
outUnit: settings.isMs ? Panel.UnitConverter.Unit.VelocityMS : Panel.UnitConverter.Unit.VelocityFPM
19+
inUnit: uVelocityMS
20+
outUnit: settings.isMs ? uVelocityMS : uVelocityFPM
2121
}
2222

2323
DataRef {

qmlui/qmlui.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ QML_DESIGNER_IMPORT_PATH =
3434
# Default rules for deployment.
3535
qnx: target.path = /tmp/$${TARGET}/bin
3636
else: unix:!android: target.path = /opt/$${TARGET}/bin
37-
!isEmpty(target.path): INSTALLS += target
3837

3938
target.path = /usr/bin
4039

0 commit comments

Comments
 (0)