Changeset 33638 for branches/eam_branches/ipp-20111122/ippToPsps/src/Dvo.c
- Timestamp:
- Mar 30, 2012, 2:49:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/ippToPsps/src/Dvo.c
r31986 r33638 35 35 mysql_query(this->mysql, "DELETE FROM dvoDetection"); 36 36 37 mysql_query(this->mysql, "SELECT sourceID, externID FROM dvoMeta");37 mysql_query(this->mysql, "SELECT SOURCE_ID, EXTERN_ID FROM dvoImages"); 38 38 MYSQL_RES* result = mysql_store_result(this->mysql); 39 39 … … 47 47 externID = atoi(row[1]); 48 48 49 this->logger->print(this->logger, MSG_INFO, "Dvo", "---------------------------------------------------------------------\n");50 this->logger->print(this->logger, MSG_INFO, "Dvo", "Getting skylist from DVO database for source ID = %d and extern ID = %d\n",51 sourceID, externID);49 //this->logger->print(this->logger, MSG_INFO, "Dvo", "---------------------------------------------------------------------\n"); 50 //this->logger->print(this->logger, MSG_INFO, "Dvo", "Getting skylist from DVO database for source ID = %d and extern ID = %d\n", 51 // sourceID, externID); 52 52 skyList = dvoSkyListByExternID(this->dvoConfig, sourceID, externID, &image); 53 53 if (!skyList) { … … 61 61 62 62 sprintf(sql, 63 "UPDATE dvo Meta SET imageID = %d,flags = %d, photcode = %d WHERE sourceID = %d AND externID = %d",63 "UPDATE dvoImages SET IMAGE_ID = %d, FLAGS = %d, PHOTCODE = %d WHERE SOURCE_ID = %d AND EXTERN_ID = %d", 64 64 image->imageID, 65 65 image->flags, … … 70 70 71 71 // now get detections 72 this->logger->print(this->logger, MSG_INFO, "Dvo", "Getting detections...\n");72 //this->logger->print(this->logger, MSG_INFO, "Dvo", "Getting detections...\n"); 73 73 dvoDetection* dvoDetections = NULL; 74 74 int32_t maxDetectionId = -1; 75 int32_t numDetections =75 //int32_t numDetections = 76 76 dvoGetDetections(skyList, image->imageID, &dvoDetections, &maxDetectionId); 77 77 78 this->logger->print(this->logger, MSG_INFO, "Dvo",79 "Found %d detections with a max detection ID of %d\n",80 numDetections, maxDetectionId);81 82 83 this->logger->print(this->logger, MSG_INFO, "Dvo", "Inserting IDs into dvoDetection table...\n");78 //this->logger->print(this->logger, MSG_INFO, "Dvo", 79 // "Found %d detections with a max detection ID of %d\n", 80 // numDetections, maxDetectionId); 81 82 83 //this->logger->print(this->logger, MSG_INFO, "Dvo", "Inserting IDs into dvoDetection table...\n"); 84 84 85 85 uint32_t zeroDvoCount = 0; … … 91 91 else { 92 92 sprintf(sql, 93 "INSERT INTO dvoDetection (sourceID, imageID, ippDetectID, detectID, ippObjID, objID, flags) VALUES (%d, %d, %u, %lu, %lu, %lu, %u)", 94 sourceID, // sourceID 93 "INSERT INTO dvoDetection (imageID, ippDetectID, detectID, ippObjID, objID, flags) VALUES (%d, %u, %lu, %lu, %lu, %u)", 95 94 image->imageID, // imageID 96 95 dvoDetections[i].meas.detID, // ippDetectID … … 117 116 Constructor. 118 117 */ 119 Dvo* new_Dvo(Logger* logger, const char* configFile, const char* d voDatabase) {118 Dvo* new_Dvo(Logger* logger, const char* configFile, const char* dbname, const char* dvoDatabase) { 120 119 121 120 Dvo* this = (Dvo*)calloc(1, sizeof(Dvo)); … … 130 129 char user[20]; 131 130 char passwd[20]; 132 char dbname[20];133 131 134 132 … … 157 155 sprintf(name, "%s", dbParams->name); 158 156 value = xmlNodeListGetString(doc, dbParams->xmlChildrenNode, 1); 159 if (strcmp(name, "name") == 0) sprintf(dbname, "%s", value); 160 else if (strcmp(name, "user") == 0) sprintf(user, "%s", value); 157 if (strcmp(name, "user") == 0) sprintf(user, "%s", value); 161 158 else if (strcmp(name, "host") == 0) sprintf(host, "%s", value); 162 159 else if (strcmp(name, "password") == 0) sprintf(passwd, "%s", value); … … 225 222 Logger* logger = new_Logger(NULL, true); 226 223 227 if (argc < 3) {224 if (argc < 4) { 228 225 229 226 logger->print(logger, MSG_ERROR, "Dvo", "Incorrect arguments\n"); 230 logger->print(logger, MSG_INFO, "Dvo", "Usage: ./dvo <pathToConfig> < pathToDvo>\n");227 logger->print(logger, MSG_INFO, "Dvo", "Usage: ./dvo <pathToConfig> <dbName> <pathToDvo>\n"); 231 228 } 232 229 else { 233 //Dvo * dvo = new_Dvo(logger, "/data/ipp004.0/gpc1/catdirs/ThreePi.V1"); 234 Dvo * dvo = new_Dvo(logger, argv[1], argv[2]); 235 //dvo->getDetections(dvo, 33, 8345290); 230 231 Dvo * dvo = new_Dvo(logger, argv[1], argv[2], argv[3]); 236 232 dvo->getDetections(dvo); 237 233 dvo->destroy(dvo);
Note:
See TracChangeset
for help on using the changeset viewer.
