-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.py
66 lines (51 loc) · 1.57 KB
/
settings.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
import os
import time
import serial
import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk
import serial
from quatre_etapes import *
class RubiksSolverGui:
def __init__(self, master):
self.master = master
master.title("Rubik's Cube Solver!")
self.frame = tk.Frame(master)
self.image = Image.open("cubeR2.gif")
self.photo = ImageTk.PhotoImage(self.image)
self.label = tk.Label(self.frame, image=self.photo)
self.label.grid(row=0, column=0)
self.label = tk.Label(self.frame, text="Welcome to the Rubik's Cube Solver!")
self.label.grid(row=1, column=0, pady=(5, 5))
self.pic_button = tk.Button(self.frame, text="Scan", command=self.solve)
self.pic_button.grid(row=2, pady=(5, 5))
self.frame.pack(padx=5, pady=5)
self.frame2 = tk.Frame(master)
self.frame2.pack()
self.frame3 = tk.Frame(master)
self.frame3.pack()
def solve(self):
cube = Cube(str())
cube.resolution()
print("solving")
pass
def init():
global ser
ser = serial.Serial('/dev/ttyACM2', timeout=.1)
global root
root = tk.Tk()
global my_gui
my_gui = RubiksSolverGui(root)
global incr
incr = 0
global images
images = []
global photos
photos = []
global texts
texts = []
global pos
pos = {1: (0, 0, 1, 0), 2: (0, 1, 1, 1), 3: (2, 0, 3, 0), 4: (2, 1, 3, 1), 5: (4, 0, 5, 0), 6: (4, 1, 5, 1), 7: (6, 0, 7, 0), 8: (6, 1, 7, 1)}
global vs
vs = []
print("init done")