Skip to content

Commit 0beb03a

Browse files
committed
Cosmetic changes
1 parent ba11021 commit 0beb03a

27 files changed

+267
-262
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*.user
1+
*.user
2+
build
3+
Build

qml/BasicSix.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Window {
1111
minimumHeight: 600
1212
visibility: Window.Maximized
1313
title: "Basic Six Example"
14-
color: "#181818"
14+
color: "#ffffff"
1515

1616
property double scaleRatio: Math.min(height / 1080, width / 1920)
1717
property double radius: 250 * scaleRatio

qml/BasicSix/AirspeedIndicator.qml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,26 @@ Item {
88
property double airspeed: 0
99
property double angle: 0
1010

11-
onAirspeedChanged: update();
11+
onAirspeedChanged: update()
1212

1313
function update() {
1414
angle = airspeed
1515

16-
if (angle < 0.0) angle = 0.0
17-
else if (angle > 235.0) angle = 235.0
18-
19-
if (angle < 40.0) angle = 0.9 * angle
20-
else if (angle < 70.0) angle = 36.0 + 1.8 * (angle - 40.0)
21-
else if (angle < 130.0) angle = 90.0 + 2.0 * (angle - 70.0)
22-
else if (angle < 160.0) angle = 210.0 + 1.8 * (angle - 130.0)
23-
else angle = 264.0 + 1.2 * (angle - 160.0)
24-
16+
if (angle < 0.0)
17+
angle = 0.0
18+
else if (angle > 235.0)
19+
angle = 235.0
20+
21+
if (angle < 40.0)
22+
angle = 0.9 * angle
23+
else if (angle < 70.0)
24+
angle = 36.0 + 1.8 * (angle - 40.0)
25+
else if (angle < 130.0)
26+
angle = 90.0 + 2.0 * (angle - 70.0)
27+
else if (angle < 160.0)
28+
angle = 210.0 + 1.8 * (angle - 130.0)
29+
else
30+
angle = 264.0 + 1.2 * (angle - 160.0)
2531
}
2632

2733
CustomImage {

qml/BasicSix/Altimeter.qml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ Item {
1212
anchors.fill: parent
1313
source: "qrc:/data/images/alt/alt_face_1.svg"
1414
rotation: {
15-
var value = pressure
16-
if (value < 28.0) value = 28.0
17-
else if (value > 31.5) value = 31.5
15+
let value = pressure
16+
17+
if (value < 28.0)
18+
value = 28.0
19+
else if (value > 31.5)
20+
value = 31.5
1821

1922
return (value - 28.0) * 100.0
2023
}
@@ -29,7 +32,6 @@ Item {
2932
anchors.fill: parent
3033
source: "qrc:/data/images/alt/alt_face_3.svg"
3134
rotation: 0.0036 * altitude
32-
3335
}
3436

3537
CustomImage {

qml/BasicSix/AttitudeIndicator.qml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ Item {
1515
onRollChanged: update()
1616
onPitchChanged: update()
1717

18-
function update()
19-
{
18+
function update() {
2019
var tempPitch = pitch
21-
if(tempPitch < -20) tempPitch = -20
22-
if(tempPitch > 20) tempPitch = 20
20+
if (tempPitch < -20)
21+
tempPitch = -20
22+
if (tempPitch > 20)
23+
tempPitch = 20
2324

24-
deltaFaceX = (face.width / 240) * pixelPerDegree * tempPitch * Math.sin(Math.PI * roll / 180.0)
25+
deltaFaceX = (face.width / 240) * pixelPerDegree * tempPitch * Math.sin(Math.PI * roll / 180.0)
2526
deltaFaceY = (face.height / 240) * pixelPerDegree * tempPitch * Math.cos(Math.PI * roll / 180.0)
2627
}
2728

28-
2929
CustomImage {
3030
anchors.fill: parent
3131
source: "qrc:/data/images/ai/ai_back.svg"

qml/EFIS.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Window {
1313
minimumHeight: 600
1414
visibility: Window.Maximized
1515
title: "EFIS Example"
16-
color: "#181818"
16+
color: "#ffffff"
1717

1818
Item {
1919
id: container

qml/EFIS/EADI/AirspeedIndicator.qml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import QtQuick 2.0
22

3-
Item {
3+
Item {
44
width: 300
55
height: 300
66
clip: false
@@ -36,17 +36,18 @@ Item {
3636

3737
function update() {
3838

39-
var tempBugY = pixelPerSpeed * (airspeed - bugValue);
39+
let tempBugY = pixelPerSpeed * (airspeed - bugValue)
4040

41-
if ( tempBugY < -85.0 ) tempBugY = -85.0;
42-
else if ( tempBugY > 85.0 ) tempBugY = 85.0;
41+
if (tempBugY < -85.0)
42+
tempBugY = -85.0
43+
else if (tempBugY > 85.0)
44+
tempBugY = 85.0
4345

4446
bugY = tempBugY
4547

4648
canvas.requestPaint()
4749
}
4850

49-
5051
Canvas {
5152
id: canvas
5253
x: 25
@@ -79,7 +80,7 @@ Item {
7980
let lowestIndex = Math.round((airspeed - minimumAirspeed) / tickmarkStepSize - visibleTickmarkCount / 2)
8081
let highestIndex = Math.round(lowestIndex + visibleTickmarkCount)
8182

82-
if(lowestIndex < 0)
83+
if (lowestIndex < 0)
8384
lowestIndex = 0
8485

8586
for (var i = lowestIndex; i <= highestIndex; i++) {
@@ -115,10 +116,10 @@ Item {
115116
let lowestIndex = Math.round((airspeed - minimumAirspeed) / labelStepSize - visibleLabelCount / 2)
116117
let highestIndex = Math.round(lowestIndex + visibleLabelCount)
117118

118-
if(lowestIndex < 0)
119+
if (lowestIndex < 0)
119120
lowestIndex = 0
120121

121-
for (let i = lowestIndex; i <= highestIndex; i++) {
122+
for (var i = lowestIndex; i <= highestIndex; i++) {
122123
var valueString = i * labelStepSize
123124
var x = 26
124125
let y = 0.5 * height - i * labelStepSize * pixelPerSpeed
@@ -130,13 +131,11 @@ Item {
130131
// Low airspeed marker line
131132
{
132133
ctx.moveTo(36, 0.5 * height + 0.5)
133-
ctx.lineTo(36,
134-
0.5 * height - lowAirspeed * pixelPerSpeed)
134+
ctx.lineTo(36, 0.5 * height - lowAirspeed * pixelPerSpeed)
135135
ctx.strokeStyle = "#ffffff"
136136
ctx.lineWidth = 1
137137
ctx.stroke()
138138
}
139-
140139
}
141140
}
142141

qml/EFIS/EADI/Altimeter.qml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ Item {
2929

3030
function update() {
3131

32-
altitudeBugDeltaY = pixelPerAltitude * (altitude - bugValue);
32+
altitudeBugDeltaY = pixelPerAltitude * (altitude - bugValue)
3333

34-
if ( altitudeBugDeltaY < -85.0 ) altitudeBugDeltaY = -85.0;
35-
else if ( altitudeBugDeltaY > 85.0 ) altitudeBugDeltaY = 85.0;
34+
if (altitudeBugDeltaY < -85.0)
35+
altitudeBugDeltaY = -85.0
36+
else if (altitudeBugDeltaY > 85.0)
37+
altitudeBugDeltaY = 85.0
3638

3739
canvas.requestPaint()
3840
}
@@ -70,7 +72,7 @@ Item {
7072
var lowestIndex = Math.round((altitude - minimumAltitude) / tickmarkStepSize - visibleTickmarkCount / 2)
7173
var highestIndex = Math.round(lowestIndex + visibleTickmarkCount)
7274

73-
if(lowestIndex < 0)
75+
if (lowestIndex < 0)
7476
lowestIndex = 0
7577

7678
for (var i = lowestIndex; i <= highestIndex; i++) {
@@ -80,7 +82,6 @@ Item {
8082
ctx.stroke()
8183
}
8284

83-
8485
// Labels
8586
ctx.textAlign = "right"
8687
ctx.textBaseline = 'middle'
@@ -89,14 +90,14 @@ Item {
8990
lowestIndex = Math.round((altitude - minimumAltitude) / labelStepSize - visibleLabelCount / 2)
9091
highestIndex = Math.round(lowestIndex + visibleLabelCount)
9192

92-
if(lowestIndex < 0)
93+
if (lowestIndex < 0)
9394
lowestIndex = 0
9495

9596
for (i = lowestIndex; i <= highestIndex; i++) {
9697
var valueString = i * labelStepSize
9798
valueString = valueString.toFixed(0)
9899

99-
if(valueString.length < 4)
100+
if (valueString.length < 4)
100101
ctx.font = "11px 'Courier Std'"
101102
else if (valueString.length === 4)
102103
ctx.font = "10px 'Courier Std'"
@@ -159,6 +160,6 @@ Item {
159160
y: 26
160161
width: 42
161162
height: 12
162-
color : "#000000"
163+
color: "#000000"
163164
}
164165
}

qml/EFIS/EADI/Labels.qml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ Item {
4242
verticalAlignment: Text.AlignVCenter
4343
color: "#ffffff"
4444
antialiasing: true
45-
text: machNumber < 1 ? machNumber.toFixed(3).substring(1) :
46-
machNumber < 10 ? machNumber.toFixed(2) : machNumber.toFixed(1)
45+
text: machNumber < 1 ? machNumber.toFixed(3).substring(1) : machNumber < 10 ? machNumber.toFixed(2) : machNumber.toFixed(1)
4746
}
4847

4948
// Altitude bug
@@ -54,9 +53,8 @@ Item {
5453
width: 36
5554
height: 18
5655
font.family: "Courier Std"
57-
font.pixelSize: altitudeBug.toFixed(0).length < 4 ? 16 :
58-
altitudeBug.toFixed(0).length === 4 ? 14 :
59-
altitudeBug.toFixed(0).length === 5 ? 12 : 11
56+
font.pixelSize: altitudeBug.toFixed(0).length < 4 ? 16 : altitudeBug.toFixed(0).length === 4 ? 14 : altitudeBug.toFixed(
57+
0).length === 5 ? 12 : 11
6058
horizontalAlignment: Text.AlignRight
6159
verticalAlignment: Text.AlignVCenter
6260
color: "#ff00ff"
@@ -75,10 +73,7 @@ Item {
7573
anchors.horizontalCenter: altitudeBugText.horizontalCenter
7674
color: "#00ff00"
7775
antialiasing: true
78-
text: pressureMode === 0 ? "STD" :
79-
pressureMode === 1 ? pressure.toFixed(0) + " MB" :
80-
pressureMode === 2 ? pressure.toFixed(2) + " IN" : ""
81-
76+
text: pressureMode === 0 ? "STD" : pressureMode === 1 ? pressure.toFixed(0) + " MB" : pressureMode === 2 ? pressure.toFixed(2) + " IN" : ""
8277
}
8378

8479
// Flight Mode
@@ -93,9 +88,7 @@ Item {
9388
anchors.horizontalCenter: parent.horizontalCenter
9489
color: "#00ff00"
9590
antialiasing: true
96-
text: flightMode === 1 ? "FD" :
97-
flightMode === 2 ? "CMD" : ""
98-
91+
text: flightMode === 1 ? "FD" : flightMode === 2 ? "CMD" : ""
9992
}
10093

10194
// Speed Mode
@@ -109,7 +102,6 @@ Item {
109102
color: "#00ff00"
110103
antialiasing: true
111104
text: speedMode === 1 ? "FMC SPD" : ""
112-
113105
}
114106

115107
// LNAV TOP
@@ -124,13 +116,8 @@ Item {
124116
verticalAlignment: Text.AlignVCenter
125117
font.family: "Courier Std"
126118
antialiasing: true
127-
text: lnav === 1 ? "HDG SEL" :
128-
lnav === 2 ? "VOR/LOC" :
129-
lnav === 3 ? "HDG SEL" :
130-
lnav === 4 ? "APR" :
131-
lnav === 5 ? "APR" :
132-
lnav === 6 ? "BC" :
133-
lnav === 7 ? "BC" : ""
119+
text: lnav === 1 ? "HDG SEL" : lnav === 2 ? "VOR/LOC" : lnav === 3 ? "HDG SEL" : lnav
120+
=== 4 ? "APR" : lnav === 5 ? "APR" : lnav === 6 ? "BC" : lnav === 7 ? "BC" : ""
134121
}
135122

136123
// LNAV BOTTOM
@@ -144,9 +131,7 @@ Item {
144131
verticalAlignment: Text.AlignVCenter
145132
font.family: "Courier Std"
146133
antialiasing: true
147-
text: lnav === 3 ? "VOR LOC" :
148-
lnav === 5 ? "APR" :
149-
lnav === 7 ? "BC" : ""
134+
text: lnav === 3 ? "VOR LOC" : lnav === 5 ? "APR" : lnav === 7 ? "BC" : ""
150135
}
151136

152137
// VNAV TOP
@@ -160,12 +145,7 @@ Item {
160145
verticalAlignment: Text.AlignVCenter
161146
font.family: "Courier Std"
162147
antialiasing: true
163-
text: vnav === 1 ? "ALT" :
164-
vnav === 2 ? "IAS" :
165-
vnav === 3 ? "VS" :
166-
vnav === 4 ? "ALT SEL" :
167-
vnav === 5 ? "GS PATH" :
168-
vnav === 6 ? "GS PATH" : ""
148+
text: vnav === 1 ? "ALT" : vnav === 2 ? "IAS" : vnav === 3 ? "VS" : vnav === 4 ? "ALT SEL" : vnav === 5 ? "GS PATH" : vnav === 6 ? "GS PATH" : ""
169149
}
170150

171151
// VNAV BOTTOM

qml/EFIS/EADI/VerticalSpeedIndicator.qml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ Item {
1616
onClimbRateChanged: update()
1717

1818
function update() {
19-
20-
var lineDeltaY = 0
21-
var climbRateAbs = Math.abs(climbRate)
19+
let lineDeltaY = 0
20+
let climbRateAbs = Math.abs(climbRate)
2221

2322
if (Math.abs(climbRate) <= 1.0) {
2423
lineDeltaY = pixelPerSpeed1 * climbRateAbs

0 commit comments

Comments
 (0)