16
LBTO Events August 15, 2006 Chris Biddick 1 cjb

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

Embed Size (px)

Citation preview

Page 1: 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

LBTO Events

August 15, 2006

Chris Biddick

1 cjb

Page 2: 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

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

Page 3: 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

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

Page 4: 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

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

Page 5: 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

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

Page 6: 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

EventEditorGUI

Display/create/modify event definitions Populates FullQualifiedName and all

UpdateInfo fields Directory options

• Add folder

• Add file

• Delete

• Rename

• Move

• Copy

6 cjb

Page 7: 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

EventEditorGUI (cont)

File options• Edit file

• Delete

• Rename

• Move

• Copy

7 cjb

Page 8: 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

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

Page 9: 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

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

Page 10: 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

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 where T

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

Page 11: 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

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

Page 12: 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

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

Page 13: 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

LSS subsystem

Saves events in MySql database Provides callbacks for logged events

• EventHandler provides most functionality

• Callback list is stored in database

13 cjb

Page 14: 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

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

Page 15: 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

LSS database (cont)

No event viewer (good grad student job) Access

• mysql –ulss –plss –hmysql LBT_log

15 cjb

Page 16: 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

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