1 / 16

LBTO Events

LBTO Events. August 15, 2006 Chris Biddick. 1 cjb. Introduction. Events are the TCS logging system Report and save all important events in the TCS Part of the Data Dictionary Events are composed of XML definitions Binary definitions (ddsconfig) EventHandler piece of CommonSW

diamond
Download Presentation

LBTO Events

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LBTO Events August 15, 2006 Chris Biddick 1 cjb

  2. Introduction • Events are the TCS logging system • Report and save all important events in the TCS • Part of the Data Dictionary • Events are composed of • XML definitions • Binary definitions (ddsconfig) • EventHandler piece of CommonSW • LSS subsystem • Reference document: 481s505 2 cjb

  3. Event categories • Command started and complete/failed • Starting/stopping of data streams, for example tracking polynomials • Errors • ……. • Include pertinent data • Don’t include large amounts of data • Only relatively slow things 3 cjb

  4. Event definitions • Path in CVS: • LBTO/TCS/usr/commonsw/DDArchive/Events/ • Every subsystem has a directory • Event files are hierarchical in the file system • PSF/PrimaryMirror/Command/SetZernikes/started.xml • Capitalization rules: the subsystem name must be all capitals, and the first letter of each directory name must be a capital • Event object name • psf.primaryMirror.command.setZernikes.started • To match a defined event, the subsystem name is converted to upper case, and the first letter after each dot except the last is converted to upper case 4 cjb

  5. Event definition example <?xml version="1.0" encoding="UTF-16" standalone="no" ?> <Event_Dictionary_Entry> <Name>started</Name> <FullQualifiedName>PSF/PrimaryMirror/Command/SetZernikes/started</FullQualifiedName> <Description>setZernikes command started</Description> <LogString>%1 PSF Getting Zernike coefficients for primary mirror</LogString> <Priority>5</Priority> <Parameter> <Name>side</Name> <Units>N/A</Units> </Parameter> <UpdateInfo> <UserName>cjb</UserName> <UserClass>ASTRONOMER</UserClass> <UpdateDescription>Modified logString field</UpdateDescription> <Date_Of_Updation>2006-02-04</Date_Of_Updation> <Time_Of_Updation>20:38:40</Time_Of_Updation> </UpdateInfo> </Event_Dictionary_Entry> 5 cjb

  6. EventEditorGUI • Display/create/modify event definitions • Populates FullQualifiedName and all UpdateInfo fields • Directory options • Add folder • Add file • Delete • Rename • Move • Copy 6 cjb

  7. EventEditorGUI (cont) • File options • Edit file • Delete • Rename • Move • Copy 7 cjb

  8. Binary event definitions • Install event (and other) definitions • cd LBTO/TCS/usr • sudo make install • Run ddsconfig • sudo ddsconfig -events • Makes binary event definition file: /usr/local/bin/.binEventDictionary from /usr/commonsw/DDArchive/Events/ 8 cjb

  9. Event object • Name of the event • MJD of the event • Calendar date and time of the event • Subsystem name • Priority of the event • Description of the event • Parameters for the event 9 cjb

  10. Event object (cont) • Methods exist to set/get all members • template<class T> void setParameter(string name, T value) • Set the value of parameter name whereT may be any type understood by ostringstream. Note that the value is stored as a string, so there is no type associated with a parameter. 10 cjb

  11. Event object (cont) • string logEvent() • Tries to log the event in the database, but if that fails then logs it locally (/tmp/SUB.log (i.e., /tmp/PSF.log)). • The return value is the XML that was logged in the database, or • ‘LSSDOWN’ if the LSS is not running • ‘INVALIDSUBSYSTEM’ if the subsystem requesting the logging is not recognized • ‘INVALIDEVENT’ if event name is invalid 11 cjb

  12. Example: logging an event string sideName; float offset,kp,ki,kd; int state; Event cmdRcv("pmc.thermal.command.setData.started"); cmdRcv.setParameter("side",sideName); cmdRcv.setParameter("offset",offset); cmdRcv.setParameter("kp",kp); cmdRcv.setParameter("ki",ki); cmdRcv.setParameter("kd",kd); cmdRcv.setParameter("state",state); cmdRcv.logEvent(); 12 cjb

  13. LSS subsystem • Saves events in MySql database • Provides callbacks for logged events • EventHandler provides most functionality • Callback list is stored in database 13 cjb

  14. LSS database • MySql database LBT_log on host mysql • Table Event holds events • Table EventClient holds list of current event callbacks • Table EventParameters holds parameters 14 cjb

  15. LSS database (cont) • No event viewer (good grad student job) • Access • mysql –ulss –plss –hmysql LBT_log 15 cjb

  16. LSS callbacks • Clients requests callbacks for events by name – may include wildcards (‘psf.*’) • When events are logged the client function is called with a string argument containing the event encoded as XML • The client instantiates an event, and loads it using setEvent(XML) • The client uses event methods to retrieve information from the event • See 481s505 for more details and an example 16 cjb

More Related