Index: /vtcross/trunk/src/service_management_layer/ServiceManagementLayer.cpp
===================================================================
--- /vtcross/trunk/src/service_management_layer/ServiceManagementLayer.cpp	(revision 294)
+++ /vtcross/trunk/src/service_management_layer/ServiceManagementLayer.cpp	(revision 295)
@@ -704,15 +704,15 @@
     SendMessage(miss[activeMission].services[sourceID].socketFD, miss[activeMission].services[sourceID].name.c_str());
 
-   //If the service takes a paramater, feed that paramater in
-   if(!miss[activeMission].services[sourceID].paramater.empty()){
+   //If the service takes a parameter, feed that parameter in
+   if(!miss[activeMission].services[sourceID].parameter.empty()){
 	//printf("sending parameter!\n");
 	SendMessage(miss[activeMission].services[sourceID].socketFD, "1");
 	SendMessage(miss[activeMission].services[sourceID].socketFD, "parameter");
-	SendMessage(miss[activeMission].services[sourceID].socketFD, miss[activeMission].services[sourceID].paramater.c_str());
+	SendMessage(miss[activeMission].services[sourceID].socketFD, miss[activeMission].services[sourceID].parameter.c_str());
     }
 
 
     //Load and transmit the input data
-    while(i < 5 && !miss[activeMission].services[sourceID].input[i].empty()){
+    while(i < 10 && !miss[activeMission].services[sourceID].input[i].empty()){
         strcpy(_data_DB->command, "select ");
    	strcat(_data_DB->command, _data_DB->tablename);
@@ -747,5 +747,5 @@
     
     //Receive and store the output data
-    while(j < 5 && !miss[activeMission].services[sourceID].output[j].empty()){
+    while(j < 10 && !miss[activeMission].services[sourceID].output[j].empty()){
 	int rc;
 	memset(buffer, 0, 256);
@@ -815,7 +815,7 @@
  *
  * DESCRIPTION: This function works by first sending the inputs from the shell to the appropriate components
- * The first service should begin immeadiately, as should any others who have all of their input paramaters
+ * The first service should begin immeadiately, as should any others who have all of their input parameters
  * When they complete, the output path is found and the data is transfered as it becomes available
- * Presumably at this point the second function has all of it's paramaters, so it begins to compute, and the cycle repeats
+ * Presumably at this point the second function has all of it's parameters, so it begins to compute, and the cycle repeats
  *  
  * 
@@ -832,4 +832,5 @@
 ServiceManagementLayer::PerformActiveMission()
 {
+    printf("start PAM\n");
     uint16_t i = 0;
     std::string data_param, data_obsv, data;
@@ -896,5 +897,5 @@
 
     //Receive any other defined inputs
-    while(i < 5 && !miss[activeMission].input[i].empty()){
+    while(i < 10 && !miss[activeMission].input[i].empty()){
 	    //New data being added to DB
 	//printf("inserting data from shell\n");
@@ -1150,5 +1151,5 @@
 						}
 					    }
-					    //printf("L2:--- %s  %s---\n", miss[activeMission].services[j].output[t].c_str(), token);
+					    //printf("L2:---%s||%s---\n", miss[activeMission].services[j].output[t].c_str(), token);
 					    //TODO change to strstr
 					    bool doit = false;
@@ -1182,5 +1183,5 @@
 						data.clear();
 					    }
-					    else if (strstr(miss[activeMission].services[k].output[t].c_str(), token))
+					    else if (strstr(miss[activeMission].services[j].output[t].c_str(), token))
 						doit=true;
 					    if(doit){
@@ -1198,10 +1199,10 @@
 					}else if(miss[activeMission].services[j].name.compare("dowhile")==0){
 					    numstatements[0]=0;
-					    printf("L2 while detected\n");
+					    //printf("L2 while detected\n");
 					    while(true){
 						uint16_t l;
 						    for(l = j+1; l <= j+miss[activeMission].services[j].num_conds; l++){ 
 							TransactData(l);
-							printf("l=%d\n", l);
+							//printf("l=%d\n", l);
 						    }
 						    data.clear();
@@ -1259,6 +1260,7 @@
 				}
 			    }
-			    else
+			    else{
 				//printf("L1: if not taken\n");
+			    }
 			        numstatements[1] +=miss[activeMission].services[k].num_conds+1;
 			        k+=miss[activeMission].services[k].num_conds;
@@ -1402,5 +1404,5 @@
     data.clear();
     //get the ouptuts
-    while(i < 5 && !miss[activeMission].output[i].empty()){
+    while(i < 10 && !miss[activeMission].output[i].empty()){
 	//printf("sending output data to shell\n");
         strcpy(_data_DB->command, "select ");
@@ -1503,5 +1505,5 @@
  *
  * DESCRIPTION: IMPORTANT - See formatting instructions for correct parsing of data
- * Can currently handle 5 inputs and 5 outputs per service, but easily expandable
+ * Can currently handle 10 inputs and 10 outputs per service, but easily expandable
  * Also, can handle two layer of nested conditional statements, but could
  * be expanded to meet additional needs.
@@ -1546,4 +1548,5 @@
       	    pChild1  = pChild1->NextSiblingElement()) 
     	{
+	    //printf("here1\n");
 	    int32_t conditional_0 = service_num;
 	    for(pChild2 = pChild1->FirstChildElement(); \
@@ -1565,27 +1568,18 @@
 			    else
 			        mList[mission_num].services[service_num].name = pChild4->Value();
-				
-		            if(pChild4->Attribute("input1"))
-				mList[mission_num].services[service_num].input[0] = pChild4->Attribute("input1");
-		            if(pChild4->Attribute("input2"))
-				mList[mission_num].services[service_num].input[1] = pChild4->Attribute("input2");
-		            if(pChild4->Attribute("input3"))
-				mList[mission_num].services[service_num].input[2] = pChild4->Attribute("input3");
-		            if(pChild4->Attribute("input4"))
-				mList[mission_num].services[service_num].input[3] = pChild4->Attribute("input4");
-		            if(pChild4->Attribute("input5"))
-				mList[mission_num].services[service_num].input[4] = pChild4->Attribute("input5");
-		            if(pChild4->Attribute("output1"))
-				mList[mission_num].services[service_num].output[0] = pChild4->Attribute("output1");
-		            if(pChild4->Attribute("output2"))
-				mList[mission_num].services[service_num].output[1] = pChild4->Attribute("output2");
-		            if(pChild4->Attribute("output3"))
-				mList[mission_num].services[service_num].output[2] = pChild4->Attribute("output3");
-			    if(pChild4->Attribute("output4"))
-				mList[mission_num].services[service_num].output[3] = pChild4->Attribute("output4");
-		            if(pChild4->Attribute("output5"))
-				mList[mission_num].services[service_num].output[4] = pChild4->Attribute("output5");
+			    for(int i = 1; i <= 10; i++) {
+			        char buffer[9]="input";
+			        sprintf(buffer, "%s%d", buffer, i); 
+			        //printf("buffer=%s\n", buffer);
+			        if(pChild4->Attribute(buffer))
+			    	    mList[mission_num].services[service_num].input[i-1] = pChild4->Attribute(buffer);
+			        char buffer2[9]="output";
+			        sprintf(buffer2, "%s%d", buffer2, i); 
+			        if(pChild4->Attribute(buffer2))
+				    mList[mission_num].services[service_num].output[i-1] = pChild4->Attribute(buffer2);
+			        //printf("i1=%s\n", mList[mission_num].services[conditional_0].input[i].c_str());
+			    }
 			    if(pChild4->Attribute("parameter"))
-				mList[mission_num].services[service_num].paramater = pChild4->Attribute("parameter");
+				mList[mission_num].services[service_num].parameter = pChild4->Attribute("parameter");
 			    cond_array[2]++;
 			}
@@ -1596,29 +1590,18 @@
 			    mList[mission_num].services[service_num].name = pChild3->Attribute("name");
 			}
-		            if(pChild3->Attribute("input1"))
-				mList[mission_num].services[conditional_2].input[0] = pChild3->Attribute("input1");
-		            if(pChild3->Attribute("input2"))
-				mList[mission_num].services[conditional_2].input[1] = pChild3->Attribute("input2");
-		            if(pChild3->Attribute("input3"))
-				mList[mission_num].services[conditional_2].input[2] = pChild3->Attribute("input3");
-		            if(pChild3->Attribute("input4"))
-				mList[mission_num].services[conditional_2].input[3] = pChild3->Attribute("input4");
-		            if(pChild3->Attribute("input5"))
-				mList[mission_num].services[conditional_2].input[4] = pChild3->Attribute("input5");
-		            if(pChild3->Attribute("output1"))
-				mList[mission_num].services[conditional_2].output[0] = pChild3->Attribute("output1");
-		            if(pChild3->Attribute("output2"))
-				mList[mission_num].services[conditional_2].output[1] = pChild3->Attribute("output2");
-		            if(pChild3->Attribute("output3"))
-				mList[mission_num].services[conditional_2].output[2] = pChild3->Attribute("output3");
-			    if(pChild3->Attribute("output4"))
-				mList[mission_num].services[conditional_2].output[3] = pChild3->Attribute("output4");
-		            if(pChild3->Attribute("output5"))
-				mList[mission_num].services[conditional_2].output[4] = pChild3->Attribute("output5");
+			for(int i = 1; i <= 10; i++) {
+			    char buffer[9]="input";
+			    sprintf(buffer, "%s%d", buffer, i); 
+			    if(pChild3->Attribute(buffer))
+				mList[mission_num].services[conditional_2].input[i-1] = pChild3->Attribute(buffer);
+			    char buffer2[9]="output";
+			    sprintf(buffer2, "%s%d", buffer2, i); 
+			    if(pChild3->Attribute(buffer2))
+				mList[mission_num].services[conditional_2].output[i-1] = pChild3->Attribute(buffer2);
+			}
 			    if(pChild3->Attribute("parameter"))
-				mList[mission_num].services[conditional_2].paramater = pChild3->Attribute("parameter");
+				mList[mission_num].services[conditional_2].parameter = pChild3->Attribute("parameter");
 			mList[mission_num].services[conditional_2].num_conds = cond_array[2];
 			cond_array[1]+=cond_array[2]+1;
-			//printf("cond_array[2]%d\n", cond_array[2]);
 			cond_array[2] = 0;
 
@@ -1631,30 +1614,19 @@
 		    mList[mission_num].services[service_num].name = pChild2->Attribute("name");
 		}
-                if(pChild2->Attribute("input1"))
-		    mList[mission_num].services[conditional_1].input[0] = pChild2->Attribute("input1");
-                if(pChild2->Attribute("input2"))
-		    mList[mission_num].services[conditional_1].input[1] = pChild2->Attribute("input2");
-                    if(pChild2->Attribute("input3"))
-			mList[mission_num].services[conditional_1].input[2] = pChild2->Attribute("input3");
-                    if(pChild2->Attribute("input4"))
-			mList[mission_num].services[conditional_1].input[3] = pChild2->Attribute("input4");
-                    if(pChild2->Attribute("input5"))
-			mList[mission_num].services[conditional_1].input[4] = pChild2->Attribute("input5");
-                    if(pChild2->Attribute("output1"))
-			mList[mission_num].services[conditional_1].output[0] = pChild2->Attribute("output1");
-                    if(pChild2->Attribute("output2"))
-			mList[mission_num].services[conditional_1].output[1] = pChild2->Attribute("output2");
-                    if(pChild2->Attribute("output3"))
-			mList[mission_num].services[conditional_1].output[2] = pChild2->Attribute("output3");
-		    if(pChild2->Attribute("output4"))
-			mList[mission_num].services[conditional_1].output[3] = pChild2->Attribute("output4");
-                    if(pChild2->Attribute("output5"))
-			mList[mission_num].services[conditional_1].output[4] = pChild2->Attribute("output5");
+   		for(int i = 1; i <= 10; i++) {
+		    char buffer[9]="input";
+		    sprintf(buffer, "%s%d", buffer, i); 
+		    if(pChild2->Attribute(buffer))
+		        mList[mission_num].services[conditional_1].input[i-1] = pChild2->Attribute(buffer);
+		    char buffer2[9]="output";
+		    sprintf(buffer2, "%s%d", buffer2, i); 
+		    if(pChild2->Attribute(buffer2))
+			mList[mission_num].services[conditional_1].output[i-1] = pChild2->Attribute(buffer2);
+		}
 		    if(pChild2->Attribute("parameter"))
-			mList[mission_num].services[conditional_1].paramater = pChild2->Attribute("parameter");
+			mList[mission_num].services[conditional_1].parameter = pChild2->Attribute("parameter");
 
 		mList[mission_num].services[conditional_1].num_conds = cond_array[1];
 		cond_array[0]+=cond_array[1]+1;
-		//printf("cond_array[1]%d\n", cond_array[1]);
 		cond_array[1] = 0;
 	    }
@@ -1666,27 +1638,17 @@
 		mList[mission_num].services[conditional_0].name = pChild1->Attribute("name");
 	    }
-		//printf("name=%s\n", mList[mission_num].services[conditional_0].name.c_str());
-                if(pChild1->Attribute("input1"))
-	            mList[mission_num].services[conditional_0].input[0] = pChild1->Attribute("input1");
-                if(pChild1->Attribute("input2"))
-		    mList[mission_num].services[conditional_0].input[1] = pChild1->Attribute("input2");
-                if(pChild1->Attribute("input3"))
-		    mList[mission_num].services[conditional_0].input[2] = pChild1->Attribute("input3");
-                if(pChild1->Attribute("input4"))
-		    mList[mission_num].services[conditional_0].input[3] = pChild1->Attribute("input4");
-                if(pChild1->Attribute("input5"))
-		    mList[mission_num].services[conditional_0].input[4] = pChild1->Attribute("input5");
-                if(pChild1->Attribute("output1"))
-		    mList[mission_num].services[conditional_0].output[0] = pChild1->Attribute("output1");
-                if(pChild1->Attribute("output2"))
-		    mList[mission_num].services[conditional_0].output[1] = pChild1->Attribute("output2");
-                if(pChild1->Attribute("output3"))
-		    mList[mission_num].services[conditional_0].output[2] = pChild1->Attribute("output3");
-                if(pChild1->Attribute("output4"))
-		    mList[mission_num].services[conditional_0].output[3] = pChild1->Attribute("output4");
-                if(pChild1->Attribute("output5"))
-		    mList[mission_num].services[conditional_0].output[4] = pChild1->Attribute("output5");
+		for(int i = 1; i <= 10; i++) {
+		    char buffer[9]="input";
+		    sprintf(buffer, "%s%d", buffer, i); 
+		    if(pChild1->Attribute(buffer))
+		        mList[mission_num].services[conditional_0].input[i-1] = pChild1->Attribute(buffer);
+		    char buffer2[9]="output";
+		    sprintf(buffer2, "%s%d", buffer2, i); 
+		    if(pChild1->Attribute(buffer2))
+			mList[mission_num].services[conditional_0].output[i-1] = pChild1->Attribute(buffer2);
+		}
+		   // printf("i1=%s\n", mList[mission_num].services[conditional_0].input[0].c_str());
 		if(pChild1->Attribute("parameter"))
-		    mList[mission_num].services[conditional_0].paramater = pChild1->Attribute("parameter");
+		    mList[mission_num].services[conditional_0].parameter = pChild1->Attribute("parameter");
 	    mList[mission_num].services[conditional_0].num_conds = cond_array[0];
             cond_array[0] = 0;
@@ -1694,33 +1656,25 @@
 	}
 	//for(int i = 0; i < service_num; i++)
-	// printf("ttt%s\n",mList[mission_num].services[i].name.c_str());
+	 //printf("ttt%s\n",mList[mission_num].services[i].input[0].c_str());
 	
 	mList[mission_num].numServices = service_num;
 	mList[mission_num].name = pChild0->Attribute("name");
-	mList[mission_num].missionID = atoi(pChild0->Attribute("id"));
-        if(pChild0->Attribute("input1"))
-	    mList[mission_num].input[0] = pChild0->Attribute("input1");
-        if(pChild0->Attribute("input2"))
-	    mList[mission_num].input[1] = pChild0->Attribute("input2");
-        if(pChild0->Attribute("input3"))
-	    mList[mission_num].input[2] = pChild0->Attribute("input3");
-        if(pChild0->Attribute("input4"))
-	    mList[mission_num].input[3] = pChild0->Attribute("input4");
-        if(pChild0->Attribute("input5"))
-	    mList[mission_num].input[4] = pChild0->Attribute("input4");
-        if(pChild0->Attribute("output1"))
-	    mList[mission_num].output[0] = pChild0->Attribute("output1");
-        if(pChild0->Attribute("output2"))
-	    mList[mission_num].output[1] = pChild0->Attribute("output2");
-        if(pChild0->Attribute("output3"))
-	    mList[mission_num].output[2] = pChild0->Attribute("output3");
-        if(pChild0->Attribute("output4"))
-	    mList[mission_num].output[3] = pChild0->Attribute("output4");
-        if(pChild0->Attribute("output5"))
-	    mList[mission_num].output[4] = pChild0->Attribute("output5");
+        mList[mission_num].missionID = atoi(pChild0->Attribute("id"));
+	for(int i = 1; i <= 10; i++) {
+	    char buffer[9]="input";
+	    sprintf(buffer, "%s%d", buffer, i); 
+	    if(pChild0->Attribute(buffer))
+	        mList[mission_num].input[i-1] = pChild0->Attribute(buffer);
+	    char buffer2[9]="output";
+	    sprintf(buffer2, "%s%d", buffer2, i); 
+	    if(pChild0->Attribute(buffer2))
+		mList[mission_num].output[i-1] = pChild0->Attribute(buffer2);
+	}
 	//printf("mis, input1=%s, output1=%s\n", mList[mission_num].input[0].c_str(), mList[mission_num].output[0].c_str());
 	//printf("NUMSERVICES = %d\n", mList[mission_num].numServices);
 	mission_num++;
-    }
+	//printf("here\n");
+    }
+    //LOG("ServiceManagementLayer:: Done Loading Configuration");
 }
 
