Beispiel #1
0
    def __init__(self, master):
        TUI.Inst.ExposeWdg.ExposeWdg.__init__(self, master, instName=InstName)

        gr = self.expInputWdg.gridder

        self.gainWdg = RO.Wdg.OptionMenu(
            master=self.expInputWdg,
            items=("Low", "Med", "High"),
            defValue="Med",
            defMenu="Default",
            helpText="CCD amplifier gain",
            helpURL=self.HelpPrefix + "Gain",
        )
        gr.gridWdg("Gain", self.gainWdg, colSpan=2)

        self.readRateWdg = RO.Wdg.OptionMenu(
            master=self.expInputWdg,
            items=("Slow", "Fast"),
            defValue="Fast",
            defMenu="Default",
            helpText="CCD readout rate",
            helpURL=self.HelpPrefix + "ReadRate",
        )
        gr.gridWdg("Read Rate", self.readRateWdg, colSpan=2)

        self.filterWdg = AgileFilterWdg.AgileFilterWdg(
            master=self.expInputWdg,
            statusBar=self.statusBar,
            gridder=gr,
            helpPrefix=self.HelpPrefix,
        )
        #        gr.gridWdg(False, self.filterWdg, colSpan=5)

        self.statusConfigWdg = StatusConfigInputWdg.StatusConfigInputWdg(
            master=self.expInputWdg, )
        gr.gridWdg(False, self.statusConfigWdg, colSpan=10, sticky="w")
        self.configWdg.pack_forget()
        self._stateTracker.trackCheckbutton(
            "showEnviron", self.statusConfigWdg.environShowHideWdg)

        self.connSensitiveWdgSet = (self.startWdg, self.stopWdg, self.abortWdg)
        self.agileModel = AgileModel.getModel()
Beispiel #2
0
    def __init__(self, master):
        TUI.Inst.ExposeWdg.ExposeWdg.__init__(self, master, instName=InstName)
        
        gr = self.expInputWdg.gridder
        
        self.gainWdg = RO.Wdg.OptionMenu(
            master = self.expInputWdg,
            items = ("Low", "Med", "High"),
            defValue = "Med",
            defMenu = "Default",
            helpText = "CCD amplifier gain",
            helpURL = self.HelpPrefix + "Gain",
        )
        gr.gridWdg("Gain", self.gainWdg, colSpan=2)
        
        self.readRateWdg = RO.Wdg.OptionMenu(
            master = self.expInputWdg,
            items = ("Slow", "Fast"),
            defValue = "Fast",
            defMenu = "Default",
            helpText = "CCD readout rate",
            helpURL = self.HelpPrefix + "ReadRate",
        )
        gr.gridWdg("Read Rate", self.readRateWdg, colSpan=2)
        
        self.filterWdg = AgileFilterWdg.AgileFilterWdg(
            master = self.expInputWdg,
            statusBar = self.statusBar,
            gridder = gr,
            helpPrefix = self.HelpPrefix,
        )
#        gr.gridWdg(False, self.filterWdg, colSpan=5)
        
        self.statusConfigWdg = StatusConfigInputWdg.StatusConfigInputWdg(
            master = self.expInputWdg,
        )
        gr.gridWdg(False, self.statusConfigWdg, colSpan=10, sticky="w")
        self.configWdg.pack_forget()
        self._stateTracker.trackCheckbutton("showEnviron", self.statusConfigWdg.environShowHideWdg)
        
        self.connSensitiveWdgSet = (self.startWdg, self.stopWdg, self.abortWdg)
        self.agileModel = AgileModel.getModel()
