35 this->checkConnection();
38 int ecid_id=ecid.getLogicID();
41 Statement* stmt0 = m_conn->createStatement();
42 stmt0->setSQL(
"SELECT count(since) FROM PVSS_TEMPERATURE_DAT " 43 "WHERE logic_id = :logic_id " );
44 stmt0->setInt(1, ecid_id);
46 ResultSet* rset0 = stmt0->executeQuery();
48 nruns = rset0->getInt(1);
50 m_conn->terminateStatement(stmt0);
52 cout <<
"DCSPTMTempList::fetchValuesForECID>> Number of records in DB="<< nruns << endl;
53 m_vec_temp.reserve(nruns);
55 Statement* stmt = m_conn->createStatement();
56 stmt->setSQL(
"SELECT " 57 "since, till, temperature FROM PVSS_TEMPERATURE_DAT " 58 "WHERE logic_id = :logic_id order by since " );
59 stmt->setInt(1, ecid_id);
65 ResultSet* rset = stmt->executeQuery();
70 Date startDate = rset->getDate(1);
71 Date endDate = rset->getDate(2);
72 float x = rset->getFloat(3);
81 m_vec_temp.push_back(r);
86 cout <<
"DCSPTMTempList::fetchValuesForECID>> loop done " << endl;
88 m_conn->terminateStatement(stmt);
89 }
catch (SQLException &
e) {
90 throw(std::runtime_error(
"DCSPTMTempList: "+e.getMessage()));
100 this->checkConnection();
103 int ecid_id=ecid.getLogicID();
111 Statement* stmt0 = m_conn->createStatement();
112 stmt0->setSQL(
"SELECT count(since) FROM PVSS_TEMPERATURE_DAT " 113 "WHERE logic_id = :logic_id " 114 "AND since >= :start_time " 115 "AND since <= :till_time " 117 stmt0->setInt(1, ecid_id);
121 ResultSet* rset0 = stmt0->executeQuery();
123 nruns = rset0->getInt(1);
125 m_conn->terminateStatement(stmt0);
127 cout <<
"DCSPTMTempList::fetchValuesForECIDAndTime>> Number of records in DB="<< nruns << endl;
128 m_vec_temp.reserve(nruns);
130 Statement* stmt = m_conn->createStatement();
131 stmt->setSQL(
"SELECT " 132 "since, till, temperature FROM PVSS_TEMPERATURE_DAT " 133 "WHERE logic_id = :logic_id " 134 "AND since >= :start_time " 135 "AND since <= :till_time " 136 " order by since " );
137 stmt->setInt(1, ecid_id);
142 ResultSet* rset = stmt->executeQuery();
147 Date startDate = rset->getDate(1);
148 Date endDate = rset->getDate(2);
149 float x = rset->getFloat(3);
150 runStart = dh.
dateToTm( startDate );
158 m_vec_temp.push_back(r);
164 m_conn->terminateStatement(stmt);
165 }
catch (SQLException &
e) {
166 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)