This repository was archived by the owner on Dec 16, 2024. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_SlitTableViewer.py
More file actions
Latest commit
93 lines (56 loc) · 1.8 KB
/
Copy pathtest_SlitTableViewer.py
File metadata and controls
93 lines (56 loc) · 1.8 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
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 20 13:31:31 2023
@author: samos_dev
"""
importtkinterastk
# Used for styling the GUI
#from tkinter import ttk
# import filedialog module
fromtkinterimportfiledialog
fromPILimportImage,ImageTk,ImageOps
importos,sys
importshutil
#from astropy.io import ascii
importtime
importnumpyasnp
importpandasaspd
frompathlibimportPath
path=Path(__file__).parent.absolute()
local_dir=str(path.absolute())
parent_dir=str(path.parent)
sys.path.append(parent_dir)
SF_path=parent_dir+"/SAMOS_system_dev"
os.sys.path.append(SF_path)
fromSlitTableViewerimportSlitTableViewasSTView
#slitView = STView()
importtksheet
importregions
fromregionsimportRegions
fromregionsimportPixCoord, RectanglePixelRegion, PointPixelRegion, RegionVisual
fromSAMOS_DMD_dev.CONVERT.CONVERT_classimportCONVERT
convert=CONVERT()
x=500
y=700
width=50
height=20
viewer='test, no canvas viewer'
fromregionsimportPixCoord, RectanglePixelRegion, PointPixelRegion, RegionVisual
classNewWindow(tk.Tk):
def__init__(self,):# master = None):
super().__init__()#(master = master)
self.title("New Window")
self.geometry("200x200")
label=tk.Label(self, text="New Window")
label.pack()
btn=tk.Button(self, text="Open table window")
btn.bind("<Button>", self.display_slit_table)
btn.pack(pady=10)
defdisplay_slit_table(self, event):
self.SlitTabView=STView()
defadd_slit(self, obj, viewer):
rect_obj=RectanglePixelRegion(PixCoord(x=x,y=y), width=width, height=height)
self.SlitTabView.add_slit_obj(rect_obj, viewer)
root=NewWindow()
root.mainloop()