2020-11-05 19:25:17 -04:00
|
|
|
#pragma once
|
|
|
|
|
2015-06-29 02:59:53 -03:00
|
|
|
#include "VehicleType.h"
|
2019-01-18 02:18:52 -04:00
|
|
|
#include "DataFlashFileReader.h"
|
2015-06-29 02:59:53 -03:00
|
|
|
#include "LR_MsgHandler.h"
|
2016-05-25 07:46:18 -03:00
|
|
|
#include "Parameters.h"
|
2013-12-29 07:56:54 -04:00
|
|
|
|
2019-01-18 00:23:42 -04:00
|
|
|
class LogReader : public AP_LoggerFileReader
|
2013-12-29 07:56:54 -04:00
|
|
|
{
|
|
|
|
public:
|
2020-11-05 19:25:17 -04:00
|
|
|
LogReader(struct LogStructure *log_structure, NavEKF2 &_ekf, NavEKF3 &_ekf3);
|
2014-01-05 01:37:47 -04:00
|
|
|
|
2015-04-27 00:25:16 -03:00
|
|
|
VehicleType::vehicle_type vehicle;
|
2014-01-04 20:39:43 -04:00
|
|
|
|
2020-11-08 22:06:04 -04:00
|
|
|
static bool check_user_param(const char *name);
|
|
|
|
static bool set_parameter(const char *name, float value, bool force=false);
|
2014-03-01 00:15:46 -04:00
|
|
|
|
2019-09-03 07:03:59 -03:00
|
|
|
bool handle_log_format_msg(const struct log_Format &f) override;
|
2020-11-05 19:25:17 -04:00
|
|
|
bool handle_msg(const struct log_Format &f, uint8_t *msg) override;
|
2015-04-20 02:07:13 -03:00
|
|
|
|
2015-07-07 02:13:51 -03:00
|
|
|
static bool in_list(const char *type, const char *list[]);
|
|
|
|
|
2015-07-04 09:43:54 -03:00
|
|
|
protected:
|
|
|
|
|
2013-12-29 07:56:54 -04:00
|
|
|
private:
|
2020-11-05 19:25:17 -04:00
|
|
|
|
|
|
|
NavEKF2 &ekf2;
|
|
|
|
NavEKF3 &ekf3;
|
|
|
|
|
2018-04-22 07:19:11 -03:00
|
|
|
struct LogStructure *_log_structure;
|
|
|
|
uint8_t _log_structure_count;
|
2013-12-29 07:56:54 -04:00
|
|
|
|
2015-07-04 02:14:14 -03:00
|
|
|
class LR_MsgHandler *msgparser[LOGREADER_MAX_FORMATS] {};
|
2013-12-29 07:56:54 -04:00
|
|
|
};
|
2016-05-16 04:21:52 -03:00
|
|
|
|
|
|
|
// some vars are difficult to get through the layers
|
|
|
|
struct globals {
|
|
|
|
bool no_params;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct globals globals;
|