command_manager.cpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. //
  2. // Created by zx on 2020/7/14.
  3. //
  4. #include <sstream>
  5. #include <iomanip>
  6. #include <parkspace_excutor.h>
  7. #include "command_manager.h"
  8. #include "StoreProcessTask.h"
  9. #include "PickupProcessTask.h"
  10. #include "command_accepter.h"
  11. Command_manager::Command_manager()
  12. :m_thread_queue_process(nullptr)
  13. ,m_system_paused(false)
  14. ,m_publish_statu_thread(nullptr)
  15. {
  16. }
  17. Command_manager::~Command_manager()
  18. {
  19. //等待线程池完成
  20. if(m_thread_queue_process!=nullptr) {
  21. m_thread_queue_process->WaitForFinish();
  22. m_thread_queue_process->Stop();
  23. }
  24. //退出发布线程
  25. m_publish_exit_condition.set_pass_ever(true);
  26. if(m_publish_statu_thread!= nullptr)
  27. {
  28. if(m_publish_statu_thread->joinable())
  29. {
  30. m_publish_statu_thread->join();
  31. }
  32. delete m_publish_statu_thread;
  33. m_publish_statu_thread=nullptr;
  34. }
  35. }
  36. Error_manager Command_manager::init(setting::System_setting system_setting) {
  37. /*
  38. * 检查参数
  39. */
  40. if (system_setting.has_bind_ip() == false || system_setting.has_entrance_num() == false
  41. || system_setting.has_export_num() == false) {
  42. return Error_manager(ERROR, MAJOR_ERROR, "系统配置错误");
  43. }
  44. if (system_setting.entrance_num() < 0 || system_setting.export_num() < 0) {
  45. return Error_manager(ERROR, MAJOR_ERROR, "系统配置出入口数量错误");
  46. }
  47. //初始化出入口状态为 Enable
  48. m_input_entrance_paused.resize(system_setting.entrance_num());
  49. for(int i=0;i<system_setting.entrance_num();++i)
  50. m_input_entrance_paused[i]=false;
  51. m_output_entrance_paused.resize(system_setting.export_num());
  52. for(int i=0;i<system_setting.export_num();++i)
  53. m_output_entrance_paused[i]=false;
  54. //创建线程池
  55. if (m_thread_queue_process == nullptr) {
  56. m_thread_queue_process = tq::TQFactory::CreateDefaultQueue();
  57. m_thread_queue_process->Start(48);
  58. }
  59. /*
  60. * 此处添加等待各个通讯模块正常代码
  61. */
  62. std::chrono::system_clock::time_point t_start=std::chrono::system_clock::now();
  63. std::chrono::system_clock::time_point t_end=std::chrono::system_clock::now();
  64. /*Error_manager parkspace_code=ERROR;
  65. LOG(INFO)<<"初始化车位管理模块...";
  66. do
  67. {
  68. if (parkspace_code != SUCCESS) {
  69. parkspace_code = Parkspace_excutor::get_instance_pointer()->check_statu();
  70. LOG_IF(INFO, parkspace_code == SUCCESS) << "车位管理模块初始化完成!!!";
  71. }
  72. if(parkspace_code==SUCCESS)
  73. break;
  74. t_end=std::chrono::system_clock::now();
  75. usleep(1000*100);
  76. }while(t_end-t_start<std::chrono::seconds(300));
  77. LOG_IF(ERROR,parkspace_code!=SUCCESS)<<"车位管理节点连接超时";
  78. if(parkspace_code!=SUCCESS)
  79. {
  80. return Error_manager(ERROR,MAJOR_ERROR,"车位管理模块初始化超时");
  81. }
  82. //检查节点并创建停取车流程
  83. for(int i=0;i<system_setting.entrance_num();++i)
  84. {
  85. //
  86. // 检查入口 i 的各个节点状态
  87. //
  88. LOG(INFO)<<"初始化停车入口:"<<i<<" 测量及调度模块...";
  89. Error_manager locate_code=ERROR,dispatch_code=ERROR;
  90. do {
  91. if (locate_code != SUCCESS) {
  92. locate_code = Measure_excutor::get_instance_pointer()->check_statu(i);
  93. LOG_IF(INFO, locate_code == SUCCESS) << "停车入口:"<<i<<" 测量模块初始化完成!!!";
  94. }
  95. if (dispatch_code != SUCCESS) {
  96. dispatch_code = Dispatch_excutor::get_instance_pointer()->check_entrance_statu(i);
  97. LOG_IF(INFO, dispatch_code == SUCCESS) << "停车入口:"<<i<<" 调度模块初始化完成!!!";
  98. }
  99. t_end=std::chrono::system_clock::now();
  100. if (locate_code == SUCCESS && dispatch_code == SUCCESS)
  101. break;
  102. usleep(1000*100);
  103. }while(t_end-t_start<std::chrono::seconds(300));
  104. LOG_IF(ERROR,locate_code!=SUCCESS||dispatch_code!=SUCCESS)<<"停车口:"<<i<<" 测量/调度节点连接超时";
  105. if(locate_code!=SUCCESS||dispatch_code!=SUCCESS)
  106. {
  107. return Error_manager(ERROR,MAJOR_ERROR,"停车入口通讯节点初始化超时");
  108. }
  109. }
  110. for(int i=0;i<system_setting.export_num();++i)
  111. {
  112. LOG(INFO)<<"初始化取车出口:"<<i<<" 调度模块...";
  113. Error_manager dispatch_code=ERROR;
  114. do {
  115. if (dispatch_code != SUCCESS) {
  116. dispatch_code = Dispatch_excutor::get_instance_pointer()->check_export_statu(i);
  117. LOG_IF(INFO, dispatch_code == SUCCESS) << "取车出口:" << i << " 调度模块初始化完成!!!";
  118. }
  119. t_end = std::chrono::system_clock::now();
  120. if (dispatch_code == SUCCESS)
  121. break;
  122. usleep(1000*100);
  123. }while(t_end-t_start<std::chrono::seconds(300));
  124. LOG_IF(ERROR,dispatch_code!=SUCCESS)<<"取车出口:"<<i<<" 调度节点连接超时";
  125. if(dispatch_code!=SUCCESS)
  126. {
  127. return Error_manager(ERROR,MAJOR_ERROR,"取车出口通讯节点初始化超时");
  128. }
  129. }
  130. */
  131. m_system_setting=system_setting;
  132. /*
  133. * 创建发布线程
  134. */
  135. if(m_publish_statu_thread== nullptr)
  136. {
  137. m_publish_exit_condition.reset(false, false, false);
  138. m_publish_statu_thread=new std::thread(publish_statu_function,this);
  139. }
  140. return SUCCESS;
  141. }
  142. /*
  143. * 执行停车请求
  144. */
  145. Error_manager Command_manager::execute_store_command(const message::Store_command_request_msg& request)
  146. {
  147. message::Error_manager error_msg;
  148. message::Store_command_response_msg response;
  149. if (m_system_paused == true)
  150. {
  151. error_msg.set_error_code(PAUSE);
  152. error_msg.set_error_description("急停");
  153. response.mutable_code()->CopyFrom(error_msg);
  154. Communication_message msg;
  155. msg.reset(response.base_info(), response.SerializeAsString());
  156. Message_communicator::get_instance_pointer()->send_msg(&msg);
  157. return Error_manager(PAUSE, MINOR_ERROR, "急停");
  158. }
  159. //判断entrance是否开放
  160. if (request.terminal_id() < 0 || request.terminal_id() >= m_system_setting.entrance_num())
  161. {
  162. error_msg.set_error_code(ERROR);
  163. error_msg.set_error_description(" xxxx entrance id 设置错误");
  164. response.mutable_code()->CopyFrom(error_msg);
  165. return Error_manager(ERROR, MINOR_ERROR, " xxxxx entrance id 设置错误");
  166. }
  167. if (m_input_entrance_paused[request.terminal_id()] != false)
  168. {
  169. error_msg.set_error_code(ERROR);
  170. error_msg.set_error_description("中控entrance已停止使用");
  171. response.mutable_code()->CopyFrom(error_msg);
  172. Communication_message msg;
  173. msg.reset(response.base_info(), response.SerializeAsString());
  174. Message_communicator::get_instance_pointer()->send_msg(&msg);
  175. return Error_manager(ERROR, MINOR_ERROR, "中控entrance已停止使用");
  176. }
  177. message::Base_info base_info_response;
  178. base_info_response.set_msg_type(message::eStore_command_response_msg);
  179. base_info_response.set_sender(message::eMain);
  180. base_info_response.set_receiver(message::eTerminor);
  181. response.mutable_base_info()->CopyFrom(base_info_response);
  182. response.set_terminal_id(request.terminal_id());
  183. Error_manager code;
  184. if (request.base_info().msg_type() == message::eStore_command_request_msg
  185. && request.base_info().receiver() == message::eMain
  186. && request.base_info().sender() == message::eTerminor) {
  187. // LOG(WARNING) << request.DebugString();
  188. if (request.has_locate_information() && request.has_base_info())
  189. {
  190. message::Locate_information locate_info = request.locate_information();
  191. if (locate_info.has_locate_correct())
  192. {
  193. if (locate_info.locate_correct() == true)
  194. {
  195. if (locate_info.has_locate_width() && locate_info.has_locate_height()
  196. && locate_info.has_locate_x() && locate_info.has_locate_y()
  197. && locate_info.has_locate_angle() && locate_info.has_locate_wheel_base())
  198. {
  199. LOG(INFO) << "------ 停 ------- 收到停车,车牌:" << request.car_info().license() <<
  200. ",终端:" << request.terminal_id() << "............................";
  201. //check hardwared
  202. Error_manager parkspace_code = Parkspace_excutor::get_instance_pointer()->check_statu();
  203. Error_manager dispatch_code = Dispatch_excutor::get_instance_pointer()->check_entrance_statu(request.terminal_id());
  204. if(parkspace_code!=SUCCESS)
  205. {
  206. error_msg.set_error_code(parkspace_code.get_error_code());
  207. error_msg.set_error_description(parkspace_code.to_string());
  208. response.mutable_code()->CopyFrom(error_msg);
  209. LOG(ERROR) << "xxxx 创建停车流程失败:" << request.terminal_id() <<
  210. "车牌:" << request.car_info().license() << " " << parkspace_code.to_string();
  211. Communication_message msg;
  212. msg.reset(response.base_info(), response.SerializeAsString());
  213. Message_communicator::get_instance_pointer()->send_msg(&msg);
  214. return parkspace_code;
  215. }
  216. if(dispatch_code!=SUCCESS)
  217. {
  218. error_msg.set_error_code(dispatch_code.get_error_code());
  219. error_msg.set_error_description(dispatch_code.to_string());
  220. response.mutable_code()->CopyFrom(error_msg);
  221. LOG(ERROR) << "xxxx 创建停车流程失败:" << request.terminal_id() <<
  222. "车牌:" << request.car_info().license() << " " << dispatch_code.to_string();
  223. Communication_message msg;
  224. msg.reset(response.base_info(), response.SerializeAsString());
  225. Message_communicator::get_instance_pointer()->send_msg(&msg);
  226. return dispatch_code;
  227. }
  228. /*
  229. * 检查消息完毕,开始处理
  230. */
  231. Process_task *ptask = new StoreProcessTask(request.terminal_id(), request.car_info());
  232. StoreProcessTask *pStore_task = (StoreProcessTask *) ptask;
  233. //初始化流程
  234. code = pStore_task->init_task(locate_info);
  235. if (code != SUCCESS)
  236. {
  237. delete pStore_task;
  238. error_msg.set_error_code(code.get_error_code());
  239. error_msg.set_error_description(code.to_string());
  240. response.mutable_code()->CopyFrom(error_msg);
  241. LOG(ERROR) << "xxxx 创建停车流程失败(车位分配失败),终端:" << request.terminal_id() <<
  242. "车牌:" << request.car_info().license() << " " << code.to_string();
  243. Communication_message msg;
  244. msg.reset(response.base_info(), response.SerializeAsString());
  245. Message_communicator::get_instance_pointer()->send_msg(&msg);
  246. return code;
  247. }
  248. m_thread_queue_process->AddTask(pStore_task);
  249. return SUCCESS;
  250. }
  251. }
  252. }
  253. }
  254. error_msg.set_error_code(FAILED);
  255. error_msg.set_error_description("创建停车流程失败...指令缺少必要信息...");
  256. response.mutable_code()->CopyFrom(error_msg);
  257. Communication_message msg;
  258. msg.reset(response.base_info(), response.SerializeAsString());
  259. Message_communicator::get_instance_pointer()->send_msg(&msg);
  260. return Error_manager(FAILED, MINOR_ERROR, "创建停车流程失败...指令缺少必要信息...");
  261. } else {
  262. error_msg.set_error_code(INVALID_MESSAGE);
  263. error_msg.set_error_description("停车请求基本信息错误");
  264. response.mutable_code()->CopyFrom(error_msg);
  265. Communication_message msg;
  266. msg.reset(response.base_info(),response.SerializeAsString());
  267. Message_communicator::get_instance_pointer()->send_msg(&msg);
  268. return Error_manager(INVALID_MESSAGE, MAJOR_ERROR, "停车请求基本信息错误");
  269. }
  270. }
  271. /*
  272. * 执行取车请求
  273. */
  274. Error_manager Command_manager::execute_pickup_command(const message::Pickup_command_request_msg& request)
  275. {
  276. message::Error_manager error_msg;
  277. message::Pickup_command_response_msg response;
  278. message::Base_info base_info_response;
  279. base_info_response.set_msg_type(message::ePickup_command_response_msg);
  280. base_info_response.set_sender(message::eMain);
  281. base_info_response.set_receiver(message::eTerminor);
  282. response.mutable_base_info()->CopyFrom(base_info_response);
  283. response.set_terminal_id(request.terminal_id());
  284. if (m_thread_queue_process == nullptr)
  285. {
  286. error_msg.set_error_code(ERROR);
  287. error_msg.set_error_description(" xxxxx 中控bug,线程池未初始化");
  288. response.mutable_code()->CopyFrom(error_msg);
  289. Communication_message msg;
  290. msg.reset(response.base_info(), response.SerializeAsString());
  291. Message_communicator::get_instance_pointer()->send_msg(&msg);
  292. return Error_manager(ERROR, MINOR_ERROR, "线程池未初始化,bug");
  293. }
  294. if (m_system_paused == true)
  295. {
  296. error_msg.set_error_code(PAUSE);
  297. error_msg.set_error_description("急停");
  298. response.mutable_code()->CopyFrom(error_msg);
  299. Communication_message msg;
  300. msg.reset(response.base_info(), response.SerializeAsString());
  301. Message_communicator::get_instance_pointer()->send_msg(&msg);
  302. return Error_manager(PAUSE, MINOR_ERROR, "急停");
  303. }
  304. //判断出口是否开放
  305. if (request.terminal_id() < 0 || request.terminal_id() >= m_system_setting.export_num())
  306. {
  307. error_msg.set_error_code(ERROR);
  308. error_msg.set_error_description(" xxxx 出口 id 设置错误");
  309. response.mutable_code()->CopyFrom(error_msg);
  310. return Error_manager(ERROR, MINOR_ERROR, " xxxxx出口 id 设置错误");
  311. }
  312. if (m_output_entrance_paused[request.terminal_id()] != false)
  313. {
  314. error_msg.set_error_code(ERROR);
  315. error_msg.set_error_description("中控出口已停止使用");
  316. response.mutable_code()->CopyFrom(error_msg);
  317. Communication_message msg;
  318. msg.reset(response.base_info(), response.SerializeAsString());
  319. Message_communicator::get_instance_pointer()->send_msg(&msg);
  320. return Error_manager(ERROR, MINOR_ERROR, "中控出口已停止使用");
  321. }
  322. if (request.base_info().msg_type() == message::ePickup_command_request_msg
  323. && request.base_info().receiver() == message::eMain
  324. && request.base_info().sender() == message::eTerminor
  325. && request.has_car_info())
  326. {
  327. response.set_terminal_id(request.terminal_id());
  328. /*
  329. * 检查各个节点是否正常
  330. */
  331. Error_manager parkspace_code = Parkspace_excutor::get_instance_pointer()->check_statu();
  332. if (parkspace_code != SUCCESS)
  333. {
  334. error_msg.set_error_code(parkspace_code.get_error_code());
  335. error_msg.set_error_description(parkspace_code.get_error_description());
  336. response.mutable_code()->CopyFrom(error_msg);
  337. Communication_message msg;
  338. msg.reset(response.base_info(), response.SerializeAsString());
  339. Message_communicator::get_instance_pointer()->send_msg(&msg);
  340. return parkspace_code;
  341. }
  342. Error_manager dispatch_code = Dispatch_excutor::get_instance_pointer()->check_export_statu(request.terminal_id());
  343. if (dispatch_code != SUCCESS)
  344. {
  345. error_msg.set_error_code(dispatch_code.get_error_code());
  346. error_msg.set_error_description(dispatch_code.get_error_description());
  347. response.mutable_code()->CopyFrom(error_msg);
  348. Communication_message msg;
  349. msg.reset(response.base_info(), response.SerializeAsString());
  350. Message_communicator::get_instance_pointer()->send_msg(&msg);
  351. return dispatch_code;
  352. }
  353. //一切正常,接受指令
  354. Error_manager code;
  355. LOG(WARNING) << "--------- 取 -------收到取车-----------------------------" << request.car_info().license();
  356. Process_task *ptask = new PickupProcessTask(request.terminal_id(), request.car_info());
  357. PickupProcessTask *pPick_task = (PickupProcessTask *) ptask;
  358. //初始化流程
  359. code = pPick_task->init_task(request);
  360. if (code == SUCCESS)
  361. {
  362. m_thread_queue_process->AddTask(pPick_task);
  363. return SUCCESS;
  364. }
  365. error_msg.set_error_code(code.get_error_code());
  366. error_msg.set_error_description(code.to_string());
  367. response.mutable_code()->CopyFrom(error_msg);
  368. LOG(ERROR) << "创建取车流程失败(车位查询失败),终端:" << request.terminal_id() <<
  369. "车牌:" << request.car_info().license() << " " << code.to_string();
  370. delete pPick_task;
  371. Communication_message msg;
  372. msg.reset(response.base_info(), response.SerializeAsString());
  373. Message_communicator::get_instance_pointer()->send_msg(&msg);
  374. return code;
  375. }
  376. else
  377. {
  378. error_msg.set_error_code(INVALID_MESSAGE);
  379. error_msg.set_error_description("停车请求信息错误");
  380. response.mutable_code()->CopyFrom(error_msg);
  381. Communication_message msg;
  382. msg.reset(response.base_info(), response.SerializeAsString());
  383. Message_communicator::get_instance_pointer()->send_msg(&msg);
  384. return Error_manager(INVALID_MESSAGE, MAJOR_ERROR, "停车请求信息错误");
  385. }
  386. }
  387. /*
  388. * 控制入口 开放或者关闭
  389. */
  390. Error_manager Command_manager::pause_entrance(int terminal_id,bool paused)
  391. {
  392. if(terminal_id<0 || terminal_id>m_system_setting.entrance_num())
  393. return Error_manager(ERROR,MINOR_ERROR,"xxxx");
  394. m_input_entrance_paused[terminal_id]=paused;
  395. return SUCCESS;
  396. }
  397. message::Entrance_statu Command_manager::entrance_statu(int terminal_id)
  398. {
  399. message::Entrance_statu entrance_statu;
  400. if(terminal_id<0 || terminal_id>=m_system_setting.entrance_num())
  401. return entrance_statu;
  402. message::Module_statu statu=message::eConnected;
  403. Error_manager code=Parkspace_excutor::get_instance_pointer()->check_statu();
  404. statu=(code==SUCCESS)?message::eConnected:message::eFault;
  405. entrance_statu.set_parkspace_statu(statu);
  406. code=Dispatch_excutor::get_instance_pointer()->check_entrance_statu(terminal_id);
  407. if (code==ERROR) statu=message::eFault;
  408. if(code==DISCONNECT) statu=message::eDisconnected;
  409. entrance_statu.set_dispatch_statu(statu);
  410. entrance_statu.set_paused(m_input_entrance_paused[terminal_id]);
  411. return entrance_statu;
  412. }
  413. message::Entrance_statu Command_manager::export_statu(int terminal_id)
  414. {
  415. message::Entrance_statu entrance_statu;
  416. if(terminal_id<0 || terminal_id>=m_system_setting.export_num())
  417. return entrance_statu;
  418. message::Module_statu statu=message::eConnected;
  419. Error_manager code=Parkspace_excutor::get_instance_pointer()->check_statu();
  420. statu=(code==SUCCESS)?message::eConnected:message::eFault;
  421. entrance_statu.set_parkspace_statu(statu);
  422. code=Dispatch_excutor::get_instance_pointer()->check_entrance_statu(terminal_id);
  423. if (code==ERROR) statu=message::eFault;
  424. if(code==DISCONNECT) statu=message::eDisconnected;
  425. entrance_statu.set_dispatch_statu(statu);
  426. entrance_statu.set_paused(m_output_entrance_paused[terminal_id]);
  427. return entrance_statu;
  428. }
  429. /*
  430. * 控制出口 开放或者关闭
  431. */
  432. Error_manager Command_manager::pause_export(int terminal_id,bool paused)
  433. {
  434. if(terminal_id<0 || terminal_id>m_system_setting.export_num())
  435. return Error_manager(ERROR,MINOR_ERROR,"xxxx");
  436. m_output_entrance_paused[terminal_id]=paused;
  437. return SUCCESS;
  438. }
  439. /*
  440. * pause,系统急停
  441. */
  442. void Command_manager::pause_system()
  443. {
  444. m_system_paused=true;
  445. }
  446. void Command_manager::publish_statu_function(Command_manager* commander)
  447. {
  448. if(commander== nullptr)
  449. return ;
  450. commander->publish_statu();
  451. }
  452. void Command_manager::publish_statu()
  453. {
  454. while(m_publish_exit_condition.wait_for_millisecond(100)==false)
  455. {
  456. message::Central_controller_statu_msg msg;
  457. message::Base_info baseInfo;
  458. baseInfo.set_msg_type(message::eCentral_controller_statu_msg);
  459. baseInfo.set_sender(message::eMain);
  460. baseInfo.set_receiver(message::eEmpty);
  461. msg.mutable_base_info()->CopyFrom(baseInfo);
  462. for(int i=0;i<m_system_setting.entrance_num();++i)
  463. {
  464. message::Entrance_statu* entrance_statu=msg.mutable_entrance_statu_vector()->Add();;
  465. message::Module_statu statu=message::eConnected;
  466. Error_manager code=Parkspace_excutor::get_instance_pointer()->check_statu();
  467. statu=(code==SUCCESS)?message::eConnected:message::eFault;
  468. entrance_statu->set_parkspace_statu(statu);
  469. code=Dispatch_excutor::get_instance_pointer()->check_entrance_statu(i);
  470. statu=(code==SUCCESS)?message::eConnected:message::eFault;
  471. if(code==DISCONNECT) statu=message::eDisconnected;
  472. entrance_statu->set_dispatch_statu(statu);
  473. entrance_statu->set_paused(m_input_entrance_paused[i]);
  474. }
  475. for(int i=0;i<m_system_setting.export_num();++i)
  476. {
  477. message::Entrance_statu* entrance_statu=msg.mutable_export_statu_vector()->Add();
  478. message::Module_statu statu=message::eConnected;
  479. Error_manager code=Parkspace_excutor::get_instance_pointer()->check_statu();
  480. statu=(code==SUCCESS)?message::eConnected:message::eFault;
  481. entrance_statu->set_parkspace_statu(statu);
  482. code=Dispatch_excutor::get_instance_pointer()->check_export_statu(i);
  483. statu=(code==SUCCESS)?message::eConnected:message::eFault;
  484. if(code==DISCONNECT) statu=message::eDisconnected;
  485. entrance_statu->set_dispatch_statu(statu);
  486. entrance_statu->set_paused(m_output_entrance_paused[i]);
  487. }
  488. Command_accepter::get_instance_pointer()->post_central_statu(msg);
  489. //std::cout<<" 123 \n "<<msg.DebugString()<<std::endl;
  490. }
  491. }