SXXXXXXX_PyMsc/pymsc/gui/docking/mcs_dock.py
2026-01-12 08:18:56 +01:00

64 lines
2.2 KiB
Python

# -*- coding: utf-8 -*-
"""
MCS Dock: Mission Control System panel.
Contains all MCS controls, commands, and telemetry widgets.
"""
import tkinter as tk
from tkinter import ttk
from pymsc.gui.docking.title_panel import TitlePanel
from pymsc.gui.pages.control_page import ControlPage
from pymsc.gui.pages.mission_page import MissionPage
class MCSDock(TitlePanel):
"""
MCS (Mission Control System) dockable panel.
Contains tabs for different MCS functions:
- Control: Radar modes, functions, parameters
- Mission: Navigation data, cursor, attitude
"""
def __init__(self, parent: tk.Widget, bus_module, **kwargs):
"""
Args:
parent: Parent widget
bus_module: Bus1553Module instance for message access
**kwargs: Additional DockFrame options
"""
self.bus_module = bus_module
super().__init__(parent, title="MCS - Mission Control System", closable=False, **kwargs)
def populate_content(self):
"""Create the MCS tab structure and pages."""
# Create notebook for MCS tabs
self.notebook = ttk.Notebook(self.content_frame)
self.notebook.pack(fill=tk.BOTH, expand=True)
# Dictionary to store page instances
self.pages = {}
# Create Control page
control_frame = ttk.Frame(self.notebook)
self.notebook.add(control_frame, text="Control")
self.pages['control'] = ControlPage(control_frame, self.bus_module)
self.pages['control'].pack(fill=tk.BOTH, expand=True)
# Create Mission page
mission_frame = ttk.Frame(self.notebook)
self.notebook.add(mission_frame, text="Mission")
self.pages['mission'] = MissionPage(mission_frame, self.bus_module)
self.pages['mission'].pack(fill=tk.BOTH, expand=True)
def start_refresh(self):
"""Start the refresh loop for all pages."""
for page in self.pages.values():
if hasattr(page, 'start_refresh'):
page.start_refresh()
def stop_refresh(self):
"""Stop the refresh loop for all pages."""
for page in self.pages.values():
if hasattr(page, 'stop_refresh'):
page.stop_refresh()