-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
68 lines (63 loc) · 2.25 KB
/
main.py
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
60
61
62
63
64
65
66
67
68
from tkinter import *
from gui.left_side_menu.plotting_options_menu import PlottingOptionsMenu
from gui.all_patterns.all_patterns import AllPatterns
from gui.left_side_menu.algorithm.algorithm_menu import AlgorithmMenu
from gui.left_side_menu.measuring_tool import MeasuringTool
from gui.left_side_menu.file_menu import FileMenu
from gui.placed_patterns.placed_patterns_menu import PlacedPatternsMenu
from gui.canvas.canvas_manager import CanvasManager
from gui.left_side_menu.analyze.analyze_menu import AnalyzeMenu
from gui.mesh3dplotter.mesh3dplotter import Mesh3DPlotter
from gui.left_side_menu.mode.mode_menu import ModeMenu
from gui.left_side_menu.export_menu import ExportMenu
from gui.listview import ListView
# Constants
canvasSize = 900
mainColor = "#cccccc"
# Framework startup
root = Tk()
root.title("Tactile Sensing Development Framework")
root.iconbitmap("image.ico")
root.geometry("1920x900")
root.configure(bg=mainColor)
# UI Initialization
allPatternsContainer = Frame(root, bg=mainColor)
leftContainerParent = Frame(root)
leftContainer = ListView(leftContainerParent, 255, 900, 0, mainColor).build()
plotter = Mesh3DPlotter(allPatternsContainer)
canvasManager = CanvasManager(root, canvasSize, plotter)
computationInfo = PlottingOptionsMenu(leftContainer, canvasManager)
measuringTool = MeasuringTool(leftContainer, canvasManager)
fileMenu = FileMenu(leftContainer, plotter, mainColor)
exportMenu = ExportMenu(leftContainer, canvasManager, fileMenu)
analyzeMenu = AnalyzeMenu(leftContainer, fileMenu, mainColor)
algorithmMenu = AlgorithmMenu(
leftContainer, canvasManager, fileMenu, computationInfo, plotter
)
modeMenu = ModeMenu(
leftContainer,
analyzeMenu,
algorithmMenu,
computationInfo,
measuringTool,
exportMenu,
)
placedPatterns = PlacedPatternsMenu(root, canvasManager, mainColor)
allPatterns = AllPatterns(
allPatternsContainer, mainColor, placedPatterns, canvasManager
)
# UI Rendering
fileMenu.build()
modeMenu.build()
analyzeMenu.build()
algorithmMenu.build()
computationInfo.build()
measuringTool.build()
exportMenu.build()
leftContainerParent.pack(side=LEFT, anchor=N, padx=(0, 20))
canvasManager.build()
allPatterns.build()
plotter.show()
allPatternsContainer.pack(side=LEFT, anchor=N, padx=(20, 0))
placedPatterns.build()
root.mainloop()