def asCSVDataEntry(self): 'Converts the data to CSV format ready to be saved in CSV file. ' lines = [] fTimes = asFormattedListOfTime(self.timeStamps, Config.DEFAULT_TIME_FORMAT) for i in range(0, self.nMPS, 1): lines.append( "%s, %d, %s, %s\n" % (fTimes[i], self.sensorData[i], self.batteryVoltage[i], self.mcuTemperature[i]) ) return lines
def __str__(self): "Converts the instance to string - to be used for debugging only." s = "" s += "Node: %s (%s)\n" % (self.nodeDescription, self.shortID) s += "address64: %s\n" % self.address64 s += "address16: %s\n" % self.address16 s += "lastTimeReceived: %s\n" % time.ctime(self.lastTimeReceived) s += "Last atDB response: %d\n" % self.lastATDBResponse s += "nMPS: %d\n" % self.nMPS s += "timeBetweenMeasurements: %d\n" % self.timeBetweenMeasurements s += "timeBetweenEmissions: %d, \n" % self.timeBetweenEmissions s += "sensorData: %s\n" % self.sensorData s += "timeStamps: %s\n" % asFormattedListOfTime(self.timeStamps, Config.DEFAULT_TIME_FORMAT) s += "batteryVoltage: %s\n" % self.batteryVoltage s += "mcuTemperature: %s" % self.mcuTemperature return s