130 likes | 281 Views
LBTO Reflective Memory. August 17, 2006 Chris Biddick. 1 cjb. Introduction. Mechanism for maintaining all TCS state and status Local shared memory segment Network demon to update all systems Part of the Data Dictionary Reflective memory is composed of XML definitions
E N D
LBTO Reflective Memory August 17, 2006 Chris Biddick 1 cjb
Introduction • Mechanism for maintaining all TCS state and status • Local shared memory segment • Network demon to update all systems • Part of the Data Dictionary • Reflective memory is composed of • XML definitions • Binary definitions (ddsconfig) • Several pieces of CommonSW • Network • Reference document: 481s504 2 cjb
Reflective memory definitions • Path in CVS: • LBTO/TCS/usr/commonsw/DDArchive/ReflectiveMemory/ • Every subsystem has a directory • Files are hierarchical in the file system • PSF/PSFside/PrimaryMirror/modes.xml psf.side[n].primaryMirror.modes • Arrays allowed at all levels • Variable types: • BIT, CHAR, UCHAR, SHORT, USHORT, INT, UINT • LONG, ULONG, FLOAT, DOUBLE, STRING • Subdirectory name 3 cjb
XML files • Meta Dictionary Entry • Defines level of hierarchy • Points to subdirectory • Determines element name • Reflective Memory Dictionary Entry • Defines actual variables 4 cjb
Meta Dictionary Entry example <?xml version="1.0" encoding="UTF-8"?> <Meta_Dictionary_Entry> <Name>side</Name> <FullQualifiedName>PSF/side</FullQualifiedName> <Owner>PSF</Owner> <UnitType>PSFside</UnitType> <UnitQty>2</UnitQty> </Meta_Dictionary_Entry> 5 cjb
Reflective Memory Dictionary Entry example <?xml version="1.0" encoding="UTF-16" standalone="no" ?> <Reflective_Memory_Dictionary_Entry> <Name>modes</Name> <FullQualifiedName>PSF/PSFside/PrimaryMirror/modes</FullQualifiedName> <Description>Number of bending modes used</Description> <Owner>PSF</Owner> <UnitType>INT</UnitType> <UnitQty>1</UnitQty> <Units>N/A</Units> <DangerUpperLimit>0</DangerUpperLimit> <UpperLimit>160</UpperLimit> <LowerLimit>1</LowerLimit> <DangerLowerLimit>0</DangerLowerLimit> <ReadAccess>ASTRONOMER</ReadAccess> <WriteAccess>ASTRONOMER</WriteAccess> <SubsystemAccess>ALL</SubsystemAccess> <SuperUserAccess>ALL</SuperUserAccess> <Events>None right now</Events> <Callback>0</Callback> <UpdateInfo> <UserName>cjb</UserName> <UserClass>ASTRONOMER</UserClass> <UpdateDescription>Modified the danger lower limit</UpdateDescription> <Date_Of_Updation>2004-11-12</Date_Of_Updation> <Time_Of_Updation>11:01:20</Time_Of_Updation> </UpdateInfo> </Reflective_Memory_Dictionary_Entry> 6 cjb
DDEditorGUI • Display/create/modify definitions • Populates FullQualifiedName, Owner, and all UpdateInfo fields • Directory options • Add folder • Add file • Delete • Rename • Move • Copy 7 cjb
DDEditorGUI (cont) • File options • Delete • Rename • Move • Copy • Edit by double clicking on fields • To create a new level of hierarchy • Make subdirectory • Make file whose type is the subdirectory 8 cjb
Binary reflective memory definitions • Install reflective memory (and other) definitions • cd LBTO/TCS/usr • sudo make install • Run ddsconfig • sudo ddsconfig -refmem • Makes files: /usr/local/bin/.binRefMemDictionary /usr/local/lib/libLBTGshmVar.so /usr/local/include/LBT/GshmVar.h /usr/local/etc/OffsetTable.conf 9 cjb
Reflective memory access • Two ways: • Gtype objects • Use variable names directly • No notification if errors • SetValueInterface objects • Each reference a function call • Status return for errors • May read/write a buffer 10 cjb
Gtype access • Some operators overloaded, use cast if unsure; see 481s504 • Can get metadata • Examples: psf.side[side].primaryMirror.modes = 6; int modes = psf.side[side].primaryMirror.modes; int muplim = psf.side[side].primaryMirror.modes.get_upperlimit(); 11 cjb
SetValueInterface access • Create SetValueInterface object #include <LBT/SetValueInterface.h> SetValueInterface svi; int modes,err; • Write err = svi.write(&psf.side[side].primaryMirror.modes,modes); err = svi.write(“psf.side[side].primaryMirror.modes”,modes); • Read err = svi.read(&psf.side[side].primaryMirror.modes,&modes); err = svi.read(“psf.side[side].primaryMirror.modes”,&modes); 12 cjb
SetValueInterface access (cont) • Check for errors if(svi.isError(err) && err != VALUEOUTOFBOUNDS) { //error } • Metadata string muplim = svi.getUpperLimit(“psf.side[side].primaryMirror.modes”); int muplim = svi.getUpperLimit(&psf.side[side].primaryMirror.modes); • See 481s504 for details 13 cjb