231 {
233 try {
235
236
237 if(ctpFiles.id() <= 0 || ctpFiles.smxId() <= 0) {
238 int l1id = ctpFiles.lvl1MasterTableId();
240 if(ctpFiles.id() <= 0) {
242 ctpFiles.setId(filesid);
243 }
244 if(ctpFiles.smxId() <= 0) {
246 ctpFiles.setSmxId(id);
247 }
248 }
249
250 {
251 unique_ptr<coral::IQuery>
query(
m_session.nominalSchema().tableHandle(
"L1_CTP_FILES").newQuery() );
252 query->setRowCacheSize( 13 );
253
254
255 coral::AttributeList emptyBindVariableList0;
256 std::string
condition =
"L1CF_ID = :fId";
257 emptyBindVariableList0.extend<long>("fId");
258 emptyBindVariableList0[0].data<long>() = ctpFiles.id();
259 query->setCondition( condition, emptyBindVariableList0 );
260
261 coral::AttributeList attList;
262 attList.extend<std::string>( "L1CF_NAME" );
263 attList.extend<int>( "L1CF_VERSION" );
264 attList.extend<std::string>( "L1CF_MON_SEL_SLOT7" );
265 attList.extend<std::string>( "L1CF_MON_SEL_SLOT8" );
266 attList.extend<std::string>( "L1CF_MON_SEL_SLOT9" );
267 attList.extend<std::string>( "L1CF_MON_DEC_SLOT7" );
268 attList.extend<std::string>( "L1CF_MON_DEC_SLOT8" );
269 attList.extend<std::string>( "L1CF_MON_DEC_SLOT9" );
271
274 TRG_MSG_ERROR(
"No such L1_CTP_Files exists " << ctpFiles.id());
276 throw std::runtime_error( "CTPFilesLoader >> CTPFiles not available" );
277 }
278
279 const coral::AttributeList&
row =
cursor.currentRow();
280 std::string
name =
row[
"L1CF_NAME"].data<std::string>();
281 int version =
row[
"L1CF_VERSION"].data<
int>();
282 std::string strMonSel7 =
row[
"L1CF_MON_SEL_SLOT7"].data<std::string>();
283 std::string strMonSel8 =
row[
"L1CF_MON_SEL_SLOT8"].data<std::string>();
284 std::string strMonSel9 =
row[
"L1CF_MON_SEL_SLOT9"].data<std::string>();
285 std::string strMonDec7 =
row[
"L1CF_MON_DEC_SLOT7"].data<std::string>();
286 std::string strMonDec8 =
row[
"L1CF_MON_DEC_SLOT8"].data<std::string>();
287 std::string strMonDec9 =
row[
"L1CF_MON_DEC_SLOT9"].data<std::string>();
288
290 TRG_MSG_ERROR(
"More than one GetFile exists " << ctpFiles.id());
292 throw std::runtime_error( "CTPFilesLoader >> CTPFiles not available" );
293 }
294
295 std::vector<u_int> monDecSlot7(CTPFiles::ALL_CTPINMONDEC_SIZE);
296 TRG_MSG_INFO(
"Loading MON Slot7 of size " << monDecSlot7.size());
298 std::vector<u_int> monDecSlot8(CTPFiles::ALL_CTPINMONDEC_SIZE);
299 TRG_MSG_INFO(
"Loading MON Slot8 of size " << monDecSlot8.size());
301 std::vector<u_int> monDecSlot9(CTPFiles::ALL_CTPINMONDEC_SIZE);
302 TRG_MSG_INFO(
"Loading MON Slot9 of size " << monDecSlot9.size());
304
305 std::vector<u_int> monSelSlot7(CTPFiles::ALL_CTPINMONSEL_SIZE);
306 TRG_MSG_INFO(
"Loading MON SEL Slot7 of size " << monSelSlot7.size());
308 std::vector<u_int> monSelSlot8(CTPFiles::ALL_CTPINMONSEL_SIZE);
309 TRG_MSG_INFO(
"Loading MON SEL Slot8 of size " << monSelSlot8.size());
311 std::vector<u_int> monSelSlot9(CTPFiles::ALL_CTPINMONSEL_SIZE);
312 TRG_MSG_INFO(
"Loading MON SEL Slot9 of size " << monSelSlot9.size());
314
315
316 ctpFiles.setName( name );
317 ctpFiles.setVersion( version );
318 ctpFiles.setCtpinMonDecoderSlot7(monDecSlot7);
319 ctpFiles.setCtpinMonDecoderSlot8(monDecSlot8);
320 ctpFiles.setCtpinMonDecoderSlot9(monDecSlot9);
321 ctpFiles.setCtpinMonSelectorSlot7(monSelSlot7);
322 ctpFiles.setCtpinMonSelectorSlot8(monSelSlot8);
323 ctpFiles.setCtpinMonSelectorSlot9(monSelSlot9);
324 }
325
326 {
327 unique_ptr<coral::IQuery>
query(
m_session.nominalSchema().tableHandle(
"L1_CTP_SMX").newQuery() );
328 query->setRowCacheSize( 13 );
329
330
331 coral::AttributeList emptyBindVariableList0;
332 std::string
condition =
"L1SMX_ID = :sId";
333 emptyBindVariableList0.extend<long>("sId");
334 emptyBindVariableList0[0].data<long>() = ctpFiles.smxId();
335 query->setCondition( condition, emptyBindVariableList0 );
336
337 coral::AttributeList attList;
338 attList.extend<std::string>( "L1SMX_NAME" );
339 attList.extend<std::string>( "L1SMX_OUTPUT" );
340 attList.extend<std::string>( "L1SMX_VHDL_SLOT7" );
341 attList.extend<std::string>( "L1SMX_VHDL_SLOT8" );
342 attList.extend<std::string>( "L1SMX_VHDL_SLOT9" );
343 attList.extend<std::string>( "L1SMX_SVFI_SLOT7" );
344 attList.extend<std::string>( "L1SMX_SVFI_SLOT8" );
345 attList.extend<std::string>( "L1SMX_SVFI_SLOT9" );
347
350 TRG_MSG_ERROR(
"No such L1_CTP_SMX entry " << ctpFiles.smxId() <<
" exists");
352 throw std::runtime_error( "CTPFilesLoader >> CTPFiles not available" );
353 }
354
355 const coral::AttributeList&
row =
cursor.currentRow();
358
365 }
366
368 }
369 catch( const coral::Exception& e ) {
372 throw;
373 }
374 return true;
375}
long getSmxIdFromMenu(int mid)