From fee8f342eb20221091d9a3248b61d96e4000b511 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sat, 13 Jan 2018 13:11:20 +0100 Subject: [PATCH] add calculation time debug message for simulator --- client_sw/matrixsimulator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()