Esempio n. 1
0
	def __on_click(self,widget,data=None):
		if data=='new':
			if len(self.mes.get_text())!=0:
				glu.setKey('Rec Num '+self.num.get_text(),int(self.num.get_text()))
				glu.setKey('Rec Text '+self.num.get_text(),self.mes.get_text())
				self.__refresh()
				pass
			pass
		if data=='del':
			if len(self.num.get_text())!=0:
				glu.delKey('Rec Num '+self.num.get_text())
				glu.delKey('Rec Text '+self.num.get_text())
				self.num.set_text('')
				self.mes.set_text('')
				self.__refresh()
		if data=='resivescale':
			selscale=sysfrm.SelectScale()
			selscale.run()
			selscale.destroy()			
			
			self.__clear_text()
			for i in xrange(1,20): #2000
				try :
					num,txt=tigerlib.getMoreText_209(i)
					glu.setKey('Rec Num '+str(num),num)
					glu.setKey('Rec Text '+str(num),txt)
				except :
					print 'поймали'
					continue
				time.sleep(1)
			self.__refresh()
		if data=='sendcale':
			pass
		pass
Esempio n. 2
0
	def __on_click(self,widget,data=None):
		if data=='insert':
			iefrm=InsEditScale(0)
			iefrm.run()
			if iefrm.ok:
				i=int(glu.getKey('Count Scale'))
				i+=1
				glu.setKey('Num '+str(i),i)
				glu.setKey('Name Scale '+str(i),iefrm.nameScale.get_text())
				glu.setKey('IP '+str(i),iefrm.ipAdress.get_text())
				glu.setKey('Scale use '+str(i),True)
				glu.setKey('Count Scale',i)
				glu.setKey('Number line '+str(i),iefrm.lineNum.get_text())
			iefrm.destroy()
			#print glu.prop
			self.__refresh()
			
		if data=='edit':
			if self.sel_id==None:
				return True
			iefrm=InsEditScale(1,glu.getKey('Name Scale '+str(self.sel_id)),glu.getKey('IP '+str(self.sel_id)),glu.getKey('Number line '+str(self.sel_id)))
			iefrm.run()
			if iefrm.ok:
				glu.setKey('Num '+str(self.sel_id),self.sel_id)
				glu.setKey('Name Scale '+str(self.sel_id),iefrm.nameScale.get_text())
				glu.setKey('IP '+str(self.sel_id),iefrm.ipAdress.get_text())	
				glu.setKey('Number line '+str(self.sel_id),iefrm.lineNum.get_text())
			iefrm.destroy()	
			self.__refresh()
		if data=='del':
			# TODO удаление не работает
			glu.delKey('Num '+str(self.sel_id))
			glu.delKey('Name Scale '+str(self.sel_id))
			glu.delKey('IP '+str(self.sel_id))
			glu.delKey('Number line '+str(self.sel_id))
			self.__refresh()
			pass
		pass
Esempio n. 3
0
	def __on_click(self,widget,data=None):
		if data=='new':
			if len(self.mes.get_text())!=0:
				glu.setKey('Dop Num '+self.num.get_text(),int(self.num.get_text()))
				glu.setKey('Dop Text '+self.num.get_text(),self.mes.get_text())
				self.__refresh()
				pass
			pass
		if data=='del':
			if len(self.num.get_text())!=0:
				glu.delKey('Dop Num '+self.num.get_text())
				glu.delKey('Dop Text '+self.num.get_text())
				self.num.set_text('')
				self.mes.set_text('')
				self.__refresh()
		if data=='resivescale':
			selscale=sysfrm.SelectScale(1,title='прием')
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False			
			
			self.__clear_text()
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,2000): 
						  try :
						  		num,txt=tigerlib.getMoreText_209(i,tigerlib.MULTIOPERATION)
						  		glu.setKey('Dop Num '+str(num),num)
						  		glu.setKey('Dop Text '+str(num),txt)
						  except :
						  	print 'поймали'
						  	continue
						  	#time.sleep(1)
						tigerlib.closesocket()
			self.__refresh()
		if data=='sendcale':
			selscale=sysfrm.SelectScale(title='передача')
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,2000):
							if glu.testKey('Dop Text '+str(i)):
								tigerlib.setMoreText_209(int(glu.getKey('Dop Num '+str(i))),glu.getKey('Dop Text '+str(i)),tigerlib.MULTIOPERATION)
								#time.sleep(1)
							pass
						tigerlib.closesocket()			
			pass
		pass
