13 using namespace oracle::occi;
66 std::cout<<
"going to call fetchLastData"<<std::endl;
67 fetchLastData(fillMap);
68 std::cout<<
"returned from fetchLastData"<<std::endl;
78 string query=
"SELECT c.name, c.logic_id, c.id1, c.id2, c.id3, c.maps_to , v.value_number, v.change_date from "+ getMagnetAccount()+
79 ".CMSFWMAGNET_LV v, channelview c where v.dpe_name= 'CURRENT' and c.name=maps_to and c.name='EB' " ;
84 m_readStmt->setSQL(query);
85 rset = m_readStmt->executeQuery();
88 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
89 throw(std::runtime_error(
"RunDCSMagnetDat::getBarrelRset(): " + e.getMessage() +
" " +
query));
91 throw(std::runtime_error(
"RunDCSMagnetDat::getBarrelRset(): error code " + std::to_string(e.getErrorCode()) +
" " + query));
100 map< EcalLogicID, RunDCSMagnetDat >* fillMap) {
104 std::pair< EcalLogicID, RunDCSMagnetDat >
p;
109 while(rset->next()) {
117 std::cout<<
"done the logic id"<<std::endl;
119 std::cout<<
"done the magnet current"<<std::endl;
121 Date sinceDate = rset->getDate(8);
132 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
133 throw(std::runtime_error(
"RunDCSMagnetDat::fetchData(): "+e.getMessage()));
135 throw(std::runtime_error(
"RunDCSMagnetDat::fetchData(): error code " + std::to_string(e.getErrorCode())));
147 int t_now_gmt_micros = t_now_gmt.
microsTime();
148 return t_now_gmt_micros;
156 this->checkConnection();
158 std::cout<<
"fetchLastData>>1"<<std::endl;
162 std::cout<<
"fetchLastData>>2"<<std::endl;
166 std::pair< EcalLogicID, RunDCSMagnetDat >
p;
168 std::cout<<
"fetchLastData>>3"<<std::endl;
172 std::cout<<
"fetchLastData>>4"<<std::endl;
174 fillTheMap(rset, fillMap);
175 std::cout<<
"fetchLastData>>5"<<std::endl;
180 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
181 throw(std::runtime_error(
"RunDCSMagnetDat::fetchData(): "+e.getMessage()));
183 throw(std::runtime_error(
"RunDCSMagnetDat::fetchData(): error code " + std::to_string(e.getErrorCode())));
void fetchData(std::map< EcalLogicID, RunDCSMagnetDat > *fillMap, RunIOV *iov) noexcept(false)
void setToCurrentGMTime()
oracle::occi::SQLException SQLException
uint64_t microsTime() const
void prepareWrite() noexcept(false)
void fetchLastData(std::map< EcalLogicID, RunDCSMagnetDat > *fillMap) noexcept(false)
void setMagnetCurrent(float t)
oracle::occi::ResultSet ResultSet
void writeDB(const EcalLogicID *ecid, const RunDCSMagnetDat *item, RunIOV *iov) noexcept(false)
void fillTheMap(ResultSet *, std::map< EcalLogicID, RunDCSMagnetDat > *)
ResultSet * getMagnetRset()
void setTime(const Tm &start)
volatile std::atomic< bool > shutdown_flag false
Tm dateToTm(oracle::occi::Date &date) const