DPsim
InterfaceVillas.h
1 // SPDX-License-Identifier: Apache-2.0
2 
3 #pragma once
4 
5 #include <dpsim-models/PtrFactory.h>
6 #include <dpsim/Interface.h>
7 
8 #include <villas/kernel/rt.hpp>
9 #include <villas/node.hpp>
10 #include <villas/node/exceptions.hpp>
11 #include <villas/node/memory.hpp>
12 #include <villas/pool.hpp>
13 #include <villas/sample.hpp>
14 #include <villas/signal.hpp>
15 #include <villas/signal_list.hpp>
16 
17 using namespace villas;
18 
19 namespace DPsim {
21 class InterfaceVillas : public Interface,
22  public SharedFactory<InterfaceVillas> {
23 
24 public:
31  InterfaceVillas(const String &nodeConfig, UInt queueLength = 512,
32  UInt sampleLength = 64, const String &name = "",
33  UInt downsampling = 1);
34 
40  void importAttribute(CPS::AttributeBase::Ptr attr, UInt idx,
41  Bool blockOnRead = false,
42  Bool syncOnSimulationStart = true,
43  const String &name = "", const String &unit = "");
44 
51  void exportAttribute(CPS::AttributeBase::Ptr attr, UInt idx,
52  Bool waitForOnWrite, const String &name = "",
53  const String &unit = "");
54 
55  void printVillasSignals() const;
56 };
57 } // namespace DPsim
Interface type that can be used to import and export simulation attributes over any node type support...