Motorcortex Core  version: 2.7.6
up_module.h
1 /*
2  * Developer : Mark Verrijt (mark.verrijt@vectioneer.com),
3  * Alexey Zakharov (alexey.zakharov@vectioneer.com)
4  * All rights reserved. Copyright (c) 2021 VECTIONEER.
5  */
6 
7 #ifndef MOTORCORTEX_CORE_UP_MODULE_H
8 #define MOTORCORTEX_CORE_UP_MODULE_H
9 
10 #include "ct_module.h"
11 #include "up_base.h"
12 #include <memory>
13 
14 namespace mcx::user_parameters {
16 
17 public:
18  explicit Module(const std::string& filename);
19  Module() = default;
20  ~Module() override = default;
21  Status load(const std::string& file);
22  Status getStatus() const;
23 
24 private:
25  void create_(const char* name, mcx::parameter_server::Parameter* parameter_server, uint64_t dt_micro_s) override {}
26  bool initPhase1_() override;
27  bool initPhase2_() override;
28  bool startOp_() override { return true; }
29  bool iterateOp_(const mcx::container::TaskTime& system_time, mcx::container::UserTime* user_time) override {
30  return true;
31  }
32  bool stopOp_() override { return true; }
33 
34  static nlohmann::json loadJson(const std::string& filename);
35  static std::unique_ptr<UserParametersBase> selectLoader(const nlohmann::json& json);
36 
37  std::unique_ptr<uint8_t[]> data_;
38  BranchParams branch_params_;
39  DefaultValues default_values_;
40  Status status_{Status::DISABLED};
41 };
42 } // namespace mcx::user_parameters
43 
44 #endif // MOTORCORTEX_CORE_UP_MODULE_H
mcx::parameter_server::Parameter
Definition: ps_parameter.h:45
mcx::user_parameters::Module
Definition: up_module.h:15
mcx::container::TaskTime
Internal time source.
Definition: ct_time.h:25
mcx::container::UserTime
External time source.
Definition: ct_time.h:40
mcx::container::Module
A building block of the Motorcortex components.
Definition: ct_module.h:64
mcx::user_parameters::Module::~Module
~Module() override=default
Default destructor.