00001 #ifndef trkwsPOS_CALC_H 00002 #define trkwsPOS_CALC_H 00003 /******************************************************************************* 00004 * E.S.O. - VLT project 00005 * 00006 * "@(#) $Id: trkwsPOS_CALC.h,v 1.157 2003/10/17 14:00:42 vltsccm Exp $" 00007 * 00008 * who when what 00009 * -------- -------- ---------------------------------------------- 00010 * rkarban 2001-08-13 add DB members for autoguiding correction 00011 * ssandroc 2000-02-12 SPR 990471: ASM attrs float -> double 00012 * kwirenst 18/12/98 Added alphaAppAct and deltaAppAct 00013 * rkarban 15/04/98 add adDegPosActual attribute 00014 * rkarban 03/03/98 add rotOffset, rotOnSky attributes 00015 * kwirenst 29/05/97 Added declaration of 'utc'. 00016 * rkarban 15/03/97 add attributes alphaCurrentReadback & deltaCurrentReadback 00017 * rkarban 23/01/97 add attribute rotPosActual that keeps the last read rotator position 00018 * gchiozzi 24/10/96 Added maxTimeDifference for time stamps 00019 * gchiozzi 20/08/96 Added new attributes 00020 * gchiozzi 19/08/96 created 00021 */ 00022 00023 /************************************************************************ 00024 * 00025 *---------------------------------------------------------------------- 00026 */ 00027 00028 #ifndef __cplusplus 00029 #error This is a C++ include file and cannot be used from plain C 00030 #endif 00031 00032 #include "evhHANDLER.h" 00033 #include "eccsDB_ATTR.h" 00034 #include "trkws.h" 00035 #include "trkwsPOS_READ_LIST.h" 00036 00037 00038 class trkwsPOS_CALC: public fndOBJECT, public eccsERROR_CLASS 00039 { 00040 public: 00041 trkwsPOS_CALC(const dbSYMADDRESS dbPoint); 00042 virtual ~trkwsPOS_CALC(); 00043 00044 ccsCOMPL_STAT Enable(); 00045 ccsCOMPL_STAT Disable(); 00046 00047 virtual evhCB_COMPL_STAT ActPosDbEventCB(evtEVENT_MSG &msg, void *udata); 00048 00049 protected: 00050 ccsCOMPL_STAT SetInvalid(vltINT32 code, vltDOUBLE time = 0); 00051 ccsCOMPL_STAT SetValid(); 00052 00053 private: 00054 /* Symbolic address for the root point */ 00055 dbSYMADDRESS dbPoint; 00056 00057 /* Objects to handle the LCU images, dynamically created */ 00058 trkwsPOS_READ_LIST *altLcu; 00059 trkwsPOS_READ_LIST *azLcu; 00060 eccsDB_DOUBLE *rotOffsetObj; 00061 eccsDB_DOUBLE *rotOffsetStepAccu; 00062 eccsDB_DOUBLE *alphaAppAct; 00063 eccsDB_DOUBLE *deltaAppAct; 00064 00065 /* 00066 * Database attributes to be accessed 00067 */ 00068 00069 /* Attributes accessed in write mode for update */ 00070 eccsDB_INT32 posStatus; 00071 00072 eccsDB_DOUBLE syncTimestamp; 00073 vltDOUBLE altitude; 00074 vltDOUBLE azimuth; 00075 vltDOUBLE alpha2000Readback; 00076 vltDOUBLE delta2000Readback; 00077 vltDOUBLE alpha2000DegReadback; 00078 vltDOUBLE delta2000DegReadback; 00079 vltDOUBLE alphaCurrentReadback; 00080 vltDOUBLE deltaCurrentReadback; 00081 vltDOUBLE alphaReadback; 00082 vltDOUBLE deltaReadback; 00083 vltDOUBLE alphaEncoder; 00084 vltDOUBLE deltaEncoder; 00085 vltDOUBLE alphaLT2000; 00086 vltDOUBLE deltaLT2000; 00087 vltDOUBLE siderealTime; 00088 vltDOUBLE utc; 00089 vltDOUBLE hourAngle; 00090 eccsDB_DOUBLE rotRadPosActual; 00091 eccsDB_DOUBLE rotDegPosActual; 00092 eccsDB_DOUBLE adRadPosActual; 00093 eccsDB_DOUBLE adDegPosActual; 00094 vltDOUBLE decDeviation; 00095 vltDOUBLE raDeviation; 00096 eccsDB_DOUBLE refAlpha; 00097 eccsDB_DOUBLE refDelta; 00098 00099 /* Attributes accessed in read mode for calculations */ 00100 eccsDB_DOUBLE maxTimeDifference; 00101 00102 eccsDB_DOUBLE epoch; 00103 eccsDB_DOUBLE equinox; 00104 eccsDB_STRING epochSystem; 00105 eccsDB_DOUBLE pma; 00106 eccsDB_DOUBLE pmd; 00107 eccsDB_DOUBLE parallax; 00108 eccsDB_DOUBLE radvel; 00109 eccsDB_DOUBLE dut1; 00110 eccsDB_DOUBLE wavelen; 00111 eccsDB_DOUBLE temperature; 00112 eccsDB_DOUBLE pressure; 00113 eccsDB_DOUBLE humidity; 00114 eccsDB_DOUBLE lapseRate; 00115 eccsDB_DOUBLE longitude; 00116 eccsDB_DOUBLE latitude; 00117 eccsDB_DOUBLE height; 00118 eccsDB_DOUBLE polmx; 00119 eccsDB_DOUBLE polmy; 00120 eccsDB_DOUBLE pointAxisOffX; 00121 eccsDB_DOUBLE pointAxisOffY; 00122 eccsDB_DOUBLE rotOffset; 00123 eccsDB_DOUBLE rotOnSky; 00124 eccsDB_STRING rotPosAddr; 00125 eccsDB_STRING adPosAddr; 00126 00127 /* 00128 * Internal flags and variables 00129 */ 00130 vltLOGICAL enabled; 00131 00132 vltINT32 errorCounter; 00133 vltINT32 errorCounterRotatorAddr; 00134 vltINT32 errorBonus; 00135 vltDOUBLE lastTimeStamp; 00136 vltLOGICAL alreadyInvalid; 00137 00138 dbLISTID listId; 00139 }; 00140 00141 #endif