most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown

Dependencies:   mbed MODSERIAL FATFileSystem

Revision:
21:38c8544db6f4
Parent:
17:7c16b5671d0e
Child:
30:2964617e7676
--- a/SequenceController/SequenceController.cpp	Wed Nov 22 14:32:06 2017 +0000
+++ b/SequenceController/SequenceController.cpp	Wed Nov 22 23:04:11 2017 +0000
@@ -8,7 +8,7 @@
 }
 
 void SequenceController::loadSequence() {
-    pc().printf("\n\rRead NEUTRAL Config File Function");
+    pc().printf("\n\rLoading Dive Sequence File:");
     
     ConfigFile read_sequence_cfg;
     char value[256];   
@@ -19,10 +19,8 @@
     }
     else {
         int array_size = sizeof(_sequence_array)/sizeof(_sequence_array[0]);
-        pc().printf("\n\n\rSEQUENCE ARRAY SIZE %d", array_size);
         
         /* Read values from the file until you reach an "exit" character" */
-        //for (int i = 0; i < array_size; i++) {                  //works
         for (int i = 0; i < 1024; i++) {                  //works
             /* convert INT to string */
             char buf[256];
@@ -35,8 +33,6 @@
                 sequenceStructLoaded[i] = process(value); //create the structs using process(string randomstring)
             }
             
-            
-            pc().printf("\n\n\rTitle: %s", sequenceStructLoaded[i].title.c_str());
             if (sequenceStructLoaded[i].title == "exit") {
                 _number_of_sequences = i;   //before the exit
                 break;
@@ -48,7 +44,7 @@
 sequenceStruct SequenceController::process(string randomstring) {
     //this is the struct that is loaded from the config variables
     
-    sequenceStruct loadStruct;
+    sequenceStruct loadStruct; //local struct
     
     /* CONVERT STRING TO CHAR ARRAY */
     const char *cstr = randomstring.c_str();
@@ -91,7 +87,6 @@
                     depth_counter++;
                 }
             }
-            pc().printf("\n\r(%s) DEPTH: %f", randomstring.c_str(), atof(depth_array));
             loadStruct.depth = atof(depth_array);
         }
     }    
@@ -113,7 +108,6 @@
                     pitch_counter++;
                 }
             }
-            pc().printf("\n\r(%s) PITCH: %f", randomstring.c_str(), atof(pitch_array));
             loadStruct.pitch = atof(pitch_array);
         }
     }
@@ -144,9 +138,6 @@
                 time_counter++;
             }
         }
-        pc().printf("\n\r----------- time_array: %s", time_array);
-        
-        pc().printf("\n\r(%s) \n\rTIMEOUT: %f\n\r", randomstring.c_str(), atof(time_array));
         loadStruct.timeout = atof(time_array);
     }
     /* TIME TO FLOAT */  
@@ -161,11 +152,6 @@
     return loadStruct;  //each iteration this returns a completed struct
 }
 
-void SequenceController::runSequence() {
-    //pc().printf("\n\rRUNNING SEQUENCE\n\r");
-    sequenceTicker.attach(this,&SequenceController::sequenceFunction,1.0);
-}
-
 void SequenceController::sequenceFunction() {
     //pc().printf("sequenceFunction\n\r");    //debug (verified it is working correctly)
     
@@ -193,8 +179,6 @@
             
         _sequence_counter++;        //exit ticker when counter complete
     }   
-    
-    //pc().printf("Sequence Controller State: %d\n\r", _current_state);
 }
 
 int SequenceController::getSequenceState() {