def checkOvernightCycle(self, frameid, framescounter):
        try:
            dt = utime.gmtime()
            if globalVars.flag_rtc_syncro == False:
                tools.debug(
                    "Scheduler - RTC is not syncronized, so not possible to check the DutyCycle properly",
                    "v")
                return
            current_wiloc_dt = str(dt[3]) + ":" + str(dt[4]) + ":" + str(dt[5])
            slp_tm_day = tools.calculateSleepTime(current_wiloc_dt,
                                                  globalVars.dailyStandBy)
            tools.debug(
                "Scheduler - Overnight start: " + globalVars.startDownlink +
                "- Overnight end: " + globalVars.endDownlink, "v")

            if slp_tm_day < 0:
                if frameid == framescounter:
                    #------ Sleep cycle 3 (S3) ---------
                    slp_tm = tools.calculateSleepTime(current_wiloc_dt,
                                                      globalVars.dailyStart)
                    tools.debug(
                        "Overnight Scheduler - Going to sleep until day begins: "
                        + str(slp_tm), "v")
                    tools.deepSleepWiloc(slp_tm)
                else:
                    #------ Sleep cycle 2 (S2) ---------
                    rnd_secs = tools.random()
                    tools.debug(
                        "Overnight Scheduler - Going to sleep until next downlink: "
                        + str(rnd_secs), "v")
                    tools.deepSleepWiloc(rnd_secs)
            else:
                tools.debug(
                    "Overnight Scheduler - Message received during the day, not going to sleep, current date: "
                    + str(current_wiloc_dt) + " - Remaining day: " +
                    str(slp_tm_day), "v")

        except BaseException as e:
            checkError("Error on scheduler OvernightCycle", e)
示例#2
0
from skimage import data as da
from skimage.segmentation import mark_boundaries
import cv2

import cProfile as profile

runt = profile.run

from tools import mapp, show, getPoltName, performance, normalizing, random, loga
from tools import saveData, loadData

from warnings import filterwarnings

filterwarnings('ignore')

a = random(3, 5)
G = {}  # G is a global var to save value for DEBUG in funcation

#IMG_DIR =  '../DataSet1/Imgs/'
#COARSE_DIR ='../DataSet1/Saliency/'

#IMG_DIR =  r'G:\Data\HKU-IS/Imgs/'
#COARSE_DIR =r'G:\Data\HKU-IS/Saliency/'

#IMG_DIR = r'E:\3-experiment\SalBenchmark-master\Data\DataSet1\Imgs/'
#COARSE_DIR =r'E:\3-experiment\SalBenchmark-master\Data\DataSet1\Saliency/'

#IMG_DIR = r'E:\3-experiment\SalBenchmark-master\Data\DataSet2\Imgs/'
#COARSE_DIR =r'E:\3-experiment\SalBenchmark-master\Data\DataSet2\Saliency/'

IMG_DIR = r'E:\3-experiment\SalBenchmark-master\Data\HKU-IS\Imgs/'