def _exec(self): if not hasattr(self, "values_min") or not hasattr(self, "values_max"): Setting.error("No \"values_min / values_max\" in CptObjective \"{}\"".format(self.inner_name)) return if not hasattr(self, "nickname"): Setting.critical("No \"nickname\" in CptObjective \"{}\"".format(self.inner_name)) return
def _verif(self): cpt = None for c in Setting.cptdata: print c, c.get_data("nickname"), self.nickname if c.get_data("nickname") == self.nickname: cpt = c break if cpt is None: Setting.critical("Could not initialize CaptorData in \"CptObjective {}\"".format(self.inner_name)) normal_stop() for i in range(getattr(self, "since", 0), getattr(self, "to", 0)+1): for k in self.values_min: if c.get_data(k, i) < self.values_min[k]: return False for k in self.values_max: if c.get_data(k, i) > self.values_max[k]: return False return True