Beispiel #3
0
    def __init__(self,
        master,
        statusBar,
        gridder,
        helpPrefix = None,
    ):
        self.statusBar = statusBar

        self.agileModel = AgileModel.getModel()
        self.currCmd = None
        gr = gridder
        
        wheelFrame = Tkinter.Frame(master)
        
        self.userFilterWdg = RO.Wdg.OptionMenu(
            master = wheelFrame,
            items = (),
            noneDisplay = "?",
            autoIsCurrent = True,
            width = 8,
            callFunc = self.enableButtons,
            defMenu = "Current",
            helpText =  "Agile filter",
            helpURL = helpPrefix + "FilterWheel",
        )
        self.userFilterWdg.pack(side="left")
        
        self.applyBtn = RO.Wdg.Button(
            master = wheelFrame,
            text = "Set Filter",
            callFunc = self.doApply,
            helpText = "Set Agile filter",
            helpURL = helpPrefix + "FilterWheel",
        )
        self.applyBtn.pack(side="left")

        self.cancelBtn = RO.Wdg.Button(
            master = wheelFrame,
            text = "X",
            callFunc = self.doCancel,
            helpText = "Cancel filter command",
            helpURL = helpPrefix + "FilterWheel",
        )
        self.cancelBtn.pack(side="left")

        self.currentBtn = RO.Wdg.Button(
            master = wheelFrame,
            text = "Current Filter",
            callFunc = self.doCurrent,
            helpText = "Show current Agile filter",
            helpURL = helpPrefix + "FilterWheel",
        )
        self.currentBtn.setEnable(False)
        self.currentBtn.pack(side="left")

        gr.gridWdg("Filter Wheel", wheelFrame)
        
        
        slideFrame = Tkinter.Frame(master)

        self.slideInfoWdg = RO.Wdg.StrLabel(
            master = slideFrame,
            helpText = "Filter slide information",
            helpURL = helpPrefix + "FilterSlide",
        )
        self.slideInfoWdg.pack(side="left")
        gr.gridWdg("Filter Slide", slideFrame)
        
        self.agileModel.currFilter.addCallback(self.updCurrFilter)
        self.agileModel.fwNames.addCallback(self.updFwNames)
