Commit 50efcde4 authored by Michael König's avatar Michael König

remove outdated flows

parent 79168def
......@@ -141,15 +141,26 @@ class LiveGui(GuiBase):
self.tearDown()
def updateFlowDataStructures(self):
# test all flows if outdated and replace list in-place
for flowIdentifier in self.flows:
self.flows[:] = [i for i in self.flows if not self.isFlowOutdated(i)]
for flowIdentifier in self.__connectionBuffer:
if(flowIdentifier not in self.flows):
self.initFlowDataStructures(flowIdentifier)
else:
outdated = self.__lastPlotTimestamp[flowIdentifier] < self.xmin
if(outdated):
self.destroyFlowDataStructures(flowIdentifier)
self.drawPlotLegend()
def isFlowOutdated(self, flowIdentifier):
outdated = self.__lastPlotTimestamp[flowIdentifier] < self.xmin
if(outdated):
for val in VALUES_TO_PLOT:
self.__plotLineConfigs[flowIdentifier][val] = False
self.__plotLines[flowIdentifier][val].set_visible(False)
self.__plotLines[flowIdentifier][val].set_data([], [])
self.__plotValues[flowIdentifier][val] = []
self.drawPlotLegend()
def initFlowDataStructures(self, flowIdentifier):
splittedFlowidentifier = flowIdentifier.split("-")
srcPort = splittedFlowidentifier[0]
......@@ -183,7 +194,8 @@ class LiveGui(GuiBase):
def destroyFlowDataStructures(self, flowIdentifier):
self.flows.remove(flowIdentifier)
pass
# del(self.flows[(self.flows.index(flowIdentifier))])
print("deleting " + str(flowIdentifier))
def plotGraph(self):
"""Initializes plot configuration and starts the plotting."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment