SEletion from listbox implemented
This commit is contained in:
parent
f1b763309a
commit
3f38ecf348
33
JFSphoto.py
33
JFSphoto.py
@ -309,11 +309,8 @@ class Jfsphoto (object):
|
|||||||
self.fig = plt.Figure(figsize=(8,4),dpi=100)
|
self.fig = plt.Figure(figsize=(8,4),dpi=100)
|
||||||
self.ax1 = self.fig.add_subplot(111)
|
self.ax1 = self.fig.add_subplot(111)
|
||||||
|
|
||||||
t = arange(0.0, 3.0, 0.01)
|
|
||||||
s = sin(2*pi*t)
|
|
||||||
self.ax1.plot(t, s, linewidth=0.6)
|
|
||||||
|
|
||||||
self.calculate()
|
|
||||||
|
|
||||||
self.canvas = FigureCanvasTkAgg(self.fig, master = self.ctr_mid)
|
self.canvas = FigureCanvasTkAgg(self.fig, master = self.ctr_mid)
|
||||||
self.canvas._tkcanvas.pack(side = tk.TOP, fill = tk.BOTH, expand = 1)
|
self.canvas._tkcanvas.pack(side = tk.TOP, fill = tk.BOTH, expand = 1)
|
||||||
@ -334,13 +331,24 @@ class Jfsphoto (object):
|
|||||||
self.scrollbar = tk.Scrollbar(master=self.ctr_right)
|
self.scrollbar = tk.Scrollbar(master=self.ctr_right)
|
||||||
self.listbox.config(yscrollcommand =self.scrollbar.set)
|
self.listbox.config(yscrollcommand =self.scrollbar.set)
|
||||||
self.scrollbar.config(command = self.listbox.yview)
|
self.scrollbar.config(command = self.listbox.yview)
|
||||||
self.kbtn1 = tk.Button(master=self.ctr_right,text="show")
|
self.kbtn1 = tk.Button(master=self.ctr_right,text="show",command=self.show_selected)
|
||||||
self.kbtn1.grid(row=14,column=0,sticky="w")
|
self.kbtn1.grid(row=14,column=0,sticky="w")
|
||||||
|
|
||||||
|
if self.calculate() :
|
||||||
|
self.show_first_look()
|
||||||
|
else:
|
||||||
|
t = arange(0.0, 3.0, 0.01)
|
||||||
|
s = sin(2*pi*t)
|
||||||
|
self.ax1.plot(t, s, linewidth=0.6)
|
||||||
|
|
||||||
win.focus_set()
|
win.focus_set()
|
||||||
win.grab_set()
|
win.grab_set()
|
||||||
win.wait_window()
|
win.wait_window()
|
||||||
|
|
||||||
|
def show_selected(self):
|
||||||
|
self.col_list = [self.listbox.get(i) for i in self.listbox.curselection()]
|
||||||
|
self.look()
|
||||||
|
|
||||||
def calculate(self):
|
def calculate(self):
|
||||||
self.ok.set(0)
|
self.ok.set(0)
|
||||||
if 'baseline' in self.df.columns:
|
if 'baseline' in self.df.columns:
|
||||||
@ -350,6 +358,9 @@ class Jfsphoto (object):
|
|||||||
self.do_absorption(xx)
|
self.do_absorption(xx)
|
||||||
for xx in self.col_list:
|
for xx in self.col_list:
|
||||||
self.do_transmission(xx)
|
self.do_transmission(xx)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
def get_kin_list(self):
|
def get_kin_list(self):
|
||||||
self.col_list = list(self.df.columns.values.tolist())
|
self.col_list = list(self.df.columns.values.tolist())
|
||||||
@ -361,9 +372,7 @@ class Jfsphoto (object):
|
|||||||
self.col_list.remove('darkline')
|
self.col_list.remove('darkline')
|
||||||
self.col_list.remove('nmscale')
|
self.col_list.remove('nmscale')
|
||||||
|
|
||||||
def kini(self):
|
def show_first_look(self):
|
||||||
self.load_kinetics("kini.dat")
|
|
||||||
self.calculate()
|
|
||||||
self.ax1.clear()
|
self.ax1.clear()
|
||||||
for xx in self.col_list:
|
for xx in self.col_list:
|
||||||
self.df.plot(x = 'nmscale',y = xx, linewidth=0.6,ax=self.ax1)
|
self.df.plot(x = 'nmscale',y = xx, linewidth=0.6,ax=self.ax1)
|
||||||
@ -371,6 +380,12 @@ class Jfsphoto (object):
|
|||||||
self.ok.set(1)
|
self.ok.set(1)
|
||||||
self.canvas.draw()
|
self.canvas.draw()
|
||||||
|
|
||||||
|
def kini(self):
|
||||||
|
self.load_kinetics("kini.dat")
|
||||||
|
self.calculate()
|
||||||
|
self.show_first_look()
|
||||||
|
|
||||||
|
|
||||||
def do_get_range(self):
|
def do_get_range(self):
|
||||||
self.right = 0
|
self.right = 0
|
||||||
self.left = 0
|
self.left = 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user