first import
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user