update with altimeter, swimfile.txt endleg.txt, etc see changes_13sep.txt also reset_PI()
Dependencies: mbed MODSERIAL FATFileSystem
ConfigFileIO/ConfigFileIO.hpp@104:426224a55f5f, 2019-09-13 (annotated)
- Committer:
- joel_ssc
- Date:
- Fri Sep 13 19:15:40 2019 +0000
- Revision:
- 104:426224a55f5f
- Parent:
- 102:0f430de62447
slight change includes reset_PI
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tnhnrl | 57:ec69651c8c21 | 1 | #include "mbed.h" |
tnhnrl | 57:ec69651c8c21 | 2 | #include "ConfigFile.h" |
joel_ssc | 82:0981b9ada820 | 3 | #include <string> |
tnhnrl | 57:ec69651c8c21 | 4 | |
tnhnrl | 57:ec69651c8c21 | 5 | #ifndef CONFIGFILEIO_HPP |
tnhnrl | 57:ec69651c8c21 | 6 | #define CONFIGFILEIO_HPP |
joel_ssc | 82:0981b9ada820 | 7 | struct logFileNames { |
joel_ssc | 82:0981b9ada820 | 8 | string diagFileName; |
joel_ssc | 82:0981b9ada820 | 9 | string logFileName; |
joel_ssc | 82:0981b9ada820 | 10 | int logversion; |
joel_ssc | 82:0981b9ada820 | 11 | int diagversion; |
joel_ssc | 82:0981b9ada820 | 12 | }; |
joel_ssc | 87:6d95f853dab3 | 13 | struct neutralStatus { |
joel_ssc | 87:6d95f853dab3 | 14 | int setval; |
joel_ssc | 102:0f430de62447 | 15 | float bce_neutral_mm; |
joel_ssc | 102:0f430de62447 | 16 | float batt_neutral_mm; |
joel_ssc | 102:0f430de62447 | 17 | }; |
joel_ssc | 102:0f430de62447 | 18 | struct swimParams { |
joel_ssc | 102:0f430de62447 | 19 | float bce_dive_mm; |
joel_ssc | 102:0f430de62447 | 20 | float bce_rise_mm; |
joel_ssc | 102:0f430de62447 | 21 | float bmm_dive_mm; |
joel_ssc | 102:0f430de62447 | 22 | float bmm_rise_mm; |
joel_ssc | 102:0f430de62447 | 23 | int fn_timeout; |
joel_ssc | 102:0f430de62447 | 24 | float altim_blank_m; |
joel_ssc | 102:0f430de62447 | 25 | float altim_abort_m; |
joel_ssc | 102:0f430de62447 | 26 | float max_mbed_runtime_hr; |
joel_ssc | 102:0f430de62447 | 27 | int endleg_reason; //1 = normal timeout 2=yo_timeout 3= altim_abort 4=no_find_neutral 5=still inverted 6=yo_timeout+too slow 7=no_find_neutral+altim_abort |
joel_ssc | 102:0f430de62447 | 28 | int altim_abort_count; //8=mbed_max_runtime_hr limit |
joel_ssc | 87:6d95f853dab3 | 29 | }; |
tnhnrl | 57:ec69651c8c21 | 30 | |
joel_ssc | 82:0981b9ada820 | 31 | |
tnhnrl | 57:ec69651c8c21 | 32 | class ConfigFileIO { |
tnhnrl | 57:ec69651c8c21 | 33 | public: |
tnhnrl | 57:ec69651c8c21 | 34 | ConfigFileIO(); |
joel_ssc | 87:6d95f853dab3 | 35 | logFileNames logFilesStruct; |
joel_ssc | 87:6d95f853dab3 | 36 | neutralStatus neutralStruct; |
joel_ssc | 102:0f430de62447 | 37 | swimParams swimConstants; |
joel_ssc | 87:6d95f853dab3 | 38 | |
joel_ssc | 87:6d95f853dab3 | 39 | //modified savebatt to save frequency and deadband 7/11/2018 |
tnhnrl | 76:c802e1da4179 | 40 | void saveBattData(float batt_p_gain, float batt_i_gain, float batt_d_gain, int batt_zeroOffset, float batt_filter_freq, float batt_deadband); //modified this because zero offsets are integers |
tnhnrl | 73:f6f378311c8d | 41 | void savePitchData(float pitch_p_gain, float pitch_i_gain, float pitch_d_gain, float pitch_zeroOffset, float pitch_filter_freq, float pitch_deadband); |
tnhnrl | 73:f6f378311c8d | 42 | |
tnhnrl | 76:c802e1da4179 | 43 | void saveBCEData(float bce_p_gain, float bce_i_gain, float bce_d_gain, int bce_zeroOffset, float bce_filter_freq, float bce_deadband); //modified this because zero offsets are integers |
tnhnrl | 73:f6f378311c8d | 44 | void saveDepthData(float depth_p_gain, float depth_i_gain, float depth_d_gain, float depth_zeroOffset, float depth_filter_freq, float depth_deadband); |
tnhnrl | 57:ec69651c8c21 | 45 | |
tnhnrl | 57:ec69651c8c21 | 46 | void saveRudderData(float setMinDeg, float setMaxDeg, float setCenterPWM, float setMinPWM, float setMaxPWM); |
tnhnrl | 73:f6f378311c8d | 47 | void saveHeadingData(float heading_p_gain, float heading_i_gain, float heading_d_gain, float heading_zeroOffset, float heading_filter_freq, float heading_deadband); |
tnhnrl | 57:ec69651c8c21 | 48 | |
tnhnrl | 57:ec69651c8c21 | 49 | //ConfigFunctions |
tnhnrl | 57:ec69651c8c21 | 50 | int load_BCE_config(); |
joel_ssc | 102:0f430de62447 | 51 | int load_swim_config(); |
joel_ssc | 82:0981b9ada820 | 52 | int load_LogVers_config(int print_diag); // jcw feb 2019 |
joel_ssc | 102:0f430de62447 | 53 | void saveNeutralStatus(int setval, float bce_neutral_mm, float batt_neutral_mm); |
joel_ssc | 87:6d95f853dab3 | 54 | int load_setneutral_status(); |
joel_ssc | 102:0f430de62447 | 55 | int load_Altimeter_config(); |
joel_ssc | 102:0f430de62447 | 56 | void report_no_neutral_found(float bce_last_pos, float batt_last_pos); |
joel_ssc | 102:0f430de62447 | 57 | void writeEndleg_reason(); |
joel_ssc | 88:1813f583cee9 | 58 | void save_FinalTime(); |
joel_ssc | 87:6d95f853dab3 | 59 | void report_still_inverted( float roll_value, int yotime); |
joel_ssc | 82:0981b9ada820 | 60 | void saveLogVersData(int logversion, int diagversion); |
tnhnrl | 57:ec69651c8c21 | 61 | int load_BATT_config(); |
tnhnrl | 57:ec69651c8c21 | 62 | int load_DEPTH_config(); |
tnhnrl | 57:ec69651c8c21 | 63 | int load_PITCH_config(); |
joel_ssc | 86:ba3a118b0080 | 64 | int load_StartTime(); |
tnhnrl | 57:ec69651c8c21 | 65 | int load_HEADING_config(); //heading outer loop of rudder servo |
tnhnrl | 57:ec69651c8c21 | 66 | int load_RUDDER_config(); //rudder servo |
tnhnrl | 57:ec69651c8c21 | 67 | int load_script(); |
tnhnrl | 57:ec69651c8c21 | 68 | |
tnhnrl | 57:ec69651c8c21 | 69 | private: |
tnhnrl | 57:ec69651c8c21 | 70 | float _neutral_batt_pos_mm; |
tnhnrl | 57:ec69651c8c21 | 71 | float _neutral_bce_pos_mm; |
tnhnrl | 57:ec69651c8c21 | 72 | }; |
tnhnrl | 57:ec69651c8c21 | 73 | #endif |