Ejemplo n.º 1
0
def mouse_input_eventx(event):
	global clicks
	global x,y
	global Xmain
	global Ymain
	global mastercount
	global slavecount
	if valueofkey2():
		
		print Xmain,"\n" , Ymain
		ax.plot(Xmain, Ymain,'rx') 
		print 'fyfdflih'
		tktable.write_to_table_master(np.round(Xmain),np.round(Ymain),mastercount,slavecount)
		resetkeyyx()
	if valueofkey1():
			
			slavecount=slavecount+1
			print 'input pixel loc is ',event.xdata,' ', event.ydata
			ax.plot(event.xdata, event.ydata,'rx')
			tktable.write_to_table_slave(np.round(event.xdata),np.round(event.ydata),slavecount,mastercount)
			clicks.append([event.xdata,event.ydata])
			list_Slave.append([np.round(event.xdata), np.round(event.ydata)])
			print list_Slave
			resetkeyy()        
	canvasx.show() 
Ejemplo n.º 2
0
def mouse_input_eventx(event):
	global clicks
	global x,y
	global Xmain
	global Ymain
	global mastercount
	global slavecount
	if valueofkey2():
		
		print Xmain,"\n" , Ymain
		ax.plot(Xmain, Ymain,'rx') 
		print 'fyfdflih'
		tktable.write_to_table_master(np.round(Xmain),np.round(Ymain),mastercount,slavecount)
		resetkeyyx()
	if valueofkey1():
			
			slavecount=slavecount+1
			print 'input pixel loc is ',event.xdata,' ', event.ydata
			ax.plot(event.xdata, event.ydata,'rx')
			tktable.write_to_table_slave(np.round(event.xdata),np.round(event.ydata),slavecount,mastercount)
			clicks.append([event.xdata,event.ydata])
			list_Slave.append([np.round(event.xdata), np.round(event.ydata)])
			print list_Slave
			resetkeyy()        
	canvasx.show() 
Ejemplo n.º 3
0
def mouse_input_event(event):
    if valueofkey():
        global mastercount
        global slavecount
        mastercount=mastercount+1
        print 'input pixel loc is ',event.xdata,' ', event.ydata
        a.plot(event.xdata, event.ydata,'b.')
        tktable.write_to_table_master(np.round(event.xdata),np.round(event.ydata),mastercount,slavecount)
        list_Master.append([np.round(event.xdata), np.round(event.ydata)])
        print list_Master
        resetkeyx()
    canvas.show() 
Ejemplo n.º 4
0
def mouse_input_event(event):
    if valueofkey():
        global mastercount
        global slavecount
        mastercount = mastercount + 1
        print 'input pixel loc is ', event.xdata, ' ', event.ydata
        a.plot(event.xdata, event.ydata, 'b.')
        tktable.write_to_table_master(np.round(event.xdata),
                                      np.round(event.ydata), mastercount,
                                      slavecount)
        list_Master.append([np.round(event.xdata), np.round(event.ydata)])
        print list_Master
        resetkeyx()
    canvas.show()
Ejemplo n.º 5
0
def mouse_input_event(event):
    global x, y
    global order
    global clicks
    if valueofkey():
        global mastercount
        global slavecount
        mastercount = mastercount + 1
        print 'input pixel loc is ', event.xdata, ' ', event.ydata
        a.plot(event.xdata, event.ydata, 'rx')
        if valueofkey2():
            x = event.xdata
            y = event.ydata
            print x, y
            print "\n"
        tktable.write_to_table_master(np.round(event.xdata),
                                      np.round(event.ydata), mastercount,
                                      slavecount)
        clicks.append([event.xdata, event.ydata])
        list_Master.append([np.round(event.xdata), np.round(event.ydata)])
        print "List slave \n", list_Master
        print "\n"
        resetkeyx()
    if keyyx:
        print "yoyo\n yoyo \n yooy\n"
        global Xmain
        global Ymain
        if order == 1:
            Xmain = abca[0] * (x) + abca[1] * (y) + abca[2]
            Ymain = defa[0] * (x) + defa[1] * (y) + defa[2]
            mouse_input_eventx(event)
        if order == 2:
            Xmain = abca[0] * (x)**2 + abca[1] * (y)**2 + abca[2] * (
                x) + abca[3] * (y) + abca[4] * (x) * (y) + abca[5]
            Ymain = defa[0] * (x)**2 + defa[1] * (y)**2 + defa[2] * (
                x) + defa[3] * (y) + defa[4] * (x) * (y) + defa[5]
            mouse_input_eventx(event)
        if order == 3:
            Xmain = abca[0] * (x)**3 + abca[1] * (y)**3 + abca[2] * (
                x)**2 + abca[3] * (y)**2 + abca[4] * (x)**2 * (y) + abca[5] * (
                    x) * (y)**2 + abca[6] * (x) * (y) + abca[7] * (
                        x) + abca[8] * (y) + abca[9]
            Ymain = defa[0] * (x)**3 + defa[1] * (y)**3 + defa[2] * (
                x)**2 + defa[3] * (y)**2 + defa[4] * (x)**2 * (y) + defa[5] * (
                    x) * (y)**2 + defa[6] * (x) * (y) + defa[7] * (
                        x) + defa[8] * (y) + defa[9]
            mouse_input_eventx(event)
    canvas.show()
Ejemplo n.º 6
0
def mouse_input_event(event):
    global x,y    
    global order
    global clicks
    if valueofkey():
        global mastercount
        global slavecount
        mastercount=mastercount+1
        print 'input pixel loc is ',event.xdata,' ', event.ydata
        a.plot(event.xdata, event.ydata,'rx')
        if valueofkey2():
			x=event.xdata
			y=event.ydata
			print x, y 
			print "\n"
        tktable.write_to_table_master(np.round(event.xdata),np.round(event.ydata),mastercount,slavecount)
        clicks.append([event.xdata,event.ydata])
        list_Master.append([np.round(event.xdata), np.round(event.ydata)])
        print "List slave \n", list_Master
        print "\n"
        resetkeyx()
    if keyyx:
		print "yoyo\n yoyo \n yooy\n"
		global Xmain
		global Ymain
		if order==1:
			Xmain=abca[0]*(x)+abca[1]*(y)+abca[2]
			Ymain=defa[0]*(x)+defa[1]*(y)+defa[2]   
			mouse_input_eventx(event)	
		if order==2:
			Xmain=abca[0]*(x)**2+abca[1]*(y)**2+abca[2]*(x)+abca[3]*(y)+abca[4]*(x)*(y)+abca[5]
			Ymain=defa[0]*(x)**2+defa[1]*(y)**2+defa[2]*(x)+defa[3]*(y)+defa[4]*(x)*(y)+defa[5]   
			mouse_input_eventx(event)	
		if order==3:
			Xmain=abca[0]*(x)**3+abca[1]*(y)**3+abca[2]*(x)**2+abca[3]*(y)**2+abca[4]*(x)**2*(y)+abca[5]*(x)*(y)**2+abca[6]*(x)*(y)+abca[7]*(x)+abca[8]*(y)+abca[9]
			Ymain=defa[0]*(x)**3+defa[1]*(y)**3+defa[2]*(x)**2+defa[3]*(y)**2+defa[4]*(x)**2*(y)+defa[5]*(x)*(y)**2+defa[6]*(x)*(y)+defa[7]*(x)+defa[8]*(y)+defa[9]
			mouse_input_eventx(event)	
    canvas.show()