summaryrefslogtreecommitdiffstats
path: root/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py
diff options
context:
space:
mode:
authorpikusa <pikusa@man.poznan.pl>2013-04-03 13:18:17 (GMT)
committer pikusa <pikusa@man.poznan.pl>2013-04-03 13:18:17 (GMT)
commit2f2a3a129c91de540e66c3bfbe30b0df1942cd4b (patch)
tree2d313cdf0068af368d4de6067d676be16f6a6464 /Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py
parentff8aa232b071a9b54dff833714a870fd0aec0b30 (diff)
downloadnovi-public-2f2a3a129c91de540e66c3bfbe30b0df1942cd4b.zip
novi-public-2f2a3a129c91de540e66c3bfbe30b0df1942cd4b.tar.gz
novi-public-2f2a3a129c91de540e66c3bfbe30b0df1942cd4b.tar.bz2
project commit and dir tree change
Diffstat (limited to 'Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py')
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py
new file mode 100644
index 0000000..766761a
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/Monitoring/DataTypes/PtActivity.py
@@ -0,0 +1,53 @@
+"""
+Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+Copyright according to BSD License
+For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+
+@author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+@author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+@author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+@author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+@author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+@author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+@author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+@author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+"""
+
+from time import mktime, time, strftime, localtime
+
+from Task.Passive.Monitoring.DataTypes import Node
+
+class PtActivity(object):
+ def __init__(self, startTime = time(), stopTime = time(),
+ node = Node.Node(), activity = 0):
+ self.startTime = mktime(startTime)
+ self.stopTime = mktime(stopTime)
+ self.node = node
+ self.activity = activity
+
+ def __str__(self):
+ startTime = strftime("%a, %d %b %Y %H:%M:%S", localtime(self.startTime))
+ stopTime = strftime("%a, %d %b %Y %H:%M:%S", localtime(self.stopTime))
+ return ("PtActivity:\n"
+ " Node (Oid): " + str(self.node) + "\n"
+ " StartTime: " + startTime + "\n"
+ " StopTime: " + stopTime + "\n"
+ " Activity: " + str(self.activity) + " %")
+
+ def set_StartTime(self, StartTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the start of the observation
+ """
+ self.StartTime = mktime(StartTime)
+
+ def set_StopTime(self, StopTime):
+ """
+ Overwritten setter functions to convert the time_struct into a real
+ timestamp.
+ @type StartTime: struct_time
+ @param StartTime Time that defines the end of the observation
+ """
+ self.StopTime = mktime(StopTime) \ No newline at end of file