122 lines
3.9 KiB
Python
122 lines
3.9 KiB
Python
from maneuvers.docking import DockingManeuver
|
|
from . import Mission
|
|
|
|
class StationBuildMission(Mission):
|
|
def __init__(self, conn):
|
|
self.conn = conn
|
|
|
|
def execute(self, mission_control):
|
|
transfer_ship = mission_control.seperate_transfer_ship()
|
|
DockingManeuver(self.conn, mission_control, transfer_ship.get_front_port(), mission_control.solar_panel_port())
|
|
separate_solar_panels()
|
|
DockingManeuver(self.conn, mission_control, transfer_ship.get_front_port(), mission_control.get_port("Station Core Stern Joint"))
|
|
transfer_ship = mission_control.seperate_transfer_ship()
|
|
DockingManeuver(self.conn, mission_control, transfer_ship.get_front_port(), mission_control.get_tank_holder_port())
|
|
separate_tank_holder()
|
|
DockingManeuver(self.conn, mission_control, transfer_ship.get_front_port(), mission_control.get_port("Station Core Bow Joint"))
|
|
transfer_ship = mission_control.seperate_transfer_ship()
|
|
DockingManeuver(self.conn, mission_control, transfer_ship.get_front_port(), mission_control.get_dock_left_port())
|
|
separate_left_dock()
|
|
DockingManeuver(self.conn, mission_control, transfer_ship.get_front_port(), mission_control.get_port("Station Core Port Joint"))
|
|
transfer_ship = mission_control.seperate_transfer_ship()
|
|
DockingManeuver(self.conn, mission_control, transfer_ship.get_front_port(), mission_control.get_port("Station Dock Left 1 Nadir Port"))
|
|
|
|
|
|
# Ship part package to LKO
|
|
# if destination not Kerbin:
|
|
# Transfer part package to Right orbit
|
|
# if station core not in package:
|
|
# Rendez-vous with station (if station core not in package)
|
|
# separate package
|
|
# for each part:
|
|
# Determine connection ports and angle
|
|
# Start docking
|
|
|
|
class Station:
|
|
pass
|
|
|
|
|
|
class StationPart:
|
|
joints = []
|
|
ports = []
|
|
|
|
|
|
class StationCore(StationPart):
|
|
joints = [
|
|
'Station Core Bow Joint',
|
|
'Station Core Starboard Joint',
|
|
'Station Core Stern Joint',
|
|
'Station Core Port Joint'
|
|
]
|
|
|
|
|
|
class StationSolarPanels(StationPart):
|
|
|
|
def __init__(self, number):
|
|
self.joints = [
|
|
f'Station Solar Panels {number} Bow Joint',
|
|
f'Station Solar Panels {number} Port Joint',
|
|
]
|
|
|
|
|
|
class StationTankHolder(StationPart):
|
|
joints = [
|
|
'Station Tank Holder Stern Joint',
|
|
]
|
|
|
|
ports = [
|
|
'Station Tank Holder Fuel Port 1',
|
|
'Station Tank Holder Fuel Port 2',
|
|
'Station Tank Holder Oxygen Port 1',
|
|
'Station Tank Holder Oxygen Port 2',
|
|
'Station Tank Holder RCS Port 1',
|
|
'Station Tank Holder RCS Port 2',
|
|
]
|
|
|
|
|
|
class StationTank(StationPart):
|
|
def __init__(self, resource, number):
|
|
self.ports = [
|
|
f'Station Tank {resource} {number} Bow Port'
|
|
f'Station Tank {resource} {number} Stern Port'
|
|
]
|
|
|
|
|
|
class StationDockLeft(StationPart):
|
|
def __init__(self, number):
|
|
self.joints = [
|
|
f'Station Dock Left {number} Starboard Joint',
|
|
f'Station Dock Left {number} Port Joint',
|
|
]
|
|
|
|
self.ports = [
|
|
f'Station Dock Left {number} Zenith Port',
|
|
f'Station Dock Left {number} Bow Port',
|
|
f'Station Dock Left {number} Nadir Port'
|
|
]
|
|
|
|
|
|
class StationDockRight(StationPart):
|
|
def __init__(self, number):
|
|
self.joints = [
|
|
f'Station Dock Right {number} Starboard Joint',
|
|
f'Station Dock Right {number} Port Joint',
|
|
]
|
|
|
|
self.ports = [
|
|
f'Station Dock Right {number} Zenith Port',
|
|
f'Station Dock Right {number} Bow Port',
|
|
f'Station Dock Right {number} Nadir Port'
|
|
]
|
|
|
|
|
|
class StationResourceConverter(StationPart):
|
|
def __int__(self, number):
|
|
self.joints = [
|
|
f'Station Resource Converter {number} Bow Joint'
|
|
]
|
|
|
|
self.ports = [
|
|
f'Station Resource Converter {number} Stern Port'
|
|
]
|