diff --git a/client_sw/matrixsimulator.py b/client_sw/matrixsimulator.py index cb11b15..45fefbd 100644 --- a/client_sw/matrixsimulator.py +++ b/client_sw/matrixsimulator.py @@ -31,6 +31,7 @@ class FlipdotSim(): self.udpHostSocket.bind(("", self.udpPort)) self.timesincelastpacket=time.time() + self.timelastcalculation=0 def run(self): self.RunServer() @@ -49,7 +50,7 @@ class FlipdotSim(): imageArray = ImageArrayAdapter().convertPacketToImageArray(rawData) if DEBUG: - print("Received Data. Time since last message: "+str( round( time.time()-self.timesincelastpacket,2))+"s ("+str( round( (1/ (time.time()-self.timesincelastpacket) ) ,2) ) +" FPS)") + print("Received Data. Time since last message: "+str( round( time.time()-self.timesincelastpacket,2))+"s ("+str( round( (1/ (time.time()-self.timesincelastpacket) ) ,2) ) +" FPS), last calctime="+str(round( (self.timelastcalculation) ,2))) self.timesincelastpacket=time.time() _bitsneeded=self.imageSize[0]*self.imageSize[1]*self.bitsperpixel if len(imageArray) < _bitsneeded: @@ -67,6 +68,8 @@ class FlipdotSim(): self.flipdotMatrixSimulatorWidget.show(imageArray) #send to simulator display + self.timelastcalculation=time.time()-self.timesincelastpacket #calculate time it took for calculation and drawing + finally: self.udpHostSocket.close()