Files
RRJServer/DB_IaT/InstructorsAndTrainees/docTasks/module.cpp
2024-11-27 09:42:52 +03:00

125 lines
2.7 KiB
C++

#include "module.h"
Module::Module():
type (ModuleType::TYPE_PM),
parentModule(nullptr)
{
}
Module::~Module()
{
}
PM::PM():
modelIdentCode (""),
pmIssuer (""),
pmNumber (""),
pmVolume ("")
{
type = ModuleType::TYPE_PM;
langRus.title = "";
langEng.title = "";
}
PM::~PM()
{
for(Module* module: listChildModules)
{
if(module->getType() == ModuleType::TYPE_PM)
delete static_cast<PM*>(module);
else
delete static_cast<DM*>(module);
}
listChildModules.clear();
}
void PM::initialize(QString modelIdentCode, QString pmIssuer, QString pmNumber, QString pmVolume)
{
this->modelIdentCode = modelIdentCode;
this->pmIssuer = pmIssuer;
this->pmNumber = pmNumber;
this->pmVolume = pmVolume;
}
void PM::setLangStructRus(QString title)
{
langRus.title = title;
}
void PM::setLangStructEng(QString title)
{
langEng.title = title;
}
void PM::addChildModule(Module *childModule)
{
listChildModules.append(childModule);
}
DM::DM():
modelIdentCode (""),
systemDiffCode (""),
systemCode (""),
subSystemCode (""),
subSubSystemCode (""),
assyCode (""),
disassyCode (""),
disassyCodeVariant (""),
infoCode (""),
infoCodeVariant (""),
itemLocationCode ("")
{
type = ModuleType::TYPE_DM;
setLangStructRus("", "", "", "", "");
setLangStructEng("", "", "", "", "");
}
DM::~DM()
{
}
void DM::initialize(QString modelIdentCode, QString systemDiffCode, QString systemCode,
QString subSystemCode, QString subSubSystemCode, QString assyCode,
QString disassyCode, QString disassyCodeVariant, QString infoCode,
QString infoCodeVariant, QString itemLocationCode)
{
this->modelIdentCode = modelIdentCode;
this->systemDiffCode = systemDiffCode;
this->systemCode = systemCode;
this->subSystemCode = subSystemCode;
this->subSubSystemCode = subSubSystemCode;
this->assyCode = assyCode;
this->disassyCode = disassyCode;
this->disassyCodeVariant = disassyCodeVariant;
this->infoCode = infoCode;
this->infoCodeVariant = infoCodeVariant;
this->itemLocationCode = itemLocationCode;
}
void DM::setLangStructRus(QString techName, QString infoName, QString pdf, QString bookmark, QString xml)
{
langRus.techName = techName;
langRus.infoName = infoName;
langRus.pdf = pdf;
langRus.bookmark = bookmark;
langRus.xml = xml;
}
void DM::setLangStructEng(QString techName, QString infoName, QString pdf, QString bookmark, QString xml)
{
langEng.techName = techName;
langEng.infoName = infoName;
langEng.pdf = pdf;
langEng.bookmark = bookmark;
langEng.xml = xml;
}