94 std::vector<Assertion::Operator*> conditions;
95 conditions.reserve( 6 );
113 conditions.push_back( &calibTypeOp );
114 conditions.push_back( &instOp );
115 conditions.push_back( &flavorOp );
116 conditions.push_back( &levelOp );
117 conditions.push_back( &vstartOp );
118 conditions.push_back( &completeOp );
126 results = m_conn->select( m_table, m_selects, m_orderBy, whereClause );
129 std::cerr << ex.
getMsg() << std::endl;
136 std::cerr <<
"Error making query " << std::endl;
142 std::vector<SelectInfo> info;
143 unsigned nFound = results->
getNRows();
147 std::cout <<
"No calibrations found for calib_type '" << calibtype <<
"'" << std::endl;
151 info.reserve( results->
getNRows() );
154 std::vector<std::string> fields;
158 unsigned retCode = 0;
161 std::cout << std::endl <<
"Checking for valid timestamps, vstart < vend .. " << std::endl;
162 for ( iRow = 0; iRow < nFound; iRow++ )
164 results->
getRow( fields, iRow );
168 Timestamp vstart = Timestamp( fields[1] );
169 Timestamp vend = Timestamp( fields[2] );
170 info.push_back(
SelectInfo( ser, vstart, vend ) );
172 if ( vend.getClibTime() < vstart.getClibTime() )
174 std::cerr <<
"vend < vstart for " << info.back();
180 std::cerr <<
"Bad vstart or vend in row " << ser << std::endl;
185 if ( !ok )
return retCode;
188 std::cout << std::endl <<
"Checking for vends monotonic.. " << std::endl;
189 for ( iRow = 0; iRow < nFound - 1; iRow++ )
191 if ( info[iRow].m_vend.getClibTime() > info[iRow + 1].m_vend.getClibTime() )
193 std::cerr <<
"Validity interval for row with serial #" << info[iRow + 1].m_ser
194 <<
" completely contained in interval for row with serial #"
195 << info[iRow].m_ser << std::endl;
196 std::cerr << info[iRow];
197 std::cerr << info[iRow + 1] << std::endl;
202 if ( !ok )
return retCode;
205 std::cout << std::endl <<
"Checking for gaps.. " << std::endl;
206 for ( iRow = 0; iRow < nFound - 1; iRow++ )
208 if ( info[iRow].m_vend < info[iRow + 1].m_vstart )
210 std::cerr <<
"Validity interval gap between calibrations with serial #"
211 << info[iRow].m_ser <<
" and #" << info[iRow + 1].m_ser << std::endl;
212 std::cerr << info[iRow];
213 std::cerr << info[iRow + 1] << std::endl;
219 std::cout << std::endl <<
"Checking for overlaps.. " << std::endl;
220 for ( iRow = 0; iRow < nFound - 1; iRow++ )
222 if ( ( info[iRow].m_vend ).getClibTime() >
223 ( info[iRow + 1].m_vstart ).getClibTime() + m_overlap )
225 std::cerr <<
"Unacceptable overlap between serial #" << info[iRow].m_ser <<
" and #"
226 << info[iRow + 1].m_ser << std::endl;
227 std::cerr << info[iRow];
228 std::cerr << info[iRow + 1] << std::endl;
230 if ( !retCode ) retCode = 4;
Coverage(calibUtil::Metadata *meta, const std::string &instr, const std::string &flavor, const std::string &level, const facilities::Timestamp &ts)