| 
									
										
										
										
											2024-11-24 00:58:06 +00:00
										 |  |  | //
 | 
					
						
							|  |  |  | // Created by matrixai on 10/26/24.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef TRAIN_CONTROLENGINE_H
 | 
					
						
							|  |  |  | #define TRAIN_CONTROLENGINE_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "AppCommon.h"
 | 
					
						
							|  |  |  | #include "EngineBase.h"
 | 
					
						
							|  |  |  | #include "EngineFactory.h"
 | 
					
						
							|  |  |  | #include "json/json.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace ai_matrix; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ControlEngine : public ai_matrix::EngineBase | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     ControlEngine(); | 
					
						
							|  |  |  |     ~ControlEngine(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     APP_ERROR Init() override; | 
					
						
							|  |  |  |     APP_ERROR DeInit() override; | 
					
						
							|  |  |  |     APP_ERROR Process() override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     std::string strPort0_; | 
					
						
							|  |  |  |     std::string strPort1_; | 
					
						
							|  |  |  |     std::string strPort2_; | 
					
						
							|  |  |  |     std::string strPort3_; | 
					
						
							|  |  |  |     std::string strPort4_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ai_matrix::BaseConfig baseConfig_; | 
					
						
							|  |  |  |     ai_matrix::IdentifyConfig identifyConfig_; | 
					
						
							|  |  |  |     std::vector<DataSourceConfig> vecDataSourceConfig_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     uint32_t iDetectNO_ = 1;  //动态检测数据编号
 | 
					
						
							|  |  |  |     std::map<int, uint32_t> mapDetectNO_; | 
					
						
							| 
									
										
										
										
											2025-02-13 10:43:42 +00:00
										 |  |  |     std::map<int, int> mapIdentifyType_; | 
					
						
							| 
									
										
										
										
											2024-11-24 00:58:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     std::string strDetectDate_; | 
					
						
							|  |  |  |     std::string strDetectTime_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     //参数初始化
 | 
					
						
							|  |  |  |     void initParam(); | 
					
						
							|  |  |  |     void endIdentify(int iDataSource); | 
					
						
							|  |  |  |     void sendWSEngine(std::string msg); | 
					
						
							|  |  |  |     void detectControl(std::shared_ptr<std::string> pWSServerOrder); | 
					
						
							| 
									
										
										
										
											2025-02-13 10:43:42 +00:00
										 |  |  |     bool isDetecting(); | 
					
						
							| 
									
										
										
										
											2024-11-24 00:58:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ENGINE_REGIST(ControlEngine) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif //TRAIN_CONTROLENGINE_H
 |