Skip to content

Commit a2dfda6

Browse files
committed
SatDump frm-files extend
1 parent 453e2de commit a2dfda6

10 files changed

Lines changed: 15 additions & 7 deletions

File tree

SatsDecoder/systems/ax25.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def get_receiver_callsign(ax25_hdr):
7777
class Ax25Protocol(common.Protocol):
7878
columns = ()
7979
c_width = ()
80+
has_ax25 = 1
8081
dd = nt('Ax25Tlm', ('receiver_cs', 'sender_cs', 'control', 'pid', 'data', 'hex'))
8182
tlm_table = {
8283
'frame': {

SatsDecoder/systems/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class Protocol:
7373
columns = ()
7474
c_width = ()
7575
tlm_table = {}
76+
has_ax25 = 0
7677

7778
def __init__(self, ir: ImageReceiver = None):
7879
self.ir = isinstance(ir, ImageReceiver) and ir

SatsDecoder/systems/cubebel2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@
283283
class Cubebel2Protocol(common.Protocol):
284284
columns = 'cdm_id',
285285
c_width = 60,
286+
has_ax25 = 1
286287

287288
_beacon = (
288289
('beacon_name', 'TRX Beacon'),

SatsDecoder/systems/geoscan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ class GeoscanProtocol(common.Protocol):
422422
PACKETSIZE = 64
423423
columns = ()
424424
c_width = ()
425+
has_ax25 = 1
425426
tlm_table = {
426427
'geoscan_beacon': {
427428
'table': (

SatsDecoder/systems/roseycubesat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def push_data(self, data, **kw):
106106
class RoseyProtocol(common.Protocol):
107107
columns = 'msg_id',
108108
c_width = 60,
109+
has_ax25 = 1
109110

110111
tlm_table = {
111112
'message': {

SatsDecoder/systems/samsat_ion2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
class SamSatIon2Protocol(common.Protocol):
5050
columns = ()
5151
c_width = ()
52+
has_ax25 = 1
5253
tlm_table = {
5354
'samsat_beacon': {
5455
'table': (

SatsDecoder/systems/sharjahsat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ def reset(self):
281281
class SharjahProtocol(common.Protocol):
282282
columns = ()
283283
c_width = ()
284+
has_ax25 = 1
284285

285286
tlm_table = {
286287
'eser': {

SatsDecoder/systems/sonate2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4453,6 +4453,7 @@
44534453
class SonateProtocol(common.Protocol):
44544454
columns = 'APID',
44554455
c_width = 60,
4456+
has_ax25 = 1
44564457

44574458
tlm_table = {
44584459
'std_hk': {

SatsDecoder/systems/usp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,7 @@ def push_data(self, data, **kw):
15211521
class UspProtocol(common.Protocol):
15221522
columns = 'msg-id',
15231523
c_width = 60,
1524+
has_ax25 = 1
15241525

15251526
_regular_tmpl = {
15261527
'table': (

SatsDecoder/ui.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -752,12 +752,11 @@ def _kiss_files(self):
752752
self.feed(data, t)
753753

754754
def _satdump_files(self):
755-
if self.proto not in (systems.ax25.proto_name, systems.geoscan.proto_name):
756-
return
757-
758-
is_ax25 = self.proto == systems.ax25.proto_name
759755
is_geoscan = self.proto == systems.geoscan.proto_name
760756

757+
if not (is_geoscan or self.decoder.has_ax25):
758+
return
759+
761760
files = filedialog.askopenfilenames(filetypes=[('SatDump FRM', ['*.frm']), ('All files', '*.*')])
762761
if not files:
763762
return
@@ -772,13 +771,13 @@ def _satdump_files(self):
772771
for fn in files:
773772
with open(fn, 'rb') as f:
774773
while 1:
775-
if is_ax25:
774+
if is_geoscan:
775+
f.read(4)
776+
else:
776777
hdr = f.read(6)
777778
if hdr[:4] != b'\x1a\xcf\xfc\x1d':
778779
break
779780
frm_len = hdr[4] << 8 | hdr[5]
780-
elif is_geoscan:
781-
f.read(4)
782781

783782
data = f.read(frm_len)
784783
if len(data) < frm_len:

0 commit comments

Comments
 (0)