Beispiel #4
0
    def __init__(self, master, **kargs):
        """Create a new widget to show status for and configure Agile
        """
        RO.Wdg.InputContFrame.__init__(self, master, **kargs)
        self.model = AgileModel.getModel()

        self.environStateSet = TUI.Base.StateSet.StateSet(StNames, callFunc=self._updEnvironStateSet)

        self.settingCurrWin = False

        gr = RO.Wdg.StatusConfigGridder(master=self, sticky="w", numStatusCols=3)
        self.gridder = gr

        # Temperature State information

        self.ccdTempStateDict = {
            None: (None, RO.Constants.sevNormal),
            "normal": ("", RO.Constants.sevNormal),
            "low": ("Low", RO.Constants.sevWarning),
            "high": ("High", RO.Constants.sevWarning),
            "verylow": ("Very Low", RO.Constants.sevError),
            "veryhigh": ("Very High", RO.Constants.sevError),
        }

        # Environment

        self.environShowHideWdg = RO.Wdg.Checkbutton(
            master=self, text="Environ", helpText="Show environment details?", helpURL=self.HelpPrefix + "Environ"
        )

        self.environSummaryWdg = RO.Wdg.StrLabel(
            master=self, helpText="Environment summary", helpURL=self.HelpPrefix + "Environ"
        )

        gr.gridWdg(label=self.environShowHideWdg, dataWdg=self.environSummaryWdg, colSpan=3, numStatusCols=None)

        # Camera connected
        self.cameraConnStateWdg = RO.Wdg.StrLabel(
            master=self, anchor="w", helpText="Camera connection state", helpURL=self.HelpPrefix + "env_Camera"
        )
        gr.gridWdg("Camera", self.cameraConnStateWdg, cat=self.EnvironCat)

        self.ccdTempWdg = RO.Wdg.StrLabel(
            master=self, helpText="Current CCD Temp (C)", helpURL=self.HelpPrefix + "env_CCDTemp"
        )

        gr.gridWdg(label=StCCDTemp, dataWdg=self.ccdTempWdg, cat=self.EnvironCat)

        # CCD Set Temperature

        self.ccdSetTempWdg = RO.Wdg.StrLabel(
            master=self, helpText="Desired CCD Temp (C)", helpURL=self.HelpPrefix + "env_CCDSetTemp"
        )

        gr.gridWdg(label=StCCDSetTemp, dataWdg=self.ccdSetTempWdg, cat=self.EnvironCat)

        # CCD Temperature Limits

        self.ccdTempLimitsFrame = Tkinter.Frame(self)
        self.ccdTempLimitsWdgSet = []
        for col, limitName in enumerate(("Low", "High", "Very Low", "Very High")):
            ccdTempLimitWdg = RO.Wdg.FloatLabel(
                self.ccdTempLimitsFrame,
                precision=1,
                width=_EnvWidth,
                helpText="Error limit for %s CCD temp." % (limitName.lower(),),
                helpURL=self.HelpPrefix + "env_CCDTempLimits",
            )
            ccdTempLimitWdg.grid(row=0, column=col)
            self.ccdTempLimitsWdgSet.append(ccdTempLimitWdg)

        gr.gridWdg(
            label="CCD Temp Limits",
            dataWdg=self.ccdTempLimitsFrame,
            colSpan=10,
            numStatusCols=None,
            cat=self.EnvironCat,
        )

        self.gpsSyncedWdg = RO.Wdg.StrLabel(
            master=self,
            anchor="w",
            helpText="Is clock card synched to the GPS clock?",
            helpURL=self.HelpPrefix + "env_GPSSynced",
        )

        gr.gridWdg(label=StGPSSynced, dataWdg=self.gpsSyncedWdg, cat=self.EnvironCat)

        self.ntpStatusFrame = Tkinter.Frame(self)
        self.ntpStatusWdgSet = []
        for col, helpStr in enumerate(("Is NTP client running?", "NTP server", "Stratum of NTP server")):
            ntpStatusWdg = RO.Wdg.StrLabel(
                self.ntpStatusFrame, helpText=helpStr, helpURL=self.HelpPrefix + "env_NTPStatus"
            )
            ntpStatusWdg.grid(row=0, column=col)
            self.ntpStatusWdgSet.append(ntpStatusWdg)

        gr.gridWdg(label=StNTPStatus, dataWdg=self.ntpStatusFrame, colSpan=10, numStatusCols=None, cat=self.EnvironCat)

        # filter related status

        self.fwConnStateWdg = RO.Wdg.StrLabel(
            master=self,
            anchor="w",
            helpText="Filter wheel connection state",
            helpURL=self.HelpPrefix + "env_FilterWheel",
        )
        gr.gridWdg(StFWConn, self.fwConnStateWdg, cat=self.EnvironCat)

        self.fwHomedWdg = RO.Wdg.StrLabel(
            master=self,
            anchor="w",
            helpText="Filter wheel motor state",
            helpURL=self.HelpPrefix + "env_FilterWheelMotor",
        )

        gr.gridWdg(label=StFWMotor, dataWdg=self.fwHomedWdg, cat=self.EnvironCat)

        gr.allGridded()

        self.gpsSyncedDict = {
            True: (RO.Constants.sevNormal, "Yes"),
            False: (RO.Constants.sevError, "No"),
            None: (RO.Constants.sevWarning, "?"),
        }

        self.ntpRunningDict = {True: "Running", False: "NotRunning", None: "?"}

        # add callbacks that deal with multiple widgets
        self.environShowHideWdg.addCallback(self._doShowHide, callNow=False)
        self.model.cameraConnState.addCallback(self._updCameraConnState, callNow=True)
        self.model.fwConnState.addCallback(self._updFWConnState, callNow=True)
        self.model.ccdTemp.addCallback(self._updCCDTemp, callNow=True)
        self.model.ccdSetTemp.addCallback(self._updCCDSetTemp, callNow=True)
        self.model.ccdTempLimits.addCallback(self._updCCDTempLimits, callNow=True)
        self.model.gpsSynced.addCallback(self._updGPSSynced, callNow=True)
        self.model.ntpStatus.addCallback(self._updNTPStatus, callNow=True)
        self.model.fwStatus.addCallback(self._updFWStatus, callNow=True)
        self._doShowHide()
    def __init__(self, master, **kargs):
        """Create a new widget to show status for and configure Agile
        """
        RO.Wdg.InputContFrame.__init__(self, master, **kargs)
        self.model = AgileModel.getModel()

        self.environStateSet = TUI.Base.StateSet.StateSet(
            StNames, callFunc=self._updEnvironStateSet)

        self.settingCurrWin = False

        gr = RO.Wdg.StatusConfigGridder(
            master=self,
            sticky="w",
            numStatusCols=3,
        )
        self.gridder = gr

        # Temperature State information

        self.ccdTempStateDict = {
            None: (None, RO.Constants.sevNormal),
            "normal": ("", RO.Constants.sevNormal),
            "low": ("Low", RO.Constants.sevWarning),
            "high": ("High", RO.Constants.sevWarning),
            "verylow": ("Very Low", RO.Constants.sevError),
            "veryhigh": ("Very High", RO.Constants.sevError),
        }

        # Environment

        self.environShowHideWdg = RO.Wdg.Checkbutton(
            master=self,
            text="Environ",
            helpText="Show environment details?",
            helpURL=self.HelpPrefix + "Environ",
        )

        self.environSummaryWdg = RO.Wdg.StrLabel(
            master=self,
            helpText="Environment summary",
            helpURL=self.HelpPrefix + "Environ",
        )

        gr.gridWdg(
            label=self.environShowHideWdg,
            dataWdg=self.environSummaryWdg,
            colSpan=3,
            numStatusCols=None,
        )

        # Camera connected
        self.cameraConnStateWdg = RO.Wdg.StrLabel(
            master=self,
            anchor="w",
            helpText="Camera connection state",
            helpURL=self.HelpPrefix + "env_Camera",
        )
        gr.gridWdg("Camera", self.cameraConnStateWdg, cat=self.EnvironCat)

        self.ccdTempWdg = RO.Wdg.StrLabel(
            master=self,
            helpText="Current CCD Temp (C)",
            helpURL=self.HelpPrefix + "env_CCDTemp",
        )

        gr.gridWdg(
            label=StCCDTemp,
            dataWdg=self.ccdTempWdg,
            cat=self.EnvironCat,
        )

        # CCD Set Temperature

        self.ccdSetTempWdg = RO.Wdg.StrLabel(
            master=self,
            helpText="Desired CCD Temp (C)",
            helpURL=self.HelpPrefix + "env_CCDSetTemp",
        )

        gr.gridWdg(
            label=StCCDSetTemp,
            dataWdg=self.ccdSetTempWdg,
            cat=self.EnvironCat,
        )

        # CCD Temperature Limits

        self.ccdTempLimitsFrame = Tkinter.Frame(self)
        self.ccdTempLimitsWdgSet = []
        for col, limitName in enumerate(
            ("Low", "High", "Very Low", "Very High")):
            ccdTempLimitWdg = RO.Wdg.FloatLabel(
                self.ccdTempLimitsFrame,
                precision=1,
                width=_EnvWidth,
                helpText="Error limit for %s CCD temp." %
                (limitName.lower(), ),
                helpURL=self.HelpPrefix + "env_CCDTempLimits",
            )
            ccdTempLimitWdg.grid(row=0, column=col)
            self.ccdTempLimitsWdgSet.append(ccdTempLimitWdg)

        gr.gridWdg(
            label="CCD Temp Limits",
            dataWdg=self.ccdTempLimitsFrame,
            colSpan=10,
            numStatusCols=None,
            cat=self.EnvironCat,
        )

        self.gpsSyncedWdg = RO.Wdg.StrLabel(
            master=self,
            anchor="w",
            helpText="Is clock card synched to the GPS clock?",
            helpURL=self.HelpPrefix + "env_GPSSynced",
        )

        gr.gridWdg(
            label=StGPSSynced,
            dataWdg=self.gpsSyncedWdg,
            cat=self.EnvironCat,
        )

        self.ntpStatusFrame = Tkinter.Frame(self)
        self.ntpStatusWdgSet = []
        for col, helpStr in enumerate(
            ("Is NTP client running?", "NTP server", "Stratum of NTP server")):
            ntpStatusWdg = RO.Wdg.StrLabel(
                self.ntpStatusFrame,
                helpText=helpStr,
                helpURL=self.HelpPrefix + "env_NTPStatus",
            )
            ntpStatusWdg.grid(row=0, column=col)
            self.ntpStatusWdgSet.append(ntpStatusWdg)

        gr.gridWdg(
            label=StNTPStatus,
            dataWdg=self.ntpStatusFrame,
            colSpan=10,
            numStatusCols=None,
            cat=self.EnvironCat,
        )

        # filter related status

        self.fwConnStateWdg = RO.Wdg.StrLabel(
            master=self,
            anchor="w",
            helpText="Filter wheel connection state",
            helpURL=self.HelpPrefix + "env_FilterWheel",
        )
        gr.gridWdg(StFWConn, self.fwConnStateWdg, cat=self.EnvironCat)

        self.fwHomedWdg = RO.Wdg.StrLabel(
            master=self,
            anchor="w",
            helpText="Filter wheel motor state",
            helpURL=self.HelpPrefix + "env_FilterWheelMotor",
        )

        gr.gridWdg(
            label=StFWMotor,
            dataWdg=self.fwHomedWdg,
            cat=self.EnvironCat,
        )

        gr.allGridded()

        self.gpsSyncedDict = {
            True: (RO.Constants.sevNormal, "Yes"),
            False: (RO.Constants.sevError, "No"),
            None: (RO.Constants.sevWarning, "?"),
        }

        self.ntpRunningDict = {
            True: "Running",
            False: "NotRunning",
            None: "?",
        }

        # add callbacks that deal with multiple widgets
        self.environShowHideWdg.addCallback(self._doShowHide, callNow=False)
        self.model.cameraConnState.addCallback(self._updCameraConnState,
                                               callNow=True)
        self.model.fwConnState.addCallback(self._updFWConnState, callNow=True)
        self.model.ccdTemp.addCallback(self._updCCDTemp, callNow=True)
        self.model.ccdSetTemp.addCallback(self._updCCDSetTemp, callNow=True)
        self.model.ccdTempLimits.addCallback(self._updCCDTempLimits,
                                             callNow=True)
        self.model.gpsSynced.addCallback(self._updGPSSynced, callNow=True)
        self.model.ntpStatus.addCallback(self._updNTPStatus, callNow=True)
        self.model.fwStatus.addCallback(self._updFWStatus, callNow=True)
        self._doShowHide()
