def update_capacity_utilization(self): """Called by the scheduler to update the utilization regularly""" if not self.capacity_utilization_below(ProductivityLowStatus.threshold) is not self.__utilization_ok: self.__utilization_ok = not self.__utilization_ok if self.__utilization_ok: RemoveStatusIcon.broadcast(self, self.instance, ProductivityLowStatus) else: icon = ProductivityLowStatus(self.instance) AddStatusIcon.broadcast(self, icon)
def get_status_icons(self): l = super(Producer, self).get_status_icons() if self.capacity_utilisation_below(ProductivityLowStatus.threshold): l.append(ProductivityLowStatus()) return l