Motorcortex Core  version: 2.7.6
ecat_base.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_BASE_H
7 #define MOTORCORTEX_LIB_ECAT_BASE_H
8 
9 #include "ct_module.h"
10 #include "ecat_state.h"
11 #include "ecat_xmltypes.h"
12 #include "utl_cmdparser.h"
13 #include <vector>
14 
15 namespace mcx {
16 
17 namespace parameter_server {
18 class Parameter;
19 }
20 
21 namespace ecat {
22 
23 class DomainBase;
24 
25 class EthercatBase {
26 public:
27  virtual bool createMaster(unsigned int id);
28 
29  virtual bool setSendInterval(unsigned long dt_micro_s);
30 
31  virtual int addDomain(DomainBase* domain);
32 
33  virtual bool startMaster();
34 
35  virtual bool iterate(const container::TaskTime& system_time, container::UserTime* user_time);
36 
37  virtual bool stopMaster();
38 
39  virtual void setSystemMode(utils::SystemMode mode);
40 
41  virtual bool setCpuAffinity(int cpu_affinity);
42 
43  utils::SystemMode getSystemMode() const;
44 
45  unsigned int getId() const;
46 
47  virtual const char* getDriverName() const;
48 
49  void setSyncFactor(unsigned int sync_factor);
50 
51  unsigned int getSyncFactor() const { return sync_factor_; }
52 
53 private:
54  utils::SystemMode system_mode_{utils::SystemMode::SIMULATION};
55  unsigned int sync_factor_{0};
56 
57 protected:
58  unsigned int master_id_{0};
59 };
60 
61 } // namespace ecat
62 
63 } // namespace mcx
64 
65 #endif // MOTORCORTEX_LIB_ECAT_BASE_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