forked from meerk40t/gui-files-meerk40t
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lasertool.py
195 lines (138 loc) · 8 KB
/
lasertool.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 1.1.0pre on Mon Apr 11 12:41:47 2022
#
import wx
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class clsLasertools(wx.Panel):
def __init__(self, *args, **kwds):
# begin wxGlade: clsLasertools.__init__
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
wx.Panel.__init__(self, *args, **kwds)
sizer_main = wx.BoxSizer(wx.VERTICAL)
self.nbook_lasertools = wx.Notebook(self, wx.ID_ANY)
sizer_main.Add(self.nbook_lasertools, 1, wx.EXPAND, 0)
self.nb_circle = wx.Panel(self.nbook_lasertools, wx.ID_ANY)
self.nbook_lasertools.AddPage(self.nb_circle, "Find center")
sizer_circle = wx.BoxSizer(wx.VERTICAL)
sizer_9 = wx.BoxSizer(wx.HORIZONTAL)
sizer_circle.Add(sizer_9, 0, wx.EXPAND, 0)
sizer_10 = wx.BoxSizer(wx.VERTICAL)
sizer_9.Add(sizer_10, 0, wx.EXPAND, 0)
sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
sizer_10.Add(sizer_1, 1, wx.EXPAND, 0)
label_1 = wx.StaticText(self.nb_circle, wx.ID_ANY, "A")
label_1.SetMinSize((20, 23))
sizer_1.Add(label_1, 0, 0, 0)
self.btnSet1 = wx.Button(self.nb_circle, wx.ID_ANY, "Get")
self.btnSet1.SetToolTip("Place the laser over the desired point and press...")
sizer_1.Add(self.btnSet1, 0, 0, 0)
lbl_pos_1 = wx.StaticText(self.nb_circle, wx.ID_ANY, "<empty>")
sizer_1.Add(lbl_pos_1, 0, 0, 0)
sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
sizer_10.Add(sizer_2, 1, wx.EXPAND, 0)
label_2 = wx.StaticText(self.nb_circle, wx.ID_ANY, "B")
label_2.SetMinSize((20, 23))
sizer_2.Add(label_2, 0, 0, 0)
self.btnSet2 = wx.Button(self.nb_circle, wx.ID_ANY, "Get")
self.btnSet2.SetToolTip("Place the laser over the desired point and press...")
sizer_2.Add(self.btnSet2, 0, 0, 0)
lbl_pos_2 = wx.StaticText(self.nb_circle, wx.ID_ANY, "<empty>")
sizer_2.Add(lbl_pos_2, 0, 0, 0)
sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
sizer_10.Add(sizer_3, 1, wx.EXPAND, 0)
label_3 = wx.StaticText(self.nb_circle, wx.ID_ANY, "C")
label_3.SetMinSize((20, 23))
sizer_3.Add(label_3, 0, 0, 0)
self.btnSet3 = wx.Button(self.nb_circle, wx.ID_ANY, "Get")
self.btnSet3.SetToolTip("Place the laser over the desired point and press...")
sizer_3.Add(self.btnSet3, 0, 0, 0)
lbl_pos_3 = wx.StaticText(self.nb_circle, wx.ID_ANY, "<empty>")
sizer_3.Add(lbl_pos_3, 0, 0, 0)
image1 = wx.StaticBitmap(self.nb_circle, wx.ID_ANY, wx.Bitmap("C:\\Users\\MCHPIRNAYJ\\OneDrive - FUJITSU\\Desktop\\circle.png", wx.BITMAP_TYPE_ANY))
image1.SetToolTip("Instruction: place the laser on three points on the circumference of the circle on the bed and confirm the position by clicking on the buttons below.\nMK will find the center for you and place the laser above it or will recreate the circle for futher processing.")
sizer_9.Add(image1, 1, 0, 0)
sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
sizer_circle.Add(sizer_4, 0, wx.EXPAND, 0)
self.btn_move = wx.Button(self.nb_circle, wx.ID_ANY, "Move to center")
sizer_4.Add(self.btn_move, 0, 0, 0)
self.button_1 = wx.Button(self.nb_circle, wx.ID_ANY, "Create circle")
sizer_4.Add(self.button_1, 0, 0, 0)
self.check_reference_1 = wx.CheckBox(self.nb_circle, wx.ID_ANY, "Make reference")
self.check_reference_1.SetMinSize((-1, 23))
sizer_4.Add(self.check_reference_1, 0, 0, 0)
self.nb_rectangle = wx.Panel(self.nbook_lasertools, wx.ID_ANY)
self.nbook_lasertools.AddPage(self.nb_rectangle, "Place rectangle")
sizer_rectangle = wx.BoxSizer(wx.VERTICAL)
sizer_11 = wx.BoxSizer(wx.HORIZONTAL)
sizer_rectangle.Add(sizer_11, 0, wx.EXPAND, 0)
sizer_12 = wx.BoxSizer(wx.VERTICAL)
sizer_11.Add(sizer_12, 0, wx.EXPAND, 0)
sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
sizer_12.Add(sizer_5, 1, wx.EXPAND, 0)
label_4 = wx.StaticText(self.nb_rectangle, wx.ID_ANY, "Side A 1")
label_4.SetMinSize((45, 23))
sizer_5.Add(label_4, 0, 0, 0)
self.btnSet1_copy = wx.Button(self.nb_rectangle, wx.ID_ANY, "Get")
self.btnSet1_copy.SetToolTip("Place the laser over the desired point and press...")
sizer_5.Add(self.btnSet1_copy, 0, 0, 0)
lbl_pos_4 = wx.StaticText(self.nb_rectangle, wx.ID_ANY, "<empty>")
sizer_5.Add(lbl_pos_4, 0, 0, 0)
sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
sizer_12.Add(sizer_6, 1, wx.EXPAND, 0)
label_5 = wx.StaticText(self.nb_rectangle, wx.ID_ANY, "Side A 2")
label_5.SetMinSize((45, 23))
sizer_6.Add(label_5, 0, 0, 0)
self.btnSet2_copy = wx.Button(self.nb_rectangle, wx.ID_ANY, "Get")
self.btnSet2_copy.SetToolTip("Place the laser over the desired point and press...")
sizer_6.Add(self.btnSet2_copy, 0, 0, 0)
lbl_pos_5 = wx.StaticText(self.nb_rectangle, wx.ID_ANY, "<empty>")
sizer_6.Add(lbl_pos_5, 0, 0, 0)
sizer_7 = wx.BoxSizer(wx.HORIZONTAL)
sizer_12.Add(sizer_7, 1, wx.EXPAND, 0)
label_6 = wx.StaticText(self.nb_rectangle, wx.ID_ANY, "Side B")
label_6.SetMinSize((45, 23))
sizer_7.Add(label_6, 0, 0, 0)
self.btnSet3_copy = wx.Button(self.nb_rectangle, wx.ID_ANY, "Get")
self.btnSet3_copy.SetToolTip("Place the laser over the desired point and press...")
sizer_7.Add(self.btnSet3_copy, 0, 0, 0)
lbl_pos_6 = wx.StaticText(self.nb_rectangle, wx.ID_ANY, "<empty>")
sizer_7.Add(lbl_pos_6, 0, 0, 0)
image2 = wx.StaticBitmap(self.nb_rectangle, wx.ID_ANY, wx.Bitmap("C:\\Users\\MCHPIRNAYJ\\OneDrive - FUJITSU\\Desktop\\rectangle.png", wx.BITMAP_TYPE_ANY))
image2.SetToolTip("Instruction: place the laser on two points of one side of a rectangle on the bed and confirm the position by clicking on the buttons below. Then choose one point on the other side of the corner.\nMK will create a rectangle for you for futher processing.")
sizer_11.Add(image2, 1, 0, 0)
sizer_8 = wx.BoxSizer(wx.HORIZONTAL)
sizer_rectangle.Add(sizer_8, 0, wx.EXPAND, 0)
self.btn_move_copy = wx.Button(self.nb_rectangle, wx.ID_ANY, "Create rectangle")
sizer_8.Add(self.btn_move_copy, 0, 0, 0)
self.check_reference_2 = wx.CheckBox(self.nb_rectangle, wx.ID_ANY, "Make reference")
self.check_reference_2.SetMinSize((-1, 23))
sizer_8.Add(self.check_reference_2, 0, 0, 0)
self.nb_rectangle.SetSizer(sizer_rectangle)
self.nb_circle.SetSizer(sizer_circle)
self.SetSizer(sizer_main)
sizer_main.Fit(self)
self.Layout()
self.btnSet1.Bind(wx.EVT_BUTTON, self.on_click_get)
self.btnSet2.Bind(wx.EVT_BUTTON, self.on_click_get)
self.btnSet3.Bind(wx.EVT_BUTTON, self.on_click_get)
self.btn_move.Bind(wx.EVT_BUTTON, self.on_bt_move_center)
self.button_1.Bind(wx.EVT_BUTTON, self.on_btn_create_circle)
self.btnSet1_copy.Bind(wx.EVT_BUTTON, self.on_click_get)
self.btnSet2_copy.Bind(wx.EVT_BUTTON, self.on_click_get)
self.btnSet3_copy.Bind(wx.EVT_BUTTON, self.on_click_get)
self.btn_move_copy.Bind(wx.EVT_BUTTON, self.on_bt_move_center)
# end wxGlade
def on_click_get(self, event): # wxGlade: clsLasertools.<event_handler>
print("Event handler 'on_click_get' not implemented!")
event.Skip()
def on_bt_move_center(self, event): # wxGlade: clsLasertools.<event_handler>
print("Event handler 'on_bt_move_center' not implemented!")
event.Skip()
def on_btn_create_circle(self, event): # wxGlade: clsLasertools.<event_handler>
print("Event handler 'on_btn_create_circle' not implemented!")
event.Skip()
# end of class clsLasertools