IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2012, 2:49:37 PM (14 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/ippToPsps/src/Dvo.c

    r31986 r33638  
    3535    mysql_query(this->mysql, "DELETE FROM dvoDetection");
    3636
    37     mysql_query(this->mysql, "SELECT sourceID, externID FROM dvoMeta");
     37    mysql_query(this->mysql, "SELECT SOURCE_ID, EXTERN_ID FROM dvoImages");
    3838    MYSQL_RES* result = mysql_store_result(this->mysql);
    3939
     
    4747        externID = atoi(row[1]);
    4848
    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);
    5252        skyList = dvoSkyListByExternID(this->dvoConfig, sourceID, externID, &image);
    5353        if (!skyList) {
     
    6161
    6262        sprintf(sql,
    63                 "UPDATE dvoMeta 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",
    6464                image->imageID,
    6565                image->flags,
     
    7070
    7171        // 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");
    7373        dvoDetection* dvoDetections = NULL;
    7474        int32_t maxDetectionId = -1;
    75         int32_t numDetections =
     75        //int32_t numDetections =
    7676            dvoGetDetections(skyList, image->imageID, &dvoDetections, &maxDetectionId);
    7777
    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");
    8484
    8585        uint32_t zeroDvoCount = 0;
     
    9191            else {
    9292                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)",
    9594                        image->imageID,    // imageID
    9695                        dvoDetections[i].meas.detID,   // ippDetectID
     
    117116  Constructor.
    118117  */
    119 Dvo* new_Dvo(Logger* logger, const char* configFile, const char* dvoDatabase) {
     118Dvo* new_Dvo(Logger* logger, const char* configFile, const char* dbname, const char* dvoDatabase) {
    120119
    121120    Dvo* this = (Dvo*)calloc(1, sizeof(Dvo));
     
    130129    char user[20];
    131130    char passwd[20];
    132     char dbname[20];
    133131
    134132
     
    157155                    sprintf(name, "%s", dbParams->name);
    158156                    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);
    161158                    else if (strcmp(name, "host") == 0) sprintf(host, "%s", value);
    162159                    else if (strcmp(name, "password") == 0) sprintf(passwd, "%s", value);
     
    225222    Logger* logger = new_Logger(NULL, true);
    226223
    227     if (argc < 3) {
     224    if (argc < 4) {
    228225
    229226        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");
    231228    }
    232229    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]);
    236232        dvo->getDetections(dvo);
    237233        dvo->destroy(dvo);
Note: See TracChangeset for help on using the changeset viewer.