ExpressionClassifyEngine.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. #pragma once
  2. #include "stdafx.h"
  3. #include "ExpressionClassifyEngine.h"
  4. #include "ExpressionParseEngine/LogicExp.h"
  5. #include "XMLSerialization.h"
  6. #include <map>
  7. #include <Element.h>
  8. #include "OTSSTDLibFileMgr.h"
  9. #include "COTSUtilityDllFunExport.h"
  10. namespace OTSClassifyEngine
  11. {
  12. using namespace expInterpreter;
  13. bool ExpressionClassifyEngine::Init()
  14. {
  15. CSTDLibFileMgrPtr pLibFileMgr = CSTDLibFileMgrPtr(new CSTDLibFileMgr(m_StrName));
  16. m_std = ParticleSTDPtr(new ParticleSTD());
  17. if (!pLibFileMgr->LoadPartSTD(m_std))
  18. {
  19. return FALSE;
  20. }
  21. pLibFileMgr->LoadMaxEDSRulesData(m_std);
  22. pLibFileMgr->LoadZeroElementRulesData(m_std);
  23. string constantStr = pLibFileMgr->LoadConstantsData();
  24. std::map<std::string, double> m_mapConstants;
  25. m_mapConstants.clear();
  26. std::vector<std::string> strs;
  27. xmls::SplitString(constantStr, strs, ",");
  28. for (std::string s : strs)
  29. {
  30. std::vector<std::string> oneExp;
  31. xmls::SplitString(s, oneExp, "=");
  32. m_mapConstants[oneExp[0]] = std::atof(oneExp[1].c_str());
  33. }
  34. m_std->setConstantsMap(m_mapConstants);
  35. return true;
  36. }
  37. bool ExpressionClassifyEngine::ClassifyExpression(COTSParticlePtr particle, CPosXrayPtr xray)
  38. {
  39. if (particle != nullptr && xray != nullptr)
  40. {
  41. auto& originalPartEles = xray->GetElementQuantifyData();//find all the elements containing in the particle xray.
  42. //以下为调试用代码段(在log中打出颗粒元素),不要删除----------
  43. /*std::string allele=std::to_string(particle->GetTagId()) + " ";
  44. for (auto che : originalPartEles)
  45. {
  46. allele += che->GetName().GetBuffer() ;
  47. allele += ":";
  48. allele += std::to_string(che->GetPercentage()).c_str();
  49. allele += " ";
  50. }
  51. LogTrace(__FILE__, __LINE__, allele.c_str());*/
  52. //-----------------------------
  53. //zero element process,if satisfied the condition than set the particular element percentage to 0.and make it 100% of all the element percentage.
  54. auto partEles = ZeroElementProcess(particle, xray);//
  55. std::map<std::string, CElementChemistryPtr> mapChemistrys;
  56. for (auto ch : partEles)
  57. {
  58. mapChemistrys[ch->GetName().GetBuffer()] = ch;
  59. }
  60. PartSTDRuleItemList ruleItems = m_std->GetSTDRuleItems();
  61. //以下为调试用代码段(在log中打出颗粒元素),不要删除----------
  62. /*CString stdnum = _T("STDNum ")+ CString(std::to_string(stdItems.size()).c_str());
  63. LogTrace(__FILE__, __LINE__, stdnum);*/
  64. for (auto itm : ruleItems)
  65. {
  66. std::string exp = itm->GetExpressionStr();
  67. //LogTrace(__FILE__, __LINE__, exp.c_str());
  68. //if the element quantity is not match the std item's keyelement num than they are unmatching.
  69. if (partEles.size() < itm->GetKeyElementList().size())
  70. {
  71. continue;
  72. }
  73. auto& mapStdEles = itm->GetMapElements();
  74. bool bMatch = true;
  75. // if the particle does not contain all the key elements of the item than they are unmatching.
  76. for (auto che : mapStdEles)
  77. {
  78. auto chemical = mapChemistrys.find(che.second->GetName().GetBuffer());
  79. if (chemical == mapChemistrys.end())
  80. {
  81. bMatch = false;
  82. break;
  83. }
  84. }
  85. if (!bMatch) continue;
  86. // process the special property name such as "first_elem" and "Element#1" etc.
  87. for (std::string s : itm->GetUsingOtherpropertyList())
  88. {
  89. if (s.find("_elem") != std::string::npos)
  90. {
  91. auto val = GetAtomicNoBySortingPercentage(s.c_str(), xray);
  92. xmls::ReplaceAll(exp, s, std::to_string(val));
  93. }
  94. if (s.find("Element#") != std::string::npos)
  95. {
  96. auto val = GetEleNameBySortingPercentage(s.c_str(), xray);//find the "Element#1" and replace it with the real element name.
  97. auto elelist = itm->GetKeyElementList();
  98. elelist.push_back(CElementPtr(new CElement(val)));// then replace it in the next step.
  99. itm->SetKeyElementList(elelist);
  100. xmls::ReplaceAll(exp, s, val.GetBuffer());
  101. }
  102. }
  103. for (auto eleChemistry : itm->GetAllSortedEleList())
  104. {
  105. auto e = mapChemistrys.find(eleChemistry->GetName().GetBuffer());
  106. if (e != mapChemistrys.end())
  107. {
  108. std::string name = eleChemistry->GetName();
  109. xmls::ReplaceAll(exp, name, std::to_string(e->second->GetPercentage()));
  110. }
  111. else
  112. {
  113. std::string name = eleChemistry->GetName();
  114. xmls::ReplaceAll(exp, name, "0");
  115. }
  116. }
  117. //process the image property
  118. for (std::string s : itm->GetUsingImgPropertyNameList())
  119. {
  120. auto val = particle->GetImgPropertyValueByName(s.c_str());
  121. xmls::ReplaceAll(exp, s, std::to_string(val));
  122. }
  123. //process the "true" keyword.
  124. if (exp.find("true") != std::string::npos)
  125. {
  126. xmls::ReplaceAll(exp, "true", "(1=1)");
  127. }
  128. //process the "false" keyword.
  129. if (exp.find("false") != std::string::npos)
  130. {
  131. xmls::ReplaceAll(exp, "false", "(1=0)");
  132. }
  133. for (int i = 0; i < 10; i++)
  134. {
  135. std::string macStr = "MAC#" + std::to_string(i);
  136. if (exp.find(macStr) != std::string::npos)
  137. {
  138. auto val = GetMacValue(macStr.c_str());//find the "Mac#1" and replace it with the real element name.
  139. xmls::ReplaceAll(exp, macStr, std::to_string(val));
  140. }
  141. }
  142. //calculate the expression which has been processed.
  143. bool rst = CalcuExp(exp);
  144. //以下为调试用代码段(在log中打出颗粒元素),不要删除----------
  145. /*LogTrace(__FILE__, __LINE__, exp.c_str());
  146. if (rst)
  147. {
  148. LogTrace(__FILE__, __LINE__, CString("true"));
  149. }
  150. else
  151. {
  152. LogTrace(__FILE__, __LINE__, CString("false"));
  153. }*/
  154. if (rst)
  155. {
  156. particle->SetType(OTS_PARTICLE_TYPE::IDENTIFIED);
  157. particle->SetClassifyId(itm->GetID());
  158. particle->SetColor(itm->GetColor());
  159. particle->SetClassifyName(itm->GetName());
  160. particle->SetHardness(itm->GetHardness());
  161. particle->SetDensity(itm->GetDensity());
  162. particle->SetConductivity(itm->GetElectrical_conductivity());
  163. particle->SetGroupId(itm->GetGrpID());
  164. particle->SetGroupColor(itm->GetGrpColor());
  165. particle->SetGroupName(itm->GetGrpName());
  166. return true;
  167. }
  168. else
  169. {
  170. continue;
  171. }
  172. }
  173. particle->SetType(OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
  174. particle->SetClassifyName("Not Identified");
  175. particle->SetColor("#000000");
  176. particle->SetGroupId((int)OTS_PARTCLE_TYPE::NOT_IDENTIFIED);
  177. particle->SetGroupName("Not Identified");
  178. particle->SetGroupColor("#000000");
  179. return true;
  180. }
  181. else if(particle != nullptr && xray == nullptr)
  182. {
  183. PartSTDRuleItemList stdItems = m_std->GetSTDRuleItems();
  184. for (auto itm : stdItems)
  185. {
  186. std::string exp = itm->GetExpressionStr();
  187. if (itm->GetKeyElementList().size() > 0 || itm->GetSubElementList().size() > 0)
  188. {
  189. continue;
  190. }
  191. //process the image property
  192. for (std::string s : itm->GetUsingImgPropertyNameList())
  193. {
  194. auto val = particle->GetImgPropertyValueByName(s.c_str());
  195. xmls::ReplaceAll(exp, s, std::to_string(val));
  196. }
  197. //process the "true" keyword.
  198. if (exp.find("true") != std::string::npos)
  199. {
  200. xmls::ReplaceAll(exp, "true", "(1=1)");
  201. }
  202. //process the "false" keyword.
  203. if (exp.find("false") != std::string::npos)
  204. {
  205. xmls::ReplaceAll(exp, "false", "(1=0)");
  206. }
  207. for (int i = 0; i < 10; i++)
  208. {
  209. std::string macStr = "MAC#" + std::to_string(i);
  210. if (exp.find(macStr) != std::string::npos)
  211. {
  212. auto val = GetMacValue(macStr.c_str());//find the "Mac#1" and replace it with the real element name.
  213. xmls::ReplaceAll(exp, macStr, std::to_string(val));
  214. }
  215. }
  216. //calculate the expression which has been processed.
  217. bool rst = CalcuExp(exp);
  218. if (rst)
  219. {
  220. //int id = itm->GetID();
  221. particle->SetType(OTS_PARTICLE_TYPE::IDENTIFIED);
  222. particle->SetClassifyId(itm->GetID());
  223. particle->SetColor(itm->GetColor());
  224. particle->SetClassifyName(itm->GetName());
  225. particle->SetHardness(itm->GetHardness());
  226. particle->SetDensity(itm->GetDensity());
  227. particle->SetConductivity(itm->GetElectrical_conductivity());
  228. particle->SetGroupId(itm->GetGrpID());
  229. particle->SetGroupColor(itm->GetGrpColor());
  230. particle->SetGroupName(itm->GetGrpName());
  231. if (itm->GetIsElementAnalysis() == false)
  232. {
  233. itm->AddXraySpectrum(particle->GetXrayInfo());
  234. }
  235. return true;
  236. }
  237. else
  238. {
  239. continue;
  240. }
  241. }
  242. particle->SetType(OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
  243. particle->SetClassifyName("Not Identified");
  244. particle->SetColor("#000000");
  245. particle->SetGroupId((int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
  246. particle->SetGroupColor("#000000");
  247. particle->SetGroupName("Not Identified");
  248. return true;
  249. }
  250. }
  251. bool ExpressionClassifyEngine::IfNeedMaxEDS(COTSParticlePtr particle, CPosXrayPtr xray, double& MaxEDSTime)
  252. {
  253. if (particle == nullptr || xray == nullptr) return false;
  254. MaxEDSRuleList Rules = m_std->GetMaxEDSRules();
  255. for (auto rule : Rules)
  256. {
  257. std::string exp = rule->m_expressionStr;
  258. auto& partEles = xray->GetElementQuantifyData();//find all the elements containing in the particle xray.
  259. if (partEles.size() < rule->m_elementList.size())
  260. {
  261. continue;// if the size not match then continue.
  262. }
  263. std::map<CString, CElementChemistryPtr> mapChe;
  264. for (auto ch : partEles)
  265. {
  266. mapChe[ch->GetName()] = ch;
  267. }
  268. auto& usingEles = rule->m_elementList;
  269. bool bMatch=true;
  270. for (auto che : usingEles)
  271. {
  272. auto chemical = mapChe.find(che->GetName());
  273. if (chemical == mapChe.end())
  274. {
  275. bMatch = false;
  276. break;
  277. }
  278. }
  279. if (!bMatch) continue;//if cann't find the element in the particle's element,then continue.
  280. // all the rule's using element are contained in the particle then we replace the element with the percentage value
  281. for (std::string s : rule->m_OtherpropertyList)
  282. {
  283. if (s.find("_elem")!=std::string::npos)
  284. {
  285. auto val = GetAtomicNoBySortingPercentage(s.c_str(), xray);
  286. xmls::ReplaceAll(exp, s, std::to_string(val));
  287. }
  288. if (s.find("Element#")!=std::string::npos)
  289. {
  290. auto val = GetEleNameBySortingPercentage(s.c_str(), xray);//find the "Element#1" and replace it with the real element name.
  291. auto& elelist = rule->m_elementList;
  292. elelist.push_back(CElementPtr(new CElement(val)));// then replace it in the next step.
  293. xmls::ReplaceAll(exp, s, val.GetBuffer());
  294. }
  295. }
  296. for (auto eleChemistry : rule->m_elementList)
  297. {
  298. auto e = mapChe[eleChemistry->GetName()];
  299. std::string name = eleChemistry->GetName();
  300. xmls::ReplaceAll(exp, name, std::to_string(e->GetPercentage()));
  301. }
  302. for (std::string s : rule->m_ImgPropertyList)
  303. {
  304. auto val = particle->GetImgPropertyValueByName(s.c_str());
  305. xmls::ReplaceAll(exp, s, std::to_string(val));
  306. }
  307. bool rst = CalcuExp(exp);
  308. if (rst)
  309. {
  310. MaxEDSTime = rule->m_MaxEDSTime;
  311. return true;
  312. }
  313. else
  314. {
  315. continue;
  316. }
  317. }
  318. MaxEDSTime = 0;
  319. return false;
  320. }
  321. CString ExpressionClassifyEngine::GetEleNameBySortingPercentage(CString sortingNostr, CPosXrayPtr xrayInfo)
  322. {
  323. std::map<double, CElementChemistryPtr> mapPercent;
  324. std::map<int, CElementChemistryPtr> mapSorted;
  325. auto eles = xrayInfo->GetElementQuantifyData();
  326. for (auto e : eles)
  327. {
  328. mapPercent[e->GetPercentage()] = e;
  329. }
  330. auto itr = --mapPercent.end();
  331. for (int i=0;itr != mapPercent.begin();)
  332. {
  333. mapSorted.insert(std::pair<int, CElementChemistryPtr>(i, itr->second));
  334. itr--;
  335. i++;
  336. }
  337. std::string NoStr = sortingNostr;
  338. std::vector<string> strs;
  339. xmls::SplitString(NoStr, strs, "#");
  340. int No = std::stoi(strs[1]);
  341. if (mapSorted.size() > No)
  342. {
  343. return mapSorted[No]->GetName();
  344. }
  345. else
  346. {
  347. return _T("");
  348. }
  349. }
  350. double ExpressionClassifyEngine::GetMacValue(CString MacStr)
  351. {
  352. auto mapconstant = m_std->GetMapConstants();
  353. if (mapconstant.find(MacStr.GetBuffer()) != mapconstant.end())
  354. {
  355. return mapconstant[MacStr.GetBuffer()];
  356. }
  357. else
  358. {
  359. return 0.0;
  360. }
  361. }
  362. int ExpressionClassifyEngine::GetAtomicNoBySortingPercentage(CString sortingNostr, CPosXrayPtr xrayInfo)
  363. {
  364. std::map<double, CElementChemistryPtr> mapPercent;
  365. std::map<int, CElementChemistryPtr> mapSorted;
  366. auto eles = xrayInfo->GetElementQuantifyData();
  367. if (eles.size() == 0)
  368. {
  369. return 0;
  370. }
  371. for (auto e : eles)
  372. {
  373. mapPercent[e->GetPercentage()] = e;
  374. }
  375. auto itr = --mapPercent.end();
  376. for (int i = 0; itr != mapPercent.begin(); )
  377. {
  378. mapSorted.insert(std::pair<int, CElementChemistryPtr>(i, itr->second));
  379. itr--;
  380. i++;
  381. }
  382. std::string NoStr = sortingNostr;
  383. int No=10;
  384. if (sortingNostr == "first_elem") No = 0;
  385. if (sortingNostr == "second_elem") No = 1;
  386. if (sortingNostr == "third_elem") No = 2;
  387. if (sortingNostr == "fourth_elem") No = 3;
  388. if (sortingNostr == "fifth_elem") No = 4;
  389. if (sortingNostr == "sixth_elem") No = 5;
  390. if (sortingNostr == "seventh_elem") No =6;
  391. if (sortingNostr == "eighth_elem") No = 7;
  392. if (sortingNostr == "ninth_elem") No = 8;
  393. if (sortingNostr == "tenth_elem") No =9;
  394. if (mapSorted.size() > No)
  395. {
  396. std::string elename = mapSorted[No]->GetName();
  397. CElementPtr ele = CElementPtr(new CElement(elename.c_str()));
  398. return ele->GetAtomNum();
  399. }
  400. else
  401. {
  402. return 0;
  403. }
  404. }
  405. CElementChemistriesList ExpressionClassifyEngine::ZeroElementProcess(COTSParticlePtr particle, CPosXrayPtr xray)
  406. {
  407. auto& originalPartEles = xray->GetElementQuantifyData();//find all the elements containing in the particle xray.
  408. CElementChemistriesList partEles;
  409. for (auto che : originalPartEles)
  410. {
  411. auto newChe = CElementChemistryPtr(new CElementChemistry(che.get()));
  412. partEles.push_back(newChe);
  413. }
  414. //make it 100% in total.
  415. double rawPercentage = 0;
  416. for (auto ele : partEles)
  417. {
  418. rawPercentage += ele->GetPercentage();
  419. }
  420. for (auto ele : partEles)
  421. {
  422. ele->SetPercentage(ele->GetPercentage() / rawPercentage * 100);
  423. }
  424. //zero element process
  425. std::map<CString, CElementChemistryPtr> mapChe;
  426. for (auto ch : partEles)
  427. {
  428. mapChe[ch->GetName()] = ch;
  429. }
  430. ZeroElementRuleList Rules = m_std->GetZeroRules();
  431. for (auto rule : Rules)
  432. {
  433. std::string exp = rule->GetExpressionStr();
  434. if (partEles.size() < rule->GetUsingElementList().size())
  435. {
  436. continue;// if the size not match then continue.
  437. }
  438. auto& usingEles = rule->GetUsingElementList();
  439. bool bMatch = true;
  440. for (auto che : usingEles)
  441. {
  442. auto chemical = mapChe.find(che->GetName());
  443. if (chemical == mapChe.end())
  444. {
  445. bMatch = false;
  446. break;//if cann't find the element in the particle's element,then continue.
  447. }
  448. }
  449. if (bMatch == false) continue;
  450. // all the rule's using element are contained in the particle then we replace the element with the percentage value
  451. for (std::string s : rule->GetOtherpropertyList())
  452. {
  453. if (s.find("_elem")!=std::string::npos)
  454. {
  455. auto val = GetAtomicNoBySortingPercentage(s.c_str(), xray);
  456. xmls::ReplaceAll(exp, s, std::to_string(val));
  457. }
  458. if (s.find("Element#")!=std::string::npos)
  459. {
  460. auto val = GetEleNameBySortingPercentage(s.c_str(), xray);//find the "Element#1" and replace it with the real element name.
  461. auto elelist = rule->GetUsingElementList();
  462. elelist.push_back(CElementPtr(new CElement(val)));// then replace it in the next step.
  463. rule->SetUsingElementList(elelist);
  464. xmls::ReplaceAll(exp, s, val.GetBuffer());
  465. }
  466. }
  467. for (auto eleChemistry : rule->GetUsingElementList())
  468. {
  469. auto e = mapChe.find(eleChemistry->GetName());
  470. if (e != mapChe.end())
  471. {
  472. std::string name = eleChemistry->GetName();
  473. xmls::ReplaceAll(exp, name, std::to_string((*e).second->GetPercentage()));
  474. }
  475. }
  476. for (std::string s : rule->GetImgPropertyList())
  477. {
  478. auto val = particle->GetImgPropertyValueByName(s.c_str());
  479. xmls::ReplaceAll(exp, s, std::to_string(val));
  480. }
  481. for (int i = 0; i < 10; i++)
  482. {
  483. std::string macStr = "MAC#" + std::to_string(i);
  484. if (exp.find(macStr) != std::string::npos)
  485. {
  486. auto val = GetMacValue(macStr.c_str());//find the "Mac#1" and replace it with the real element name.
  487. xmls::ReplaceAll(exp, macStr, std::to_string(val));
  488. }
  489. }
  490. bool rst = CalcuExp(exp);
  491. if (rst)
  492. {
  493. auto itr = std::find_if(partEles.begin(), partEles.end(), [rule](CElementChemistryPtr ele) {return ele->GetName() == CString(rule->GetZeroElementName().c_str()); });
  494. if (itr != partEles.end())
  495. {
  496. //partEles.erase(itr);//if satisfied the condition then erase the element(zero the element).
  497. (*itr)->SetPercentage(0);//if satisfied the condition then set element percenttage to 0(zero the element).
  498. double sumPercentage=0;
  499. for (auto ele : partEles)
  500. {
  501. sumPercentage += ele->GetPercentage();
  502. }
  503. for (auto ele : partEles)
  504. {
  505. ele->SetPercentage(ele->GetPercentage() / sumPercentage*100);
  506. }
  507. }
  508. }
  509. else
  510. {
  511. continue;
  512. }
  513. }
  514. return partEles;
  515. }
  516. bool ExpressionClassifyEngine::ClassifyBySpectrum(COTSParticlePtr particle, CPosXrayPtr xray)
  517. {
  518. return false;
  519. }
  520. bool ExpressionClassifyEngine::ClassifyByExpressionTemporarySpectrum(COTSParticlePtr particle, CPosXrayPtr xray)
  521. {
  522. PartSTDRuleItemList ruleItems = m_std->GetSTDRuleItems();
  523. for (auto itm : ruleItems)
  524. {
  525. if (itm->GetIsElementAnalysis() == false)
  526. {
  527. if (itm->CalculateSimilarity(xray) > 0.90)
  528. {
  529. particle->SetType(OTS_PARTICLE_TYPE::IDENTIFIED);
  530. particle->SetClassifyId(itm->GetID());
  531. particle->SetColor(itm->GetColor());
  532. particle->SetClassifyName(itm->GetName());
  533. particle->SetHardness(itm->GetHardness());
  534. particle->SetDensity(itm->GetDensity());
  535. particle->SetConductivity(itm->GetElectrical_conductivity());
  536. particle->SetGroupId(itm->GetGrpID());
  537. particle->SetGroupColor(itm->GetGrpColor());
  538. particle->SetGroupName(itm->GetGrpName());
  539. break;
  540. }
  541. }
  542. }
  543. return true;
  544. }
  545. bool ExpressionClassifyEngine::ClassifyIncA(COTSParticlePtr particle, int SteelTech, CPosXrayPtr xray)
  546. {
  547. return false;
  548. }
  549. OTSClassifyEngine::CLEEnginePtr GetParticleEngine(std::string a_libName)
  550. {
  551. static CLEEnginePtr engine;
  552. static std::string libName="";
  553. if (engine == NULL || libName != a_libName)
  554. {
  555. engine = CLEEnginePtr(new ExpressionClassifyEngine(a_libName));
  556. libName = a_libName;
  557. engine->Init();
  558. }
  559. return engine;
  560. }
  561. }