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
93 lines (56 loc) · 1.8 KB
/
test_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
"""
import tkinter as tk
# Used for styling the GUI
#from tkinter import ttk
# import filedialog module
from tkinter import filedialog
from PIL import Image,ImageTk,ImageOps
import os,sys
import shutil
#from astropy.io import ascii
import time
import numpy as np
import pandas as pd
from pathlib import Path
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)
from SlitTableViewer import SlitTableView as STView
#slitView = STView()
import tksheet
import regions
from regions import Regions
from regions import PixCoord, RectanglePixelRegion, PointPixelRegion, RegionVisual
from SAMOS_DMD_dev.CONVERT.CONVERT_class import CONVERT
convert = CONVERT()
x = 500
y = 700
width = 50
height = 20
viewer = 'test, no canvas viewer'
from regions import PixCoord, RectanglePixelRegion, PointPixelRegion, RegionVisual
class NewWindow(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)
def display_slit_table(self, event):
self.SlitTabView = STView()
def add_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()