Exemple #1
0
def _regenImage(logview_instance, gas, types, imgfile):

    print "GAS: %s" % gas
    #
    # Only re-decode if one of the .hex files are newer than the image file
    #
    try:
        s = os.stat(imgfile)
        imgtime = s.st_mtime
        doit = False
        for f in filenames:
            s = os.stat(f)
            if imgtime < s.st_mtime:
                doit = True
    except OSError:
        # File probably does not exist...
        doit = True

    if doit:
        if logview_instance == None:
            logview_instance = KnxLogViewer(devices, groups, filenames, False,
                                            types, True, 0)
        logview_instance.plotLog(gas, imgfile)

    return logview_instance
Exemple #2
0
def _regenImage(logview_instance, gas, types, imgfile):

    print "GAS: %s" %gas
    #
    # Only re-decode if one of the .hex files are newer than the image file
    #
    try:
        s = os.stat(imgfile)
        imgtime = s.st_mtime
        doit = False
        for f in filenames:
            s = os.stat(f)
            if imgtime < s.st_mtime:
                doit = True
    except OSError:
        # File probably does not exist...
        doit = True

    if doit:
        if logview_instance == None:
            logview_instance = KnxLogViewer(devices, groups, filenames,
                                            False, types, True, 0)
        logview_instance.plotLog(gas, imgfile)

    return logview_instance
Exemple #3
0
def _regenImage(filenames,
                logview_instance,
                gas,
                types,
                imgfile,
                addHorLine=None,
                numDays=None):

    global add_message
    #
    # Only re-decode if one of the .hex files are newer than the image file
    #
    try:
        s = os.stat(imgfile)
        imgtime = s.st_mtime
        doit = False
        for f in filenames:
            s = os.stat(f)
            if imgtime < s.st_mtime:
                doit = True
#add_message += "REGENERATED IMAGE"
            else:
                #add_message += "USING LAST IMAGE"
                pass
    except OSError:
        # File probably does not exist...
        doit = True
#add_message += "GENERATED IMAGE"

    if doit:
        if logview_instance == None:
            if numDays != None:
                start_time = time.time() - (numDays * 24 * 3600)
            else:
                start_time = None

            logview_instance = KnxLogViewer(devices,
                                            groups,
                                            filenames,
                                            False,
                                            types,
                                            True,
                                            0,
                                            allGAs,
                                            start_time=start_time)

        minVal, maxVal = logview_instance.getMinMaxValues(gas[0])

        if addHorLine != None:
            addHorLine = []  # [addHorLine]
            if minVal != None:
                addHorLine.append(minVal)
            if maxVal != None:
                addHorLine.append(maxVal)

        logview_instance.plotLog(gas, imgfile, addHorLine)

        #add_message += "<p>" + logview_instance.getPerfData() + "<p>%s, %s, %s<p>"%(str(gas), minVal,maxVal)

    return logview_instance
Exemple #4
0
def _regenImage(filenames, logview_instance, gas, types, imgfile, addHorLine=None, numDays=None):

    global add_message
    #
    # Only re-decode if one of the .hex files are newer than the image file
    #
    try:
        s = os.stat(imgfile)
        imgtime = s.st_mtime
        doit = False
        for f in filenames:
            s = os.stat(f)
            if imgtime < s.st_mtime:
                doit = True
		#add_message += "REGENERATED IMAGE"
	    else:
		#add_message += "USING LAST IMAGE"
		pass
    except OSError:
        # File probably does not exist...
        doit = True
 	#add_message += "GENERATED IMAGE"

    if doit:
        if logview_instance == None:
            if numDays != None:
                start_time = time.time() - (numDays*24*3600)
            else:
                start_time = None

            logview_instance = KnxLogViewer(devices, groups, filenames,
                                            False, types, True, 0, allGAs, start_time=start_time)

        minVal,maxVal = logview_instance.getMinMaxValues(gas[0])

        if addHorLine != None:
            addHorLine = [] # [addHorLine]
            if minVal != None:
                addHorLine.append(minVal)
            if maxVal != None:
                addHorLine.append(maxVal)

        logview_instance.plotLog(gas, imgfile, addHorLine)

        #add_message += "<p>" + logview_instance.getPerfData() + "<p>%s, %s, %s<p>"%(str(gas), minVal,maxVal)

    return logview_instance