Esempio n. 4
0
	def __clear_text(self):
		for i in xrange(1,2000):
			if glu.testKey('Dop Num '+str(i)):
				glu.delKey('Dop Num '+str(i))
				glu.delKey('Dop Text '+str(i))
Esempio n. 5
0
	def __on_click(self,widget,data=None):
		if data=='new':
			if len(self.num.get_text())!=0 :
				i=0
				if int(self.num.get_text())>8: return None
				ii=int(self.num.get_text())
				if glu.testKey('BarMask count'):
					i=glu.getKey('BarMask count')
				glu.setKey('BarMask Num '+str(ii),int(self.num.get_text()))
				glu.setKey('BarMask '+str(ii),self.mes.get_text())
				i +=1
				glu.setKey('BarMask count',i)
				self.__refresh()
				pass
			pass
		if data=='del':
			glu.delKey('BarMask Num '+str(self.sel_id))
			glu.delKey('BarMask '+str(self.sel_id))
			self.__refresh()
			pass
		if data=='sendcale':
			selscale=sysfrm.SelectScale()
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,9):
							tigerlib.setBarCode_214(i,glu.getKey('BarMask '+str(i)),tigerlib.MULTIOPERATION)
							#time.sleep(1)
						pass
						tigerlib.closesocket()
			pass
			
		if data=='resivescale':
			selscale=sysfrm.SelectScale(1)
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False	
			
			self.__clear_bar()
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						#print tigerlib.address
						tigerlib.opensocket()
						for i in xrange(1,9):
							num,st=tigerlib.getBarCode_214(i,tigerlib.MULTIOPERATION)
							glu.setKey('BarMask Num '+str(i),num)
							glu.setKey('BarMask '+str(i),st)
							#time.sleep(1)
						tigerlib.closesocket()
						self.__refresh()
		pass
Esempio n. 6
0
	def __clear_bar(self):
		for i in xrange(1,9):
			if glu.testKey('BarMask Num '+str(i)):
				glu.delKey('BarMask Num '+str(i))
				glu.delKey('BarMask '+str(i))
		pass
Esempio n. 7
0
	def __clear_text(self):
		for i in xrange(1,99):
			if glu.testKey('Pers Num '+str(i)):
				glu.delKey('Pers Num '+str(i))
				glu.delKey('Pers Text '+str(i))
Esempio n. 8
0
class SetPerson(gtk.Frame):
	'''
	   Продавцы
	'''
	def __clear_text(self):
		for i in xrange(1,99):
			if glu.testKey('Pers Num '+str(i)):
				glu.delKey('Pers Num '+str(i))
				glu.delKey('Pers Text '+str(i))
				
	def __on_click(self,widget,data=None):
		if data=='resivescale':
			selscale=sysfrm.SelectScale(1)
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False	
			
			self.__clear_text()
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,99):
							try :
								num,txt=tigerlib.getSellers_204(i,modesocket=tigerlib.MULTIOPERATION)
								glu.setKey('Pers Num '+str(num),num)
								glu.setKey('Pers Text '+str(num),txt)
							except Exception,ecx :
								print 'поймали ',ecx
								continue
							#time.sleep(1)
						tigerlib.closesocket()
			self.__refresh()
			
		if data=='sendcale':
			selscale=sysfrm.SelectScale()
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False	
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,99):
							if glu.testKey('Pers Text '+str(i)):
								tigerlib.setSellers_204(int(glu.getKey('Pers Num '+str(i))),glu.getKey('Pers Text '+str(i)),modesocket=tigerlib.MULTIOPERATION)
								#time.sleep(1)
						tigerlib.closesocket()			
			
		if data=='new'	:
			if len(self.num.get_text())!=0:
				ic=len(self.lst)
				ic +=1
				glu.setKey('Pers Num '+str(ic),self.num.get_text())
				glu.setKey('Pers Text '+str(ic),self.mes.get_text())
				self.__refresh()
		if data=='del':
			if len(self.num.get_text())!=0:
				glu.delKey('Pers Num '+self.num.get_text())
				glu.delKey('Pers Text '+self.num.get_text())
				self.num.set_text('')
				self.mes.set_text('')
				self.__refresh()			
			pass