00001 #ifndef mswMOD_LIST_H 00002 #define mswMOD_LIST_H 00003 /******************************************************************************* 00004 * E.S.O. - VLT project 00005 * 00006 * "@(#) $Id: mswMOD_LIST.h,v 1.115 2003/11/12 14:33:36 vltsccm Exp $" 00007 * 00008 * who when what 00009 * -------- -------- ---------------------------------------------- 00010 * rabuter 2000-07-12 Added method UpdateTrkModList 00011 * gchiozzi 13/02/98 BUG: modTable was sized with hard coded 32 instead of mswNO_OF_MODULES 00012 * gchiozzi 04/04/97 Removed _CACHE subclasses 00013 * gchiozzi 24/05/96 Protected selectList and added access method 00014 * awalland 23/05/96 Added methods SelectGuidingModules, ParseUserField 00015 * awalland 22/05/96 Replaced GetAddrList with Select*List 00016 * mverola 03/04/96 Added StoreTable, UpdateReqModList 00017 * Changed GetStateList into GetAddrList 00018 * gchiozzi 30/08/95 Removed many not useful parameters 00019 * awalland 04/08/95 created 00020 */ 00021 00022 /************************************************************************ 00023 * 00024 *---------------------------------------------------------------------- 00025 */ 00026 #ifndef __cplusplus 00027 #error This is a C++ include file and cannot be used from plain C 00028 #endif 00029 00030 #include "msw.h" 00031 #include "eccsErr.h" 00032 #include "evhDB_CMD_SEND.h" 00033 #include "fndARRAY.h" 00034 #include "fndOBJECT.h" 00035 00036 // support classes mswMOD_RECORD and mswMOD_RECORD_ARRAY 00037 // ----------------------------------------------------- 00038 // These support classes are used to hold and manipulate data from 00039 // the module table 00040 00041 // structure to hold a record of module configuration 00042 typedef struct 00043 { 00044 vltBYTES32 modName; // identifier for module 00045 vltBYTES32 modId; // destination process 00046 vltBYTES256 modSymbAddr; // state attribute in database 00047 vltINT8 startPhase; // start phase for the module, 0..n 00048 vltINT8 stopPhase; // stop phase for the module, 0..n 00049 vltINT8 tracking; // true if module has to receive tracking commands 00050 vltINT8 focus; // module used for focus x 00051 vltLOGICAL required; // module currently required in operation 00052 vltLOGICAL ignore; // ignore this module (maintenance operation) 00053 vltBYTES256 userField; // free field to be used for private filtering 00054 } mswMOD_DB_RECORD; 00055 00056 00057 class mswMOD_RECORD: public fndOBJECT, public mswMOD_DB_RECORD 00058 { 00059 public: 00060 mswMOD_RECORD(); 00061 mswMOD_RECORD( const mswMOD_DB_RECORD& ); 00062 mswMOD_RECORD& operator =( const mswMOD_DB_RECORD& ); 00063 00064 vltLOGICAL IsMod(const vltBYTES32 modName) const; 00065 00066 const char *ModName() const; 00067 const char *ModId() const; 00068 const char *ModSymbAddr() const; 00069 const char *ModBaseAddr() const; 00070 vltINT8 StartPhase() const; 00071 vltINT8 StopPhase() const; 00072 vltINT8 Tracking() const; 00073 vltINT8 Focus() const; 00074 const char *FocusName() const; 00075 vltLOGICAL Required() const; 00076 vltLOGICAL Ignore() const; 00077 const char *UserField() const; 00078 00079 private: 00080 vltBYTES256 modBaseAddr; // Base root point for the unit 00081 // assumed to be the parent point for the 00082 // state attribute 00083 }; 00084 00085 00086 class mswMOD_RECORD_ARRAY: public fndARRAY 00087 { 00088 public: 00089 mswMOD_RECORD_ARRAY(); 00090 mswMOD_RECORD& operator []( int atIndex ) const; 00091 mswMOD_RECORD& operator []( const vltBYTES32 modName) const; 00092 00093 }; 00094 00095 00096 class mswMOD_LIST : public eccsERROR_CLASS 00097 { 00098 public: 00099 mswMOD_LIST(const dbSYMADDRESS dbPoint = dbEMPTY); 00100 virtual ~mswMOD_LIST(); 00101 00102 // SelectList returns the list after selection 00103 const mswMOD_RECORD_ARRAY &SelectList() const; 00104 00105 // Get<x>() methods read everytime from DB table 00106 00107 virtual ccsCOMPL_STAT SelectRequiredModules(); 00108 virtual ccsCOMPL_STAT SelectTrackingModules(); 00109 virtual ccsCOMPL_STAT SelectGuidingModules(); 00110 virtual ccsCOMPL_STAT SelectOnFocusModules(vltINT8 focus); 00111 virtual ccsCOMPL_STAT SelectInitChFocModules(); 00112 00113 // Loads the table from DB into the modTable vector 00114 virtual ccsCOMPL_STAT LoadTable(); 00115 00116 00117 ccsCOMPL_STAT DbPoint(const dbSYMADDRESS point); 00118 00119 ccsCOMPL_STAT UpdateReqModList(vltINT8 oldFocus, vltINT8 newFocus); 00120 ccsCOMPL_STAT UpdateTrkModList(vltINT8 index, vltINT8 istracking ); 00121 protected: 00122 dbSYMADDRESS modPoint; 00123 00124 // selectList contains the list after selection 00125 mswMOD_RECORD modTable[mswNO_OF_MODULES]; 00126 mswMOD_RECORD_ARRAY selectList; 00127 00128 vltLOGICAL ParseUserField(const char *matchString, 00129 const char *userField); 00130 ccsCOMPL_STAT _SelectRequiredModules(); 00131 ccsCOMPL_STAT _SelectUsrFieldModules(char *usrField); 00132 00133 ccsCOMPL_STAT StoreTable(); 00134 00135 private: 00136 vltINT8 focus; 00137 }; 00138 00139 // include inline code for support classes 00140 #include "mswMOD_LIST.icc" 00141 00142 #endif