7 #include <dpsim-models/Attribute.h>
8 #include <dpsim-models/Logger.h>
9 #include <dpsim-models/Task.h>
10 #include <dpsim/Config.h>
11 #include <dpsim/Definitions.h>
12 #include <dpsim/Interface.h>
13 #include <dpsim/Scheduler.h>
17 class InterfaceWorker;
22 typedef std::shared_ptr<Interface> Ptr;
24 Interface(
const String &name =
"", spdlog::level::level_enum logLevel =
25 spdlog::level::level_enum::info)
26 : mName(name), mOpened(
false) {
27 mLog = CPS::Logger::get(
"Interface", logLevel);
30 virtual void open() = 0;
31 virtual void close() = 0;
34 virtual void syncExports() = 0;
38 virtual CPS::Task::List getTasks() = 0;
40 virtual void setLogger(CPS::Logger::Log log);
42 virtual String &getName() {
return mName; }
46 std::vector<std::tuple<CPS::AttributeBase::Ptr, UInt, bool, bool>>
49 std::vector<std::tuple<CPS::AttributeBase::Ptr, UInt>> mExportAttrsDpsim;
52 bool syncOnSimulationStart =
true);
56 CPS::Logger::Log mLog;
58 bool mSyncOnSimulationStart;
59 UInt mCurrentSequenceDpsimToInterface = 1;
60 UInt mNextSequenceInterfaceToDpsim = 1;
61 std::atomic<bool> mOpened;
virtual void syncImports()=0
Function called by the Simulation to perform interface synchronization.