CSDN博客

img casularm

接口定义

发表于2004/10/6 21:53:00  937人阅读

        根据以上分析,命令和状态的操作是分开的,并且在命令发送完后,如果命令被接受执行,则状态会不断的返回给OCS(其中有一部分状态是全局的,需要始终返回给OCS)。同时考虑到对子系统的同步请求,以及一些数据的不定长度,接口的数据结构修正为:

        enum CmdPriority {PRI_LOWER,PRI_NORMAL,PRI_HIGHER,PRI_HIGHEST,PRI_REALTIME };

        struct TheCommand
                {
                        string strCmdCUID;          //当前命令UID,格式为标准UID+”.”+”YYYYMMDD”
                                                                //+”.”+”HHMMSS”+”.”+流水号
                                                                //流水号可以是命令发送的计数,有OCS来分配
                        string strCmdParameter;   // 命令参数,以<命令><参数1><参数2>
                                                                //引号以内为一个参数
                        CmdPriority  cpPriority     //命令执行优先级
                        bool bSync                       //是否为同步请求
                }

   命令的返回结构
  
        typedef string CmdResult;                  
//同步命令返回的结果
                                                                 //异步命令返回代码,”0”表示命令被接受
                                                                //其他表示错误代码(待定义)

        enum Severity {Info, Warning, Error, FatalError};

        struct TheStatus
                {
                        string strRelatedCmdCUID;      //状态的相关命令UID,定义同上
                                                                      //如果没有相关命令,则此值为“0”
                        string strStatusCUID;              //当前状态UID,格式为标准UID+”.”
                                                                      //+”YYYYMMDD” +”.”+”HHMMSS”
                        Severity eSeverity;                  //状态的程度
                        string strStatusAttribute;          // 状态属性以<属性1><属性2><属性3>
                        bool bExeStatus;                    //是否为执行反馈信息
                                                                      //如果为执行反馈信息,则strStatusUID记录
                                                                      //执行反馈信息返回的时间,格式为:
                                                                      //”YYYYMMDD” +”.”+”HHMMSS”;
                                                                      //执行反馈信息填在strStatusAttribute中
                                                                      //执行反馈信息状态为”ACTIVE”时,同时可反馈
                                                                      //执行的进度,以百分比记;忽略eSeverity。
                }
               
        此结构作为状态通讯的基本单位,进行状态通讯。

        对于命令执行优先级,定义如下:
        PRI_LOWER                        低
        PRI_NORMAL                      普通
        PRI_HIGHER                       高
        PRI_HIGHEST                     更高
        PRI_REALTIME                    实时(最高)

IDL 文件

sss.idl

#pragma prefix "lamost.ustc"
  module SSS{

        enum CmdPriority {PRI_LOWER,PRI_NORMAL,PRI_HIGHER,PRI_HIGHEST,PRI_REALTIME};
       
        struct TheCommand
        {
                string strCmdCUID;
                string strCmdParameter;
                CmdPriority cpPriority;
                boolean bSync;
        };

        typedef string TheCmdResult;
        typedef string TheXMLCommand;
        typedef string TheXMLCmdResult;

        interface SSS_CMD_Server
        {
                void SendCommand(in TheCommand cmdData,out TheCmdResult resultData);
                void SendCommandByXML(in TheXMLCommand cmdData,out TheXMLCmdResult resultData);
        };
};


status.idl

#pragma prefix "lamost.ustc"

module OCS {
        enum Severity {Info,Warning,Error,FatalError};

        struct TheStatus
        {
                string strRelatedCmdCUID;
                string strStatusCUID;
                Severity eSeverity;
                string strStatusAttribute;
                boolean bExeStatus;
        };

        interface Status_Server
        {
                void SendStatus(in TheStatus statusData);
                void SendStatusByXML(in string xmlStatusData);
        };
};

 

0 0

相关博文

我的热门文章

img
取 消
img