Skip to content

Commit 805c314

Browse files
committed
Various enhancements
1 parent 582b8b8 commit 805c314

File tree

5 files changed

+43
-15
lines changed

5 files changed

+43
-15
lines changed

qmlui/main.qml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ Window {
2121
Text {
2222
color: extplaneClient.extplaneConnection.connected ? "white" : "red"
2323
text: extplaneClient.connectionMessage + " " + extplaneClient.extplaneConnection.networkError
24+
onTextChanged: {
25+
opacity = 1
26+
opacityAnimation.start()
27+
}
28+
NumberAnimation on opacity { id: opacityAnimation; to: 0; duration: 10*1000}
2429
}
2530

2631
Item {

qmlui/panelitems/needle/AirspeedIndicator.qml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,40 @@ PanelItems.PanelItem {
5050
scaleFactor: unitConverter.scaleFactor
5151
}
5252

53+
CircularGaugeBars {
54+
id: thinValueBars
55+
barValue: settings.thinBarValue
56+
valueMax: valueBars.valueMax
57+
showLastValue: true
58+
}
59+
5360
CircularGaugeBars {
5461
id: valueBars
5562

5663
thickBars: true
5764
showValue: true
65+
fontSizeMultiplier: 0.7
5866
barValue: settings.thickBarValue
59-
valueMax: vneRef.value || 100
67+
valueMax: Math.round(vneRef.value) || 200
68+
Component.onCompleted: console.log("Thick bars", barCount, barAngle, "values", valueMax, barValue)
6069

6170
GaugeArc { // Vne bar
6271
anchors.fill: parent
6372
arcColor: "red"
64-
z: -10
6573
startAngle: valueBars.value2Angle(vneRef.value)
6674
arcAngle: 0.3
6775
arcWidth: width * 0.06
6876
}
6977
GaugeArc { // Yellow arc
7078
anchors.fill: parent
7179
arcColor: "yellow"
72-
z: -20
7380
startAngle: valueBars.value2Angle(vnoRef.value)
7481
arcAngle: valueBars.value2Angle(vneRef.value) - startAngle
7582
arcWidth: arcWidth
7683
}
7784
GaugeArc { // Vno arc
7885
anchors.fill: parent
7986
arcColor: "green"
80-
z: -20
8187
startAngle: valueBars.value2Angle(vsRef.value)
8288
arcAngle: valueBars.value2Angle(vnoRef.value) -startAngle
8389
arcWidth: arcWidth
@@ -88,15 +94,10 @@ PanelItems.PanelItem {
8894
anchors.fill: parent
8995
radius: width / 2 - 2*arcWidth
9096
arcColor: "white"
91-
z: -30
9297
startAngle: valueBars.value2Angle(vsoRef.value)
9398
arcAngle: valueBars.value2Angle(vfeRef.value) - startAngle
9499
arcWidth: arcWidth
95100
}
96-
CircularGaugeBars {
97-
barValue: settings.thinBarValue
98-
valueMax: valueBars.valueMax
99-
}
100101
Text {
101102
text: unitConverter.outUnitName
102103
color: "white"

qmlui/panelitems/needle/Altimeter.qml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,30 @@ PanelItems.PanelItem {
3232
name: "sim/cockpit/misc/barometer_setting"
3333
scaleFactor: pressureConverter.scaleFactor
3434
}
35-
35+
CircularGaugeBars {
36+
barValue: 100
37+
valueMax: 10000
38+
valueMultiplier: 1000
39+
barsAngleMin: 90
40+
barsAngle: 359
41+
showLastValue: false
42+
}
43+
CircularGaugeBars {
44+
longBars: true
45+
barValue: 500
46+
valueMax: 10000
47+
valueMultiplier: 1000
48+
barsAngleMin: 90
49+
barsAngle: 359
50+
showLastValue: false
51+
}
3652
CircularGaugeBars {
3753
id: valueBars
3854

3955
thickBars: true
4056
showValue: true
41-
barValue: settings.isMs ? 1000 : 1000
42-
valueMax: settings.isMs ? 10000 : 10000
57+
barValue: 1000
58+
valueMax: 10000
4359
valueMultiplier: 1000
4460
barsAngleMin: 90
4561
barsAngle: 359

qmlui/panelitems/needle/CircularGaugeBars.qml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@ import QtQuick 2.0
22

33
Item { // Gets parent size
44
property bool thickBars: false // Thick or thin bars
5+
property bool longBars: thickBars // Long bars
56
property bool showValue: false // Show values as numbers
67
property bool showLastValue: true // Can be used to hide last value (for 360 degree gauges)
8+
property bool absValue: false // Don't show negative numbers with -
79
property bool limitAngle: false // Limit value2angle between min & max values
810
property real valueMin: 0 // Minimum value to show
911
property real valueMax: 100 // Maximum value to show
1012
property real barValue: 10 // Value of one bar
1113
property int barsAngleMin: -90 // Angle of minimum value, 0=west
1214
property int barsAngle: 270 // Total angle of values
1315
property real valueMultiplier: 1 // Multiplier of value labels
16+
property real fontSizeMultiplier: 1
1417

1518
readonly property int barCount: valueRange / barValue + 1
1619
readonly property real valueRange: valueMax - valueMin
@@ -37,18 +40,19 @@ Item { // Gets parent size
3740
transformOrigin: Item.Center
3841
Rectangle {
3942
color: "white"
40-
width: thickBars ? 50 : 25
43+
width: longBars ? 50 : 25
4144
height: thickBars ? 15 : 5
4245
antialiasing: true
4346
}
4447
Text {
4548
x: 70
4649
visible: showValue && (showLastValue || index < barCount - 1)
4750
color: "white"
48-
font.pixelSize: Math.min((barsItem.width / barCount) * 1.1, 100)
51+
font.pixelSize: 100 * fontSizeMultiplier
4952
rotation: -barItem.rotation
5053
anchors.verticalCenter: parent.verticalCenter
51-
text: Math.round((index * barValue + valueMin) / valueMultiplier)
54+
text: absValue ? Math.abs(value) : value
55+
property int value: Math.round((index * barValue + valueMin) / valueMultiplier)
5256
}
5357
}
5458
}

qmlui/panelitems/needle/Variometer.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ PanelItems.PanelItem {
4646

4747
thickBars: true
4848
showValue: true
49+
absValue: true
50+
fontSizeMultiplier: 1.3
4951
barValue: settings.isMs ? 1 : 200
5052
valueMax: settings.isMs ? 5 : 1000
5153
valueMin: -valueMax

0 commit comments

Comments
 (0)