Changeset 294
- Timestamp:
- 06/23/09 15:22:35 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/service_management_layer/ServiceManagementLayer.cpp
r293 r294 16 16 */ 17 17 18 //TODO Add nested conditional support19 //TODO Verify update functionality20 //TODO Better shutdown21 //TODO Verify Deregister services22 //TODO printf's23 18 24 19 #include <stdlib.h> … … 145 140 miss = new Mission[10]; 146 141 for(int i = 0; i < 10; i++) 147 miss[i].services = new Service[ 20];142 miss[i].services = new Service[30]; 148 143 149 144 Current_ID = 0; … … 467 462 468 463 //Modified to check the incoming message buffer rather than the outgoing message buffer to avoid a portion of the delay 464 //May change this again to handle data more inteligently, taking advantage of it's properties. 469 465 void 470 466 ServiceManagementLayer::TransferRadioConfiguration(int32_t ID) … … 505 501 506 502 //Modified to check the incoming message buffer rather than the outgoing message buffer to avoid a portion of the delay 503 //May change this again to handle data more inteligently, taking advantage of it's properties. 507 504 void 508 505 ServiceManagementLayer::TransferExperience(int32_t ID) … … 653 650 char* cols[] = {(char *)"Tag", (char *)"Data"}; 654 651 int i = 0; 655 fd_set sockSet;656 652 char *token; 657 struct timeval selTimeout;658 653 659 654 //Send a message directly to the shell … … 661 656 if(miss[activeMission].services[sourceID].name.find("shell")!=string::npos) 662 657 { 663 //printf("caught shell\n");664 658 //If the name on the output doesn't start with "~", search the DB to find the output that should be returned 665 659 if(miss[activeMission].services[sourceID].output[0].find("~") == string::npos){ … … 679 673 else { 680 674 //TODO could do shell output here if not in DB 681 data.append("1@"); 682 data.append(miss[activeMission].services[sourceID].output[0]); 683 data.append("@"); 675 data.append("1@output1@"); 684 676 data.append(miss[activeMission].services[sourceID].output[0]); 685 677 data.append("@"); 686 678 //printf("data = %s\n", data.c_str()); 687 679 688 printf("data_DB:: Data not yet in DB.\n");680 //printf("2222data_DB:: Data not yet in DB.\n"); 689 681 rc=31337; 690 682 } … … 707 699 } 708 700 709 710 701 //If this is a service command and not a shell command... 711 702 //Transmission starting messages 712 703 SendMessage(miss[activeMission].services[sourceID].socketFD, "request_optimization_service"); 713 704 SendMessage(miss[activeMission].services[sourceID].socketFD, miss[activeMission].services[sourceID].name.c_str()); 714 //Find and load the input data 705 706 //If the service takes a paramater, feed that paramater in 707 if(!miss[activeMission].services[sourceID].paramater.empty()){ 708 //printf("sending parameter!\n"); 709 SendMessage(miss[activeMission].services[sourceID].socketFD, "1"); 710 SendMessage(miss[activeMission].services[sourceID].socketFD, "parameter"); 711 SendMessage(miss[activeMission].services[sourceID].socketFD, miss[activeMission].services[sourceID].paramater.c_str()); 712 } 713 714 715 //Load and transmit the input data 715 716 while(i < 5 && !miss[activeMission].services[sourceID].input[i].empty()){ 716 //printf("pulling input data out of DB for ID#=%d\n", sourceID);717 717 strcpy(_data_DB->command, "select "); 718 718 strcat(_data_DB->command, _data_DB->tablename); … … 720 720 strcat(_data_DB->command, _data_DB->tablename); 721 721 strcat(_data_DB->command, " where Tag=="); 722 char temp[100]; 723 strcpy(temp, miss[activeMission].services[sourceID].input[i].c_str()); 724 char *temp2 = strtok(temp, "+"); 725 sprintf(_data_DB->command, "%s'%s';", _data_DB->command, temp2); 722 sprintf(_data_DB->command, "%s'%s';", _data_DB->command, miss[activeMission].services[sourceID].input[i].c_str()); 726 723 sqlite3_stmt * pStatement; 727 724 int rc = sqlite3_prepare_v2(_data_DB->db, _data_DB->command, -1, &pStatement, NULL); … … 738 735 } 739 736 sqlite3_finalize(pStatement); 740 char *data_ch = (char *) data.c_str(); 741 int32_t numStatements = 0; 742 temp2 = strtok(NULL, "+"); 743 while(temp2){ 744 numStatements++; 745 temp2 = strtok(NULL, "+"); 746 } 747 //printf("here1%d\n", numStatements); 748 char temp4[10]; 749 memset(temp4, 0, 10); 750 sprintf(temp4, "%d", numStatements); 751 //Tokenize the data and pass it along 752 //printf("here2 %s\n", temp4); 753 if(strstr(miss[activeMission].services[sourceID].input[i].c_str(), "+")){ 754 SendMessage(miss[activeMission].services[sourceID].socketFD, temp4); 755 token = strtok(data_ch, "@"); 756 } 757 else{ 758 token = strtok(data_ch, "@"); 737 738 token = strtok((char *)data.c_str(), "@"); 739 while(token){ 759 740 SendMessage(miss[activeMission].services[sourceID].socketFD, token); 760 }761 token = strtok(NULL, "@");762 763 764 //Either have to send whole block of memory or just one piece765 while(token){766 if(strstr(miss[activeMission].services[sourceID].input[i].c_str(), token))767 {768 //printf("1tokenizing %s %s!\n", miss[activeMission].services[sourceID].input[i].c_str(), token);769 SendMessage(miss[activeMission].services[sourceID].socketFD, token);770 token = strtok(NULL, "@");771 SendMessage(miss[activeMission].services[sourceID].socketFD, token);772 }773 else if(!strstr(miss[activeMission].services[sourceID].input[i].c_str(), "+"))774 {775 //printf("t not detected tokenizing %s %s!\n", miss[activeMission].services[sourceID].input[i].c_str(), token);776 SendMessage(miss[activeMission].services[sourceID].socketFD, token);777 token = strtok(NULL, "@");778 SendMessage(miss[activeMission].services[sourceID].socketFD, token);779 }780 else{781 //printf("3tokenizing %s %s!\n", miss[activeMission].services[sourceID].input[i].c_str(), token);782 token = strtok(NULL, "@");}783 741 token = strtok(NULL, "@"); 784 742 } 785 //printf("done\n");786 //printf("done pulling input data out of DB for ID#=%d\n", sourceID);787 743 i++; 788 744 data.clear(); 789 745 } 790 746 int32_t j = 0; 791 FD_ZERO(&sockSet); 792 FD_SET(miss[activeMission].services[sourceID].socketFD, &sockSet); 793 //TODO neccessary? 794 selTimeout.tv_sec = 5; 795 selTimeout.tv_usec = 0; 796 //Use select command to force wait for processing to finish 797 select(miss[activeMission].services[sourceID].socketFD + 1, &sockSet, NULL, NULL, &selTimeout); 798 //printf("done\n"); 799 //TODO rewrite part of data on output? 800 //TODO true false format? 747 748 //Receive and store the output data 801 749 while(j < 5 && !miss[activeMission].services[sourceID].output[j].empty()){ 802 750 int rc; 803 751 memset(buffer, 0, 256); 752 //Read the number of datapairs for this output 804 753 ReadMessage(miss[activeMission].services[sourceID].socketFD, buffer); 805 // printf("waiting\n");806 754 data.append(buffer); 807 755 data.append("@"); 808 756 int t = atoi(buffer); 809 //printf("%d\n", t);810 757 for(int k = 0; k < t; k++){ 811 //Read the data incrementally and deliminate it with the "@" symbol758 //Read the datapairs incrementally and deliminate it with the "@" symbol 812 759 memset(buffer, 0, 256); 813 760 ReadMessage(miss[activeMission].services[sourceID].socketFD, buffer); 814 if(!strcmp(buffer, "TF")){ 815 ReadMessage(miss[activeMission].services[sourceID].socketFD, buffer); 816 data.append(buffer); 817 data.append("@"); 818 } 819 else{ 820 data.append(buffer); 821 data.append("@"); 822 memset(buffer, 0, 256); 823 ReadMessage(miss[activeMission].services[sourceID].socketFD, buffer); 824 data.append(buffer); 825 data.append("@"); 826 } 761 data.append(buffer); 762 data.append("@"); 763 memset(buffer, 0, 256); 764 ReadMessage(miss[activeMission].services[sourceID].socketFD, buffer); 765 data.append(buffer); 766 data.append("@"); 827 767 } 828 //printf("SML: putting output data into DB for ID#=%d\n", sourceID);829 768 830 769 strcpy(_data_DB->command, "insert or replace into "); … … 884 823 * -Five inputs/outputs per service and per mission 885 824 * -All ordering constraints have been relaxed in this version; all data is stored locally and only sent when requested 886 * -If support fully implemented - up to three levels887 * - While support still a work in progress825 * -If and while support fully implemented - up to three levels (if's can be nested, but dowhiles cannot) 826 * -For dowhiles, assumes loop condition determined on next to last line (last line is a shell statement to keep the application updated) 888 827 * -IMPORTANT: DB uses '@' to seperate individual statements; using '@' in the data stream will result in incorrect behavior 889 828 */ 890 829 891 //IF-IF-IF892 830 //WHILE 893 831 void … … 908 846 ReadMessage(shellSocketFD, buffer); 909 847 LOG("ServiceManagementLayer:: Received PerformActiveMission command.\n"); 910 848 //TODO this whole section needs to be reworked depending on how relevent data is actually transmitted from the app to the shell to the SML 911 849 int32_t t = atoi(buffer); 912 850 /* Receive Set of Observables */ … … 957 895 958 896 959 897 //Receive any other defined inputs 960 898 while(i < 5 && !miss[activeMission].input[i].empty()){ 961 899 //New data being added to DB … … 1054 992 token = strtok(NULL, "@"); 1055 993 //printf("data=%s\n", token); 994 data.clear(); 1056 995 break; 1057 996 } … … 1059 998 //printf("L0:--- %s %s---\n", miss[activeMission].services[i].output[t].c_str(), token); 1060 999 //TODO change to strstr 1061 if(strstr(miss[activeMission].services[i].output[t].c_str(), token)){ 1000 1001 bool doit = false; 1002 if(miss[activeMission].services[i].output[t].find(">") != string::npos){ 1003 //printf("foundit!\n"); 1004 strcpy(_data_DB->command, "SELECT "); 1005 strcat(_data_DB->command, _data_DB->tablename); 1006 strcat(_data_DB->command, ".* from "); 1007 strcat(_data_DB->command, _data_DB->tablename); 1008 strcat(_data_DB->command, " where Tag=="); 1009 miss[activeMission].services[i].output[t].erase(0, 1); 1010 //printf("here! %s\n", miss[activeMission].services[i].output[t].c_str()); 1011 sprintf(_data_DB->command, "%s'%s';", _data_DB->command, miss[activeMission].services[i].output[t].c_str()); 1012 sqlite3_stmt * pStatement; 1013 rc = sqlite3_prepare_v2(_data_DB->db, _data_DB->command, -1, &pStatement, NULL); 1014 if (rc == SQLITE_OK){ 1015 if (sqlite3_step(pStatement) == SQLITE_ROW) 1016 data = (const char *) sqlite3_column_text(pStatement, 1); 1017 else { 1018 printf("1 data_DB:: Data not yet in DB.\n"); 1019 rc=31337; 1020 } 1021 } else { 1022 printf("data_DB:: Error executing SQL statement. rc = %i\n%s\n",rc,_data_DB->command); 1023 } 1024 sqlite3_finalize(pStatement); 1025 token = strtok((char *)data.c_str(), "@"); 1026 token = strtok(NULL, "@"); 1027 token = strtok(NULL, "@"); 1028 if(atof(buffer) > atof(token)) 1029 doit=true; 1030 //printf("%s %s\n", buffer, token); 1031 data.clear(); 1032 } 1033 else if (strstr(miss[activeMission].services[i].output[t].c_str(), token)) 1034 doit=true; 1035 if(doit){ 1036 //if(strstr(miss[activeMission].services[i].output[t].c_str(), token)){ 1062 1037 //printf("L0:if taken\n"); 1063 1038 for(uint16_t k = i+1; k <= i+miss[activeMission].services[i].num_conds; k++){ … … 1096 1071 token = strtok(NULL, "@"); 1097 1072 //printf("data=%s\n", token); 1073 data.clear(); 1098 1074 break; 1099 1075 } … … 1101 1077 //printf("L1:--- %s %s---\n", miss[activeMission].services[k].output[t].c_str(), token); 1102 1078 //TODO change to strstr 1103 if(strstr(miss[activeMission].services[k].output[t].c_str(), token)){ 1079 bool doit = false; 1080 //printf("here! %s\n", miss[activeMission].services[k].output[t].c_str()); 1081 if(miss[activeMission].services[k].output[t].find(">") != string::npos){ 1082 strcpy(_data_DB->command, "SELECT "); 1083 strcat(_data_DB->command, _data_DB->tablename); 1084 strcat(_data_DB->command, ".* from "); 1085 strcat(_data_DB->command, _data_DB->tablename); 1086 strcat(_data_DB->command, " where Tag=="); 1087 miss[activeMission].services[k].output[t].erase(0, 1); 1088 sprintf(_data_DB->command, "%s'%s';", _data_DB->command, miss[activeMission].services[k].output[t].c_str()); 1089 sqlite3_stmt * pStatement; 1090 rc = sqlite3_prepare_v2(_data_DB->db, _data_DB->command, -1, &pStatement, NULL); 1091 if (rc == SQLITE_OK){ 1092 if (sqlite3_step(pStatement) == SQLITE_ROW) 1093 data = (const char *) sqlite3_column_text(pStatement, 1); 1094 else { 1095 printf("1 data_DB:: Data not yet in DB.\n"); 1096 rc=31337; 1097 } 1098 } else { 1099 printf("data_DB:: Error executing SQL statement. rc = %i\n%s\n",rc,_data_DB->command); 1100 } 1101 sqlite3_finalize(pStatement); 1102 token = strtok((char *)data.c_str(), "@"); 1103 token = strtok(NULL, "@"); 1104 token = strtok(NULL, "@"); 1105 if(atof(buffer) > atof(token)) 1106 doit=true; 1107 data.clear(); 1108 } 1109 else if (strstr(miss[activeMission].services[k].output[t].c_str(), token)) 1110 doit=true; 1111 if(doit){ 1104 1112 //printf("L1:if taken\n"); 1105 1113 for(uint16_t j = k+1; j <= k+miss[activeMission].services[k].num_conds; j++){ … … 1138 1146 token = strtok(NULL, "@"); 1139 1147 //printf("data=%s\n", token); 1148 data.clear(); 1140 1149 break; 1141 1150 } … … 1143 1152 //printf("L2:--- %s %s---\n", miss[activeMission].services[j].output[t].c_str(), token); 1144 1153 //TODO change to strstr 1145 if(strstr(miss[activeMission].services[j].output[t].c_str(), token)){ 1154 bool doit = false; 1155 //printf("here! %s\n", miss[activeMission].services[j].output[t].c_str()); 1156 if(miss[activeMission].services[j].output[t].find(">") != string::npos){ 1157 strcpy(_data_DB->command, "SELECT "); 1158 strcat(_data_DB->command, _data_DB->tablename); 1159 strcat(_data_DB->command, ".* from "); 1160 strcat(_data_DB->command, _data_DB->tablename); 1161 strcat(_data_DB->command, " where Tag=="); 1162 miss[activeMission].services[k].output[t].erase(0, 1); 1163 sprintf(_data_DB->command, "%s'%s';", _data_DB->command, miss[activeMission].services[j].output[t].c_str()); 1164 sqlite3_stmt * pStatement; 1165 rc = sqlite3_prepare_v2(_data_DB->db, _data_DB->command, -1, &pStatement, NULL); 1166 if (rc == SQLITE_OK){ 1167 if (sqlite3_step(pStatement) == SQLITE_ROW) 1168 data = (const char *) sqlite3_column_text(pStatement, 1); 1169 else { 1170 printf("1 data_DB:: Data not yet in DB.\n"); 1171 rc=31337; 1172 } 1173 } else { 1174 printf("data_DB:: Error executing SQL statement. rc = %i\n%s\n",rc,_data_DB->command); 1175 } 1176 sqlite3_finalize(pStatement); 1177 token = strtok((char *)data.c_str(), "@"); 1178 token = strtok(NULL, "@"); 1179 token = strtok(NULL, "@"); 1180 if(atof(buffer) > atof(token)) 1181 doit=true; 1182 data.clear(); 1183 } 1184 else if (strstr(miss[activeMission].services[k].output[t].c_str(), token)) 1185 doit=true; 1186 if(doit){ 1146 1187 //printf("L1:if taken\n"); 1147 1188 for(uint16_t l = j+1; l <= j+miss[activeMission].services[j].num_conds; l++){ … … 1155 1196 j+=miss[activeMission].services[j].num_conds; 1156 1197 //printf("doneif %d, %d, %d\n", numstatements, miss[activeMission].services[i].num_conds, i); 1198 }else if(miss[activeMission].services[j].name.compare("dowhile")==0){ 1199 numstatements[0]=0; 1200 printf("L2 while detected\n"); 1201 while(true){ 1202 uint16_t l; 1203 for(l = j+1; l <= j+miss[activeMission].services[j].num_conds; l++){ 1204 TransactData(l); 1205 printf("l=%d\n", l); 1206 } 1207 data.clear(); 1208 //printf("L0:while detected %d, %d\n", k, miss[activeMission].services[i].num_conds); 1209 input.clear(); 1210 check.clear(); 1211 int t; 1212 for(t = 0; t < 5; t++){ 1213 if(!miss[activeMission].services[j].output[t].empty()){ 1214 input=miss[activeMission].services[l-2].output[t]; 1215 //printf("input=%s\n", input.c_str()); 1216 strcpy(_data_DB->command, "SELECT "); 1217 strcat(_data_DB->command, _data_DB->tablename); 1218 strcat(_data_DB->command, ".* from "); 1219 strcat(_data_DB->command, _data_DB->tablename); 1220 strcat(_data_DB->command, " where Tag=="); 1221 sprintf(_data_DB->command, "%s'%s';", _data_DB->command, input.c_str()); 1222 sqlite3_stmt * pStatement; 1223 rc = sqlite3_prepare_v2(_data_DB->db, _data_DB->command, -1, &pStatement, NULL); 1224 if (rc == SQLITE_OK){ 1225 if (sqlite3_step(pStatement) == SQLITE_ROW) 1226 data = (const char *) sqlite3_column_text(pStatement, 1); 1227 else { 1228 printf("1 data_DB:: Data not yet in DB.\n"); 1229 rc=31337; 1230 } 1231 } else { 1232 printf("data_DB:: Error executing SQL statement. rc = %i\n%s\n",rc,_data_DB->command); 1233 } 1234 sqlite3_finalize(pStatement); 1235 //printf("data=%s\n", data.c_str()); 1236 token = strtok((char *)data.c_str(), "@"); 1237 token = strtok(NULL, "@"); 1238 token = strtok(NULL, "@"); 1239 //printf("data=%s\n", token); 1240 break; 1241 } 1242 } 1243 //printf("L2:--- %s %s---\n", miss[activeMission].services[j].output[t].c_str(), token); 1244 if(strstr(miss[activeMission].services[j].output[t].c_str(), token)){ 1245 //printf("L2:while taken again!\n"); 1246 } 1247 else { 1248 //printf("no more while\n"); 1249 break;} 1250 } 1251 j+=miss[activeMission].services[j].num_conds; 1252 //printf("doneif\n"); 1157 1253 } 1158 1254 else{ … … 1168 1264 k+=miss[activeMission].services[k].num_conds; 1169 1265 //printf("doneif %d, %d, %d\n", numstatements, miss[activeMission].services[i].num_conds, i); 1170 } else if(miss[activeMission].services[k].name.compare("dowhile")==0){ 1171 //printf("while detected\n"); 1266 }else if(miss[activeMission].services[k].name.compare("dowhile")==0){ 1267 numstatements[0]=0; 1268 //printf("L1 while detected\n"); 1172 1269 while(true){ 1173 uint16_t m; 1174 for(uint16_t m = k+1; m <= k+miss[activeMission].services[k].num_conds; m++){ 1175 TransactData(m); 1176 printf("transact! %d\n", m); 1177 } 1270 uint16_t j; 1271 for(j = k+1; j <= k+miss[activeMission].services[k].num_conds; j++){ 1272 TransactData(j); 1273 } 1178 1274 data.clear(); 1179 printf("L1:while detected %d, %d\n", miss[activeMission].services[k].num_conds, k);1275 //printf("L0:while detected %d, %d\n", k, miss[activeMission].services[i].num_conds); 1180 1276 input.clear(); 1181 1277 check.clear(); 1182 1278 int t; 1183 1279 for(t = 0; t < 5; t++){ 1184 if(!miss[activeMission].services[k-1].output[t].empty()){ 1185 input=miss[activeMission].services[m].output[t]; 1280 if(!miss[activeMission].services[k].output[t].empty()){ 1281 input=miss[activeMission].services[j-2].output[t]; 1282 //printf("input=%s\n", input.c_str()); 1186 1283 strcpy(_data_DB->command, "SELECT "); 1187 1284 strcat(_data_DB->command, _data_DB->tablename); … … 1203 1300 } 1204 1301 sqlite3_finalize(pStatement); 1205 //printf("data=%s\n", data.c_str());1302 // printf("data=%s\n", data.c_str()); 1206 1303 token = strtok((char *)data.c_str(), "@"); 1207 1304 token = strtok(NULL, "@"); … … 1211 1308 } 1212 1309 } 1213 printf("L1:--- %s %s---\n", miss[activeMission].services[k].output[t].c_str(), token);1310 //printf("L1:--- %s %s---\n", miss[activeMission].services[k].output[t].c_str(), token); 1214 1311 if(strstr(miss[activeMission].services[k].output[t].c_str(), token)){ 1215 printf("L1:do itagain!\n");1312 //printf("L1:while taken again!\n"); 1216 1313 } 1217 else 1218 break; 1314 else { 1315 //printf("no more while\n"); 1316 break;} 1219 1317 } 1220 1318 k+=miss[activeMission].services[k].num_conds; 1221 //printf("done while\n");1319 //printf("doneif\n"); 1222 1320 } 1223 1321 else{ … … 1241 1339 { 1242 1340 numstatements[0]=0; 1243 //printf(" while detected\n");1341 //printf("L0 while detected\n"); 1244 1342 while(true){ 1245 1343 uint16_t k; … … 1254 1352 for(t = 0; t < 5; t++){ 1255 1353 if(!miss[activeMission].services[i].output[t].empty()){ 1256 input=miss[activeMission].services[k- 1].output[t];1354 input=miss[activeMission].services[k-2].output[t]; 1257 1355 //printf("input=%s\n", input.c_str()); 1258 1356 strcpy(_data_DB->command, "SELECT "); … … 1287 1385 //printf("L0:while taken again!\n"); 1288 1386 } 1289 else 1290 break; 1387 else { 1388 //printf("no more while\n"); 1389 break;} 1291 1390 } 1292 1391 i+=miss[activeMission].services[i].num_conds; … … 1317 1416 data.append((const char*) sqlite3_column_text(pStatement, 1)); 1318 1417 else { 1319 printf(" data_DB:: Data not yet in DB.\n");1418 printf("1data_DB:: Data not yet in DB.\n"); 1320 1419 rc=31337; 1321 1420 } … … 1341 1440 data.clear(); 1342 1441 } 1343 LOG("ServiceManagementLayer:: Done sending output data to shell from PerformActiveMission.\n");1344 /*strcpy(_data_DB->command, "select ");1442 /*LOG("ServiceManagementLayer:: Done sending output data to shell from PerformActiveMission.\n"); 1443 strcpy(_data_DB->command, "select "); 1345 1444 strcat(_data_DB->command, _data_DB->tablename); 1346 1445 strcat(_data_DB->command, ".* from "); … … 1394 1493 miss = new Mission[10]; 1395 1494 for(int i = 0; i < 10; i++) 1396 miss[i].services = new Service[ 20];1495 miss[i].services = new Service[30]; 1397 1496 LoadConfiguration(_SML_Config, miss); 1398 1497 } … … 1444 1543 //memset(cond_array, 0, 2); 1445 1544 1446 for(pChild1 = pChild0->FirstChildElement(); pChild1; \1545 for(pChild1 = (pChild0->FirstChildElement())->FirstChildElement(); pChild1; \ 1447 1546 pChild1 = pChild1->NextSiblingElement()) 1448 1547 { … … 1487 1586 if(pChild4->Attribute("output5")) 1488 1587 mList[mission_num].services[service_num].output[4] = pChild4->Attribute("output5"); 1588 if(pChild4->Attribute("parameter")) 1589 mList[mission_num].services[service_num].paramater = pChild4->Attribute("parameter"); 1489 1590 cond_array[2]++; 1490 1591 } … … 1515 1616 if(pChild3->Attribute("output5")) 1516 1617 mList[mission_num].services[conditional_2].output[4] = pChild3->Attribute("output5"); 1618 if(pChild3->Attribute("parameter")) 1619 mList[mission_num].services[conditional_2].paramater = pChild3->Attribute("parameter"); 1517 1620 mList[mission_num].services[conditional_2].num_conds = cond_array[2]; 1518 1621 cond_array[1]+=cond_array[2]+1; … … 1548 1651 if(pChild2->Attribute("output5")) 1549 1652 mList[mission_num].services[conditional_1].output[4] = pChild2->Attribute("output5"); 1653 if(pChild2->Attribute("parameter")) 1654 mList[mission_num].services[conditional_1].paramater = pChild2->Attribute("parameter"); 1550 1655 1551 1656 mList[mission_num].services[conditional_1].num_conds = cond_array[1]; … … 1581 1686 mList[mission_num].services[conditional_0].output[3] = pChild1->Attribute("output4"); 1582 1687 if(pChild1->Attribute("output5")) 1583 mList[mission_num].services[service_num].output[4] = pChild1->Attribute("output4"); 1688 mList[mission_num].services[conditional_0].output[4] = pChild1->Attribute("output5"); 1689 if(pChild1->Attribute("parameter")) 1690 mList[mission_num].services[conditional_0].paramater = pChild1->Attribute("parameter"); 1584 1691 mList[mission_num].services[conditional_0].num_conds = cond_array[0]; 1585 1692 cond_array[0] = 0; … … 1587 1694 } 1588 1695 //for(int i = 0; i < service_num; i++) 1589 //printf("ttt%d\n", mList[mission_num].services[i].num_conds);1696 // printf("ttt%s\n",mList[mission_num].services[i].name.c_str()); 1590 1697 1591 1698 mList[mission_num].numServices = service_num;