def getsensordbdatadays(selsensor, sensordata, days): fieldlist = [] fieldlist.append(TIMEFIELD) fieldlist.append(DATAFIELD) sampletime = hardwaremod.searchdata(hardwaremod.HW_INFO_NAME, selsensor, hardwaremod.HW_FUNC_TIME) samplingintervalminutes = int(sampletime.split(":")[1]) samplesnumber = (days * 24 * 60) / samplingintervalminutes databasemod.getdatafromfieldslimit(DBFILENAME, selsensor, fieldlist, sensordata, samplesnumber)
def getsensordbdatadays(selsensor, sensordata, days): fieldlist = [] fieldlist.append(TIMEFIELD) fieldlist.append(DATAFIELD) sampletime = hardwaremod.searchdata(hardwaremod.HW_INFO_NAME, selsensor, hardwaremod.HW_FUNC_TIME) schedtype = hardwaremod.searchdata( hardwaremod.HW_INFO_NAME, selsensor, hardwaremod.HW_FUNC_SCHEDTYPE ) # ["oneshot", "periodic"] #scheduling type if (sampletime != "") and (schedtype == "periodic"): samplingintervalminutes = int(sampletime.split(":")[1]) if samplingintervalminutes >= 1: samplesnumber = old_div((days * 24 * 60), samplingintervalminutes) databasemod.getdatafromfieldslimit(DBFILENAME, selsensor, fieldlist, sensordata, samplesnumber) else: databasemod.getdatafromfields(DBFILENAME, selsensor, fieldlist, sensordata) else: databasemod.getdatafromfields(DBFILENAME, selsensor, fieldlist, sensordata)
def getsensordbdatasamplesN(selsensor, sensordata, samplesnumber): fieldlist = [] fieldlist.append(TIMEFIELD) fieldlist.append(DATAFIELD) databasemod.getdatafromfieldslimit(DBFILENAME, selsensor, fieldlist, sensordata, samplesnumber)