Edit-on-start Parameters: Difference between revisions
No edit summary |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Pagelinks}} | |||
= Links = | |||
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"> | |||
* [[Edit-on-Sequence Parameters]] | |||
* [[/Experiment ODB tree]] | |||
* mhttpd [[Start Page]] | |||
</div> | |||
== Introduction == | == Introduction == | ||
When a run is started, by default only the | 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 (Figure 1). | [[/Runinfo ODB tree #Run number|run number]] of the upcoming run will be displayed for editing (Figure 1). | ||
{| | {| class="wikitable" | ||
|+ | |+ Figure 1: Run start with no edit-on-start parameters defined | ||
|- | |- | ||
! Using [[mhttpd]] !! Using [[odbedit]] | |||
[[File:Mhstart1.gif| | |- | ||
|[[File:Mhstart1.gif|left|border|300px]] | |||
| | | | ||
<pre> | <pre> | ||
[local:bnmr:S]/Experiment>start | [local:bnmr:S]/Experiment>start | ||
Line 31: | Line 35: | ||
Many users link to the [[Keys in the ODB /Logger tree #/Logger/Write data |Write data key]] (see [[#Creating ''edit-on-start'' parameters|below]]) which enables/disables writing of data. A quick test run can then be made without data logging (see Figure 2). | Many users link to the [[Keys in the ODB /Logger tree #/Logger/Write data |Write data key]] (see [[#Creating ''edit-on-start'' parameters|below]]) which enables/disables writing of data. A quick test run can then be made without data logging (see Figure 2). | ||
{| | |||
|+ | {| class="wikitable" | ||
|+ Figure 2: Run start with one edit-on-start parameter defined | |||
|- | |- | ||
! Using [[mhttpd]] !! Using [[odbedit]] | |||
[[File:Mhstart.gif| | |- | ||
| [[File:Mhstart.gif|left|border|400px]] | |||
| | | | ||
<pre> | <pre> | ||
[local:test:S]/Experiment>start | [local:test:S]/Experiment>start | ||
Line 50: | Line 52: | ||
<br><br> | <br><br> | ||
|} | |} | ||
;Note | |||
By using the {{Odbedit cmd|cmd=start now}}, any edit-on-start parameters will ''not'' be displayed; the run will start immediately. | |||
<br><br><br> | |||
== Creating ''edit-on-start'' parameters == | == Creating ''edit-on-start'' parameters == | ||
Line 64: | Line 71: | ||
[local:Default:S]/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. | 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. | ||
Some 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 the run parameters. Links to these parameters in the subtree {{Odbpath|path=Run Parameters}} 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.: | The example below shows the creation of three parameters in the <span style="color: purple;">''Edit on start''</span> subtree.: | ||
Line 91: | Line 98: | ||
Description -> /Experiment/Run Parameters/Run Description | Description -> /Experiment/Run Parameters/Run Description | ||
<br><br><br> | |||
== edit-on-start parameter comments == | == ''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. | 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. | ||
Line 98: | Line 105: | ||
This "parameter comment" option is visible ONLY when using the MIDAS web server [[mhttpd]]. The [[odbedit]] start command will not display this extra information. | 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 | 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. | ||
=== Parameter comments when edit-on-start parameter is a link === | |||
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 in the | This is illustrated in the below, where the Edit-on-start parameter is a link named "number of cycles", which links to the actual parameter named <span style="color: purple;">''/equipment/fifo_acq/frontend/hardware/num cycles''</span>. The parameter name in the <span style="color: purple;">''Parameter Comments''</span> subtree for this parameter must be '''"num cycles"''' and '''NOT "number of cycles"'''. | ||
<pre> | |||
[local:bnqr:Stopped]Parameter Comments>ls "Edit on start/Number of cycles" | |||
Number of cycles -> /Equipment/FIFO_acq/frontend/hardware/num cycles | |||
0 | |||
[local:bnqr:Stopped]/Experiment>ls "Parameter Comments/Num cycles" | |||
Num cycles Stop run after number of cycles is reached. Enter 0 to disable (free running) | |||
</pre> | |||
=== Adding HTML styles to parameter comments === | |||
HTML styling can be added to the parameter comments using the HTML span tag, as in Figures 3a and 3b. | |||
;Figure 3a Adding HTML styling to the parameter comments Keys in ODB | |||
[[File:Bnqr_parameter_comments.png|border|750px]] | |||
<br clear=all> | |||
<br><br> | |||
'Figure 3b Parameter comments shown with HTML styling | |||
[[File:Bnqr_run_start.png|border]] | |||
<br clear=all> | |||
== Example of edit-on-start parameters == | |||
<br><br><br> | |||
== Example of ''edit-on-start'' parameters == | |||
The relevant parts of the /Experiment tree are shown below | The relevant parts of the /Experiment tree are shown below | ||
[local:test:S]/Experiment>ls -lr | [local:test:S]/Experiment>ls -lr | ||
Line 133: | Line 163: | ||
....... | ....... | ||
Starting a run with edit-on-start parameters set up as above results in a list of the edit-on-start parameters which the user can change (Figure | Starting a run with edit-on-start parameters set up as above, results in a list of the edit-on-start parameters which the user can change (Figure 4). | ||
<br> | <br> | ||
{| class="wikitable" | |||
{| | |+ Figure 4: Run start with many edit-on-start parameters defined | ||
| | |- | ||
! Using [[mhttpd]] !! Using [[odbedit]] | |||
|- | |- | ||
| | | [[File:Mhstart2.gif|left|border|700px]] | ||
[[File:Mhstart2.gif| | | | ||
| | |||
<pre> | <pre> | ||
[local:test:S]/Experiment>start | [local:test:S]/Experiment>start | ||
Line 161: | Line 188: | ||
</pre> | </pre> | ||
|} | |} | ||
<br><br><br> | |||
== Prevent the run number being edited at Run Start == | |||
;NOTES | |||
# Most experiments do not use this feature. It was requested for experiments where the run number is strictly controlled, e.g. with a custom run number checking system that assigns the run number automatically based on the type of run. | |||
#This feature is ignored by [[odbedit]]; regardless of whether the key <span style="color: purple; font-style:italic;">Edit run number</span> is present, the run number may be edited when using <span style="color:darkcyan;font-style:italic">odbedit</span> to start the run. | |||
By default, the user has the option to edit the run number at begin of run. To prevent this, the user may add an optional key {{Odbpath|path=Edit run number}} to the {{Odbpath|path=/Experiment/Edit on Start}} subdirectory. If this key is set to "n", the user will not be able to edit the run number on the mhttpd [[Start Page]] at the begin of run. | |||
By creating the key {{Odbpath|path=/Experiment/Edit on Start/Edit run number}} as a Boolean variable, the ability of editing the run number in the {{Utility|name=mhttpd}} [[Start Page]] is enabled or disabled, e.g. | |||
[local:Default:S]Edit on start>create BOOL "Edit run number" | |||
[local:Default:S]Edit on start>set "Edit run number" n | |||
By default, if this key is NOT present, the run number IS editable. | |||
Figure 5 shows edit-on-start parameters with the key "Edit run number" present, using the mhttpd [[ODB Page]] (Figure 5a) or [[odbedit]] (Figure 5b). | |||
{| class="wikitable" | |||
|+ Figure 5: Displaying edit-on-start parameters | |||
|- | |||
! Figure 5a: Using [[mhttpd]] [[ODB Page]] !! Figure 5b: Using odbedit | |||
|- | |||
| [[File:odb_edit_on_start.png|left|border|700px]] | |||
| <pre> | |||
[local:bnqr:Stopped]/Experiment>ls "Edit on start/ | |||
run_title MgO, HH=22mT, 300 K, 28 keV 31Mg, SLR | |||
experiment number 9998 | |||
experimenter ms cdpl wlk lp gdm | |||
sample MgO | |||
orientation 100 | |||
temperature 300 K | |||
field 220 G | |||
run mode -> /Experiment/run parameters/run mode | |||
1 | |||
Number of cycles -> /Equipment/FIFO_acq/frontend/hardware/num cycles | |||
0 | |||
write data -> /Equipment/FIFO_acq/mdarc/enable mdarc logging | |||
y | |||
Edit run number n | |||
</pre> | |||
|} | |||
<br><br> | |||
The resulting {{Utility|name=mhttpd}} [[Start Page]] is shown below (Figure 6). | |||
'''Figure 6: Start Page where run number cannot be edited''' | |||
[[File:edit-on-start.png|left|border|1000px|Figure 6]] | |||
<br clear=all> | |||
[[Category:Experiment]] |
Latest revision as of 16:18, 25 November 2016
Links
Introduction
When a run is started, by default only the run number of the upcoming run will be displayed for editing (Figure 1).
Using mhttpd | Using odbedit |
---|---|
[local:bnmr:S]/Experiment>start Run number [30499]: 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 Edit on start that the user creates in the /Experiment ODB tree.
Many users link to the Write data key (see below) which enables/disables writing of data. A quick test run can then be made without data logging (see Figure 2).
Using mhttpd | Using odbedit |
---|---|
[local:test:S]/Experiment>start Write data : n Run number [30499]: Are the above parameters correct? ([y]/n/q):
|
- Note
By using the odbedit command start now, any edit-on-start parameters will not be displayed; the run will start immediately.
Creating edit-on-start parameters
- Note
- The examples shown here use odbedit for ease of documentation; many users will prefer to use the editing function of the mhttpd ODB Page to create the ODB keys.
The first step to setting up the edit-on-start parameters is to create the subtree Edit on start under /Experiment 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 Edit on start subtree.
Some users find it convenient to create a subtree of /Experiment named Run Parameters to contain the run parameters. Links to these parameters in the subtree Run Parameters are then created in the Edit on start subtree.
The example below shows the creation of three parameters in the Edit on start subtree.:
- a parameter to contain the title of the run (called run_title )
- a link to the ODB parameter /Logger/Write data
- a link to the ODB parameter /Equipment/FIFO_acq/frontend/hardware/num cycles(previously created by the user)
- a link to the ODB parameter /Equipment/Run Parameters/Run Description (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/frontend/hardware/num cycles" "Number of cycles" [local:Default:S]/Edit on start>ln "/Experiment/Run Parameters/Run Description" "Description" [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 13m 0 RWD Number of cycles -> /equipment/fifo_acq/frontend/hardware/num cycles DWORD 1 4 >99d 0 RWD 0 write data -> /logger/Write data BOOL 1 4 >99d 0 RWD y Description -> /Experiment/Run Parameters/Run Description
edit-on-start parameter comments
An optional subdirectory Parameter Comments can be created under the /Experiment ODB tree to display some extra text on the mhttpd Start page under an 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 Parameter Comments subtree must match that of the corresponding edit-on-start parameter.
Parameter comments when edit-on-start parameter is a link
If the edit-on-start parameter is a link which is named differently from the actual parameter, then the parameter name in the Parameter Comments subtree must match the name of the actual parameter, rather than the link-name.
This is illustrated in the below, where the Edit-on-start parameter is a link named "number of cycles", which links to the actual parameter named /equipment/fifo_acq/frontend/hardware/num cycles. The parameter name in the Parameter Comments subtree for this parameter must be "num cycles" and NOT "number of cycles".
[local:bnqr:Stopped]Parameter Comments>ls "Edit on start/Number of cycles" Number of cycles -> /Equipment/FIFO_acq/frontend/hardware/num cycles 0 [local:bnqr:Stopped]/Experiment>ls "Parameter Comments/Num cycles" Num cycles Stop run after number of cycles is reached. Enter 0 to disable (free running)
Adding HTML styles to parameter comments
HTML styling can be added to the parameter comments using the HTML span tag, as in Figures 3a and 3b.
- Figure 3a Adding HTML styling to the parameter comments Keys in ODB
'Figure 3b Parameter comments shown with HTML styling
Example of edit-on-start parameters
The relevant parts of the /Experiment tree are shown below
[local:test:S]/Experiment>ls -lr Key name Type #Val Size Last Opn Mode Value --------------------------------------------------------------------------- Experiment DIR Name STRING 1 32 5s 0 RWD test ......... Run Parameters DIR Run Description STRING 1 256 2h 0 RWD Test run edit on start DIR run_title STRING 1 128 1m 0 RWD test without beam experiment number STRING 1 32 1m 0 RWD 12345 sample STRING 1 32 1m 0 RWD NA field STRING 1 32 52s 0 RWD 2500 Number of cycles -> /equipment/fifo_acq/frontend/hardware/num cycles DWORD 1 4 >99d 0 RWD 0 write data -> /logger/Write data BOOL 1 4 >99d 0 RWD y Description -> /Experiment/Run Parameters/Run Description STRING 1 256 2h 0 RWD Test run parameter comments DIR field STRING 1 64 35m 0 RWD Entered in Tesla unit active STRING 1 64 35m 0 RWD Enter y to save data to disk Num cycles STRING 1 80 34m 0 RWD Stop run after num cycles is reached. Enter 0 to disable (free running) .......
Starting a run with edit-on-start parameters set up as above, results in a list of the edit-on-start parameters which the user can change (Figure 4).
Using mhttpd | Using odbedit |
---|---|
[local:test:S]/Experiment>start run_title : test without beam experiment number : 12345 sample : NA field : 2500 Number of cycles : 0 write data : y Description : Test run Run number [30499]: Are the above parameters correct? ([y]/n/q): Starting run #30499 |
Prevent the run number being edited at Run Start
- NOTES
- Most experiments do not use this feature. It was requested for experiments where the run number is strictly controlled, e.g. with a custom run number checking system that assigns the run number automatically based on the type of run.
- This feature is ignored by odbedit; regardless of whether the key Edit run number is present, the run number may be edited when using odbedit to start the run.
By default, the user has the option to edit the run number at begin of run. To prevent this, the user may add an optional key
Edit run number to the
/Experiment/Edit on Start subdirectory. If this key is set to "n", the user will not be able to edit the run number on the mhttpd Start Page at the begin of run.
By creating the key /Experiment/Edit on Start/Edit run number as a Boolean variable, the ability of editing the run number in the mhttpd Start Page is enabled or disabled, e.g.
[local:Default:S]Edit on start>create BOOL "Edit run number" [local:Default:S]Edit on start>set "Edit run number" n
By default, if this key is NOT present, the run number IS editable.
Figure 5 shows edit-on-start parameters with the key "Edit run number" present, using the mhttpd ODB Page (Figure 5a) or odbedit (Figure 5b).
Figure 5a: Using mhttpd ODB Page | Figure 5b: Using odbedit |
---|---|
[local:bnqr:Stopped]/Experiment>ls "Edit on start/ run_title MgO, HH=22mT, 300 K, 28 keV 31Mg, SLR experiment number 9998 experimenter ms cdpl wlk lp gdm sample MgO orientation 100 temperature 300 K field 220 G run mode -> /Experiment/run parameters/run mode 1 Number of cycles -> /Equipment/FIFO_acq/frontend/hardware/num cycles 0 write data -> /Equipment/FIFO_acq/mdarc/enable mdarc logging y Edit run number n |
The resulting mhttpd Start Page is shown below (Figure 6).
Figure 6: Start Page where run number cannot be edited