from tkinter import *
from tkinter.ttk import *
import os
import xlrd
import detailgui
import detailgui1
import detailgui2
import detailgui3
import detailgui4
import detailgui5
import win32api
import win32con
for i in range(1,1500):
win32api.mouse_event(win32con.MOUSEEVENTF_WHEEL,0,0,-1)
class MainWindow(Tk):
def __init__(self):
super().__init__()
self.title("Visualisierungssystem für Schraubenmanagement von Chassis Vorder- und Hinterachse Aggregat")
self.geometry("1300x900+200+100")
self.resizable(True, True)
self["bg"] = "lavender"#lavender
self.setup_UI()
def setup_UI(self):
self.Style01 = Style()
self.Style01.configure("right.TPanedwindow", background="lavender")
self.Style01.configure("TButton", width=3, font=("宋体", 10,"normal") )
self.Login_image = PhotoImage(file="D:\\bolt\\bolt5.PNG")
self.Lable_image = Label(self, image=self.Login_image)
self.Lable_image.pack()
self.Pane_right = PanedWindow(width=1700, height=1000, style="right.TPanedwindow")
self.Pane_right.place(x=0, y=200)
self.Pane_right = PanedWindow(width=1800, height=480, style="right.TPanedwindow")
self.Pane_right.place(x=0, y=180)
self.LabelFrame_query = LabelFrame(self.Pane_right, text="Teileinformationen suchen", width=988, height=150)
self.LabelFrame_query.place(x=145, y=-2)
self.Label_sno = Label(self.LabelFrame_query, text="Teilenummer:")
self.Label_sno.place(x=10, y=20)
self.Entry_sno = Entry(self.LabelFrame_query, width=12)
self.Entry_sno.place(x=100, y=20)
self.Label_name = Label(self.LabelFrame_query, text="Positionsnummer:")
self.Label_name.place(x=357, y=20)
self.Entry_name = Entry(self.LabelFrame_query, width=5)
self.Entry_name.place(x=473, y=20)
self.Label_id = Label(self.LabelFrame_query, text="Fahrzeugtyp:")
self.Label_id.place(x=200, y=20)
self.Entry_id = Entry(self.LabelFrame_query, width=8)
self.Entry_id.place(x=285, y=20)
self.Button_query = Button(self.LabelFrame_query, text="Suchen", width=8,command = self.get_query_result)
self.Button_query.place(x=530, y=20)
self.Button_all = Button(self.LabelFrame_query, text="Alles zeigen", width=12,command = self.load_all_student)
self.Button_all.place(x=610, y=20)
self.Button_MQB = Button(self.LabelFrame_query, text="MQB.VA", width=10,command = self.update_student)
self.Button_MQB.place(x=720, y=5)
self.Button_MQB1 = Button(self.LabelFrame_query, text="MQB.HA", width=10, command=self.update_student1)
self.Button_MQB1.place(x=720, y=35)
self.Button_MLB = Button(self.LabelFrame_query, text="MLB.VA", width=10, command=self.update_student2)
self.Button_MLB.place(x=810, y=5)
self.Button_MLB1 = Button(self.LabelFrame_query, text="MLB.HA", width=10, command=self.update_student3)
self.Button_MLB1.place(x=810, y=35)
self.Button_MEB = Button(self.LabelFrame_query, text="MEB.VA", width=10, command=self.update_student4)
self.Button_MEB.place(x=900, y=5)
self.Button_MEB1 = Button(self.LabelFrame_query, text="MEB.HA", width=10, command=self.update_student5)
self.Button_MEB1.place(x=900, y=35)
self.Tree = Treeview(self.Pane_right, columns=("sno", "names","platform","gender", "birthday","mobile","email","address","number"),show="headings", height=18)
self.Tree.column("sno", width=98, anchor="center")
self.Tree.column("names", width=80, anchor="center")
self.Tree.column("platform", width=65, anchor="center")
self.Tree.column("gender", width=85, anchor="center")
self.Tree.column("birthday", width=60, anchor="center")
self.Tree.column("mobile", width=200, anchor="center")
self.Tree.column("email", width=100, anchor="center")
self.Tree.column("address", width=246, anchor="center")
self.Tree.column("number", width=50, anchor="center")
self.Tree.heading("sno", text="Teilenummer")
self.Tree.heading("names", text="Fahrzeugtyp")
self.Tree.heading("platform", text="Plattform")
self.Tree.heading("gender", text="VA/HA")
self.Tree.heading("birthday", text="Positionsnummer")
self.Tree.heading("mobile", text="Montageposition")
self.Tree.heading("email", text="PDM-Nummer")
self.Tree.heading("address", text="Monatgemoment")
self.Tree.heading("number",text="Anzahl")
self.Tree.place(x=145, y=95)
self.all_student_list = []
self.file_path = "D:\\bolt\\demo保密版Deutsch.xls"
self.load_file_student_info()
data = xlrd.open_workbook("D:\\bolt\\demo保密版Deutsch.xls")
table = data.sheets()[0]
nrows = table.nrows
sl = Scrollbar(self)
Listbox(self.Tree)['yscrollcommand'] = sl.set
sl['command'] = Listbox(self.Tree).yview
self.Tree.bind("<Double-1>", self.view_student)
self.Tree.bind("<Double-3>", self.view_pdm)
def load_file_student_info(self):
if not os.path.exists(self.file_path):
showinfo("系统消息", "提供的文件名不存在!")
else:
try:
data=xlrd.open_workbook("D:\\bolt\\demo保密版Deutsch.xls")
table=data.sheets()[0]
nrows=table.nrows
for i in range(nrows):
if i==0:
continue
self.all_student_list.append(table.row_values(i))
except:
showinfo("系统消息", "文件读取出现异常!")
self.load_treeview(self.all_student_list)
def load_treeview(self, current_list: list):
if len(current_list) == 0:
showinfo("系统消息", "没有数据加载")
else:
for index in range(len(current_list)):
self.Tree.insert("", index, values=(current_list[index][0], current_list[index][1],current_list[index][2], current_list[index][3],current_list[index][4],current_list[index][5],current_list[index][6],current_list[index][7],current_list[index][8]))
self.query_result_list = []
self.var_sno = StringVar()
self.var_id = StringVar()
self.var_name = StringVar()
self.query_result_list.clear()
def get_query_result(self):
query_condition = []
query_condition.append(self.Entry_sno.get().strip())
query_condition.append(self.Entry_id.get().strip())
query_condition.append(self.Entry_name.get().strip())
query_condition[0] = self.Entry_sno.get()
query_condition[1] = self.Entry_id.get()
query_condition[2] = self.Entry_name.get()
for item in self.all_student_list:
if (query_condition[1] in item[1] and query_condition[0] in item[0]) and (query_condition[2] == item[4]):
self.query_result_list.append(item)
if (query_condition[1] in item[1] and query_condition[0] in item[0]) and (query_condition[2] == ''):
self.query_result_list.append(item)
for i in self.Tree.get_children():
self.Tree.delete(i)
self.load_treeview(self.query_result_list)
def load_all_student(self):
self.var_sno.set("")
self.var_id.set("")
self.var_name.set("")
for i in self.Tree.get_children():
self.Tree.delete(i)
self.load_treeview(self.all_student_list)
def load_detail_window(self):
detail_window = detailgui.DetailWindow()
def update_student(self):
self.load_detail_window()
def load_detail_window1(self):
detail_window = detailgui1.DetailWindow()
def update_student1(self):
self.load_detail_window1()
def load_detail_window2(self):
detail_window = detailgui2.DetailWindow()
def update_student2(self):
self.load_detail_window2()
def load_detail_window3(self):
detail_window = detailgui3.DetailWindow()
def update_student3(self):
self.load_detail_window3()
def load_detail_window4(self):
detail_window = detailgui4.DetailWindow()
def update_student4(self):
self.load_detail_window4()
def load_detail_window5(self):
detail_window = detailgui5.DetailWindow()
def update_student5(self):
self.load_detail_window5()
def set(self, *args):
"""Set the fractional values of the slider position (upper and
lower ends as value between 0 and 1)."""
self.tk.call((self._w, 'set') + args)
def view_student(self, event):
sub_str = "MQB"
sub_str1 = "MLB"
sub_str2 = "MEB"
item = self.Tree.selection()[0]
Temp_student_list = self.Tree.item(item, "values")
if Temp_student_list[3] == 'Vorderachse':
if Temp_student_list[2] == 'MLB':
self.load_detail_window2()
else:
if Temp_student_list[2] == 'MQB':
self.load_detail_window()
else:
self.load_detail_window4()
else:
if Temp_student_list[2] == 'MQB':
self.load_detail_window1()
else:
if Temp_student_list[2] == 'MLB':
self.load_detail_window3()
else:
self.load_detail_window5()
def view_pdm(self, event):
sub_str = '1EA.199'
sub_str1 = '1EA.400'
sub_str2 = '1EA.423'
sub_str3 = '1EA.501'
sub_str4 = '1EA.816'
sub_str5 = '1ED.615'
sub_str6 = '2Q0.199'
sub_str7 = '2Q0.400'
sub_str8 = '2Q0.423'
sub_str9 = '2Q0.615'
sub_str10 = '3Q0.400'
sub_str11 = '3QF.400'
sub_str12 = '4M0.199'
sub_str13 = '5Q0.199'
sub_str14 = '5Q0.400'
sub_str15 = '5Q0.423'
sub_str16 = '5Q0.500'
sub_str17 = '5Q0.501'
sub_str18 = '5Q0.615'
sub_str19 = '8W0.400'
sub_str20 = '8W0.501'
sub_str21 = '8W0.615'
sub_str22 = '80A.400'
sub_str23 = '80A.501'
sub_str24 = '80A.615'
sub_str25 = '180.199'
sub_str26 = '180.400'
sub_str27 = '180.615'
sub_str28 = 'TAB.017.598'
sub_str29 = 'TAB.017.694'
sub_str30 = '4M0.501'
sub_str31 = '4N0.501'
item = self.Tree.selection()[0]
Temp_student_list = self.Tree.item(item, "values")
if sub_str in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.1EA.199.pdf")
if sub_str1 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.1EA.400.pdf")
if sub_str2 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.1EA.423.pdf")
if sub_str3 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.1EA.501.pdf")
if sub_str4 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.1EA.816.pdf")
if sub_str5 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.1ED.615.pdf")
if sub_str6 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.2Q0.199.pdf")
if sub_str7 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.2Q0.400.pdf")
if sub_str8 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.2Q0.423.pdf")
if sub_str9 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.2Q0.615.pdf")
if sub_str10 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.3Q0.400.pdf")
if sub_str11 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.3QF.400.pdf")
if sub_str12 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.4M0.199.pdf")
if sub_str13 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.5Q0.199.pdf")
if sub_str14 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.5Q0.400.pdf")
if sub_str15 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.5Q0.423.pdf")
if sub_str16 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.5Q0.500.pdf")
if sub_str17 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.5Q0.501.pdf")
if sub_str18 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.5Q0.615.pdf")
if sub_str19 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.8W0.400.pdf")
if sub_str20 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.8W0.501.pdf")
if sub_str21 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.8W0.615.pdf")
if sub_str22 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.80A.400.pdf")
if sub_str23 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.80A.501.pdf")
if sub_str24 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.80A.615.pdf")
if sub_str25 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.180.199.pdf")
if sub_str26 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.180.400.pdf")
if sub_str27 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.180.615.pdf")
if sub_str28 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\TAB.017.598.tif")
if sub_str29 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\TAB.017.694.tif")
if sub_str30 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.80A.501.pdf")
if sub_str31 in Temp_student_list[6] :
os.system("start explorer D:\\bolt\\PDM\\PDM.80A.501.pdf")
mainwindow = MainWindow()
mainwindow.mainloop()
from tkinter import *
from tkinter.ttk import *
import os
class DetailWindow(Toplevel):
def __init__(self):
super().__init__()
self.title("MQB-Vorderachs-Montagezeichnung")
self.geometry("1100x1100+180+80")
self.resizable(True, True)
self.setup_UI()
def setup_UI(self):
self.Style01 = Style()
self.Login_image = PhotoImage(file="D:\\bolt\\MQB前.PNG")
self.Lable_image = Label(self, image=self.Login_image)
self.Lable_image.pack()
if __name__ == '__main__':
this_window = DetailWindow()
this_window.mainloop()
from tkinter import *
from tkinter.ttk import *
import os
class DetailWindow(Toplevel):
def __init__(self):
super().__init__()
self.title("MQB-Hinterachs-Montagezeichnung")
self.geometry("1000x1000+180+80")
self.resizable(True, True)
self.setup_UI()
def setup_UI(self):
self.Style01 = Style()
self.Login_image = PhotoImage(file="D:\\bolt\\MQB后.PNG")
self.Lable_image = Label(self, image=self.Login_image)
self.Lable_image.pack()
if __name__ == '__main__':
this_window = DetailWindow()
this_window.mainloop()
from tkinter import *
from tkinter.ttk import *
import os
class DetailWindow(Toplevel):
def __init__(self):
super().__init__()
self.title("MLB-Vorderachs-Montagezeichnung")
self.geometry("1100x1100+180+80")
self.resizable(True, True)
self.setup_UI()
def setup_UI(self):
self.Style01 = Style()
self.Login_image = PhotoImage(file="D:\\bolt\\MLB前.PNG")
self.Lable_image = Label(self, image=self.Login_image)
self.Lable_image.pack()
if __name__ == '__main__':
this_window = DetailWindow()
this_window.mainloop()
from tkinter import *
from tkinter.ttk import *
import os
class DetailWindow(Toplevel):
def __init__(self):
super().__init__()
self.title("MLB-Hinterachs-Montagezeichnung")
self.geometry("1100x1100+180+80")
self.resizable(True, True)
self.setup_UI()
def setup_UI(self):
self.Style01 = Style()
self.Login_image = PhotoImage(file="D:\\bolt\\MLB后.PNG")
self.Lable_image = Label(self, image=self.Login_image)
self.Lable_image.pack()
if __name__ == '__main__':
this_window = DetailWindow()
this_window.mainloop()
from tkinter import *
from tkinter.ttk import *
import os
class DetailWindow(Toplevel):
def __init__(self):
super().__init__()
self.title("MEB-Vorderachs-Montagezeichnung")
self.geometry("1100x1100+180+80")
self.resizable(True, True)
self.setup_UI()
def setup_UI(self):
self.Style01 = Style()
self.Login_image = PhotoImage(file="D:\\bolt\\MEB前.PNG")
self.Lable_image = Label(self, image=self.Login_image)
self.Lable_image.pack()
if __name__ == '__main__':
this_window = DetailWindow()
this_window.mainloop()
from tkinter import *
from tkinter.ttk import *
import os
class DetailWindow(Toplevel):
def __init__(self):
super().__init__()
self.title("MEB-Hinterachs-Montagezeichnung")
self.geometry("1100x1100+180+80")
self.resizable(True, True)
self.setup_UI()
def setup_UI(self):
self.Style01 = Style()
self.Login_image = PhotoImage(file="D:\\bolt\\MEB后.PNG")
self.Lable_image = Label(self, image=self.Login_image)
self.Lable_image.pack()
if __name__ == '__main__':
this_window = DetailWindow()
this_window.mainloop()