1 #include <atm/AGOESSQLManager.h>
3 #include <det/Detector.h>
5 #include <utl/TimeStamp.h>
6 #include <utl/StringCompare.h>
7 #include <utl/MoonCycle.h>
19 AGOESSQLManager::GetData(map<unsigned int, int>& returnData,
20 const string& tableName,
21 const string& componentName,
25 if (tableName !=
"cloud_pixel" || componentName !=
"cloud_probability") {
30 query <<
"SELECT pixel_id, cloud_probability ";
34 query <<
"FROM cloud_pixel, software "
35 "WHERE cloud_pixel.software_id = software.software_id "
36 "AND software.software_version = \"" << fDatabaseSoftwareVersion
41 query <<
"FROM cloud_pixel WHERE ";
45 query <<
"moon_cycle = "
49 "ORDER BY last_modified ASC, start_time ASC";
51 if (Query(query,
"what") == eNotFound)
54 boost::tuple<unsigned int, int> pixelId_prob;
57 while (FetchRowMany(pixelId_prob,
false) == eFound)
58 returnData[pixelId_prob.get<0>()] = pixelId_prob.get<1>();
62 if (returnData.empty())
70 AGOESSQLManager::GetDBResFundamental(
const string& tableName,
71 const string& columnName,
75 if (tableName !=
"cloud_pixel") {
84 query <<
"SELECT " << columnName
85 <<
" FROM cloud_pixel WHERE"
88 <<
" AND pixel_id = " << index.find(
"pixel_id")->second
91 <<
" ORDER BY last_modified DESC, start_time DESC LIMIT 1";
95 query <<
"SELECT " << columnName
96 <<
" FROM cloud_pixel, software WHERE"
99 <<
" AND pixel_id = " << index.find(
"pixel_id")->second
102 <<
" and cloud_pixel.software_id = software.software_id"
103 " ORDER BY cloud_pixel.last_modified DESC, cloud_pixel.start_time DESC LIMIT 1";
106 return Query(query, QueryInfoMessage(tableName, columnName));
bool StringEquivalent(const std::string &a, const std::string &b, Predicate p)
Utility to compare strings for equivalence. It takes a predicate to determine the equivalence of indi...
A TimeStamp holds GPS second and nanosecond for some event.
#define REGISTER_A_MANAGER(_name_, _Type_)
long GetFullMoonCycle(const LunationEpoch epoch=eJan2004) const
Integer number of full moons since a start date (default = Jan 2004).
unsigned long GetGPSSecond() const
GPS second.
std::map< std::string, std::string > IndexMap
Status
Specifies success or (eventually) various possible failure modes.