first import
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
#include "system.hpp"
|
#include "system.hpp"
|
||||||
|
#include "imports/import_mentor.hpp"
|
||||||
|
|
||||||
System::System(): mods(nullptr), conns(nullptr) {
|
System::System(): mods(nullptr), conns(nullptr) {
|
||||||
mods = new Modules();
|
mods = new Modules();
|
||||||
@@ -10,3 +11,21 @@ System::~System() {
|
|||||||
delete mods;
|
delete mods;
|
||||||
delete conns;
|
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 "connect.hpp"
|
||||||
#include "modules.hpp"
|
#include "modules.hpp"
|
||||||
|
|
||||||
|
enum class ImportType {
|
||||||
|
IMPORT_MENTOR,
|
||||||
|
IMPORT_ALTIUM,
|
||||||
|
IMPORT_ODS,
|
||||||
|
};
|
||||||
|
|
||||||
class System
|
class System
|
||||||
{
|
{
|
||||||
Modules *mods;
|
Modules *mods;
|
||||||
@@ -11,6 +17,7 @@ class System
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
System();
|
System();
|
||||||
|
void Load(std::string module_name, std::string filename, ImportType type);
|
||||||
~System();
|
~System();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user