Exemple #1
0
        /// <summary>
        /// Cell運転操作要求
        /// </summary>
        /// <param name="opeType"></param>
        /// <returns></returns>
        public bool ReqOperation(CellOperationType.eType opeType)
        {
            bool ret = false;

            if (this._operationNotifyCtrl == null)
            {
                this._operationNotifyCtrl         = new OperationNotifyCtrl();
                this._operationNotifyCtrl.opeType = opeType;

                ret = true;
            }

            return(ret);
        }
Exemple #2
0
        /// <summary>
        /// Cell運転操作要求処理
        /// </summary>
        /// <param name="opeType"></param>
        /// <returns></returns>
        public void OperationProc()
        {
            switch (this._operationNotifyCtrl.notifyStatus)
            {
            case OperationNotifyCtrl.eStatus.Init:
                // 初期処理
                this._operationNotifyCtrl.notifyStatus = OperationNotifyCtrl.eStatus.SendOperation;
                break;

            case OperationNotifyCtrl.eStatus.SendOperation:
                // Cell運転操作要求
                this._operationNotifyCtrl.operationMsg         = new CellMonTabMsgGetOperation();
                this._operationNotifyCtrl.operationMsg.opeType = this._operationNotifyCtrl.opeType;

                Console.WriteLine("Cell運転操作要求送信");
                // Cell運転操作要求メッセージ送信
                if (true == this._cellMonTabMsgCtrl.SendMessage(this._operationNotifyCtrl.operationMsg))
                {
                    this._operationNotifyCtrl.notifyStatus = OperationNotifyCtrl.eStatus.WaitResponse;
                }
                break;

            case OperationNotifyCtrl.eStatus.WaitResponse:
                // Cell運転操作要求応答待ち
                if (this._operationNotifyCtrl.operationMsg.SendStatus == CellMonTabMessage.eSendStatus.SendNg)
                {
                    // 送信失敗
                    this._operationNotifyCtrl.operationMsg = null;
                    this._operationNotifyCtrl.notifyStatus = OperationNotifyCtrl.eStatus.Error;
                }
                else if (this._operationNotifyCtrl.ResError != CellMonTabMsgError.eCmdError.None)
                {
                    // 異常応答
                    this._operationNotifyCtrl.operationMsg = null;
                    this._operationNotifyCtrl.notifyStatus = OperationNotifyCtrl.eStatus.Error;
                }
                else if (this._operationNotifyCtrl.operationMsg.SendStatus == CellMonTabMessage.eSendStatus.RecvRes)
                {
                    // 応答受信
                    this._operationNotifyCtrl.operationMsg = null;
                    this._operationNotifyCtrl.notifyStatus = OperationNotifyCtrl.eStatus.Complete;
                }
                break;

            case OperationNotifyCtrl.eStatus.Complete:

                //  ソケット通信エラー(正常)を設定
                Mocs.Utils.CommonUtil.SetLastSocketError(0);
                // Cell運転操作要求完了
                this._operationNotifyCtrl = null;
                break;

            case OperationNotifyCtrl.eStatus.Error:

                //  ソケット通信エラーを設定
                Mocs.Utils.CommonUtil.SetLastSocketError((int)this._operationNotifyCtrl.notifyStatus);
                // Cell運転操作要求異常
                this._operationNotifyCtrl = null;
                break;

            default:
                break;
            }
        }