Changes between Version 11 and Version 12 of WARPnet1/BuildClientScripts
- Timestamp:
- Jun 19, 2010, 1:45:03 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WARPnet1/BuildClientScripts
v11 v12 84 84 dataLog = DataLogger('filename.txt', fileRefreshTime) 85 85 }}} 86 The `fileRefreshTime` is the the interval after which Python will automatically write the file to disk and re-open it. This is very useful when running long tests as the data is constantly being stored even in the event of an error or power outage. 86 87 87 When instantiating a struct pass the `dataLog` object to the it as follows:88 To log data to the file pass a formatted string to the `DataLogger` instance. For example: 88 89 {{{ 89 #!python 90 statStruct = StatisticsStruct(dataLog) 90 dataLog.log('Data=%d' % (valueToStore)) 91 91 }}} 92 92 93 In the StatisticsStruct any received data in `updateFromNode` can be written to the this log file using94 {{{95 #!python96 self.logData('Data0=%d, Data1=%d" %(dataTuple[0], dataTuple[1]))97 }}}98 93 99 94 == Running the Client Script ==