DataCollector collects data with timestamps, as it is added to the collection. It provides backup mechanism to recover from stored data. The data can be used for realtime or offline analysis in the same or in a later session. inspired by MemoryRecorder developed by Alberto de Campo and Marije Baalman for the Institute of Predictive Sonobotanics
Creates a new data collector.
name |
A name for the collector. |
collection |
Optional argument to provide another DataCollector which is then added to this new one. |
a DataCollector
Load a stored DataCollector from file
path |
The full path of the file to load from. |
a DataCollector
Creates the backup folder for storing DataCollectors to.
Indicates whether or not the backup folder has been created.
The path to the backupfolder.
a String
Convenience method to create a SortedList sorted by date
a SortedList
Add data to the collection.
data |
The data to be added. |
date |
The time stamp of the data. If non is given, one is created. |
overwrite |
Whether or not to overwrite a previous entry with the same datestamp. Default is true. |
the date time stamp (so it can be used for adding metadata)
Add metadata to the collection. This can be for example higher level data or a comment.
mdata |
The metadata to add. |
date |
The time stamp. |
Access an trace in the collection.
index |
The index of the trace to access. |
an Event of the trace requested.
Get the last N entries from the collection
howmany |
The number of entries to get. |
a SortedList of entries.
Adds a trace of data to the collection. Called by addData or addMetaData.
trace |
The trace to add. |
overwrite |
Whether or not to overwrite an existing trace. |
the date stamp of the trace.
Create a backup in a file with an autogenerated filename, consisting of the backup folder, the name of the DataCollector and a timestamp.
a String with the filename.
Recover the last saved backup with the same name.
Print all data in the collector.
Finds the most recently saved backup.
a String with the filename.
Save the DataCollector to file.
path |
The full path to save to. |
a File to which was saved.
The SortedList of the data collected.
a SortedList
The name of the DataCollector
a String