Example #1
0
	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()
Example #2
0
	def __on_click(self,widgth,data=None):
		if data=='new':
			if len(self.mes.get_text())!=0:
				glu.setKey('Tare Num '+self.num.get_text(),int(self.num.get_text()))
				glu.setKey('Tare '+self.num.get_text(),self.mes.get_text())
				self.__refresh()
				pass			
			pass
			
		pass
Example #3
0
    def __on_click(self, widget, data=None):
        if data == 'run':
            self.ok_flg = True
            self.response(gtk.RESPONSE_CLOSE)
            pass

        if data == 'sellall':
            for i in xrange(0, len(self.lst)):
                glu.setKey('Exchange scale ' + str(self.lst[i][0]), True)
            self.__refresh()
        if data == 'delsall':
            for i in xrange(0, len(self.lst)):
                glu.setKey('Exchange scale ' + str(self.lst[i][0]), False)
            self.__refresh()
Example #4
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
Example #5
0
	def __on_click(self,widget,data=None):
		if data=='new':
			if len(self.num.get_text())!=0:
				ic=len(self.lst)
				ic +=1
				if ic>20:
					return False
				glu.setKey('Group Num '+str(ic),self.num.get_text())
				glu.setKey('Group Text '+str(ic),self.mes.get_text())
				self.__refresh()			
			pass
		if data=='del':
			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,20):
							if glu.testKey('Group Text '+str(i)):
								tigerlib.setCommodityGroups_210(int(glu.getKey('Group Num '+str(i))),glu.getKey('Group Text '+str(i)),int(glu.getKey('Group Num '+str(i))),modesocket=tigerlib.MULTIOPERATION)
								#time.sleep(1)
						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_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,20):
							try :
								num,txt,root_group=tigerlib.getCommodityGroups_210(i,tigerlib.MULTIOPERATION)
								glu.setKey('Group Num '+str(i),num)
								glu.setKey('Group Text '+str(i),txt)
							except Exception,ecx :
								print 'поймали ',ecx
								continue
								#time.sleep(1)
						tigerlib.closesocket()
			self.__refresh()			
			pass
Example #6
0
    def __on_row_activated(self, widget, row, col):
        tree_model, tree_iter = widget.get_selection().get_selected()
        if tree_iter != None:
            id = tree_model.get_value(tree_iter, 0)

            if self.select_multi_mode == 1:
                if self.__test_one_rec(id):
                    return False
            if glu.testKey('Exchange scale ' + str(id)):
                flg = not glu.getKey('Exchange scale ' + str(id))
                glu.setKey('Exchange scale ' + str(id), flg)
            else:
                glu.setKey('Exchange scale ' + str(id), True)
            self.__refresh()
        #print row,id,col
        pass
Example #7
0
 def __set_default_select(self):
     for i in xrange(glu.getKey('Count Scale')):
         if glu.getKey('Scale use ' + str(i + 1)):
             if glu.testKey('Exchange scale ' + str(i + 1)) != True:
                 glu.setKey('Exchange scale ' + str(i + 1), False)
Example #8
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
Example #9
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
Example #10
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
Example #11
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