
class MyOVBox(OVBox):
	def __init__(self):
		OVBox.__init__(self)
		self.a = 0
		self.b = 0
		self.c = 0
		self.d = 0
		self.e = 0
		self.chosenB = 0
		self.chosenC = 0
		self.chosenD = 0
		self.chosenE = 0
		self.counter = 0
		
	def initialize(self):
		# nop
		return
		
	def process(self):
		if self.counter > 100:
			print " "
			#print self.a
			#print "Prvi gumb tocke: " + str(self.b)
			#print "Drugi gumb tocke: " + str(self.c)
			#print "Tretji gumb tocke: " + str(self.d)
			#print "Cetrti gumb tocke: " + str(self.e)
			max = 0
			if self.b >= max:
				max = self.b
			if self.c >= max:
				max = self.c
			if self.d >= max:
				max = self.d
			if self.e >= max:
				max = self.e
			if self.a == max:
				print "napaka"
			elif self.b == max:
				self.chosenB += 1
				print "prvi filter: prvi gumb"
			elif self.c == max:
				self.chosenC += 1
				print "prvi filter: drugi gumb"
			elif self.d == max:
				self.chosenD += 1
				print "prvi filter: tretji gumb"
			elif self.e == max:
				self.chosenE += 1
				print "prvi filter: cetrti gumb"
			self.a = 0
			self.b = 0
			self.c = 0
			self.d = 0
			self.e = 0
			self.counter = 0
			print "prvi filter: prvi gumb izbran: " + str(self.chosenB)
			print "prvi filter: druig gumb izbran: " + str(self.chosenC)
			print "prvi filter: tretji gumb izbran: " + str(self.chosenD)
			print "prvi filter: cetrti gumb izbran: " + str(self.chosenE)

		for chunkIndex in range( len(self.input[0]) ):
			chunk = self.input[0].pop()
			if(type(chunk) == OVStreamedMatrixBuffer):
				#print chunk[0]
				self.a += chunk[0]
			chunk2 = self.input[1].pop()
			if(type(chunk2) == OVStreamedMatrixBuffer):
				#print chunk2[0]
				self.b += chunk2[0]
			chunk3 = self.input[2].pop()
			if(type(chunk3) == OVStreamedMatrixBuffer):
				#print chunk3[0]
				self.c += chunk3[0]
			chunk4 = self.input[3].pop()
			if(type(chunk4) == OVStreamedMatrixBuffer):
				#print chunk4[0]
				self.d += chunk4[0]
			chunk5 = self.input[4].pop()
			if(type(chunk5) == OVStreamedMatrixBuffer):
				#print chunk5[0]
				self.e += chunk5[0]
		self.counter += 1
		return
		
	def uninitialize(self):
		# nop
		return

box = MyOVBox()
