The following lines are part of /online_dir/TkIrc.pl. They create a widget to operate the Large Offset Monochromator (Lom). It is an example of a compound device. Such devices export the attributes PositionSim and ResultSim (among other attributes). The are used as follows: if a value is written to PositionSim, the server sets the attribute ResultSim (a spectrum of strings), e.g.: Lom1Pitch = 24.2993, Lom2Pitch = 24.2993, Lom1Lin = -551.039, Lom2Lin = 551.039, emt = 0.123. Online parses these strings and fills the motor entry widgets accordingly, if the Test button is clicked.
The Crystal Spacing is selected by the positions of Lom1Lat and Lom2Lat, the Si311 crystals are found at 73mm, the Si511 crystals at 2 mm.
The motor lomenergy uses the TangoMotor interface. See our Tango manual for details.
$Spc::res_h{ blsc} = "lom"; $Spc::res_h{ lom_title} = { text => "Large Offset MC"}; $Spc::res_h{ lom_help} = sub { Util::display_text( "Help MC", ' Some Help text ' )}; # # the following line makes it a compound device # $Spc::res_h{ lom_cmpnd} = { name => "lomenergy", unit => "eV"}; # # the motors # $Spc::res_h{ lom_m1} = { name => "Lom1Pitch", unit => "Deg"}; $Spc::res_h{ lom_m2} = { name => "Lom1Lin", unit => "mm"}; $Spc::res_h{ lom_m3} = { name => "Lom1Lat", unit => "mm"}; $Spc::res_h{ lom_m4} = { name => "Lom2Pitch", unit => "Deg"}; $Spc::res_h{ lom_m5} = { name => "Lom2Lin", unit => "mm"}; $Spc::res_h{ lom_m6} = { name => "Lom2Lat", unit => "mm"}; $Spc::res_h{ lom_io1} = { label => { name => "Crystal spacing", get => sub {Spectra::tng_attrDoubleRd( "lomenergy", "D_Crystal");}}}; $Spc::res_h{ lom_io2} = { label => { name => "ConstantExit", get => sub { Spectra::tng_attrDoubleRd( "lomenergy", "ConstantExit");}, unit => "mm"}, entry => { set => sub { Spectra::tng_attrDoubleWrt( "lomenergy", "ConstantExit", $_[0])}}};