-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
59 lines (45 loc) · 1.58 KB
/
Copy pathmain.py
File metadata and controls
59 lines (45 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""
Art-Net Controller - Main Entry Point
Phần mềm điều khiển Art-Net với GUI đầy đủ tính năng
"""
import sys
import os
import logging
from pathlib import Path
# Add src directory to Python path
sys.path.insert(0, str(Path(__file__).parent / "src"))
from PyQt6.QtWidgets import QApplication
from PyQt6.QtCore import Qt
from src.gui.main_window import MainWindow
from src.system.crash_reporter import setup_logging, setup_exception_handler
from src.utils.config import ConfigManager
def main():
"""Main entry point của ứng dụng"""
# Setup enhanced logging (V2.0 - with rotation & compression)
setup_logging()
logger = logging.getLogger(__name__)
# Setup global exception handler (V2.0 - crash reporting)
setup_exception_handler()
try:
# Create QApplication
app = QApplication(sys.argv)
app.setApplicationName("DMX Master")
app.setApplicationVersion("0.0.1")
app.setOrganizationName("ArtNet Studio")
# Set application style
app.setStyle('Fusion')
# Load configuration
config_manager = ConfigManager()
# Create and show main window
main_window = MainWindow()
main_window.show()
logger.info("Art-Net Controller started successfully")
# Start event loop
sys.exit(app.exec())
except Exception as e:
logger.error(f"Failed to start application: {e}", exc_info=True)
import traceback
traceback.print_exc()
sys.exit(1)
if __name__ == "__main__":
main()