Update mission.py

This commit is contained in:
Richard Bronkhorst 2023-06-20 22:30:21 +02:00
parent fbda97df61
commit b023718450

View File

@ -349,12 +349,30 @@ class HaulMission(BaseMission):
'orbit2': (self.step_orbit, 'travel') 'orbit2': (self.step_orbit, 'travel')
} }
class TravelMission(BaseMission):
def start_state(self):
return 'travel'
@classmethod
def params(cls):
return {
'destination': MissionParam(Waypoint, True)
}
def steps(self):
return {
'travel': (self.step_travel_site, {
'more': 'travel',
'done': 'done'
})
}
def create_mission(mtype, ship, store, api): def create_mission(mtype, ship, store, api):
types = { types = {
'survey': SurveyMission, 'survey': SurveyMission,
'mine': MiningMission, 'mine': MiningMission,
'haul': HaulMission 'haul': HaulMission,
'travel': TravelMission
} }
if mtype not in types: if mtype not in types:
logging.warning(f'invalid mission type {mtype}') logging.warning(f'invalid mission type {mtype}')