#include "FERODBFieldPositions.h" //=========================================================================== AltroFieldPositions::AltroFieldPositions() { // // This class shows the positions of the various fields of the Altro Table in the // Oracle TPC Configuration DB. // int32_t position = 0; id = position++; // 0 Position = position++; // 1 ON_ALTRO = position++; // 2 for(int32_t pos = 0; pos < 16; pos++){ // 3-18 ON_CHANNEL[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 19-34 K1_CHANNEL[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 35-50 K2_CHANNEL[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 51-66 K3_CHANNEL[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 67-82 L1_CHANNEL[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 83-98 L2_CHANNEL[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 99-114 L3_CHANNEL[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 115-130 VFPED_CHANNEL[pos] = position++; } ZSTHR_OFFSET = position++; // 131 ZSTHR_ZS_THR = position++; // 132 BCTHR_THR_HI = position++; // 133 BCTHR_THR_LOW = position++; // 134 TRCFG_ACQ_START = position++; // 135 TRCFG_ACQ_END = position++; // 136 DPCFG_BC1_MODE = position++; // 137 DPCFG_BC1_POL = position++; // 138 DPCFG_BC2_PRE = position++; // 139 DPCFG_BC2_POST = position++; // 140 DPCFG_BC2_EN = position++; // 141 DPCFG_ZS_GF = position++; // 142 DPCFG_ZS_POST = position++; // 143 DPCFG_ZS_PRE = position++; // 144 DPCFG_ZS_EN = position++; // 145 DPCF2_PTRG = position++; // 146 DPCF2_BUF = position++; // 147 DPCF2_FLT_EN = position++; // 148 DPCF2_PWSV = position++; // 149 fSize = position; char carry[40]; fColNames.push_back("id"); fColNames.push_back("Position"); fColNames.push_back("ON_ALTRO"); for(int32_t pos = 0; pos < 16; pos++){ sprintf(carry, "ON_CHANNEL%02d", pos); fColNames.push_back(carry); } for(int32_t pos = 0; pos < 16; pos++){ sprintf(carry, "K1_CHANNEL%02d", pos); fColNames.push_back(carry); } for(int32_t pos = 0; pos < 16; pos++){ sprintf(carry, "K2_CHANNEL%02d", pos); fColNames.push_back(carry); } for(int32_t pos = 0; pos < 16; pos++){ sprintf(carry, "K3_CHANNEL%02d", pos); fColNames.push_back(carry); } for(int32_t pos = 0; pos < 16; pos++){ sprintf(carry, "L1_CHANNEL%02d", pos); fColNames.push_back(carry); } for(int32_t pos = 0; pos < 16; pos++){ sprintf(carry, "L2_CHANNEL%02d", pos); fColNames.push_back(carry); } for(int32_t pos = 0; pos < 16; pos++){ sprintf(carry, "L3_CHANNEL%02d", pos); fColNames.push_back(carry); } for(int32_t pos = 0; pos < 16; pos++){ sprintf(carry, "VFPED_CHANNEL%02d", pos); fColNames.push_back(carry); } fColNames.push_back("ZSTHR_OFFSET"); fColNames.push_back("ZSTHR_ZS_THR"); fColNames.push_back("BCTHR_THR_HI"); fColNames.push_back("BCTHR_THR_LOW"); fColNames.push_back("TRCFG_ACQ_START"); fColNames.push_back("TRCFG_ACQ_END"); fColNames.push_back("DPCFG_BC1_MODE"); fColNames.push_back("DPCFG_BC1_POL"); fColNames.push_back("DPCFG_BC2_PRE"); fColNames.push_back("DPCFG_BC2_POST"); fColNames.push_back("DPCFG_BC2_EN"); fColNames.push_back("DPCFG_ZS_GF"); fColNames.push_back("DPCFG_ZS_POST"); fColNames.push_back("DPCFG_ZS_PRE"); fColNames.push_back("DPCFG_ZS_EN"); fColNames.push_back("DPCF2_PTRG"); fColNames.push_back("DPCF2_BUF"); fColNames.push_back("DPCF2_FLT_EN"); fColNames.push_back("DPCF2_PWSV"); } //=========================================================================== string AltroFieldPositions::getColName(int32_t i) { // Return the names of the columns return fColNames[i]; } //=========================================================================== int32_t AltroFieldPositions::getPosition(string colName) { // Find the column number (Position) of the column with name colName. for ( uint32_t i=0; i < fColNames.size(); i++ ) { if ( colName.compare(fColNames.at(i) ) == 0) { return i; } } return -1; } //=========================================================================== AltroFieldPositions::~AltroFieldPositions() { } //=========================================================================== //=========================================================================== FecFieldPositions::FecFieldPositions() { // // This class shows the positions of the various fields of the FEC Table in the // Oracle TPC Configuration DB. // int32_t position = 0; id = position++; // 0 BranchPosition = position++; // 1 Position = position++; // 2 ON_FEC = position++; // 3 BC_T_TH = position++; // 4 BC_AV_TH = position++; // 5 BC_AC_TH = position++; // 6 BC_DV_TH = position++; // 7 BC_DC_TH = position++; // 8 TSMWORD = position++; // 9 USRATIO = position++; // 10 CSR0 = position++; // 11 CSR1 = position++; // 12 CSR2 = position++; // 13 CSR3 = position++; // 14 RDO_FEC = position++; // 15 fSize = position; fColNames.push_back("id"); fColNames.push_back("BranchPosition"); fColNames.push_back("Position"); fColNames.push_back("ON_FEC"); fColNames.push_back("BC_T_TH"); fColNames.push_back("BC_AV_TH"); fColNames.push_back("BC_AC_TH"); fColNames.push_back("BC_DV_TH"); fColNames.push_back("BC_DC_TH"); fColNames.push_back("TSMWORD"); fColNames.push_back("USRATIO"); fColNames.push_back("CSR0"); fColNames.push_back("CSR1"); fColNames.push_back("CSR2"); fColNames.push_back("CSR3"); fColNames.push_back("RDO_FEC"); } //=========================================================================== string FecFieldPositions::getColName(int32_t i) { // Return the names of the columns return fColNames[i]; } //=========================================================================== int32_t FecFieldPositions::getPosition(string colName) { // Find the column number (Position) of the column with name colName. for ( uint32_t i=0; i < fColNames.size(); i++ ) { if ( colName.compare(fColNames.at(i) ) == 0) { return i; } } return -1; } //=========================================================================== FecFieldPositions::~FecFieldPositions() { } //=========================================================================== //=========================================================================== RcuFieldPositions::RcuFieldPositions() { // // This class shows the positions of the various fields of the RCU Table in the // Oracle TPC Configuration DB. // int32_t position = 0; id = position++; // 0 Equipmentid = position++; // 1 Position = position++; // 2 ON_RCU = position++; // 3 ALTROIF_NSAM_EV = position++; // 4 ALTROIF_CLK_RATIO = position++; // 5 ALTROIF_CSTB_DELAY = position++; // 6 RDOMOD_SPARSE_RDO = position++; // 7 RDOMOD_MEB_MODE = position++; // 8 RDOMOD_DISABLE_RDYRX = position++; // 9 TTC_CONTROL_CDH_VERSION = position++; // 10 TTC_L1_LATENCY = position++; // 11 TTC_L1_LATENCY_WINDOW = position++; // 12 TTC_L1_MSG_LATENCY_MIN = position++; // 13 TTC_L1_MSG_LATENCY_MAX = position++; // 14 TTC_L2_LATENCY_MIN = position++; // 15 TTC_L2_LATENCY_MAX = position++; // 16 TTC_ROI_CONFIG1 = position++; // 17 TTC_ROI_CONFIG2 = position++; // 18 TTC_ROI_LATENCY_MIN = position++; // 19 TTC_ROI_LATENCY_MAX = position++; // 20 RDOMOD_SKIP_EMPTY = position++; // 21 EN_INT_BA = position++; // 22 PLACEHOLDER = position++; // 23 fSize = position; fColNames.push_back("id"); fColNames.push_back("Equipmentid"); fColNames.push_back("Position"); fColNames.push_back("ON_RCU"); fColNames.push_back("ALTROIF_NSAM_EV"); fColNames.push_back("ALTROIF_CLK_RATIO"); fColNames.push_back("ALTROIF_CSTB_DELAY"); fColNames.push_back("RDOMOD_SPARSE_RDO"); fColNames.push_back("RDOMOD_MEB_MODE"); fColNames.push_back("RDOMOD_DISABLE_RDYRX"); fColNames.push_back("TTC_CONTROL_CDH_VERSION"); fColNames.push_back("TTC_L1_LATENCY"); fColNames.push_back("TTC_L1_LATENCY_WINDOW"); fColNames.push_back("TTC_L1_MSG_LATENCY_MIN"); fColNames.push_back("TTC_L1_MSG_LATENCY_MAX"); fColNames.push_back("TTC_L2_LATENCY_MIN"); fColNames.push_back("TTC_L2_LATENCY_MAX"); fColNames.push_back("TTC_ROI_CONFIG1"); fColNames.push_back("TTC_ROI_CONFIG2"); fColNames.push_back("TTC_ROI_LATENCY_MIN"); fColNames.push_back("TTC_ROI_LATENCY_MAX"); fColNames.push_back("RDOMOD_SKIP_EMPTY"); fColNames.push_back("EN_INT_BA"); fColNames.push_back("PLACEHOLDER"); } //=========================================================================== string RcuFieldPositions::getColName(int32_t i) { // Return the names of the columns return fColNames[i]; } //=========================================================================== int32_t RcuFieldPositions::getPosition(string colName) { // Find the column number (Position) of the column with name colName. for ( uint32_t i=0; i < fColNames.size(); i++ ) { if ( colName.compare(fColNames.at(i) ) == 0) { return i; } } return -1; } //=========================================================================== RcuFieldPositions::~RcuFieldPositions() { } //=========================================================================== //=========================================================================== TpcFieldPositions::TpcFieldPositions( ) { // // This class shows the positions of the fields of the TPC Table in the // Oracle TPC Configuration DB. // int32_t position = 0; id = position++; // 0 Created = position++; // 1 Used = position++; // 2 Updated = position++; // 3 Revision = position++; // 4 Comment = position++; // 5 fSize = position; fColNames.push_back("Id"); fColNames.push_back("Created"); fColNames.push_back("Used"); fColNames.push_back("Updated"); fColNames.push_back("Revision"); fColNames.push_back("Comment"); } //=========================================================================== string TpcFieldPositions::getColName(int32_t i) { // Return the names of the columns return fColNames[i]; } //=========================================================================== bool TpcFieldPositions::isDate(int32_t i) { if ((i>0) && (i<4)) return true; else return false; } //=========================================================================== bool TpcFieldPositions::isString(int32_t i) { if (i>4) return true; else return false; } //=========================================================================== bool TpcFieldPositions::isNumber(int32_t i) { if ((i==0) || (i==4)) return true; else return false; } //=========================================================================== int32_t TpcFieldPositions::getPosition(string colName) { // Find the column number (Position) of the column with name colName. for ( uint32_t i=0; i < fColNames.size(); i++ ) { if ( colName.compare(fColNames.at(i) ) == 0) { return i; } } return -1; } //=========================================================================== TpcFieldPositions::~TpcFieldPositions() { } //=========================================================================== //=========================================================================== FERODBFieldPositions::FERODBFieldPositions( ) { // // This class shows the column positions of the result of the query // to the TPC FERO config database to get the configuration data. // AltroTable = new AltroFieldPositions(); RcuTable = new RcuFieldPositions(); FecTable = new FecFieldPositions(); TpcTable = new TpcFieldPositions(); int32_t position = 0; // // 1) The result to the DBQueryCreator::getSelectPartitionData query: // // Tpc Table TPCconfigID = position++; // 0 TPCcreated = position++; // 1 TPCused = position++; // 2 TPCupdated = position++; // 3 TPCrevision = position++; // 4 TPCcomment = position++; // 5 // Sector_Tpc Table SECTOR_TPCsectorID = position++; // 6 SECTOR_TPCtpcID = position++; // 7 // Sector Tab le SECTORid = position++; // 8 SECTORposition = position++; // 9 SECTORsidePosition = position++; // 10 // Rcu_Sector Table RCU_SECTORrcuID = position++; // 11 RCU_SECTORsectorID = position++; // 12 // Rcu Table RCUid = position++; // 13 RCUequipmentID = position++; // 14 RCUposition = position++; // 15 RCUon = position++; // 16 RCUaltroif_nsam_ev = position++; // 17 RCUaltroif_clk_ratio = position++; // 18 RCUaltroif_cstb_delay = position++; // 19 RCUrdomod_sparse_rdo = position++; // 20 RCUrdomod_meb_mode = position++; // 21 RCUrdomod_disable_rdyrx = position++; // 22 RCUttc_control_cdh_version = position++; // 23 RCUttc_l1_latency = position++; // 24 RCUttc_l1_latency_window = position++; // 25 RCUttc_l1_msg_latency_min = position++; // 26 RCUttc_l1_msg_latency_max = position++; // 27 RCUttc_l2_latency_min = position++; // 28 RCUttc_l2_latency_max = position++; // 29 RCUttc_roi_config1 = position++; // 30 RCUttc_roi_config2 = position++; // 31 RCUttc_roi_latency_min = position++; // 32 RCUttc_roi_latency_max = position++; // 33 RCUrdomod_skip_empty = position++; // 34 RCUen_int_ba = position++; // 35 RCUplaceholder = position++; // 36 ////////////////////////////////////////////////// // // 2) The result to the DBQueryCreator::getSelectPartitionConfigData query: // position = 0; // Fec Table FECid = position++; // 0 FECbranchPosition = position++; // 1 FECposition = position++; // 2 FEConFEC = position++; // 3 FECbcTth = position++; // 4 FECbcAVth = position++; // 5 FECbcACth = position++; // 6 FECbcDVth = position++; // 7 FECbcDCth = position++; // 8 FECbcTSMWORD = position++; // 9 FECbcUSRATIO = position++; // 10 FECbcCSR0 = position++; // 11 FECbcCSR1 = position++; // 12 FECbcCSR2 = position++; // 13 FECbcCSR3 = position++; // 14 FECrdoFEC = position++; // 15 // Fec_Rcu Table FEC_RCUfecID = position++; // 16 FEC_RCUrcuID = position++; // 17 // Altro Table ALTROid = position++; // 18 ALTROposition = position++; // 19 ALTROon = position++; // 20 for(int32_t pos = 0; pos < 16; pos++){ // 21-36 ALTROonChannel[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 37-52 ALTROk1Channel[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 53-68 ALTROk2Channel[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 69-84 ALTROk3Channel[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 85-100 ALTROl1Channel[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 101-116 ALTROl2Channel[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 117-132 ALTROl3Channel[pos] = position++; } for(int32_t pos = 0; pos < 16; pos++){ // 133-148 ALTROvfpedChannel[pos] = position++; } ALTROzsthrOffset = position++; // 149 ALTROzsthrZSthr = position++; // 150 ALTRObcthrTHRhi = position++; // 151 ALTRObcthrTHRlow = position++; // 152 ALTROtrcvfgACQstart = position++; // 153 ALTROtrcvfgACQend = position++; // 154 ALTROdpcfgBC1mode = position++; // 155 ALTROdpcfgBC1pol = position++; // 156 ALTROdpcfgBC2pre = position++; // 157 ALTROdpcfgBC2post = position++; // 158 ALTROdpcfgBC2en = position++; // 159 ALTROdpcfgZSgf = position++; // 160 ALTROdpcfgZSpost = position++; // 161 ALTROdpcfgZSpre = position++; // 162 ALTROdpcfgZSen = position++; // 163 ALTROdbcf2PTRG = position++; // 164 ALTROdbcf2BUF = position++; // 165 ALTROdbcf2FLTen = position++; // 166 ALTROdbcf2PWSV = position++; // 167 // Altro_Fec Table ALTRO_FECaltroID = position++; // 168 ALTRO_FECfecID = position++; // 169 ////////////////////////////////////////////////// // // 3) The result to the DBQueryCreator::getSelectAllPartitionConfigData query: // position = 0; QAll_Sec_id = position++; // 0 QAll_Sec_Position = position++; // 1 QAll_Sec_SidePosition = position++; // 2 QAll_Rcu_id = position++; // 3 QAll_Rcu_Equipmentid = position++; // 4 QAll_Rcu_Position = position++; // 5 QAll_Rcu_ON_RCU = position++; // 6 QAll_Rcu_ALTROIF_NSAM_EV = position++; // 7 QAll_Rcu_ALTROIF_CLK_RATIO = position++; // 8 QAll_Rcu_ALTROIF_CSTB_DELAY = position++; // 9 QAll_Rcu_RDOMOD_SPARSE_RDO = position++; // 10 QAll_Rcu_RDOMOD_MEB_MODE = position++; // 11 QAll_Rcu_RDOMOD_DISABLE_RDYRX = position++; // 12 QAll_Rcu_TTC_CONTROL_CDH_VERSION = position++; // 13 QAll_Rcu_TTC_L1_LATENCY = position++; // 14 QAll_Rcu_TTC_L1_LATENCY_WINDOW = position++; // 15 QAll_Rcu_TTC_L1_MSG_LATENCY_MIN = position++; // 16 QAll_Rcu_TTC_L1_MSG_LATENCY_MAX = position++; // 17 QAll_Rcu_TTC_L2_LATENCY_MIN = position++; // 18 QAll_Rcu_TTC_L2_LATENCY_MAX = position++; // 19 QAll_Rcu_TTC_ROI_CONFIG1 = position++; // 20 QAll_Rcu_TTC_ROI_CONFIG2 = position++; // 21 QAll_Rcu_TTC_ROI_LATENCY_MIN = position++; // 22 QAll_Rcu_TTC_ROI_LATENCY_MAX = position++; // 23 QAll_Rcu_RDOMOD_SKIP_EMPTY = position++; // 24 QAll_Rcu_EN_INT_BA = position++; // 25 QAll_Rcu_PLACEHOLDER = position++; // 26 QAll_Fec_id = position++; // 27 QAll_Fec_BranchPosition = position++; // 28 QAll_Fec_Position = position++; // 29 QAll_Fec_ON_FEC = position++; // 30 QAll_Fec_BC_T_TH = position++; // 31 QAll_Fec_BC_AV_TH = position++; // 32 QAll_Fec_BC_AC_TH = position++; // 33 QAll_Fec_BC_DV_TH = position++; // 34 QAll_Fec_BC_DC_TH = position++; // 35 QAll_Fec_TSMWORD = position++; // 36 QAll_Fec_USRATIO = position++; // 37 QAll_Fec_CSR0 = position++; // 38 QAll_Fec_CSR1 = position++; // 39 QAll_Fec_CSR2 = position++; // 40 QAll_Fec_CSR3 = position++; // 41 QAll_Fec_RDO_FEC = position++; // 42 QAll_Altro_id = position++; // 45 QAll_Altro_Position = position++; // 46 QAll_Altro_ON_ALTRO = position++; // 47 for(int32_t pos = 0; pos < 16; pos++){ QAll_Altro_ON_CHANNEL[pos] = position++; // 48-61 } for(int32_t pos = 0; pos < 16; pos++){ QAll_Altro_K1_CHANNEL[pos] = position++; // 62-77 } for(int32_t pos = 0; pos < 16; pos++){ QAll_Altro_K2_CHANNEL[pos] = position++; // 78-93 } for(int32_t pos = 0; pos < 16; pos++){ QAll_Altro_K3_CHANNEL[pos] = position++; // 94-109 } for(int32_t pos = 0; pos < 16; pos++){ QAll_Altro_L1_CHANNEL[pos] = position++; // 110-125 } for(int32_t pos = 0; pos < 16; pos++){ QAll_Altro_L2_CHANNEL[pos] = position++; // 126-141 } for(int32_t pos = 0; pos < 16; pos++){ QAll_Altro_L3_CHANNEL[pos] = position++; // 142-157 } for(int32_t pos = 0; pos < 16; pos++){ QAll_Altro_VFPED_CHANNEL[pos] = position++; // 158-173 } QAll_Altro_ZSTHR_OFFSET = position++; // 174 QAll_Altro_ZSTHR_ZS_THR = position++; // 175 QAll_Altro_BCTHR_THR_HI = position++; // 176 QAll_Altro_BCTHR_THR_LOW = position++; // 177 QAll_Altro_TRCFG_ACQ_START = position++; // 178 QAll_Altro_TRCFG_ACQ_END = position++; // 179 QAll_Altro_DPCFG_BC1_MODE = position++; // 180 QAll_Altro_DPCFG_BC1_POL = position++; // 181 QAll_Altro_DPCFG_BC2_PRE = position++; // 182 QAll_Altro_DPCFG_BC2_POST = position++; // 183 QAll_Altro_DPCFG_BC2_EN = position++; // 184 QAll_Altro_DPCFG_ZS_GF = position++; // 185 QAll_Altro_DPCFG_ZS_POST = position++; // 186 QAll_Altro_DPCFG_ZS_PRE = position++; // 187 QAll_Altro_DPCFG_ZS_EN = position++; // 188 QAll_Altro_DPCF2_PTRG = position++; // 189 QAll_Altro_DPCF2_BUF = position++; // 190 QAll_Altro_DPCF2_FLT_EN = position++; // 191 QAll_Altro_DPCF2_PWSV = position++; // 192 QAll_Tpc_id = position++; // 193 QAll_Tpc_Created = position++; // 194 QAll_Tpc_Used = position++; // 195 QAll_Tpc_Updated = position++; // 196 QAll_Tpc_Revision = position++; // 197 QAll_Tpc_Comment = position++; // 198 QAll_ST_SECTOR_ID = position++; // 199 QAll_ST_TPC_ID = position++; // 200 QAll_RS_RCU_ID = position++; // 201 QAll_RS_SECTOR_ID = position++; // 202 QAll_FR_FEC_ID = position++; // 203 QAll_FR_RCU_ID = position++; // 204 QAll_AF_ALTRO_ID = position++; // 205 QAll_AF_FEC_ID = position++; // 206 } FERODBFieldPositions::~FERODBFieldPositions() { delete AltroTable; delete RcuTable; delete FecTable; delete TpcTable; }