def _render_subsystems(self): subsystems = cw.ENGLabelFrame(self.left_frame, text="Subsystems", style=style) subsystems.pack(side=tk.TOP, fill=tk.BOTH, expand=True) widgets['INS'] = cw.Indicator(subsystems, text='INS', style=style) widgets['RADAR'] = cw.Indicator(subsystems, text='RAD', style=style) widgets['LOS'] = cw.Indicator(subsystems, text='LOS', style=style) widgets['GNC'] = cw.Indicator(subsystems, text='GNC', style=style) widgets['a_ATMO'] = cw.Alert(subsystems, text='IN ATMO', style=style) widgets['CHUTE'] = cw.OneTimeButton(subsystems, text='CHUTE', style=style) widgets['a_SRBTIME'] = cw.Alert(subsystems, text='120s', invis=True, style=style) widgets['SRB'] = cw.OneTimeButton(subsystems, text='SRB', style=style) widgets['INS'].grid(row=0, column=0) widgets['RADAR'].grid(row=1, column=0) widgets['LOS'].grid(row=2, column=0) widgets['GNC'].grid(row=3, column=0) widgets['a_ATMO'].grid(row=0, column=1) widgets['CHUTE'].grid(row=1, column=1) widgets['SRB'].grid(row=2, column=1) widgets['a_SRBTIME'].grid(row=3, column=1) subsystems.grid_columnconfigure(0, weight=1, minsize=50) subsystems.grid_columnconfigure(1, weight=1, minsize=60)
def _render_master(self): master = cw.ENGLabelFrame(self.left_frame, text="Master", style=style) master.pack(side=tk.TOP, fill=tk.BOTH, expand=True) widgets['master_freeze'] = cw.Indicator(master, text='Freeze\nControls', style=style) widgets['master_freeze'].configure(width=60, height=60) widgets['a_master'] = cw.Alert(master, text='MASTER\nALARM', font=style.large, style=style) widgets['a_master'].configure(width=100, height=100) widgets['a_asteroid'] = cw.Alert(master, text='ASTEROID', style=style) widgets['a_radiation'] = cw.Alert(master, text='RADIATION', style=style) widgets['a_hab_gnomes'] = cw.Alert(master, text='HAB\nGNOMES', style=style) widgets['master_freeze'].grid(row=0, column=0) widgets['a_master'].grid(row=0, column=1, rowspan=2) widgets['a_asteroid'].grid(row=2, column=0, padx=5, pady=5) widgets['a_radiation'].grid(row=2, column=1, padx=5, pady=5) widgets['a_hab_gnomes'].grid(row=3, column=0, pady=5)
def _render_engines(self): engines = cw.ENGLabelFrame(self.left_frame, text="Engines", style=style) engines.pack(side=tk.TOP, fill=tk.BOTH, expand=True) widgets['h_INJ1'] = cw.Indicator(engines, text="INJ-1", style=style) widgets['h_INJ2'] = cw.Indicator(engines, text="INJ-2", style=style) widgets["fuel"] = cw.ENGLabel(engines, text='FUEL', value=0, unit='kg', style=style) widgets['h_br'] = cw.ENGLabel(engines, text='BURN RATE', value=0, unit='kg/hr', style=style) widgets['h_INJ1'].grid(row=0, column=0) widgets['h_INJ1'].set_redrawer( lambda injector_widget, state: injector_widget.update( state.components[strings.INJ1].connected)) widgets['h_INJ2'].grid(row=1, column=0) widgets['fuel'].grid(row=0, column=1, sticky=tk.W) widgets['h_br'].grid(row=1, column=1, sticky=tk.W) # Engines > Fuel Management fuelmanager = cw.ENGLabelFrame(engines, text="", style=style) fuelmanager.grid(row=2, column=0, columnspan=2, pady=5) widgets['a_fuel_connected'] = cw.Alert(fuelmanager, text='TETHERED', style=style) widgets['h_load'] = cw.Indicator(fuelmanager, text="LOAD", style=style) widgets['h_dump'] = cw.Indicator(fuelmanager, text="DUMP", style=style) widgets['a_fuel_connected'].grid(row=0, column=0, padx=10) widgets['h_dump'].grid(row=0, column=1) widgets['h_load'].grid(row=0, column=2)
def _render_hab_reactors(self): hreactor = cw.ENGLabelFrame(self.right_frame_bot, text="Habitat Reactor", style=style) hreactor.pack(side=tk.LEFT, fill=tk.BOTH, expand=False) widgets['hr_INJ-1'] = cw.Indicator(hreactor, text="R-INJ-1", style=style) widgets['hr_INJ-2'] = cw.Indicator(hreactor, text="R-INJ-2", style=style) widgets['hr_heater'] = cw.Indicator(hreactor, text="HEAT", style=style) widgets["hr_curr"] = cw.ENGLabel(hreactor, text='CURR', value=0, unit='A', style=style) widgets['hr_temp'] = cw.ENGLabel(hreactor, text='TEMP', value=81, unit='*C', style=style) widgets['a_hr_overtemp'] = cw.Alert(hreactor, text="OVERTEMP", style=style) widgets['hr_INJ-1'].grid(row=0, column=0, padx=10) widgets['hr_INJ-2'].grid(row=1, column=0) widgets['hr_heater'].grid(row=2, column=0) widgets["hr_curr"].grid(row=0, column=1, sticky=tk.W) widgets['hr_temp'].grid(row=1, column=1, sticky=tk.W) widgets['a_hr_overtemp'].grid(row=2, column=1) graph_frame = tk.Frame(hreactor) graph_width = 400 hr_graph = tk.Canvas(graph_frame, width=graph_width, height=200) graph_frame.grid(row=0, column=2, rowspan=3, padx=10, pady=10) hr_graph.pack(side=tk.TOP, fill=tk.BOTH, expand=True) hreactor.grid_columnconfigure(0, weight=1, minsize=60) hreactor.grid_columnconfigure(1, weight=1, minsize=70) hreactor.grid_columnconfigure(2, weight=3, minsize=graph_width)
def _render_reactor_confinement(self): hrconfinement = cw.ENGLabelFrame(self.right_frame_bot, text="Reactor Confinement", style=style) hrconfinement.pack(side=tk.LEFT, fill=tk.BOTH, expand=True) widgets['hr_RCON-1'] = cw.Indicator(hrconfinement, text="RCON-1", style=style) widgets['hr_RCON-2'] = cw.Indicator(hrconfinement, text="RCON-2", style=style) widgets["hr_RCON-1_temp"] = cw.ENGLabel(hrconfinement, text='TEMP', value=84, unit='*C', style=style) widgets['hr_RCON-2_temp'] = cw.ENGLabel(hrconfinement, text='TEMP', value=80, unit='*C', style=style) widgets['hr_BATT'] = cw.ENGLabel(hrconfinement, text='BATT', value=2000, unit='As', style=style) widgets['a_hr_lowBatt'] = cw.Alert(hrconfinement, text='LOW BATT', style=style) widgets['hr_RCON-1'].grid(row=0, column=0) widgets['hr_RCON-2'].grid(row=1, column=0) widgets["hr_RCON-1_temp"].grid(row=0, column=1) widgets['hr_RCON-2_temp'].grid(row=1, column=1) widgets['hr_BATT'].grid(row=2, column=0, columnspan=2, pady=10) widgets['a_hr_lowBatt'].grid(row=3, column=0, columnspan=2) hrconfinement.grid_columnconfigure(0, weight=1, minsize=60) hrconfinement.grid_columnconfigure(1, weight=1, minsize=70)