Commit 758d52fc authored by Mohd Bilal's avatar Mohd Bilal
Browse files

satellite refresh rate loaded

parent 651d308c
......@@ -72,29 +72,6 @@ class TIMGSNClient:
})
satellite.update_plan(plan)
# for user in self.users:
# stations = user.get_stations()
# for station in stations:
# schedule = []
# for op in overpasses:
# if op['station_name'] == station.name:
# start = op['start_date_str'] + ' ' + op[
# 'start_time_str']
# end = op['end_date_str'] + ' ' + op['end_time_str']
# norad = op['norad']
# contact_type = op['request_types'][0]
# schedule.append({
# "contact_type": contact_type,
# "norad": norad,
# "start": start,
# "end": end,
# "updated_on": updated_on,
# "scheduling_method": scheduling_method
# })
# station.update_schedule(schedule=schedule,
# schedule_type="timgsn")
def _subscribe_station_update(self, **kwargs):
async_ = kwargs['async_'] if 'async_' in kwargs else False
topic = config.aws_topics_sub.get("schedule_update_sub")
......
......@@ -43,7 +43,7 @@ class Satellite(ThreadedModule):
plan.extend([{
"contact_type": "TELEMETRY"
}] * (len(overpasses) - len(plan)))
# request overpasses
for op, action in zip(overpasses, plan):
response = self.request_overpass(op['uid'],
......@@ -58,7 +58,9 @@ class Satellite(ThreadedModule):
self.name = data.get("name")
self.tle_l1 = data.get("tle_l1")
self.tle_l2 = data.get("tle_l2")
self.tle_src = data.get("tle_src")
self.planning_horizon = data.get("planning_horizon")
self.refresh_rate = data.get("refresh_rate")
def str_to_date(p: dict):
p['start'] = datetime.datetime.strptime(p['start'],
......@@ -85,7 +87,7 @@ class Satellite(ThreadedModule):
with open(f'app/models/{self.norad}.json', 'w') as f:
json.dump(settings)
self.load_from_json()
self.load_from_json()
def load_from_json(self, filename=""):
data = None
......
......@@ -17,14 +17,14 @@ class Station(ThreadedModule):
latitude=0,
longitude=0,
height=0,
min_el=0,
el_min=0,
*args,
**kwargs) -> None:
super().__init__(name, *args, **kwargs)
self.latitude = latitude
self.longitutde = longitude
self.height = height
self.min_el = min_el
self.el_min = el_min
self.schedule = []
self.owner = None
self._is_setup = False
......@@ -239,8 +239,11 @@ class Station(ThreadedModule):
self.latitude = data.get("latitude")
self.longitude = data.get("longitude")
self.height = data.get("height")
self.min_el = data.get("min_el")
self.el_min = data.get("el_min")
self.band_rx = data.get("band_rx")
self.band_tx = data.get("band_tx")
self.scheduling_horizon = data.get("scheduling_horizon")
self.refresh_rate = data.get("refresh_rate")
def str_to_date(p: dict):
p['start'] = datetime.datetime.strptime(p['start'],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment