Changeset 308
- Timestamp:
- 07/07/09 16:35:40 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/service_management_layer/ServiceManagementLayer.cpp
r295 r308 178 178 char* cols[] = {(char *)"ID_Num", (char *)"Service_Name"}; 179 179 180 // create table181 180 182 181 // copy tablename 183 182 strcpy(_services_DB->tablename, "Services"); 183 184 //If program execution ends in anything other than a ordered shutdown, DB's will still be there for next run 185 //Need to get rid of it so that old data isn't inadvertantly used in the next execution cycle 184 186 sprintf(_services_DB->command, "DROP TABLE IF EXISTS Services;"); 185 187 … … 482 484 FD_SET(shellSocketFD, &sockSet); 483 485 selTimeout.tv_sec = 0; 484 selTimeout.tv_usec = 5000 0;486 selTimeout.tv_usec = 5000; 485 487 //Check if there is a message on the shell ready to be processed 486 488 rc=select(shellSocketFD + 1, &sockSet, NULL, NULL, &selTimeout); … … 521 523 FD_SET(shellSocketFD, &sockSet); 522 524 selTimeout.tv_sec = 0; 523 selTimeout.tv_usec = 5000 0;525 selTimeout.tv_usec = 5000; 524 526 //Check if there is a message on the shell ready to be processed 525 527 rc=select(shellSocketFD + 1, &sockSet, NULL, NULL, &selTimeout); … … 672 674 data.append((const char*) sqlite3_column_text(pStatement, 1)); 673 675 else { 674 //TODO could do shell output here if not in DB675 676 data.append("1@output1@"); 676 677 data.append(miss[activeMission].services[sourceID].output[0]); … … 832 833 ServiceManagementLayer::PerformActiveMission() 833 834 { 834 printf("start PAM\n");835 //printf("start PAM\n"); 835 836 uint16_t i = 0; 836 837 std::string data_param, data_obsv, data; … … 897 898 898 899 //Receive any other defined inputs 899 while(i < 10 && !miss[activeMission].input[i].empty()){900 /*while(i < 10 && !miss[activeMission].input[i].empty()){ 900 901 //New data being added to DB 901 902 //printf("inserting data from shell\n"); … … 932 933 i++; 933 934 data.clear(); 934 } 935 }*/ 935 936 936 937 … … 998 999 } 999 1000 //printf("L0:--- %s %s---\n", miss[activeMission].services[i].output[t].c_str(), token); 1000 //TODO change to strstr1001 1002 1001 bool doit = false; 1003 1002 if(miss[activeMission].services[i].output[t].find(">") != string::npos){ … … 1348 1347 } 1349 1348 data.clear(); 1350 //printf("L0:while detected %d, %d\n", k, miss[activeMission].services[i].num_conds);1351 1349 input.clear(); 1352 1350 check.clear(); … … 1375 1373 } 1376 1374 sqlite3_finalize(pStatement); 1377 //printf("data=%s\n", data.c_str());1378 1375 token = strtok((char *)data.c_str(), "@"); 1379 1376 token = strtok(NULL, "@"); 1380 1377 token = strtok(NULL, "@"); 1381 //printf("data=%s\n", token);1382 1378 break; 1383 1379 } … … 1399 1395 TransactData(i);} 1400 1396 i++; 1401 //printf("i=%d\n", i);1402 1397 } 1403 1398 i=0; … … 1442 1437 data.clear(); 1443 1438 } 1439 1440 1441 LOG("ServiceManagementLayer:: Done performing active mission.\n"); 1444 1442 /*LOG("ServiceManagementLayer:: Done sending output data to shell from PerformActiveMission.\n"); 1445 1443 strcpy(_data_DB->command, "select ");