Ignore:
Timestamp:
Jan 16, 2014 6:35:51 PM (9 years ago)
Author:
jemian
Message:

handle color of alarm severity for INVALID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bcdaqwidgets/trunk/src/bcdaqwidgets/bcdaqwidgets.py

    r1425 r1451  
    7070}
    7171
    72 SeverityColor = typesafe_enum('NO_ALARM', 'MINOR', 'MAJOR',)
     72SeverityColor = typesafe_enum('NO_ALARM', 'MINOR', 'MAJOR', 'CALC_INVALID')
    7373SeverityColor.NO_ALARM =     "green"        # green
    7474SeverityColor.MINOR =        "#ff0000"      # dark orange since yellow looks bad against gray
    7575SeverityColor.MAJOR =        "red"          # red
     76SeverityColor.CALC_INVALID = "pink"         # pink
    7677
    7778
     
    153154
    154155        self.useAlarmState = useAlarmState
    155         self.severity_color_list = [SeverityColor.NO_ALARM, SeverityColor.MINOR, SeverityColor.MAJOR]
     156        self.severity_color_list = [SeverityColor.NO_ALARM, SeverityColor.MINOR, SeverityColor.MAJOR, SeverityColor.CALC_INVALID]
    156157
    157158        # for internal use persisting the various styleSheet settings
     
    226227            self.pv.get_ctrlvars()
    227228            if self.pv.severity is not None:
     229                if self.pv.severity < 0 or self.pv.severity >= len(self.severity_color_list):
     230                    print self.pv.severity
     231                    print self.severity_color_list
     232                    pass
    228233                color = self.severity_color_list[self.pv.severity]
    229234                self.updateStyleSheet({'color': color})
Note: See TracChangeset for help on using the changeset viewer.