AP_Stats: keeps track of vehicle usage statistics
This commit is contained in:
parent
9290ee65cc
commit
7eff99b053
18
libraries/AP_Stats/AP_Stats.cpp
Normal file
18
libraries/AP_Stats/AP_Stats.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include "AP_Stats.h"
|
||||||
|
|
||||||
|
// table of user settable parameters
|
||||||
|
const AP_Param::GroupInfo AP_Stats::var_info[] = {
|
||||||
|
|
||||||
|
// @Param: _BOOTCNT
|
||||||
|
// @DisplayName: Boot Count
|
||||||
|
// @Description: Number of times board has been booted
|
||||||
|
// @User: Standard
|
||||||
|
AP_GROUPINFO("_BOOTCNT", 0, AP_Stats, params.bootcount, 0),
|
||||||
|
|
||||||
|
AP_GROUPEND
|
||||||
|
};
|
||||||
|
|
||||||
|
void AP_Stats::init()
|
||||||
|
{
|
||||||
|
params.bootcount.set_and_save(params.bootcount+1);
|
||||||
|
}
|
23
libraries/AP_Stats/AP_Stats.h
Normal file
23
libraries/AP_Stats/AP_Stats.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// AP_Stats is used to collect and put to permanent storage data about
|
||||||
|
// the vehicle's autopilot
|
||||||
|
|
||||||
|
#include <AP_Common/AP_Common.h>
|
||||||
|
#include <AP_Param/AP_Param.h>
|
||||||
|
|
||||||
|
class AP_Stats
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
void init();
|
||||||
|
|
||||||
|
static const struct AP_Param::GroupInfo var_info[];
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
struct {
|
||||||
|
AP_Int16 bootcount;
|
||||||
|
} params;
|
||||||
|
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user