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
MbedLogger/MbedLogger.hpp@35:2f66ea4863d5, 2017-12-20 (annotated)
- Committer:
- tnhnrl
- Date:
- Wed Dec 20 22:44:02 2017 +0000
- Revision:
- 35:2f66ea4863d5
- Parent:
- 34:9b66c5188051
- Child:
- 36:966a86937e17
Previous version before MBED save fixes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tnhnrl | 32:f2f8ae34aadc | 1 | #ifndef MBEDLOGGER_HPP |
tnhnrl | 32:f2f8ae34aadc | 2 | #define MBEDLOGGER_HPP |
tnhnrl | 32:f2f8ae34aadc | 3 | |
tnhnrl | 32:f2f8ae34aadc | 4 | #include "mbed.h" |
tnhnrl | 32:f2f8ae34aadc | 5 | #include <string> |
tnhnrl | 32:f2f8ae34aadc | 6 | using namespace std; |
tnhnrl | 32:f2f8ae34aadc | 7 | |
tnhnrl | 32:f2f8ae34aadc | 8 | #include "DirectoryList.h" |
tnhnrl | 32:f2f8ae34aadc | 9 | |
tnhnrl | 32:f2f8ae34aadc | 10 | class MbedLogger { |
tnhnrl | 32:f2f8ae34aadc | 11 | public: |
tnhnrl | 32:f2f8ae34aadc | 12 | MbedLogger(); //constructor |
tnhnrl | 35:2f66ea4863d5 | 13 | |
tnhnrl | 35:2f66ea4863d5 | 14 | void openFile(); |
tnhnrl | 32:f2f8ae34aadc | 15 | void createTestLog(); //test log function |
tnhnrl | 32:f2f8ae34aadc | 16 | |
tnhnrl | 32:f2f8ae34aadc | 17 | //one log file type for now |
tnhnrl | 34:9b66c5188051 | 18 | void createNewFiles(); //subsequent files (takes time to process) |
tnhnrl | 32:f2f8ae34aadc | 19 | |
tnhnrl | 32:f2f8ae34aadc | 20 | //save float array to file (append each time) |
tnhnrl | 34:9b66c5188051 | 21 | void saveArrayToFile(string string_state, int input_state, float *input); |
tnhnrl | 32:f2f8ae34aadc | 22 | |
tnhnrl | 32:f2f8ae34aadc | 23 | //save the sequence title to file (append each time) |
tnhnrl | 32:f2f8ae34aadc | 24 | void saveSequenceStringToFile(string str_input); |
tnhnrl | 32:f2f8ae34aadc | 25 | |
tnhnrl | 32:f2f8ae34aadc | 26 | //print the data to the serial terminal |
tnhnrl | 32:f2f8ae34aadc | 27 | void printFromLogFile(); |
tnhnrl | 32:f2f8ae34aadc | 28 | |
tnhnrl | 32:f2f8ae34aadc | 29 | //print the directory to the screen |
tnhnrl | 32:f2f8ae34aadc | 30 | void printMbedDirectory(); |
tnhnrl | 32:f2f8ae34aadc | 31 | |
tnhnrl | 32:f2f8ae34aadc | 32 | //close the current file stream [before creating a new one] |
tnhnrl | 32:f2f8ae34aadc | 33 | void closeFile(); |
tnhnrl | 35:2f66ea4863d5 | 34 | |
tnhnrl | 35:2f66ea4863d5 | 35 | //print the current MBED log file |
tnhnrl | 35:2f66ea4863d5 | 36 | void printCurrentLogFile(); |
tnhnrl | 32:f2f8ae34aadc | 37 | |
tnhnrl | 32:f2f8ae34aadc | 38 | private: |
tnhnrl | 32:f2f8ae34aadc | 39 | int _f; //file name number |
tnhnrl | 32:f2f8ae34aadc | 40 | char _file_name[128]; //file name placeholder |
tnhnrl | 32:f2f8ae34aadc | 41 | int _file_number; |
tnhnrl | 32:f2f8ae34aadc | 42 | |
tnhnrl | 32:f2f8ae34aadc | 43 | FILE *_fp; //the file is a class member variable |
tnhnrl | 32:f2f8ae34aadc | 44 | }; |
tnhnrl | 32:f2f8ae34aadc | 45 | |
tnhnrl | 32:f2f8ae34aadc | 46 | #endif |