|
@@ -125,6 +125,25 @@ Error_manager System_executor::check_msg(Communication_message* p_msg)
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
+ case Communication_message::Message_type::eNotify_status_msg:
|
|
|
+ {
|
|
|
+ message::Notify_status_msg t_notify_status_msg;
|
|
|
+ //针对消息类型, 对消息进行二次解析
|
|
|
+ if (t_notify_status_msg.ParseFromString(p_msg->get_message_buf()))
|
|
|
+ {
|
|
|
+ if ( t_notify_status_msg.terminal_id() == Dispatch_manager::get_instance_references().get_dispatch_manager_id()*2 ||
|
|
|
+ t_notify_status_msg.terminal_id() == Dispatch_manager::get_instance_references().get_dispatch_manager_id()*2+1)
|
|
|
+ {
|
|
|
+ return Error_code::SUCCESS;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Error_manager(Error_code::SYSTEM_EXECUTOR_PARSE_ERROR, Error_level::MINOR_ERROR,
|
|
|
+ " message::Dispatch_request_msg ParseFromString error ");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
default :
|
|
|
;
|
|
|
break;
|
|
@@ -278,6 +297,23 @@ Error_manager System_executor::execute_msg(Communication_message* p_msg)
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
+ case Communication_message::Message_type::eNotify_status_msg:
|
|
|
+ {
|
|
|
+ message::Notify_status_msg t_notify_status_msg;
|
|
|
+ //针对消息类型, 对消息进行二次解析
|
|
|
+ if (t_notify_status_msg.ParseFromString(p_msg->get_message_buf()))
|
|
|
+ {
|
|
|
+ //往线程池添加执行任务, 之后会唤醒一个线程去执行他.
|
|
|
+ m_thread_pool.enqueue(&System_executor::execute_for_notify_status_msg, this,
|
|
|
+ t_notify_status_msg );
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Error_manager(Error_code::SYSTEM_EXECUTOR_PARSE_ERROR, Error_level::MINOR_ERROR,
|
|
|
+ " message::Dispatch_request_msg ParseFromString error ");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@@ -547,5 +583,16 @@ void System_executor::execute_for_terminal_status_msg(message::Terminal_status_m
|
|
|
return ;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+//调度模块 ///单片机的状态消息
|
|
|
+void System_executor::execute_for_notify_status_msg(message::Notify_status_msg notify_status_msg)
|
|
|
+{
|
|
|
+ Error_manager t_error;
|
|
|
+ t_error = Dispatch_manager::get_instance_references().execute_for_singlechip_data_msg(notify_status_msg.singlechipdata(), notify_status_msg.singlechip_validity());
|
|
|
+ if ( t_error != Error_code::SUCCESS )
|
|
|
+ {
|
|
|
+ LOG(INFO) << " System_executor::execute_for_singlechip_data_msg fun error "<< this;
|
|
|
+ LOG(INFO) << t_error.to_string() << " "<< this;
|
|
|
+ }
|
|
|
+ return ;
|
|
|
+}
|
|
|
|