diff --git a/slsDetectorSoftware/README b/slsDetectorSoftware/README index 2cbe78380..b1cfea7a7 100644 --- a/slsDetectorSoftware/README +++ b/slsDetectorSoftware/README @@ -1,7 +1,7 @@ This subversion repository contains Common directories -Please inform Anna, Beat and Ian if you make modifications to these directories +Please inform Anna or Dhanya if you make modifications to these directories - MySocketTCP : socket class - commonFiles : header file common to server and client - slsDetector : base class with all main detector functionalities (client side) @@ -13,9 +13,7 @@ Please inform Anna if you make modifications to these directories - mythenDetectorServer : mythen server (for etrax compiler) - firmware lib might be added in the future -Eiger specific directories -Please inform Beat and Ian if you make modifications to these directories -- eigerDetector : eiger specific funcs (mainly files I/O and ..) -- eigerDetectorServer : eiger server +Other Detector specific directories +Please inform Dhanya if you make modifications to these directories make doc diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp index ef7bb80c6..2ab156fbb 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -6,1292 +6,1775 @@ #include #include +/*! \mainpage Introduction + +This program is intended to control the SLS detectors via command line interface. +This is the only way to access all possible functionality of the detectors, however it is often recommendable to avoid changing the most advanced settings, rather leaving the task to configuration files, as when using the GUI or the API provided. + +The command line interface consists in four main functions: + +- \b sls_detector_acquire to acquire data from the detector +- \b sls_detector_put to set detector parameters +- \b sls_detector_get to retrieve detector parameters +- \b sls_detector_help to get help concerning the text commands +Additionally the program slsReceiver should be started on the machine expected to receive the data from the detector. + + +If you need control a single detector, the use of the command line interface does not need any additional arguments. + +For commands addressing a single controller of your detector, the command cmd should be called with the index i of the controller: + + +sls_detector_clnt i:cmd + + +where \b sls_detector_clnt is the text client (put, get, acquire, help). + +In case more than one detector is configured on the control PC, the command cmd should be called with their respective index j: + + +sls_detector_clnt j-cmd + + +where \b sls_detector_clnt is the text client (put, get, acquire, help). + +To address a specific controller i of detector j use: + +sls_detector_clnt j-i:cmd + +For additional questions concerning the indexing of the detector, please refer to the SLS Detectors FAQ documentation. + +The commands are sudivided into different pages depending on their functionalities: + - \ref acquisition Acquisition: commands to start/stop the acquisition and retrieve data + - \ref config Configuration: commands to configure the detector + - \ref data "Data postprocessing": commands to process the data - mainly for MYTHEN except for rate corrections. + - \ref settings "Settings": commands to define detector settings/threshold. + - \ref output "Output": commands to define output file destination and format + - \ref actions "Actions": commands to define scripts to be executed during the acquisition flow + - \ref network "Network": commands to setup the network between client, detector and receiver + - \ref receiver "Receiver": commands to configure the receiver + - \ref test Developer: commands to be used only for software debugging. Avoid using them! + */ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) { - myDet=det; - - int i=0; + myDet=det; + + int i=0; + + cmd=string("none"); + + /*! \page test Developer + Commands to be used only for software debugging. Avoid using them! + - \b test returns an error + */ + + descrToFuncMap[i].m_pFuncName="test"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdUnderDevelopment; + i++; + /* Acquisition and status commands */ + /*! \page acquisition Acquition commands + Commands to control the acquisition + */ + /*! \page acquisition + - \b acquire blocking acquisition (like calling sls_detector_acquire). Starts receiver and detector, writes and processes the data, stops detector. Only get! + */ + descrToFuncMap[i].m_pFuncName="acquire"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAcquire; + i++; + + /*! \page acquisition + - \b data gets all data from the detector (if any) processes them and writes them to file according to the preferences already setup (MYTHEN only). Only get! + */ + descrToFuncMap[i].m_pFuncName="data"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdData; + i++; + + /*! \page acquisition + - \b frame gets a single frame from the detector (if any) processes it and writes it to file according to the preferences already setup (MYTHEN only). Only get! + */ + descrToFuncMap[i].m_pFuncName="frame"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFrame; + i++; + + /*! \page acquisition + - \b status \c returns the detector status (string)- can be: \c running, \c error, \c transmitting, \c finished, \c waiting or \c idle; \c put can be \c start or \c stop + */ + descrToFuncMap[i].m_pFuncName="status"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus; + i++; + + /*! \page acquisition + - \b busy returns \c 1 if the acquisition is active, \c 0 otherwise. Works when the acquisition is started in non-blocking mode. Only get! + */ + descrToFuncMap[i].m_pFuncName="busy"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus; + i++; + + + /* Detector structure configuration and debugging commands */ + + /*! \page config Configuration commands + Commands to configure the detector. these commands are often left to the configuration file. + */ + + /*! \page config + - \b datastream enables/disables the 0MQ data stream (0MQ threads created) from receiver to client. + */ + descrToFuncMap[i].m_pFuncName="datastream"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDataStream; + i++; + + /*! \page config + - \b free Free shared memory on the control PC + */ + + descrToFuncMap[i].m_pFuncName="free";//OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFree; + i++; + + + /*! \page config + - \b add Adds a detector at the end of the multi-detector structure. \c put argument is the hostname or IP adress. Returns the chained list of detector hostnames. + */ + + descrToFuncMap[i].m_pFuncName="add";//OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdd; + i++; + + /*! \page config + - remove i Removes controller \c i from the multi-detector structure. Can be used for partial readout of the detector. + */ + + descrToFuncMap[i].m_pFuncName="remove";//OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRemove; + i++; + + + /*! \page config + - type Sets/gets detector type (string). + */ + + descrToFuncMap[i].m_pFuncName="type"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdHostname; + i++; + + /*! \page config + - hostname \c put adds the hostname (ot IP adress) at the end of the multi-detector structure. If used for a single controlled (i:) replaces the current hostname. Returns the list of the hostnames of the multi-detector structure. + */ + + descrToFuncMap[i].m_pFuncName="hostname"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdHostname; + i++; + + /*! \page config + - id[:i] Returns the id of the detector structure. i is the detector position in a multi detector system. If used a \c put, configures the id of the detector structure. i is the detector position in a multi detector system and l is the id of the detector to be added. + */ + + descrToFuncMap[i].m_pFuncName="id"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdId; + i++; + + /*! \page config + - master i \c put sets the position of the master of the acquisition (-1 if none). Returns the position of the master of the detector structure (-1 if none). + */ + descrToFuncMap[i].m_pFuncName="master"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdMaster; + i++; + + /*! \page config + - sync Sets/gets the synchronization mode of the detectors in the multi-detector structure. Can be: \c none, \c gating, \c trigger, \c complementary. Mainly used by MYTHEN/GOTTHARD. + */ + descrToFuncMap[i].m_pFuncName="sync"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSync; + i++; + + /*! \page test + - help Returns a list of possible commands. + */ + descrToFuncMap[i].m_pFuncName="help";//OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdHelp; + i++; + + /*! \page test + - exitserver Shuts down all the detector servers. Don't use it!!!! + */ + descrToFuncMap[i].m_pFuncName="exitserver";//OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdExitServer; + i++; + + /*! \page test + - exitreceiver Shuts down all the receivers. Don't use it!!!! + */ + descrToFuncMap[i].m_pFuncName="exitreceiver";//OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdExitServer; + i++; + + + /* data processing commands */ + + /*! \page data Data processing commands + Commands to setup the data processing (mainly MYTHEN related) + */ + /*! \page data + - flatfield [fn] \c put sets flatfield file to \c fn (relative to \c ffdir). \get returns the flatfield file name relative to \c ffdir (string). If \fn is specified, it writes the flat field correction factors and errors to \c fn. +\c none disables flat field corrections. + */ + descrToFuncMap[i].m_pFuncName="flatfield"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFlatField; + i++; + + /*! \page data + - ffdir [d] Sets/gets the directory in which the flat field file is located. + */ + descrToFuncMap[i].m_pFuncName="ffdir"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFlatField; + i++; + + /*! \page data + - ratecorr [ns] Returns the dead time used for rate correections in ns (int). \c put sets the deadtime correction constant in ns, -1 will set it to default tau of settings (0 unset). + + */ + descrToFuncMap[i].m_pFuncName="ratecorr"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRateCorr; + i++; + + + /*! \page data + - badchannels [fn] \c put sets the badchannels file to \c fn . \get returns the bad channels file name. If \fn is specified, it writes the badchannels to \c fn. \c none disables badchannel corrections. + + */ + descrToFuncMap[i].m_pFuncName="badchannels"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdBadChannels; + i++; + + + /*! \page data + - angconv [fn] \c put sets the angular conversion file to \c fn . \get returns the angular conversion file name. If \fn is specified, it writes the angular conversion factors to \c fn. \c none disables angular corrections. + + */ + + descrToFuncMap[i].m_pFuncName="angconv"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; + i++; + + /*! \page data + - globaloff [f] Sets/gets the beamline angular global offset (float). + */ + + descrToFuncMap[i].m_pFuncName="globaloff"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; + i++; + + /*! \page data + - fineoff [f] Sets/gets the angular fine offset of the measurement (float). + */ + //2017/08/15 + + descrToFuncMap[i].m_pFuncName="fineoff"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; + i++; + + /*! \page data + - binsize [f] Sets/gets the bin size used for the angular conversion (float). + */ + + descrToFuncMap[i].m_pFuncName="binsize" ;// + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; + i++; + + /*! \page data + - angdir [i] Sets/gets the angular direction. 1 means increasing channels number as increasing angle, -1 increasing channel number decreasing angle. + */ + + descrToFuncMap[i].m_pFuncName="angdir" ;// + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; + i++; + + + /*! \page data + - moveflag [i] Sets/gets the flag for physically moving the detector during the acquisition of several positions. 1 sets (moves), 0 unsets. + */ + descrToFuncMap[i].m_pFuncName="moveflag" ;// + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; + i++; + + /*! \page data + - samplex [f] Sets/gets the sample displacement in th direction parallel to the beam in um. Unused! + */ + descrToFuncMap[i].m_pFuncName="samplex" ;// + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; + i++; + + + /*! \page data + - sampley [f] Sets/gets the sample displacement in th direction orthogonal to the beam in um. Unused! + */ + descrToFuncMap[i].m_pFuncName="sampley" ;// + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; + i++; + + + /*! \page data + - threaded [i] Sets/gets the data processing threaded flag. 1 is threaded, 0 unthreaded. + */ + descrToFuncMap[i].m_pFuncName="threaded"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdThreaded; + i++; + + /*! \page data + - darkimage fn Loads the dark image to the detector from file fn (pedestal image). Cannot get. + */ + descrToFuncMap[i].m_pFuncName="darkimage"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdImage; + i++; + + /*! \page data + - gainimage fn Loads the gain image to the detector from file fn (gain map for translation into number of photons of an analog detector). Cannot get. + */ + descrToFuncMap[i].m_pFuncName="gainimage"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdImage; + i++; + + /*! \page acquisition + - readctr Reads the counters from the detector memory (analog detector returning values translated into number of photons - only GOTTHARD). Cannot put. + */ + descrToFuncMap[i].m_pFuncName="readctr"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdCounter; + i++; + + /*! \page acquisition + - resetctr i Resets counter in detector, restarts acquisition if i=1(analog detector returning values translated into number of photons - only GOTTHARD). Cannot put. + */ + descrToFuncMap[i].m_pFuncName="resetctr"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdCounter; + i++; + + /*! \page acquisition + - resmat i sets/resets counter bit in detector.gets the counter bit in detector ???? + */ + descrToFuncMap[i].m_pFuncName="resmat"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdCounter; + i++; + + /* trim/cal directories */ + + + + /*! \page settings Detector settings commands + Commands to setup the settings of the detector + */ + + /*! \page settings + - settingsdir [dir] Sets/gets the directory where the settings files are located (string) + */ + descrToFuncMap[i].m_pFuncName="settingsdir"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettingsDir; + i++; + /*! \page settings + - trimdir [dir] obsolete \c settingsdir + */ + descrToFuncMap[i].m_pFuncName="trimdir"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettingsDir; + i++; + + /*! \page settings + - caldir [dir] Sets/gets the directory where the calibration files are located (string) + */ + descrToFuncMap[i].m_pFuncName="caldir"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdCalDir; + i++; + + /*! \page settings + - trimen [n e0 e1...e(n-1)] Sets/gets the number of energies n at which the detector has default trim file and their values in eV (int) + */ + descrToFuncMap[i].m_pFuncName="trimen"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTrimEn; + i++; + + + /* file name */ + + + /*! \page output Output settings + Commands to setup the file destination and format + */ + + /*! \page output + - outdir [dir] Sets/gets the file output directory (string) + */ + descrToFuncMap[i].m_pFuncName="outdir"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOutDir; + i++; + + /*! \page output + - fname [fn] Sets/gets the root of the output file name (string) + */ + descrToFuncMap[i].m_pFuncName="fname"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFileName; + i++; + + /*! \page output + - index [i] Sets/gets the current file index (int) + */ + descrToFuncMap[i].m_pFuncName="index"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFileIndex; + i++; + + + /*! \page config + - online [i] sets the detector in online (1) or offline (0) mode + */ + descrToFuncMap[i].m_pFuncName="online"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; + i++; + + /*! \page config + - checkonline returns the hostnames of all detectors without connecting to them + */ + descrToFuncMap[i].m_pFuncName="checkonline"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; + i++; + /*! \page config + - activate Activates/Deactivates the detector. Deactivated detector does not send data. Used for EIGER only. + */ + descrToFuncMap[i].m_pFuncName="activate"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; + i++; + + /*! \page output + - enablefwrite [i] Enables/disables file writing. 1 enables, 0 disables. + */ + descrToFuncMap[i].m_pFuncName="enablefwrite"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdEnablefwrite; + i++; + + /*! \page output + - overwrite [i] enables(1) /disables(0) file overwriting + */ + descrToFuncMap[i].m_pFuncName="overwrite"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOverwrite; + i++; + + /*! \page output + - currentfname gets the filename for the data without index and extension + */ + descrToFuncMap[i].m_pFuncName="currentfname"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFileName; + i++; + + /*! \page output + - fileformat gets the file format for data (no put?) What are the possible return values? + */ + descrToFuncMap[i].m_pFuncName="fileformat"; //OK + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFileName; + i++; + + /* Acquisition actions */ + + /*! \page actions Actions + Commands to define scripts to be executed during the acquisition flow + */ + + /*! \page actions + - positions [n [p0..pn-1]] sets/gets number of angular position and positions to be acquired. + */ + descrToFuncMap[i].m_pFuncName="positions"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPositions; + i++; + + /*! \page actions + - startscript [s] sets/gets the script to be executed at the beginning of the acquisition. \c none unsets. + */ + descrToFuncMap[i].m_pFuncName="startscript"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - startscriptpar [s] sets/gets a string to be passed as a parameter to the startscript + */ + descrToFuncMap[i].m_pFuncName="startscriptpar"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - stopscript [s] sets/gets the script to be executed at the end of the acquisition. \c none unsets. + */ + descrToFuncMap[i].m_pFuncName="stopscript"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - stopscriptpar [s] sets/gets a string to be passed as a parameter to the stopscript + */ + descrToFuncMap[i].m_pFuncName="stopscriptpar"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - scriptbefore [s] sets/gets the script to be executed before starting the detector every time in the acquisition. \c none unsets. + */ + descrToFuncMap[i].m_pFuncName="scriptbefore"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - scriptbeforepar [s] sets/gets a string to be passed as a parameter to the scriptbefore + */ + descrToFuncMap[i].m_pFuncName="scriptbeforepar"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - scriptafter [s] sets/gets the script to be executed after the detector has finished every time in the acquisition. \c none unsets. + */ + descrToFuncMap[i].m_pFuncName="scriptafter"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - scriptafterpar [s] sets/gets a string to be passed as a parameter to the scriptafter + */ + descrToFuncMap[i].m_pFuncName="scriptafterpar"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - headerafter [s] sets/gets the script to be executed for logging the detector parameters. \c none unsets. + */ + descrToFuncMap[i].m_pFuncName="headerafter"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - headerbefore [s] sets/gets the script to be executed for logging the detector parameters. \c none unsets. + */ + descrToFuncMap[i].m_pFuncName="headerbefore"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - headerbeforepar [s] sets/gets a string to be passed as a parameter to the headerbefore script + */ + descrToFuncMap[i].m_pFuncName="headerbeforepar"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - headerafterpar [s] sets/gets a string to be passed as a parameter to the headerafter script + */ + descrToFuncMap[i].m_pFuncName="headerafterpar"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - enacallog [i] enables/disables logging of the parameters necessary for the energy calibration. 1 sets, 0 unsets. + */ + descrToFuncMap[i].m_pFuncName="encallog"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + /*! \page actions + - angcallog [i] enables/disables logging of the parameters necessary for the angular calibration. 1 sets, 0 unsets. + */ + descrToFuncMap[i].m_pFuncName="angcallog"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; + i++; + + + + + + /*! \page actions + - scan0script [s] sets/gets the script to be executed for the scan 0 level. \c none unsets. + */ + descrToFuncMap[i].m_pFuncName="scan0script"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + /*! \page actions + - scan0par [s] sets/gets a string to be passed as a parameter to the scan0script + */ + descrToFuncMap[i].m_pFuncName="scan0par"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + /*! \page actions + - scan0prec [i] sets/gets number of digits to be used for the scan0 variable in the file name. + */ + descrToFuncMap[i].m_pFuncName="scan0prec"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + /*! \page actions + - scan0steps [i [s0..sn-1]] sets/gets number of steps (int) of the scan0 level and their values (float). + */ + descrToFuncMap[i].m_pFuncName="scan0steps"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + + /*! \page actions + - scan0range [smin smax sstep] sets scan0 min, max and step, returns the number of steps and their values as scan0steps. + */ + descrToFuncMap[i].m_pFuncName="scan0range"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + /*! \page actions + - scan1script [s] sets/gets the script to be executed for the scan1 level. \c none unsets. + */ + descrToFuncMap[i].m_pFuncName="scan1script"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + /*! \page actions + - scan1par [s] sets/gets a string to be passed as a parameter to the scan1script + */ + descrToFuncMap[i].m_pFuncName="scan1par"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + /*! \page actions + - scan1prec [i] sets/gets number of digits to be used for the scan1 variable in the file name. + */ + descrToFuncMap[i].m_pFuncName="scan1prec"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + /*! \page actions + - scan1steps [i [s0..sn-1]] sets/gets number of steps (int) of the scan1 level and their values (float). + */ + descrToFuncMap[i].m_pFuncName="scan1steps"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + /*! \page actions + - scan1range [smin smax sstep] sets scan1 min, max and step, returns the number of steps and their values as scan1steps. + */ + descrToFuncMap[i].m_pFuncName="scan1range"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; + i++; + + + /* communication configuration */ + + /*! \page network Network + Commands to setup the network between client, detector and receiver + - rx_hostname [s] sets/gets the receiver hostname or IP address, configures detector mac with all network parameters and updates receiver with acquisition parameters. Normally used for single detectors (Can be multi-detector). \c none disables. If used, use as last network command in configuring detector MAC. + */ + descrToFuncMap[i].m_pFuncName="rx_hostname"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + /*! \page network + - rx_udpip [ip] sets/gets the ip address of the receiver UDP interface where the data from the detector will be streamed to. Normally used for single detectors (Can be multi-detector). Used if different from eth0. + */ + descrToFuncMap[i].m_pFuncName="rx_udpip"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - rx_udpmac [mac] sets/gets the mac address of the receiver UDP interface where the data from the detector will be streamed to. Normally used for single detectors (Can be multi-detector). + */ + descrToFuncMap[i].m_pFuncName="rx_udpmac"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - rx_udpport [port] sets/gets the port of the receiver UDP interface where the data from the detector will be streamed to. Use single-detector command. + */ + descrToFuncMap[i].m_pFuncName="rx_udpport"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - rx_udpport2 [port] sets/gets the second port of the receiver UDP interface where the data from the second half of the detector will be streamed to. Use single-detector command. Used for EIGER only. + */ + descrToFuncMap[i].m_pFuncName="rx_udpport2"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - detectormac [mac] sets/gets the mac address of the detector UDP interface from where the detector will stream data. Use single-detector command. Normally unused. + */ + descrToFuncMap[i].m_pFuncName="detectormac"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - detectorip [ip] sets/gets the ip address of the detector UDP interface from where the detector will stream data. Use single-detector command. Keep in same subnet as rx_udpip (if rx_udpip specified). + */ + descrToFuncMap[i].m_pFuncName="detectorip"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - txndelay_left [delay] sets/gets the transmission delay of first packet in an image being streamed out from the detector's left UDP port. Use single-detector command. Used for EIGER only. + */ + descrToFuncMap[i].m_pFuncName="txndelay_left"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - txndelay_right [delay] sets/gets the transmission delay of first packet in an image being streamed out from the detector's right UDP port. Use single-detector command. Used for EIGER only. + */ + descrToFuncMap[i].m_pFuncName="txndelay_right"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - txndelay_frame [delay] sets/gets the transmission frame period of entire frame being streamed out from the detector for both ports. Use single-detector command. Used for EIGER only. + */ + descrToFuncMap[i].m_pFuncName="txndelay_frame"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - flowcontrol_10g [delay] Enables/disables 10 GbE flow control. 1 enables, 0 disables. Used for EIGER only. + */ + descrToFuncMap[i].m_pFuncName="flowcontrol_10g"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - zmqport [port] sets/gets the 0MQ (TCP) port of the receiver from where data is streamed to the client. Use single-detector command to set individually or multi-detector command to calculate based on \c port for the rest. + */ + descrToFuncMap[i].m_pFuncName="zmqport"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; + i++; + + /*! \page network + - configuremac [i] configures the MAC of the detector with these parameters: detectorip, detectormac, rx_udpip, rx_udpmac, rx_udpport, rx_udpport2 (if applicable). Only put! + */ + descrToFuncMap[i].m_pFuncName="configuremac"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfigureMac; + i++; + + /*! \page network + - rx_tcpport [port] sets/gets the port of the client-receiver TCP interface. Use single-detector command. Is different for each detector if same \c rx_hostname used. Must be first command to communicate with receiver. + */ + descrToFuncMap[i].m_pFuncName="rx_tcpport"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPort; + i++; + + /*! \page network + - port [port] sets/gets the port of the client-detector control server TCP interface. Use single-detector command. Default value is 1952 for all detectors. Normally not changed. + */ + descrToFuncMap[i].m_pFuncName="port"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPort; + i++; + + /*! \page network + - stopport [port] sets/gets the port of the client-detector stop server TCP interface. Use single-detector command. Default value is 1953 for all detectors. Normally not changed. + */ + descrToFuncMap[i].m_pFuncName="stopport"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPort; + i++; + + /*! \page config + - lock [i] Locks/Unlocks the detector to communicate with this client. 1 locks, 0 unlocks. + */ + descrToFuncMap[i].m_pFuncName="lock"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLock; + i++; + + /*! \page network + - lastclient Gets the last client communicating with the detector. Cannot put! + */ + descrToFuncMap[i].m_pFuncName="lastclient"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLastClient; + i++; + + + /* detector and data size */ + + /*! \page config + - nmod [i] sets/gets the number of modules of the detector. Used for MYTHEN only. + */ + descrToFuncMap[i].m_pFuncName="nmod"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; + i++; + + /*! \page config + - maxmod Gets the maximum number of modules of the detector. Used for MYTHEN only. Cannot put! + */ + descrToFuncMap[i].m_pFuncName="maxmod"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; + i++; + + /*! \page config + - dr [i] sets/gets the dynamic range of detector. Mythen [4,8,16,24]. Eiger [4,8,16,32]. Others cannot put! + */ + descrToFuncMap[i].m_pFuncName="dr"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; + i++; + + /*! \page config + - roi [i] [xmin] [xmax] [ymin] [ymax] sets region of interest of the detector, where i is number of rois;i=0 to clear rois. Used for GOTTHARD only. + */ + descrToFuncMap[i].m_pFuncName="roi"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; + i++; + + /*! \page config + - detsizechan [xmax] [ymax] sets the maximum number of channels in each dimension for complete detector set; -1 is no limit. Use for multi-detector system as first command in config file. + */ + descrToFuncMap[i].m_pFuncName="detsizechan"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; + i++; + + /*! \page config + - roimask [i] ?? + */ + descrToFuncMap[i].m_pFuncName="roimask"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; + i++; + + /*! \page config + - flippeddatax [i] enables/disables data being flipped across x axis. 1 enables, 0 disables. Used for EIGER only. 1 for bottom half-module, 0 for top-half module. + */ + descrToFuncMap[i].m_pFuncName="flippeddatax"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; + i++; + + /*! \page test + - flippeddatay [i] enables/disables data being flipped across y axis. 1 enables, 0 disables. Not implemented. + */ + descrToFuncMap[i].m_pFuncName="flippeddatay"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; + i++; + + /* flags */ + + /*! \page config + - flags [flag] sets/gets the readout flags to mode. Options: none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, unknown. Used for MYTHEN and EIGER only. + */ + descrToFuncMap[i].m_pFuncName="flags"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; + i++; + + /*! \page config + - extsig:[i] [flag] sets/gets the mode of the external signal i. Options: \c off, \c gate_in_active_high, \c gate_in_active_low, \c trigger_in_rising_edge, \c trigger_in_falling_edge, + \c ro_trigger_in_rising_edge, \c ro_trigger_in_falling_edge, \c gate_out_active_high, \c gate_out_active_low, \c trigger_out_rising_edge, \c trigger_out_falling_edge, \c ro_trigger_out_rising_edge, + \c ro_trigger_out_falling_edge. \n Used in MYTHEN, GOTTHARD, PROPIX only. + */ + descrToFuncMap[i].m_pFuncName="extsig"; /* find command! */ + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; + i++; + + + /* fpga */ + + /*! \page config + - programfpga [file] programs the FPGA with file f (with .pof extension). Used for JUNGFRAU, MOENCH only. Only put! + */ + descrToFuncMap[i].m_pFuncName="programfpga"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; + i++; + + /*! \page config + - resetfpga [f] resets FPGA, where f can be any value. Used for JUNGFRAU only. Only put! + */ + descrToFuncMap[i].m_pFuncName="resetfpga"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; + i++; + + + /* chip */ + + /*! \page config + - powerchip [i] Powers on/off the chip. 1 powers on, 0 powers off. Can also get the power status. Used for JUNGFRAU only. + */ + descrToFuncMap[i].m_pFuncName="powerchip"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; + i++; + + + + /* chip */ + + /*! \page config + - led [i] sets/gets the led status. 1 on, 0 off. Used for MOENCH only ?? + */ + descrToFuncMap[i].m_pFuncName="led"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; + i++; + + + + /* versions/ serial numbers getId */ + + /*! \page config + - moduleversion:[i] Gets the firmware version of module i. Used for MYTHEN only. Only get! + */ + descrToFuncMap[i].m_pFuncName="moduleversion"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; + i++; + + /*! \page config + - detectornumber Gets the serial number or MAC of detector. Only get! + */ + descrToFuncMap[i].m_pFuncName="detectornumber"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; + i++; + + /*! \page config + - modulenumber:[i] Gets the serial number of module i. Used for MYTHEN only. Only get! + */ + descrToFuncMap[i].m_pFuncName="modulenumber"; /* find command! */ + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; + i++; + + /*! \page config + - detectorversion Gets the firmware version of detector. Only get! + */ + descrToFuncMap[i].m_pFuncName="detectorversion"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; + i++; + + /*! \page config + - softwareversion Gets the software version of detector server. Only get! + */ + descrToFuncMap[i].m_pFuncName="softwareversion"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; + i++; + + /*! \page config + - thisversion Gets the software version of this client software. Only get! + */ + descrToFuncMap[i].m_pFuncName="thisversion"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; + i++; + + /*! \page config + - receiverversion Gets the software version of receiver. Only get! + */ + descrToFuncMap[i].m_pFuncName="receiverversion"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; + i++; + + + /* digital test and debugging */ + + /*! \page test + - digitest [i] will perform test which will plot the unique channel identifier, instead of data. Only get! + */ + descrToFuncMap[i].m_pFuncName="digitest"; // /* find command! */ + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDigiTest; + i++; - cmd=string("none"); + /*! \page test + - bustest performs test of the bus interface between FPGA and embedded Linux system. Can last up to a few minutes. Cannot set! Used for Mythen only. Only get! + */ + descrToFuncMap[i].m_pFuncName="bustest"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDigiTest; + i++; - /* Acquisition and status commands */ + /*! \page test + - digibittest:[i] performs digital test of the module i. Returns 0 if succeeded, otherwise error mask. Only put! + */ + descrToFuncMap[i].m_pFuncName="digibittest"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDigiTest; + i++; - descrToFuncMap[i].m_pFuncName="test"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdUnderDevelopment; - i++; + /*! \page test + - reg [addr] [val] ??? writes to an register \c addr with \c value in hexadecimal format. + */ + descrToFuncMap[i].m_pFuncName="reg"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; + i++; + + /*! \page test + - adcreg [addr] [val] ??? writes to an adc register \c addr with \c value in hexadecimal format. Only put! + */ + descrToFuncMap[i].m_pFuncName="adcreg"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; + i++; + + /*! \page test + - setbit ??? Only put! + */ + descrToFuncMap[i].m_pFuncName="setbit"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; + i++; + + /*! \page test + - clearbit ??? Only put! + */ + descrToFuncMap[i].m_pFuncName="clearbit"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; + i++; + + /*! \page test + - getbit ??? Only get! + */ + descrToFuncMap[i].m_pFuncName="getbit"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; + i++; + + + + + + + + + + + /* settings, threshold */ + + /*! \page settings + - settings [s] sets/gets the settings of the detector. Options: \c standard, \c fast, \c highgain, \c dynamicgain, \c lowgain, \c mediumgain, \c veryhighgain, + \c lownoise, \c dynamichg0, \c fixgain1, \c fixgain2, \c forceswitchg1, \c forceswitchg2. + \n In Eiger, only sets in client shared memory. Use \c threshold or \c thresholdnotb to pass to detector. Gets from detector. + */ + descrToFuncMap[i].m_pFuncName="settings"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; + i++; - descrToFuncMap[i].m_pFuncName="acquire"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAcquire; - i++; + /*! \page settings + - settings [s] sets/gets the settings of the detector. Options: \c standard, \c fast, \c highgain, \c dynamicgain, \c lowgain, \c mediumgain, \c veryhighgain, + \c lownoise, \c dynamichg0, \c fixgain1, \c fixgain2, \c forceswitchg1, \c forceswitchg2. + \n In Eiger, only sets in client shared memory. Use \c threshold or \c thresholdnotb to pass to detector + */ + descrToFuncMap[i].m_pFuncName="threshold"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; + i++; - descrToFuncMap[i].m_pFuncName="data"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdData; - i++; + descrToFuncMap[i].m_pFuncName="thresholdnotb"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; + i++; - descrToFuncMap[i].m_pFuncName="frame"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFrame; - i++; + descrToFuncMap[i].m_pFuncName="trimbits"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; + i++; - descrToFuncMap[i].m_pFuncName="status"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus; - i++; + descrToFuncMap[i].m_pFuncName="trim"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; + i++; - descrToFuncMap[i].m_pFuncName="busy"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus; - i++; + descrToFuncMap[i].m_pFuncName="trimval"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; + i++; - descrToFuncMap[i].m_pFuncName="datastream"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDataStream; - i++; + descrToFuncMap[i].m_pFuncName="pedestal"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; + i++; - /* Detector structure configuration and debugging commands */ - descrToFuncMap[i].m_pFuncName="free";//OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFree; - i++; + /* pots */ + descrToFuncMap[i].m_pFuncName="vthreshold"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="add";//OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdd; - i++; + descrToFuncMap[i].m_pFuncName="vcalibration"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="remove";//OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRemove; - i++; + descrToFuncMap[i].m_pFuncName="vtrimbit"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; + descrToFuncMap[i].m_pFuncName="vpreamp"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="type"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdHostname; - i++; + descrToFuncMap[i].m_pFuncName="vshaper1"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="hostname"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdHostname; - i++; + descrToFuncMap[i].m_pFuncName="vshaper2"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="id"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdId; - i++; + descrToFuncMap[i].m_pFuncName="vhighvoltage"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="master"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdMaster; - i++; + descrToFuncMap[i].m_pFuncName="vapower"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="sync"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSync; - i++; + descrToFuncMap[i].m_pFuncName="vddpower"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="help";//OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdHelp; - i++; + descrToFuncMap[i].m_pFuncName="vshpower"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="exitserver";//OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdExitServer; - i++; + descrToFuncMap[i].m_pFuncName="viopower"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="exitreceiver";//OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdExitServer; - i++; + descrToFuncMap[i].m_pFuncName="vref_ds"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; + descrToFuncMap[i].m_pFuncName="vcascn_pb"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - /* data processing commands */ + descrToFuncMap[i].m_pFuncName="vcascp_pb"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - - descrToFuncMap[i].m_pFuncName="flatfield"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFlatField; - i++; + descrToFuncMap[i].m_pFuncName="vout_cm"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="ffdir"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFlatField; - i++; + descrToFuncMap[i].m_pFuncName="vcasc_out"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="ratecorr"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRateCorr; - i++; + descrToFuncMap[i].m_pFuncName="vin_cm"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="badchannels"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdBadChannels; - i++; + descrToFuncMap[i].m_pFuncName="vref_comp"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="angconv"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; - i++; + descrToFuncMap[i].m_pFuncName="ib_test_c"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="globaloff"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; - i++; + descrToFuncMap[i].m_pFuncName="dac0"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="fineoff"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; - i++; + descrToFuncMap[i].m_pFuncName="dac1"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="binsize" ;// - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; - i++; + descrToFuncMap[i].m_pFuncName="dac2"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="angdir" ;// - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; - i++; + descrToFuncMap[i].m_pFuncName="dac3"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; + descrToFuncMap[i].m_pFuncName="dac4"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="moveflag" ;// - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; - i++; - - descrToFuncMap[i].m_pFuncName="samplex" ;// - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; - i++; + descrToFuncMap[i].m_pFuncName="dac5"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; + descrToFuncMap[i].m_pFuncName="dac6"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="sampley" ;// - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAngConv; - i++; + descrToFuncMap[i].m_pFuncName="dac7"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; + descrToFuncMap[i].m_pFuncName="vsvp"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; + descrToFuncMap[i].m_pFuncName="vsvn"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="threaded"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdThreaded; - i++; + descrToFuncMap[i].m_pFuncName="vtr"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="darkimage"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdImage; - i++; + descrToFuncMap[i].m_pFuncName="vrf"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="gainimage"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdImage; - i++; + descrToFuncMap[i].m_pFuncName="vrs"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="readctr"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdCounter; - i++; + descrToFuncMap[i].m_pFuncName="vtgstv"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="resetctr"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdCounter; - i++; + descrToFuncMap[i].m_pFuncName="vcmp_ll"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="resmat"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdCounter; - i++; + descrToFuncMap[i].m_pFuncName="vcmp_lr"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - /* trim/cal directories */ - descrToFuncMap[i].m_pFuncName="trimdir"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettingsDir; - i++; + descrToFuncMap[i].m_pFuncName="vcall"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="settingsdir"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettingsDir; - i++; + descrToFuncMap[i].m_pFuncName="vcmp_rl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="caldir"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdCalDir; - i++; + descrToFuncMap[i].m_pFuncName="vcmp_rr"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="trimen"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTrimEn; - i++; + descrToFuncMap[i].m_pFuncName="rxb_rb"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; + descrToFuncMap[i].m_pFuncName="rxb_lb"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - /* file name */ - descrToFuncMap[i].m_pFuncName="outdir"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOutDir; - i++; + descrToFuncMap[i].m_pFuncName="vcp"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="fname"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFileName; - i++; + descrToFuncMap[i].m_pFuncName="vcn"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="index"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFileIndex; - i++; + descrToFuncMap[i].m_pFuncName="vis"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - - descrToFuncMap[i].m_pFuncName="online"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; - i++; + descrToFuncMap[i].m_pFuncName="iodelay"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="checkonline"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; - i++; - descrToFuncMap[i].m_pFuncName="activate"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; - i++; + descrToFuncMap[i].m_pFuncName="dac"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="enablefwrite"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdEnablefwrite; - i++; - descrToFuncMap[i].m_pFuncName="overwrite"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOverwrite; - i++; - descrToFuncMap[i].m_pFuncName="currentfname"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFileName; - i++; + descrToFuncMap[i].m_pFuncName="adcvpp"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="fileformat"; //OK - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdFileName; - i++; - /* Acquisition actions */ + descrToFuncMap[i].m_pFuncName="v_a"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="positions"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPositions; - i++; + descrToFuncMap[i].m_pFuncName="v_b"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="startscript"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="v_c"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="startscriptpar"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="v_d"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="stopscript"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="v_io"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="stopscriptpar"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="v_chip"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="scriptbefore"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="v_limit"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; + i++; - descrToFuncMap[i].m_pFuncName="scriptbeforepar"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + /* r/w timers */ - descrToFuncMap[i].m_pFuncName="scriptafter"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="temp_adc"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="scriptafterpar"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="temp_fpga"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="headerafter"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="temp_fpgaext"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="headerafterpar"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="temp_10ge"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="encallog"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="temp_dcdc"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="angcallog"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="temp_sodl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; + descrToFuncMap[i].m_pFuncName="temp_sodr"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; + descrToFuncMap[i].m_pFuncName="adc"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; + descrToFuncMap[i].m_pFuncName="temp_fpgafl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; + descrToFuncMap[i].m_pFuncName="temp_fpgafr"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; + descrToFuncMap[i].m_pFuncName="i_a"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="headerbefore"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="i_b"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="headerbeforepar"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScripts; - i++; + descrToFuncMap[i].m_pFuncName="i_c"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="scan0script"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + descrToFuncMap[i].m_pFuncName="i_d"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="scan0par"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + descrToFuncMap[i].m_pFuncName="i_io"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="scan0prec"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + descrToFuncMap[i].m_pFuncName="vm_a"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="scan0steps"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + descrToFuncMap[i].m_pFuncName="vm_b"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="scan0range"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + descrToFuncMap[i].m_pFuncName="vm_c"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="scan1script"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + descrToFuncMap[i].m_pFuncName="vm_d"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="scan1par"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + descrToFuncMap[i].m_pFuncName="vm_io"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; + i++; - descrToFuncMap[i].m_pFuncName="scan1prec"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + /* r/w timers */ - descrToFuncMap[i].m_pFuncName="scan1steps"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + descrToFuncMap[i].m_pFuncName="timing"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTiming; + i++; - descrToFuncMap[i].m_pFuncName="scan1range"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdScans; - i++; + descrToFuncMap[i].m_pFuncName="exptime"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; + descrToFuncMap[i].m_pFuncName="subexptime"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; - /* communication configuration */ + descrToFuncMap[i].m_pFuncName="period"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; - descrToFuncMap[i].m_pFuncName="rx_hostname"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="delay"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; - descrToFuncMap[i].m_pFuncName="rx_udpip"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="gates"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; - descrToFuncMap[i].m_pFuncName="rx_udpmac"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="frames"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; - descrToFuncMap[i].m_pFuncName="rx_udpport"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="cycles"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; - descrToFuncMap[i].m_pFuncName="rx_udpport2"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="probes"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; - descrToFuncMap[i].m_pFuncName="detectormac"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; - descrToFuncMap[i].m_pFuncName="detectorip"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="measurements"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; - descrToFuncMap[i].m_pFuncName="txndelay_left"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="samples"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + i++; - descrToFuncMap[i].m_pFuncName="txndelay_right"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + /* read only timers */ - descrToFuncMap[i].m_pFuncName="txndelay_frame"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="exptimel"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; - descrToFuncMap[i].m_pFuncName="flowcontrol_10g"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="periodl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; - descrToFuncMap[i].m_pFuncName="zmqport"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter; - i++; + descrToFuncMap[i].m_pFuncName="delayl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; + descrToFuncMap[i].m_pFuncName="gatesl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; - descrToFuncMap[i].m_pFuncName="configuremac"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfigureMac; - i++; + descrToFuncMap[i].m_pFuncName="framesl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; - descrToFuncMap[i].m_pFuncName="rx_tcpport"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPort; - i++; + descrToFuncMap[i].m_pFuncName="cyclesl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; - descrToFuncMap[i].m_pFuncName="port"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPort; - i++; + descrToFuncMap[i].m_pFuncName="probesl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; - descrToFuncMap[i].m_pFuncName="stopport"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPort; - i++; + // descrToFuncMap[i].m_pFuncName="progress"; + // descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; + // i++; - descrToFuncMap[i].m_pFuncName="lock"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLock; - i++; + descrToFuncMap[i].m_pFuncName="now"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; - descrToFuncMap[i].m_pFuncName="lastclient"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLastClient; - i++; + descrToFuncMap[i].m_pFuncName="timestamp"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; + descrToFuncMap[i].m_pFuncName="nframes"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; + i++; - /* detector and data size */ - descrToFuncMap[i].m_pFuncName="nmod"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; - i++; + /* speed */ - descrToFuncMap[i].m_pFuncName="maxmod"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; - i++; + descrToFuncMap[i].m_pFuncName="clkdivider"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - descrToFuncMap[i].m_pFuncName="dr"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; - i++; + descrToFuncMap[i].m_pFuncName="setlength"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - descrToFuncMap[i].m_pFuncName="roi"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; - i++; + descrToFuncMap[i].m_pFuncName="waitstates"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - descrToFuncMap[i].m_pFuncName="detsizechan"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; - i++; + descrToFuncMap[i].m_pFuncName="totdivider"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - descrToFuncMap[i].m_pFuncName="roimask"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; - i++; + descrToFuncMap[i].m_pFuncName="totdutycycle"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - descrToFuncMap[i].m_pFuncName="flippeddatax"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; - i++; + descrToFuncMap[i].m_pFuncName="phasestep"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - descrToFuncMap[i].m_pFuncName="flippeddatay"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDetectorSize; - i++; + descrToFuncMap[i].m_pFuncName="oversampling"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - /* flags */ + descrToFuncMap[i].m_pFuncName="adcclk"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - descrToFuncMap[i].m_pFuncName="flags"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; - i++; + descrToFuncMap[i].m_pFuncName="adcphase"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - descrToFuncMap[i].m_pFuncName="extsig"; /* find command! */ - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; - i++; + descrToFuncMap[i].m_pFuncName="adcpipeline"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - /* fpga */ - descrToFuncMap[i].m_pFuncName="programfpga"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; - i++; + descrToFuncMap[i].m_pFuncName="dbitclk"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - descrToFuncMap[i].m_pFuncName="resetfpga"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; - i++; + descrToFuncMap[i].m_pFuncName="dbitphase"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - /* chip */ - descrToFuncMap[i].m_pFuncName="powerchip"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; - i++; + descrToFuncMap[i].m_pFuncName="dbitpipeline"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; + i++; - /* chip */ - descrToFuncMap[i].m_pFuncName="led"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdAdvanced; - i++; + /* settings dump/retrieve */ + descrToFuncMap[i].m_pFuncName="config"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration; + i++; + descrToFuncMap[i].m_pFuncName="rx_printconfig"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration; + i++; + descrToFuncMap[i].m_pFuncName="parameters"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration; + i++; - /* versions/ serial numbers getId */ + descrToFuncMap[i].m_pFuncName="setup"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration; + i++; - descrToFuncMap[i].m_pFuncName="moduleversion"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; - i++; - descrToFuncMap[i].m_pFuncName="detectornumber"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; - i++; + /* receiver functions */ - descrToFuncMap[i].m_pFuncName="modulenumber"; /* find command! */ - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; - i++; + /*! \page receiver Receiver commands + Commands to configure the receiver + */ + descrToFuncMap[i].m_pFuncName="receiver"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; + i++; - descrToFuncMap[i].m_pFuncName="detectorversion"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; - i++; + descrToFuncMap[i].m_pFuncName="r_online"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; + i++; - descrToFuncMap[i].m_pFuncName="softwareversion"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; - i++; + descrToFuncMap[i].m_pFuncName="r_checkonline"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; + i++; - descrToFuncMap[i].m_pFuncName="thisversion"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; - i++; + descrToFuncMap[i].m_pFuncName="framescaught"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; + i++; - descrToFuncMap[i].m_pFuncName="receiverversion"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN; - i++; + descrToFuncMap[i].m_pFuncName="resetframescaught"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; + i++; + descrToFuncMap[i].m_pFuncName="frameindex"; + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; + i++; - /* digital test and debugging */ + descrToFuncMap[i].m_pFuncName="r_lock"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLock; + i++; - descrToFuncMap[i].m_pFuncName="digitest"; // /* find command! */ - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDigiTest; - i++; + descrToFuncMap[i].m_pFuncName="r_lastclient"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLastClient; + i++; - descrToFuncMap[i].m_pFuncName="bustest"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDigiTest; - i++; + descrToFuncMap[i].m_pFuncName="r_readfreq"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; + i++; - descrToFuncMap[i].m_pFuncName="digibittest"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDigiTest; - i++; + descrToFuncMap[i].m_pFuncName="r_compression"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; + i++; - descrToFuncMap[i].m_pFuncName="reg"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; - i++; + descrToFuncMap[i].m_pFuncName="tengiga"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; + i++; - descrToFuncMap[i].m_pFuncName="adcreg"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; - i++; + descrToFuncMap[i].m_pFuncName="rx_fifodepth"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; + i++; - descrToFuncMap[i].m_pFuncName="setbit"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; - i++; + /* pattern generator */ - descrToFuncMap[i].m_pFuncName="clearbit"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; - i++; - descrToFuncMap[i].m_pFuncName="getbit"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdRegister; - i++; + descrToFuncMap[i].m_pFuncName="adcinvert"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; + descrToFuncMap[i].m_pFuncName="adcdisable"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; + descrToFuncMap[i].m_pFuncName="pattern"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; + descrToFuncMap[i].m_pFuncName="patword"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; + descrToFuncMap[i].m_pFuncName="patioctrl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; + descrToFuncMap[i].m_pFuncName="patclkctrl"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - /* settings, threshold */ + descrToFuncMap[i].m_pFuncName="patlimits"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="settings"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; - i++; + descrToFuncMap[i].m_pFuncName="patloop0"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="threshold"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; - i++; - descrToFuncMap[i].m_pFuncName="thresholdnotb"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; - i++; + descrToFuncMap[i].m_pFuncName="patnloop0"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="trimbits"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; - i++; - descrToFuncMap[i].m_pFuncName="trim"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; - i++; + descrToFuncMap[i].m_pFuncName="patwait0"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="trimval"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; - i++; - descrToFuncMap[i].m_pFuncName="pedestal"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSettings; - i++; + descrToFuncMap[i].m_pFuncName="patwaittime0"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; + descrToFuncMap[i].m_pFuncName="patloop1"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - /* pots */ - descrToFuncMap[i].m_pFuncName="vthreshold"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="patnloop1"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="vcalibration"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - descrToFuncMap[i].m_pFuncName="vtrimbit"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="patwait1"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="vpreamp"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - descrToFuncMap[i].m_pFuncName="vshaper1"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="patwaittime1"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="vshaper2"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - descrToFuncMap[i].m_pFuncName="vhighvoltage"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="patloop2"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="vapower"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - descrToFuncMap[i].m_pFuncName="vddpower"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="patnloop2"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="vshpower"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - descrToFuncMap[i].m_pFuncName="viopower"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="patwait2"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="vref_ds"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - descrToFuncMap[i].m_pFuncName="vcascn_pb"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="patwaittime2"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="vcascp_pb"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - descrToFuncMap[i].m_pFuncName="vout_cm"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="dut_clk"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; + i++; - descrToFuncMap[i].m_pFuncName="vcasc_out"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - descrToFuncMap[i].m_pFuncName="vin_cm"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + /* pulse */ - descrToFuncMap[i].m_pFuncName="vref_comp"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="pulse"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPulse; + i++; - descrToFuncMap[i].m_pFuncName="ib_test_c"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="pulsenmove"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPulse; + i++; - descrToFuncMap[i].m_pFuncName="dac0"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + descrToFuncMap[i].m_pFuncName="pulsechip"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPulse; + i++; - descrToFuncMap[i].m_pFuncName="dac1"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - descrToFuncMap[i].m_pFuncName="dac2"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; + numberOfCommands=i; - descrToFuncMap[i].m_pFuncName="dac3"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="dac4"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="dac5"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="dac6"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="dac7"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vsvp"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vsvn"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vtr"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vrf"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vrs"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vtgstv"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vcmp_ll"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vcmp_lr"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vcall"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vcmp_rl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vcmp_rr"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="rxb_rb"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="rxb_lb"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vcp"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vcn"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="vis"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="iodelay"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - - descrToFuncMap[i].m_pFuncName="dac"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - - - descrToFuncMap[i].m_pFuncName="adcvpp"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - - descrToFuncMap[i].m_pFuncName="v_a"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="v_b"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="v_c"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="v_d"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="v_io"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="v_chip"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - descrToFuncMap[i].m_pFuncName="v_limit"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC; - i++; - - /* r/w timers */ - - descrToFuncMap[i].m_pFuncName="temp_adc"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="temp_fpga"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="temp_fpgaext"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="temp_10ge"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="temp_dcdc"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="temp_sodl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="temp_sodr"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - - descrToFuncMap[i].m_pFuncName="adc"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="temp_fpgafl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="temp_fpgafr"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - - descrToFuncMap[i].m_pFuncName="i_a"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="i_b"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="i_c"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="i_d"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="i_io"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="vm_a"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="vm_b"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="vm_c"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="vm_d"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - descrToFuncMap[i].m_pFuncName="vm_io"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; - i++; - - /* r/w timers */ - - descrToFuncMap[i].m_pFuncName="timing"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTiming; - i++; - - descrToFuncMap[i].m_pFuncName="exptime"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - descrToFuncMap[i].m_pFuncName="subexptime"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - descrToFuncMap[i].m_pFuncName="period"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - descrToFuncMap[i].m_pFuncName="delay"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - descrToFuncMap[i].m_pFuncName="gates"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - descrToFuncMap[i].m_pFuncName="frames"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - descrToFuncMap[i].m_pFuncName="cycles"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - descrToFuncMap[i].m_pFuncName="probes"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - - descrToFuncMap[i].m_pFuncName="measurements"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - descrToFuncMap[i].m_pFuncName="samples"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - i++; - - /* read only timers */ - - descrToFuncMap[i].m_pFuncName="exptimel"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - descrToFuncMap[i].m_pFuncName="periodl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - descrToFuncMap[i].m_pFuncName="delayl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - descrToFuncMap[i].m_pFuncName="gatesl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - descrToFuncMap[i].m_pFuncName="framesl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - descrToFuncMap[i].m_pFuncName="cyclesl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - descrToFuncMap[i].m_pFuncName="probesl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - // descrToFuncMap[i].m_pFuncName="progress"; - // descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimer; - // i++; - - descrToFuncMap[i].m_pFuncName="now"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - descrToFuncMap[i].m_pFuncName="timestamp"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - descrToFuncMap[i].m_pFuncName="nframes"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdTimeLeft; - i++; - - /* speed */ - - descrToFuncMap[i].m_pFuncName="clkdivider"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - descrToFuncMap[i].m_pFuncName="setlength"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - descrToFuncMap[i].m_pFuncName="waitstates"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - descrToFuncMap[i].m_pFuncName="totdivider"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - descrToFuncMap[i].m_pFuncName="totdutycycle"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - descrToFuncMap[i].m_pFuncName="phasestep"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - descrToFuncMap[i].m_pFuncName="oversampling"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - descrToFuncMap[i].m_pFuncName="adcclk"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - descrToFuncMap[i].m_pFuncName="adcphase"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - - descrToFuncMap[i].m_pFuncName="adcpipeline"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - - descrToFuncMap[i].m_pFuncName="dbitclk"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - descrToFuncMap[i].m_pFuncName="dbitphase"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - - descrToFuncMap[i].m_pFuncName="dbitpipeline"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; - i++; - - - - /* settings dump/retrieve */ - descrToFuncMap[i].m_pFuncName="config"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration; - i++; - - descrToFuncMap[i].m_pFuncName="rx_printconfig"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration; - i++; - - descrToFuncMap[i].m_pFuncName="parameters"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration; - i++; - - descrToFuncMap[i].m_pFuncName="setup"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration; - i++; - - - /* receiver functions */ - descrToFuncMap[i].m_pFuncName="receiver"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; - i++; - - descrToFuncMap[i].m_pFuncName="r_online"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; - i++; - - descrToFuncMap[i].m_pFuncName="r_checkonline"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdOnline; - i++; - - descrToFuncMap[i].m_pFuncName="framescaught"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; - i++; - - descrToFuncMap[i].m_pFuncName="resetframescaught"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; - i++; - - descrToFuncMap[i].m_pFuncName="frameindex"; - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; - i++; - - descrToFuncMap[i].m_pFuncName="r_lock"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLock; - i++; - - descrToFuncMap[i].m_pFuncName="r_lastclient"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLastClient; - i++; - - descrToFuncMap[i].m_pFuncName="r_readfreq"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; - i++; - - descrToFuncMap[i].m_pFuncName="r_compression"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; - i++; - - descrToFuncMap[i].m_pFuncName="tengiga"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; - i++; - - descrToFuncMap[i].m_pFuncName="rx_fifodepth"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; - i++; - - /* pattern generator */ - - - descrToFuncMap[i].m_pFuncName="adcinvert"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - descrToFuncMap[i].m_pFuncName="adcdisable"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - descrToFuncMap[i].m_pFuncName="pattern"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patword"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patioctrl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patclkctrl"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patlimits"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - descrToFuncMap[i].m_pFuncName="patloop0"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patnloop0"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patwait0"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patwaittime0"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patloop1"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patnloop1"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patwait1"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patwaittime1"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patloop2"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patnloop2"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patwait2"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="patwaittime2"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - descrToFuncMap[i].m_pFuncName="dut_clk"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPattern; - i++; - - - /* pulse */ - - descrToFuncMap[i].m_pFuncName="pulse"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPulse; - i++; - - descrToFuncMap[i].m_pFuncName="pulsenmove"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPulse; - i++; - - descrToFuncMap[i].m_pFuncName="pulsechip"; // - descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdPulse; - i++; - - - numberOfCommands=i; - - // #ifdef VERBOSE - // cout << "Number of commands is " << numberOfCommands << endl; - // #endif + // #ifdef VERBOSE + // cout << "Number of commands is " << numberOfCommands << endl; + // #endif } +//----------------------------------------------------------- + +/*! + */ + +//----------------------------------------------------------- string slsDetectorCommand::executeLine(int narg, char *args[], int action) { - - if (action==READOUT_ACTION) - return cmdAcquire(narg, args, action); + + if (action==READOUT_ACTION) + return cmdAcquire(narg, args, action); - size_t s=string(args[0]).find(':'); - string key=string(args[0]).substr(0,s); // truncate at : + size_t s=string(args[0]).find(':'); + string key=string(args[0]).substr(0,s); // truncate at : - if (action==PUT_ACTION && narg<1) - action=HELP_ACTION; + if (action==PUT_ACTION && narg<1) + action=HELP_ACTION; - for(int i=0; isetReceiverOnline()==ONLINE_FLAG){ char answer[100]; - sprintf(answer,"\nAcquired %d",myDet->getFramesCaughtByReceiver()); - return string(answer); + sprintf(answer,"\nAcquired %d",myDet->getFramesCaughtByReceiver()); + return string(answer); } return string(""); @@ -1358,134 +1841,134 @@ string slsDetectorCommand::cmdAcquire(int narg, char *args[], int action) { string slsDetectorCommand::helpAcquire(int narg, char *args[], int action){ - - - if (action==PUT_ACTION) - return string(""); - ostringstream os; - os << "Usage is "<< std::endl << "sls_detector_acquire id " << std::endl; - os << "where id is the id of the detector " << std::endl; - os << "the detector will be started, the data acquired, processed and written to file according to the preferences configured " << std::endl; - return os.str(); + + + if (action==PUT_ACTION) + return string(""); + ostringstream os; + os << "Usage is "<< std::endl << "sls_detector_acquire id " << std::endl; + os << "where id is the id of the detector " << std::endl; + os << "the detector will be started, the data acquired, processed and written to file according to the preferences configured " << std::endl; + return os.str(); } - + string slsDetectorCommand::cmdData(int narg, char *args[], int action) { - + #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - int b; - if (action==PUT_ACTION) { - return string("cannot set"); - } else if (action==HELP_ACTION) { - return helpData(narg,args,HELP_ACTION); - } else { - b=myDet->setThreadedProcessing(-1); - myDet->setThreadedProcessing(0); - myDet->setOnline(ONLINE_FLAG); - myDet->setReceiverOnline(ONLINE_FLAG); - myDet->readAll(); - //processdata in receiver is useful only for gui purposes - if(myDet->setReceiverOnline()==OFFLINE_FLAG) - myDet->processData(1); - myDet->setThreadedProcessing(b); - return string(""); - } + int b; + if (action==PUT_ACTION) { + return string("cannot set"); + } else if (action==HELP_ACTION) { + return helpData(narg,args,HELP_ACTION); + } else { + b=myDet->setThreadedProcessing(-1); + myDet->setThreadedProcessing(0); + myDet->setOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); + myDet->readAll(); + //processdata in receiver is useful only for gui purposes + if(myDet->setReceiverOnline()==OFFLINE_FLAG) + myDet->processData(1); + myDet->setThreadedProcessing(b); + return string(""); + } } string slsDetectorCommand::helpData(int narg, char *args[], int action){ - if (action==PUT_ACTION) - return string(""); - else - return string("data \t gets all data from the detector (if any) processes them and writes them to file according to the preferences already setup\n"); + if (action==PUT_ACTION) + return string(""); + else + return string("data \t gets all data from the detector (if any) processes them and writes them to file according to the preferences already setup\n"); } string slsDetectorCommand::cmdFrame(int narg, char *args[], int action) { - int b; + int b; #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - if (action==PUT_ACTION) { - return string("cannot set"); - } else if (action==HELP_ACTION) { - return helpFrame(narg,args,HELP_ACTION); - } else { - b=myDet->setThreadedProcessing(-1); - myDet->setThreadedProcessing(0); - myDet->setOnline(ONLINE_FLAG); - myDet->setReceiverOnline(ONLINE_FLAG); - myDet->readFrame(); - //processdata in receiver is useful only for gui purposes - if(myDet->setReceiverOnline()==OFFLINE_FLAG) - myDet->processData(1); - myDet->setThreadedProcessing(b); - return string("ok"); - } + if (action==PUT_ACTION) { + return string("cannot set"); + } else if (action==HELP_ACTION) { + return helpFrame(narg,args,HELP_ACTION); + } else { + b=myDet->setThreadedProcessing(-1); + myDet->setThreadedProcessing(0); + myDet->setOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); + myDet->readFrame(); + //processdata in receiver is useful only for gui purposes + if(myDet->setReceiverOnline()==OFFLINE_FLAG) + myDet->processData(1); + myDet->setThreadedProcessing(b); + return string("ok"); + } } string slsDetectorCommand::helpFrame(int narg, char *args[], int action) { - - if (action==PUT_ACTION) - return string(""); - return string("frame \t gets a single frame from the detector (if any) processes it and writes it to file according to the preferences already setup\n"); - + + if (action==PUT_ACTION) + return string(""); + return string("frame \t gets a single frame from the detector (if any) processes it and writes it to file according to the preferences already setup\n"); + } string slsDetectorCommand::cmdStatus(int narg, char *args[], int action) { #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - if (action==HELP_ACTION) - return helpStatus(narg,args,action); + if (action==HELP_ACTION) + return helpStatus(narg,args,action); - if (cmd=="status") { - myDet->setOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - //myDet->setThreadedProcessing(0); - if (string(args[1])=="start") - myDet->startAcquisition(); - else if (string(args[1])=="stop") - myDet->stopAcquisition(); - else - return string("unknown action"); - } - runStatus s=myDet->getRunStatus(); - return myDet->runStatusType(s); - } - else if (cmd=="busy") { - if (action==PUT_ACTION) { - return string ("cannot put"); - } - char answer[100]; - sprintf(answer,"%d", myDet->getAcquiringFlag()); - return string(answer); - } - else return string("cannot scan command ")+string(cmd); + if (cmd=="status") { + myDet->setOnline(ONLINE_FLAG); + if (action==PUT_ACTION) { + //myDet->setThreadedProcessing(0); + if (string(args[1])=="start") + myDet->startAcquisition(); + else if (string(args[1])=="stop") + myDet->stopAcquisition(); + else + return string("unknown action"); + } + runStatus s=myDet->getRunStatus(); + return myDet->runStatusType(s); + } + else if (cmd=="busy") { + if (action==PUT_ACTION) { + return string ("cannot put"); + } + char answer[100]; + sprintf(answer,"%d", myDet->getAcquiringFlag()); + return string(answer); + } + else return string("cannot scan command ")+string(cmd); } string slsDetectorCommand::helpStatus(int narg, char *args[], int action) { - - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) { - os << string("status \t gets the detector status - can be: running, error, transmitting, finished, waiting or idle\n"); - os << string("busy \t gets the status of acquire- can be: 0 or 1. 0 for idle, 1 for running\n"); - } - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("status \t controls the detector acquisition - can be start or stop \n"); - return os.str(); + + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) { + os << string("status \t gets the detector status - can be: running, error, transmitting, finished, waiting or idle\n"); + os << string("busy \t gets the status of acquire- can be: 0 or 1. 0 for idle, 1 for running\n"); + } + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("status \t controls the detector acquisition - can be start or stop \n"); + return os.str(); } @@ -1493,192 +1976,192 @@ string slsDetectorCommand::helpStatus(int narg, char *args[], int action) { string slsDetectorCommand::cmdDataStream(int narg, char *args[], int action) { #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - int ival=-1; - char ans[100]=""; + int ival=-1; + char ans[100]=""; - myDet->setOnline(ONLINE_FLAG); - myDet->setReceiverOnline(ONLINE_FLAG); + myDet->setOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); - if (action==HELP_ACTION) - return helpStatus(narg,args,HELP_ACTION); + if (action==HELP_ACTION) + return helpStatus(narg,args,HELP_ACTION); - if (action==PUT_ACTION) { - if (!sscanf(args[1],"%d",&ival)) - return string ("cannot scan datastream mode"); - myDet->enableDataStreamingFromReceiver(ival); - } - sprintf(ans,"%d",myDet->enableDataStreamingFromReceiver()); - return string(ans); + if (action==PUT_ACTION) { + if (!sscanf(args[1],"%d",&ival)) + return string ("cannot scan datastream mode"); + myDet->enableDataStreamingFromReceiver(ival); + } + sprintf(ans,"%d",myDet->enableDataStreamingFromReceiver()); + return string(ans); } string slsDetectorCommand::helpDataStream(int narg, char *args[], int action) { - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("datastream \t gets if zmq data stream from receiver is enabled. \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("datastream i\t enables/disables the zmq data stream from receiver. \n"); - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("datastream \t gets if zmq data stream from receiver is enabled. \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("datastream i\t enables/disables the zmq data stream from receiver. \n"); + return os.str(); } string slsDetectorCommand::cmdFree(int narg, char *args[], int action) { - + #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - if (action==HELP_ACTION) { - return helpFree(narg,args,HELP_ACTION); - } - myDet->freeSharedMemory(); - return("freed"); + if (action==HELP_ACTION) { + return helpFree(narg,args,HELP_ACTION); + } + myDet->freeSharedMemory(); + return("freed"); } string slsDetectorCommand::helpFree(int narg, char *args[], int action) { - return string("free \t frees the shared memory\n"); + return string("free \t frees the shared memory\n"); } - + string slsDetectorCommand::cmdAdd(int narg, char *args[], int action) { #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - int ivar, ival; - string var=string(args[0]); - ostringstream os; - if (action==HELP_ACTION) { - return helpAdd(narg,args,HELP_ACTION); - } else if (action==PUT_ACTION) { - size_t p=string(args[0]).find(':'); - if (p==string::npos) - ivar=-1; - else { - istringstream vvstr(var.substr(p+1)); - vvstr >> ivar; - if (vvstr.fail()) - ivar=-1; //append at the end - } + int ivar, ival; + string var=string(args[0]); + ostringstream os; + if (action==HELP_ACTION) { + return helpAdd(narg,args,HELP_ACTION); + } else if (action==PUT_ACTION) { + size_t p=string(args[0]).find(':'); + if (p==string::npos) + ivar=-1; + else { + istringstream vvstr(var.substr(p+1)); + vvstr >> ivar; + if (vvstr.fail()) + ivar=-1; //append at the end + } - if (sscanf(args[1],"%d",&ival)) { - // add by detector id - os<< myDet->addSlsDetector(ival, ivar)<< endl;; - } else { - //add by hostname - os<< myDet->addSlsDetector(args[1], ivar)<< endl; - } - return os.str(); - } - return string("cannot get"); + if (sscanf(args[1],"%d",&ival)) { + // add by detector id + os<< myDet->addSlsDetector(ival, ivar)<< endl;; + } else { + //add by hostname + os<< myDet->addSlsDetector(args[1], ivar)<< endl; + } + return os.str(); + } + return string("cannot get"); } string slsDetectorCommand::helpAdd(int narg, char *args[], int action){ - return string("add[:i] det \t adds a detector in position i to the multi detector structure. i is the detector position, default is appended. det can either be the detector hostname or the detector id. Returns -1 if it fails or the total number of detectors in the multidetector structure\n"); + return string("add[:i] det \t adds a detector in position i to the multi detector structure. i is the detector position, default is appended. det can either be the detector hostname or the detector id. Returns -1 if it fails or the total number of detectors in the multidetector structure\n"); } string slsDetectorCommand::cmdRemove(int narg, char *args[], int action){ #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - - - ostringstream os; - int ival;//ivar, - string var=string(args[0]); - - if (action==HELP_ACTION) { - return helpRemove(narg,args,HELP_ACTION); - } else if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&ival)) { - // remove detector in position ival - os << myDet->removeSlsDetector(ival); - } else { - // remove detector by hostname - os<< myDet->removeSlsDetector(args[1]); - } - return os.str(); - } - return string("cannot get"); + + + ostringstream os; + int ival;//ivar, + string var=string(args[0]); + + if (action==HELP_ACTION) { + return helpRemove(narg,args,HELP_ACTION); + } else if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&ival)) { + // remove detector in position ival + os << myDet->removeSlsDetector(ival); + } else { + // remove detector by hostname + os<< myDet->removeSlsDetector(args[1]); + } + return os.str(); + } + return string("cannot get"); } string slsDetectorCommand::helpRemove(int narg, char *args[], int action){ - return string("remove det \t removes a detector. det can either be the detector hostname or the detector position. Returns the total number of detectors in the multidetector structure\n"); + return string("remove det \t removes a detector. det can either be the detector hostname or the detector position. Returns the total number of detectors in the multidetector structure\n"); } string slsDetectorCommand::cmdHostname(int narg, char *args[], int action){ #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - if (action==HELP_ACTION) { - return helpHostname(narg,args,HELP_ACTION); - } + if (action==HELP_ACTION) { + return helpHostname(narg,args,HELP_ACTION); + } - ostringstream os; - int ivar=-1;//, ival; - string var=string(args[0]); - char hostname[1000]; - + ostringstream os; + int ivar=-1;//, ival; + string var=string(args[0]); + char hostname[1000]; - size_t p=string(args[0]).find(':'); - if (p==string::npos) - ivar=-1; - else { - istringstream vvstr(var.substr(p+1)); - vvstr >> ivar; - if (vvstr.fail()) - ivar=-1; - } + + size_t p=string(args[0]).find(':'); + if (p==string::npos) + ivar=-1; + else { + istringstream vvstr(var.substr(p+1)); + vvstr >> ivar; + if (vvstr.fail()) + ivar=-1; + } - p=string(args[0]).find("hostname"); - - if (p==string::npos) { - //type - // cout << "should add by type!" << endl; - - if (action==PUT_ACTION) { - //add by type - if (ivar==-1) { - strcpy(hostname,""); - for (int id=1; id2) - strcat(hostname,"+"); - } - } else - strcpy(hostname,args[1]); + p=string(args[0]).find("hostname"); - myDet->ssetDetectorsType(hostname, ivar); - } - return myDet->sgetDetectorsType(ivar); - } else { - if (action==PUT_ACTION) { - //add by hostname - if (ivar==-1) { - strcpy(hostname,""); - for (int id=1; id2) - strcat(hostname,"+"); - } - } else - strcpy(hostname,args[1]); - myDet->setHostname(hostname, ivar); - } - - return string(myDet->getHostname(ivar)); - } + if (p==string::npos) { + //type + // cout << "should add by type!" << endl; + + if (action==PUT_ACTION) { + //add by type + if (ivar==-1) { + strcpy(hostname,""); + for (int id=1; id2) + strcat(hostname,"+"); + } + } else + strcpy(hostname,args[1]); + + myDet->ssetDetectorsType(hostname, ivar); + } + return myDet->sgetDetectorsType(ivar); + } else { + if (action==PUT_ACTION) { + //add by hostname + if (ivar==-1) { + strcpy(hostname,""); + for (int id=1; id2) + strcat(hostname,"+"); + } + } else + strcpy(hostname,args[1]); + myDet->setHostname(hostname, ivar); + } + + return string(myDet->getHostname(ivar)); + } } @@ -1686,287 +2169,287 @@ string slsDetectorCommand::cmdHostname(int narg, char *args[], int action){ string slsDetectorCommand::helpHostname(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("hostname[:i] \t returns the hostname(s) of the detector structure. i is the detector position in a multi detector system\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("hostname[:i] name [name name]\t configures the hostnames of the detector structure. i is the detector position in a multi detector system\n"); - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("hostname[:i] \t returns the hostname(s) of the detector structure. i is the detector position in a multi detector system\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("hostname[:i] name [name name]\t configures the hostnames of the detector structure. i is the detector position in a multi detector system\n"); + return os.str(); } string slsDetectorCommand::cmdId(int narg, char *args[], int action){ #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - if (action==HELP_ACTION) { - return helpId(narg,args,HELP_ACTION); - } + if (action==HELP_ACTION) { + return helpId(narg,args,HELP_ACTION); + } - ostringstream os; - int ivar, ival; - string var=string(args[0]); - // char answer[1000]; - + ostringstream os; + int ivar, ival; + string var=string(args[0]); + // char answer[1000]; - size_t p=string(args[0]).find(':'); - if (p==string::npos) - ivar=-1; - else { - istringstream vvstr(var.substr(p+1)); - vvstr >> ivar; - if (vvstr.fail()) - ivar=-1; - } - - if (action==PUT_ACTION) { - //add by hostname - istringstream vvstr(args[1]); - - vvstr >> ival; - if (vvstr.fail()) - ival=-1; - myDet->setDetectorId(ival, ivar); - } - os << myDet->getDetectorId(ivar); + size_t p=string(args[0]).find(':'); + if (p==string::npos) + ivar=-1; + else { + istringstream vvstr(var.substr(p+1)); + vvstr >> ivar; + if (vvstr.fail()) + ivar=-1; + } - return os.str(); + if (action==PUT_ACTION) { + //add by hostname + istringstream vvstr(args[1]); + + vvstr >> ival; + if (vvstr.fail()) + ival=-1; + + myDet->setDetectorId(ival, ivar); + } + os << myDet->getDetectorId(ivar); + + return os.str(); } string slsDetectorCommand::helpId(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("id[:i] \t returns the id of the detector structure. i is the detector position in a multi detector system\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("id:i l]\t configures the id of the detector structure. i is the detector position in a multi detector system and l is the id of the detector to be added\n"); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("id[:i] \t returns the id of the detector structure. i is the detector position in a multi detector system\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("id:i l]\t configures the id of the detector structure. i is the detector position in a multi detector system and l is the id of the detector to be added\n"); - return os.str(); + return os.str(); } string slsDetectorCommand::cmdMaster(int narg, char *args[], int action){ #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - ostringstream os; - int ival; + ostringstream os; + int ival; - if (action==HELP_ACTION) { - return helpMaster(narg,args,HELP_ACTION); - } - myDet->setOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - istringstream vvstr(args[1]); - vvstr >> ival; - if (vvstr.fail()) - return helpMaster(narg,args,HELP_ACTION); - myDet->setMaster(ival); - } - os << myDet->setMaster(); - return os.str(); - + if (action==HELP_ACTION) { + return helpMaster(narg,args,HELP_ACTION); + } + myDet->setOnline(ONLINE_FLAG); + if (action==PUT_ACTION) { + istringstream vvstr(args[1]); + vvstr >> ival; + if (vvstr.fail()) + return helpMaster(narg,args,HELP_ACTION); + myDet->setMaster(ival); + } + os << myDet->setMaster(); + return os.str(); + } string slsDetectorCommand::helpMaster(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("master \t gets the master of the detector structure (-1 if none)\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("master pos \t sets position of the master of the detector structure (-1 if none) \n"); - return os.str(); - + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("master \t gets the master of the detector structure (-1 if none)\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("master pos \t sets position of the master of the detector structure (-1 if none) \n"); + return os.str(); + } string slsDetectorCommand::cmdSync(int narg, char *args[], int action){ #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - if (action==HELP_ACTION) { - return helpSync(narg,args,HELP_ACTION); - } - myDet->setOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - if (myDet->getSyncType(string(args[1]))==GET_SYNCHRONIZATION_MODE) return helpSync(narg,args, action); - myDet->setSynchronization(myDet->getSyncType(string(args[1]))); - } - return myDet->getSyncType(myDet->setSynchronization()); + if (action==HELP_ACTION) { + return helpSync(narg,args,HELP_ACTION); + } + myDet->setOnline(ONLINE_FLAG); + if (action==PUT_ACTION) { + if (myDet->getSyncType(string(args[1]))==GET_SYNCHRONIZATION_MODE) return helpSync(narg,args, action); + myDet->setSynchronization(myDet->getSyncType(string(args[1]))); + } + return myDet->getSyncType(myDet->setSynchronization()); } string slsDetectorCommand::helpSync(int narg, char *args[], int action){ - - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("sync \t gets the synchronization mode of the structure\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("sync mode \t sets synchronization mode of the structure. Cane be none, gating, trigger, complementary \n"); - return os.str(); + + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("sync \t gets the synchronization mode of the structure\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("sync mode \t sets synchronization mode of the structure. Cane be none, gating, trigger, complementary \n"); + return os.str(); } string slsDetectorCommand::cmdHelp(int narg, char *args[], int action){ #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - cout << narg << endl; + cout << narg << endl; + + if (narg>=1) + return helpLine(narg-1, args+1, action); + else + return helpLine(0, args, action); - if (narg>=1) - return helpLine(narg-1, args+1, action); - else - return helpLine(0, args, action); - } string slsDetectorCommand::cmdExitServer(int narg, char *args[], int action){ #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - if (action==HELP_ACTION) { - return helpExitServer(narg, args, action); - } + if (action==HELP_ACTION) { + return helpExitServer(narg, args, action); + } - if (action==PUT_ACTION) { - if (cmd=="exitserver"){ - myDet->setOnline(ONLINE_FLAG); - if (myDet->exitServer()!=OK) - return string("Server shut down."); - else - return string("Error closing server\n"); - } - else if (cmd=="exitreceiver"){ - myDet->setReceiverOnline(ONLINE_FLAG); - if(myDet->exitReceiver()!=OK) - return string("Receiver shut down\n"); - else - return string("Error closing receiver\n"); - } - else return("cannot decode command\n"); - } else - return ("cannot get"); + if (action==PUT_ACTION) { + if (cmd=="exitserver"){ + myDet->setOnline(ONLINE_FLAG); + if (myDet->exitServer()!=OK) + return string("Server shut down."); + else + return string("Error closing server\n"); + } + else if (cmd=="exitreceiver"){ + myDet->setReceiverOnline(ONLINE_FLAG); + if(myDet->exitReceiver()!=OK) + return string("Receiver shut down\n"); + else + return string("Error closing receiver\n"); + } + else return("cannot decode command\n"); + } else + return ("cannot get"); } string slsDetectorCommand::helpExitServer(int narg, char *args[], int action){ - ostringstream os; - os << string("exitserver \t shuts down all the detector servers. Don't use it!!!!\n"); - os << string("exitreceiver \t shuts down all the receiver servers.\n"); - return os.str(); + ostringstream os; + os << string("exitserver \t shuts down all the detector servers. Don't use it!!!!\n"); + os << string("exitreceiver \t shuts down all the receiver servers.\n"); + return os.str(); } string slsDetectorCommand::cmdSettingsDir(int narg, char *args[], int action){ #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - if (action==HELP_ACTION) { - return helpSettingsDir(narg, args, action); - } - if (action==PUT_ACTION) { - myDet->setSettingsDir(string(args[1])); - } - if (myDet->getSettingsDir()==NULL) - return string("undefined"); - return string(myDet->getSettingsDir()); + if (action==HELP_ACTION) { + return helpSettingsDir(narg, args, action); + } + if (action==PUT_ACTION) { + myDet->setSettingsDir(string(args[1])); + } + if (myDet->getSettingsDir()==NULL) + return string("undefined"); + return string(myDet->getSettingsDir()); } string slsDetectorCommand::helpSettingsDir(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("settingsdir \t gets the directory where the settings files are located\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("settingsdir dir \t sets the directory where the settings files are located\n"); - if (action==GET_ACTION || action==HELP_ACTION) - os << string("trimdir \t obsolete for settingsdir\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("trimdir dir \t obsolete for settingsdir\n"); - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("settingsdir \t gets the directory where the settings files are located\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("settingsdir dir \t sets the directory where the settings files are located\n"); + if (action==GET_ACTION || action==HELP_ACTION) + os << string("trimdir \t obsolete for settingsdir\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("trimdir dir \t obsolete for settingsdir\n"); + return os.str(); } string slsDetectorCommand::cmdCalDir(int narg, char *args[], int action){ - if (action==HELP_ACTION) { - return helpCalDir(narg, args, action); - } - if (action==PUT_ACTION) { - myDet->setCalDir(string(args[1])); - } - if (myDet->getCalDir()==NULL) - return string("undefined"); - return string(myDet->getCalDir()); + if (action==HELP_ACTION) { + return helpCalDir(narg, args, action); + } + if (action==PUT_ACTION) { + myDet->setCalDir(string(args[1])); + } + if (myDet->getCalDir()==NULL) + return string("undefined"); + return string(myDet->getCalDir()); } string slsDetectorCommand::helpCalDir(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("caldir \t gets the directory where the calibration files are located\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("caldir dir \t sets the directory where the calibration files are located\n"); - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("caldir \t gets the directory where the calibration files are located\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("caldir dir \t sets the directory where the calibration files are located\n"); + return os.str(); } string slsDetectorCommand::cmdTrimEn(int narg, char *args[], int action){ - int ival; - int ip; + int ival; + int ip; - char answer[1000]; + char answer[1000]; - if (action==HELP_ACTION) return helpTrimEn(narg,args,action); + if (action==HELP_ACTION) return helpTrimEn(narg,args,action); - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&ival)) { - int pos[ival]; - for (ip=0; ipsetTrimEn(ip,pos); + } } - } - myDet->setTrimEn(ip,pos); - } - } - int npos=myDet->getTrimEn(); - sprintf(answer,"%d",npos); - int opos[npos]; - myDet->getTrimEn(opos); - for (int ip=0; ipgetTrimEn(); + sprintf(answer,"%d",npos); + int opos[npos]; + myDet->getTrimEn(opos); + for (int ip=0; ipsetReceiverOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); if (action==HELP_ACTION) return helpOutDir(narg, args, action); @@ -1979,120 +2462,120 @@ string slsDetectorCommand::cmdOutDir(int narg, char *args[], int action){ string slsDetectorCommand::helpOutDir(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("outdir \t gets the directory where the output files will be written\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("outdir dir \t sets the directory where the output files will be written\n"); - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("outdir \t gets the directory where the output files will be written\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("outdir dir \t sets the directory where the output files will be written\n"); + return os.str(); } string slsDetectorCommand::cmdFileName(int narg, char *args[], int action){ - myDet->setReceiverOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); if (action==HELP_ACTION) return helpFileName(narg, args, action); if (cmd=="fname") { - if (action==PUT_ACTION) - myDet->setFileName(string(args[1])); + if (action==PUT_ACTION) + myDet->setFileName(string(args[1])); - return string(myDet->getFileName()); + return string(myDet->getFileName()); } else if(cmd=="fileformat") { if (action==PUT_ACTION){ - if (string(args[1])=="binary") - myDet->setFileFormat(BINARY); - else if (string(args[1])=="ascii") - myDet->setFileFormat(ASCII); - else if (string(args[1])=="hdf5") - myDet->setFileFormat(HDF5); - else return string("could not scan file format mode\n"); + if (string(args[1])=="binary") + myDet->setFileFormat(BINARY); + else if (string(args[1])=="ascii") + myDet->setFileFormat(ASCII); + else if (string(args[1])=="hdf5") + myDet->setFileFormat(HDF5); + else return string("could not scan file format mode\n"); } return myDet->fileFormats(myDet->getFileFormat()); } - return string(myDet->getCurrentFileName()); - + return string(myDet->getCurrentFileName()); + } string slsDetectorCommand::helpFileName(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION){ - os << string("fname \t gets the filename for the data without index and extension\n"); - os << string("fileformat \t gets the file format for data\n"); - } - if (action==PUT_ACTION || action==HELP_ACTION){ - os << string("fname s \t sets the filename for the data (index and extension will be automatically appended)\n"); - os << string("fname s \t sets the file format for the data (binary, ascii, hdf5)\n"); - } - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION){ + os << string("fname \t gets the filename for the data without index and extension\n"); + os << string("fileformat \t gets the file format for data\n"); + } + if (action==PUT_ACTION || action==HELP_ACTION){ + os << string("fname s \t sets the filename for the data (index and extension will be automatically appended)\n"); + os << string("fname s \t sets the file format for the data (binary, ascii, hdf5)\n"); + } + return os.str(); } string slsDetectorCommand::cmdEnablefwrite(int narg, char *args[], int action){ - int i; - char ans[100]; - myDet->setReceiverOnline(ONLINE_FLAG); - if (action==HELP_ACTION) { - return helpEnablefwrite(narg, args, action); - } - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&i)) - myDet->enableWriteToFile(i); - else - return string("could not decode enable file write"); + int i; + char ans[100]; + myDet->setReceiverOnline(ONLINE_FLAG); + if (action==HELP_ACTION) { + return helpEnablefwrite(narg, args, action); + } + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&i)) + myDet->enableWriteToFile(i); + else + return string("could not decode enable file write"); - } - sprintf(ans,"%d",myDet->enableWriteToFile()); - return string(ans); + } + sprintf(ans,"%d",myDet->enableWriteToFile()); + return string(ans); } string slsDetectorCommand::helpEnablefwrite(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("enablefwrite \t When Enabled writes the data into the file\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("enablefwrite i \t should be 1 or 0 or -1\n"); - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("enablefwrite \t When Enabled writes the data into the file\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("enablefwrite i \t should be 1 or 0 or -1\n"); + return os.str(); } string slsDetectorCommand::cmdOverwrite(int narg, char *args[], int action){ - int i; - char ans[100]; - myDet->setReceiverOnline(ONLINE_FLAG); - if (action==HELP_ACTION) { - return helpOverwrite(narg, args, action); - } - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&i)) - myDet->overwriteFile(i); - else - return string("could not decode overwrite"); + int i; + char ans[100]; + myDet->setReceiverOnline(ONLINE_FLAG); + if (action==HELP_ACTION) { + return helpOverwrite(narg, args, action); + } + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&i)) + myDet->overwriteFile(i); + else + return string("could not decode overwrite"); - } - sprintf(ans,"%d",myDet->overwriteFile()); - return string(ans); + } + sprintf(ans,"%d",myDet->overwriteFile()); + return string(ans); } string slsDetectorCommand::helpOverwrite(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("overwrite \t When Enabled overwrites files\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("overwrite i \t should be 1 or 0 or -1\n"); - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("overwrite \t When Enabled overwrites files\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("overwrite i \t should be 1 or 0 or -1\n"); + return os.str(); } @@ -2100,7 +2583,7 @@ string slsDetectorCommand::helpOverwrite(int narg, char *args[], int action){ string slsDetectorCommand::cmdFileIndex(int narg, char *args[], int action){ char ans[100]; int i; - myDet->setReceiverOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); if (action==HELP_ACTION) { return helpFileName(narg, args, action); } @@ -2117,558 +2600,558 @@ string slsDetectorCommand::cmdFileIndex(int narg, char *args[], int action){ string slsDetectorCommand::helpFileIndex(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("index \t gets the file index for the next the data file\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("index i \t sets the fileindex for the next data file\n"); - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("index \t gets the file index for the next the data file\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("index i \t sets the fileindex for the next data file\n"); + return os.str(); } string slsDetectorCommand::cmdFlatField(int narg, char *args[], int action){ - if (action==HELP_ACTION) { - return helpFlatField(narg, args, action); - } - string sval; + if (action==HELP_ACTION) { + return helpFlatField(narg, args, action); + } + string sval; - if (string(args[0])==string("ffdir")) { - if (action==PUT_ACTION) { - sval=string(args[1]); - if (sval=="none") - sval=""; - myDet->setFlatFieldCorrectionDir(sval); - } - return string(myDet->getFlatFieldCorrectionDir()); + if (string(args[0])==string("ffdir")) { + if (action==PUT_ACTION) { + sval=string(args[1]); + if (sval=="none") + sval=""; + myDet->setFlatFieldCorrectionDir(sval); + } + return string(myDet->getFlatFieldCorrectionDir()); - } else if (string(args[0])==string("flatfield")) { + } else if (string(args[0])==string("flatfield")) { + + if (action==PUT_ACTION) { + sval=string(args[1]); + if (sval=="none") + sval=""; + myDet->setFlatFieldCorrection(sval); + return string(myDet->getFlatFieldCorrectionFile()); + + } else {// if (action==GET_ACTION) { + if (narg>1) + sval=string(args[1]); + else + sval="none"; + // cout << myDet->getMaxNumberOfChannels() << endl; + double corr[ myDet->getMaxNumberOfChannels()], ecorr[myDet->getMaxNumberOfChannels()]; + if (myDet->getFlatFieldCorrection(corr,ecorr)) { + if (sval!="none") { + myDet->writeDataFile(sval,corr,ecorr,NULL,'i'); + return sval; + } + return string(myDet->getFlatFieldCorrectionFile()); + } else { + return string("none"); + } + } + } + return string("could not decode flat field action ")+cmd; - if (action==PUT_ACTION) { - sval=string(args[1]); - if (sval=="none") - sval=""; - myDet->setFlatFieldCorrection(sval); - return string(myDet->getFlatFieldCorrectionFile()); - - } else {// if (action==GET_ACTION) { - if (narg>1) - sval=string(args[1]); - else - sval="none"; - // cout << myDet->getMaxNumberOfChannels() << endl; - double corr[ myDet->getMaxNumberOfChannels()], ecorr[myDet->getMaxNumberOfChannels()]; - if (myDet->getFlatFieldCorrection(corr,ecorr)) { - if (sval!="none") { - myDet->writeDataFile(sval,corr,ecorr,NULL,'i'); - return sval; - } - return string(myDet->getFlatFieldCorrectionFile()); - } else { - return string("none"); - } - } - } - return string("could not decode flat field action ")+cmd; - } - + string slsDetectorCommand::helpFlatField(int narg, char *args[], int action){ - int t=0; - ostringstream os; - if (string(args[0])==string("ffdir")) { - t=1; - } else if (string(args[0])==string("flatfield")) { - t=2; - } - if (t!=1) { - - if (action==GET_ACTION || action==HELP_ACTION) { - os << string("flatfield [fn]\t gets the flat field file name. the coorection values and errors can be dumped to fn if specified. \n"); - } if (action==PUT_ACTION || action==HELP_ACTION) - os << string("flatfield s \t sets the flat field file name\n"); - } - if (t!=2) { - - if (action==GET_ACTION || action==HELP_ACTION) - os << string("ffdir \t gets the path for the flat field files \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("ffdir s \t sets the path for flat field files\n"); - } - return os.str(); + int t=0; + ostringstream os; + if (string(args[0])==string("ffdir")) { + t=1; + } else if (string(args[0])==string("flatfield")) { + t=2; + } + if (t!=1) { + + if (action==GET_ACTION || action==HELP_ACTION) { + os << string("flatfield [fn]\t gets the flat field file name. the coorection values and errors can be dumped to fn if specified. \n"); + } if (action==PUT_ACTION || action==HELP_ACTION) + os << string("flatfield s \t sets the flat field file name\n"); + } + if (t!=2) { + + if (action==GET_ACTION || action==HELP_ACTION) + os << string("ffdir \t gets the path for the flat field files \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("ffdir s \t sets the path for flat field files\n"); + } + return os.str(); } - + string slsDetectorCommand::cmdRateCorr(int narg, char *args[], int action){ - if (action==HELP_ACTION) { - return helpRateCorr(narg, args, action); - } - double fval; - char answer[1000]; + if (action==HELP_ACTION) { + return helpRateCorr(narg, args, action); + } + double fval; + char answer[1000]; - myDet->setOnline(ONLINE_FLAG); + myDet->setOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - sscanf(args[1],"%lf",&fval); - myDet->setRateCorrection(fval); - } - double t; - if (myDet->getRateCorrection(t)) { - sprintf(answer,"%0.9f",t); - } else { - sprintf(answer,"%f",0.); - } - return string(answer); + if (action==PUT_ACTION) { + sscanf(args[1],"%lf",&fval); + myDet->setRateCorrection(fval); + } + double t; + if (myDet->getRateCorrection(t)) { + sprintf(answer,"%0.9f",t); + } else { + sprintf(answer,"%f",0.); + } + return string(answer); } - + string slsDetectorCommand::helpRateCorr(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("ratecorr \t returns the dead time used for rate correections in ns \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("ratecorr ns \t sets the deadtime correction constant in ns, -1 in Eiger will set it to default tau of settings\n"); - return os.str(); - + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("ratecorr \t returns the dead time used for rate correections in ns \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("ratecorr ns \t sets the deadtime correction constant in ns, -1 in Eiger will set it to default tau of settings\n"); + return os.str(); + } string slsDetectorCommand::cmdBadChannels(int narg, char *args[], int action){ - - string sval; - if (action==HELP_ACTION) { - return helpBadChannels(narg, args, action); - } - if (action==PUT_ACTION) { - sval=string(args[1]); - if (sval=="none") - sval=""; - myDet->setBadChannelCorrection(sval); - } else if (action==GET_ACTION) { - if (narg>1) - sval=string(args[1]); - else - sval="none"; - int bch[myDet->getMaxNumberOfChannels()], nbch; - if ((nbch=myDet->getBadChannelCorrection(bch))) { - if (sval!="none") { - ofstream outfile; - outfile.open (sval.c_str(),ios_base::out); - if (outfile.is_open()) { - for (int ich=0; ichgetBadChannelCorrectionFile()); + string sval; + + if (action==HELP_ACTION) { + return helpBadChannels(narg, args, action); + } + if (action==PUT_ACTION) { + sval=string(args[1]); + if (sval=="none") + sval=""; + myDet->setBadChannelCorrection(sval); + } else if (action==GET_ACTION) { + if (narg>1) + sval=string(args[1]); + else + sval="none"; + int bch[myDet->getMaxNumberOfChannels()], nbch; + if ((nbch=myDet->getBadChannelCorrection(bch))) { + if (sval!="none") { + ofstream outfile; + outfile.open (sval.c_str(),ios_base::out); + if (outfile.is_open()) { + for (int ich=0; ichgetBadChannelCorrectionFile()); } - + string slsDetectorCommand::helpBadChannels(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("badchannels [fn]\t returns the badchannels file. Prints the list of bad channels in fn, if specified. \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("badchannels \t sets the bad channels list\n"); - - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("badchannels [fn]\t returns the badchannels file. Prints the list of bad channels in fn, if specified. \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("badchannels \t sets the bad channels list\n"); + + return os.str(); } - + string slsDetectorCommand::cmdAngConv(int narg, char *args[], int action){ - if (action==HELP_ACTION) { - return helpAngConv(narg, args, action); - } - string sval; - char answer[1000]; - double fval; - angleConversionParameter c; - - if (string(args[0])==string("angconv")) { - if (action==PUT_ACTION) { - sval=string(args[1]); - - if (sval=="none") - sval=""; - - myDet->setAngularConversionFile(sval); - - return string(myDet->getAngularConversionFile()); - } else if (action==GET_ACTION) { - if (narg>1) - sval=string(args[1]); - else - sval="none"; - int dir; - if (myDet->getAngularConversion(dir)) { - if (sval!="none") { - myDet->writeAngularConversion(sval.c_str()); - return sval; + if (action==HELP_ACTION) { + return helpAngConv(narg, args, action); } - return string(myDet->getAngularConversionFile()); - } else { - return string("none"); - } - } - } else if (string(args[0])==string("globaloff")) { - c=GLOBAL_OFFSET; + string sval; + char answer[1000]; + double fval; + angleConversionParameter c; + + if (string(args[0])==string("angconv")) { + if (action==PUT_ACTION) { + sval=string(args[1]); + + if (sval=="none") + sval=""; + + myDet->setAngularConversionFile(sval); + + return string(myDet->getAngularConversionFile()); + } else if (action==GET_ACTION) { + if (narg>1) + sval=string(args[1]); + else + sval="none"; + int dir; + if (myDet->getAngularConversion(dir)) { + if (sval!="none") { + myDet->writeAngularConversion(sval.c_str()); + return sval; + } + return string(myDet->getAngularConversionFile()); + } else { + return string("none"); + } + } + } else if (string(args[0])==string("globaloff")) { + c=GLOBAL_OFFSET; - } else if (string(args[0])==string("fineoff")) { - c=FINE_OFFSET; + } else if (string(args[0])==string("fineoff")) { + c=FINE_OFFSET; - } else if (string(args[0])==string("binsize")) { - c=BIN_SIZE; + } else if (string(args[0])==string("binsize")) { + c=BIN_SIZE; - } else if (string(args[0])==string("angdir")) { - c=ANGULAR_DIRECTION; + } else if (string(args[0])==string("angdir")) { + c=ANGULAR_DIRECTION; - } else if (string(args[0])==string("moveflag")) { - c=MOVE_FLAG; - } else if (string(args[0])==string("samplex")) { - c=SAMPLE_X; - } else if (string(args[0])==string("sampley")) { - c=SAMPLE_Y; - } + } else if (string(args[0])==string("moveflag")) { + c=MOVE_FLAG; + } else if (string(args[0])==string("samplex")) { + c=SAMPLE_X; + } else if (string(args[0])==string("sampley")) { + c=SAMPLE_Y; + } - else - return string("could not decode angular conversion parameter ")+cmd; + else + return string("could not decode angular conversion parameter ")+cmd; - if (action==PUT_ACTION) { - if (sscanf(args[1],"%lf",&fval)) - myDet->setAngularConversionParameter(c,fval); - } - sprintf(answer,"%f",myDet->getAngularConversionParameter(c)); - return string(answer); + if (action==PUT_ACTION) { + if (sscanf(args[1],"%lf",&fval)) + myDet->setAngularConversionParameter(c,fval); + } + sprintf(answer,"%f",myDet->getAngularConversionParameter(c)); + return string(answer); } - + string slsDetectorCommand::helpAngConv(int narg, char *args[], int action){ - int t=0xffff; - ostringstream os; - - if (string(args[0])==string("angconv")) { - t=1; - } else if (string(args[0])==string("globaloff")) { - t=2; - } else if (string(args[0])==string("fineoff")) { - t=4; - } else if (string(args[0])==string("binsize")) { - t=8; - } else if (string(args[0])==string("samplex")) { - t=16; - } else if (string(args[0])==string("sampley")) { - t=32; - } - if (t&1) { - if (action==GET_ACTION || action==HELP_ACTION) - os << string("angconv [fn]\t returns the constants used for angular conversion prints them to the file fn if specified \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("angconv fn\t sets the angualr conversion constants (none unsets) \n"); - } if (t&2) { - if (action==GET_ACTION || action==HELP_ACTION) - os << string("globaloff\t returns the global offset used for angular conversion \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("globaloff f\t sets the global offset used for the angular conversion \n"); + int t=0xffff; + ostringstream os; + + if (string(args[0])==string("angconv")) { + t=1; + } else if (string(args[0])==string("globaloff")) { + t=2; + } else if (string(args[0])==string("fineoff")) { + t=4; + } else if (string(args[0])==string("binsize")) { + t=8; + } else if (string(args[0])==string("samplex")) { + t=16; + } else if (string(args[0])==string("sampley")) { + t=32; + } + if (t&1) { + if (action==GET_ACTION || action==HELP_ACTION) + os << string("angconv [fn]\t returns the constants used for angular conversion prints them to the file fn if specified \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("angconv fn\t sets the angualr conversion constants (none unsets) \n"); + } if (t&2) { + if (action==GET_ACTION || action==HELP_ACTION) + os << string("globaloff\t returns the global offset used for angular conversion \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("globaloff f\t sets the global offset used for the angular conversion \n"); - } if (t&4) { - if (action==GET_ACTION || action==HELP_ACTION) - os << string("fineoff\t returns the fine offset used for angular conversion \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("fineoff f\t sets the fine offset used for the angular conversion \n"); + } if (t&4) { + if (action==GET_ACTION || action==HELP_ACTION) + os << string("fineoff\t returns the fine offset used for angular conversion \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("fineoff f\t sets the fine offset used for the angular conversion \n"); - } if (t&8) { - if (action==GET_ACTION || action==HELP_ACTION) - os << string("binsize\t returns the bin size used for the angular conversion \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("binsize f\t sets the bin size used for the angular conversion \n"); + } if (t&8) { + if (action==GET_ACTION || action==HELP_ACTION) + os << string("binsize\t returns the bin size used for the angular conversion \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("binsize f\t sets the bin size used for the angular conversion \n"); - } - if (t&16) { - if (action==GET_ACTION || action==HELP_ACTION) - os << string("samplex \t gets the sample displacement in th direction parallel to the beam \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("samplex f\t sets the sample displacement in th direction parallel to the beam \n"); - } - if (t&32) { - if (action==GET_ACTION || action==HELP_ACTION) - os << string("sampley \t gets the sample displacement in the direction orthogonal to the beam \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("sampley f\t sets the sample displacement in the direction orthogonal to the beam \n"); - } + } + if (t&16) { + if (action==GET_ACTION || action==HELP_ACTION) + os << string("samplex \t gets the sample displacement in th direction parallel to the beam \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("samplex f\t sets the sample displacement in th direction parallel to the beam \n"); + } + if (t&32) { + if (action==GET_ACTION || action==HELP_ACTION) + os << string("sampley \t gets the sample displacement in the direction orthogonal to the beam \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("sampley f\t sets the sample displacement in the direction orthogonal to the beam \n"); + } - return os.str(); + return os.str(); } string slsDetectorCommand::cmdThreaded(int narg, char *args[], int action){ - int ival; - char answer[1000]; + int ival; + char answer[1000]; - if (action==HELP_ACTION) - return helpThreaded(narg,args,action); + if (action==HELP_ACTION) + return helpThreaded(narg,args,action); + + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&ival)) + myDet->setThreadedProcessing(ival); + } + sprintf(answer,"%d",myDet->setThreadedProcessing()); + return string(answer); - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&ival)) - myDet->setThreadedProcessing(ival); - } - sprintf(answer,"%d",myDet->setThreadedProcessing()); - return string(answer); - } - + string slsDetectorCommand::helpThreaded(int narg, char *args[], int action){ - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("threaded \t returns wether the data processing is threaded. \n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("threaded t \t sets the threading flag ( 1sets, 0 unsets).\n"); - - return os.str(); - + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("threaded \t returns wether the data processing is threaded. \n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("threaded t \t sets the threading flag ( 1sets, 0 unsets).\n"); + + return os.str(); + } - + string slsDetectorCommand::cmdImage(int narg, char *args[], int action){ - string sval; - int retval; - if (action==HELP_ACTION) - return helpImage(narg,args,HELP_ACTION); - else if (action==GET_ACTION) - return string("Cannot get"); + string sval; + int retval; + if (action==HELP_ACTION) + return helpImage(narg,args,HELP_ACTION); + else if (action==GET_ACTION) + return string("Cannot get"); - sval=string(args[1]); - myDet->setOnline(ONLINE_FLAG); + sval=string(args[1]); + myDet->setOnline(ONLINE_FLAG); - if (string(args[0])==string("darkimage")) - retval=myDet->loadImageToDetector(DARK_IMAGE,sval); - else if (string(args[0])==string("gainimage")) - retval=myDet->loadImageToDetector(GAIN_IMAGE,sval); + if (string(args[0])==string("darkimage")) + retval=myDet->loadImageToDetector(DARK_IMAGE,sval); + else if (string(args[0])==string("gainimage")) + retval=myDet->loadImageToDetector(GAIN_IMAGE,sval); - - if(retval==OK) - return string("Image loaded succesfully"); - else - return string("Image load failed"); + + if(retval==OK) + return string("Image loaded succesfully"); + else + return string("Image load failed"); } string slsDetectorCommand::helpImage(int narg, char *args[], int action){ - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION){ - os << "darkimage f \t loads the image to detector from file f"<< std::endl; - os << "gainimage f \t loads the image to detector from file f"<< std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION){ - os << "darkimage \t Cannot get"<< std::endl; - os << "gainimage \t Cannot get"<< std::endl; - } - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION){ + os << "darkimage f \t loads the image to detector from file f"<< std::endl; + os << "gainimage f \t loads the image to detector from file f"<< std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION){ + os << "darkimage \t Cannot get"<< std::endl; + os << "gainimage \t Cannot get"<< std::endl; + } + return os.str(); } string slsDetectorCommand::cmdCounter(int narg, char *args[], int action){ - int ival; - char answer[100]; - string sval; - int retval; - if (action==HELP_ACTION) - return helpCounter(narg,args,HELP_ACTION); - else if (action==PUT_ACTION) - ival=atoi(args[1]); + int ival; + char answer[100]; + string sval; + int retval; + if (action==HELP_ACTION) + return helpCounter(narg,args,HELP_ACTION); + else if (action==PUT_ACTION) + ival=atoi(args[1]); - myDet->setOnline(ONLINE_FLAG); + myDet->setOnline(ONLINE_FLAG); - if (string(args[0])==string("readctr")){ - if (action==PUT_ACTION) - return string("Cannot put"); - else{ - if (narg<3) - return string("should specify I/O file"); - sval=string(args[2]); - retval=myDet->writeCounterBlockFile(sval,ival); - } - } - else if (string(args[0])==string("resetctr")){ - if (action==GET_ACTION) - return string("Cannot get"); - else - retval=myDet->resetCounterBlock(ival); - } + if (string(args[0])==string("readctr")){ + if (action==PUT_ACTION) + return string("Cannot put"); + else{ + if (narg<3) + return string("should specify I/O file"); + sval=string(args[2]); + retval=myDet->writeCounterBlockFile(sval,ival); + } + } + else if (string(args[0])==string("resetctr")){ + if (action==GET_ACTION) + return string("Cannot get"); + else + retval=myDet->resetCounterBlock(ival); + } - else if (string(args[0])==string("resmat")){ - if (action==PUT_ACTION){ - if (!sscanf(args[1],"%d",&ival)) - return string("Could not scan resmat input ")+string(args[1]); - if(ival>=0) - sprintf(answer,"%d",myDet->setCounterBit(ival)); - }else - sprintf(answer,"%d",myDet->setCounterBit()); - return string(answer); - } + else if (string(args[0])==string("resmat")){ + if (action==PUT_ACTION){ + if (!sscanf(args[1],"%d",&ival)) + return string("Could not scan resmat input ")+string(args[1]); + if(ival>=0) + sprintf(answer,"%d",myDet->setCounterBit(ival)); + }else + sprintf(answer,"%d",myDet->setCounterBit()); + return string(answer); + } - if(retval==OK) - return string("Counter read/reset succesfully"); - else - return string("Counter read/reset failed"); + if(retval==OK) + return string("Counter read/reset succesfully"); + else + return string("Counter read/reset failed"); } string slsDetectorCommand::helpCounter(int narg, char *args[], int action){ - ostringstream os; - os << std::endl; - if (action==PUT_ACTION || action==HELP_ACTION){ - os << "readctr \t Cannot put"<< std::endl; - os << "resetctr i \t resets counter in detector, restarts acquisition if i=1"<< std::endl; - os << "resmat i \t sets/resets counter bit in detector"<< std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION){ - os << "readctr i fname\t reads counter in detector to file fname, restarts acquisition if i=1"<< std::endl; - os << "resetctr \t Cannot get"<< std::endl; - os << "resmat i \t gets the counter bit in detector"<< std::endl; - } - return os.str(); + ostringstream os; + os << std::endl; + if (action==PUT_ACTION || action==HELP_ACTION){ + os << "readctr \t Cannot put"<< std::endl; + os << "resetctr i \t resets counter in detector, restarts acquisition if i=1"<< std::endl; + os << "resmat i \t sets/resets counter bit in detector"<< std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION){ + os << "readctr i fname\t reads counter in detector to file fname, restarts acquisition if i=1"<< std::endl; + os << "resetctr \t Cannot get"<< std::endl; + os << "resmat i \t gets the counter bit in detector"<< std::endl; + } + return os.str(); } string slsDetectorCommand::cmdPositions(int narg, char *args[], int action){ - int ival; - int ip; + int ival; + int ip; - char answer[1000]; + char answer[1000]; - if (action==HELP_ACTION) return helpPositions(narg,args,action); + if (action==HELP_ACTION) return helpPositions(narg,args,action); - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&ival)) { - double pos[ival]; - for (ip=0; ipsetPositions(ip,pos); + } } - } - myDet->setPositions(ip,pos); - } - } - int npos=myDet->getPositions(); - sprintf(answer,"%d",npos); - double opos[npos]; - myDet->getPositions(opos); - for (int ip=0; ipgetPositions(); + sprintf(answer,"%d",npos); + double opos[npos]; + myDet->getPositions(opos); + for (int ip=0; ipsetActionParameter(ia, args[1]); - } - return string(myDet->getActionParameter(ia)); - - } else { + if (ia==-1) return string("cannot define action ")+cmd; - if (ia==enCalLog || ia==angCalLog) { - + if (cmd.find("par")!=string::npos) { - if (action==PUT_ACTION) { + if (action==PUT_ACTION) { + myDet->setActionParameter(ia, args[1]); + } + return string(myDet->getActionParameter(ia)); - int arg=-1; + } else { + + if (ia==enCalLog || ia==angCalLog) { - sscanf(args[1],"%d",&arg); + if (action==PUT_ACTION) { - if (arg==0) - myDet->setActionScript(ia,"none"); - else - myDet->setActionScript(ia,args[1]); - - } - - sprintf(answer,"%d",myDet->getActionMode(ia)); - return string(answer); - - } + int arg=-1; - if (action==PUT_ACTION) { - myDet->setActionScript(ia, args[1]); - } - return string(myDet->getActionScript(ia)); - - } - return string("could not decode command")+cmd; + sscanf(args[1],"%d",&arg); + + if (arg==0) + myDet->setActionScript(ia,"none"); + else + myDet->setActionScript(ia,args[1]); + + } + + sprintf(answer,"%d",myDet->getActionMode(ia)); + return string(answer); + + } + + + if (action==PUT_ACTION) { + myDet->setActionScript(ia, args[1]); + } + return string(myDet->getActionScript(ia)); + + } + return string("could not decode command")+cmd; @@ -2676,225 +3159,225 @@ string slsDetectorCommand::cmdScripts(int narg, char *args[], int action) { } string slsDetectorCommand::helpScripts(int narg, char *args[], int action) { - - ostringstream os; - - if (narg>0) { - if ((string(args[0]).find("start")!=string::npos) || (string(args[0]).find("stop")!=string::npos) || (string(args[0]).find("scriptbefore")!=string::npos) || \ - (string(args[0]).find("scriptafter")!=string::npos) || (string(args[0]).find("headerafter")!=string::npos) || (string(args[0]).find("headerbefore")!=string::npos)) { - - if (action==PUT_ACTION || action==HELP_ACTION) - os << args[0] << " script \t sets the script to execute for the corresponding action"<< std::endl; - if (action==GET_ACTION || action==HELP_ACTION) - os << args[0] << " \t returns the script to execute for the corresponding action"<< std::endl; - - } - - - if ((string(args[0]).find("encallog")!=string::npos) || (string(args[0]).find("angcallog")!=string::npos)) { - + ostringstream os; + + if (narg>0) { + if ((string(args[0]).find("start")!=string::npos) || (string(args[0]).find("stop")!=string::npos) || (string(args[0]).find("scriptbefore")!=string::npos) || \ + (string(args[0]).find("scriptafter")!=string::npos) || (string(args[0]).find("headerafter")!=string::npos) || (string(args[0]).find("headerbefore")!=string::npos)) { - if (action==PUT_ACTION || action==HELP_ACTION) - os << args[0] << " i \t enables (1) or disables (0) the logging for the calibration"<< std::endl; - if (action==GET_ACTION || action==HELP_ACTION) - os << args[0] << " \t returns the calibration log mode"<< std::endl; - } - } - return os.str(); + if (action==PUT_ACTION || action==HELP_ACTION) + os << args[0] << " script \t sets the script to execute for the corresponding action"<< std::endl; + if (action==GET_ACTION || action==HELP_ACTION) + os << args[0] << " \t returns the script to execute for the corresponding action"<< std::endl; + + } + + + if ((string(args[0]).find("encallog")!=string::npos) || (string(args[0]).find("angcallog")!=string::npos)) { + + + + if (action==PUT_ACTION || action==HELP_ACTION) + os << args[0] << " i \t enables (1) or disables (0) the logging for the calibration"<< std::endl; + if (action==GET_ACTION || action==HELP_ACTION) + os << args[0] << " \t returns the calibration log mode"<< std::endl; + } + } + return os.str(); } string slsDetectorCommand::cmdScans(int narg, char *args[], int action) { - int is=-1, ival, ns=0; - char answer[MAX_SCAN_STEPS*10]; - double *values; - if (action==HELP_ACTION) - return helpScans(narg,args,action); + int is=-1, ival, ns=0; + char answer[MAX_SCAN_STEPS*10]; + double *values; + if (action==HELP_ACTION) + return helpScans(narg,args,action); - if (cmd.find("0")!=string::npos) is=0; - else if (cmd.find("1")!=string::npos) is=1; - else return string("cannot define scan level ")+cmd; + if (cmd.find("0")!=string::npos) is=0; + else if (cmd.find("1")!=string::npos) is=1; + else return string("cannot define scan level ")+cmd; - if (cmd.find("par")!=string::npos) { - if (action==PUT_ACTION) { - myDet->setScanParameter(is, args[1]); - } - return myDet->getScanParameter(is); - } - if (cmd.find("script")!=string::npos) { - if (action==PUT_ACTION) { - myDet->setScanScript(is, args[1]); - } - return myDet->getScanScript(is); - } - if (cmd.find("prec")!=string::npos) { - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&ival)) { - myDet->setScanPrecision(is, ival); - } else - return string("invalid precision ")+cmd; - } - sprintf(answer,"%d", myDet->getScanPrecision(is)); - return string(answer); - } - if (cmd.find("steps")!=string::npos) { - - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&ival)) { - - if (ival>MAX_SCAN_STEPS) - return string("too many steps required!"); - - values=new double[ival]; - for (int i=0; i=(i+2)) { - if (sscanf(args[i+2],"%lf",values+i)) - ns++; - else - break; - } else - break; + if (cmd.find("par")!=string::npos) { + if (action==PUT_ACTION) { + myDet->setScanParameter(is, args[1]); + } + return myDet->getScanParameter(is); } - myDet->setScanSteps(is, ns, values); - delete [] values; - } else { - return string("invalid number of steps ")+string(args[1]); - } - } - ns=myDet->getScanSteps(is); - sprintf(answer,"%d ",ns); - if (ns>0) { - values=new double[ns]; - ns=myDet->getScanSteps(is, values); - int p=myDet->getScanPrecision(is); - char format[1000]; - sprintf(format, "%%s %%0.%df",p); - for (int i=0; isetScanScript(is, args[1]); + } + return myDet->getScanScript(is); + } + if (cmd.find("prec")!=string::npos) { + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&ival)) { + myDet->setScanPrecision(is, ival); + } else + return string("invalid precision ")+cmd; + } + sprintf(answer,"%d", myDet->getScanPrecision(is)); + return string(answer); + } + if (cmd.find("steps")!=string::npos) { + + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&ival)) { + + if (ival>MAX_SCAN_STEPS) + return string("too many steps required!"); + + values=new double[ival]; + for (int i=0; i=(i+2)) { + if (sscanf(args[i+2],"%lf",values+i)) + ns++; + else + break; + } else + break; + } + myDet->setScanSteps(is, ns, values); + delete [] values; + } else { + return string("invalid number of steps ")+string(args[1]); + } + } + ns=myDet->getScanSteps(is); + sprintf(answer,"%d ",ns); + if (ns>0) { + values=new double[ns]; + ns=myDet->getScanSteps(is, values); + int p=myDet->getScanPrecision(is); + char format[1000]; + sprintf(format, "%%s %%0.%df",p); + for (int i=0; iMAX_SCAN_STEPS) - return string("too many steps required!"); - - if (fmax>fmin) - if (fstep<0) - fstep=-1*fstep; - - if (fmax0) - fstep=-1*fstep; - - values=new double[ns]; - for (int i=0; isetScanSteps(is, ns, values); - delete [] values; - } - - ns=myDet->getScanSteps(is); - values=new double[ns]; - ns=myDet->getScanSteps(is, values); - int p=myDet->getScanPrecision(is); - char format[1000]; - sprintf(format, "%%s %%0.%df",p); - sprintf(answer,"%d ",ns); - for (int i=0; iMAX_SCAN_STEPS) + return string("too many steps required!"); + + if (fmax>fmin) + if (fstep<0) + fstep=-1*fstep; + + if (fmax0) + fstep=-1*fstep; + + + values=new double[ns]; + for (int i=0; isetScanSteps(is, ns, values); + delete [] values; + } + + ns=myDet->getScanSteps(is); + values=new double[ns]; + ns=myDet->getScanSteps(is, values); + int p=myDet->getScanPrecision(is); + char format[1000]; + sprintf(format, "%%s %%0.%df",p); + sprintf(answer,"%d ",ns); + for (int i=0; isetOnline(ONLINE_FLAG); - if (action==PUT_ACTION) - myDet->setPort(index,val); - - sprintf(ans,"%d",myDet->setPort(index)); - return string(ans); + if (cmd=="port") { + index=CONTROL_PORT; + } else if (cmd=="rx_tcpport") { + index=DATA_PORT; + } else if (cmd=="stopport") { + index=STOP_PORT; + } else + return string("unknown port type ")+cmd; + + myDet->setOnline(ONLINE_FLAG); + if (action==PUT_ACTION) + myDet->setPort(index,val); + + sprintf(ans,"%d",myDet->setPort(index)); + return string(ans); } @@ -3049,19 +3532,19 @@ string slsDetectorCommand::cmdPort(int narg, char *args[], int action) { string slsDetectorCommand::helpPort(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "port i \n sets the communication control port"<< std::endl; - os << "rx_tcpport i \n sets the communication receiver port"<< std::endl; - os << "stopport i \n sets the communication stop port "<< std::endl; - - } - if (action==GET_ACTION || action==HELP_ACTION) { - os << "port \n gets the communication control port"<< std::endl; - os << "rx_tcpport \n gets the communication receiver port"<< std::endl; - os << "stopport \n gets the communication stop port "<< std::endl; - } - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "port i \n sets the communication control port"<< std::endl; + os << "rx_tcpport i \n sets the communication receiver port"<< std::endl; + os << "stopport i \n sets the communication stop port "<< std::endl; + + } + if (action==GET_ACTION || action==HELP_ACTION) { + os << "port \n gets the communication control port"<< std::endl; + os << "rx_tcpport \n gets the communication receiver port"<< std::endl; + os << "stopport \n gets the communication stop port "<< std::endl; + } + return os.str(); } @@ -3069,41 +3552,41 @@ string slsDetectorCommand::helpPort(int narg, char *args[], int action) { string slsDetectorCommand::cmdLock(int narg, char *args[], int action) { - if (action==HELP_ACTION) - return helpLock(narg,args,action); - - int val;//, ret; - char ans[1000]; - - if(cmd=="lock"){ - myDet->setOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&val)) - myDet->lockServer(val); - else - return string("could not lock status")+string(args[1]); - } + if (action==HELP_ACTION) + return helpLock(narg,args,action); - sprintf(ans,"%d",myDet->lockServer()); - } + int val;//, ret; + char ans[1000]; + + if(cmd=="lock"){ + myDet->setOnline(ONLINE_FLAG); + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&val)) + myDet->lockServer(val); + else + return string("could not lock status")+string(args[1]); + } + + sprintf(ans,"%d",myDet->lockServer()); + } - else if(cmd=="r_lock"){ - myDet->setReceiverOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&val)) - myDet->lockReceiver(val); - else - return string("could not decode lock status")+string(args[1]); - } - sprintf(ans,"%d",myDet->lockReceiver()); - } + else if(cmd=="r_lock"){ + myDet->setReceiverOnline(ONLINE_FLAG); + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&val)) + myDet->lockReceiver(val); + else + return string("could not decode lock status")+string(args[1]); + } + sprintf(ans,"%d",myDet->lockReceiver()); + } - else - return string("could not decode command"); + else + return string("could not decode command"); - return string(ans); + return string(ans); } @@ -3111,16 +3594,16 @@ string slsDetectorCommand::cmdLock(int narg, char *args[], int action) { string slsDetectorCommand::helpLock(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "lock i \n locks (1) or unlocks (0) the detector to communicate to this client"<< std::endl; - os << "r_lock i \n locks (1) or unlocks (0) the receiver to communicate to this client"<< std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION) { - os << "lock \n returns the detector lock status"<< std::endl; - os << "r_lock \n returns the receiver lock status"<< std::endl; - } - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "lock i \n locks (1) or unlocks (0) the detector to communicate to this client"<< std::endl; + os << "r_lock i \n locks (1) or unlocks (0) the receiver to communicate to this client"<< std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION) { + os << "lock \n returns the detector lock status"<< std::endl; + os << "r_lock \n returns the receiver lock status"<< std::endl; + } + return os.str(); } @@ -3128,114 +3611,116 @@ string slsDetectorCommand::helpLock(int narg, char *args[], int action) { string slsDetectorCommand::cmdLastClient(int narg, char *args[], int action) { - if (action==HELP_ACTION) - return helpLastClient(narg,args,action); - - if (action==PUT_ACTION) - return string("cannot set"); + if (action==HELP_ACTION) + return helpLastClient(narg,args,action); + + if (action==PUT_ACTION) + return string("cannot set"); - if(cmd=="lastclient"){ - myDet->setOnline(ONLINE_FLAG); - return myDet->getLastClientIP(); - } + if(cmd=="lastclient"){ + myDet->setOnline(ONLINE_FLAG); + return myDet->getLastClientIP(); + } - else if(cmd=="r_lastclient"){ - myDet->setReceiverOnline(ONLINE_FLAG); - return myDet->getReceiverLastClientIP(); - } + else if(cmd=="r_lastclient"){ + myDet->setReceiverOnline(ONLINE_FLAG); + return myDet->getReceiverLastClientIP(); + } - return string("cannot decode command"); + return string("cannot decode command"); } string slsDetectorCommand::helpLastClient(int narg, char *args[], int action) { - - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) { - os << "lastclient \n returns the last client communicating with the detector"<< std::endl; - os << "r_lastclient \n returns the last client communicating with the receiver"<< std::endl; - } - return os.str(); + + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) { + os << "lastclient \n returns the last client communicating with the detector"<< std::endl; + os << "r_lastclient \n returns the last client communicating with the receiver"<< std::endl; + } + return os.str(); } string slsDetectorCommand::cmdOnline(int narg, char *args[], int action) { - if (action==HELP_ACTION) { - return helpOnline(narg,args,action); - } - int ival; - char ans[1000]; + if (action==HELP_ACTION) { + return helpOnline(narg,args,action); + } + int ival; + char ans[1000]; - if(cmd=="online"){ - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&ival)) - myDet->setOnline(ival); - else - return string("Could not scan online mode ")+string(args[1]); - } - sprintf(ans,"%d",myDet->setOnline()); - } - else if(cmd=="checkonline"){ - if (action==PUT_ACTION) - return string("cannot set"); - strcpy(ans,myDet->checkOnline().c_str()); - if(!strlen(ans)) - strcpy(ans,"All online"); - else - strcat(ans," :Not online"); - } - else if(cmd=="activate"){ - myDet->setOnline(ONLINE_FLAG); - myDet->setReceiverOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - if (!sscanf(args[1],"%d",&ival)) - return string("Could not scan activate mode ")+string(args[1]); - /* if(dynamic_cast(myDet) != NULL) + if(cmd=="online"){ + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&ival)) + myDet->setOnline(ival); + else + return string("Could not scan online mode ")+string(args[1]); + } + sprintf(ans,"%d",myDet->setOnline()); + } + else if(cmd=="checkonline"){ + if (action==PUT_ACTION) + return string("cannot set"); + strcpy(ans,myDet->checkOnline().c_str()); + if(!strlen(ans)) + strcpy(ans,"All online"); + else + strcat(ans," :Not online"); + } + else if(cmd=="activate"){ + myDet->setOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); + if (action==PUT_ACTION) { + if (!sscanf(args[1],"%d",&ival)) + return string("Could not scan activate mode ")+string(args[1]); + /* if(dynamic_cast(myDet) != NULL) return string("Can only set it from the multiDetector mode");*/ - myDet->activate(ival); - } - sprintf(ans,"%d",myDet->activate()); - } - else if(cmd=="r_online"){ - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d",&ival)) - myDet->setReceiverOnline(ival); - else - return string("Could not scan online mode ")+string(args[1]); - } - sprintf(ans,"%d",myDet->setReceiverOnline()); - } - else{ - if (action==PUT_ACTION) - return string("cannot set"); - myDet->setReceiverOnline(ONLINE_FLAG); - strcpy(ans,myDet->checkReceiverOnline().c_str()); - if(!strlen(ans)) - strcpy(ans,"All receiver online"); - else - strcat(ans," :Not all receiver online"); - } + myDet->activate(ival); + } + sprintf(ans,"%d",myDet->activate()); + } + else if(cmd=="r_online"){ + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&ival)) + myDet->setReceiverOnline(ival); + else + return string("Could not scan online mode ")+string(args[1]); + } + sprintf(ans,"%d",myDet->setReceiverOnline()); + } + else{ + if (action==PUT_ACTION) + return string("cannot set"); + myDet->setReceiverOnline(ONLINE_FLAG); + strcpy(ans,myDet->checkReceiverOnline().c_str()); + if(!strlen(ans)) + strcpy(ans,"All receiver online"); + else + strcat(ans," :Not all receiver online"); + } - return ans; + return ans; } string slsDetectorCommand::helpOnline(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "online i \n sets the detector in online (1) or offline (0) mode"<< std::endl; - os << "r_online i \n sets the receiver in online (1) or offline (0) mode"<< std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION) { - os << "online \n gets the detector online (1) or offline (0) mode"<< std::endl; - os << "checkonline \n returns the hostnames of all detectors in offline mode"<< std::endl; - os << "r_online \n gets the receiver online (1) or offline (0) mode"<< std::endl; - os << "r_checkonline \n returns the hostnames of all receiver in offline mode"<< std::endl; - } - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "online i \n sets the detector in online (1) or offline (0) mode"<< std::endl; + os << "r_online i \n sets the receiver in online (1) or offline (0) mode"<< std::endl; + os << "activate i \n sets the detector in activated (1) or deactivated (0) mode (does not send data). Only for Eiger."<< std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION) { + os << "online \n gets the detector online (1) or offline (0) mode"<< std::endl; + os << "checkonline \n returns the hostnames of all detectors in offline mode"<< std::endl; + os << "r_online \n gets the receiver online (1) or offline (0) mode"<< std::endl; + os << "r_checkonline \n returns the hostnames of all receiver in offline mode"<< std::endl; + os << "activate \n gets the detector activated (1) or deactivated (0) mode. Only for Eiger."<< std::endl; + } + return os.str(); } @@ -3245,33 +3730,33 @@ string slsDetectorCommand::helpOnline(int narg, char *args[], int action) { string slsDetectorCommand::cmdConfigureMac(int narg, char *args[], int action) { - if (action==HELP_ACTION) { - return helpConfigureMac(narg,args,action); - } - int ret; - char ans[1000]; - - if (action==PUT_ACTION){ - myDet->setOnline(ONLINE_FLAG); - myDet->setReceiverOnline(ONLINE_FLAG); - ret=myDet->configureMAC(); - } - else - return string("Cannot get ")+cmd; + if (action==HELP_ACTION) { + return helpConfigureMac(narg,args,action); + } + int ret; + char ans[1000]; - sprintf(ans,"%d",ret); - return ans; + if (action==PUT_ACTION){ + myDet->setOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); + ret=myDet->configureMAC(); + } + else + return string("Cannot get ")+cmd; + + sprintf(ans,"%d",ret); + return ans; } string slsDetectorCommand::helpConfigureMac(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) - os << "configuremac i \n configures the MAC of the detector."<< std::endl; - if (action==GET_ACTION || action==HELP_ACTION) - os << "configuremac " << "Cannot get " << std::endl; - - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) + os << "configuremac i \n configures the MAC of the detector."<< std::endl; + if (action==GET_ACTION || action==HELP_ACTION) + os << "configuremac " << "Cannot get " << std::endl; + + return os.str(); } @@ -3288,23 +3773,23 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) { if (cmd=="maxmod") return string("cannot put!"); else if (cmd=="roimask"){ - if (!sscanf(args[1],"%d",&val)) - return string("could not scan ")+string(args[0])+string(" ")+string(args[1]); + if (!sscanf(args[1],"%d",&val)) + return string("could not scan ")+string(args[0])+string(" ")+string(args[1]); } else if (!sscanf(args[1],"%d",&val)) - return string("could not scan ")+string(args[0])+string(" ")+string(args[1]); + return string("could not scan ")+string(args[0])+string(" ")+string(args[1]); if (cmd=="roi"){ - //debug number of arguments - if ((val<0) || (narg!=((val*4)+2)) ) - return helpDetectorSize(narg,args,action); + //debug number of arguments + if ((val<0) || (narg!=((val*4)+2)) ) + return helpDetectorSize(narg,args,action); ROI allroi[val]; pos=2; for(i=0;isetROI(val,allroi); @@ -3339,7 +3824,7 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) { } else if (cmd=="maxmod") { ret=myDet->getMaxNumberOfModules(); } else if (cmd=="dr") { - myDet->setReceiverOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); ret=myDet->setDynamicRange(val); } else if (cmd=="roi") { myDet->getROI(ret); @@ -3362,10 +3847,10 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) { return string("unknown detector size ")+cmd; if (cmd=="roimask") - sprintf(ans,"0x%x",ret); + sprintf(ans,"0x%x",ret); else - sprintf(ans,"0x%d",ret); - + sprintf(ans,"0x%d",ret); + return string(ans); } @@ -3373,25 +3858,25 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) { string slsDetectorCommand::helpDetectorSize(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "nmod i \n sets the number of modules of the detector"<< std::endl; - os << "dr i \n sets the dynamic range of the detector"<< std::endl; - os << "roi i xmin xmax ymin ymax \n sets region of interest where i is number of rois;i=0 to clear rois"<< std::endl; - os << "detsizechan x y \n sets the maximum number of channels for complete detector set in both directions; -1 is no limit"<< std::endl; - os << "flippeddatax x \n sets if the data should be flipped on the x axis"<< std::endl; - os << "flippeddatay y \n sets if the data should be flipped on the y axis"<< std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION) { - os << "nmod \n gets the number of modules of the detector"<< std::endl; - os << "maxmod \n gets the maximum number of modules of the detector"<< std::endl; - os << "dr \n gets the dynamic range of the detector"<< std::endl; - os << "roi \n gets region of interest"<< std::endl; - os << "detsizechan \n gets the maximum number of channels for complete detector set in both directions; -1 is no limit"<< std::endl; - os << "flippeddatax\n gets if the data will be flipped on the x axis respectively"<< std::endl; - os << "flippeddatay\n gets if the data will be flipped on the y axis respectively"<< std::endl; - } - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "nmod i \n sets the number of modules of the detector"<< std::endl; + os << "dr i \n sets the dynamic range of the detector"<< std::endl; + os << "roi i xmin xmax ymin ymax \n sets region of interest where i is number of rois;i=0 to clear rois"<< std::endl; + os << "detsizechan x y \n sets the maximum number of channels for complete detector set in both directions; -1 is no limit"<< std::endl; + os << "flippeddatax x \n sets if the data should be flipped on the x axis"<< std::endl; + os << "flippeddatay y \n sets if the data should be flipped on the y axis"<< std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION) { + os << "nmod \n gets the number of modules of the detector"<< std::endl; + os << "maxmod \n gets the maximum number of modules of the detector"<< std::endl; + os << "dr \n gets the dynamic range of the detector"<< std::endl; + os << "roi \n gets region of interest"<< std::endl; + os << "detsizechan \n gets the maximum number of channels for complete detector set in both directions; -1 is no limit"<< std::endl; + os << "flippeddatax\n gets if the data will be flipped on the x axis"<< std::endl; + os << "flippeddatay\n gets if the data will be flipped on the y axis"<< std::endl; + } + return os.str(); } @@ -3400,164 +3885,164 @@ string slsDetectorCommand::helpDetectorSize(int narg, char *args[], int action) string slsDetectorCommand::cmdSettings(int narg, char *args[], int action) { - if (action==HELP_ACTION) - return helpSettings(narg,args,action); - int val=-1;//ret, - char ans[1000]; + if (action==HELP_ACTION) + return helpSettings(narg,args,action); + int val=-1;//ret, + char ans[1000]; - // portType index; - // if (sscanf(args[1],"%d",&val)) - // ; - // else - // return string("could not scan port number")+string(args[1]); - // } + // portType index; + // if (sscanf(args[1],"%d",&val)) + // ; + // else + // return string("could not scan port number")+string(args[1]); + // } - myDet->setOnline(ONLINE_FLAG); + myDet->setOnline(ONLINE_FLAG); - if (cmd=="settings") { - detectorSettings sett = GET_SETTINGS; - if (action==PUT_ACTION) { - sett = myDet->setSettings(myDet->getDetectorSettings(string(args[1]))); - if (myDet->getDetectorsType() == EIGER) { - return myDet->getDetectorSettings(sett); - } - } - return myDet->getDetectorSettings(myDet->getSettings()); - } else if (cmd=="threshold") { - if (action==PUT_ACTION) { - if (!sscanf(args[1],"%d",&val)) { - return string("invalid threshold value"); - } - detectorType type = myDet->getDetectorsType(); - if (type != EIGER || (type == EIGER && narg<=2)) { - myDet->setThresholdEnergy(val); - } else { - detectorSettings sett= myDet->getDetectorSettings(string(args[2])); - if(sett == -1) - return string("invalid settings value"); - myDet->setThresholdEnergy(val, -1, sett); - } - } - sprintf(ans,"%d",myDet->getThresholdEnergy()); - return string(ans); - } else if (cmd=="thresholdnotb") { - if (action==PUT_ACTION) { - if (!sscanf(args[1],"%d",&val)) { - return string("invalid threshold value"); - } - detectorType type = myDet->getDetectorsType(); - if (type != EIGER) - return string("not implemented for this detector"); - if (narg<=2) { - myDet->setThresholdEnergy(val, -1, GET_SETTINGS, 0); - } else { - detectorSettings sett= myDet->getDetectorSettings(string(args[2])); - if(sett == -1) - return string("invalid settings value"); - myDet->setThresholdEnergy(val, -1, sett, 0); - } - } - sprintf(ans,"%d",myDet->getThresholdEnergy()); - return string(ans); - } else if (cmd=="trimbits") { - if (narg>=2) { - string sval=string(args[1]); + if (cmd=="settings") { + detectorSettings sett = GET_SETTINGS; + if (action==PUT_ACTION) { + sett = myDet->setSettings(myDet->getDetectorSettings(string(args[1]))); + if (myDet->getDetectorsType() == EIGER) { + return myDet->getDetectorSettings(sett); + } + } + return myDet->getDetectorSettings(myDet->getSettings()); + } else if (cmd=="threshold") { + if (action==PUT_ACTION) { + if (!sscanf(args[1],"%d",&val)) { + return string("invalid threshold value"); + } + detectorType type = myDet->getDetectorsType(); + if (type != EIGER || (type == EIGER && narg<=2)) { + myDet->setThresholdEnergy(val); + } else { + detectorSettings sett= myDet->getDetectorSettings(string(args[2])); + if(sett == -1) + return string("invalid settings value"); + myDet->setThresholdEnergy(val, -1, sett); + } + } + sprintf(ans,"%d",myDet->getThresholdEnergy()); + return string(ans); + } else if (cmd=="thresholdnotb") { + if (action==PUT_ACTION) { + if (!sscanf(args[1],"%d",&val)) { + return string("invalid threshold value"); + } + detectorType type = myDet->getDetectorsType(); + if (type != EIGER) + return string("not implemented for this detector"); + if (narg<=2) { + myDet->setThresholdEnergy(val, -1, GET_SETTINGS, 0); + } else { + detectorSettings sett= myDet->getDetectorSettings(string(args[2])); + if(sett == -1) + return string("invalid settings value"); + myDet->setThresholdEnergy(val, -1, sett, 0); + } + } + sprintf(ans,"%d",myDet->getThresholdEnergy()); + return string(ans); + } else if (cmd=="trimbits") { + if (narg>=2) { + string sval=string(args[1]); #ifdef VERBOSE - std::cout<< " trimfile " << sval << std::endl; + std::cout<< " trimfile " << sval << std::endl; #endif - if (action==GET_ACTION) { - //create file names - myDet->saveSettingsFile(sval, -1); - } else if (action==PUT_ACTION) { - myDet->loadSettingsFile(sval,-1); - } - } - return string(myDet->getSettingsFile()); - } else if (cmd=="trim") { - if (action==GET_ACTION) - return string("cannot get!"); + if (action==GET_ACTION) { + //create file names + myDet->saveSettingsFile(sval, -1); + } else if (action==PUT_ACTION) { + myDet->loadSettingsFile(sval,-1); + } + } + return string(myDet->getSettingsFile()); + } else if (cmd=="trim") { + if (action==GET_ACTION) + return string("cannot get!"); - trimMode mode=NOISE_TRIMMING; - int par1=0, par2=0; - if (string(args[0]).find("trim:")==string::npos) - return helpSettings(narg,args,action); - else if (string(args[0]).find("noise")!=string::npos) { - // par1 is countlim; par2 is nsigma - mode=NOISE_TRIMMING; - par1=500; - par2=4; - } else if (string(args[0]).find("beam")!=string::npos){ - // par1 is countlim; par2 is nsigma - mode=BEAM_TRIMMING; - par1=1000; - par2=4; - } else if (string(args[0]).find("improve")!=string::npos) { - // par1 is maxit; if par2!=0 vthresh will be optimized - mode=IMPROVE_TRIMMING; - par1=5; - par2=0; - } else if (string(args[0]).find("fix")!=string::npos) { - // par1 is countlim; if par2<0 then trimwithlevel else trim with median - mode=FIXEDSETTINGS_TRIMMING; - par1=1000; - par2=1; - // }else if (string(args[0]).find("fix")!=string::npos) { - //mode=OFFLINE_TRIMMING; - } else { - return string("Unknown trim mode ")+cmd; - } - myDet->executeTrimming(mode, par1, par2); - string sval=string(args[1]); - myDet->saveSettingsFile(sval, -1); - return string("done"); - - } else if (cmd=="trimval") { - if (action==PUT_ACTION){ - if (sscanf(args[1],"%d",&val)) - myDet->setAllTrimbits(val); - else - return string("invalid trimbit value ")+cmd; - } - sprintf(ans,"%d",myDet->setAllTrimbits(-1)); - return ans; - } else if (cmd=="pedestal") { - if (action==GET_ACTION) - return string("cannot get"); - if (sscanf(args[1],"%d",&val)){ - sprintf(ans,"%d",myDet->calibratePedestal(val)); - return string(ans); - }else - return string("cannot parse frame number")+cmd; + trimMode mode=NOISE_TRIMMING; + int par1=0, par2=0; + if (string(args[0]).find("trim:")==string::npos) + return helpSettings(narg,args,action); + else if (string(args[0]).find("noise")!=string::npos) { + // par1 is countlim; par2 is nsigma + mode=NOISE_TRIMMING; + par1=500; + par2=4; + } else if (string(args[0]).find("beam")!=string::npos){ + // par1 is countlim; par2 is nsigma + mode=BEAM_TRIMMING; + par1=1000; + par2=4; + } else if (string(args[0]).find("improve")!=string::npos) { + // par1 is maxit; if par2!=0 vthresh will be optimized + mode=IMPROVE_TRIMMING; + par1=5; + par2=0; + } else if (string(args[0]).find("fix")!=string::npos) { + // par1 is countlim; if par2<0 then trimwithlevel else trim with median + mode=FIXEDSETTINGS_TRIMMING; + par1=1000; + par2=1; + // }else if (string(args[0]).find("fix")!=string::npos) { + //mode=OFFLINE_TRIMMING; + } else { + return string("Unknown trim mode ")+cmd; + } + myDet->executeTrimming(mode, par1, par2); + string sval=string(args[1]); + myDet->saveSettingsFile(sval, -1); + return string("done"); + + } else if (cmd=="trimval") { + if (action==PUT_ACTION){ + if (sscanf(args[1],"%d",&val)) + myDet->setAllTrimbits(val); + else + return string("invalid trimbit value ")+cmd; + } + sprintf(ans,"%d",myDet->setAllTrimbits(-1)); + return ans; + } else if (cmd=="pedestal") { + if (action==GET_ACTION) + return string("cannot get"); + if (sscanf(args[1],"%d",&val)){ + sprintf(ans,"%d",myDet->calibratePedestal(val)); + return string(ans); + }else + return string("cannot parse frame number")+cmd; + + } + return string("unknown settings command ")+cmd; - } - return string("unknown settings command ")+cmd; - } string slsDetectorCommand::helpSettings(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "settings s \n sets the settings of the detector - can be standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain" - "lownoise, dynamichg0,fixgain1,fixgain2,forceswitchg1, forceswitchg2"<< std::endl; - os << "threshold eV [sett]\n sets the detector threshold in eV. If sett is provided for eiger, uses settings sett"<< std::endl; - os << "thresholdnotb eV [sett]\n sets the detector threshold in eV without loading trimbits. If sett is provided for eiger, uses settings sett"<< std::endl; - os << "trimbits fname\n loads the trimfile fname to the detector. If no extension is specified, the serial number of each module will be attached."<< std::endl; - os << "trim:mode fname\n trims the detector according to mode (can be noise, beam, improve, fix) and saves the resulting trimbits to file fname."<< std::endl; - os << "trimval i \n sets all the trimbits to i" << std::endl; - os << "pedestal i \n starts acquisition for i frames, calculates pedestal and writes back to fpga."<< std::endl; + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "settings s \n sets the settings of the detector - can be standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain" + "lownoise, dynamichg0,fixgain1,fixgain2,forceswitchg1, forceswitchg2"<< std::endl; + os << "threshold eV [sett]\n sets the detector threshold in eV. If sett is provided for eiger, uses settings sett"<< std::endl; + os << "thresholdnotb eV [sett]\n sets the detector threshold in eV without loading trimbits. If sett is provided for eiger, uses settings sett"<< std::endl; + os << "trimbits fname\n loads the trimfile fname to the detector. If no extension is specified, the serial number of each module will be attached."<< std::endl; + os << "trim:mode fname\n trims the detector according to mode (can be noise, beam, improve, fix) and saves the resulting trimbits to file fname."<< std::endl; + os << "trimval i \n sets all the trimbits to i" << std::endl; + os << "pedestal i \n starts acquisition for i frames, calculates pedestal and writes back to fpga."<< std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION) { - os << "settings \n gets the settings of the detector"<< std::endl; - os << "threshold V\n gets the detector threshold"<< std::endl; - os << "thresholdnotb V\n gets the detector threshold"<< std::endl; - os << "trimbits [fname]\n returns the trimfile loaded on the detector. If fname is specified the trimbits are saved to file. If no extension is specified, the serial number of each module will be attached."<< std::endl; - os << "trimval \n returns the value all trimbits are set to. If they are different, returns -1." << std::endl; - } - return os.str(); + } + if (action==GET_ACTION || action==HELP_ACTION) { + os << "settings \n gets the settings of the detector"<< std::endl; + os << "threshold V\n gets the detector threshold"<< std::endl; + os << "thresholdnotb V\n gets the detector threshold"<< std::endl; + os << "trimbits [fname]\n returns the trimfile loaded on the detector. If fname is specified the trimbits are saved to file. If no extension is specified, the serial number of each module will be attached."<< std::endl; + os << "trimval \n returns the value all trimbits are set to. If they are different, returns -1." << std::endl; + } + return os.str(); } @@ -3573,106 +4058,106 @@ string slsDetectorCommand::helpSettings(int narg, char *args[], int action) { string slsDetectorCommand::cmdSN(int narg, char *args[], int action) { - char answer[1000]; + char answer[1000]; - if (action==PUT_ACTION) - return string("cannot set"); + if (action==PUT_ACTION) + return string("cannot set"); - if (action==HELP_ACTION) - return helpSN(narg, args, action); + if (action==HELP_ACTION) + return helpSN(narg, args, action); - if (cmd=="thisversion"){ - int64_t retval = myDet->getId(THIS_SOFTWARE_VERSION); - if (retval < 0) - sprintf(answer, "%d", -1); - else - sprintf(answer,"0x%lx", retval); - return string(answer); - } + if (cmd=="thisversion"){ + int64_t retval = myDet->getId(THIS_SOFTWARE_VERSION); + if (retval < 0) + sprintf(answer, "%d", -1); + else + sprintf(answer,"0x%lx", retval); + return string(answer); + } - myDet->setOnline(ONLINE_FLAG); + myDet->setOnline(ONLINE_FLAG); - if (cmd=="moduleversion") { - int ival=-1; - if (sscanf(args[0],"moduleversion:%d",&ival)) { - int64_t retval = myDet->getId(MODULE_FIRMWARE_VERSION, ival); - if (retval < 0) - sprintf(answer, "%d", -1); - else - sprintf(answer,"0x%lx", retval); - return string(answer); - } else - return string("undefined module number"); - } - if (cmd=="detectornumber") { - int64_t retval = myDet->getId(DETECTOR_SERIAL_NUMBER); - if (retval < 0) - sprintf(answer, "%d", -1); - else - sprintf(answer,"0x%lx", retval); - return string(answer); - } - if (cmd.find("modulenumber")!=string::npos) { - int ival=-1; - if (sscanf(args[0],"modulenumber:%d",&ival)) { - int64_t retval = myDet->getId(MODULE_SERIAL_NUMBER, ival); - if (retval < 0) - sprintf(answer, "%d", -1); - else - sprintf(answer,"0x%lx", retval); - return string(answer); - } else - return string("undefined module number"); - } + if (cmd=="moduleversion") { + int ival=-1; + if (sscanf(args[0],"moduleversion:%d",&ival)) { + int64_t retval = myDet->getId(MODULE_FIRMWARE_VERSION, ival); + if (retval < 0) + sprintf(answer, "%d", -1); + else + sprintf(answer,"0x%lx", retval); + return string(answer); + } else + return string("undefined module number"); + } + if (cmd=="detectornumber") { + int64_t retval = myDet->getId(DETECTOR_SERIAL_NUMBER); + if (retval < 0) + sprintf(answer, "%d", -1); + else + sprintf(answer,"0x%lx", retval); + return string(answer); + } + if (cmd.find("modulenumber")!=string::npos) { + int ival=-1; + if (sscanf(args[0],"modulenumber:%d",&ival)) { + int64_t retval = myDet->getId(MODULE_SERIAL_NUMBER, ival); + if (retval < 0) + sprintf(answer, "%d", -1); + else + sprintf(answer,"0x%lx", retval); + return string(answer); + } else + return string("undefined module number"); + } - if (cmd=="detectorversion") { - int64_t retval = myDet->getId(DETECTOR_FIRMWARE_VERSION); - if (retval < 0) - sprintf(answer, "%d", -1); - else - sprintf(answer,"0x%lx", retval); - return string(answer); - } - - if (cmd=="softwareversion") { - int64_t retval = myDet->getId(DETECTOR_SOFTWARE_VERSION); - if (retval < 0) - sprintf(answer, "%d", -1); - else - sprintf(answer,"0x%lx", retval); - return string(answer); - } + if (cmd=="detectorversion") { + int64_t retval = myDet->getId(DETECTOR_FIRMWARE_VERSION); + if (retval < 0) + sprintf(answer, "%d", -1); + else + sprintf(answer,"0x%lx", retval); + return string(answer); + } - if (cmd=="receiverversion") { - myDet->setReceiverOnline(ONLINE_FLAG); - int64_t retval = myDet->getId(RECEIVER_VERSION); - if (retval < 0) - sprintf(answer, "%d", -1); - else - sprintf(answer,"0x%lx", retval); - return string(answer); - } - return string("unknown id mode ")+cmd; + if (cmd=="softwareversion") { + int64_t retval = myDet->getId(DETECTOR_SOFTWARE_VERSION); + if (retval < 0) + sprintf(answer, "%d", -1); + else + sprintf(answer,"0x%lx", retval); + return string(answer); + } + + if (cmd=="receiverversion") { + myDet->setReceiverOnline(ONLINE_FLAG); + int64_t retval = myDet->getId(RECEIVER_VERSION); + if (retval < 0) + sprintf(answer, "%d", -1); + else + sprintf(answer,"0x%lx", retval); + return string(answer); + } + return string("unknown id mode ")+cmd; } string slsDetectorCommand::helpSN(int narg, char *args[], int action) { - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) { - os << "moduleversion:i \n gets the firmwareversion of the module i"<< std::endl; - os << "modulenumber:i \n gets the serial number of the module i"<< std::endl; - os << "detectornumber \n gets the serial number of the detector (MAC)"<< std::endl; - os << "detectorversion \n gets the firmware version of the detector"<< std::endl; - os << "softwareversion \n gets the software version of the detector"<< std::endl; - os << "thisversion \n gets the version of this software"<< std::endl; - os << "receiverversion \n gets the version of the receiver"<< std::endl; - } - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) { + os << "moduleversion:i \n gets the firmwareversion of the module i"<< std::endl; + os << "modulenumber:i \n gets the serial number of the module i"<< std::endl; + os << "detectornumber \n gets the serial number of the detector (MAC)"<< std::endl; + os << "detectorversion \n gets the firmware version of the detector"<< std::endl; + os << "softwareversion \n gets the software version of the detector"<< std::endl; + os << "thisversion \n gets the version of this software"<< std::endl; + os << "receiverversion \n gets the version of the receiver"<< std::endl; + } + return os.str(); @@ -3681,195 +4166,195 @@ string slsDetectorCommand::helpSN(int narg, char *args[], int action) { string slsDetectorCommand::cmdDigiTest(int narg, char *args[], int action) { - char answer[1000]; + char answer[1000]; - if (action==HELP_ACTION) - return helpSN(narg, args, action); + if (action==HELP_ACTION) + return helpSN(narg, args, action); - myDet->setOnline(ONLINE_FLAG); + myDet->setOnline(ONLINE_FLAG); - if (cmd=="bustest"){ - if (action==PUT_ACTION) - return string("cannot set ")+cmd; - sprintf(answer,"0x%x",myDet->digitalTest(DETECTOR_BUS_TEST)); - return string(answer); - } + if (cmd=="bustest"){ + if (action==PUT_ACTION) + return string("cannot set ")+cmd; + sprintf(answer,"0x%x",myDet->digitalTest(DETECTOR_BUS_TEST)); + return string(answer); + } - if (cmd=="digitest") { - if (action==PUT_ACTION) - return string("cannot set ")+cmd; - int ival=-1; - if (sscanf(args[0],"digitest:%d",&ival)) { - sprintf(answer,"0x%x",myDet->digitalTest(CHIP_TEST, ival)); - return string(answer); - } else - return string("undefined module number"); - } + if (cmd=="digitest") { + if (action==PUT_ACTION) + return string("cannot set ")+cmd; + int ival=-1; + if (sscanf(args[0],"digitest:%d",&ival)) { + sprintf(answer,"0x%x",myDet->digitalTest(CHIP_TEST, ival)); + return string(answer); + } else + return string("undefined module number"); + } - if (cmd=="digibittest") { - if (action==GET_ACTION) - return string("cannot get ")+cmd; - int ival=-1; - if (sscanf(args[1],"%d",&ival)) { - if((ival==0)||(ival==1)){ - sprintf(answer,"0x%x",myDet->digitalTest(DIGITAL_BIT_TEST,ival)); - return string(answer); - } - else - return string("Use only 0 or 1 to set/clear digital test bit\n"); - } else - return string("undefined number"); - } + if (cmd=="digibittest") { + if (action==GET_ACTION) + return string("cannot get ")+cmd; + int ival=-1; + if (sscanf(args[1],"%d",&ival)) { + if((ival==0)||(ival==1)){ + sprintf(answer,"0x%x",myDet->digitalTest(DIGITAL_BIT_TEST,ival)); + return string(answer); + } + else + return string("Use only 0 or 1 to set/clear digital test bit\n"); + } else + return string("undefined number"); + } - - return string("unknown digital test mode ")+cmd; + + return string("unknown digital test mode ")+cmd; } string slsDetectorCommand::helpDigiTest(int narg, char *args[], int action) { - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) { - os << "digitaltest:i \t performs digital test of the module i. Returns 0 if succeeded, otherwise error mask."<< std::endl; - os << "bustest \t performs test of the bus interface between FPGA and embedded Linux system. Can last up to a few minutes."<< std::endl; - } - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "digibittest i\t will perform test which will plot the unique channel identifier, instead of data."<< std::endl; - } - return os.str(); + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) { + os << "digitaltest:i \t performs digital test of the module i. Returns 0 if succeeded, otherwise error mask."<< std::endl; + os << "bustest \t performs test of the bus interface between FPGA and embedded Linux system. Can last up to a few minutes."<< std::endl; + } + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "digibittest i\t will perform test which will plot the unique channel identifier, instead of data."<< std::endl; + } + return os.str(); } string slsDetectorCommand::cmdRegister(int narg, char *args[], int action) { - - - if (action==HELP_ACTION) - return helpRegister(narg, args, action); - - int addr, val,n; - char answer[1000]; - - myDet->setOnline(ONLINE_FLAG); - - - // "reg" // - - // "setbit" // - - // "clearbit" // - - // "getbit" // - - if (action==PUT_ACTION) { - if (cmd=="getbit") - return string("Cannot put"); - - if(narg<3) { - if (cmd=="reg") - return string("wrong usage: should specify both address and value (hexadecimal fomat) "); - else - return string("wrong usage: should specify both address (hexadecimal fomat) and bit number"); - - } + if (action==HELP_ACTION) + return helpRegister(narg, args, action); - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan address (hexadecimal fomat) ")+string(args[1]); + int addr, val,n; + char answer[1000]; - - if (cmd=="reg") { - if (sscanf(args[2],"%x",&val)) - ; - else - return string("Could not scan value (hexadecimal fomat) ")+string(args[2]); - sprintf(answer,"0x%x",myDet->writeRegister(addr,val)); - } else if (cmd=="adcreg") { - if (sscanf(args[2],"%x",&val)) - ; - else - return string("Could not scan value (hexadecimal fomat) ")+string(args[2]); - sprintf(answer,"0x%x",myDet->writeAdcRegister(addr,val)); - } else { - - if (sscanf(args[2],"%d",&n)) - ; - else - return string("Could not scan bit number ")+string(args[2]); - - if (n<0 || n>31) - return string("Bit number out of range")+string(args[2]); - - if (cmd=="setbit") - sprintf(answer,"0x%x",myDet->writeRegister(addr,myDet->readRegister(addr)| 1<writeRegister(addr,myDet->readRegister(addr) & ~(1<setOnline(ONLINE_FLAG); - } else { - if (cmd=="setbit") - return string("Cannot get"); - if (cmd=="clearbit") - return string("Cannot get"); - if (cmd=="adcreg") - return string("Cannot get"); + // "reg" // - if (cmd=="reg") { - if (narg<2) - return string("wrong usage: should specify address (hexadecimal fomat) "); - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan address (hexadecimal fomat) ")+string(args[1]); - - - sprintf(answer,"0x%x",myDet->readRegister(addr)); + // "setbit" // - } - - if (cmd=="getbit") { + // "clearbit" // - if(narg<3) - return string("wrong usage: should specify both address (hexadecimal fomat) and bit number"); + // "getbit" // - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan address (hexadecimal fomat) ")+string(args[1]); - - if (sscanf(args[2],"%d",&n)) - ; - else - return string("Could not scan bit number ")+string(args[2]); - - if (n<0 || n>31) - return string("Bit number out of range")+string(args[2]); - - sprintf(answer,"%d",(myDet->readRegister(addr) >> n) & 1); - } - } + if (action==PUT_ACTION) { + if (cmd=="getbit") + return string("Cannot put"); - return string(answer); + if(narg<3) { + if (cmd=="reg") + return string("wrong usage: should specify both address and value (hexadecimal fomat) "); + else + return string("wrong usage: should specify both address (hexadecimal fomat) and bit number"); + + } + + if (sscanf(args[1],"%x",&addr)) + ; + else + return string("Could not scan address (hexadecimal fomat) ")+string(args[1]); + + + if (cmd=="reg") { + if (sscanf(args[2],"%x",&val)) + ; + else + return string("Could not scan value (hexadecimal fomat) ")+string(args[2]); + sprintf(answer,"0x%x",myDet->writeRegister(addr,val)); + } else if (cmd=="adcreg") { + if (sscanf(args[2],"%x",&val)) + ; + else + return string("Could not scan value (hexadecimal fomat) ")+string(args[2]); + sprintf(answer,"0x%x",myDet->writeAdcRegister(addr,val)); + } else { + + if (sscanf(args[2],"%d",&n)) + ; + else + return string("Could not scan bit number ")+string(args[2]); + + if (n<0 || n>31) + return string("Bit number out of range")+string(args[2]); + + if (cmd=="setbit") + sprintf(answer,"0x%x",myDet->writeRegister(addr,myDet->readRegister(addr)| 1<writeRegister(addr,myDet->readRegister(addr) & ~(1<readRegister(addr)); + + } + + if (cmd=="getbit") { + + if(narg<3) + return string("wrong usage: should specify both address (hexadecimal fomat) and bit number"); + + + if (sscanf(args[1],"%x",&addr)) + ; + else + return string("Could not scan address (hexadecimal fomat) ")+string(args[1]); + + if (sscanf(args[2],"%d",&n)) + ; + else + return string("Could not scan bit number ")+string(args[2]); + + if (n<0 || n>31) + return string("Bit number out of range")+string(args[2]); + + + sprintf(answer,"%d",(myDet->readRegister(addr) >> n) & 1); + } + } + + return string(answer); } string slsDetectorCommand::helpRegister(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "reg addr val \n writes the register addr with the value val (hexadecimal format)"<< std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION) { - os << "reg addr \n reads the register addr"<< std::endl; - } - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "reg addr val \n writes the register addr with the value val (hexadecimal format)"<< std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION) { + os << "reg addr \n reads the register addr"<< std::endl; + } + return os.str(); @@ -3878,509 +4363,509 @@ string slsDetectorCommand::helpRegister(int narg, char *args[], int action) { string slsDetectorCommand::cmdDAC(int narg, char *args[], int action) { - if (action==HELP_ACTION) - return helpDAC(narg, args, action); + if (action==HELP_ACTION) + return helpDAC(narg, args, action); - dacIndex dac; - dacs_t val=-1; - char answer[1000]; - int mode=0; + dacIndex dac; + dacs_t val=-1; + char answer[1000]; + int mode=0; - int idac=-1; - if (sscanf(args[0],"dac:%d",&idac)==1) { - printf("chiptestboard!\n"); - dac=(dacIndex)idac; - } - else if (cmd=="adcvpp") - dac=ADC_VPP; - else if (cmd=="vthreshold") - dac=THRESHOLD; - else if (cmd=="vcalibration") - dac=CALIBRATION_PULSE; - else if (cmd=="vtrimbit") - dac=TRIMBIT_SIZE; - else if (cmd=="vpreamp") - dac=PREAMP; - else if (cmd=="vshaper1") - dac=SHAPER1; - else if (cmd=="vshaper2") - dac=SHAPER2; - else if (cmd=="vhighvoltage") - dac=HV_NEW; - else if (cmd=="vapower") - dac=VA_POT; - else if (cmd=="vddpower") - dac=VDD_POT; - else if (cmd=="vshpower") - dac=VSH_POT; - else if (cmd=="viopower") - dac=VIO_POT; - else if (cmd=="vref_ds") - dac=G_VREF_DS; - else if (cmd=="vcascn_pb") - dac=G_VCASCN_PB; - else if (cmd=="vcascp_pb") - dac=G_VCASCP_PB; - else if (cmd=="vout_cm") - dac=G_VOUT_CM; - else if (cmd=="vcasc_out") - dac=G_VCASC_OUT; - else if (cmd=="vin_cm") - dac=G_VIN_CM; - else if (cmd=="vref_comp") - dac=G_VREF_COMP; - else if (cmd=="ib_test_c") - dac=G_IB_TESTC; + int idac=-1; + if (sscanf(args[0],"dac:%d",&idac)==1) { + printf("chiptestboard!\n"); + dac=(dacIndex)idac; + } + else if (cmd=="adcvpp") + dac=ADC_VPP; + else if (cmd=="vthreshold") + dac=THRESHOLD; + else if (cmd=="vcalibration") + dac=CALIBRATION_PULSE; + else if (cmd=="vtrimbit") + dac=TRIMBIT_SIZE; + else if (cmd=="vpreamp") + dac=PREAMP; + else if (cmd=="vshaper1") + dac=SHAPER1; + else if (cmd=="vshaper2") + dac=SHAPER2; + else if (cmd=="vhighvoltage") + dac=HV_NEW; + else if (cmd=="vapower") + dac=VA_POT; + else if (cmd=="vddpower") + dac=VDD_POT; + else if (cmd=="vshpower") + dac=VSH_POT; + else if (cmd=="viopower") + dac=VIO_POT; + else if (cmd=="vref_ds") + dac=G_VREF_DS; + else if (cmd=="vcascn_pb") + dac=G_VCASCN_PB; + else if (cmd=="vcascp_pb") + dac=G_VCASCP_PB; + else if (cmd=="vout_cm") + dac=G_VOUT_CM; + else if (cmd=="vcasc_out") + dac=G_VCASC_OUT; + else if (cmd=="vin_cm") + dac=G_VIN_CM; + else if (cmd=="vref_comp") + dac=G_VREF_COMP; + else if (cmd=="ib_test_c") + dac=G_IB_TESTC; - else if (cmd=="dac0") - dac=V_DAC0; - else if (cmd=="dac1") - dac=V_DAC1; - else if (cmd=="dac2") - dac=V_DAC2; - else if (cmd=="dac3") - dac=V_DAC3; - else if (cmd=="dac4") - dac=V_DAC4; - else if (cmd=="dac5") - dac=V_DAC5; - else if (cmd=="dac6") - dac=V_DAC6; - else if (cmd=="dac7") - dac=V_DAC7; + else if (cmd=="dac0") + dac=V_DAC0; + else if (cmd=="dac1") + dac=V_DAC1; + else if (cmd=="dac2") + dac=V_DAC2; + else if (cmd=="dac3") + dac=V_DAC3; + else if (cmd=="dac4") + dac=V_DAC4; + else if (cmd=="dac5") + dac=V_DAC5; + else if (cmd=="dac6") + dac=V_DAC6; + else if (cmd=="dac7") + dac=V_DAC7; - else if (cmd== "vsvp") - dac=E_SvP; - else if (cmd=="vsvn") - dac=E_SvN; - else if (cmd=="vtr") - dac=E_Vtr; - else if (cmd=="vrf") - dac=E_Vrf; - else if (cmd=="vrs") - dac=E_Vrs; - else if (cmd== "vtgstv") - dac=E_Vtgstv; - else if (cmd== "vcmp_ll") - dac=E_Vcmp_ll; - else if (cmd=="vcmp_lr") - dac=E_Vcmp_lr; - else if (cmd== "vcall") - dac=E_cal; - else if (cmd== "vcmp_rl") - dac=E_Vcmp_rl; - else if (cmd== "vcmp_rr") - dac=E_Vcmp_rr; - else if (cmd== "rxb_rb") - dac=E_rxb_rb; - else if (cmd== "rxb_lb") - dac=E_rxb_lb; - else if (cmd== "vcp") - dac=E_Vcp; - else if (cmd=="vcn") - dac=E_Vcn; - else if (cmd== "vis") - dac=E_Vis; - else if (cmd== "iodelay") - dac=IO_DELAY; - else if (cmd== "v_a") - dac=V_POWER_A; - else if (cmd== "v_b") - dac=V_POWER_B; - else if (cmd== "v_c") - dac=V_POWER_C; - else if (cmd== "v_d") - dac=V_POWER_D; - else if (cmd== "v_io") - dac=V_POWER_IO; - else if (cmd== "v_chip") - dac=V_POWER_CHIP; - else if (cmd== "v_limit") - dac=V_LIMIT; - else - return string("cannot decode dac ")+cmd; - - myDet->setOnline(ONLINE_FLAG); + else if (cmd== "vsvp") + dac=E_SvP; + else if (cmd=="vsvn") + dac=E_SvN; + else if (cmd=="vtr") + dac=E_Vtr; + else if (cmd=="vrf") + dac=E_Vrf; + else if (cmd=="vrs") + dac=E_Vrs; + else if (cmd== "vtgstv") + dac=E_Vtgstv; + else if (cmd== "vcmp_ll") + dac=E_Vcmp_ll; + else if (cmd=="vcmp_lr") + dac=E_Vcmp_lr; + else if (cmd== "vcall") + dac=E_cal; + else if (cmd== "vcmp_rl") + dac=E_Vcmp_rl; + else if (cmd== "vcmp_rr") + dac=E_Vcmp_rr; + else if (cmd== "rxb_rb") + dac=E_rxb_rb; + else if (cmd== "rxb_lb") + dac=E_rxb_lb; + else if (cmd== "vcp") + dac=E_Vcp; + else if (cmd=="vcn") + dac=E_Vcn; + else if (cmd== "vis") + dac=E_Vis; + else if (cmd== "iodelay") + dac=IO_DELAY; + else if (cmd== "v_a") + dac=V_POWER_A; + else if (cmd== "v_b") + dac=V_POWER_B; + else if (cmd== "v_c") + dac=V_POWER_C; + else if (cmd== "v_d") + dac=V_POWER_D; + else if (cmd== "v_io") + dac=V_POWER_IO; + else if (cmd== "v_chip") + dac=V_POWER_CHIP; + else if (cmd== "v_limit") + dac=V_LIMIT; + else + return string("cannot decode dac ")+cmd; - if (action==PUT_ACTION) { + myDet->setOnline(ONLINE_FLAG); - if(narg >= 3) - if(!strcasecmp(args[2],"mv")) - mode = 1; + if (action==PUT_ACTION) { + + if(narg >= 3) + if(!strcasecmp(args[2],"mv")) + mode = 1; #ifdef DACS_INT - if (sscanf(args[1],"%d", &val)) + if (sscanf(args[1],"%d", &val)) #else - if (sscanf(args[1],"%f", &val)) + if (sscanf(args[1],"%f", &val)) #endif - ; - else - return string("cannot scan DAC value ")+string(args[1]); + ; + else + return string("cannot scan DAC value ")+string(args[1]); - myDet->setDAC(val,dac,mode); - } - - else if(narg >= 2) - if(!strcasecmp(args[1],"mv")) - mode = 1; + myDet->setDAC(val,dac,mode); + } + + else if(narg >= 2) + if(!strcasecmp(args[1],"mv")) + mode = 1; #ifdef DACS_INT - sprintf(answer,"%d",myDet->setDAC(-1,dac,mode)); + sprintf(answer,"%d",myDet->setDAC(-1,dac,mode)); #else - sprintf(answer,"%f",myDet->setDAC(-1,dac,mode)); + sprintf(answer,"%f",myDet->setDAC(-1,dac,mode)); #endif - if(mode) - strcat(answer," mV"); - return string(answer); + if(mode) + strcat(answer," mV"); + return string(answer); } string slsDetectorCommand::helpDAC(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "vthreshold dacu\t sets the detector threshold in dac units (0-1024) or mV. The energy is approx 800-15*keV" << std::endl; - os << std::endl; + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "vthreshold dacu\t sets the detector threshold in dac units (0-1024) or mV. The energy is approx 800-15*keV" << std::endl; + os << std::endl; - os << "vcalibration " << "dacu\t sets the calibration pulse amplitude in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vtrimbit " << "dacu\t sets the trimbit amplitude in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vpreamp " << "dacu\t sets the preamp feedback voltage in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vshaper1 " << "dacu\t sets the shaper1 feedback voltage in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vshaper2 " << "dacu\t sets the shaper2 feedback voltage in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vhighvoltage " << "dacu\t CHIPTEST BOARD ONLY - sets the detector HV in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vapower " << "dacu\t CHIPTEST BOARD ONLY - sets the analog power supply in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vddpower " << "dacu\t CHIPTEST BOARD ONLY - sets the digital power supply in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vshpower " << "dacu\t CHIPTEST BOARD ONLY - sets the comparator power supply in dac units (0-1024)." << std::endl; - os << std::endl; - os << "viopower " << "dacu\t CHIPTEST BOARD ONLY - sets the FPGA I/O power supply in dac units (0-1024)." << std::endl; + os << "vcalibration " << "dacu\t sets the calibration pulse amplitude in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vtrimbit " << "dacu\t sets the trimbit amplitude in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vpreamp " << "dacu\t sets the preamp feedback voltage in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vshaper1 " << "dacu\t sets the shaper1 feedback voltage in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vshaper2 " << "dacu\t sets the shaper2 feedback voltage in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vhighvoltage " << "dacu\t CHIPTEST BOARD ONLY - sets the detector HV in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vapower " << "dacu\t CHIPTEST BOARD ONLY - sets the analog power supply in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vddpower " << "dacu\t CHIPTEST BOARD ONLY - sets the digital power supply in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vshpower " << "dacu\t CHIPTEST BOARD ONLY - sets the comparator power supply in dac units (0-1024)." << std::endl; + os << std::endl; + os << "viopower " << "dacu\t CHIPTEST BOARD ONLY - sets the FPGA I/O power supply in dac units (0-1024)." << std::endl; - os << "vrefds " << "dacu\t sets vrefds" << std::endl; - os << "vcascn_pb " << "dacu\t sets vcascn_pb" << std::endl; - os << "vcascp_pb " << "dacu\t sets vcascp_pb" << std::endl; - os << "vout_cm " << "dacu\t sets vout_cm" << std::endl; - os << "vin_cm " << "dacu\t sets vin_cm" << std::endl; - os << "vcasc_out " << "dacu\t sets vcasc_out" << std::endl; - os << "vref_comp " << "dacu\t sets vref_comp" << std::endl; - os << "ib_test_c " << "dacu\t sets ib_test_c" << std::endl; + os << "vrefds " << "dacu\t sets vrefds" << std::endl; + os << "vcascn_pb " << "dacu\t sets vcascn_pb" << std::endl; + os << "vcascp_pb " << "dacu\t sets vcascp_pb" << std::endl; + os << "vout_cm " << "dacu\t sets vout_cm" << std::endl; + os << "vin_cm " << "dacu\t sets vin_cm" << std::endl; + os << "vcasc_out " << "dacu\t sets vcasc_out" << std::endl; + os << "vref_comp " << "dacu\t sets vref_comp" << std::endl; + os << "ib_test_c " << "dacu\t sets ib_test_c" << std::endl; - os << "dac0 " << "dacu\t sets dac 0" << std::endl; - os << "dac1 " << "dacu\t sets dac 1" << std::endl; - os << "dac2 " << "dacu\t sets dac 2" << std::endl; - os << "dac3 " << "dacu\t sets dac 3" << std::endl; - os << "dac4 " << "dacu\t sets dac 4" << std::endl; - os << "dac5 " << "dacu\t sets dac 5" << std::endl; - os << "dac6 " << "dacu\t sets dac 6" << std::endl; - os << "dac7 " << "dacu\t sets dac 7" << std::endl; + os << "dac0 " << "dacu\t sets dac 0" << std::endl; + os << "dac1 " << "dacu\t sets dac 1" << std::endl; + os << "dac2 " << "dacu\t sets dac 2" << std::endl; + os << "dac3 " << "dacu\t sets dac 3" << std::endl; + os << "dac4 " << "dacu\t sets dac 4" << std::endl; + os << "dac5 " << "dacu\t sets dac 5" << std::endl; + os << "dac6 " << "dacu\t sets dac 6" << std::endl; + os << "dac7 " << "dacu\t sets dac 7" << std::endl; - os << "vsvp" << "dacu\t sets vsvp" << std::endl; - os << "vsvn" << "dacu\t sets vsvn" << std::endl; - os << "vtr" << "dacu\t sets vtr" << std::endl; - os << "vrf" << "dacu\t sets vrf" << std::endl; - os << "vrs" << "dacu\t sets vrs" << std::endl; - os << "vtgstv" << "dacu\t sets vtgstv" << std::endl; - os << "vcmp_ll" << "dacu\t sets vcmp_ll" << std::endl; - os << "vcmp_lr" << "dacu\t sets vcmp_lr" << std::endl; - os << "vcall" << "dacu\t sets vcall" << std::endl; - os << "vcmp_rl" << "dacu\t sets vcmp_rl" << std::endl; - os << "vcmp_rr" << "dacu\t sets vcmp_rr" << std::endl; - os << "rxb_rb" << "dacu\t sets rxb_rb" << std::endl; - os << "rxb_lb" << "dacu\t sets rxb_lb" << std::endl; - os << "vcp" << "dacu\t sets vcp " << std::endl; - os << "vcn" << "dacu\t sets vcn " << std::endl; - os << "vis" << "dacu\t sets vis " << std::endl; + os << "vsvp" << "dacu\t sets vsvp" << std::endl; + os << "vsvn" << "dacu\t sets vsvn" << std::endl; + os << "vtr" << "dacu\t sets vtr" << std::endl; + os << "vrf" << "dacu\t sets vrf" << std::endl; + os << "vrs" << "dacu\t sets vrs" << std::endl; + os << "vtgstv" << "dacu\t sets vtgstv" << std::endl; + os << "vcmp_ll" << "dacu\t sets vcmp_ll" << std::endl; + os << "vcmp_lr" << "dacu\t sets vcmp_lr" << std::endl; + os << "vcall" << "dacu\t sets vcall" << std::endl; + os << "vcmp_rl" << "dacu\t sets vcmp_rl" << std::endl; + os << "vcmp_rr" << "dacu\t sets vcmp_rr" << std::endl; + os << "rxb_rb" << "dacu\t sets rxb_rb" << std::endl; + os << "rxb_lb" << "dacu\t sets rxb_lb" << std::endl; + os << "vcp" << "dacu\t sets vcp " << std::endl; + os << "vcn" << "dacu\t sets vcn " << std::endl; + os << "vis" << "dacu\t sets vis " << std::endl; - os << " mv if you want in mV else in dac units " << std::endl; - } + os << " mv if you want in mV else in dac units " << std::endl; + } - if (action==GET_ACTION || action==HELP_ACTION) { + if (action==GET_ACTION || action==HELP_ACTION) { - os << "vthreshold \t Gets the detector threshold in dac units (0-1024). The energy is approx 800-15*keV" << std::endl; - os << std::endl; + os << "vthreshold \t Gets the detector threshold in dac units (0-1024). The energy is approx 800-15*keV" << std::endl; + os << std::endl; - os << "vcalibration " << "dacu\t gets the calibration pulse amplitude in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vtrimbit " << "dacu\t gets the trimbit amplitude in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vpreamp " << "dacu\t gets the preamp feedback voltage in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vshaper1 " << "dacu\t gets the shaper1 feedback voltage in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vshaper2 " << "dacu\t gets the shaper2 feedback voltage in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vhighvoltage " << "dacu\t CHIPTEST BOARD ONLY - gets the detector HV in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vapower " << "dacu\t CHIPTEST BOARD ONLY - gets the analog power supply in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vddpower " << "dacu\t CHIPTEST BOARD ONLY - gets the digital power supply in dac units (0-1024)." << std::endl; - os << std::endl; - os << "vshpower " << "dacu\t CHIPTEST BOARD ONLY - gets the comparator power supply in dac units (0-1024)." << std::endl; - os << std::endl; - os << "viopower " << "dacu\t CHIPTEST BOARD ONLY - gets the FPGA I/O power supply in dac units (0-1024)." << std::endl; - os << std::endl; + os << "vcalibration " << "dacu\t gets the calibration pulse amplitude in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vtrimbit " << "dacu\t gets the trimbit amplitude in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vpreamp " << "dacu\t gets the preamp feedback voltage in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vshaper1 " << "dacu\t gets the shaper1 feedback voltage in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vshaper2 " << "dacu\t gets the shaper2 feedback voltage in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vhighvoltage " << "dacu\t CHIPTEST BOARD ONLY - gets the detector HV in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vapower " << "dacu\t CHIPTEST BOARD ONLY - gets the analog power supply in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vddpower " << "dacu\t CHIPTEST BOARD ONLY - gets the digital power supply in dac units (0-1024)." << std::endl; + os << std::endl; + os << "vshpower " << "dacu\t CHIPTEST BOARD ONLY - gets the comparator power supply in dac units (0-1024)." << std::endl; + os << std::endl; + os << "viopower " << "dacu\t CHIPTEST BOARD ONLY - gets the FPGA I/O power supply in dac units (0-1024)." << std::endl; + os << std::endl; - os << "vrefds " << "\t gets vrefds" << std::endl; - os << "vcascn_pb " << "\t gets vcascn_pb" << std::endl; - os << "vcascp_pb " << "\t gets vcascp_pb" << std::endl; - os << "vout_cm " << "\t gets vout_cm" << std::endl; - os << "vin_cm " << "\t gets vin_cm" << std::endl; - os << "vcasc_out " << "\t gets vcasc_out" << std::endl; - os << "vref_comp " << "\t gets vref_comp" << std::endl; - os << "ib_test_c " << "\t gets ib_test_c" << std::endl; + os << "vrefds " << "\t gets vrefds" << std::endl; + os << "vcascn_pb " << "\t gets vcascn_pb" << std::endl; + os << "vcascp_pb " << "\t gets vcascp_pb" << std::endl; + os << "vout_cm " << "\t gets vout_cm" << std::endl; + os << "vin_cm " << "\t gets vin_cm" << std::endl; + os << "vcasc_out " << "\t gets vcasc_out" << std::endl; + os << "vref_comp " << "\t gets vref_comp" << std::endl; + os << "ib_test_c " << "\t gets ib_test_c" << std::endl; - os << "dac0 " << "\t gets dac 0" << std::endl; - os << "dac1 " << "\t gets dac 1" << std::endl; - os << "dac2 " << "\t gets dac 2" << std::endl; - os << "dac3 " << "\t gets dac 3" << std::endl; - os << "dac4 " << "\t gets dac 4" << std::endl; - os << "dac5 " << "\t gets dac 5" << std::endl; - os << "dac6 " << "\t gets dac 6" << std::endl; - os << "dac7 " << "\t gets dac 7" << std::endl; + os << "dac0 " << "\t gets dac 0" << std::endl; + os << "dac1 " << "\t gets dac 1" << std::endl; + os << "dac2 " << "\t gets dac 2" << std::endl; + os << "dac3 " << "\t gets dac 3" << std::endl; + os << "dac4 " << "\t gets dac 4" << std::endl; + os << "dac5 " << "\t gets dac 5" << std::endl; + os << "dac6 " << "\t gets dac 6" << std::endl; + os << "dac7 " << "\t gets dac 7" << std::endl; - os << "vsvp" << "dacu\t gets vsvp" << std::endl; - os << "vsvn" << "dacu\t gets vsvn" << std::endl; - os << "vtr" << "dacu\t gets vtr" << std::endl; - os << "vrf" << "dacu\t gets vrf" << std::endl; - os << "vrs" << "dacu\t gets vrs" << std::endl; - os << "vtgstv" << "dacu\t gets vtgstv" << std::endl; - os << "vcmp_ll" << "dacu\t gets vcmp_ll" << std::endl; - os << "vcmp_lr" << "dacu\t gets vcmp_lr" << std::endl; - os << "vcall" << "dacu\t gets vcall" << std::endl; - os << "vcmp_rl" << "dacu\t gets vcmp_rl" << std::endl; - os << "vcmp_rr" << "dacu\t gets vcmp_rr" << std::endl; - os << "rxb_rb" << "dacu\t gets rxb_rb" << std::endl; - os << "rxb_lb" << "dacu\t gets rxb_lb" << std::endl; - os << "vcp" << "dacu\t gets vcp " << std::endl; - os << "vcn" << "dacu\t gets vcn " << std::endl; - os << "vis" << "dacu\t gets vis " << std::endl; + os << "vsvp" << "dacu\t gets vsvp" << std::endl; + os << "vsvn" << "dacu\t gets vsvn" << std::endl; + os << "vtr" << "dacu\t gets vtr" << std::endl; + os << "vrf" << "dacu\t gets vrf" << std::endl; + os << "vrs" << "dacu\t gets vrs" << std::endl; + os << "vtgstv" << "dacu\t gets vtgstv" << std::endl; + os << "vcmp_ll" << "dacu\t gets vcmp_ll" << std::endl; + os << "vcmp_lr" << "dacu\t gets vcmp_lr" << std::endl; + os << "vcall" << "dacu\t gets vcall" << std::endl; + os << "vcmp_rl" << "dacu\t gets vcmp_rl" << std::endl; + os << "vcmp_rr" << "dacu\t gets vcmp_rr" << std::endl; + os << "rxb_rb" << "dacu\t gets rxb_rb" << std::endl; + os << "rxb_lb" << "dacu\t gets rxb_lb" << std::endl; + os << "vcp" << "dacu\t gets vcp " << std::endl; + os << "vcn" << "dacu\t gets vcn " << std::endl; + os << "vis" << "dacu\t gets vis " << std::endl; - } - return os.str(); + } + return os.str(); } string slsDetectorCommand::cmdADC(int narg, char *args[], int action) { - dacIndex adc; - int idac; - // double val=-1; - char answer[1000]; - - if (action==HELP_ACTION) - return helpADC(narg, args, action); - else if (action==PUT_ACTION) - return string("cannot set ")+cmd; - - if (sscanf(args[0],"adc:%d",&idac)==1) { - // printf("chiptestboard!\n"); - adc=(dacIndex)(idac+1000); - } else if (cmd=="temp_adc") - adc=TEMPERATURE_ADC; - else if (cmd=="temp_fpga") - adc=TEMPERATURE_FPGA; - else if (cmd=="temp_fpgaext") - adc=TEMPERATURE_FPGAEXT; - else if (cmd=="temp_10ge") - adc=TEMPERATURE_10GE; - else if (cmd=="temp_dcdc") - adc=TEMPERATURE_DCDC; - else if (cmd=="temp_sodl") - adc=TEMPERATURE_SODL; - else if (cmd=="temp_sodr") - adc=TEMPERATURE_SODR; - else if (cmd=="temp_fpgafl") - adc=TEMPERATURE_FPGA2; - else if (cmd=="temp_fpgafr") - adc=TEMPERATURE_FPGA3; - else if (cmd=="i_a") - adc=I_POWER_A; - else if (cmd=="i_b") - adc=I_POWER_B; - else if (cmd=="i_c") - adc=I_POWER_C; - else if (cmd=="i_d") - adc=I_POWER_D; - else if (cmd=="vm_a") - adc=V_POWER_A; - else if (cmd=="vm_b") - adc=V_POWER_B; - else if (cmd=="vm_c") - adc=V_POWER_C; - else if (cmd=="vm_d") - adc=V_POWER_D; - else if (cmd=="vm_io") - adc=V_POWER_IO; - else if (cmd=="i_io") - adc=I_POWER_IO; - else - return string("cannot decode adc ")+cmd; + dacIndex adc; + int idac; + // double val=-1; + char answer[1000]; - myDet->setOnline(ONLINE_FLAG); + if (action==HELP_ACTION) + return helpADC(narg, args, action); + else if (action==PUT_ACTION) + return string("cannot set ")+cmd; + + if (sscanf(args[0],"adc:%d",&idac)==1) { + // printf("chiptestboard!\n"); + adc=(dacIndex)(idac+1000); + } else if (cmd=="temp_adc") + adc=TEMPERATURE_ADC; + else if (cmd=="temp_fpga") + adc=TEMPERATURE_FPGA; + else if (cmd=="temp_fpgaext") + adc=TEMPERATURE_FPGAEXT; + else if (cmd=="temp_10ge") + adc=TEMPERATURE_10GE; + else if (cmd=="temp_dcdc") + adc=TEMPERATURE_DCDC; + else if (cmd=="temp_sodl") + adc=TEMPERATURE_SODL; + else if (cmd=="temp_sodr") + adc=TEMPERATURE_SODR; + else if (cmd=="temp_fpgafl") + adc=TEMPERATURE_FPGA2; + else if (cmd=="temp_fpgafr") + adc=TEMPERATURE_FPGA3; + else if (cmd=="i_a") + adc=I_POWER_A; + else if (cmd=="i_b") + adc=I_POWER_B; + else if (cmd=="i_c") + adc=I_POWER_C; + else if (cmd=="i_d") + adc=I_POWER_D; + else if (cmd=="vm_a") + adc=V_POWER_A; + else if (cmd=="vm_b") + adc=V_POWER_B; + else if (cmd=="vm_c") + adc=V_POWER_C; + else if (cmd=="vm_d") + adc=V_POWER_D; + else if (cmd=="vm_io") + adc=V_POWER_IO; + else if (cmd=="i_io") + adc=I_POWER_IO; + else + return string("cannot decode adc ")+cmd; + + myDet->setOnline(ONLINE_FLAG); #ifdef DACS_INT - if (myDet->getDetectorsType() == EIGER || myDet->getDetectorsType() == JUNGFRAU) - sprintf(answer,"%.2f",(double)myDet->getADC(adc)/1000.00); - else sprintf(answer,"%d",myDet->getADC(adc)); + if (myDet->getDetectorsType() == EIGER || myDet->getDetectorsType() == JUNGFRAU) + sprintf(answer,"%.2f",(double)myDet->getADC(adc)/1000.00); + else sprintf(answer,"%d",myDet->getADC(adc)); #else - sprintf(answer,"%f",myDet->getADC(adc)); + sprintf(answer,"%f",myDet->getADC(adc)); #endif - //if ((adc == TEMPERATURE_ADC) || (adc == TEMPERATURE_FPGA)) - if (adc<1000) - strcat(answer,"°C"); - else - strcat(answer,"mV"); - - return string(answer); + //if ((adc == TEMPERATURE_ADC) || (adc == TEMPERATURE_FPGA)) + if (adc<1000) + strcat(answer,"°C"); + else + strcat(answer,"mV"); + + return string(answer); } string slsDetectorCommand::helpADC(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "temp_adc " << "Cannot be set" << std::endl; - os << "temp_fpga " << "Cannot be set" << std::endl; - os << "temp_fpgaext " << "Cannot be set" << std::endl; - os << "temp_10ge " << "Cannot be set" << std::endl; - os << "temp_dcdc " << "Cannot be set" << std::endl; - os << "temp_sodl " << "Cannot be set" << std::endl; - os << "temp_sodr " << "Cannot be set" << std::endl; - os << "temp_fpgafl " << "Cannot be set" << std::endl; - os << "temp_fpgafr " << "Cannot be set" << std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION) { - os << "temp_adc " << "\t gets the temperature of the adc" << std::endl; - os << "temp_fpga " << "\t gets the temperature of the fpga" << std::endl; - os << "temp_fpgaext " << "\t gets the temperature close to the fpga" << std::endl; - os << "temp_10ge " << "\t gets the temperature close to the 10GE" << std::endl; - os << "temp_dcdc " << "\t gets the temperature close to the dc dc converter" << std::endl; - os << "temp_sodl " << "\t gets the temperature close to the left so-dimm memory" << std::endl; - os << "temp_sodr " << "\t gets the temperature close to the right so-dimm memory" << std::endl; - os << "temp_fpgafl " << "\t gets the temperature of the left front end board fpga" << std::endl; - os << "temp_fpgafr " << "\t gets the temperature of the left front end board fpga" << std::endl; - } - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "temp_adc " << "Cannot be set" << std::endl; + os << "temp_fpga " << "Cannot be set" << std::endl; + os << "temp_fpgaext " << "Cannot be set" << std::endl; + os << "temp_10ge " << "Cannot be set" << std::endl; + os << "temp_dcdc " << "Cannot be set" << std::endl; + os << "temp_sodl " << "Cannot be set" << std::endl; + os << "temp_sodr " << "Cannot be set" << std::endl; + os << "temp_fpgafl " << "Cannot be set" << std::endl; + os << "temp_fpgafr " << "Cannot be set" << std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION) { + os << "temp_adc " << "\t gets the temperature of the adc" << std::endl; + os << "temp_fpga " << "\t gets the temperature of the fpga" << std::endl; + os << "temp_fpgaext " << "\t gets the temperature close to the fpga" << std::endl; + os << "temp_10ge " << "\t gets the temperature close to the 10GE" << std::endl; + os << "temp_dcdc " << "\t gets the temperature close to the dc dc converter" << std::endl; + os << "temp_sodl " << "\t gets the temperature close to the left so-dimm memory" << std::endl; + os << "temp_sodr " << "\t gets the temperature close to the right so-dimm memory" << std::endl; + os << "temp_fpgafl " << "\t gets the temperature of the left front end board fpga" << std::endl; + os << "temp_fpgafr " << "\t gets the temperature of the left front end board fpga" << std::endl; + } + return os.str(); } string slsDetectorCommand::cmdTiming(int narg, char *args[], int action){ #ifdef VERBOSE - cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); + cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n"); #endif - if (action==HELP_ACTION) { - return helpTiming(narg,args,HELP_ACTION); - } - myDet->setOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - if (myDet->externalCommunicationType(string(args[1]))== GET_EXTERNAL_COMMUNICATION_MODE) return helpTiming(narg,args, action); - myDet->setExternalCommunicationMode(myDet->externalCommunicationType(string(args[1]))); - } - return myDet->externalCommunicationType(myDet->setExternalCommunicationMode()); + if (action==HELP_ACTION) { + return helpTiming(narg,args,HELP_ACTION); + } + myDet->setOnline(ONLINE_FLAG); + if (action==PUT_ACTION) { + if (myDet->externalCommunicationType(string(args[1]))== GET_EXTERNAL_COMMUNICATION_MODE) return helpTiming(narg,args, action); + myDet->setExternalCommunicationMode(myDet->externalCommunicationType(string(args[1]))); + } + return myDet->externalCommunicationType(myDet->setExternalCommunicationMode()); } string slsDetectorCommand::helpTiming(int narg, char *args[], int action){ - - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) - os << string("timing \t gets the timing mode of the detector (auto, trigger, ro_trigger, gating, triggered_gating)\n"); - if (action==PUT_ACTION || action==HELP_ACTION) - os << string("timing mode \t sets synchronization mode of the detector. Can be auto, trigger, ro_trigger, gating, triggered_gating \n"); - return os.str(); + + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) + os << string("timing \t gets the timing mode of the detector (auto, trigger, ro_trigger, gating, triggered_gating)\n"); + if (action==PUT_ACTION || action==HELP_ACTION) + os << string("timing mode \t sets synchronization mode of the detector. Can be auto, trigger, ro_trigger, gating, triggered_gating \n"); + return os.str(); } string slsDetectorCommand::cmdTimer(int narg, char *args[], int action) { - timerIndex index; - int64_t t=-1, ret; - double val, rval; - - char answer[1000]; + timerIndex index; + int64_t t=-1, ret; + double val, rval; - - if (action==HELP_ACTION) - return helpTimer(narg, args, action); - - if (cmd=="exptime") - index=ACQUISITION_TIME; - else if (cmd=="subexptime") - index=SUBFRAME_ACQUISITION_TIME; - else if (cmd=="period") - index=FRAME_PERIOD; - else if (cmd=="delay") - index=DELAY_AFTER_TRIGGER; - else if (cmd=="gates") - index=GATES_NUMBER; - else if (cmd=="frames") - index=FRAME_NUMBER; - else if (cmd=="cycles") - index=CYCLES_NUMBER; - else if (cmd=="probes") - index=PROBES_NUMBER; - else if (cmd=="measurements") - index=MEASUREMENTS_NUMBER; - else if (cmd=="samples") - index=SAMPLES_JCTB; - else - return string("could not decode timer ")+cmd; + char answer[1000]; - - if (action==PUT_ACTION) { - if (sscanf(args[1],"%lf", &val)) - ;//printf("value:%0.9lf\n",val); - else - return string("cannot scan timer value ")+string(args[1]); - if (index==ACQUISITION_TIME || index==SUBFRAME_ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER) { - // t=(int64_t)(val*1E+9); for precision of eg.0.0000325, following done - val*=1E9; - t = (int64_t)val; - if(fabs(val-t)) // to validate precision loss - t = t + val - t; //even t += vak-t loses precision - }else t=(int64_t)val; - } - - - myDet->setOnline(ONLINE_FLAG); - myDet->setReceiverOnline(ONLINE_FLAG); - ret=myDet->setTimer(index,t); - if ((ret!=-1) && (index==ACQUISITION_TIME || index==SUBFRAME_ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER)) - rval=(double)ret*1E-9; - else rval=ret; + if (action==HELP_ACTION) + return helpTimer(narg, args, action); - // cout << "here!"<< endl; - //set frame index - if (index==FRAME_NUMBER || index==CYCLES_NUMBER ){ - if ((myDet->setTimer(FRAME_NUMBER,-1)*myDet->setTimer(CYCLES_NUMBER,-1))>1) { - myDet->setFrameIndex(0); - } else - myDet->setFrameIndex(-1); - } + if (cmd=="exptime") + index=ACQUISITION_TIME; + else if (cmd=="subexptime") + index=SUBFRAME_ACQUISITION_TIME; + else if (cmd=="period") + index=FRAME_PERIOD; + else if (cmd=="delay") + index=DELAY_AFTER_TRIGGER; + else if (cmd=="gates") + index=GATES_NUMBER; + else if (cmd=="frames") + index=FRAME_NUMBER; + else if (cmd=="cycles") + index=CYCLES_NUMBER; + else if (cmd=="probes") + index=PROBES_NUMBER; + else if (cmd=="measurements") + index=MEASUREMENTS_NUMBER; + else if (cmd=="samples") + index=SAMPLES_JCTB; + else + return string("could not decode timer ")+cmd; + + + if (action==PUT_ACTION) { + if (sscanf(args[1],"%lf", &val)) + ;//printf("value:%0.9lf\n",val); + else + return string("cannot scan timer value ")+string(args[1]); + if (index==ACQUISITION_TIME || index==SUBFRAME_ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER) { + // t=(int64_t)(val*1E+9); for precision of eg.0.0000325, following done + val*=1E9; + t = (int64_t)val; + if(fabs(val-t)) // to validate precision loss + t = t + val - t; //even t += vak-t loses precision + }else t=(int64_t)val; + } + + + myDet->setOnline(ONLINE_FLAG); + myDet->setReceiverOnline(ONLINE_FLAG); + + ret=myDet->setTimer(index,t); + if ((ret!=-1) && (index==ACQUISITION_TIME || index==SUBFRAME_ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER)) + rval=(double)ret*1E-9; + else rval=ret; + + // cout << "here!"<< endl; + //set frame index + if (index==FRAME_NUMBER || index==CYCLES_NUMBER ){ + if ((myDet->setTimer(FRAME_NUMBER,-1)*myDet->setTimer(CYCLES_NUMBER,-1))>1) { + myDet->setFrameIndex(0); + } else + myDet->setFrameIndex(-1); + } + + if (index==FRAME_NUMBER || index==GATES_NUMBER || index==PROBES_NUMBER || index==CYCLES_NUMBER || index==MEASUREMENTS_NUMBER) + sprintf(answer,"%d",(int)rval); + else + sprintf(answer,"%0.9f",rval); + return string(answer); - if (index==FRAME_NUMBER || index==GATES_NUMBER || index==PROBES_NUMBER || index==CYCLES_NUMBER || index==MEASUREMENTS_NUMBER) - sprintf(answer,"%d",(int)rval); - else - sprintf(answer,"%0.9f",rval); - return string(answer); - @@ -4388,36 +4873,36 @@ string slsDetectorCommand::cmdTimer(int narg, char *args[], int action) { string slsDetectorCommand::helpTimer(int narg, char *args[], int action) { - - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "exptime t \t sets the exposure time in s" << std::endl; - os << "subexptime t \t sets the exposure time of subframe in s" << std::endl; - os << "period t \t sets the frame period in s" << std::endl; - os << "delay t \t sets the delay after trigger in s" << std::endl; - os << "frames t \t sets the number of frames per cycle (e.g. after each trigger)" << std::endl; - os << "cycles t \t sets the number of cycles (e.g. number of triggers)" << std::endl; - os << "probes t \t sets the number of probes to accumulate (max 3! cycles should be set to 1, frames to the number of pump-probe events)" << std::endl; - os << "samples t \t sets the number of samples expected from the jctb" << std::endl; - os << std::endl; + + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "exptime t \t sets the exposure time in s" << std::endl; + os << "subexptime t \t sets the exposure time of subframe in s" << std::endl; + os << "period t \t sets the frame period in s" << std::endl; + os << "delay t \t sets the delay after trigger in s" << std::endl; + os << "frames t \t sets the number of frames per cycle (e.g. after each trigger)" << std::endl; + os << "cycles t \t sets the number of cycles (e.g. number of triggers)" << std::endl; + os << "probes t \t sets the number of probes to accumulate (max 3! cycles should be set to 1, frames to the number of pump-probe events)" << std::endl; + os << "samples t \t sets the number of samples expected from the jctb" << std::endl; + os << std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION) { - - os << "exptime \t gets the exposure time in s" << std::endl; - os << "subexptime \t gets the exposure time of subframe in s" << std::endl; - os << "period \t gets the frame period in s" << std::endl; - os << "delay \t gets the delay after trigger in s" << std::endl; - os << "frames \t gets the number of frames per cycle (e.g. after each trigger)" << std::endl; - os << "cycles \t gets the number of cycles (e.g. number of triggers)" << std::endl; - os << "probes \t gets the number of probes to accumulate" << std::endl; - os << "samples t \t gets the number of samples expected from the jctb" << std::endl; - - os << std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION) { - } - return os.str(); + os << "exptime \t gets the exposure time in s" << std::endl; + os << "subexptime \t gets the exposure time of subframe in s" << std::endl; + os << "period \t gets the frame period in s" << std::endl; + os << "delay \t gets the delay after trigger in s" << std::endl; + os << "frames \t gets the number of frames per cycle (e.g. after each trigger)" << std::endl; + os << "cycles \t gets the number of cycles (e.g. number of triggers)" << std::endl; + os << "probes \t gets the number of probes to accumulate" << std::endl; + os << "samples t \t gets the number of samples expected from the jctb" << std::endl; + + os << std::endl; + + } + return os.str(); @@ -4430,83 +4915,83 @@ string slsDetectorCommand::helpTimer(int narg, char *args[], int action) { string slsDetectorCommand::cmdTimeLeft(int narg, char *args[], int action) { - timerIndex index; - int64_t ret; - double rval; - - char answer[1000]; + timerIndex index; + int64_t ret; + double rval; - - if (action==HELP_ACTION) - return helpTimeLeft(narg, args, action); - - if (cmd=="exptimel") - index=ACQUISITION_TIME; - else if (cmd=="periodl") - index=FRAME_PERIOD; - else if (cmd=="delayl") - index=DELAY_AFTER_TRIGGER; - else if (cmd=="gatesl") - index=GATES_NUMBER; - else if (cmd=="framesl") - index=FRAME_NUMBER; - else if (cmd=="cyclesl") - index=CYCLES_NUMBER; - else if (cmd=="probesl") - index=PROBES_NUMBER; - else if (cmd=="now") - index=ACTUAL_TIME; - else if (cmd=="timestamp") - index=MEASUREMENT_TIME; - else if (cmd=="nframes") - index=FRAMES_FROM_START; - else - return string("could not decode timer ")+cmd; + char answer[1000]; - - if (action==PUT_ACTION) { - return string("cannot set ")+string(args[1]); - } - - - - myDet->setOnline(ONLINE_FLAG); + if (action==HELP_ACTION) + return helpTimeLeft(narg, args, action); - ret=myDet->getTimeLeft(index); + if (cmd=="exptimel") + index=ACQUISITION_TIME; + else if (cmd=="periodl") + index=FRAME_PERIOD; + else if (cmd=="delayl") + index=DELAY_AFTER_TRIGGER; + else if (cmd=="gatesl") + index=GATES_NUMBER; + else if (cmd=="framesl") + index=FRAME_NUMBER; + else if (cmd=="cyclesl") + index=CYCLES_NUMBER; + else if (cmd=="probesl") + index=PROBES_NUMBER; + else if (cmd=="now") + index=ACTUAL_TIME; + else if (cmd=="timestamp") + index=MEASUREMENT_TIME; + else if (cmd=="nframes") + index=FRAMES_FROM_START; + else + return string("could not decode timer ")+cmd; + + + if (action==PUT_ACTION) { + return string("cannot set ")+string(args[1]); + } + + + + + myDet->setOnline(ONLINE_FLAG); + + ret=myDet->getTimeLeft(index); + + if (index==ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER || index==ACTUAL_TIME || index==MEASUREMENT_TIME) + rval=(double)ret*1E-9; + else rval=ret; + + + sprintf(answer,"%0.9f",rval); + return string(answer); - if (index==ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER || index==ACTUAL_TIME || index==MEASUREMENT_TIME) - rval=(double)ret*1E-9; - else rval=ret; - - sprintf(answer,"%0.9f",rval); - return string(answer); - - } - + string slsDetectorCommand::helpTimeLeft(int narg, char *args[], int action) { - - - ostringstream os; - if (action==GET_ACTION || action==HELP_ACTION) { - - os << "exptimel \t gets the exposure time left" << std::endl; - os << "periodl \t gets the frame period left" << std::endl; - os << "delayl \t gets the delay left" << std::endl; - os << "framesl \t gets the number of frames left" << std::endl; - os << "cyclesl \t gets the number of cycles left" << std::endl; - os << "probesl \t gets the number of probes left" << std::endl; - os << std::endl; - } - return os.str(); + + ostringstream os; + if (action==GET_ACTION || action==HELP_ACTION) { + + os << "exptimel \t gets the exposure time left" << std::endl; + os << "periodl \t gets the frame period left" << std::endl; + os << "delayl \t gets the delay left" << std::endl; + os << "framesl \t gets the number of frames left" << std::endl; + os << "cyclesl \t gets the number of cycles left" << std::endl; + os << "probesl \t gets the number of probes left" << std::endl; + os << std::endl; + + } + return os.str(); @@ -4521,63 +5006,63 @@ string slsDetectorCommand::helpTimeLeft(int narg, char *args[], int action) { string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action) { - speedVariable index; - int t=-1, ret; - - char answer[1000]; + speedVariable index; + int t=-1, ret; - - if (action==HELP_ACTION) - return helpSpeed(narg, args, action); - - if (cmd=="clkdivider") - index=CLOCK_DIVIDER; - else if (cmd=="setlength") - index=SET_SIGNAL_LENGTH; - else if (cmd=="waitstates") - index=WAIT_STATES; - else if (cmd=="totdivider") - index=TOT_CLOCK_DIVIDER; - else if (cmd=="totdutycycle") - index=TOT_DUTY_CYCLE; - else if (cmd=="phasestep") { - index=PHASE_SHIFT; - t=100000; - } else if (cmd=="oversampling") - index=OVERSAMPLING; - else if (cmd=="adcclk") - index=ADC_CLOCK; - else if (cmd=="adcphase") { - index=ADC_PHASE; - t=100000; - } else if (cmd=="adcpipeline") - index=ADC_PIPELINE; - else if (cmd=="dbitclk") - index=DBIT_CLOCK; - else if (cmd=="dbitphase") { - index=DBIT_PHASE; - t=100000; - } else if (cmd=="dbitpipeline") - index=DBIT_PIPELINE; - else - return string("could not decode speed variable ")+cmd; + char answer[1000]; - - if (action==PUT_ACTION) { - if (sscanf(args[1],"%d", &t)) - ; - else - return string("cannot scan speed value ")+string(args[1]); - } - - myDet->setOnline(ONLINE_FLAG); + if (action==HELP_ACTION) + return helpSpeed(narg, args, action); - ret=myDet->setSpeed(index,t); + if (cmd=="clkdivider") + index=CLOCK_DIVIDER; + else if (cmd=="setlength") + index=SET_SIGNAL_LENGTH; + else if (cmd=="waitstates") + index=WAIT_STATES; + else if (cmd=="totdivider") + index=TOT_CLOCK_DIVIDER; + else if (cmd=="totdutycycle") + index=TOT_DUTY_CYCLE; + else if (cmd=="phasestep") { + index=PHASE_SHIFT; + t=100000; + } else if (cmd=="oversampling") + index=OVERSAMPLING; + else if (cmd=="adcclk") + index=ADC_CLOCK; + else if (cmd=="adcphase") { + index=ADC_PHASE; + t=100000; + } else if (cmd=="adcpipeline") + index=ADC_PIPELINE; + else if (cmd=="dbitclk") + index=DBIT_CLOCK; + else if (cmd=="dbitphase") { + index=DBIT_PHASE; + t=100000; + } else if (cmd=="dbitpipeline") + index=DBIT_PIPELINE; + else + return string("could not decode speed variable ")+cmd; + + + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d", &t)) + ; + else + return string("cannot scan speed value ")+string(args[1]); + + } + + myDet->setOnline(ONLINE_FLAG); + + ret=myDet->setSpeed(index,t); + + sprintf(answer,"%d",ret); + return string(answer); - sprintf(answer,"%d",ret); - return string(answer); - @@ -4585,29 +5070,29 @@ string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action) { string slsDetectorCommand::helpSpeed(int narg, char *args[], int action) { - - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "clkdivider c \t sets readout clock divider" << std::endl; - os << "setlength c\t sets the length of the set/reset signals (in clock cycles)" << std::endl; - os << "waitstates c \t sets the waitstates of the bus interface" << std::endl; - os << "totdivider c\t sets the clock divider in tot mode" << std::endl; - os << "totdutycycle c\t sets the duty cycle of the tot clock" << std::endl; - os << std::endl; + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { - } - if (action==GET_ACTION || action==HELP_ACTION) { - - os << "clkdivider \t gets readout clock divider" << std::endl; - os << "setlength \t gets the length of the set/reset signals (in clock cycles)" << std::endl; - os << "waitstates \t gets the waitstates of the bus interface" << std::endl; - os << "totdivider \t gets the clock divider in tot mode" << std::endl; - os << "totdutycycle \t gets the duty cycle of the tot clock" << std::endl; - os << std::endl; + os << "clkdivider c \t sets readout clock divider" << std::endl; + os << "setlength c\t sets the length of the set/reset signals (in clock cycles)" << std::endl; + os << "waitstates c \t sets the waitstates of the bus interface" << std::endl; + os << "totdivider c\t sets the clock divider in tot mode" << std::endl; + os << "totdutycycle c\t sets the duty cycle of the tot clock" << std::endl; + os << std::endl; - } - return os.str(); + } + if (action==GET_ACTION || action==HELP_ACTION) { + + os << "clkdivider \t gets readout clock divider" << std::endl; + os << "setlength \t gets the length of the set/reset signals (in clock cycles)" << std::endl; + os << "waitstates \t gets the waitstates of the bus interface" << std::endl; + os << "totdivider \t gets the clock divider in tot mode" << std::endl; + os << "totdutycycle \t gets the duty cycle of the tot clock" << std::endl; + os << std::endl; + + } + return os.str(); @@ -4634,58 +5119,58 @@ string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action) { readOutFlags flag=GET_READOUT_FLAGS; - if (action==PUT_ACTION) { - string sval=string(args[1]); - if (sval=="none") - flag=NORMAL_READOUT; - else if (sval=="storeinram") - flag=STORE_IN_RAM; - else if (sval=="tot") - flag=TOT_MODE; - else if (sval=="continous") - flag=CONTINOUS_RO; - else if (sval=="parallel") - flag=PARALLEL; - else if (sval=="nonparallel") - flag=NONPARALLEL; - else if (sval=="safe") - flag=SAFE; - else if (sval=="digital") - flag=DIGITAL_ONLY; - else if (sval=="analog_digital") - flag=ANALOG_AND_DIGITAL; - else - return string("could not scan flag ")+string(args[1]); - } - + if (action==PUT_ACTION) { + string sval=string(args[1]); + if (sval=="none") + flag=NORMAL_READOUT; + else if (sval=="storeinram") + flag=STORE_IN_RAM; + else if (sval=="tot") + flag=TOT_MODE; + else if (sval=="continous") + flag=CONTINOUS_RO; + else if (sval=="parallel") + flag=PARALLEL; + else if (sval=="nonparallel") + flag=NONPARALLEL; + else if (sval=="safe") + flag=SAFE; + else if (sval=="digital") + flag=DIGITAL_ONLY; + else if (sval=="analog_digital") + flag=ANALOG_AND_DIGITAL; + else + return string("could not scan flag ")+string(args[1]); + } + myDet->setOnline(ONLINE_FLAG); - retval = myDet->setReadOutFlags(flag); + retval = myDet->setReadOutFlags(flag); - // cout << hex << flag << " " << retval << endl; + // cout << hex << flag << " " << retval << endl; - if(retval == NORMAL_READOUT) - return string("none"); + if(retval == NORMAL_READOUT) + return string("none"); - if(retval & STORE_IN_RAM) - strcat(answer,"storeinram "); - if(retval & TOT_MODE) - strcat(answer,"tot "); - if(retval & CONTINOUS_RO) - strcat(answer,"continous "); - if(retval & PARALLEL) - strcat(answer,"parallel "); - if(retval & NONPARALLEL) - strcat(answer,"nonparallel "); - if(retval & SAFE) - strcat(answer,"safe "); - if (retval & DIGITAL_ONLY) - strcat(answer,"digital " ); - if (retval & ANALOG_AND_DIGITAL) - strcat(answer,"analog_digital "); - if(strlen(answer)) - return string(answer); + if(retval & STORE_IN_RAM) + strcat(answer,"storeinram "); + if(retval & TOT_MODE) + strcat(answer,"tot "); + if(retval & CONTINOUS_RO) + strcat(answer,"continous "); + if(retval & PARALLEL) + strcat(answer,"parallel "); + if(retval & NONPARALLEL) + strcat(answer,"nonparallel "); + if(retval & SAFE) + strcat(answer,"safe "); + if (retval & DIGITAL_ONLY) + strcat(answer,"digital " ); + if (retval & ANALOG_AND_DIGITAL) + strcat(answer,"analog_digital "); + if(strlen(answer)) + return string(answer); - return string("unknown"); + return string("unknown"); } else if (cmd=="extsig") { externalSignalFlag flag=GET_EXTERNAL_SIGNAL_FLAG; @@ -4734,30 +5219,30 @@ string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action) { } - else if (cmd=="powerchip") { - char ans[100]; - myDet->setOnline(ONLINE_FLAG); - if (action==PUT_ACTION){ - int ival = -1; - if (!sscanf(args[1],"%d",&ival)) - return string("could not scan powerchip parameter " + string(args[1])); - myDet->powerChip(ival); - } - sprintf(ans,"%d",myDet->powerChip()); - return string(ans); + else if (cmd=="powerchip") { + char ans[100]; + myDet->setOnline(ONLINE_FLAG); + if (action==PUT_ACTION){ + int ival = -1; + if (!sscanf(args[1],"%d",&ival)) + return string("could not scan powerchip parameter " + string(args[1])); + myDet->powerChip(ival); + } + sprintf(ans,"%d",myDet->powerChip()); + return string(ans); } else if (cmd=="led") { - char ans[100]; - int val=0; - myDet->setOnline(ONLINE_FLAG); - if (action==PUT_ACTION){ - int ival = -1; - if (!sscanf(args[1],"%d",&ival)) - return string("could not scan powerchip parameter " + string(args[1])); - val=myDet->readRegister(0x4d); - myDet->writeRegister(0x4d,(val&(~1))|((~ival)&1));//config register - } - sprintf(ans,"%d",~(myDet->readRegister(0x4d))&1); - return string(ans); + char ans[100]; + int val=0; + myDet->setOnline(ONLINE_FLAG); + if (action==PUT_ACTION){ + int ival = -1; + if (!sscanf(args[1],"%d",&ival)) + return string("could not scan powerchip parameter " + string(args[1])); + val=myDet->readRegister(0x4d); + myDet->writeRegister(0x4d,(val&(~1))|((~ival)&1));//config register + } + sprintf(ans,"%d",~(myDet->readRegister(0x4d))&1); + return string(ans); } else return string("unknown command ")+cmd; @@ -4766,30 +5251,30 @@ string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action) { string slsDetectorCommand::helpAdvanced(int narg, char *args[], int action) { - - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "extsig:i mode \t sets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl; - os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, unknown" << std::endl; + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { - os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl; - os << "resetfpga f \t resets fpga, f can be any value" << std::endl; + os << "extsig:i mode \t sets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl; + os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, unknown" << std::endl; - os << "led s \t sets led status (0 off, 1 on)" << std::endl; - os << "powerchip i \t powers on or off the chip. i = 1 for on, i = 0 for off" << std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION) { + os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl; + os << "resetfpga f \t resets fpga, f can be any value" << std::endl; - os << "extsig:i \t gets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl; + os << "led s \t sets led status (0 off, 1 on)" << std::endl; + os << "powerchip i \t powers on or off the chip. i = 1 for on, i = 0 for off" << std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION) { - os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, unknown" << std::endl; - os << "led \t returns led status (0 off, 1 on)" << std::endl; - os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, safe, unknown" << std::endl; - os << "powerchip \t gets if the chip has been powered on or off" << std::endl; + os << "extsig:i \t gets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl; - } - return os.str(); + os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, unknown" << std::endl; + os << "led \t returns led status (0 off, 1 on)" << std::endl; + os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, safe, unknown" << std::endl; + os << "powerchip \t gets if the chip has been powered on or off" << std::endl; + + } + return os.str(); @@ -4806,77 +5291,77 @@ string slsDetectorCommand::helpAdvanced(int narg, char *args[], int action) { string slsDetectorCommand::cmdConfiguration(int narg, char *args[], int action) { - - if (action==HELP_ACTION) - return helpConfiguration(narg, args, action); - - string sval; - - if (narg<2 && cmd != "rx_printconfig") - return string("should specify I/O file"); - myDet->setOnline(ONLINE_FLAG); + if (action==HELP_ACTION) + return helpConfiguration(narg, args, action); - if (cmd=="config") { - if (action==PUT_ACTION) { - sval=string(args[1]); - myDet->readConfigurationFile(sval); - } else if (action==GET_ACTION) { - sval=string(args[1]); - myDet->writeConfigurationFile(sval); - } - return sval; - } else if (cmd=="rx_printconfig"){ - myDet->setReceiverOnline(ONLINE_FLAG); - if (action==PUT_ACTION) - return string("cannot put"); - return string(""+myDet->printReceiverConfiguration()); - }else if (cmd=="parameters") { - myDet->setReceiverOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - sval=string(args[1]); - myDet->retrieveDetectorSetup(sval); - } else if (action==GET_ACTION) { - sval=string(args[1]); - myDet->dumpDetectorSetup(sval); - } - return sval; - } else if (cmd=="setup") { - myDet->setReceiverOnline(ONLINE_FLAG); - if (action==PUT_ACTION) { - sval=string(args[1]); - myDet->retrieveDetectorSetup(sval,2); - } else if (action==GET_ACTION) { - sval=string(args[1]); - myDet->dumpDetectorSetup(sval,2); - } - return sval; - } - return string("could not decode conf mode"); + string sval; + + if (narg<2 && cmd != "rx_printconfig") + return string("should specify I/O file"); + + myDet->setOnline(ONLINE_FLAG); + + if (cmd=="config") { + if (action==PUT_ACTION) { + sval=string(args[1]); + myDet->readConfigurationFile(sval); + } else if (action==GET_ACTION) { + sval=string(args[1]); + myDet->writeConfigurationFile(sval); + } + return sval; + } else if (cmd=="rx_printconfig"){ + myDet->setReceiverOnline(ONLINE_FLAG); + if (action==PUT_ACTION) + return string("cannot put"); + return string(""+myDet->printReceiverConfiguration()); + }else if (cmd=="parameters") { + myDet->setReceiverOnline(ONLINE_FLAG); + if (action==PUT_ACTION) { + sval=string(args[1]); + myDet->retrieveDetectorSetup(sval); + } else if (action==GET_ACTION) { + sval=string(args[1]); + myDet->dumpDetectorSetup(sval); + } + return sval; + } else if (cmd=="setup") { + myDet->setReceiverOnline(ONLINE_FLAG); + if (action==PUT_ACTION) { + sval=string(args[1]); + myDet->retrieveDetectorSetup(sval,2); + } else if (action==GET_ACTION) { + sval=string(args[1]); + myDet->dumpDetectorSetup(sval,2); + } + return sval; + } + return string("could not decode conf mode"); } string slsDetectorCommand::helpConfiguration(int narg, char *args[], int action) { - - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "config fname \t sets the detector to the configuration contained in fname" << std::endl; - os << "parameters fname \t sets the detector parameters to those contained in fname" << std::endl; - os << "setup fname \t sets the detector complete detector setup to that contained in fname (extensions automatically generated), including trimfiles, ff coefficients etc." << std::endl; - - } - if (action==GET_ACTION || action==HELP_ACTION) { + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { - os << "config fname \t saves the detector to the configuration to fname" << std::endl; - os << "parameters fname \t saves the detector parameters to fname" << std::endl; - os << "setup fname \t saves the detector complete detector setup to fname (extensions automatically generated), including trimfiles, ff coefficients etc." << std::endl; - - } + os << "config fname \t sets the detector to the configuration contained in fname" << std::endl; + os << "parameters fname \t sets the detector parameters to those contained in fname" << std::endl; + os << "setup fname \t sets the detector complete detector setup to that contained in fname (extensions automatically generated), including trimfiles, ff coefficients etc." << std::endl; - return os.str(); + } + if (action==GET_ACTION || action==HELP_ACTION) { + + os << "config fname \t saves the detector to the configuration to fname" << std::endl; + os << "parameters fname \t saves the detector parameters to fname" << std::endl; + os << "setup fname \t saves the detector complete detector setup to fname (extensions automatically generated), including trimfiles, ff coefficients etc." << std::endl; + + } + + return os.str(); @@ -4889,126 +5374,126 @@ string slsDetectorCommand::helpConfiguration(int narg, char *args[], int action) string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) { - char answer[100]; - int ival = -1; + char answer[100]; + int ival = -1; - if (action==HELP_ACTION) - return helpReceiver(narg, args, action); + if (action==HELP_ACTION) + return helpReceiver(narg, args, action); - myDet->setOnline(ONLINE_FLAG); - int receivers = myDet->setReceiverOnline(ONLINE_FLAG); + myDet->setOnline(ONLINE_FLAG); + int receivers = myDet->setReceiverOnline(ONLINE_FLAG); - if(cmd=="receiver"){ - if (action==PUT_ACTION) { - if(!strcasecmp(args[1],"start")) { - //to ensure data streaming enable is the same across client and receiver - if (receivers == ONLINE_FLAG) { - //if it was not off - if (myDet->enableDataStreamingFromReceiver(-1) != 0){ - //switch it off, if error - if (myDet->enableDataStreamingFromReceiver(0) != 0) { - return string("could not disable data streaming in receiver\n"); - } - } - } - myDet->startReceiver(); - } - else if(!strcasecmp(args[1],"stop")){ - //myDet->stopReceiver(); - // myDet->startReceiverReadout(); - /*runStatus s = myDet->getReceiverStatus(); + if(cmd=="receiver"){ + if (action==PUT_ACTION) { + if(!strcasecmp(args[1],"start")) { + //to ensure data streaming enable is the same across client and receiver + if (receivers == ONLINE_FLAG) { + //if it was not off + if (myDet->enableDataStreamingFromReceiver(-1) != 0){ + //switch it off, if error + if (myDet->enableDataStreamingFromReceiver(0) != 0) { + return string("could not disable data streaming in receiver\n"); + } + } + } + myDet->startReceiver(); + } + else if(!strcasecmp(args[1],"stop")){ + //myDet->stopReceiver(); + // myDet->startReceiverReadout(); + /*runStatus s = myDet->getReceiverStatus(); while(s != RUN_FINISHED){ usleep(50000); s = myDet->getReceiverStatus(); }*/ - myDet->stopReceiver(); - } - else - return helpReceiver(narg, args, action); - } - return myDet->runStatusType(myDet->getReceiverStatus()); - } + myDet->stopReceiver(); + } + else + return helpReceiver(narg, args, action); + } + return myDet->runStatusType(myDet->getReceiverStatus()); + } - else if(cmd=="framescaught"){ - if (action==PUT_ACTION) - return string("cannot put"); - else{ - sprintf(answer,"%d",myDet->getFramesCaughtByReceiver()); - return string(answer); - } - } + else if(cmd=="framescaught"){ + if (action==PUT_ACTION) + return string("cannot put"); + else{ + sprintf(answer,"%d",myDet->getFramesCaughtByReceiver()); + return string(answer); + } + } - else if(cmd=="resetframescaught"){ - if (action==GET_ACTION) - return string("cannot get"); - else{ - if(myDet->resetFramesCaught() == FAIL) - strcpy(answer,"failed"); - else - strcpy(answer,"successful"); - return string(answer); - } - } + else if(cmd=="resetframescaught"){ + if (action==GET_ACTION) + return string("cannot get"); + else{ + if(myDet->resetFramesCaught() == FAIL) + strcpy(answer,"failed"); + else + strcpy(answer,"successful"); + return string(answer); + } + } - else if(cmd=="frameindex"){ - if (action==PUT_ACTION) - return string("cannot put"); - else{ - sprintf(answer,"%d",myDet->getReceiverCurrentFrameIndex()); - return string(answer); - } - } - else if(cmd=="r_readfreq"){ - if (action==PUT_ACTION){ - if (!sscanf(args[1],"%d",&ival)) - return string("Could not scan read frequency mode ")+string(args[1]); - if(ival>=0) - myDet->setReadReceiverFrequency(1,ival); - } - sprintf(answer,"%d",myDet->setReadReceiverFrequency(1)); - return string(answer); + else if(cmd=="frameindex"){ + if (action==PUT_ACTION) + return string("cannot put"); + else{ + sprintf(answer,"%d",myDet->getReceiverCurrentFrameIndex()); + return string(answer); + } + } + else if(cmd=="r_readfreq"){ + if (action==PUT_ACTION){ + if (!sscanf(args[1],"%d",&ival)) + return string("Could not scan read frequency mode ")+string(args[1]); + if(ival>=0) + myDet->setReadReceiverFrequency(1,ival); + } + sprintf(answer,"%d",myDet->setReadReceiverFrequency(1)); + return string(answer); - } - else if(cmd=="r_compression"){ - if (action==PUT_ACTION){ - if (!sscanf(args[1],"%d",&ival)) - return string("Could not scan receiver compression input ")+string(args[1]); - if(ival>=0) - sprintf(answer,"%d",myDet->enableReceiverCompression(ival)); - }else - sprintf(answer,"%d",myDet->enableReceiverCompression()); - return string(answer); + } + else if(cmd=="r_compression"){ + if (action==PUT_ACTION){ + if (!sscanf(args[1],"%d",&ival)) + return string("Could not scan receiver compression input ")+string(args[1]); + if(ival>=0) + sprintf(answer,"%d",myDet->enableReceiverCompression(ival)); + }else + sprintf(answer,"%d",myDet->enableReceiverCompression()); + return string(answer); - } + } - else if(cmd=="tengiga"){ - if (action==PUT_ACTION){ - if (!sscanf(args[1],"%d",&ival)) - return string("Could not scan tengiga input ")+string(args[1]); - if(ival>=0) - sprintf(answer,"%d",myDet->enableTenGigabitEthernet(ival)); - }else - sprintf(answer,"%d",myDet->enableTenGigabitEthernet()); - return string(answer); + else if(cmd=="tengiga"){ + if (action==PUT_ACTION){ + if (!sscanf(args[1],"%d",&ival)) + return string("Could not scan tengiga input ")+string(args[1]); + if(ival>=0) + sprintf(answer,"%d",myDet->enableTenGigabitEthernet(ival)); + }else + sprintf(answer,"%d",myDet->enableTenGigabitEthernet()); + return string(answer); - } + } - else if(cmd=="rx_fifodepth"){ - if (action==PUT_ACTION){ - if (!sscanf(args[1],"%d",&ival)) - return string("Could not scan rx_fifodepth input ")+string(args[1]); - if(ival>=0) - sprintf(answer,"%d",myDet->setReceiverFifoDepth(ival)); - }else - sprintf(answer,"%d",myDet->setReceiverFifoDepth()); - return string(answer); + else if(cmd=="rx_fifodepth"){ + if (action==PUT_ACTION){ + if (!sscanf(args[1],"%d",&ival)) + return string("Could not scan rx_fifodepth input ")+string(args[1]); + if(ival>=0) + sprintf(answer,"%d",myDet->setReceiverFifoDepth(ival)); + }else + sprintf(answer,"%d",myDet->setReceiverFifoDepth()); + return string(answer); - } + } - return string("could not decode command"); + return string("could not decode command"); } @@ -5016,23 +5501,23 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) { string slsDetectorCommand::helpReceiver(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "receiver [status] \t starts/stops the receiver to listen to detector packets. - can be start or stop" << std::endl; - os << "resetframescaught [any value] \t resets frames caught by receiver" << std::endl; - os << "r_readfreq \t sets the gui read frequency of the receiver, 0 if gui requests frame, >0 if receiver sends every nth frame to gui" << std::endl; - os << "tengiga \t sets system to be configure for 10Gbe if set to 1, else 1Gbe if set to 0" << std::endl; - os << "rx_fifodepth [val]\t sets receiver fifo depth to val" << std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION){ - os << "receiver \t returns the status of receiver - can be running or idle" << std::endl; - os << "framescaught \t returns the number of frames caught by receiver(average for multi)" << std::endl; - os << "frameindex \t returns the current frame index of receiver(average for multi)" << std::endl; - os << "r_readfreq \t returns the gui read frequency of the receiver" << std::endl; - os << "tengiga \t returns 1 if the system is configured for 10Gbe else 0 for 1Gbe" << std::endl; - os << "rx_fifodepth \t returns receiver fifo depth" << std::endl; - } - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "receiver [status] \t starts/stops the receiver to listen to detector packets. - can be start or stop" << std::endl; + os << "resetframescaught [any value] \t resets frames caught by receiver" << std::endl; + os << "r_readfreq \t sets the gui read frequency of the receiver, 0 if gui requests frame, >0 if receiver sends every nth frame to gui" << std::endl; + os << "tengiga \t sets system to be configure for 10Gbe if set to 1, else 1Gbe if set to 0" << std::endl; + os << "rx_fifodepth [val]\t sets receiver fifo depth to val" << std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION){ + os << "receiver \t returns the status of receiver - can be running or idle" << std::endl; + os << "framescaught \t returns the number of frames caught by receiver(average for multi)" << std::endl; + os << "frameindex \t returns the current frame index of receiver(average for multi)" << std::endl; + os << "r_readfreq \t returns the gui read frequency of the receiver" << std::endl; + os << "tengiga \t returns 1 if the system is configured for 10Gbe else 0 for 1Gbe" << std::endl; + os << "rx_fifodepth \t returns receiver fifo depth" << std::endl; + } + return os.str(); @@ -5045,565 +5530,565 @@ string slsDetectorCommand::helpReceiver(int narg, char *args[], int action) { string slsDetectorCommand::helpPattern(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "pattern fname \t loads pattern file" << std::endl; - os << "patword addr word \t writes pattern word - only very advanced users!" << std::endl; - os << "patioctrl reg\t configures inputs/outputs of the chiptest board - only advanced users!" << std::endl; - os << "patclkctrl reg\t configures output clk enable of the chiptest board- only advanced users! " << std::endl; - os << "patlimits addr1 addr2\t defines pattern limits between addr1 and addr2" << std::endl; - os << "patloop0 addr1 adrr2 \t configures the limits of the 0 loop " << std::endl; - os << "patloop1 addr1 adrr2 \t configures the limits of the 1 loop " << std::endl; - os << "patloop2 addr1 adrr2 \t configures the limits of the 2 loop " << std::endl; - os << "patnloop0 n \t sets number of cycles of the 0 loop " << std::endl; - os << "patnloop1 n \t sets number of cycles of the 1 loop " << std::endl; - os << "patnloop2 n \t sets number of cycles of the 2 loop " << std::endl; - os << "patwait0 addr \t configures pattern wait 0 address " << std::endl; - os << "patwait1 addr \t configures pattern wait 1 address " << std::endl; - os << "patwait2 addr \t configures pattern wait 2 address " << std::endl; - os << "patwaittime0 nclk \t sets wait 0 waiting time in clock number " << std::endl; - os << "patwaittime1 nclk \t sets wait 1 waiting time in clock number " << std::endl; - os << "patwaittime2 nclk \t sets wait 2 waiting time in clock number " << std::endl; - os << "adcinvert mask\t sets the adcinversion mask (hex)" << std::endl; - os << "adcdisable mask\t sets the adcdisable mask (hex)" << std::endl; + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "pattern fname \t loads pattern file" << std::endl; + os << "patword addr word \t writes pattern word - only very advanced users!" << std::endl; + os << "patioctrl reg\t configures inputs/outputs of the chiptest board - only advanced users!" << std::endl; + os << "patclkctrl reg\t configures output clk enable of the chiptest board- only advanced users! " << std::endl; + os << "patlimits addr1 addr2\t defines pattern limits between addr1 and addr2" << std::endl; + os << "patloop0 addr1 adrr2 \t configures the limits of the 0 loop " << std::endl; + os << "patloop1 addr1 adrr2 \t configures the limits of the 1 loop " << std::endl; + os << "patloop2 addr1 adrr2 \t configures the limits of the 2 loop " << std::endl; + os << "patnloop0 n \t sets number of cycles of the 0 loop " << std::endl; + os << "patnloop1 n \t sets number of cycles of the 1 loop " << std::endl; + os << "patnloop2 n \t sets number of cycles of the 2 loop " << std::endl; + os << "patwait0 addr \t configures pattern wait 0 address " << std::endl; + os << "patwait1 addr \t configures pattern wait 1 address " << std::endl; + os << "patwait2 addr \t configures pattern wait 2 address " << std::endl; + os << "patwaittime0 nclk \t sets wait 0 waiting time in clock number " << std::endl; + os << "patwaittime1 nclk \t sets wait 1 waiting time in clock number " << std::endl; + os << "patwaittime2 nclk \t sets wait 2 waiting time in clock number " << std::endl; + os << "adcinvert mask\t sets the adcinversion mask (hex)" << std::endl; + os << "adcdisable mask\t sets the adcdisable mask (hex)" << std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION){ - os << "pattern \t cannot get" << std::endl; - os << "patword \t cannot get" << std::endl; - os << "patioctrl \t returns inputs/outputs of the chiptest board - only advanced users!" << std::endl; - os << "patclkctrl\t returns output clk enable of the chiptest board- only advanced users! " << std::endl; - os << "patlimits \t returns pattern limits between addr1 and addr2" << std::endl; - os << "patloop0 \t returns the limits of the 0 loop " << std::endl; - os << "patloop1 \t returns the limits of the 1 loop " << std::endl; - os << "patloop2 \t returns the limits of the 2 loop " << std::endl; - os << "patnloop0 \t returns the number of cycles of the 0 loop " << std::endl; - os << "patnloop1 \t returns the number of cycles of the 1 loop " << std::endl; - os << "patnloop2 \t returns the number of cycles of the 2 loop " << std::endl; - os << "patwait0 \t returns the pattern wait 0 address " << std::endl; - os << "patwait1 \t returns the pattern wait 1 address " << std::endl; - os << "patwait2 \t returns the pattern wait 2 address " << std::endl; - os << "patwaittime0 \t returns the wait 0 waiting time in clock number " << std::endl; - os << "patwaittime1 \t returns the wait 1 waiting time in clock number " << std::endl; - os << "patwaittime2 \t returns the wait 2 waiting time in clock number " << std::endl; - os << "adcinvert \t returns the adcinversion mask " << std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION){ + os << "pattern \t cannot get" << std::endl; + os << "patword \t cannot get" << std::endl; + os << "patioctrl \t returns inputs/outputs of the chiptest board - only advanced users!" << std::endl; + os << "patclkctrl\t returns output clk enable of the chiptest board- only advanced users! " << std::endl; + os << "patlimits \t returns pattern limits between addr1 and addr2" << std::endl; + os << "patloop0 \t returns the limits of the 0 loop " << std::endl; + os << "patloop1 \t returns the limits of the 1 loop " << std::endl; + os << "patloop2 \t returns the limits of the 2 loop " << std::endl; + os << "patnloop0 \t returns the number of cycles of the 0 loop " << std::endl; + os << "patnloop1 \t returns the number of cycles of the 1 loop " << std::endl; + os << "patnloop2 \t returns the number of cycles of the 2 loop " << std::endl; + os << "patwait0 \t returns the pattern wait 0 address " << std::endl; + os << "patwait1 \t returns the pattern wait 1 address " << std::endl; + os << "patwait2 \t returns the pattern wait 2 address " << std::endl; + os << "patwaittime0 \t returns the wait 0 waiting time in clock number " << std::endl; + os << "patwaittime1 \t returns the wait 1 waiting time in clock number " << std::endl; + os << "patwaittime2 \t returns the wait 2 waiting time in clock number " << std::endl; + os << "adcinvert \t returns the adcinversion mask " << std::endl; - os << "adcdisable \t returns the adcdisable mask " << std::endl; + os << "adcdisable \t returns the adcdisable mask " << std::endl; - } - return os.str(); + } + return os.str(); } string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) { - - if (action==HELP_ACTION) - return helpPattern(narg, args, action); - /******** - + + if (action==HELP_ACTION) + return helpPattern(narg, args, action); + /******** + Must implement set ctb functions in slsDetector and multiSlsDetector - - **********/ - string fname; - int addr, start, stop, n; - uint64_t word, t; - - myDet->setOnline(ONLINE_FLAG); - - ostringstream os; - if (cmd=="pattern") { - //get fname fron stdin - - if (action==PUT_ACTION) { - fname=string(args[1]); - os << myDet->setCTBPattern(fname); - } else if (action==GET_ACTION) - os << "Cannot get"; - } else if (cmd=="patword") { - - if (action==PUT_ACTION) { - //get addr, word from stdin - - if(narg<3) - return string("wrong usage: should specify both address and value (hexadecimal fomat) "); - - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan address (hexadecimal fomat) ")+string(args[1]); - - if (sscanf(args[2],"%lx",&word)) - ; - else - return string("Could not scan value (hexadecimal fomat) ")+string(args[2]); - - - os << hex << myDet->setCTBWord(addr,word) << dec; - } else if (action==GET_ACTION) - os << "Cannot get"; - - - } else if (cmd=="patioctrl") { - //get word from stdin - - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%lx",&word)) - ; - else - return string("Could not scan value (hexadecimal fomat) ")+string(args[1]); - - - myDet->setCTBWord(-1,word); - } - - os << hex << myDet->setCTBWord(-1,-1) << dec; - } else if (cmd=="patclkctrl") { - //get word from stdin - - - - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%lx",&word)) - ; - else - return string("Could not scan value (hexadecimal fomat) ")+string(args[1]); - - - myDet->setCTBWord(-2,word); - } - - os << hex << myDet->setCTBWord(-2,-1) << dec; - - - } else if (cmd=="patlimits") { - //get start, stop from stdin - if (action==PUT_ACTION) { - if(narg<3) return string("wrong usage: should specify both start and stop address (hexadecimal fomat) "); - n=-1; - if (sscanf(args[1],"%x",&start)) - ; - else - return string("Could not scan start address (hexadecimal fomat) ")+string(args[1]); - - - if (sscanf(args[2],"%x",&stop)) - ; - else - return string("Could not scan stop address (hexadecimal fomat) ")+string(args[2]); - - myDet->setCTBPatLoops(-1,start, stop,n); - } - - start=-1; - stop=-1; - n=-1; - myDet->setCTBPatLoops(-1,start, stop,n); - os << hex << start << " " << stop;// << " "<< dec << n ; - } else if (cmd=="patloop0") { - //get start, stop from stdin - - - //get start, stop from stdin - if (action==PUT_ACTION) { - if(narg<3) return string("wrong usage: should specify both start and stop address (hexadecimal fomat) "); - n=-1; - if (sscanf(args[1],"%x",&start)) - ; - else - return string("Could not scan start address (hexadecimal fomat) ")+string(args[1]); - - - if (sscanf(args[2],"%x",&stop)) - ; - else - return string("Could not scan stop address (hexadecimal fomat) ")+string(args[2]); - - myDet->setCTBPatLoops(0,start, stop,n); - } - - start=-1; - stop=-1; - n=-1; - myDet->setCTBPatLoops(0,start, stop,n); - os << hex << start << " " << stop;// << " "<< dec << n ; - - - } else if (cmd=="patloop1") { - - //get start, stop from stdin - if (action==PUT_ACTION) { - if(narg<3) return string("wrong usage: should specify both start and stop address (hexadecimal fomat) "); - n=-1; - if (sscanf(args[1],"%x",&start)) - ; - else - return string("Could not scan start address (hexadecimal fomat) ")+string(args[1]); - - - if (sscanf(args[2],"%x",&stop)) - ; - else - return string("Could not scan stop address (hexadecimal fomat) ")+string(args[2]); - - myDet->setCTBPatLoops(1,start, stop,n); - } - - start=-1; - stop=-1; - n=-1; - myDet->setCTBPatLoops(1,start, stop,n); - os << hex << start << " " << stop;// << " "<< dec << n ; - - - - - } else if (cmd=="patloop2") { - - //get start, stop from stdin - if (action==PUT_ACTION) { - if(narg<3) return string("wrong usage: should specify both start and stop address (hexadecimal fomat) "); - n=-1; - if (sscanf(args[1],"%x",&start)) - ; - else - return string("Could not scan start address (hexadecimal fomat) ")+string(args[1]); - - - if (sscanf(args[2],"%x",&stop)) - ; - else - return string("Could not scan stop address (hexadecimal fomat) ")+string(args[2]); - - myDet->setCTBPatLoops(2,start, stop,n) ; - } - - start=-1; - stop=-1; - n=-1; - myDet->setCTBPatLoops(2,start, stop,n); - os << hex << start << " " << stop << dec;// << " "<< dec << n ; - - - } else if (cmd=="patnloop0") { - start=-1; - stop=-1; - - - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%d",&n)) - ; - else - return string("Could not scan number of loops ")+string(args[1]); - - myDet->setCTBPatLoops(0,start, stop,n) ; - } + **********/ + string fname; + int addr, start, stop, n; + uint64_t word, t; + myDet->setOnline(ONLINE_FLAG); - - start=-1; - stop=-1; - n=-1; - myDet->setCTBPatLoops(0,start, stop,n); - os << n ; - } else if (cmd=="patnloop1") { + ostringstream os; + if (cmd=="pattern") { + //get fname fron stdin + if (action==PUT_ACTION) { + fname=string(args[1]); + os << myDet->setCTBPattern(fname); + } else if (action==GET_ACTION) + os << "Cannot get"; + } else if (cmd=="patword") { - start=-1; - stop=-1; + if (action==PUT_ACTION) { + //get addr, word from stdin - - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%d",&n)) - ; - else - return string("Could not scan number of loops ")+string(args[1]); + if(narg<3) + return string("wrong usage: should specify both address and value (hexadecimal fomat) "); - - myDet->setCTBPatLoops(1,start, stop,n) ; - } + if (sscanf(args[1],"%x",&addr)) + ; + else + return string("Could not scan address (hexadecimal fomat) ")+string(args[1]); + if (sscanf(args[2],"%lx",&word)) + ; + else + return string("Could not scan value (hexadecimal fomat) ")+string(args[2]); - - start=-1; - stop=-1; - n=-1; - myDet->setCTBPatLoops(1,start, stop,n); - os << n ; + os << hex << myDet->setCTBWord(addr,word) << dec; + } else if (action==GET_ACTION) + os << "Cannot get"; + } else if (cmd=="patioctrl") { + //get word from stdin - } else if (cmd=="patnloop2") { + if (action==PUT_ACTION) { + if (sscanf(args[1],"%lx",&word)) + ; + else + return string("Could not scan value (hexadecimal fomat) ")+string(args[1]); - start=-1; - stop=-1; - - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%d",&n)) - ; - else - return string("Could not scan number of loops ")+string(args[1]); + myDet->setCTBWord(-1,word); + } - - myDet->setCTBPatLoops(2,start, stop,n) ; - } + os << hex << myDet->setCTBWord(-1,-1) << dec; + } else if (cmd=="patclkctrl") { + //get word from stdin - - start=-1; - stop=-1; - n=-1; - myDet->setCTBPatLoops(2,start, stop,n); - os << n ; + if (action==PUT_ACTION) { + if (sscanf(args[1],"%lx",&word)) + ; + else + return string("Could not scan value (hexadecimal fomat) ")+string(args[1]); - } else if (cmd=="patwait0") { + myDet->setCTBWord(-2,word); + } + os << hex << myDet->setCTBWord(-2,-1) << dec; - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan wait address (hex format)")+string(args[1]); + } else if (cmd=="patlimits") { + //get start, stop from stdin + if (action==PUT_ACTION) { + if(narg<3) return string("wrong usage: should specify both start and stop address (hexadecimal fomat) "); + n=-1; + if (sscanf(args[1],"%x",&start)) + ; + else + return string("Could not scan start address (hexadecimal fomat) ")+string(args[1]); - - myDet->setCTBPatWaitAddr(0,addr); - } + if (sscanf(args[2],"%x",&stop)) + ; + else + return string("Could not scan stop address (hexadecimal fomat) ")+string(args[2]); - - os << hex << myDet->setCTBPatWaitAddr(0,-1) << dec; + myDet->setCTBPatLoops(-1,start, stop,n); + } + start=-1; + stop=-1; + n=-1; + myDet->setCTBPatLoops(-1,start, stop,n); + os << hex << start << " " << stop;// << " "<< dec << n ; + } else if (cmd=="patloop0") { + //get start, stop from stdin + //get start, stop from stdin + if (action==PUT_ACTION) { + if(narg<3) return string("wrong usage: should specify both start and stop address (hexadecimal fomat) "); + n=-1; + if (sscanf(args[1],"%x",&start)) + ; + else + return string("Could not scan start address (hexadecimal fomat) ")+string(args[1]); + if (sscanf(args[2],"%x",&stop)) + ; + else + return string("Could not scan stop address (hexadecimal fomat) ")+string(args[2]); - } else if (cmd=="patwait1") { + myDet->setCTBPatLoops(0,start, stop,n); + } + start=-1; + stop=-1; + n=-1; + myDet->setCTBPatLoops(0,start, stop,n); + os << hex << start << " " << stop;// << " "<< dec << n ; - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan wait address (hex format)")+string(args[1]); - - myDet->setCTBPatWaitAddr(1,addr); - } + } else if (cmd=="patloop1") { + //get start, stop from stdin + if (action==PUT_ACTION) { + if(narg<3) return string("wrong usage: should specify both start and stop address (hexadecimal fomat) "); + n=-1; + if (sscanf(args[1],"%x",&start)) + ; + else + return string("Could not scan start address (hexadecimal fomat) ")+string(args[1]); - - os << hex << myDet->setCTBPatWaitAddr(1,-1) << dec; + if (sscanf(args[2],"%x",&stop)) + ; + else + return string("Could not scan stop address (hexadecimal fomat) ")+string(args[2]); + myDet->setCTBPatLoops(1,start, stop,n); + } - } else if (cmd=="patwait2") { + start=-1; + stop=-1; + n=-1; + myDet->setCTBPatLoops(1,start, stop,n); + os << hex << start << " " << stop;// << " "<< dec << n ; - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan wait address (hex format)")+string(args[1]); - - myDet->setCTBPatWaitAddr(2,addr); - } - - os << hex << myDet->setCTBPatWaitAddr(2,-1) << dec ; + } else if (cmd=="patloop2") { - } else if (cmd=="patwaittime0") { + //get start, stop from stdin + if (action==PUT_ACTION) { + if(narg<3) return string("wrong usage: should specify both start and stop address (hexadecimal fomat) "); + n=-1; + if (sscanf(args[1],"%x",&start)) + ; + else + return string("Could not scan start address (hexadecimal fomat) ")+string(args[1]); + if (sscanf(args[2],"%x",&stop)) + ; + else + return string("Could not scan stop address (hexadecimal fomat) ")+string(args[2]); + myDet->setCTBPatLoops(2,start, stop,n) ; + } + start=-1; + stop=-1; + n=-1; + myDet->setCTBPatLoops(2,start, stop,n); + os << hex << start << " " << stop << dec;// << " "<< dec << n ; - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%ld",&t)) - ; - else - return string("Could not scan wait time")+string(args[1]); - - myDet->setCTBPatWaitTime(0,t); - } + } else if (cmd=="patnloop0") { + start=-1; + stop=-1; - - os << myDet->setCTBPatWaitTime(0,-1); + if (action==PUT_ACTION) { + if (sscanf(args[1],"%d",&n)) + ; + else + return string("Could not scan number of loops ")+string(args[1]); + myDet->setCTBPatLoops(0,start, stop,n) ; + } + start=-1; + stop=-1; + n=-1; + myDet->setCTBPatLoops(0,start, stop,n); + os << n ; + } else if (cmd=="patnloop1") { - } else if (cmd=="patwaittime1") { - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%ld",&t)) - ; - else - return string("Could not scan wait time ")+string(args[1]); + start=-1; + stop=-1; - - myDet->setCTBPatWaitTime(1,t); - } + if (action==PUT_ACTION) { - - os << myDet->setCTBPatWaitTime(1,-1); + if (sscanf(args[1],"%d",&n)) + ; + else + return string("Could not scan number of loops ")+string(args[1]); + myDet->setCTBPatLoops(1,start, stop,n) ; + } - } else if (cmd=="patwaittime2") { - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%ld",&t)) - ; - else - return string("Could not scan wait time ")+string(args[1]); - - myDet->setCTBPatWaitTime(2,t); - } + start=-1; + stop=-1; + n=-1; + myDet->setCTBPatLoops(1,start, stop,n); + os << n ; - - os << myDet->setCTBPatWaitTime(2,-1); - } else if (cmd=="adcinvert") { - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan adcinvert reg ")+string(args[1]); - - myDet->writeRegister(67,addr); - } + } else if (cmd=="patnloop2") { - - os << hex << myDet->readRegister(67) << dec; - } else if (cmd=="dut_clk") { - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan dut_clk reg ")+string(args[1]); + start=-1; + stop=-1; - - myDet->writeRegister(123,addr); //0x7b - } + if (action==PUT_ACTION) { - - os << hex << myDet->readRegister(123) << dec; //0x7b - } else if (cmd=="adcdisable") { + if (sscanf(args[1],"%d",&n)) + ; + else + return string("Could not scan number of loops ")+string(args[1]); - int nroi=0; - ROI roiLimits[MAX_ROIS]; - if (action==PUT_ACTION) { - - if (sscanf(args[1],"%x",&addr)) - ; - else - return string("Could not scan adcdisable reg ")+string(args[1]); + myDet->setCTBPatLoops(2,start, stop,n) ; + } - /******USE ROI?!?!?!?*********/ - // roiLimits[i].xmin;roiLimits[i].xmax;roiLimits[i].ymin;roiLimits[i].ymin;roiLimits[i].ymax - //int mask=1; - int ii=0; - while (ii<32) { - nroi++; - roiLimits[nroi-1].xmin=ii; - roiLimits[nroi-1].ymin=0; - roiLimits[nroi-1].ymax=0; - while ((addr&(1<=32) - break; - } - if (ii>=32) { - break; - cout << "ROI "<< nroi << " xmin "<=32) - break; - } - roiLimits[nroi-1].xmax=ii-1; - if (ii>=32) { - cout << "ROI "<< nroi << " xmin "<setROI(nroi-1,roiLimits); - // myDet->writeRegister(94,addr); - // myDet->writeRegister(120,addr); - } - - ROI *aa=myDet->getROI(nroi); - - int reg=0xffffffff; - if (nroi<1) - reg=0; - else { - for (int iroi=0; iroixmin<< " xmax "<< (aa+iroi)->xmax<< endl; - for (int ich=(aa+iroi)->xmin; ich<=(aa+iroi)->xmax; ich++) { - reg&=~(1<readRegister(120) << dec; - - } - - - - else return helpPattern(narg, args, action); - - - - - - return os.str(); + + + start=-1; + stop=-1; + n=-1; + myDet->setCTBPatLoops(2,start, stop,n); + os << n ; + + + + } else if (cmd=="patwait0") { + + + + + if (action==PUT_ACTION) { + + if (sscanf(args[1],"%x",&addr)) + ; + else + return string("Could not scan wait address (hex format)")+string(args[1]); + + + myDet->setCTBPatWaitAddr(0,addr); + } + + + + os << hex << myDet->setCTBPatWaitAddr(0,-1) << dec; + + + + + + + } else if (cmd=="patwait1") { + + + if (action==PUT_ACTION) { + + if (sscanf(args[1],"%x",&addr)) + ; + else + return string("Could not scan wait address (hex format)")+string(args[1]); + + + myDet->setCTBPatWaitAddr(1,addr); + } + + + + os << hex << myDet->setCTBPatWaitAddr(1,-1) << dec; + + + + } else if (cmd=="patwait2") { + + if (action==PUT_ACTION) { + + if (sscanf(args[1],"%x",&addr)) + ; + else + return string("Could not scan wait address (hex format)")+string(args[1]); + + + myDet->setCTBPatWaitAddr(2,addr); + } + + + + os << hex << myDet->setCTBPatWaitAddr(2,-1) << dec ; + + } else if (cmd=="patwaittime0") { + + + + + + if (action==PUT_ACTION) { + + if (sscanf(args[1],"%ld",&t)) + ; + else + return string("Could not scan wait time")+string(args[1]); + + + myDet->setCTBPatWaitTime(0,t); + } + + + + os << myDet->setCTBPatWaitTime(0,-1); + + + + + + + + } else if (cmd=="patwaittime1") { + + if (action==PUT_ACTION) { + + if (sscanf(args[1],"%ld",&t)) + ; + else + return string("Could not scan wait time ")+string(args[1]); + + + myDet->setCTBPatWaitTime(1,t); + } + + + + os << myDet->setCTBPatWaitTime(1,-1); + + + + } else if (cmd=="patwaittime2") { + if (action==PUT_ACTION) { + + if (sscanf(args[1],"%ld",&t)) + ; + else + return string("Could not scan wait time ")+string(args[1]); + + + myDet->setCTBPatWaitTime(2,t); + } + + + + os << myDet->setCTBPatWaitTime(2,-1); + + } else if (cmd=="adcinvert") { + if (action==PUT_ACTION) { + + if (sscanf(args[1],"%x",&addr)) + ; + else + return string("Could not scan adcinvert reg ")+string(args[1]); + + + myDet->writeRegister(67,addr); + } + + + + os << hex << myDet->readRegister(67) << dec; + + } else if (cmd=="dut_clk") { + if (action==PUT_ACTION) { + + if (sscanf(args[1],"%x",&addr)) + ; + else + return string("Could not scan dut_clk reg ")+string(args[1]); + + + myDet->writeRegister(123,addr); //0x7b + } + + + + os << hex << myDet->readRegister(123) << dec; //0x7b + } else if (cmd=="adcdisable") { + + int nroi=0; + ROI roiLimits[MAX_ROIS]; + + if (action==PUT_ACTION) { + + if (sscanf(args[1],"%x",&addr)) + ; + else + return string("Could not scan adcdisable reg ")+string(args[1]); + + /******USE ROI?!?!?!?*********/ + // roiLimits[i].xmin;roiLimits[i].xmax;roiLimits[i].ymin;roiLimits[i].ymin;roiLimits[i].ymax + //int mask=1; + int ii=0; + while (ii<32) { + nroi++; + roiLimits[nroi-1].xmin=ii; + roiLimits[nroi-1].ymin=0; + roiLimits[nroi-1].ymax=0; + while ((addr&(1<=32) + break; + } + if (ii>=32) { + break; + cout << "ROI "<< nroi << " xmin "<=32) + break; + } + roiLimits[nroi-1].xmax=ii-1; + if (ii>=32) { + cout << "ROI "<< nroi << " xmin "<setROI(nroi-1,roiLimits); + // myDet->writeRegister(94,addr); + // myDet->writeRegister(120,addr); + } + + ROI *aa=myDet->getROI(nroi); + + int reg=0xffffffff; + if (nroi<1) + reg=0; + else { + for (int iroi=0; iroixmin<< " xmax "<< (aa+iroi)->xmax<< endl; + for (int ich=(aa+iroi)->xmin; ich<=(aa+iroi)->xmax; ich++) { + reg&=~(1<readRegister(120) << dec; + + } + + + + else return helpPattern(narg, args, action); + + + + + + return os.str(); } @@ -5611,18 +6096,18 @@ string slsDetectorCommand::cmdPattern(int narg, char *args[], int action) { string slsDetectorCommand::helpPulse(int narg, char *args[], int action) { - ostringstream os; - if (action==PUT_ACTION || action==HELP_ACTION) { - os << "pulse [n] [x] [y] \t pulses pixel at coordinates (x,y) n number of times" << std::endl; - os << "pulsenmove [n] [x] [y]\t pulses pixel n number of times and moves relatively by x value (x axis) and y value(y axis)" << std::endl; - os << "pulsechip [n] \t pulses chip n number of times, while n=-1 will reset it to normal mode" << std::endl; - } - if (action==GET_ACTION || action==HELP_ACTION){ - os << "pulse \t cannot get" << std::endl; - os << "pulsenmove \t cannot get" << std::endl; - os << "pulsechip \t cannot get" << std::endl; - } - return os.str(); + ostringstream os; + if (action==PUT_ACTION || action==HELP_ACTION) { + os << "pulse [n] [x] [y] \t pulses pixel at coordinates (x,y) n number of times" << std::endl; + os << "pulsenmove [n] [x] [y]\t pulses pixel n number of times and moves relatively by x value (x axis) and y value(y axis)" << std::endl; + os << "pulsechip [n] \t pulses chip n number of times, while n=-1 will reset it to normal mode" << std::endl; + } + if (action==GET_ACTION || action==HELP_ACTION){ + os << "pulse \t cannot get" << std::endl; + os << "pulsenmove \t cannot get" << std::endl; + os << "pulsechip \t cannot get" << std::endl; + } + return os.str(); } @@ -5639,8 +6124,8 @@ string slsDetectorCommand::cmdPulse(int narg, char *args[], int action) { int ival1=-1; - if (!sscanf(args[1],"%d",&ival1)) - return string("Could not scan 1st argument ")+string(args[1]); + if (!sscanf(args[1],"%d",&ival1)) + return string("Could not scan 1st argument ")+string(args[1]); if (string(args[0])==string("pulsechip")) retval = myDet->pulseChip(ival1); diff --git a/slsDetectorSoftware/slsDetectorClient.doxy b/slsDetectorSoftware/slsDetectorClient.doxy new file mode 100644 index 000000000..c63f84d40 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClient.doxy @@ -0,0 +1,86 @@ +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + + + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = YES + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +INTERNAL_DOCS = NO + +SHOW_INCLUDE_FILES = NO + +SHOW_FILES = NO + +SHOW_NAMESPACES = NO + +COMPACT_LATEX = YES + +PAPER_TYPE = a4 + +PDF_HYPERLINKS = YES + +USE_PDFLATEX = YES + +LATEX_HIDE_INDICES = YES + + +PREDEFINED = __cplusplus + +INPUT = slsDetector/slsDetectorCommand.cpp + +OUTPUT_DIRECTORY = slsDetectorClientDocs diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/acquisition.html b/slsDetectorSoftware/slsDetectorClientDocs/html/acquisition.html new file mode 100644 index 000000000..a96418f67 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/acquisition.html @@ -0,0 +1,85 @@ + + + + + +Acquition commands + + + + + + + + + +
+ + +

Acquition commands

Commands to control the acquisition

+
    +
  • acquire blocking acquisition (like calling sls_detector_acquire). Starts receiver and detector, writes and processes the data, stops detector. Only get!
  • +
+
    +
  • data gets all data from the detector (if any) processes them and writes them to file according to the preferences already setup (MYTHEN only). Only get!
  • +
+
    +
  • frame gets a single frame from the detector (if any) processes it and writes it to file according to the preferences already setup (MYTHEN only). Only get!
  • +
+
    +
  • status returns the detector status (string)- can be: running, error, transmitting, finished, waiting or idle; put can be start or stop
  • +
+
    +
  • busy returns 1 if the acquisition is active, 0 otherwise. Works when the acquisition is started in non-blocking mode. Only get!
  • +
+
    +
  • readctr Reads the counters from the detector memory (analog detector returning values translated into number of photons - only GOTTHARD). Cannot put.
  • +
+
    +
  • resetctr i Resets counter in detector, restarts acquisition if i=1(analog detector returning values translated into number of photons - only GOTTHARD). Cannot put.
  • +
+
    +
  • resmat i sets/resets counter bit in detector.gets the counter bit in detector ????
  • +
+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/actions.html b/slsDetectorSoftware/slsDetectorClientDocs/html/actions.html new file mode 100644 index 000000000..2beec987a --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/actions.html @@ -0,0 +1,136 @@ + + + + + +Actions + + + + + + + + + +
+ + +

Actions

Commands to define scripts to be executed during the acquisition flow

+
    +
  • positions [n [p0..pn-1]] sets/gets number of angular position and positions to be acquired.
  • +
+
    +
  • startscript [s] sets/gets the script to be executed at the beginning of the acquisition. none unsets.
  • +
+
    +
  • startscriptpar [s] sets/gets a string to be passed as a parameter to the startscript
  • +
+
    +
  • stopscript [s] sets/gets the script to be executed at the end of the acquisition. none unsets.
  • +
+
    +
  • stopscriptpar [s] sets/gets a string to be passed as a parameter to the stopscript
  • +
+
    +
  • scriptbefore [s] sets/gets the script to be executed before starting the detector every time in the acquisition. none unsets.
  • +
+
    +
  • scriptbeforepar [s] sets/gets a string to be passed as a parameter to the scriptbefore
  • +
+
    +
  • scriptafter [s] sets/gets the script to be executed after the detector has finished every time in the acquisition. none unsets.
  • +
+
    +
  • scriptafterpar [s] sets/gets a string to be passed as a parameter to the scriptafter
  • +
+
    +
  • headerafter [s] sets/gets the script to be executed for logging the detector parameters. none unsets.
  • +
+
    +
  • headerbefore [s] sets/gets the script to be executed for logging the detector parameters. none unsets.
  • +
+
    +
  • headerbeforepar [s] sets/gets a string to be passed as a parameter to the headerbefore script
  • +
+
    +
  • headerafterpar [s] sets/gets a string to be passed as a parameter to the headerafter script
  • +
+
    +
  • enacallog [i] enables/disables logging of the parameters necessary for the energy calibration. 1 sets, 0 unsets.
  • +
+
    +
  • angcallog [i] enables/disables logging of the parameters necessary for the angular calibration. 1 sets, 0 unsets.
  • +
+
    +
  • scan0script [s] sets/gets the script to be executed for the scan 0 level. none unsets.
  • +
+
    +
  • scan0par [s] sets/gets a string to be passed as a parameter to the scan0script
  • +
+
    +
  • scan0prec [i] sets/gets number of digits to be used for the scan0 variable in the file name.
  • +
+
    +
  • scan0steps [i [s0..sn-1]] sets/gets number of steps (int) of the scan0 level and their values (float).
  • +
+
    +
  • scan0range [smin smax sstep] sets scan0 min, max and step, returns the number of steps and their values as scan0steps.
  • +
+
    +
  • scan1script [s] sets/gets the script to be executed for the scan1 level. none unsets.
  • +
+
    +
  • scan1par [s] sets/gets a string to be passed as a parameter to the scan1script
  • +
+
    +
  • scan1prec [i] sets/gets number of digits to be used for the scan1 variable in the file name.
  • +
+
    +
  • scan1steps [i [s0..sn-1]] sets/gets number of steps (int) of the scan1 level and their values (float).
  • +
+
    +
  • scan1range [smin smax sstep] sets scan1 min, max and step, returns the number of steps and their values as scan1steps.
  • +
+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/advanced.html b/slsDetectorSoftware/slsDetectorClientDocs/html/advanced.html new file mode 100644 index 000000000..b24667eb2 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/advanced.html @@ -0,0 +1,61 @@ + + + + + +Advanced Usage + + + + + + + + + +
+ + +

Advanced Usage

This page is for advanced users. Make sure you have first read the introduction.

+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/config.html b/slsDetectorSoftware/slsDetectorClientDocs/html/config.html new file mode 100644 index 000000000..69e6f447c --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/config.html @@ -0,0 +1,161 @@ + + + + + +Configuration commands + + + + + + + + + +
+ + +

Configuration commands

Commands to configure the detector. these commands are often left to the configuration file.

+
    +
  • datastream enables/disables the 0MQ data stream (0MQ threads created) from receiver to client.
  • +
+
    +
  • free Free shared memory on the control PC
  • +
+
    +
  • add Adds a detector at the end of the multi-detector structure. put argument is the hostname or IP adress. Returns the chained list of detector hostnames.
  • +
+
    +
  • remove i Removes controller i from the multi-detector structure. Can be used for partial readout of the detector.
  • +
+
    +
  • type Sets/gets detector type (string).
  • +
+
    +
  • hostname put adds the hostname (ot IP adress) at the end of the multi-detector structure. If used for a single controlled (i:) replaces the current hostname. Returns the list of the hostnames of the multi-detector structure.
  • +
+
    +
  • id[:i] Returns the id of the detector structure. i is the detector position in a multi detector system. If used a put, configures the id of the detector structure. i is the detector position in a multi detector system and l is the id of the detector to be added.
  • +
+
    +
  • master i put sets the position of the master of the acquisition (-1 if none). Returns the position of the master of the detector structure (-1 if none).
  • +
+
    +
  • sync Sets/gets the synchronization mode of the detectors in the multi-detector structure. Can be: none, gating, trigger, complementary. Mainly used by MYTHEN/GOTTHARD.
  • +
+
    +
  • online [i] sets the detector in online (1) or offline (0) mode
  • +
+
    +
  • checkonline returns the hostnames of all detectors without connecting to them
  • +
+
    +
  • activate Activates/Deactivates the detector. Deactivated detector does not send data. Used for EIGER only.
  • +
+
    +
  • lock [i] Locks/Unlocks the detector to communicate with this client. 1 locks, 0 unlocks.
  • +
+
    +
  • nmod [i] sets/gets the number of modules of the detector. Used for MYTHEN only.
  • +
+
    +
  • maxmod Gets the maximum number of modules of the detector. Used for MYTHEN only. Cannot put!
  • +
+
    +
  • dr [i] sets/gets the dynamic range of detector. Mythen [4,8,16,24]. Eiger [4,8,16,32]. Others cannot put!
  • +
+
    +
  • roi [i] [xmin] [xmax] [ymin] [ymax] sets region of interest of the detector, where i is number of rois;i=0 to clear rois. Used for GOTTHARD only.
  • +
+
    +
  • detsizechan [xmax] [ymax] sets the maximum number of channels in each dimension for complete detector set; -1 is no limit. Use for multi-detector system as first command in config file.
  • +
+
    +
  • roimask [i] ??
  • +
+
    +
  • flippeddatax [i] enables/disables data being flipped across x axis. 1 enables, 0 disables. Used for EIGER only. 1 for bottom half-module, 0 for top-half module.
  • +
+
    +
  • flags [flag] sets/gets the readout flags to mode. Options: none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog_digital, unknown. Used for MYTHEN and EIGER only.
  • +
+
    +
  • extsig:[i] [flag] sets/gets the mode of the external signal i. Options: off, gate_in_active_high, gate_in_active_low, trigger_in_rising_edge, trigger_in_falling_edge, ro_trigger_in_rising_edge, ro_trigger_in_falling_edge, gate_out_active_high, gate_out_active_low, trigger_out_rising_edge, trigger_out_falling_edge, ro_trigger_out_rising_edge, ro_trigger_out_falling_edge.
    + Used in MYTHEN, GOTTHARD, PROPIX only.
  • +
+
    +
  • programfpga [file] programs the FPGA with file f (with .pof extension). Used for JUNGFRAU, MOENCH only. Only put!
  • +
+
    +
  • resetfpga [f] resets FPGA, where f can be any value. Used for JUNGFRAU only. Only put!
  • +
+
    +
  • powerchip [i] Powers on/off the chip. 1 powers on, 0 powers off. Can also get the power status. Used for JUNGFRAU only.
  • +
+
    +
  • led [i] sets/gets the led status. 1 on, 0 off. Used for MOENCH only ??
  • +
+
    +
  • moduleversion:[i] Gets the firmware version of module i. Used for MYTHEN only. Only get!
  • +
+
    +
  • detectornumber Gets the serial number or MAC of detector. Only get!
  • +
+
    +
  • modulenumber:[i] Gets the serial number of module i. Used for MYTHEN only. Only get!
  • +
+
    +
  • detectorversion Gets the firmware version of detector. Only get!
  • +
+
    +
  • softwareversion Gets the software version of detector server. Only get!
  • +
+
    +
  • thisversion Gets the software version of this client software. Only get!
  • +
+
    +
  • receiverversion Gets the software version of receiver. Only get!
  • +
+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/data.html b/slsDetectorSoftware/slsDetectorClientDocs/html/data.html new file mode 100644 index 000000000..ce4399606 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/data.html @@ -0,0 +1,106 @@ + + + + + +Data processing commands + + + + + + + + + +
+ + +

Data processing commands

Commands to setup the data processing (mainly MYTHEN related)

+
    +
  • flatfield [fn] put sets flatfield file to fn (relative to ffdir). returns the flatfield file name relative to ffdir (string). If
  • +
+
    +
  • ffdir [d] Sets/gets the directory in which the flat field file is located.
  • +
+
    +
  • ratecorr [ns] Returns the dead time used for rate correections in ns (int). put sets the deadtime correction constant in ns, -1 will set it to default tau of settings (0 unset).
  • +
+
    +
  • badchannels [fn] put sets the badchannels file to fn . returns the bad channels file name. If
  • +
+
    +
  • angconv [fn] put sets the angular conversion file to fn . returns the angular conversion file name. If
  • +
+
    +
  • globaloff [f] Sets/gets the beamline angular global offset (float).
  • +
+
    +
  • fineoff [f] Sets/gets the angular fine offset of the measurement (float).
  • +
+
    +
  • binsize [f] Sets/gets the bin size used for the angular conversion (float).
  • +
+
    +
  • angdir [i] Sets/gets the angular direction. 1 means increasing channels number as increasing angle, -1 increasing channel number decreasing angle.
  • +
+
    +
  • moveflag [i] Sets/gets the flag for physically moving the detector during the acquisition of several positions. 1 sets (moves), 0 unsets.
  • +
+
    +
  • samplex [f] Sets/gets the sample displacement in th direction parallel to the beam in um. Unused!
  • +
+
    +
  • sampley [f] Sets/gets the sample displacement in th direction orthogonal to the beam in um. Unused!
  • +
+
    +
  • threaded [i] Sets/gets the data processing threaded flag. 1 is threaded, 0 unthreaded.
  • +
+
    +
  • darkimage fn Loads the dark image to the detector from file fn (pedestal image). Cannot get.
  • +
+
    +
  • gainimage fn Loads the gain image to the detector from file fn (gain map for translation into number of photons of an analog detector). Cannot get.
  • +
+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/doxygen.css b/slsDetectorSoftware/slsDetectorClientDocs/html/doxygen.css new file mode 100644 index 000000000..9ca3cafbc --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/doxygen.css @@ -0,0 +1,498 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + text-align: center; + font-size: 150%; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #153788; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #1b77c5; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { +} + +a.codeRef { +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + padding: 4px 6px; + margin: 4px 8px 4px 2px; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} + +td.indexkey { + background-color: #e8eef2; + font-weight: bold; + border: 1px solid #CCCCCC; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #e8eef2; + border: 1px solid #CCCCCC; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #f0f0f0; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} + +th.dirtab { + background: #e8eef2; + font-weight: bold; +} + +hr { + height: 0; + border: none; + border-top: 1px solid #666; +} + +/* @group Member Descriptions */ + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #FAFAFA; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #ccc; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memTemplParams { + color: #606060; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; + margin-left: 3px; +} + +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; + margin-bottom: 10px; +} + +.memname { + white-space: nowrap; + font-weight: bold; +} + +.memproto, .memdoc { + border: 1px solid #84b0c7; +} + +.memproto { + padding: 0; + background-color: #d5e1e8; + font-weight: bold; + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -moz-border-radius-topleft: 8px; + -moz-border-radius-topright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + +} + +.memdoc { + padding: 2px 5px; + background-color: #eef3f5; + border-top-width: 0; + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0.5em; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +address { + font-style: normal; + color: #333; +} diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/doxygen.png b/slsDetectorSoftware/slsDetectorClientDocs/html/doxygen.png new file mode 100644 index 000000000..f0a274bba Binary files /dev/null and b/slsDetectorSoftware/slsDetectorClientDocs/html/doxygen.png differ diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/index.html b/slsDetectorSoftware/slsDetectorClientDocs/html/index.html new file mode 100644 index 000000000..121676d5d --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/index.html @@ -0,0 +1,88 @@ + + + + + +Introduction + + + + + + + + + +
+

Introduction

This program is intended to control the SLS detectors via command line interface. This is the only way to access all possible functionality of the detectors, however it is often recommendable to avoid changing the most advanced settings, rather leaving the task to configuration files, as when using the GUI or the API provided.

+

The command line interface consists in four main functions:

+
    +
  • sls_detector_acquire to acquire data from the detector
  • +
  • sls_detector_put to set detector parameters
  • +
  • sls_detector_get to retrieve detector parameters
  • +
  • sls_detector_help to get help concerning the text commands Additionally the program slsReceiver should be started on the machine expected to receive the data from the detector.
  • +
+

If you need control a single detector, the use of the command line interface does not need any additional arguments.

+

For commands addressing a single controller of your detector, the command cmd should be called with the index i of the controller:

+

sls_detector_clnt i:cmd

+

where sls_detector_clnt is the text client (put, get, acquire, help).

+

In case more than one detector is configured on the control PC, the command cmd should be called with their respective index j:

+

sls_detector_clnt j-cmd

+

where sls_detector_clnt is the text client (put, get, acquire, help).

+

To address a specific controller i of detector j use:

+

sls_detector_clnt j-i:cmd

+

For additional questions concerning the indexing of the detector, please refer to the SLS Detectors FAQ documentation.

+

The commands are sudivided into different pages depending on their functionalities:

+
    +
  • Acquition commands Acquisition: commands to start/stop the acquisition and retrieve data
  • +
  • Configuration commands Configuration: commands to configure the detector
  • +
  • Data postprocessing: commands to process the data - mainly for MYTHEN except for rate corrections.
  • +
  • Settings: commands to define detector settings/threshold.
  • +
  • Output: commands to define output file destination and format
  • +
  • Actions: commands to define scripts to be executed during the acquisition flow
  • +
  • Network: commands to setup the network between client, detector and receiver
  • +
  • Receiver: commands to configure the receiver
  • +
  • Developer Developer: commands to be used only for software debugging. Avoid using them!
  • +
+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/installdox b/slsDetectorSoftware/slsDetectorClientDocs/html/installdox new file mode 100755 index 000000000..9b89fe025 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/installdox @@ -0,0 +1,117 @@ +#!/usr/bin/perl + +%subst = ( ); +$quiet = 0; + +if (open(F,"search.cfg")) +{ + $_= ; s/[ \t\n]*$//g ; $subst{"_doc"} = $_; + $_= ; s/[ \t\n]*$//g ; $subst{"_cgi"} = $_; +} + +while ( @ARGV ) { + $_ = shift @ARGV; + if ( s/^-// ) { + if ( /^l(.*)/ ) { + $v = ($1 eq "") ? shift @ARGV : $1; + ($v =~ /\/$/) || ($v .= "/"); + $_ = $v; + if ( /(.+)\@(.+)/ ) { + if ( exists $subst{$1} ) { + $subst{$1} = $2; + } else { + print STDERR "Unknown tag file $1 given with option -l\n"; + &usage(); + } + } else { + print STDERR "Argument $_ is invalid for option -l\n"; + &usage(); + } + } + elsif ( /^q/ ) { + $quiet = 1; + } + elsif ( /^\?|^h/ ) { + &usage(); + } + else { + print STDERR "Illegal option -$_\n"; + &usage(); + } + } + else { + push (@files, $_ ); + } +} + +foreach $sub (keys %subst) +{ + if ( $subst{$sub} eq "" ) + { + print STDERR "No substitute given for tag file `$sub'\n"; + &usage(); + } + elsif ( ! $quiet && $sub ne "_doc" && $sub ne "_cgi" ) + { + print "Substituting $subst{$sub} for each occurence of tag file $sub\n"; + } +} + +if ( ! @files ) { + if (opendir(D,".")) { + foreach $file ( readdir(D) ) { + $match = ".html"; + next if ( $file =~ /^\.\.?$/ ); + ($file =~ /$match/) && (push @files, $file); + ($file =~ "tree.js") && (push @files, $file); + } + closedir(D); + } +} + +if ( ! @files ) { + print STDERR "Warning: No input files given and none found!\n"; +} + +foreach $f (@files) +{ + if ( ! $quiet ) { + print "Editing: $f...\n"; + } + $oldf = $f; + $f .= ".bak"; + unless (rename $oldf,$f) { + print STDERR "Error: cannot rename file $oldf\n"; + exit 1; + } + if (open(F,"<$f")) { + unless (open(G,">$oldf")) { + print STDERR "Error: opening file $oldf for writing\n"; + exit 1; + } + if ($oldf ne "tree.js") { + while () { + s/doxygen\=\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\" (href|src)=\"\2/doxygen\=\"$1:$subst{$1}\" \3=\"$subst{$1}/g; + print G "$_"; + } + } + else { + while () { + s/\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\", \"\2/\"$1:$subst{$1}\" ,\"$subst{$1}/g; + print G "$_"; + } + } + } + else { + print STDERR "Warning file $f does not exist\n"; + } + unlink $f; +} + +sub usage { + print STDERR "Usage: installdox [options] [html-file [html-file ...]]\n"; + print STDERR "Options:\n"; + print STDERR " -l tagfile\@linkName tag file + URL or directory \n"; + print STDERR " -q Quiet mode\n\n"; + exit 1; +} diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/network.html b/slsDetectorSoftware/slsDetectorClientDocs/html/network.html new file mode 100644 index 000000000..d562e9976 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/network.html @@ -0,0 +1,112 @@ + + + + + +Network + + + + + + + + + +
+ + +

Network

Commands to setup the network between client, detector and receiver

+
    +
  • rx_hostname [s] sets/gets the receiver hostname or IP address, configures detector mac with all network parameters and updates receiver with acquisition parameters. Normally used for single detectors (Can be multi-detector). none disables. If used, use as last network command in configuring detector MAC.
  • +
+
    +
  • rx_udpip [ip] sets/gets the ip address of the receiver UDP interface where the data from the detector will be streamed to. Normally used for single detectors (Can be multi-detector). Used if different from eth0.
  • +
+
    +
  • rx_udpmac [mac] sets/gets the mac address of the receiver UDP interface where the data from the detector will be streamed to. Normally used for single detectors (Can be multi-detector).
  • +
+
    +
  • rx_udpport [port] sets/gets the port of the receiver UDP interface where the data from the detector will be streamed to. Use single-detector command.
  • +
+
    +
  • rx_udpport2 [port] sets/gets the second port of the receiver UDP interface where the data from the second half of the detector will be streamed to. Use single-detector command. Used for EIGER only.
  • +
+
    +
  • detectormac [mac] sets/gets the mac address of the detector UDP interface from where the detector will stream data. Use single-detector command. Normally unused.
  • +
+
    +
  • detectorip [ip] sets/gets the ip address of the detector UDP interface from where the detector will stream data. Use single-detector command. Keep in same subnet as rx_udpip (if rx_udpip specified).
  • +
+
    +
  • txndelay_left [delay] sets/gets the transmission delay of first packet in an image being streamed out from the detector's left UDP port. Use single-detector command. Used for EIGER only.
  • +
+
    +
  • txndelay_right [delay] sets/gets the transmission delay of first packet in an image being streamed out from the detector's right UDP port. Use single-detector command. Used for EIGER only.
  • +
+
    +
  • txndelay_frame [delay] sets/gets the transmission frame period of entire frame being streamed out from the detector for both ports. Use single-detector command. Used for EIGER only.
  • +
+
    +
  • flowcontrol_10g [delay] Enables/disables 10 GbE flow control. 1 enables, 0 disables. Used for EIGER only.
  • +
+
    +
  • zmqport [port] sets/gets the 0MQ (TCP) port of the receiver from where data is streamed to the client. Use single-detector command to set individually or multi-detector command to calculate based on port for the rest.
  • +
+
    +
  • configuremac [i] configures the MAC of the detector with these parameters: detectorip, detectormac, rx_udpip, rx_udpmac, rx_udpport, rx_udpport2 (if applicable). Only put!
  • +
+
    +
  • rx_tcpport [port] sets/gets the port of the client-receiver TCP interface. Use single-detector command. Is different for each detector if same rx_hostname used. Must be first command to communicate with receiver.
  • +
+
    +
  • port [port] sets/gets the port of the client-detector control server TCP interface. Use single-detector command. Default value is 1952 for all detectors. Normally not changed.
  • +
+
    +
  • stopport [port] sets/gets the port of the client-detector stop server TCP interface. Use single-detector command. Default value is 1953 for all detectors. Normally not changed.
  • +
+
    +
  • lastclient Gets the last client communicating with the detector. Cannot put!
  • +
+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/output.html b/slsDetectorSoftware/slsDetectorClientDocs/html/output.html new file mode 100644 index 000000000..ca4889fa8 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/output.html @@ -0,0 +1,82 @@ + + + + + +Output settings + + + + + + + + + +
+ + +

Output settings

Commands to setup the file destination and format

+
    +
  • outdir [dir] Sets/gets the file output directory (string)
  • +
+
    +
  • fname [fn] Sets/gets the root of the output file name (string)
  • +
+
    +
  • index [i] Sets/gets the current file index (int)
  • +
+
    +
  • enablefwrite [i] Enables/disables file writing. 1 enables, 0 disables.
  • +
+
    +
  • overwrite [i] enables(1) /disables(0) file overwriting
  • +
+
    +
  • currentfname gets the filename for the data without index and extension
  • +
+
    +
  • fileformat gets the file format for data (no put?) What are the possible return values?
  • +
+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/pages.html b/slsDetectorSoftware/slsDetectorClientDocs/html/pages.html new file mode 100644 index 000000000..85eec37c6 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/pages.html @@ -0,0 +1,80 @@ + + + + + +Page Index + + + + + + + + + +
+

Related Pages

Here is a list of all related documentation pages: +
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/receiver.html b/slsDetectorSoftware/slsDetectorClientDocs/html/receiver.html new file mode 100644 index 000000000..e250a4b24 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/receiver.html @@ -0,0 +1,61 @@ + + + + + +Receiver commands + + + + + + + + + +
+ + +

Receiver commands

Commands to configure the receiver

+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/search/close.png b/slsDetectorSoftware/slsDetectorClientDocs/html/search/close.png new file mode 100644 index 000000000..9342d3dfe Binary files /dev/null and b/slsDetectorSoftware/slsDetectorClientDocs/html/search/close.png differ diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/search/nomatches.html b/slsDetectorSoftware/slsDetectorClientDocs/html/search/nomatches.html new file mode 100644 index 000000000..b1ded27e9 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/search/nomatches.html @@ -0,0 +1,12 @@ + + + + + + + +
+
No Matches
+
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/search/search.css b/slsDetectorSoftware/slsDetectorClientDocs/html/search/search.css new file mode 100644 index 000000000..d263b9724 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/search/search.css @@ -0,0 +1,198 @@ +/*---------------- Search Box */ + +#MSearchBox { + padding: 0px; + margin: 0px; + border: none; + border: 1px solid #84B0C7; + white-space: nowrap; + -moz-border-radius: 8px; + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; +} +#MSearchField { + font: 9pt Arial, Verdana, sans-serif; + color: #999999; + background-color: #FFFFFF; + font-style: normal; + cursor: text; + padding: 1px 1px; + margin: 0px 6px 0px 0px; + border: none; + outline: none; + vertical-align: middle; +} +.MSearchBoxActive #MSearchField { + color: #000000; +} +#MSearchSelect { + float : none; + display : inline; + background : none; + font: 9pt Verdana, sans-serif; + border: none; + margin: 0px 0px 0px 6px; + vertical-align: middle; + padding: 0px 0px; +} + +#MSearchClose { + float : none; + display : none; + background : none; + border: none; + margin: 0px 4px 0px 0px; + padding: 0px 0px; + outline: none; +} + +#MSearchCloseImg { + vertical-align: middle; +} + +.MSearchBoxLeft { + display: block; + text-align: left; + float: left; + margin-left: 6px; +} +.MSearchBoxRight { + display: block; + float: right; + text-align: right; + margin-right: 6px; +} +.MSearchBoxSpacer { + font-size: 0px; + clear: both; +} +.MSearchBoxRow { + font-size: 0px; + clear: both; +} + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #A0A0A0; + background-color: #FAFAFA; + z-index: 1; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + } +.SelectItem { + font: 8pt Arial, Verdana, sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} +span.SelectionMark { + margin-right: 4px; + font-family: monospace; + outline-style: none; + text-decoration: none; +} +a.SelectItem { + display: block; + outline-style: none; + color: #000000; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} +a.SelectItem:focus, +a.SelectItem:active { + color: #000000; + outline-style: none; + text-decoration: none; +} +a.SelectItem:hover { + color: #FFFFFF; + background-color: #2A50E4; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + width: 60ex; + height: 15em; + } +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #000000; + background-color: #EEF3F5; + } + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; + padding-bottom: 15px; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} +body.SRPage { + margin: 5px 2px; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} +.SRPage .SRChildren { + display: none; +} +.SRSymbol { + font-weight: bold; color: #153788; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #153788; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; +} + +.SRResult { + display: none; +} + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/search/search.js b/slsDetectorSoftware/slsDetectorClientDocs/html/search/search.js new file mode 100644 index 000000000..474cc1a80 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/search/search.js @@ -0,0 +1,724 @@ +// Search script generated by doxygen +// Copyright (C) 2009 by Dimitri van Heesch. + +// The code in this file is loosly based on main.js, part of Natural Docs, +// which is Copyright (C) 2003-2008 Greg Valure +// Natural Docs is licensed under the GPL. + +var indexSectionsWithContent = +{ +}; + +var indexSectionNames = +{ +}; + +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var hexCode; + if (code<16) + { + hexCode="0"+code.toString(16); + } + else + { + hexCode=code.toString(16); + } + + var resultsPage; + var resultsPageWithSearch; + var hasResultsPage; + + if (indexSectionsWithContent[this.searchIndex].charAt(code-32) == '1') + { + resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html'; + resultsPageWithSearch = resultsPage+'?'+escape(searchValue); + hasResultsPage = true; + } + else // nothing available for this search term + { + resultsPage = this.resultsPath + '/nomatches.html'; + resultsPageWithSearch = resultsPage; + hasResultsPage = false; + } + + window.frames.MSearchResults.location.href = resultsPageWithSearch; + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + + if (domPopupSearchResultsWindow.style.display!='block') + { + var domSearchBox = this.DOMSearchBox(); + this.DOMSearchClose().style.display = 'inline'; + if (this.insideFrame) + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + domPopupSearchResultsWindow.style.position = 'relative'; + domPopupSearchResultsWindow.style.display = 'block'; + var width = document.body.clientWidth - 8; // the -8 is for IE :-( + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResults.style.width = width + 'px'; + } + else + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + var left = getXPos(domSearchBox) + domSearchBox.offsetWidth; + var top = getYPos(domSearchBox) + domSearchBox.offsetHeight + 1; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + } + } + + this.lastSearchValue = searchValue; + this.lastResultsPage = resultsPage; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + + var searchField = this.DOMSearchField(); + + if (searchField.value == this.searchLabel) // clear "Search" term upon entry + { + searchField.value = ''; + this.searchActive = true; + } + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.DOMSearchField().value = this.searchLabel; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName == 'DIV' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName == 'DIV' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + parent.document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/search/search.png b/slsDetectorSoftware/slsDetectorClientDocs/html/search/search.png new file mode 100644 index 000000000..9dd2396db Binary files /dev/null and b/slsDetectorSoftware/slsDetectorClientDocs/html/search/search.png differ diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/settings.html b/slsDetectorSoftware/slsDetectorClientDocs/html/settings.html new file mode 100644 index 000000000..7380859a5 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/settings.html @@ -0,0 +1,77 @@ + + + + + +Detector settings commands + + + + + + + + + +
+ + +

Detector settings commands

Commands to setup the settings of the detector

+
    +
  • settingsdir [dir] Sets/gets the directory where the settings files are located (string)
  • +
+
    +
  • trimdir [dir] obsolete settingsdir
  • +
+
    +
  • caldir [dir] Sets/gets the directory where the calibration files are located (string)
  • +
+
    +
  • trimen [n e0 e1...e(n-1)] Sets/gets the number of energies n at which the detector has default trim file and their values in eV (int)
  • +
+
    +
  • settings [s] sets/gets the settings of the detector. Options: standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, lownoise, dynamichg0, fixgain1, fixgain2, forceswitchg1, forceswitchg2.
    + In Eiger, only sets in client shared memory. Use threshold or threshold_notb to pass to detector
  • +
+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/tab_b.gif b/slsDetectorSoftware/slsDetectorClientDocs/html/tab_b.gif new file mode 100644 index 000000000..0d623483f Binary files /dev/null and b/slsDetectorSoftware/slsDetectorClientDocs/html/tab_b.gif differ diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/tab_l.gif b/slsDetectorSoftware/slsDetectorClientDocs/html/tab_l.gif new file mode 100644 index 000000000..9b1e6337c Binary files /dev/null and b/slsDetectorSoftware/slsDetectorClientDocs/html/tab_l.gif differ diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/tab_r.gif b/slsDetectorSoftware/slsDetectorClientDocs/html/tab_r.gif new file mode 100644 index 000000000..ce9dd9f53 Binary files /dev/null and b/slsDetectorSoftware/slsDetectorClientDocs/html/tab_r.gif differ diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/tabs.css b/slsDetectorSoftware/slsDetectorClientDocs/html/tabs.css new file mode 100644 index 000000000..a44416341 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/tabs.css @@ -0,0 +1,105 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs #MSearchBox +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; + text-align : center; + margin : 2px; + padding : 2px; +} diff --git a/slsDetectorSoftware/slsDetectorClientDocs/html/test.html b/slsDetectorSoftware/slsDetectorClientDocs/html/test.html new file mode 100644 index 000000000..488afcf72 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/html/test.html @@ -0,0 +1,100 @@ + + + + + +Developer + + + + + + + + + +
+ + +

Developer

Commands to be used only for software debugging. Avoid using them!

+
    +
  • test returns an error
  • +
+
    +
  • help Returns a list of possible commands.
  • +
+
    +
  • exitserver Shuts down all the detector servers. Don't use it!!!!
  • +
+
    +
  • exitreceiver Shuts down all the receivers. Don't use it!!!!
  • +
+
    +
  • flippeddatay [i] enables/disables data being flipped across y axis. 1 enables, 0 disables. Not implemented.
  • +
+
    +
  • digitest [i] will perform test which will plot the unique channel identifier, instead of data. Only get!
  • +
+
    +
  • bustest performs test of the bus interface between FPGA and embedded Linux system. Can last up to a few minutes. Cannot set! Used for Mythen only. Only get!
  • +
+
    +
  • digibittest:[i] performs digital test of the module i. Returns 0 if succeeded, otherwise error mask. Only put!
  • +
+
    +
  • reg [addr] [val] ??? writes to an register addr with value in hexadecimal format.
  • +
+
    +
  • adcreg [addr] [val] ??? writes to an adc register addr with value in hexadecimal format. Only put!
  • +
+
    +
  • setbit ??? Only put!
  • +
+
    +
  • clearbit ??? Only put!
  • +
+
    +
  • getbit ??? Only get!
  • +
+
+ +
+
+ + +
+ +
+ +
Generated on 15 Aug 2017 by  + +doxygen 1.6.1
+ + diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/Makefile b/slsDetectorSoftware/slsDetectorClientDocs/latex/Makefile new file mode 100644 index 000000000..8b7c89a1b --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/Makefile @@ -0,0 +1,19 @@ +all: clean refman.pdf + +pdf: refman.pdf + +refman.pdf: refman.tex + pdflatex refman.tex + makeindex refman.idx + pdflatex refman.tex + latex_count=5 ; \ + while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ + do \ + echo "Rerunning latex...." ;\ + pdflatex refman.tex ;\ + latex_count=`expr $$latex_count - 1` ;\ + done + + +clean: + rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/acquisition.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/acquisition.tex new file mode 100644 index 000000000..29603ddd1 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/acquisition.tex @@ -0,0 +1,41 @@ +Commands to control the acquisition + + +\begin{DoxyItemize} +\item {\bfseries acquire} blocking acquisition (like calling sls\_\-detector\_\-acquire). Starts receiver and detector, writes and processes the data, stops detector. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries data} gets all data from the detector (if any) processes them and writes them to file according to the preferences already setup (MYTHEN only). Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries frame} gets a single frame from the detector (if any) processes it and writes it to file according to the preferences already setup (MYTHEN only). Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries status} {\ttfamily returns} the detector status (string)-\/ can be: {\ttfamily running}, {\ttfamily error}, {\ttfamily transmitting}, {\ttfamily finished}, {\ttfamily waiting} or {\ttfamily idle}; {\ttfamily put} can be {\ttfamily start} or {\ttfamily stop} +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries busy} returns {\ttfamily 1} if the acquisition is active, {\ttfamily 0} otherwise. Works when the acquisition is started in non-\/blocking mode. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries readctr } Reads the counters from the detector memory (analog detector returning values translated into number of photons -\/ only GOTTHARD). Cannot put. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries resetctr i } Resets counter in detector, restarts acquisition if i=1(analog detector returning values translated into number of photons -\/ only GOTTHARD). Cannot put. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries resmat i } sets/resets counter bit in detector.gets the counter bit in detector ???? +\end{DoxyItemize} \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/actions.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/actions.tex new file mode 100644 index 000000000..c21066a0d --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/actions.tex @@ -0,0 +1,126 @@ +Commands to define scripts to be executed during the acquisition flow + + +\begin{DoxyItemize} +\item {\bfseries positions \mbox{[}n \mbox{[}p0..pn-\/1\mbox{]}\mbox{]}} sets/gets number of angular position and positions to be acquired. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries startscript \mbox{[}s\mbox{]}} sets/gets the script to be executed at the beginning of the acquisition. {\ttfamily none} unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries startscriptpar \mbox{[}s\mbox{]}} sets/gets a string to be passed as a parameter to the startscript +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries stopscript \mbox{[}s\mbox{]}} sets/gets the script to be executed at the end of the acquisition. {\ttfamily none} unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries stopscriptpar \mbox{[}s\mbox{]}} sets/gets a string to be passed as a parameter to the stopscript +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scriptbefore \mbox{[}s\mbox{]}} sets/gets the script to be executed before starting the detector every time in the acquisition. {\ttfamily none} unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scriptbeforepar \mbox{[}s\mbox{]}} sets/gets a string to be passed as a parameter to the scriptbefore +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scriptafter \mbox{[}s\mbox{]}} sets/gets the script to be executed after the detector has finished every time in the acquisition. {\ttfamily none} unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scriptafterpar \mbox{[}s\mbox{]}} sets/gets a string to be passed as a parameter to the scriptafter +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries headerafter \mbox{[}s\mbox{]}} sets/gets the script to be executed for logging the detector parameters. {\ttfamily none} unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries headerbefore \mbox{[}s\mbox{]}} sets/gets the script to be executed for logging the detector parameters. {\ttfamily none} unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries headerbeforepar \mbox{[}s\mbox{]}} sets/gets a string to be passed as a parameter to the headerbefore script +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries headerafterpar \mbox{[}s\mbox{]}} sets/gets a string to be passed as a parameter to the headerafter script +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries enacallog \mbox{[}i\mbox{]}} enables/disables logging of the parameters necessary for the energy calibration. 1 sets, 0 unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries angcallog \mbox{[}i\mbox{]}} enables/disables logging of the parameters necessary for the angular calibration. 1 sets, 0 unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan0script \mbox{[}s\mbox{]}} sets/gets the script to be executed for the scan 0 level. {\ttfamily none} unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan0par \mbox{[}s\mbox{]}} sets/gets a string to be passed as a parameter to the scan0script +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan0prec \mbox{[}i\mbox{]}} sets/gets number of digits to be used for the scan0 variable in the file name. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan0steps \mbox{[}i \mbox{[}s0..sn-\/1\mbox{]}\mbox{]}} sets/gets number of steps (int) of the scan0 level and their values (float). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan0range \mbox{[}smin smax sstep\mbox{]}} sets scan0 min, max and step, returns the number of steps and their values as scan0steps. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan1script \mbox{[}s\mbox{]}} sets/gets the script to be executed for the scan1 level. {\ttfamily none} unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan1par \mbox{[}s\mbox{]}} sets/gets a string to be passed as a parameter to the scan1script +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan1prec \mbox{[}i\mbox{]}} sets/gets number of digits to be used for the scan1 variable in the file name. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan1steps \mbox{[}i \mbox{[}s0..sn-\/1\mbox{]}\mbox{]}} sets/gets number of steps (int) of the scan1 level and their values (float). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries scan1range \mbox{[}smin smax sstep\mbox{]}} sets scan1 min, max and step, returns the number of steps and their values as scan1steps. +\end{DoxyItemize} \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/advanced.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/advanced.tex new file mode 100644 index 000000000..72d2fa6d2 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/advanced.tex @@ -0,0 +1 @@ +This page is for advanced users. Make sure you have first read the introduction. \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/config.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/config.tex new file mode 100644 index 000000000..777ccab11 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/config.tex @@ -0,0 +1,167 @@ +Commands to configure the detector. these commands are often left to the configuration file. + + +\begin{DoxyItemize} +\item {\bfseries datastream} enables/disables the 0MQ data stream (0MQ threads created) from receiver to client. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries free} Free shared memory on the control PC +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries add} Adds a detector at the end of the multi-\/detector structure. {\ttfamily put} argument is the hostname or IP adress. Returns the chained list of detector hostnames. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries remove i} Removes controller {\ttfamily i} from the multi-\/detector structure. Can be used for partial readout of the detector. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries type} Sets/gets detector type (string). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries hostname} {\ttfamily put} adds the hostname (ot IP adress) at the end of the multi-\/detector structure. If used for a single controlled (i:) replaces the current hostname. Returns the list of the hostnames of the multi-\/detector structure. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries id\mbox{[}:i\mbox{]}} Returns the id of the detector structure. i is the detector position in a multi detector system. If used a {\ttfamily put}, configures the id of the detector structure. i is the detector position in a multi detector system and l is the id of the detector to be added. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries master i} {\ttfamily put} sets the position of the master of the acquisition (-\/1 if none). Returns the position of the master of the detector structure (-\/1 if none). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries sync} Sets/gets the synchronization mode of the detectors in the multi-\/detector structure. Can be: {\ttfamily none}, {\ttfamily gating}, {\ttfamily trigger}, {\ttfamily complementary}. Mainly used by MYTHEN/GOTTHARD. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries online \mbox{[}i\mbox{]}} sets the detector in online (1) or offline (0) mode +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries checkonline} returns the hostnames of all detectors without connecting to them +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries activate} Activates/Deactivates the detector. Deactivated detector does not send data. Used for EIGER only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries lock \mbox{[}i\mbox{]}} Locks/Unlocks the detector to communicate with this client. 1 locks, 0 unlocks. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries nmod \mbox{[}i\mbox{]}} sets/gets the number of modules of the detector. Used for MYTHEN only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries maxmod } Gets the maximum number of modules of the detector. Used for MYTHEN only. Cannot put! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries dr \mbox{[}i\mbox{]}} sets/gets the dynamic range of detector. Mythen \mbox{[}4,8,16,24\mbox{]}. Eiger \mbox{[}4,8,16,32\mbox{]}. Others cannot put! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries roi \mbox{[}i\mbox{]} \mbox{[}xmin\mbox{]} \mbox{[}xmax\mbox{]} \mbox{[}ymin\mbox{]} \mbox{[}ymax\mbox{]} } sets region of interest of the detector, where i is number of rois;i=0 to clear rois. Used for GOTTHARD only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries detsizechan \mbox{[}xmax\mbox{]} \mbox{[}ymax\mbox{]}} sets the maximum number of channels in each dimension for complete detector set; -\/1 is no limit. Use for multi-\/detector system as first command in config file. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries roimask \mbox{[}i\mbox{]}} ?? +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries flippeddatax \mbox{[}i\mbox{]}} enables/disables data being flipped across x axis. 1 enables, 0 disables. Used for EIGER only. 1 for bottom half-\/module, 0 for top-\/half module. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries flags \mbox{[}flag\mbox{]}} sets/gets the readout flags to mode. Options: none, storeinram, tot, continous, parallel, nonparallel, safe, digital, analog\_\-digital, unknown. Used for MYTHEN and EIGER only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries extsig:\mbox{[}i\mbox{]} \mbox{[}flag\mbox{]}} sets/gets the mode of the external signal i. Options: {\ttfamily off}, {\ttfamily gate\_\-in\_\-active\_\-high}, {\ttfamily gate\_\-in\_\-active\_\-low}, {\ttfamily trigger\_\-in\_\-rising\_\-edge}, {\ttfamily trigger\_\-in\_\-falling\_\-edge}, {\ttfamily ro\_\-trigger\_\-in\_\-rising\_\-edge}, {\ttfamily ro\_\-trigger\_\-in\_\-falling\_\-edge}, {\ttfamily gate\_\-out\_\-active\_\-high}, {\ttfamily gate\_\-out\_\-active\_\-low}, {\ttfamily trigger\_\-out\_\-rising\_\-edge}, {\ttfamily trigger\_\-out\_\-falling\_\-edge}, {\ttfamily ro\_\-trigger\_\-out\_\-rising\_\-edge}, {\ttfamily ro\_\-trigger\_\-out\_\-falling\_\-edge}. \par + Used in MYTHEN, GOTTHARD, PROPIX only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries programfpga \mbox{[}file\mbox{]}} programs the FPGA with file f (with .pof extension). Used for JUNGFRAU, MOENCH only. Only put! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries resetfpga \mbox{[}f\mbox{]}} resets FPGA, where f can be any value. Used for JUNGFRAU only. Only put! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries powerchip \mbox{[}i\mbox{]}} Powers on/off the chip. 1 powers on, 0 powers off. Can also get the power status. Used for JUNGFRAU only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries led \mbox{[}i\mbox{]}} sets/gets the led status. 1 on, 0 off. Used for MOENCH only ?? +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries moduleversion:\mbox{[}i\mbox{]}} Gets the firmware version of module i. Used for MYTHEN only. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries detectornumber} Gets the serial number or MAC of detector. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries modulenumber:\mbox{[}i\mbox{]}} Gets the serial number of module i. Used for MYTHEN only. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries detectorversion} Gets the firmware version of detector. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries softwareversion} Gets the software version of detector server. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries thisversion} Gets the software version of this client software. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries receiverversion} Gets the software version of receiver. Only get! +\end{DoxyItemize} \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/data.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/data.tex new file mode 100644 index 000000000..898020fd0 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/data.tex @@ -0,0 +1,76 @@ +Commands to setup the data processing (mainly MYTHEN related) + + +\begin{DoxyItemize} +\item {\bfseries flatfield \mbox{[}fn\mbox{]}} {\ttfamily put} sets flatfield file to {\ttfamily fn} (relative to {\ttfamily ffdir}). returns the flatfield file name relative to {\ttfamily ffdir} (string). If +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries ffdir \mbox{[}d\mbox{]}} Sets/gets the directory in which the flat field file is located. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries ratecorr \mbox{[}ns\mbox{]}} Returns the dead time used for rate correections in ns (int). {\ttfamily put} sets the deadtime correction constant in ns, -\/1 will set it to default tau of settings (0 unset). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries badchannels \mbox{[}fn\mbox{]}} {\ttfamily put} sets the badchannels file to {\ttfamily fn} . returns the bad channels file name. If +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries angconv \mbox{[}fn\mbox{]}} {\ttfamily put} sets the angular conversion file to {\ttfamily fn} . returns the angular conversion file name. If +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries globaloff \mbox{[}f\mbox{]}} Sets/gets the beamline angular global offset (float). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries fineoff \mbox{[}f\mbox{]}} Sets/gets the angular fine offset of the measurement (float). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries binsize \mbox{[}f\mbox{]}} Sets/gets the bin size used for the angular conversion (float). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries angdir \mbox{[}i\mbox{]}} Sets/gets the angular direction. 1 means increasing channels number as increasing angle, -\/1 increasing channel number decreasing angle. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries moveflag \mbox{[}i\mbox{]}} Sets/gets the flag for physically moving the detector during the acquisition of several positions. 1 sets (moves), 0 unsets. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries samplex \mbox{[}f\mbox{]}} Sets/gets the sample displacement in th direction parallel to the beam in um. Unused! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries sampley \mbox{[}f\mbox{]}} Sets/gets the sample displacement in th direction orthogonal to the beam in um. Unused! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries threaded \mbox{[}i\mbox{]}} Sets/gets the data processing threaded flag. 1 is threaded, 0 unthreaded. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries darkimage fn} Loads the dark image to the detector from file fn (pedestal image). Cannot get. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries gainimage fn} Loads the gain image to the detector from file fn (gain map for translation into number of photons of an analog detector). Cannot get. +\end{DoxyItemize} \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/doxygen.sty b/slsDetectorSoftware/slsDetectorClientDocs/latex/doxygen.sty new file mode 100644 index 000000000..c953c0ef2 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/doxygen.sty @@ -0,0 +1,348 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{doxygen} + +% Packages used by this style file +\RequirePackage{alltt} +\RequirePackage{array} +\RequirePackage{calc} +\RequirePackage{color} +\RequirePackage{fancyhdr} +\RequirePackage{verbatim} + +% Setup fancy headings +\pagestyle{fancyplain} +\newcommand{\clearemptydoublepage}{% + \newpage{\pagestyle{empty}\cleardoublepage}% +} +\renewcommand{\sectionmark}[1]{% + \markright{\thesection\ #1}% +} +\lhead[\fancyplain{}{\bfseries\thepage}]{% + \fancyplain{}{\bfseries\rightmark}% +} +\rhead[\fancyplain{}{\bfseries\leftmark}]{% + \fancyplain{}{\bfseries\thepage}% +} +\rfoot[\fancyplain{}{\bfseries\scriptsize% + Generated on Tue Aug 15 17:35:40 2017 by Doxygen }]{} +\lfoot[]{\fancyplain{}{\bfseries\scriptsize% + Generated on Tue Aug 15 17:35:40 2017 by Doxygen }} +\cfoot{} + +%---------- Internal commands used in this style file ---------------- + +% Generic environment used by all paragraph-based environments defined +% below. Note that the command \title{...} needs to be defined inside +% those environments! +\newenvironment{DoxyDesc}[1]{% + \begin{list}{}% + {% + \settowidth{\labelwidth}{40pt}% + \setlength{\leftmargin}{\labelwidth}% + \setlength{\parsep}{0pt}% + \setlength{\itemsep}{-4pt}% + \renewcommand{\makelabel}{\entrylabel}% + }% + \item[#1:]% +}{% + \end{list}% +} + +%---------- Commands used by doxygen LaTeX output generator ---------- + +% Used by
 ... 
+\newenvironment{DoxyPre}{% + \small% + \begin{alltt}% +}{% + \end{alltt}% + \normalsize% +} + +% Used by @code ... @endcode +\newenvironment{DoxyCode}{% + \footnotesize% + \verbatim% +}{% + \endverbatim% + \normalsize% +} + +% Used by @example, @include, @includelineno and @dontinclude +\newenvironment{DoxyCodeInclude}{% + \DoxyCode% +}{% + \endDoxyCode% +} + +% Used by @verbatim ... @endverbatim +\newenvironment{DoxyVerb}{% + \footnotesize% + \verbatim% +}{% + \endverbatim% + \normalsize% +} + +% Used by @verbinclude +\newenvironment{DoxyVerbInclude}{% + \DoxyVerb% +}{% + \endDoxyVerb% +} + +% Used by numbered lists (using '-#' or
    ...
) +\newenvironment{DoxyEnumerate}{% + \enumerate% +}{% + \endenumerate% +} + +% Used by bullet lists (using '-', @li, @arg, or
    ...
) +\newenvironment{DoxyItemize}{% + \itemize% +}{% + \enditemize% +} + +% Used by description lists (using
...
) +\newenvironment{DoxyDescription}{% + \description% +}{% + \enddescription% +} + +% Used by @image, @dotfile, and @dot ... @enddot +% (only if caption is specified) +\newenvironment{DoxyImage}{% + \begin{figure}[H]% + \begin{center}% +}{% + \end{center}% + \end{figure}% +} + +% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc +% (only if no caption is specified) +\newenvironment{DoxyImageNoCaption}{% +}{% +} + +% Used by @attention +\newenvironment{DoxyAttention}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @author and @authors +\newenvironment{DoxyAuthor}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @date +\newenvironment{DoxyDate}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @invariant +\newenvironment{DoxyInvariant}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @note +\newenvironment{DoxyNote}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @post +\newenvironment{DoxyPostcond}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @pre +\newenvironment{DoxyPrecond}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @remark +\newenvironment{DoxyRemark}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @return +\newenvironment{DoxyReturn}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @since +\newenvironment{DoxySince}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @see +\newenvironment{DoxySeeAlso}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @version +\newenvironment{DoxyVersion}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @warning +\newenvironment{DoxyWarning}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @internal +\newenvironment{DoxyInternal}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @par and @paragraph +\newenvironment{DoxyParagraph}[1]{% + \begin{list}{}% + {% + \settowidth{\labelwidth}{40pt}% + \setlength{\leftmargin}{\labelwidth}% + \setlength{\parsep}{0pt}% + \setlength{\itemsep}{-4pt}% + \renewcommand{\makelabel}{\entrylabel}% + }% + \item[#1]% +}{% + \end{list}% +} + +% Used by parameter lists +\newenvironment{DoxyParams}[1]{% + \begin{DoxyDesc}{#1}% + \begin{description}% +}{% + \end{description}% + \end{DoxyDesc}% +} + +% Used by return value lists +\newenvironment{DoxyRetVals}[1]{% + \begin{DoxyDesc}{#1}% + \begin{description}% +}{% + \end{description}% + \end{DoxyDesc}% +} + +% Used by exception lists +\newenvironment{DoxyExceptions}[1]{% + \begin{DoxyDesc}{#1}% + \begin{description}% +}{% + \end{description}% + \end{DoxyDesc}% +} + +% Used by template parameter lists +\newenvironment{DoxyTemplParams}[1]{% + \begin{DoxyDesc}{#1}% + \begin{description}% +}{% + \end{description}% + \end{DoxyDesc}% +} + +\newcommand{\doxyref}[3]{\textbf{#1} (\textnormal{#2}\,\pageref{#3})} +\newenvironment{DoxyCompactList} +{\begin{list}{}{ + \setlength{\leftmargin}{0.5cm} + \setlength{\itemsep}{0pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \renewcommand{\makelabel}{\hfill}}} +{\end{list}} +\newenvironment{DoxyCompactItemize} +{ + \begin{itemize} + \setlength{\itemsep}{-3pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \setlength{\partopsep}{0pt} +} +{\end{itemize}} +\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp} +\newlength{\tmplength} +\newenvironment{TabularC}[1] +{ +\setlength{\tmplength} + {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)} + \par\begin{tabular*}{\linewidth} + {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|} +} +{\end{tabular*}\par} +\newcommand{\entrylabel}[1]{ + {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{\textbf{#1}}\vspace{1.5\baselineskip}}}} +\newenvironment{Desc} +{\begin{list}{} + { + \settowidth{\labelwidth}{40pt} + \setlength{\leftmargin}{\labelwidth} + \setlength{\parsep}{0pt} + \setlength{\itemsep}{-4pt} + \renewcommand{\makelabel}{\entrylabel} + } +} +{\end{list}} +\newenvironment{Indent} + {\begin{list}{}{\setlength{\leftmargin}{0.5cm}} + \item[]\ignorespaces} + {\unskip\end{list}} +\setlength{\parindent}{0cm} +\setlength{\parskip}{0.2cm} +\addtocounter{secnumdepth}{1} +\sloppy +\usepackage[T1]{fontenc} +\makeatletter +\renewcommand{\paragraph}{\@startsection{paragraph}{4}{0ex}% + {-3.25ex plus -1ex minus -0.2ex}% + {1.5ex plus 0.2ex}% + {\normalfont\normalsize\bfseries}} +\makeatother +\stepcounter{secnumdepth} +\stepcounter{tocdepth} +\definecolor{comment}{rgb}{0.5,0.0,0.0} +\definecolor{keyword}{rgb}{0.0,0.5,0.0} +\definecolor{keywordtype}{rgb}{0.38,0.25,0.125} +\definecolor{keywordflow}{rgb}{0.88,0.5,0.0} +\definecolor{preprocessor}{rgb}{0.5,0.38,0.125} +\definecolor{stringliteral}{rgb}{0.0,0.125,0.25} +\definecolor{charliteral}{rgb}{0.0,0.5,0.5} +\definecolor{vhdldigit}{rgb}{1.0,0.0,1.0} +\definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43} +\definecolor{vhdllogic}{rgb}{1.0,0.0,0.0} +\definecolor{vhdlchar}{rgb}{0.0,0.0,0.0} diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/index.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/index.tex new file mode 100644 index 000000000..613142828 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/index.tex @@ -0,0 +1,44 @@ +This program is intended to control the SLS detectors via command line interface. This is the only way to access all possible functionality of the detectors, however it is often recommendable to avoid changing the most advanced settings, rather leaving the task to configuration files, as when using the GUI or the API provided. + +The command line interface consists in four main functions: + + +\begin{DoxyItemize} +\item {\bfseries sls\_\-detector\_\-acquire} to acquire data from the detector +\item {\bfseries sls\_\-detector\_\-put} to set detector parameters +\item {\bfseries sls\_\-detector\_\-get} to retrieve detector parameters +\item {\bfseries sls\_\-detector\_\-help} to get help concerning the text commands Additionally the program slsReceiver should be started on the machine expected to receive the data from the detector. +\end{DoxyItemize} + +If you need control a single detector, the use of the command line interface does not need any additional arguments. + +For commands addressing a single controller of your detector, the command cmd should be called with the index i of the controller: + +{\bfseries sls\_\-detector\_\-clnt i:cmd} + +where {\bfseries sls\_\-detector\_\-clnt} is the text client (put, get, acquire, help). + +In case more than one detector is configured on the control PC, the command cmd should be called with their respective index j: + +{\bfseries sls\_\-detector\_\-clnt j-\/cmd} + +where {\bfseries sls\_\-detector\_\-clnt} is the text client (put, get, acquire, help). + +To address a specific controller i of detector j use: + +{\bfseries sls\_\-detector\_\-clnt j-\/i:cmd} + +For additional questions concerning the indexing of the detector, please refer to the SLS Detectors FAQ documentation. + +The commands are sudivided into different pages depending on their functionalities: +\begin{DoxyItemize} +\item \hyperlink{acquisition}{Acquition commands} Acquisition: commands to start/stop the acquisition and retrieve data +\item \hyperlink{config}{Configuration commands} Configuration: commands to configure the detector +\item \hyperlink{data}{Data postprocessing}: commands to process the data -\/ mainly for MYTHEN except for rate corrections. +\item \hyperlink{settings}{Settings}: commands to define detector settings/threshold. +\item \hyperlink{output}{Output}: commands to define output file destination and format +\item \hyperlink{actions}{Actions}: commands to define scripts to be executed during the acquisition flow +\item \hyperlink{network}{Network}: commands to setup the network between client, detector and receiver +\item \hyperlink{receiver}{Receiver}: commands to configure the receiver +\item \hyperlink{test}{Developer} Developer: commands to be used only for software debugging. Avoid using them! +\end{DoxyItemize} \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/network.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/network.tex new file mode 100644 index 000000000..26dd6c0a1 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/network.tex @@ -0,0 +1,84 @@ +Commands to setup the network between client, detector and receiver +\begin{DoxyItemize} +\item {\bfseries rx\_\-hostname \mbox{[}s\mbox{]}} sets/gets the receiver hostname or IP address, configures detector mac with all network parameters and updates receiver with acquisition parameters. Normally used for single detectors (Can be multi-\/detector). {\ttfamily none} disables. If used, use as last network command in configuring detector MAC. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries rx\_\-udpip \mbox{[}ip\mbox{]}} sets/gets the ip address of the receiver UDP interface where the data from the detector will be streamed to. Normally used for single detectors (Can be multi-\/detector). Used if different from eth0. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries rx\_\-udpmac \mbox{[}mac\mbox{]}} sets/gets the mac address of the receiver UDP interface where the data from the detector will be streamed to. Normally used for single detectors (Can be multi-\/detector). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries rx\_\-udpport \mbox{[}port\mbox{]}} sets/gets the port of the receiver UDP interface where the data from the detector will be streamed to. Use single-\/detector command. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries rx\_\-udpport2 \mbox{[}port\mbox{]}} sets/gets the second port of the receiver UDP interface where the data from the second half of the detector will be streamed to. Use single-\/detector command. Used for EIGER only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries detectormac \mbox{[}mac\mbox{]}} sets/gets the mac address of the detector UDP interface from where the detector will stream data. Use single-\/detector command. Normally unused. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries detectorip \mbox{[}ip\mbox{]}} sets/gets the ip address of the detector UDP interface from where the detector will stream data. Use single-\/detector command. Keep in same subnet as rx\_\-udpip (if rx\_\-udpip specified). +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries txndelay\_\-left \mbox{[}delay\mbox{]}} sets/gets the transmission delay of first packet in an image being streamed out from the detector's left UDP port. Use single-\/detector command. Used for EIGER only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries txndelay\_\-right \mbox{[}delay\mbox{]}} sets/gets the transmission delay of first packet in an image being streamed out from the detector's right UDP port. Use single-\/detector command. Used for EIGER only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries txndelay\_\-frame \mbox{[}delay\mbox{]}} sets/gets the transmission frame period of entire frame being streamed out from the detector for both ports. Use single-\/detector command. Used for EIGER only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries flowcontrol\_\-10g \mbox{[}delay\mbox{]}} Enables/disables 10 GbE flow control. 1 enables, 0 disables. Used for EIGER only. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries zmqport \mbox{[}port\mbox{]}} sets/gets the 0MQ (TCP) port of the receiver from where data is streamed to the client. Use single-\/detector command to set individually or multi-\/detector command to calculate based on {\ttfamily port} for the rest. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries configuremac \mbox{[}i\mbox{]}} configures the MAC of the detector with these parameters: detectorip, detectormac, rx\_\-udpip, rx\_\-udpmac, rx\_\-udpport, rx\_\-udpport2 (if applicable). Only put! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries rx\_\-tcpport \mbox{[}port\mbox{]}} sets/gets the port of the client-\/receiver TCP interface. Use single-\/detector command. Is different for each detector if same {\ttfamily rx\_\-hostname} used. Must be first command to communicate with receiver. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries port \mbox{[}port\mbox{]}} sets/gets the port of the client-\/detector control server TCP interface. Use single-\/detector command. Default value is 1952 for all detectors. Normally not changed. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries stopport \mbox{[}port\mbox{]}} sets/gets the port of the client-\/detector stop server TCP interface. Use single-\/detector command. Default value is 1953 for all detectors. Normally not changed. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries lastclient } Gets the last client communicating with the detector. Cannot put! +\end{DoxyItemize} \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/output.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/output.tex new file mode 100644 index 000000000..d75abbf68 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/output.tex @@ -0,0 +1,36 @@ +Commands to setup the file destination and format + + +\begin{DoxyItemize} +\item {\bfseries outdir \mbox{[}dir\mbox{]}} Sets/gets the file output directory (string) +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries fname \mbox{[}fn\mbox{]}} Sets/gets the root of the output file name (string) +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries index \mbox{[}i\mbox{]}} Sets/gets the current file index (int) +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries enablefwrite \mbox{[}i\mbox{]}} Enables/disables file writing. 1 enables, 0 disables. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries overwrite \mbox{[}i\mbox{]}} enables(1) /disables(0) file overwriting +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries currentfname} gets the filename for the data without index and extension +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries fileformat} gets the file format for data (no put?) What are the possible return values? +\end{DoxyItemize} \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/receiver.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/receiver.tex new file mode 100644 index 000000000..6767ad068 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/receiver.tex @@ -0,0 +1 @@ +Commands to configure the receiver \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/refman.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/refman.tex new file mode 100644 index 000000000..402177a1d --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/refman.tex @@ -0,0 +1,93 @@ +\documentclass[a4paper]{article} +\usepackage{makeidx} +\usepackage{graphicx} +\usepackage{multicol} +\usepackage{float} +\usepackage{listings} +\usepackage{color} +\usepackage{textcomp} +\usepackage{alltt} +\usepackage{times} +\usepackage{ifpdf} +\ifpdf +\usepackage[pdftex, + pagebackref=true, + colorlinks=true, + linkcolor=blue, + unicode + ]{hyperref} +\else +\usepackage[ps2pdf, + pagebackref=true, + colorlinks=true, + linkcolor=blue, + unicode + ]{hyperref} +\usepackage{pspicture} +\fi +\usepackage[utf8]{inputenc} +\usepackage{doxygen} +\lstset{language=C++,inputencoding=utf8,basicstyle=\footnotesize,breaklines=true,breakatwhitespace=true,tabsize=8,numbers=left } +\makeindex +\setcounter{tocdepth}{3} +\renewcommand{\footrulewidth}{0.4pt} +\begin{document} +\hypersetup{pageanchor=false} +\begin{titlepage} +\vspace*{7cm} +\begin{center} +{\Large Reference Manual}\\ +\vspace*{1cm} +{\large Generated by Doxygen 1.6.1}\\ +\vspace*{0.5cm} +{\small Tue Aug 15 17:35:40 2017}\\ +\end{center} +\end{titlepage} +\pagenumbering{roman} +\tableofcontents +\pagenumbering{arabic} +\hypersetup{pageanchor=true} +\section{Introduction} +\label{index}\hypertarget{index}{}\input{index} +\section{Developer} +\label{test} +\hypertarget{test}{} +\input{test} +\section{Acquition commands} +\label{acquisition} +\hypertarget{acquisition}{} +\input{acquisition} +\section{Configuration commands} +\label{config} +\hypertarget{config}{} +\input{config} +\section{Data processing commands} +\label{data} +\hypertarget{data}{} +\input{data} +\section{Detector settings commands} +\label{settings} +\hypertarget{settings}{} +\input{settings} +\section{Output settings} +\label{output} +\hypertarget{output}{} +\input{output} +\section{Actions} +\label{actions} +\hypertarget{actions}{} +\input{actions} +\section{Network} +\label{network} +\hypertarget{network}{} +\input{network} +\section{Receiver commands} +\label{receiver} +\hypertarget{receiver}{} +\input{receiver} +\section{Advanced Usage} +\label{advanced} +\hypertarget{advanced}{} +\input{advanced} +\printindex +\end{document} diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/settings.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/settings.tex new file mode 100644 index 000000000..ab67306c3 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/settings.tex @@ -0,0 +1,27 @@ +Commands to setup the settings of the detector + + +\begin{DoxyItemize} +\item {\bfseries settingsdir \mbox{[}dir\mbox{]}} Sets/gets the directory where the settings files are located (string) +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries trimdir \mbox{[}dir\mbox{]}} obsolete {\ttfamily settingsdir} +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries caldir \mbox{[}dir\mbox{]}} Sets/gets the directory where the calibration files are located (string) +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries trimen \mbox{[}n e0 e1...e(n-\/1)\mbox{]}} Sets/gets the number of energies n at which the detector has default trim file and their values in eV (int) +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries settings \mbox{[}s\mbox{]}} sets/gets the settings of the detector. Options: {\ttfamily standard}, {\ttfamily fast}, {\ttfamily highgain}, {\ttfamily dynamicgain}, {\ttfamily lowgain}, {\ttfamily mediumgain}, {\ttfamily veryhighgain}, {\ttfamily lownoise}, {\ttfamily dynamichg0}, {\ttfamily fixgain1}, {\ttfamily fixgain2}, {\ttfamily forceswitchg1}, {\ttfamily forceswitchg2}. \par + In Eiger, only sets in client shared memory. Use {\ttfamily threshold} or {\ttfamily threshold\_\-notb} to pass to detector +\end{DoxyItemize} \ No newline at end of file diff --git a/slsDetectorSoftware/slsDetectorClientDocs/latex/test.tex b/slsDetectorSoftware/slsDetectorClientDocs/latex/test.tex new file mode 100644 index 000000000..887052aa3 --- /dev/null +++ b/slsDetectorSoftware/slsDetectorClientDocs/latex/test.tex @@ -0,0 +1,64 @@ +Commands to be used only for software debugging. Avoid using them! +\begin{DoxyItemize} +\item {\bfseries test} returns an error +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries help} Returns a list of possible commands. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries exitserver} Shuts down all the detector servers. Don't use it!!!! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries exitreceiver} Shuts down all the receivers. Don't use it!!!! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries flippeddatay \mbox{[}i\mbox{]}} enables/disables data being flipped across y axis. 1 enables, 0 disables. Not implemented. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries digitest \mbox{[}i\mbox{]}} will perform test which will plot the unique channel identifier, instead of data. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries bustest} performs test of the bus interface between FPGA and embedded Linux system. Can last up to a few minutes. Cannot set! Used for Mythen only. Only get! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries digibittest:\mbox{[}i\mbox{]}} performs digital test of the module i. Returns 0 if succeeded, otherwise error mask. Only put! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries reg \mbox{[}addr\mbox{]} \mbox{[}val\mbox{]}} ??? writes to an register {\ttfamily addr} with {\ttfamily value} in hexadecimal format. +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries adcreg \mbox{[}addr\mbox{]} \mbox{[}val\mbox{]}} ??? writes to an adc register {\ttfamily addr} with {\ttfamily value} in hexadecimal format. Only put! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries setbit} ??? Only put! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries clearbit } ??? Only put! +\end{DoxyItemize} + + +\begin{DoxyItemize} +\item {\bfseries getbit } ??? Only get! +\end{DoxyItemize} \ No newline at end of file