From 0bec49ac1e1c37aaaa6bb8298e7f831cee0590bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Mon, 21 Apr 2025 12:18:49 +0200 Subject: [PATCH] first import --- src/system/system.cpp | 19 +++++++++++++++++++ src/system/system.hpp | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/src/system/system.cpp b/src/system/system.cpp index 8febe14..d0f2e34 100644 --- a/src/system/system.cpp +++ b/src/system/system.cpp @@ -1,5 +1,6 @@ #include "system.hpp" +#include "imports/import_mentor.hpp" System::System(): mods(nullptr), conns(nullptr) { mods = new Modules(); @@ -9,4 +10,22 @@ System::System(): mods(nullptr), conns(nullptr) { System::~System() { delete mods; delete conns; +} + +void System::Load(std::string module_name, std::string file_name, ImportType type) { + ImportBase *imp; + Parts *prts = nullptr; + Module mod = Module(module_name); + switch (type) + { + case ImportType::IMPORT_MENTOR : + imp = new ImportMentor(file_name); + imp->parse(); + prts = imp->parts(); + mod.add(prts); + break; + + default: + break; + } } \ No newline at end of file diff --git a/src/system/system.hpp b/src/system/system.hpp index 0b52ec3..ed391c2 100644 --- a/src/system/system.hpp +++ b/src/system/system.hpp @@ -4,6 +4,12 @@ #include "connect.hpp" #include "modules.hpp" +enum class ImportType { + IMPORT_MENTOR, + IMPORT_ALTIUM, + IMPORT_ODS, +}; + class System { Modules *mods; @@ -11,6 +17,7 @@ class System public: System(); + void Load(std::string module_name, std::string filename, ImportType type); ~System(); };