Edit-on-start Parameters: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
(The midas documentation has moved to https://midas.triumf.ca/docs/)
Tag: Replaced
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Introduction ==
The midas documentation has moved. See [https://midas.triumf.ca/docs/develop/features/core_system/runs/configuring/#asking-questions-when-the-run-starts-edit-on-start Asking questions when the run starts (edit on start)] on the Runs: configuring page and [https://midas.triumf.ca/docs/develop/reference/reference/odb_keys/#experimentedit-on-start /Experiment/Edit on start] on the ODB keys page for the new documentation about edit-on-start parameters.
When a run is started, by default only the
[[/Runinfo ODB tree #Run number|run number]] of the upcoming run will be displayed for editing.
 
The following example shows a run started using [[odbedit]].
* Note: Examples are shown using <span style="color:darkcyan;">''odbedit''</span> for ease of documentation;  <span style="color:darkcyan;">''mhttpd''</span> could be used instead.
 
In the example below, the default run number of the next run is 30499. The user has changed this to 500.
 
[local:bnmr:S]/Experiment>start
Run number [30499]: 500
Are the above parameters correct? ([y]/n/q):
 
== ''edit-on-start'' parameters ==
It is often convenient to display and edit additional parameters prior to the run start. Not surprisingly, these parameters are known as '''''edit-on-start''''' parameters, since they automatically appear every time a run starts, and they are editable by the user.  
 
''Edit-on-start'' parameters are defined by creating ODB keys (or links to  existing ODB keys) in a special subtree named <span style="color: purple;">''Edit on start''</span> that the user creates in the
[[/Experiment ODB tree]].
 
Many users link to the  [[Keys in the ODB /Logger tree #/Logger/Write data |Write data key]]  which enables/disables writing of data. A quick test run can then be made without data logging, for example:
 
[local:bnmr:S]/Experiment>start
Write data : n
Run number [30499]:
Are the above parameters correct? ([y]/n/q): 
 
 
== Creating ''edit-on-start'' parameters ==
The first step to setting up the ''edit-on-start'' parameters is to create the subtree  <span style="color: purple;">''Edit on start''</span> under <span style="color: purple;">''/Experiment''</span> as follows:
 
$odbedit
[local:Default:S]/>cd /experiment
[local:Default:S]/Experiment>mkdir "Edit on start"
[local:Default:S]/Experiment>cd "Edit on start"
[local:Default:S]/Edit on start>
 
Then the user either creates the required parameters, or, if the parameters already exist elsewhere in the ODB, creates links to the parameters in the <span style="color: purple;">''Edit on start''</span> subtree.  
 
Many users find it convenient to create a subtree of <span style="color: purple;">''/Experiment''</span> named <span style="color: purple;">''Run Parameters''</span> to contain their run parameters. Links are then created in the <span style="color: purple;">''Edit on start''</span> subtree.
 
The example below shows the creation of three parameters in the <span style="color: purple;">''Edit on start''</span> subtree.:
 
*    a parameter to contain the title of the run (called <span style="color: purple;">''run_title''</span> )
*    a link to the ODB parameter <span style="color: purple;">''/Logger/Write data''</span>
*    a link to the ODB parameter <span style="color: purple;">''/Equipment/FIFO_acq/hardware/num scans''</span>(previously created by the user)
*  a link to the ODB parameter <span style="color: purple;">''/Equipment/Run Parameters/Sample''</span>  (previously created by the user)
 
[local:Default:S]/Edit on start>
[local:Default:S]/Edit on start>create string run_title
String length [32]:128
[local:Default:S]/Edit on start>ln "/Equipment/FIFO_acq/hardware/num scans" "number of scans"
[local:Default:S]/Edit on start>ln "/Experiment/Run Parameters/Sample" "sample"
[local:Default:S]/Edit on start>ln "/Logger/Write data" "write data"
[local:Default:S]Edit on start>ls -lt
Key name                        Type    #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
run_title                      STRING  1    128  3h  0  RWD  2e test
number of scans                INT    1    4    11h  0  RWD  /Equipment/FIFO_acq/hardware/num scans -> 0
sample                          STRING  1    23    3h  0  RWD  /Experiment/Run Parameters/Sample -> NA
write data                      BOOL    1    4    7s  0  RWD  /Logger/Write data -> y
 
 
== edit-on-start parameter comments ==
 
An optional subdirectory <span style="color: purple;">''Parameter Comments''</span> can be created under the [[/Experiment ODB tree]] to display some extra text on the [[mhttpd]] Start page under an [[#edit-on-start parameters|edit-on-start parameter]] where the parameter name may not contain enough information. In this case, a parameter comment can be created by the user.
 
This "parameter comment" option is visible ONLY when using the MIDAS web server [[mhttpd]]. The [[odbedit]] start command will not display this extra information.
 
The name of the parameter in the <span style="color: purple;">''Parameter Comments''</span> subtree must match that of the corresponding edit-on-start parameter. Comments may contain html tags if desired.
 
;Note :If the edit-on-start parameter is a link which is named differently from the actual parameter, then the parameter name in the <span style="color: purple;">''Parameter Comments''</span> subtree must match the name of the actual parameter, rather than the link-name.
 
This is illustrated below where the Edit-on-start parameter is a link named "number of channels", which links to the actual parameter <span style="color: purple;">''/sis/nchannels''</span>.
 
[local:midas:S]/Experiment>ls "Edit on start" -lr
number of channels              LINK    1    15    22m  0  RWD  /sis/nchannels
 
The parameter name in the <span style="color: purple;">''Parameter Comments''</span> subtree for this parameter must be "nchannels" and NOT "number of channels" as show in the [[#Example|example]].
 
=== Example ===
 
[local:midas:S]/Experiment>ls -lr
Key name                        Type  #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
Experiment                      DIR
    Name                        STRING  1    32    17s  0  RWD  midas
    Edit on Start              DIR
        Write data              BOOL    1    4    16m  0  RWD  y
        enable                  BOOL    1    4    16m  0  RWD  n
        nchannels              INT    1    4    16m  0  RWD  0
        dwelling time (ns)      INT    1    4    16m  0  RWD  0
 
 
    Parameter Comments          DIR
        Write Data              STRING  1    64    44m  0  RWD  Enable logging
        enable                  STRING  1    64    7m  0  RWD  SIS Multi Channel Scaler for expt B1 only
        nchannels              STRING  1    64    14m  0  RWD  <i>maximum 1024</i>
        dwelling time (ns)      STRING  1    64    8m  0  RWD  <b>Check hardware now</b>
 
[local:midas:S]Edit on Start>ls -l
 
Key name                        Type  #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
Write Data                      LINK    1    19    50m  0  RWD  /logger/Write data
enable                          LINK    1    12    22m  0  RWD  /sis/enable
number of channels              LINK    1    15    22m  0  RWD  /sis/nchannels
dwelling time (ns)              LINK    1    24    12m  0  RWD  /sis/dwelling time (ns)
 
This results in a start run page as shown below.
 
[[File:mhstart2.gif|frame|mhttpd run start page showing edit-on-start parameters and parameter comments ]]

Latest revision as of 22:00, 30 October 2026

The midas documentation has moved. See Asking questions when the run starts (edit on start) on the Runs: configuring page and /Experiment/Edit on start on the ODB keys page for the new documentation about edit-on-start parameters.