-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReconfigure.py
More file actions
54 lines (41 loc) · 1.51 KB
/
Reconfigure.py
File metadata and controls
54 lines (41 loc) · 1.51 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
import tkinter as tk
from Printer import PrinterConfig
from Board import BoardConfig
from Stepper import StepperConfig
from Extruder import ExtruderConfig
import ConfigSection
class Reconfigure:
border_effects = {"flat": tk.FLAT, "sunken": tk.SUNKEN, "raised": tk.RAISED, "groove": tk.GROOVE,
"ridge": tk.RIDGE}
config: [ConfigSection]
def __init__(self):
self.mainframe = None
self.window = None
self.board_config = BoardConfig(self)
self.pin_map = None
self.config = list()
def create_window(self):
self.window = tk.Tk()
self.mainframe = tk.Frame(master=self.window, relief=self.border_effects.get("raised"))
self.mainframe.pack()
def destroy_window(self):
self.mainframe.destroy()
self.window.destroy()
def add_config_section(self, config_section):
# print("adding section " + config_section.get_name())
self.config.append(config_section)
def set_pin_map(self, pin_map):
self.pin_map = pin_map
def init_printer(self):
self.printer_config = PrinterConfig(self)
def init_stepper(self):
self.stepper_config = StepperConfig(self)
def init_extruder(self):
self.extruder_config = ExtruderConfig(self)
main = Reconfigure()
main.board_config.board_selection_gui(main)
print("Config generated: ")
for section in main.config:
print(section.get_output())
print("\n\n")
# main.window.quit()