refactored

This commit is contained in:
2026-03-25 05:53:06 +01:00
parent 7c1e65253b
commit e5da1b663b
16 changed files with 30 additions and 27 deletions
+12 -12
View File
@@ -2,21 +2,21 @@ import socket
import selectors import selectors
import time import time
import signal import signal
from msg_container import MsgContainer
from nmea import NmeaPacketizer
from nmea import Gll, Gsa, Gsv, Gga, Rmc
from receiver.ubx_packetizer import UbxPacketizer
from receiver.ubx_listener import UbxListener
from transceiver import Transceiver
from a_backend import ABackend
from threading import Thread from threading import Thread
from queue import Queue from queue import Queue
from msg_container import MsgContainer
from transceiver import Transceiver
from a_backend import ABackend
from nmea import NmeaPacketizer
from nmea.messages import Gll, Gsa, Gsv, Gga, Rmc
from ubx.ubx import frame_create from ubx.ubx import frame_create
from ubx.msg import UbxMsg from ubx.packetizer import UbxPacketizer
from ubx.messages.nav import Sig, Sat from ubx.messages import Sig, Sat, RawX, UbxMsg
from ubx.messages.rxm import RawX from ubx.listener import UbxListener
class NetworkBackend(ABackend): class NetworkBackend(ABackend):
def __init__(self, servers: list[dict]): def __init__(self, servers: list[dict]):
-5
View File
@@ -1,6 +1 @@
from nmea.packetizer import NmeaPacketizer from nmea.packetizer import NmeaPacketizer
from nmea.GGA import Gga
from nmea.GLL import Gll
from nmea.GSA import Gsa
from nmea.GSV import Gsv
from nmea.RMC import Rmc
+5
View File
@@ -0,0 +1,5 @@
from nmea.messages.GGA import Gga
from nmea.messages.GLL import Gll
from nmea.messages.GSA import Gsa
from nmea.messages.GSV import Gsv
from nmea.messages.RMC import Rmc
View File
+1 -1
View File
@@ -1,7 +1,7 @@
from msg_container import MsgContainer from msg_container import MsgContainer
from msg_listener import MsgListener from msg_listener import MsgListener
from ubx.ubx import frame_parse, frame_parse_hdr from ubx.ubx import frame_parse, frame_parse_hdr
from ubx.msg import UbxMsg from ubx.messages.msg import UbxMsg
class UbxListener(MsgListener): class UbxListener(MsgListener):
def __init__(self, parser: UbxMsg, mclass: int|None = None, mid: int|None = None): def __init__(self, parser: UbxMsg, mclass: int|None = None, mid: int|None = None):
+3
View File
@@ -0,0 +1,3 @@
from ubx.messages.msg import UbxMsg
from ubx.messages.nav import Sig, Sat
from ubx.messages.rxm import RawX
View File
+3 -3
View File
@@ -1,7 +1,7 @@
import struct import struct
import ubx.msg from ubx.messages.msg import UbxMsg
class Sig(ubx.msg.UbxMsg): class Sig(UbxMsg):
class Group1: class Group1:
@classmethod @classmethod
def from_bytes(cls, data: bytes): def from_bytes(cls, data: bytes):
@@ -38,7 +38,7 @@ class Sig(ubx.msg.UbxMsg):
obj.signals.append(signal) obj.signals.append(signal)
return obj.__dict__ return obj.__dict__
class Sat(ubx.msg.UbxMsg): class Sat(UbxMsg):
class Group1: class Group1:
@classmethod @classmethod
def from_bytes(cls, data: bytes): def from_bytes(cls, data: bytes):
+2 -2
View File
@@ -1,7 +1,7 @@
import struct import struct
import ubx.msg from ubx.messages.msg import UbxMsg
class RawX(ubx.msg.UbxMsg): class RawX(UbxMsg):
class Group1: class Group1:
@classmethod @classmethod
def from_bytes(cls, data: bytes): def from_bytes(cls, data: bytes):
@@ -3,7 +3,7 @@ from msg_container import MsgContainer
from msg_listener import MsgListener from msg_listener import MsgListener
from msg_talker import MsgTalker from msg_talker import MsgTalker
from ubx.ubx import UBX_SYNC_WORD, frame_parse, frame_create from ubx.ubx import UBX_SYNC_WORD, frame_parse, frame_create
from receiver.ubx_listener import UbxListener from ubx.listener import UbxListener
UBX_PKT_DEBUG = False UBX_PKT_DEBUG = False
def ubx_pkt_debug(s: str): def ubx_pkt_debug(s: str):
+3 -3
View File
@@ -1,8 +1,8 @@
from msg_container import MsgContainer from msg_container import MsgContainer
from ubx.ubx import frame_parse, frame_parse_hdr, frame_create from ubx.ubx import frame_parse, frame_create
from ubx.msg import UbxMsg from ubx.messages.msg import UbxMsg
from transceiver import Transceiver from transceiver import Transceiver
from receiver.ubx_listener import UbxListener from ubx.listener import UbxListener
from threading import BoundedSemaphore from threading import BoundedSemaphore
class UbxQuery(UbxListener): class UbxQuery(UbxListener):