ReadoutGUIPanel

Name

ReadoutGUIPanel -- ReadoutGUI Convenience commands

Synopsis

package require ReadoutGUIPanel

::ReadoutGUIPanel::addUserMenu ident label

::ReadoutGUIPanel::getRunIdInstance

::ReadoutGUIPanel::ghostWidgets

::ReadoutGUIPanel::unghostWidgets

::ReadoutGUIPanel::getTitle

::ReadoutGUIPanel::setTitle title-string

::ReadoutGUIPanel::getRun

::ReadoutGUIPanel::setRun run-number

::ReadoutGUIPanel::incrRun

::ReadoutGUIPanel::recordOff

::ReadoutGUIPanel::recordOn

::ReadoutGUIPanel::recordData

::ReadoutGUIPanel::getRunTime

::ReadoutGUIPanel::isTimed

::ReadoutGUIPanel::setTimed state

::ReadoutGUIPanel::getRequestedRunTime

::ReadoutGUIPanel::setRequestedRunTime

::ReadoutGUIPanel::isRecording

::ReadoutGUIPanel::notRecording

::ReadoutGUIPanel::normalColors

::ReadoutGUIPanel::outputText

::ReadoutGUIPanel::log source class message

DESCRIPTION

ReadoutGUIPanel is a collection of simple commands that provide access to the readout GUI and its components. The commands all live in the ::ReadoutGUIPanel namespace. In many cases they provide compatibility with functions that were provided by the NSCLDAQ-10.x and earlier ReadoutShell. There are no plans, however to deprecate/remove these functions unless their functionality becomes obsolete in future (NSCLDAQ-12.0 or later) versions of NSCLDAQ's readout shell.

COMMANDS

::ReadoutGUIPanel::addUserMenu ident label

Adds a new menu to the menubar of the ReadoutGUI. The ident is required but ignored (it was used in NSCLDAQ-10.x and earlier). label is the label for the menu in the menu bar.

The command returns the widget that is the menu. This allows you to populate the menu for example:


set mymenu [::ReadoutGUIPanel::addUserMenu ignored Special]
$mymenu add command -label "a command" -command handleACommand
...
                            

Adds a menu labeled Special to the menu bar and puts a command entry labelled a command on it that invokes the command handleACommand when clicked.

::ReadoutGUIPanel::getRunIdInstance

The Readout GUI is composed of several megawidgets. These are established as singleton objects. The RunIdentification megawidget (see ui) provides a cluster of widgets that identify the run in progress or run about to start. This command returns the widget id of the run identification singleton object.

Note that several commands below offer access to the most common pieces of this widget, so you may not ever actually need to use this command.

::ReadoutGUIPanel::ghostWidgets

Some widgets in the ReadoutGUI must be disabled while the run is not in the halted state. This command disables those widgets. See also ::ReadoutGUIPanel::unghostWidgets

::ReadoutGUIPanel::unghostWidgets

Enable the widgets that must be disabled when the run is not in the halted state. See also ::ReadoutGUIPanel::ghostWidgets

::ReadoutGUIPanel::getTitle

Returns the title from the title section of the run identification megawidget. If the run is active or paused, this will be the title of the current run. Otherwise, this will be the title of the next run, assuming the user does not change it.

It is recommended that applications access this when the run is active or about to be. This can be done by using the appropriate ReadoutCallouts.tcl proc or by creating a Run state machine callback bundle and using the appropriate state transition to capture the title.

::ReadoutGUIPanel::setTitle new-title

Makes new-title the new title string in the Run identification megawidget. Note that this should only be done when the run is not in one of the active states (Active or Paused). This sets the title that will be associated with the next run.

::ReadoutGUIPanel::getRun

Returns the value of the run number in the run identification megawidget. If the run is active (state in Active or Paused), this will be the current run number. If not, this will be the run number of the next run started, unless the user modifies it.

It is recommended that applications access this when the run is active or about to be. This can be done by using the appropriate ReadoutCallouts.tcl proc or by creating a Run state machine callback bundle and using the appropriate state transition to capture the title.

::ReadoutGUIPanel::setRun new-run

Sets the run number in the run identification megawidget to be new-run. new-run must be a positive integer. This should only be modified when the run is not active (in neither the Active nor Paused states).

::ReadoutGUIPanel::incrRun

Adds one to the run number in the run identification megawidget. This should only be done when the run is not active (in neither the Active nor Paused states).

::ReadoutGUIPanel::recordOff

Turns off the record checkbutton in the run control megawidget. This determines whether or not the next run will be recorded to disk. Note that this does not change the rendition of the output area of the widget. See ::ReadoutGUIPanel::isRecording, ::ReadoutGUIPanel::notRecording and ::ReadoutGUIPanel::normalColors to modify display renditions.

::ReadoutGUIPanel::recordOn

Turns on the record checkbutton in the run control megawidget.

::ReadoutGUIPanel::recordData

Returns the state of the record checkbutton in the run control megawidget.

::ReadoutGUIPanel::getRunTime

Returns the number of seconds the current run has been active (a paused run is not active for this computation). If the run is not active this returns 0 if the ReadoutGUI has not yet started a run or the length of the previous run if it has.

::ReadoutGUIPanel::isTimed

Returns boolean true if the timed run button is on and false if not.

::ReadoutGUIPanel::setTimed state

Checks or unchecks the timed run checkbutton according to state. If checked at the start of the run, the run has a timed duration (unless manually halted). See ::ReadoutGUIPanel::getRequestedRunTime and ::ReadoutGUIPanel::setRequestedRunTime.

::ReadoutGUIPanel::getRequestedRunTime

Returns the number of seconds in the requested run time. This is only meaningful if the timed run checkbox is checked. The requested run time is the active time (time paused does not count).

::ReadoutGUIPanel::setRequestedRunTime time-in-seconds

Sets the number of seconds in the requested run time to time-in-seconds. If the timed run checkbutton is checked, then the next run will be a time duration run that will automatically stop after time-in-seconds of active time elapse.

::ReadoutGUIPanel::isRecording

Sets the rendition of the text widget to be consistent with the run being recorded.

::ReadoutGUIPanel::notRecording

Sets the rendition of the text widget to be consistent with the run being not recorded.

::ReadoutGUIPanel::normalColors

A synonym for ::ReadoutGUIPanel::notRecording

::ReadoutGUIPanel::outputText message

Outputs message to the output text widget. The message is output without interpretation or filtering using the default rendition. See also ::ReadoutGUIPanel::Log.

::ReadoutGUIPanel::Log source class message

Formats a log message to be output on the text widget. source identifies the subsystem the message is coming from. class is the class of message being output. See the documentation of the OutputWindow in ui for more information about what the class is and how it influences the output.

For now just know that unless reconfigured, class represents a message severity that can be one of: output, log, error, warning or debug and note that debug messages are, by default, not displayed.

message is the body of the message to be logged. The message is timestamped and potentially output to the text terminal along with the severity and data source. For example, when starting data source, the following log message will appear (with an appropriate timestamp).


                            
01/08/2014 08:50:08 : log : Run State changed : NotReady -> Starting
                            
                            

In this case log is the class, Run State changed is the source and NotReady -> Starting the message.