command_manager.cpp 23 KB

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