Changes between Version 11 and Version 12 of WARPnet1/BuildClientScripts


Ignore:
Timestamp:
Jun 19, 2010, 1:45:03 PM (14 years ago)
Author:
sgupta
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WARPnet1/BuildClientScripts

    v11 v12  
    8484 dataLog = DataLogger('filename.txt', fileRefreshTime)
    8585}}}
     86The `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.
    8687
    87 When instantiating a struct pass the `dataLog` object to the it as follows:
     88To log data to the file pass a formatted string to the `DataLogger` instance. For example:
    8889{{{
    89 #!python
    90  statStruct = StatisticsStruct(dataLog)
     90 dataLog.log('Data=%d' % (valueToStore))
    9191}}}
    9292
    93 In the StatisticsStruct any received data in `updateFromNode` can be written to the this log file using
    94 {{{
    95 #!python
    96  self.logData('Data0=%d, Data1=%d" %(dataTuple[0], dataTuple[1]))
    97 }}}
    9893
    9994== Running the Client Script ==