HM-SPMS/product/src/application/sequence_server/PredifineForSeqServer.h

129 lines
2.6 KiB
C
Raw Normal View History

#pragma once
/*!
* @breif
*
* @author sjq
* @date 2018
*/
#include <string>
#include "common/DataType.h"
static const std::string SEQUENCE_PROCESSNAME = "sequence_server";
static const std::string CONFING_IS_CREATE_ALARM = "isGenAlarmToOpt";
static const std::string CONFING_UI_TIMER_TO_SEND_SECONDS = "UiTimerToSendSeconds";
//顺控操作类型
enum ESeqCtrl_HmiOpType
{
OP_SEQ_START = 0,//顺控开始
OP_SEQ_STOP = 1,//顺控终止
OP_SEQ_PAUSE = 2,//暂停
OP_SEQ_CONTINUE = 3,//继续
OP_SES_START = 4,//单步开始
OP_SES_CONTINUE = 5,//单步继续
};
//顺控执行状态
enum ESeqCtrl_NodeState
{
SEQ_RESTING_STATUS = 0, /*未执行 */
SEQ_RUNNING_STATUS = 1,/* 正在执行 */
SEQ_TRIGGERED_STATUS = 2,/* 已触发 */
SEQ_FAILED_STATUS = 3,/* 执行失败 */
SEQ_SUCCESS_STATUS = 4,/* 执行成功 */
SEQ_STOP_STATUS = 5,/* 执行终止 */
SEQ_PAUSE_STATUS = 6,/* 执行暂停 */
SEQ_SKIP_STATUS = 7,/* 执行跳过 */
};
enum ESeqCtrl_FailedActionType
{
//顺控动作失败处理
SEQ_ACT_FAILED_CONTINUE = 0,/* 跳过失败动作 */
SEQ_ACT_FAILED_HMI_CONTROL = 1,/* 人工干预 */
SEQ_ACT_FAILED_EXIT = 2,/* 终止 */
SEQ_ACT_FAILED_AUTO_RETRY = 3,/* 自动重做 */
};
//人工干预执行 操作 结果
enum UI_OP_RESULT_TYPE
{
UI_TYPE_INIT = 0,//初始化状态
UI_TYPE_RETYR = 1,//重试
UI_TYPE_STOP = 2,//终止
UI_TYPE_SKIP = 3,//跳过
};
//OPT 执行的操作结果
enum OPT_RESPONSE_TYPE
{
OPT_RESPONSE_TYPE_INIT,//还未返回
OPT_RESPONSE_TYPE_FAILED,//执行失败
OPT_RESPONSE_TYPE_SUCCESS,//执行成功
};
// 顺控执行者
struct SNodeSeqActor
{
int user_id;
int user_grounp_id;
std::string host_name;
std::string user_name;
};
//opt 操作结果
struct SOptResult
{
std::string keyTag;
OPT_RESPONSE_TYPE resultCode;
std::string resultDesc;
};
//hmi 操作 信息
struct SHmiOpInfo
{
ESeqCtrl_HmiOpType eResult;
SNodeSeqActor actor;
};
//人工干预
struct SOpResultUi
{
UI_OP_RESULT_TYPE eResult;
SNodeSeqActor actor;
};
/*! @brief 人工干预应答信息*/
struct SUiResultInfo
{
std::string seqName;
std::string funcName;
std::string actionName;
uint64 seqTimeFlag;
uint64 funcTimeFlag;
uint64 actionTimeFlag;
SOpResultUi result;
};
//动作执行错误信息
struct SActionErrorInfo
{
int nCode;
std::string erroStr;
SActionErrorInfo() :
nCode(0), erroStr()
{
};
SActionErrorInfo(int code, const std::string& str)
:nCode(code), erroStr(str)
{
};
};