first import

This commit is contained in:
2025-04-21 12:18:49 +02:00
parent d8122d19a2
commit 0bec49ac1e
2 changed files with 26 additions and 0 deletions

View File

@@ -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;
}
}

View File

@@ -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();
};