Motorcortex Core  version: 2.7.6
ecat_simulation.h
1 /*
2  * Developer : Alexey Zakharov (alexey.zakharov@vectioneer.com)
3  * All rights reserved. Copyright (c) 2015 - 2018 VECTIONEER.
4  */
5 
6 #ifndef MOTORCORTEX_LIB_ECAT_SIMULATION_H
7 #define MOTORCORTEX_LIB_ECAT_SIMULATION_H
8 
9 #include "ecat_base.h"
10 #include <list>
11 #include <vector>
12 
13 namespace mcx::ecat {
14 
15 class SdoBase;
16 
17 class Simulation : public EthercatBase {
18 public:
19  Simulation() = default;
20 
21  virtual ~Simulation();
22 
23  bool createMaster(unsigned int id) override;
24 
25  bool setSendInterval(unsigned long dt_micro_s) override;
26 
27  int addDomain(DomainBase* domain) override;
28 
29  bool startMaster() override;
30 
31  bool iterate(const container::TaskTime& system_time, container::UserTime* user_time) override;
32 
33  bool stopMaster() override;
34 
35  [[nodiscard]] const char* getDriverName() const override { return "Simulation"; }
36 
37 private:
38  struct DomainData {
39  DomainBase* handle;
40  };
41 
42  std::vector<uint8_t*> sdo_data_;
43  std::vector<DomainData> domains_;
44 };
45 
46 } // namespace mcx::ecat
47 
48 #endif // MOTORCORTEX_LIB_ECAT_SIMULATION_H
mcx::container::TaskTime
Internal time source.
Definition: ct_time.h:25
mcx::ecat::EthercatBase
Definition: ecat_base.h:25
mcx::ecat::DomainBase
Definition: ecat_domainbase.h:24
mcx::container::UserTime
External time source.
Definition: ct_time.h:40
mcx::ecat::Simulation
Definition: ecat_simulation.h:17