def clear(self): if self.running == True: return self.tv = [[], []] g.delete_lines() self.msg(_('Cleared Data and Trace')) def msg(self, s, col='blue'): msgwin.config(text=s, fg=col) p = eyes.open() p.disable_actions() root = Tk() Canvas(root, width=WIDTH, height=5).pack(side=TOP) # Some space at the top g = eyeplot.graph(root, width=WIDTH, height=HEIGHT, bip=False) # make plot objects using draw.disp pen = SRF2() cf = Frame(root, width=WIDTH, height=10) cf.pack(side=TOP, fill=BOTH, expand=1) b3 = Label(cf, text=_('Digitize for')) b3.pack(side=LEFT, anchor=SW) DURATION = StringVar() Dur = Entry(cf, width=5, bg='white', textvariable=DURATION) DURATION.set('10') Dur.pack(side=LEFT, anchor=SW) b3 = Label(cf, text=_('Seconds.')) b3.pack(side=LEFT, anchor=SW) b3 = Label(cf, text=_('Max Dist=')) b3.pack(side=LEFT, anchor=SW)
self.msg(_('Cleared Data and Trace')) def msg(self,s, col = 'blue'): msgwin.config(text=s, fg=col) def quit(self): p.set_state(10,0) sys.exit() p = eyes.open() p.disable_actions() root = Tk() Canvas(root, width = WIDTH, height = 5).pack(side=TOP) g = eyeplot.graph(root, width=WIDTH, height=HEIGHT, bip=False) pt = LM35() cf = Frame(root, width = WIDTH, height = 10) cf.pack(side=TOP, fill = BOTH, expand = 1) b3 = Label(cf, text = _('Read Every')) b3.pack(side = LEFT, anchor = SW) TGAP = StringVar() Dur =Entry(cf, width=5, bg = 'white', textvariable = TGAP) TGAP.set('1000') Dur.pack(side = LEFT, anchor = SW) b3 = Label(cf, text = _('mS,')) b3.pack(side = LEFT, anchor = SW) b3 = Label(cf, text = _('for total')) b3.pack(side = LEFT, anchor = SW)
msg.config(text = s) def clear(): global history, trial, running if running == True: return g.delete_lines() history = [] trial = 0 p = eyes.open() p.loadall_calib() p.disable_actions() root = Tk() Canvas(root, width = WIDTH, height = 5).pack(side=TOP) # Some space at the top g = eyeplot.graph(root, width=WIDTH, height=HEIGHT) # make plot objects using draw.disp g.setWorld(MINX, MINY, MAXX, MAXY,_('V'),_('mA')) cf = Frame(root, width = WIDTH, height = 10) cf.pack(side=TOP, fill = BOTH, expand = 1) ZEN = IntVar() cb0 = Checkbutton(cf,text =_('ZENER'), variable=ZEN, fg = 'black') cb0.pack(side=LEFT, anchor = SW) b1 = Button(cf, text = _('START'), command = start) b1.pack(side = LEFT, anchor = N) b3 = Button(cf, text = _('SAVE to'), command = save) b3.pack(side = LEFT, anchor = N) filename = StringVar() e1 =Entry(cf, width=15, bg = 'white', textvariable = filename) filename.set('diode_iv.dat')
#-----------------------------main program starts here----------------------------- for k in range(10): # Test the hardware availability by by running another program. stat,out = commands.getstatusoutput('python '+ eyeplot.abs_path() + 'hwtest.py') if stat == 0: break pe = eyes.open() # Try several times to make a connection root = Tk() left = Frame(root) # Divide root window into Left and Right left.pack(side=LEFT, anchor = S) right = Frame(root) right.pack(side = LEFT, anchor = S, fill = Y), w=eyePanel(left, pe, WIDTH, HEIGHT) # Panel photograph to the Left Panel g = eyeplot.graph(right, WIDTH*1.05, HEIGHT*2./3,color = 'white', labels=False) # Plot window g.setWorld(0,-5*VPERDIV, NP * delay * 0.001, 5*VPERDIV,_('mS'),'V') cf = Frame(right) # Command Frame, inside the right frame, below plot window cf.pack(side=TOP, anchor = NW) l = Label(cf, text=_('mS/div')) l.pack(side=LEFT, anchor = SW ) timebase = Scale(cf,command = set_timebase, orient=HORIZONTAL, length=50, showvalue=False,\ from_ = 0, to=9, resolution=1) timebase.pack(side=LEFT, anchor = SW) timebase.set(2) ''' l = Label(text = 'Volt/div') vpd = Scale(cf,command = set_vertical, orient=HORIZONTAL, length=50, showvalue=False,\ from_ = 0, to=2, resolution=1)
Vpd.pack(side=TOP, anchor = SW) Vpd.set(1) Label(f1,text = _('Trig level')).pack(side=TOP, anchor = SW) Trig = Scale(f1,command = set_trigger, orient=HORIZONTAL, length=LPWIDTH, showvalue=False,\ from_ = 100, to=4000, resolution=10) Trig.pack(side=TOP, anchor = SW) Trig.set(2050) #----------------------- Middle Frame ------------------------ a = Frame(top, width = LPWIDTH, height = HEIGHT) a.pack(side=LEFT, fill = BOTH, expand = 1) f = Frame(a, width = 75, height = HEIGHT) f.pack(side=TOP, fill = BOTH, expand = 1) g = eyeplot.graph(f, width=WIDTH, height=HEIGHT) # make plot objects using draw.disp g.setWorld(0, -5, 20, 5,_('mS'),'V') #============== Vertical scales for OFFSET adjustment. Lambda not working with Scale callbacks !!! ===== of = Frame(top, width = 1, height = HEIGHT) of.pack(side=LEFT, fill = BOTH, expand = 1) Scale(of, orient=VERTICAL, length=HEIGHT/4, showvalue = False, bg = chancols[0],\ from_ = 4, to=-4, resolution=1, command = set_ch1_offset).pack(side=TOP) Scale(of, orient=VERTICAL, length=HEIGHT/4, showvalue = False, bg = chancols[1],\ from_ = 4, to=-4, resolution=1, command = set_ch2_offset).pack(side=TOP) Scale(of, orient=VERTICAL, length=HEIGHT/4, showvalue = False, bg = chancols[2],\ from_ = 4, to=-4, resolution=1, command = set_ch3_offset).pack(side=TOP) Scale(of, orient=VERTICAL, length=HEIGHT/4, showvalue = False, bg = chancols[3],\ from_ = 4, to=-4, resolution=1, command = set_ch4_offset).pack(side=TOP)
Xc = 0.0 dphi = math.atan( (Xc-Xl)/R)*180./math.pi s = _('XC = %5.1f XL = %5.1f\nDphi = %5.1f degree') %(Xc, Xl, dphi) Calc2.config(text = s, fg='blue') except: Calc2.config(text = _('Wrong Input'), fg='red') #=============================== main program starts here =================================== p = eyes.open() if p == None: sys.exit() p.set_trigger(2048) root = Tk() f = Frame(root) f.pack(side=LEFT) g = eyeplot.graph(f, width=WIDTH, height=HEIGHT) # make plot objects using draw.disp g.setWorld(0, -5, 20, 5,_('mS'),_('V')) f1 = Frame(f) f1.pack(side=TOP, fill = BOTH, expand = 1) Label(f1,text = _('mSec/div')).pack(side=LEFT, anchor = SW) # Sliders for Adjusting Axes timebase = Scale(f1,command = set_timebase, orient=HORIZONTAL, length=LPWIDTH, showvalue=False,\ from_ = 0, to=9, resolution=1) timebase.pack(side=LEFT, anchor = SW) timebase.set(3) Label(f1,text = _('Volt/div')).pack(side=LEFT, anchor = SW) Vpd = Scale(f1,command = set_vertical, orient=HORIZONTAL, length=LPWIDTH, showvalue=False,\ from_ = 0, to=3, resolution=1) Vpd.pack(side=LEFT, anchor = SW) Vpd.set(1)
print(stat) if stat == 0: break pe = eyes.open() # Try several times to make a connection root = Tk() left = Frame(root) # Divide root window into Left and Right left.pack(side=LEFT, anchor=S) right = Frame(root) right.pack(side=LEFT, anchor=S, fill=Y) w = eyePanel(left, pe, WIDTH, HEIGHT) # Panel photograph to the Left Panel g = eyeplot.graph(right, WIDTH * 1.05, HEIGHT * 2. / 3, color='white', labels=False) # Plot window g.setWorld(0, -5 * VPERDIV, NP * delay * 0.001, 5 * VPERDIV, 'mS', 'V') cf = Frame( right) # Command Frame, inside the right frame, below plot window cf.pack(side=TOP, anchor=NW) l = Label(cf, text='mS/div') l.pack(side=LEFT, anchor=SW) timebase = Scale(cf,command = set_timebase, orient=HORIZONTAL, length=50, showvalue=False,\ from_ = 0, to=9, resolution=1) timebase.pack(side=LEFT, anchor=SW) timebase.set(2) ''' l = Label(text = 'Volt/div')
Xc = 0.0 dphi = math.atan( (Xc-Xl)/R)*180./math.pi s = _('XC = %5.1f XL = %5.1f\nDphi = %5.1f degree') %(Xc, Xl, dphi) Calc2.config(text = s, fg='blue') except: Calc2.config(text = _('Wrong Input'), fg='red') #===================== main program starts here =========================== p = eyes.open() if p == None: sys.exit() p.set_trigger(2048) root = Tk() f = Frame(root) f.pack(side=LEFT) g = eyeplot.graph(f, width=WIDTH, height=HEIGHT) # make plot objects using draw.disp g.setWorld(0, -5, 20, 5,_('mS'),_('V')) f1 = Frame(f) f1.pack(side=TOP, fill = BOTH, expand = 1) Label(f1,text = _('mSec/div')).pack(side=LEFT, anchor = SW) # Sliders for Adjusting Axes timebase = Scale(f1,command = set_timebase, orient=HORIZONTAL, length=LPWIDTH, showvalue=False, from_ = 0, to=9, resolution=1) timebase.pack(side=LEFT, anchor = SW) timebase.set(3) Label(f1,text = _('Volt/div')).pack(side=LEFT, anchor = SW) Vpd = Scale(f1,command = set_vertical, orient=HORIZONTAL,