Beispiel #6
0
    def __init__(
        self,
        master,
        statusBar,
        gridder,
        helpPrefix=None,
    ):
        self.statusBar = statusBar

        self.agileModel = AgileModel.getModel()
        self.currCmd = None
        gr = gridder

        wheelFrame = Tkinter.Frame(master)

        self.userFilterWdg = RO.Wdg.OptionMenu(
            master=wheelFrame,
            items=(),
            noneDisplay="?",
            autoIsCurrent=True,
            width=8,
            callFunc=self.enableButtons,
            defMenu="Current",
            helpText="Agile filter",
            helpURL=helpPrefix + "FilterWheel",
        )
        self.userFilterWdg.pack(side="left")

        self.applyBtn = RO.Wdg.Button(
            master=wheelFrame,
            text="Set Filter",
            callFunc=self.doApply,
            helpText="Set Agile filter",
            helpURL=helpPrefix + "FilterWheel",
        )
        self.applyBtn.pack(side="left")

        self.cancelBtn = RO.Wdg.Button(
            master=wheelFrame,
            text="X",
            callFunc=self.doCancel,
            helpText="Cancel filter command",
            helpURL=helpPrefix + "FilterWheel",
        )
        self.cancelBtn.pack(side="left")

        self.currentBtn = RO.Wdg.Button(
            master=wheelFrame,
            text="Current Filter",
            callFunc=self.doCurrent,
            helpText="Show current Agile filter",
            helpURL=helpPrefix + "FilterWheel",
        )
        self.currentBtn.setEnable(False)
        self.currentBtn.pack(side="left")

        gr.gridWdg("Filter Wheel", wheelFrame)

        slideFrame = Tkinter.Frame(master)

        self.slideInfoWdg = RO.Wdg.StrLabel(
            master=slideFrame,
            helpText="Filter slide information",
            helpURL=helpPrefix + "FilterSlide",
        )
        self.slideInfoWdg.pack(side="left")
        gr.gridWdg("Filter Slide", slideFrame)

        self.agileModel.currFilter.addCallback(self.updCurrFilter)
        self.agileModel.fwNames.addCallback(self.updFwNames)