00001
00002
00003
00004
00005
00006 #ifndef SOURCECARDROUTING_H
00007 #define SOURCECARDROUTING_H
00008
00009
00010 #include <iostream>
00011 #include <string>
00012
00013 class SourceCardRouting {
00014
00015 public:
00016
00017 SourceCardRouting();
00018 ~SourceCardRouting();
00019
00021 struct EmuToSfpData
00022 {
00023
00024 unsigned short eIsoRank[4];
00025 unsigned short eIsoCardId[4];
00026 unsigned short eIsoRegionId[4];
00027 unsigned short eNonIsoRank[4];
00028 unsigned short eNonIsoCardId[4];
00029 unsigned short eNonIsoRegionId[4];
00030 unsigned short mipBits[7][2];
00031 unsigned short qBits[7][2];
00032
00033 unsigned short sfp[2][4];
00034 };
00035
00036
00037
00038
00039 void EMUtoSFP( unsigned short (&eIsoRank)[4],
00040 unsigned short (&eIsoCardId)[4],
00041 unsigned short (&eIsoRegionId)[4],
00042 unsigned short (&eNonIsoRank)[4],
00043 unsigned short (&eNonIsoCardId)[4],
00044 unsigned short (&eNonIsoRegionId)[4],
00045 unsigned short (&MIPbits)[7][2],
00046 unsigned short (&Qbits)[7][2],
00047 unsigned short (&SFP)[2][4] ) const;
00048
00049
00050
00051
00052 void SFPtoEMU( unsigned short (&eIsoRank)[4],
00053 unsigned short (&eIsoCardId)[4],
00054 unsigned short (&eIsoRegionId)[4],
00055 unsigned short (&eNonIsoRank)[4],
00056 unsigned short (&eNonIsoCardId)[4],
00057 unsigned short (&eNonIsoRegionId)[4],
00058 unsigned short (&MIPbits)[7][2],
00059 unsigned short (&Qbits)[7][2],
00060 unsigned short (&SFP)[2][4] ) const;
00061
00062
00063
00064
00065
00066 void RC56HFtoSFP( unsigned short (&RC)[7][2],
00067 unsigned short (&RCof)[7][2],
00068 unsigned short (&RCtau)[7][2],
00069 unsigned short (&HF)[4][2],
00070 unsigned short (&HFQ)[4][2],
00071 unsigned short (&SFP)[2][4] ) const;
00072
00073
00074
00075
00076 void SFPtoRC56HF( unsigned short (&RC)[7][2],
00077 unsigned short (&RCof)[7][2],
00078 unsigned short (&RCtau)[7][2],
00079 unsigned short (&HF)[4][2],
00080 unsigned short (&HFQ)[4][2],
00081 unsigned short (&SFP)[2][4] ) const;
00082
00083
00084
00085 void RC012toSFP( unsigned short (&RC)[7][2],
00086 unsigned short (&RCof)[7][2],
00087 unsigned short (&RCtau)[7][2],
00088 unsigned short (&SFP)[2][4] ) const;
00089
00090
00091
00092 void SFPtoRC012( unsigned short (&RC)[7][2],
00093 unsigned short (&RCof)[7][2],
00094 unsigned short (&RCtau)[7][2],
00095 unsigned short (&SFP)[2][4] ) const;
00096
00097
00098
00099 void RC234toSFP( unsigned short (&RC)[7][2],
00100 unsigned short (&RCof)[7][2],
00101 unsigned short (&RCtau)[7][2],
00102 unsigned short (&sisterRC)[7][2],
00103 unsigned short (&sisterRCof)[7][2],
00104 unsigned short (&sisterRCtau)[7][2],
00105 unsigned short (&SFP)[2][4] ) const;
00106
00107
00108
00109 void SFPtoRC234( unsigned short (&RC)[7][2],
00110 unsigned short (&RCof)[7][2],
00111 unsigned short (&RCtau)[7][2],
00112 unsigned short (&sisterRC)[7][2],
00113 unsigned short (&sisterRCof)[7][2],
00114 unsigned short (&sisterRCtau)[7][2],
00115 unsigned short (&SFP)[2][4] ) const;
00116
00117
00118
00119
00120
00121
00122 void SFPtoVHDCI( int RoutingMode,
00123 unsigned short (&SFP)[2][4],
00124 unsigned long (&VHDCI)[2][2] ) const;
00125
00126
00127
00128
00129 void VHDCItoSFP( int RoutingMode,
00130 unsigned short (&SFP)[2][4],
00131 unsigned long (&VHDCI)[2][2] ) const;
00132
00133
00134
00135
00136
00137
00138
00139 void EMUtoVHDCI( unsigned short (&eIsoRank)[4],
00140 unsigned short (&eIsoCardId)[4],
00141 unsigned short (&eIsoRegionId)[4],
00142 unsigned short (&eNonIsoRank)[4],
00143 unsigned short (&eNonIsoCardId)[4],
00144 unsigned short (&eNonIsoRegionId)[4],
00145 unsigned short (&MIPbits)[7][2],
00146 unsigned short (&Qbits)[7][2],
00147 unsigned long (&VHDCI)[2][2] ) const;
00148
00149
00150
00151
00152
00153 void VHDCItoEMU( unsigned short (&eIsoRank)[4],
00154 unsigned short (&eIsoCardId)[4],
00155 unsigned short (&eIsoRegionId)[4],
00156 unsigned short (&eNonIsoRank)[4],
00157 unsigned short (&eNonIsoCardId)[4],
00158 unsigned short (&eNonIsoRegionId)[4],
00159 unsigned short (&MIPbits)[7][2],
00160 unsigned short (&Qbits)[7][2],
00161 unsigned long (&VHDCI)[2][2] ) const;
00162
00163
00164
00165
00166
00167
00168
00169
00170 void RC56HFtoVHDCI( unsigned short (&RC)[7][2],
00171 unsigned short (&RCof)[7][2],
00172 unsigned short (&RCtau)[7][2],
00173 unsigned short (&HF)[4][2],
00174 unsigned short (&HFQ)[4][2],
00175 unsigned long (&VHDCI)[2][2] ) const;
00176
00177
00178
00179
00180 void VHDCItoRC56HF( unsigned short (&RC)[7][2],
00181 unsigned short (&RCof)[7][2],
00182 unsigned short (&RCtau)[7][2],
00183 unsigned short (&HF)[4][2],
00184 unsigned short (&HFQ)[4][2],
00185 unsigned long (&VHDCI)[2][2] ) const;
00186
00187
00188
00189 void RC012toVHDCI( unsigned short (&RC)[7][2],
00190 unsigned short (&RCof)[7][2],
00191 unsigned short (&RCtau)[7][2],
00192 unsigned long (&VHDCI)[2][2]) const;
00193
00194
00195
00196 void VHDCItoRC012( unsigned short (&RC)[7][2],
00197 unsigned short (&RCof)[7][2],
00198 unsigned short (&RCtau)[7][2],
00199 unsigned long (&VHDCI)[2][2] ) const;
00200
00201
00202
00203 void RC234toVHDCI( unsigned short (&RC)[7][2],
00204 unsigned short (&RCof)[7][2],
00205 unsigned short (&RCtau)[7][2],
00206 unsigned short (&sisterRC)[7][2],
00207 unsigned short (&sisterRCof)[7][2],
00208 unsigned short (&sisterRCtau)[7][2],
00209 unsigned long (&VHDCI)[2][2] ) const;
00210
00211
00212
00213 void VHDCItoRC234( unsigned short (&RC)[7][2],
00214 unsigned short (&RCof)[7][2],
00215 unsigned short (&RCtau)[7][2],
00216 unsigned short (&sisterRC)[7][2],
00217 unsigned short (&sisterRCof)[7][2],
00218 unsigned short (&sisterRCtau)[7][2],
00219 unsigned long (&VHDCI)[2][2] ) const;
00220
00221
00222
00223
00224
00225
00226 void EMUtoSTRING( unsigned short &logicalCardID,
00227 unsigned short &eventNumber,
00228 unsigned short (&eIsoRank)[4],
00229 unsigned short (&eIsoCardId)[4],
00230 unsigned short (&eIsoRegionId)[4],
00231 unsigned short (&eNonIsoRank)[4],
00232 unsigned short (&eNonIsoCardId)[4],
00233 unsigned short (&eNonIsoRegionId)[4],
00234 unsigned short (&MIPbits)[7][2],
00235 unsigned short (&Qbits)[7][2],
00236 std::string &dataString ) const;
00237
00238
00239
00240 void RC56HFtoSTRING( unsigned short &logicalCardID,
00241 unsigned short &eventNumber,
00242 unsigned short (&RC)[7][2],
00243 unsigned short (&RCof)[7][2],
00244 unsigned short (&RCtau)[7][2],
00245 unsigned short (&HF)[4][2],
00246 unsigned short (&HFQ)[4][2],
00247 std::string &dataString ) const;
00248
00249
00250 void RC012toSTRING( unsigned short &logicalCardID,
00251 unsigned short &eventNumber,
00252 unsigned short (&RC)[7][2],
00253 unsigned short (&RCof)[7][2],
00254 unsigned short (&RCtau)[7][2],
00255 std::string &dataString ) const;
00256
00257
00258 void RC234toSTRING( unsigned short &logicalCardID,
00259 unsigned short &eventNumber,
00260 unsigned short (&RC)[7][2],
00261 unsigned short (&RCof)[7][2],
00262 unsigned short (&RCtau)[7][2],
00263 unsigned short (&sisterRC)[7][2],
00264 unsigned short (&sisterRCof)[7][2],
00265 unsigned short (&sisterRCtau)[7][2],
00266 std::string &dataString ) const;
00267
00268
00269
00270
00271 void SFPtoSTRING( unsigned short &logicalCardID,
00272 unsigned short &eventNumber,
00273 int RoutingMode,
00274 unsigned short (&SFP)[2][4],
00275 std::string &dataString ) const;
00276
00277
00278
00279
00280 void STRINGtoVHDCI( unsigned short &logicalCardID,
00281 unsigned short &eventNumber,
00282 std::string &dataString,
00283 unsigned long (&VHDCI)[2][2] ) const;
00284
00285
00286
00287 void VHDCItoSTRING( unsigned short &logicalCardID,
00288 unsigned short &eventNumber,
00289 std::string &dataString,
00290 unsigned long (&VHDCI)[2][2] ) const;
00291
00292
00293
00294 void LogicalCardIDtoRoutingMode( unsigned short &logicalCardID,
00295 int &RoutingMode,
00296 int &RCTCrateNumber ) const;
00297
00298 void RoutingModetoLogicalCardID( unsigned short &logicalCardID,
00299 int &RoutingMode,
00300 int &RCTCrateNumber ) const;
00301
00302
00303
00304 };
00305
00306 #endif //~SOURCECARDMANAGER_H
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407