-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
53 lines (41 loc) · 1.41 KB
/
main.py
File metadata and controls
53 lines (41 loc) · 1.41 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
#!/usr/bin/env python
"""
PyDebFlow - Mass Flow Simulation Tool
r.avaflow Replica
Main entry point for the GUI application.
"""
import sys
from pathlib import Path
# Add src to path
sys.path.insert(0, str(Path(__file__).parent))
def main():
"""Launch the PyDebFlow GUI application."""
try:
from PyQt6.QtWidgets import QApplication
from PyQt6.QtCore import Qt
from src.gui.main_window import MainWindow
# Enable High DPI scaling
QApplication.setHighDpiScaleFactorRoundingPolicy(
Qt.HighDpiScaleFactorRoundingPolicy.PassThrough
)
app = QApplication(sys.argv)
app.setApplicationName("PyDebFlow")
app.setOrganizationName("PyDebFlow")
app.setApplicationVersion("0.1.0")
window = MainWindow()
window.show()
sys.exit(app.exec())
except ImportError as e:
print("=" * 60)
print("PyDebFlow - GUI Error")
print("=" * 60)
print(f"\nError: {e}")
print("\nThe GUI requires PyQt6. Please install it with:")
print(" pip install PyQt6")
print("\nAlternatively, you can run simulations from command line:")
print(" python run_simulation.py --synthetic-test")
print("\nOr use the CLI:")
print(" python -m src.cli run --synthetic --t-end 60")
sys.exit(1)
if __name__ == '__main__':
main()