""" Live Feed Panel Displays live camera and audio feeds (placeholders for now). """ from PyQt5.QtWidgets import QGroupBox, QHBoxLayout, QVBoxLayout, QLabel from PyQt5.QtCore import Qt from ui.widgets.status_indicator import StatusIndicator from resources.styles import (GROUP_BOX_STYLE, RGB_FEED_STYLE, MS_FEED_STYLE, THERMAL_FEED_STYLE, AUDIO_FEED_STYLE) from utils.config import FEED_MIN_WIDTH, FEED_MIN_HEIGHT class LiveFeedPanel(QGroupBox): """ Panel displaying live camera and audio feeds. Shows placeholders for: - RGB Camera - Multispectral Camera - Thermal Camera - Audio Spectrogram Note: For Phase 1, these are placeholders. Live feeds will be implemented in future phases. """ def __init__(self): """Initialize the live feed panel.""" super().__init__("Live Camera Feeds") self.setStyleSheet(GROUP_BOX_STYLE) self.init_ui() def init_ui(self): """Initialize the UI components.""" layout = QHBoxLayout() # RGB Feed rgb_layout = QVBoxLayout() self.rgb_feed = QLabel() self.rgb_feed.setMinimumSize(FEED_MIN_WIDTH, FEED_MIN_HEIGHT) self.rgb_feed.setStyleSheet(RGB_FEED_STYLE) self.rgb_feed.setAlignment(Qt.AlignCenter) self.rgb_feed.setText("RGB Camera\n\nšŸš€ Coming Soon!\nLive feed integration") self.rgb_status = StatusIndicator("offline") rgb_layout.addWidget(self.rgb_feed) rgb_layout.addWidget(self.rgb_status, alignment=Qt.AlignCenter) layout.addLayout(rgb_layout) # Multispectral Feed ms_layout = QVBoxLayout() self.ms_feed = QLabel() self.ms_feed.setMinimumSize(FEED_MIN_WIDTH, FEED_MIN_HEIGHT) self.ms_feed.setStyleSheet(MS_FEED_STYLE) self.ms_feed.setAlignment(Qt.AlignCenter) self.ms_feed.setText("Multispectral\n\nšŸš€ Coming Soon!\n8-Band integration") self.ms_status = StatusIndicator("offline") ms_layout.addWidget(self.ms_feed) ms_layout.addWidget(self.ms_status, alignment=Qt.AlignCenter) layout.addLayout(ms_layout) # Thermal Feed thermal_layout = QVBoxLayout() self.thermal_feed = QLabel() self.thermal_feed.setMinimumSize(FEED_MIN_WIDTH, FEED_MIN_HEIGHT) self.thermal_feed.setStyleSheet(THERMAL_FEED_STYLE) self.thermal_feed.setAlignment(Qt.AlignCenter) self.thermal_feed.setText("Thermal Camera\n\nšŸš€ Coming Soon!\nThermal imaging") self.thermal_status = StatusIndicator("offline") thermal_layout.addWidget(self.thermal_feed) thermal_layout.addWidget(self.thermal_status, alignment=Qt.AlignCenter) layout.addLayout(thermal_layout) # Audio Visualization audio_layout = QVBoxLayout() self.audio_feed = QLabel() self.audio_feed.setMinimumSize(FEED_MIN_WIDTH, FEED_MIN_HEIGHT) self.audio_feed.setStyleSheet(AUDIO_FEED_STYLE) self.audio_feed.setAlignment(Qt.AlignCenter) self.audio_feed.setText("Audio Feed\n\nšŸš€ Coming Soon!\nLive spectrogram") self.audio_status = StatusIndicator("offline") audio_layout.addWidget(self.audio_feed) audio_layout.addWidget(self.audio_status, alignment=Qt.AlignCenter) layout.addLayout(audio_layout) self.setLayout(layout) def update_rgb_feed(self, pixmap): """ Update RGB camera feed with new image. Args: pixmap: QPixmap image to display """ self.rgb_feed.setPixmap(pixmap) self.rgb_status.set_status("online") def update_ms_feed(self, pixmap): """ Update multispectral camera feed with new image. Args: pixmap: QPixmap image to display """ self.ms_feed.setPixmap(pixmap) self.ms_status.set_status("online") def update_thermal_feed(self, pixmap): """ Update thermal camera feed with new image. Args: pixmap: QPixmap image to display """ self.thermal_feed.setPixmap(pixmap) self.thermal_status.set_status("online") def update_audio_feed(self, pixmap): """ Update audio spectrogram display. Args: pixmap: QPixmap spectrogram image to display """ self.audio_feed.setPixmap(pixmap) self.audio_status.set_status("online") def set_feed_offline(self, feed_name: str): """ Set a specific feed to offline status. Args: feed_name: Feed name ('rgb', 'ms', 'thermal', or 'audio') """ if feed_name == 'rgb': self.rgb_status.set_status("offline") self.rgb_feed.clear() self.rgb_feed.setText("RGB Camera\nOFFLINE") elif feed_name == 'ms': self.ms_status.set_status("offline") self.ms_feed.clear() self.ms_feed.setText("Multispectral\nOFFLINE") elif feed_name == 'thermal': self.thermal_status.set_status("offline") self.thermal_feed.clear() self.thermal_feed.setText("Thermal\nOFFLINE") elif feed_name == 'audio': self.audio_status.set_status("offline") self.audio_feed.clear() self.audio_feed.setText("Audio\nOFFLINE")