Python-based time management application with UDP discovery, TCP protocol communication, time sync, and drift monitoring. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
940 B
Python
34 lines
940 B
Python
"""Controller 데이터클래스"""
|
|
|
|
from dataclasses import dataclass, field
|
|
|
|
|
|
@dataclass
|
|
class Controller:
|
|
"""컨트롤러 네트워크 정보"""
|
|
mac: str = ""
|
|
ip: str = ""
|
|
port: int = 5000
|
|
name: str = ""
|
|
subnet: str = "255.255.255.0"
|
|
gateway: str = "192.168.0.1"
|
|
dhcp_mode: int = 0 # 0: Static, 1: DHCP
|
|
server_ip: str = "0.0.0.0"
|
|
server_port: int = 0
|
|
server_mode: int = 0 # 0: Client, 1: Server
|
|
keep_alive: int = 0
|
|
dns_name: str = ""
|
|
ap_ssid_name: str = ""
|
|
ap_ssid_pw: str = ""
|
|
ap_mode: int = 0 # 0: Station, 1: AP
|
|
|
|
# 시간 동기화/읽기용 상태 (GUI에서 사용)
|
|
selected: bool = field(default=True, repr=False)
|
|
|
|
@property
|
|
def display_label(self) -> str:
|
|
"""GUI 표시용 라벨: 이름(IP:포트)"""
|
|
if self.name:
|
|
return f"{self.name}({self.ip}:{self.port})"
|
|
return f"{self.ip}:{self.port}"
|