Skip to content

Commit

Permalink
cleaned up setup for raspberrypi
Browse files Browse the repository at this point in the history
fixed data crash
  • Loading branch information
blauret committed Oct 7, 2023
1 parent eeba7ad commit 0659718
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pyG5/pyG5Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,23 @@ def __init__(self):
self.mainWindow.setWindowFlags(
self.mainWindow.windowFlags() | Qt.FramelessWindowHint
)
self.mainWindow.setWindowState(Qt.WindowFullScreen)


self.mainWindow.show()

Check failure on line 110 in pyG5/pyG5Main.py

View workflow job for this annotation

GitHub Actions / Check flake8

E303 too many blank lines (2)

if self.args.mode == "full":
self.secondaryWindow = pyG5SecondWindow()

self.secondaryWindow.loadSettings()

if platform.machine() == "aarch64":
self.secondaryWindow.setWindowFlags(
self.secondaryWindow.windowFlags() | Qt.FramelessWindowHint
)

self.secondaryWindow.setWindowState(Qt.WindowFullScreen)

# connect the value coming from the simulator
self.networkManager.drefUpdate.connect(
self.secondaryWindow.cWidget.drefHandler
Expand All @@ -128,7 +134,6 @@ def __init__(self):
self.send_transponder_mode
)

self.secondaryWindow.loadSettings()

self.secondaryWindow.show()

Check failure on line 138 in pyG5/pyG5Main.py

View workflow job for this annotation

GitHub Actions / Check flake8

E303 too many blank lines (2)

Expand Down
4 changes: 2 additions & 2 deletions pyG5/pyG5Network.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def socketStateHandler(self):
# connect the multicast listenner to the connect function
self.listener.xpInstance.connect(self.xplaneConnect)

elif self.udpSock.state() == QAbstractSocket.LocalSocketState.UnconnectedState:
elif self.udpSock.state() == QAbstractSocket.SocketState.UnconnectedState:
# socket got disconnected issue reconnection
self.udpSock.bind(
QHostAddress.SpecialAddress.AnyIPv4, 0, QUdpSocket.BindFlag.ShareAddress
Expand Down Expand Up @@ -730,7 +730,7 @@ def dataHandler(self):
value = 0
for i in range(0, numvalues):
singledata = data[(5 + lenvalue * i) : (5 + lenvalue * (i + 1))]
(idx, value) = struct.unpack("<if", singledata)
(idx, value) = struct.unpack("<if", singledata.data())
retvalues[idx] = (
value,
self.datarefs[idx][1],
Expand Down

0 comments on commit 0659718

Please sign in to comment.