Exemple #1
0
    def check(self):
        alerts = super().check()

        msg = "{}".format(self._window_size)
        alerts.append(cb.Info("window_size_pow_of_2", msg))

        return alerts
    def check(self):
        alerts = []

        if self.repetition_mode == __class__.RepetitionMode.SENSOR_DRIVEN:
            if self.update_rate is None:
                alerts.append(cb.Error("update_rate", "Must be set when sensor driven"))

        if self.gain > 0.9:
            alerts.append(cb.Warning("gain", "Too high gain causes degradation"))

        if self.range_start < self.profile.approx_direct_leakage_length:
            alerts.append(cb.Info("range_interval", "Direct leakage might be seen"))

        return alerts
    def check(self):
        alerts = []

        if self.repetition_mode == __class__.RepetitionMode.SENSOR_DRIVEN:
            msg = "Must be set when sensor driven"

            if self.update_rate is None:
                alerts.append(cb.Error("update_rate", msg))

            if not self.asynchronous_measurement:
                alerts.append(cb.Error("asynchronous_measurement", msg))

        if self.gain > 0.9:
            alerts.append(
                cb.Warning("gain", "Too high gain causes degradation"))

        if self.range_start < self.profile.approx_direct_leakage_length:
            alerts.append(
                cb.Info("range_interval", "Direct leakage might be seen"))

        if self.power_save_mode == __class__.PowerSaveMode.HIBERNATE:
            alerts.append(
                cb.Warning("power_save_mode", "Limited hardware support"))

            if self.repetition_mode == __class__.RepetitionMode.SENSOR_DRIVEN:
                alerts.append(
                    cb.Error("power_save_mode",
                             "Unavailable when sensor driven"))

        psms = [__class__.PowerSaveMode.HIBERNATE, __class__.PowerSaveMode.OFF]
        if self.power_save_mode in psms:
            if self.asynchronous_measurement:
                msg = "PSM hibernate/off is always synchronous"
                alerts.append(cb.Info("asynchronous_measurement", msg))

        return alerts