示例#1
0
        public ReportStatus(ReportStatus value)
        {
            /// Initiliaze the protected variables
            m_MsgHeader = new MsgHeader();
            m_Body = new Body();
            m_IsCommand = false;

            /// Copy the values
            m_MsgHeader = value.m_MsgHeader;
            m_Body = value.m_Body;
        }
示例#2
0
 public bool  notEquals(ReportStatus value)
 {
     return(!this.isEqual(value));
 }
示例#3
0
        public ReportStatus setAs(ReportStatus value)
        {
            m_MsgHeader = value.m_MsgHeader;
            m_Body = value.m_Body;

            return this;
        }
示例#4
0
 public bool notEquals(ReportStatus value)
 {
     return !this.isEqual(value);
 }
示例#5
0
        public bool isEqual(ReportStatus value)
        {
            if (!this.getMsgHeader().isEqual(value.getMsgHeader()))
            {
            return false;
            }
            if (!this.getBody().isEqual(value.getBody()))
            {
            return false;
            }

            return true;
        }
        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);
            }
        }