-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathmain_GUI.py
142 lines (105 loc) · 4.78 KB
/
main_GUI.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import os
import sys
paths = []
root_dir = os.path.join(os.path.dirname(__file__), 'GUIs')
paths.append(os.path.join(os.path.abspath(root_dir), 'position'))
paths.append(os.path.join(os.path.abspath(root_dir), 'GUI_tools'))
paths.append(os.path.join(os.path.abspath(root_dir), 'otherGUI'))
paths.append(os.path.join(os.path.abspath(root_dir), 'mybu'))
for path in paths:
if not path in sys.path:
sys.path.insert(1, path)
sys.path.insert(1, root_dir)
del path
from tkinter import *
from GUIs.position.mycoords import Myc
from GUIs.GUI_tools.adjust import Adjust
from GUIs.mybu.wafer_comparison import TwoWafers
from GUIs.mybu.bbb import ImportPanel
from GUIs.twoDtoOneD.automation import Automation
from GUIs.base.mainn import Baseline_subtraction
from GUIs.cifb.Phase_ import MainAutoMenu
from GUIs.tools.rename_ import Ren
from GUIs.base.main_bandgap import P_import
from GUIs.bdase.main_resistance import Maink
from GUIs.cifb.concentration_main import Main_concentration
from GUIs.cifb.widg import M
from GUIs.tools.mytools.other import SomeTools
from GUIs.qixiank import NName
class Tools(SomeTool):
def __init__(self):
super().__init__()
self.ca = NName().ca
try:
self._init()
except:
return
# @staticmethod
def _init(self):
n = self.ca
self.root.title(n[0])
self.logo = PhotoImage(file = n[1])
self.root.iconphoto(False, self.logo)
self.f1 = LabelFrame(self.root, text =n[2], fg = 'blue')
self.f11 = LabelFrame(self.root, text =n[3], fg = 'blue')
self.f12 = LabelFrame(self.root, text =n[4], fg = 'blue')
self.f19 = LabelFrame(self.root, text = n[5], fg = 'blue')
Button(self.f1, text = n[6], command = self.on_thickness).pack(side = 'left', padx = (5,5), pady=(5,5))
Button(self.f11, text = n[7], command = self.on_twoD1Dconvert).pack(side = 'left', padx = (5,5), pady=(5,5))
Button(self.f11, text = n[8], command = self.on_baselinesubtraction).pack(side = 'left', padx = (5,5), pady=(5,5))
Button(self.f11, text = n[9], command = self.on_phaseidentification).pack(side = 'left', padx = (5,5), pady=(5,5))
Button(self.f11, text = n[10], command = self.on_referencerename).pack(side = 'left', padx = (5,5), pady=(5,5))
Button(self.f12, text = n[11], command = self.on_bandgap).pack(side = 'left', padx = (5,5), pady=(5,5))
Button(self.f12, text = n[12], command = self.on_resistance).pack(side = 'left', padx = (5,5), pady=(5,5))
Button(self.f19, text = n[13], command = self.on_sputterconcentration).pack(side = 'left', padx = (5,5), pady=(5,5))
Button(self.f19, text = n[14], command = self.on_waferphotoRGB).pack(side = 'left', padx = (5,5), pady=(5,5))
try:
self.b1.config(command =self.on_edxcomposition)
self.b2.config(command =self.on_edxadjust)
self.b3.config(command =self.on_librariescomparison)
except:
return
self.f_edx.pack(padx = (5,5), pady=(5,5), anchor = 'w')
self.f1.pack(padx = (5,5), pady=(5,5), anchor = 'w')
self.f11.pack(padx = (5,5), pady=(5,5), anchor = 'w')
self.f12.pack(padx = (5,5), pady=(5,5), anchor = 'w')
self.f19.pack(padx = (5,5), pady=(5,5), anchor = 'w')
self.root.mainloop()
def on_edxcomposition(self):
self.call_func('EDX composition', Myc)
def on_edxadjust(self):
self.call_func('Adjust composition', Adjust)
def on_librariescomparison(self):
self.call_func('Wafer comparison',TwoWafers)
def on_closing(self):
self.w.withdraw()
self.root.destroy()
def call_func(self, title, func):
self.root.withdraw()
self.w = Toplevel()
self.w.title(title)
self.w.iconphoto(False, self.logo)
self.w.protocol("WM_DELETE_WINDOW", self.on_closing)
func(self.w).pack(fill = 'both', expand = True)
def on_thickness(self):
self.call_func('Thickness',ImportPanel)
def on_twoD1Dconvert(self):
self.call_func('2D to 1D convert', Automation)
def on_baselinesubtraction(self):
self.call_func('Baseline subtraction',Baseline_subtraction)
def on_phaseidentification(self):
self.call_func('Phase Identification', MainAutoMenu)
def on_referencerename(self):
self.call_func('Rename .cif files', Ren)
def on_bandgap(self):
self.call_func('Bandgap calculation', P_import)
def on_resistance(self):
self.call_func('Resistance calculation', Maink)
def on_sputterconcentration(self):
self.call_func('Sputter concentration calculation',Main_concentration)
def on_waferphotoRGB(self):
self.call_func('Extract photo RGB', M)
class Main(Tools):
def __init__(self):
super().__init__()
Main()