Skip to content

Commit

Permalink
fix resetting current_fid
Browse files Browse the repository at this point in the history
  • Loading branch information
baskiton committed Jun 1, 2024
1 parent 37183bc commit 126b060
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SatsDecoder/systems/geoscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def push_data(self, data, **kw):
if self.is_last_data(x):
img.flush()
# img.close()
# self.current_fid = None
# self.current_fid = ''
return 2

else:
Expand Down
4 changes: 2 additions & 2 deletions SatsDecoder/systems/image_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def generate_fid(self, *args, **kwargs):
raise NotImplementedError

def force_new(self, *args, **kwargs):
self.current_fid = 0
self.current_fid = ''
return self.new_file(self.generate_fid(*args, **kwargs))

def new_file(self, fid):
Expand All @@ -176,4 +176,4 @@ def push_data(self, data, **kw):
def clear(self):
for i in self.images.values():
i.close()
self.current_fid = 0
self.current_fid = ''
2 changes: 1 addition & 1 deletion SatsDecoder/systems/ledsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def push_data(self, data, large='', **kw):

if not self.last_addr and large or self.last_addr and not large:
# 100% it's new image. dont merged it
self.current_fid = 0
self.current_fid = ''
force_new = 1
else:
force_new = not data.pnum or soi or data.plen != self.prev_plen or large != self.last_addr
Expand Down
2 changes: 1 addition & 1 deletion SatsDecoder/systems/lucky7.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_image(self, force_new=0, packets=0, **kwargs):
img = self.images.get(fid)
if img:
if packets != img.packets:
self.current_fid = fid = 0
self.current_fid = fid = ''
force_new = 1

if force_new or not img:
Expand Down
6 changes: 3 additions & 3 deletions SatsDecoder/systems/sharjahsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ def get_image(self, force_new=0, soi=0, pnum=0, **kwargs):
if img:
if pnum > img.packets:
if img.has_soi:
self.current_fid = fid = 0
self.current_fid = fid = ''
force_new = 1
else:
img.shift_image((pnum - img.packets) * self.PACKET_SIZE)
img.packets = pnum

elif soi and pnum < img.packets:
self.current_fid = fid = 0
self.current_fid = fid = ''
force_new = 1

if force_new or not img:
Expand Down Expand Up @@ -275,7 +275,7 @@ def reset(self):
if img:
img.flush()
if not self.merge_mode:
self.current_fid = 0
self.current_fid = ''


class SharjahProtocol(common.Protocol):
Expand Down
2 changes: 1 addition & 1 deletion SatsDecoder/systems/wtc_simba.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def push_data(self, data, large='', **kw):

if not self.last_addr and large or self.last_addr and not large:
# 100% it's new image. dont merged it
self.current_fid = 0
self.current_fid = ''
force_new = 1
else:
force_new = not data.pnum or soi or data.plen != self.prev_plen or large != self.last_addr
Expand Down

0 comments on commit 126b060

Please sign in to comment.