예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
def getsensordbdatasamplesN(selsensor, sensordata, samplesnumber):
    fieldlist = []
    fieldlist.append(TIMEFIELD)
    fieldlist.append(DATAFIELD)
    databasemod.getdatafromfieldslimit(DBFILENAME, selsensor, fieldlist,
                                       sensordata, samplesnumber)