コード例 #1
0
ファイル: ReportStatus.cs プロジェクト: winterjr/jaustoolset
        public bool  isEqual(ReportStatus value)
        {
            if (!this.getMsgHeader().isEqual(value.getMsgHeader()))
            {
                return(false);
            }
            if (!this.getBody().isEqual(value.getBody()))
            {
                return(false);
            }

            return(true);
        }
コード例 #2
0
        public virtual void SendAction(string arg0, Receive.Body.ReceiveRec transportData)
        {
            if (arg0.CompareTo("ReportStatus") == 0)
            {
                ReportStatus status_msg = new ReportStatus();

                // Get the state from the context.  Note that since we are inside a transition, the "current state"
                // is ill-defined.  We instead use the state we left to execute this transition.  Recall that the state
                // is actually an amalgamation of all parent states, we're only concerned with the management
                string currentState = context.PreviousState.Name; //getPreviousState().getName();
                if (currentState.Contains("_"))
                {
                    currentState = currentState.Substring(currentState.LastIndexOf("_") + 1);
                }
                if (currentState.CompareTo("Init") == 0)
                {
                    status_msg.getBody().getReportStatusRec().setStatus(0);
                }
                if (currentState.CompareTo("Ready") == 0)
                {
                    status_msg.getBody().getReportStatusRec().setStatus(1);
                }
                if (currentState.CompareTo("Standby") == 0)
                {
                    status_msg.getBody().getReportStatusRec().setStatus(2);
                }
                if (currentState.CompareTo("Shutdown") == 0)
                {
                    status_msg.getBody().getReportStatusRec().setStatus(3);
                }
                if (currentState.CompareTo("Failure") == 0)
                {
                    status_msg.getBody().getReportStatusRec().setStatus(4);
                }
                if (currentState.CompareTo("Emergency") == 0)
                {
                    status_msg.getBody().getReportStatusRec().setStatus(5);
                }

                Console.WriteLine("Sending ReportStatus: " + currentState);

                // Now send it to the requesting component
                JausAddress sender = new JausAddress((ushort)transportData.getSourceID().getSubsystemID(),
                                                     (byte)transportData.getSourceID().getNodeID(),
                                                     (byte)transportData.getSourceID().getComponentID());
                sendJausMessage(status_msg, sender);
            }
        }
コード例 #3
0
ファイル: ReportStatus.cs プロジェクト: nikola-v/jaustoolset
        public bool isEqual(ReportStatus value)
        {
            if (!this.getMsgHeader().isEqual(value.getMsgHeader()))
            {
            return false;
            }
            if (!this.getBody().isEqual(value.getBody()))
            {
            return false;
            }

            return true;
        }
コード例 #4
0
        public virtual void SendAction(string arg0, Receive.Body.ReceiveRec transportData)
        {
            if (arg0.CompareTo("ReportStatus") == 0)
            {
            ReportStatus status_msg = new ReportStatus();

            // Get the state from the context.  Note that since we are inside a transition, the "current state"
            // is ill-defined.  We instead use the state we left to execute this transition.  Recall that the state
            // is actually an amalgamation of all parent states, we're only concerned with the management
            string currentState = context.PreviousState.Name;  //getPreviousState().getName();
            if (currentState.Contains("_"))
            currentState = currentState.Substring(currentState.LastIndexOf("_") + 1);
            if (currentState.CompareTo("Init") == 0) status_msg.getBody().getReportStatusRec().setStatus(0);
            if (currentState.CompareTo("Ready") == 0) status_msg.getBody().getReportStatusRec().setStatus(1);
            if (currentState.CompareTo("Standby") == 0) status_msg.getBody().getReportStatusRec().setStatus(2);
            if (currentState.CompareTo("Shutdown") == 0) status_msg.getBody().getReportStatusRec().setStatus(3);
            if (currentState.CompareTo("Failure") == 0) status_msg.getBody().getReportStatusRec().setStatus(4);
            if (currentState.CompareTo("Emergency") == 0) status_msg.getBody().getReportStatusRec().setStatus(5);

            Console.WriteLine("Sending ReportStatus: " + currentState);

            // Now send it to the requesting component
            JausAddress sender = new JausAddress((ushort)transportData.getSourceID().getSubsystemID(),
                                               (byte)transportData.getSourceID().getNodeID(),
                                               (byte)transportData.getSourceID().getComponentID());
            sendJausMessage(status_msg, sender);
            }
        }