33 lines
833 B
Python
33 lines
833 B
Python
# main.py
|
|
# main.py
|
|
from PyQt6.QtWidgets import QApplication, QWidget, QGridLayout
|
|
from PyQt6.QtCore import QTimer
|
|
import sys
|
|
from monitor_data import get_monitor_data
|
|
from monitor_card import MonitorCard # 카드 UI는 따로 분리해도 좋음
|
|
|
|
from loading_overlay import LoadingOverlay
|
|
|
|
class Dashboard(QWidget):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.init_ui()
|
|
|
|
def init_ui(self):
|
|
# 카드들 배치
|
|
self.layout = QVBoxLayout(self)
|
|
self.setLayout(self.layout)
|
|
|
|
# 오버레이 생성
|
|
self.overlay = LoadingOverlay(self)
|
|
|
|
# 로딩 시작
|
|
self.overlay.start()
|
|
|
|
# 데이터 수신 후
|
|
QTimer.singleShot(2000, self.finish_loading)
|
|
|
|
def finish_loading(self):
|
|
self.overlay.stop()
|
|
# 카드들에 값 업데이트
|