21 this->checkConnection();
24 int ecid_id = ecid.getLogicID();
27 Statement* stmt0 = m_conn->createStatement();
29 "SELECT count(since) FROM PVSS_TEMPERATURE_DAT " 30 "WHERE logic_id = :logic_id ");
31 stmt0->setInt(1, ecid_id);
33 ResultSet* rset0 = stmt0->executeQuery();
35 nruns = rset0->getInt(1);
37 m_conn->terminateStatement(stmt0);
39 cout <<
"DCSPTMTempList::fetchValuesForECID>> Number of records in DB=" << nruns << endl;
40 m_vec_temp.reserve(nruns);
42 Statement* stmt = m_conn->createStatement();
45 "since, till, temperature FROM PVSS_TEMPERATURE_DAT " 46 "WHERE logic_id = :logic_id order by since ");
47 stmt->setInt(1, ecid_id);
53 ResultSet* rset = stmt->executeQuery();
58 Date startDate = rset->getDate(1);
59 Date endDate = rset->getDate(2);
60 float x = rset->getFloat(3);
69 m_vec_temp.push_back(r);
74 cout <<
"DCSPTMTempList::fetchValuesForECID>> loop done " << endl;
76 m_conn->terminateStatement(stmt);
77 }
catch (SQLException&
e) {
78 throw(std::runtime_error(
"DCSPTMTempList: " + e.getMessage()));
85 this->checkConnection();
88 int ecid_id = ecid.getLogicID();
95 Statement* stmt0 = m_conn->createStatement();
97 "SELECT count(since) FROM PVSS_TEMPERATURE_DAT " 98 "WHERE logic_id = :logic_id " 99 "AND since >= :start_time " 100 "AND since <= :till_time ");
101 stmt0->setInt(1, ecid_id);
105 ResultSet* rset0 = stmt0->executeQuery();
107 nruns = rset0->getInt(1);
109 m_conn->terminateStatement(stmt0);
111 cout <<
"DCSPTMTempList::fetchValuesForECIDAndTime>> Number of records in DB=" << nruns << endl;
112 m_vec_temp.reserve(nruns);
114 Statement* stmt = m_conn->createStatement();
117 "since, till, temperature FROM PVSS_TEMPERATURE_DAT " 118 "WHERE logic_id = :logic_id " 119 "AND since >= :start_time " 120 "AND since <= :till_time " 122 stmt->setInt(1, ecid_id);
126 ResultSet* rset = stmt->executeQuery();
131 Date startDate = rset->getDate(1);
132 Date endDate = rset->getDate(2);
133 float x = rset->getFloat(3);
142 m_vec_temp.push_back(r);
147 m_conn->terminateStatement(stmt);
148 }
catch (SQLException&
e) {
149 throw(std::runtime_error(
"DCSPTMTempList: " + e.getMessage()));
void setEnd(const Tm &end)
void setEcalLogicID(const EcalLogicID &ecid)
void setTemperature(float temp)
void fetchValuesForECID(const EcalLogicID &ecid) noexcept(false)
oracle::occi::Date tmToDate(const Tm &inTm) const
~DCSPTMTempList() override
std::vector< DCSPTMTemp > getList()
Tm dateToTm(oracle::occi::Date &date) const
void fetchValuesForECIDAndTime(const EcalLogicID &ecid, const Tm &start, const Tm &end) noexcept(false)
void setStart(const Tm &start)