Skip to content

Commit 646c55b

Browse files
author
Scott Vincent
committed
Major release (64-bit)
1 parent 154d352 commit 646c55b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+361
-87
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ You can also run the display on a PC (the same one running FS2020 if you wish) b
1010

1111
Download the following two zip files.
1212

13-
Link: [Latest release of Instrument Panel for Windows](https://github.com/scott-vincent/instrument-panel/releases/latest/download/instrument-panel-v1.7.8-Windows-x64.zip)
13+
Link: [Latest release of Instrument Panel for Windows](https://github.com/scott-vincent/instrument-panel/releases/latest/download/instrument-panel-v2.0.0-Windows-x64.zip)
1414

15-
Link: [Latest release of Instrument Data Link for Windows](https://github.com/scott-vincent/instrument-data-link/releases/latest/download/instrument-data-link-v1.7.8-windows-x64.zip)
15+
Link: [Latest release of Instrument Data Link for Windows](https://github.com/scott-vincent/instrument-data-link/releases/latest/download/instrument-data-link-v2.0.0-windows-x64.zip)
1616

1717
Unzip instrument-data-link into its own folder and double-click instrument-data-link.exe to run it.
1818

@@ -36,10 +36,13 @@ sudo apt install liballegro5-dev
3636
To Download:
3737
```
3838
tag=`curl -s -i https://github.com/scott-vincent/instrument-panel/releases/latest|grep location|cut -d '/' -f 8|tr -d '\r'`
39-
wget https://github.com/scott-vincent/instrument-panel/releases/download/$tag/instrument-panel-$tag-raspi4.tar.gz
39+
wget https://github.com/scott-vincent/instrument-panel/releases/download/$tag/instrument-panel-$tag-raspi5-64.tar.gz
4040
tar -xf instrument-panel-v* --one-top-level
4141
rm instrument-panel-v*.gz
4242
```
43+
44+
NOTE: Version 2.0.0 and later is built for 64-bit OS only. If you are running a 32-bit OS please download version 1.7.8 instead.
45+
4346
To Run:
4447

4548
Make sure you do this from a terminal started under a desktop session, not using SSH.
@@ -58,7 +61,7 @@ Power/Lights Panel: https://github.com/scott-vincent/power-lights-panel
5861

5962
# Releases
6063

61-
Ready-built releases for Windows x64 and Raspberry Pi 4 can be found by clicking on the Releases section on the right of this readme.
64+
Ready-built releases for Windows x64 and Raspberry Pi 5 (64-bit) can be found by clicking on the Releases section on the right of this readme. The newer releases (v2.0.0 and later) will also run fine on a Raspberry Pi 4 (64-bit).
6265

6366
# Introduction
6467

instrument-panel/globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void identifyAircraft(char* aircraft)
8787
/// <summary>
8888
/// Server can send us a delta rather than full data so we need to unpack it.
8989
/// </summary>
90-
void receiveDelta(char *deltaData, long deltaSize, char* simVarsPtr)
90+
void receiveDelta(char *deltaData, int deltaSize, char* simVarsPtr)
9191
{
9292
char* dataPtr = deltaData;
9393

instrument-panel/instrument-panel.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@
9191
#include "savageCub/comSavageCub.h"
9292
#include "savageCub/xpdrSavageCub.h"
9393

94+
// If you don't have any hardware knobs uncomment the next line
95+
//#define NoKnobs
96+
97+
// If you have an older Raspberry Pi uncomment the next line to use WiringPi instead of gpiod
98+
//#define NoGpiod
99+
94100
#ifdef NoKnobs
95101
const bool HaveHardwareKnobs = false;
96102
#else

instrument-panel/instruments/adf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void adf::update()
130130
}
131131

132132
// Check for position or size change
133-
long *settings = globals.simVars->readSettings(name, xPos, yPos, size);
133+
int *settings = globals.simVars->readSettings(name, xPos, yPos, size);
134134

135135
xPos = settings[0];
136136
yPos = settings[1];

instrument-panel/instruments/adi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void adi::render()
174174
void adi::update()
175175
{
176176
// Check for position or size change
177-
long *settings = globals.simVars->readSettings(name, xPos, yPos, size);
177+
int *settings = globals.simVars->readSettings(name, xPos, yPos, size);
178178

179179
xPos = settings[0];
180180
yPos = settings[1];

instrument-panel/instruments/alt.cpp

Lines changed: 139 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ void alt::update()
227227
}
228228

229229
// Check for position or size change
230-
long *settings = globals.simVars->readSettings(name, xPos, yPos, size);
230+
int *settings = globals.simVars->readSettings(name, xPos, yPos, size);
231231

232232
xPos = settings[0];
233233
yPos = settings[1];
@@ -290,7 +290,8 @@ void alt::updateKnobs()
290290
int diff = (val - prevVal) / 2;
291291
bool switchBox = false;
292292

293-
if (prevValSb == 0) {
293+
// Don't set pressure in Navigation mode
294+
if (simVars->sbMode == 4 || prevValSb == 0) {
294295
prevValSb = simVars->sbEncoder[2];
295296
}
296297
else if (simVars->sbEncoder[2] != prevValSb) {
@@ -324,6 +325,142 @@ void alt::updateKnobs()
324325
lastCalAdjust = 0;
325326
}
326327
}
328+
329+
// Do all Navigation (G1000) knobs here
330+
331+
// 2nd knob rotate = MFD Range (Zoom)
332+
if (simVars->sbMode != 4 || prevZoomSb == 0) {
333+
prevZoomSb = simVars->sbEncoder[2];
334+
}
335+
else if (simVars->sbEncoder[2] != prevZoomSb) {
336+
val = simVars->sbEncoder[2];
337+
diff = val - prevZoomSb;
338+
if (diff > 0) {
339+
globals.simVars->write(KEY_G1000_MFD_RANGE_DEC);
340+
}
341+
else {
342+
globals.simVars->write(KEY_G1000_MFD_RANGE_INC);
343+
}
344+
prevZoomSb = val;
345+
}
346+
347+
// 3rd knob rotate = MFD Lower
348+
if (simVars->sbMode != 4 || prevOuterSb == 0) {
349+
prevOuterSb = simVars->sbEncoder[1];
350+
}
351+
else if (simVars->sbEncoder[1] != prevOuterSb) {
352+
val = simVars->sbEncoder[1];
353+
diff = val - prevOuterSb;
354+
if (diff > 0) {
355+
globals.simVars->write(KEY_G1000_MFD_LOWER_INC);
356+
}
357+
else {
358+
globals.simVars->write(KEY_G1000_MFD_LOWER_DEC);
359+
}
360+
prevOuterSb = val;
361+
}
362+
363+
// 4th knob rotate = MFD Upper
364+
if (simVars->sbMode != 4 || prevInnerSb == 0) {
365+
prevInnerSb = simVars->sbEncoder[0];
366+
}
367+
else if (simVars->sbEncoder[0] != prevInnerSb) {
368+
val = simVars->sbEncoder[0];
369+
diff = val - prevInnerSb;
370+
if (diff > 0) {
371+
globals.simVars->write(KEY_G1000_MFD_UPPER_INC);
372+
}
373+
else {
374+
globals.simVars->write(KEY_G1000_MFD_UPPER_DEC);
375+
}
376+
prevInnerSb = val;
377+
}
378+
379+
// Do all Navigation (G1000) pushes here
380+
381+
// 1st knob click = MFD Enter
382+
if (simVars->sbMode != 4 || prevEnterSb == 0) {
383+
prevEnterSb = simVars->sbButton[3];
384+
}
385+
else if (simVars->sbButton[3] != prevEnterSb) {
386+
val = simVars->sbButton[3];
387+
if (val % 2 == 0) {
388+
globals.simVars->write(KEY_G1000_MFD_ENT);
389+
}
390+
prevEnterSb = val;
391+
}
392+
393+
// 2nd knob click = Button 10 (Follow)
394+
if (simVars->sbMode != 4 || prevButton10Sb == 0) {
395+
prevButton10Sb = simVars->sbButton[2];
396+
}
397+
else if (simVars->sbButton[2] != prevButton10Sb) {
398+
val = simVars->sbButton[2];
399+
if (val % 2 == 0) {
400+
globals.simVars->write(KEY_G1000_MFD_SOFTKEY_10);
401+
}
402+
prevButton10Sb = val;
403+
}
404+
405+
// 3rd knob click = MFD Push
406+
if (simVars->sbMode != 4 || prevOuterPushSb == 0) {
407+
prevOuterPushSb = simVars->sbButton[1];
408+
}
409+
else if (simVars->sbButton[1] != prevOuterPushSb) {
410+
val = simVars->sbButton[1];
411+
if (val % 2 == 0) {
412+
globals.simVars->write(KEY_G1000_MFD_PUSH);
413+
}
414+
prevOuterPushSb = val;
415+
}
416+
417+
// 4th knob click = MFD Push (again)
418+
if (simVars->sbMode != 4 || prevInnerPushSb == 0) {
419+
prevInnerPushSb = simVars->sbButton[0];
420+
}
421+
else if (simVars->sbButton[0] != prevInnerPushSb) {
422+
val = simVars->sbButton[0];
423+
if (val % 2 == 0) {
424+
globals.simVars->write(KEY_G1000_MFD_PUSH);
425+
}
426+
prevInnerPushSb = val;
427+
}
428+
429+
// 2nd button click = Soft Button 5 (IFR High Map / Activate Flight Plan)
430+
if (simVars->sbMode != 4 || prevButton5Sb == 0) {
431+
prevButton5Sb = simVars->sbButton[6];
432+
}
433+
else if (simVars->sbButton[6] != prevButton5Sb) {
434+
val = simVars->sbButton[6];
435+
if (val % 2 == 0) {
436+
globals.simVars->write(KEY_G1000_MFD_SOFTKEY_5);
437+
}
438+
prevButton5Sb = val;
439+
}
440+
441+
// 3rd button click = Soft Button 7 (VFR Map)
442+
if (simVars->sbMode != 4 || prevButton7Sb == 0) {
443+
prevButton7Sb = simVars->sbButton[5];
444+
}
445+
else if (simVars->sbButton[5] != prevButton7Sb) {
446+
val = simVars->sbButton[5];
447+
if (val % 2 == 0) {
448+
globals.simVars->write(KEY_G1000_MFD_SOFTKEY_7);
449+
}
450+
prevButton7Sb = val;
451+
}
452+
453+
// 4th button click = Soft Button 8 (World Map)
454+
if (simVars->sbMode != 4 || prevButton8Sb == 0) {
455+
prevButton8Sb = simVars->sbButton[4];
456+
}
457+
else if (simVars->sbButton[4] != prevButton8Sb) {
458+
val = simVars->sbButton[4];
459+
if (val % 2 == 0) {
460+
globals.simVars->write(KEY_G1000_MFD_SOFTKEY_8);
461+
}
462+
prevButton8Sb = val;
463+
}
327464
}
328465

329466
#endif // !_WIN32

instrument-panel/instruments/alt.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ class alt : public instrument
2121
int calKnob = -1;
2222
int prevVal = 0;
2323
int prevValSb = 0;
24+
int prevZoomSb = 0;
25+
int prevOuterSb = 0;
26+
int prevInnerSb = 0;
27+
int prevOuterPushSb = 0;
28+
int prevInnerPushSb = 0;
29+
int prevEnterSb = 0;
30+
int prevButton10Sb = 0;
31+
int prevButton5Sb = 0;
32+
int prevButton7Sb = 0;
33+
int prevButton8Sb = 0;
2434
time_t lastCalAdjust = 0;
2535
time_t now;
2636

instrument-panel/instruments/alternate/altFast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ void altFast::updateCustom(double inhgVal)
256256
inhg = inhgVal;
257257

258258
// Check for position or size change
259-
long *settings = globals.simVars->readSettings(name, xPos, yPos, size);
259+
int *settings = globals.simVars->readSettings(name, xPos, yPos, size);
260260

261261
xPos = settings[0];
262262
yPos = settings[1];

instrument-panel/instruments/alternate/asiFast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void asiFast::render()
163163
void asiFast::update()
164164
{
165165
// Check for position or size change
166-
long *settings = globals.simVars->readSettings(name, xPos, yPos, size);
166+
int *settings = globals.simVars->readSettings(name, xPos, yPos, size);
167167

168168
xPos = settings[0];
169169
yPos = settings[1];

instrument-panel/instruments/alternate/asiSupersonic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void asiSupersonic::render()
9292
void asiSupersonic::update()
9393
{
9494
// Check for position or size change
95-
long *settings = globals.simVars->readSettings(name, xPos, yPos, size);
95+
int *settings = globals.simVars->readSettings(name, xPos, yPos, size);
9696

9797
xPos = settings[0];
9898
yPos = settings[1];

0 commit comments

Comments
 (0)