def __init__( self, inputRootFile="/tmp/histograms.root", outputFile="scurveHistogram.png" ) : self.inputRootFile=inputRootFile self.outputFile=outputFile self.rpcService = GlibRPCService.instance() self.view = DisplayHistogramsView() # Query the RPC service to see which CBCs are connected self.connectedCBCs=[] self.rpcService.connectedCBCNames( None, self ) # Bind the update button so that I can initiate the RPC call self.view.getUpdateButton().addClickListener( self ) # Ask to receive notifications when data is being taken so that I can disable the button DataRunManager.instance().registerEventHandler( self )
def __init__( self ) : self.view=CalibrateChannelTrimsView() # Bind to the start button self.view.getStartButton().addClickListener( self ) # Register to receive notifications of when data taking starts self.dataRunManager = DataRunManager.instance() self.dataRunManager.registerEventHandler( self )
def __init__( self ) : # This is the service that will be used to communicate with the DAQ software self.rpcService = GlibRPCService.instance() self.dataRunManager = DataRunManager.instance() self.view = OccupancyCheckView() # Ask the server what's connected self.rpcService.connectedCBCNames( None, self ) # Tell the DataRunManager that I want to be told when anything starts or stops # taking data. When anything happens the onDataTakingEvent method will be called. self.dataRunManager.registerEventHandler( self ) # Bind the Update button self.view.getUpdateButton().addClickListener(self) self.view.setEchoMessage("No data.")
def __init__( self ) : # This is the service that will be used to communicate with the DAQ software self.rpcService = GlibRPCService.instance() self.dataRunManager = DataRunManager.instance() self.mainPanel = VerticalPanel() self.mainPanel.setSpacing(15) self.controlValueEntries={} #controls the parameters of the s-curve #self.graphCanvas=GraphCanvas(self) #self.rpcService.getSCurveValues( ) self.mainSettings=VerticalPanel("Control Settings") self.startButton=VerticalPanel("Run Button") self.canvasPanel=VerticalPanel("Canvas") self.mainSettings.add(self.createControlPanel(["RangeLo","RangeHi","Steps"])) self.echo=Label() # A good print screen method self.launchButton=Button("Launch Now") self.launchButton.addClickListener(self) self.launchButton.setEnabled(True) saveHistogramsPanel=HorizontalPanel() self.saveHistogramsButton=Button("Save histograms") self.saveHistogramsButton.setEnabled(False) # Disable this button until data has been taken self.saveHistogramsButton.addClickListener(self) self.saveHistogramsFilename=TextBox("Filename") self.saveHistogramsFilename.setText("/tmp/scurveHistograms.root") self.saveHistogramsFilename.setVisibleLength(50) saveHistogramsPanel.add( self.saveHistogramsButton ) saveHistogramsPanel.add( self.saveHistogramsFilename ) self.mainPanel.add(self.mainSettings) self.mainPanel.add(self.startButton) self.mainPanel.add(self.launchButton) self.mainPanel.add(self.echo) self.mainPanel.add(saveHistogramsPanel) histogramDisplay=DisplayHistogramsPanel() self.mainPanel.add( HTML( '<br><b>Results:</b> (note that selecting a lot of channels can take a very long time)') ) self.mainPanel.add( histogramDisplay.getPanel() ) self.dataRunManager.registerEventHandler( self )
def onModuleLoad(self): # Window.setTitle("CBC Test Stand") StyleSheetCssFile("styleSheet.css") self.TEXT_WAITING = "Waiting for response..." self.TEXT_ERROR = "Server Error" self.status = Label() # This is the remote service self.I2CPanel = I2CPanel() self.SCurveRunPanel = SCurveRunPanel() self.OccupancyCheckPanel = OccupancyCheckPanel() self.CalibrateChannelTrimsPanel = CalibrateChannelTrimsPanel() # mainPanel will have all of the working stuff in it self.mainPanel = DockPanel() # self.mainPanel.setSpacing(10) titleBar = HorizontalPanel() titleBar.add(HTML(r"CBC Test Stand (v1.1)", StyleName="titleStyle")) self.stopTakingDataButton = Button("Stop taking data") self.stopTakingDataButton.addClickListener(self) self.dataTakingPercentage = HTML("0%") self.dataTakingStatus = HTML("Initiating...") titleBar.add(self.dataTakingPercentage) titleBar.add(self.dataTakingStatus) titleBar.add(self.stopTakingDataButton) titleBar.setCellHorizontalAlignment(self.dataTakingStatus, HasHorizontalAlignment.ALIGN_RIGHT) titleBar.setCellHorizontalAlignment(self.dataTakingPercentage, HasHorizontalAlignment.ALIGN_RIGHT) titleBar.setCellHorizontalAlignment(self.stopTakingDataButton, HasHorizontalAlignment.ALIGN_RIGHT) titleBar.setWidth("100%") self.mainPanel.add(titleBar, DockPanel.NORTH) selectionPanel = VerticalPanel() # Register to get updates about the status of data taking, so that # I can update the information in the title bar self.dataRunManager = DataRunManager.instance() self.dataRunManager.registerEventHandler(self) self.activePanelButton = None self.activePanel = None self.registersButton = Label("I2C Registers", StyleName="areaStyle") self.occupanciesButton = Label("Test Occupancies", StyleName="areaStyle") self.scurveButton = Label("S-Curve Run", StyleName="areaStyle") self.calibrateTrimsButton = Label("Calibrate Trims", StyleName="areaStyle") self.registersButton.addClickListener(self) self.occupanciesButton.addClickListener(self) self.scurveButton.addClickListener(self) self.calibrateTrimsButton.addClickListener(self) selectionPanel.add(self.registersButton) selectionPanel.add(self.occupanciesButton) selectionPanel.add(self.scurveButton) selectionPanel.add(self.calibrateTrimsButton) self.mainPanel.add(selectionPanel, DockPanel.WEST) self.mainPanel.add(self.status, DockPanel.SOUTH) RootPanel().add(self.mainPanel) self.setNewMainPanel(self.registersButton)