Ejemplo n.º 1
0
        //Handling event capture from MCS component
        #region IReceiveMsg Members

        public void OnMsg(int MsgID, string MsgType, string MsgValue, string MsgGroup, string Sender, string SenderGroup, string Receiver, DateTime Timestamp)
        {
            LogInfoController.AddLogInfo(LogInfoLevelEnum.Debug, "Into OnMsg, MsgValue = " + MsgValue, SessionInfo.LoginName, this.GetType().ToString() + "->" + "OnMsg()", SessionInfo.ExperimentID);

            if (onReceiveError != null)
            {
                onReceiveError();
            }

            string m_OriginMsgGUID = "";

            // create instance of XmlMsgBase and parse MsgValue content
            EVOApiErrorMsg.XmlMsgBase msgBase = new EVOApiErrorMsg.XmlMsgBase("", MsgValue);
            // save MsgGUID for response message (required since EVOApiErrorMessage V2.2.0.2)
            //m_OriginMsgGUID = msgBase.MsgGUID;
            System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
            xmlDoc.LoadXml(MsgValue);
            System.Xml.XmlNode node = xmlDoc.SelectSingleNode("/*/Header/MsgID");
            if (null != node)
            {
                m_OriginMsgGUID = node.InnerText;
            }

            //Get Message type in order to create correct message object to access to the error member
            XmlMsgType msgType;

            msgType = (XmlMsgType)Enum.Parse(typeof(XmlMsgType), MsgType);
            switch (msgType)
            {
            case (XmlMsgType.MST_DetectError):
                XmlMsgDetectError msgDetect = new XmlMsgDetectError(MsgValue);
                msgDetect.ParsingXmlContent();
                EVOErrorBox.MsgDetectError detectError = new EVOErrorBox.MsgDetectError(msgDetect);
                detectError.ShowDialog();
                SendRespons(m_OriginMsgGUID, detectError.ErrorResponse);
                break;

            //the clot error message has no content
            case (XmlMsgType.MST_ClotError):
                XmlMsgClotError msgClotError = new XmlMsgClotError(MsgValue);
                msgClotError.ParsingXmlContent();
                EVOErrorBox.ClotError clotError = new EVOErrorBox.ClotError(msgClotError);
                clotError.ShowDialog();
                SendRespons(m_OriginMsgGUID, clotError.ErrorResponse);
                break;

            case (XmlMsgType.MST_DiluterCheckError):
                XmlMsgDiluterCheckError msg = new XmlMsgDiluterCheckError(MsgValue);
                msg.ParsingXmlContent();
                EVOErrorBox.DiluterCheckError dulterCheckError = new EVOErrorBox.DiluterCheckError(msg);
                dulterCheckError.ShowDialog();
                SendRespons(m_OriginMsgGUID, dulterCheckError.ErrorResponse);
                break;

            case (XmlMsgType.MST_DiTiFetchError):
                XmlMsgDiTiFetchError msgDiTiFetch = new XmlMsgDiTiFetchError(MsgValue);
                msgDiTiFetch.ParsingXmlContent();
                EVOErrorBox.DiTiFetchError diTiFetchError = new EVOErrorBox.DiTiFetchError(msgDiTiFetch);
                diTiFetchError.ShowDialog();
                SendRespons(m_OriginMsgGUID, diTiFetchError.ErrorResponse);
                break;

            case (XmlMsgType.MST_DiTiNotMountedError):
                XmlMsgDiTiNotMountedError msgditiNotMount = new XmlMsgDiTiNotMountedError(MsgValue);
                msgditiNotMount.ParsingXmlContent();
                EVOErrorBox.DiTiNotMountedError ditiNotMount = new EVOErrorBox.DiTiNotMountedError(msgditiNotMount);
                ditiNotMount.ShowDialog();
                SendRespons(m_OriginMsgGUID, ditiNotMount.ErrorResponse);
                break;

            case (XmlMsgType.MST_DiTiLostError):
                XmlMsgDiTiLostError msgditiLost = new XmlMsgDiTiLostError(MsgValue);
                msgditiLost.ParsingXmlContent();
                EVOErrorBox.DiTiLostError ditiLost = new EVOErrorBox.DiTiLostError(msgditiLost);
                ditiLost.ShowDialog();
                SendRespons(m_OriginMsgGUID, ditiLost.ErrorResponse);
                break;

            case (XmlMsgType.MST_DiTiMountedError):
                XmlMsgDiTiMountedError msgDitiMount = new XmlMsgDiTiMountedError(MsgValue);
                msgDitiMount.ParsingXmlContent();
                EVOErrorBox.DiTiMountedError DitiMount = new EVOErrorBox.DiTiMountedError(msgDitiMount);
                DitiMount.ShowDialog();
                SendRespons(m_OriginMsgGUID, DitiMount.ErrorResponse);
                break;

            case (XmlMsgType.MST_MessageBox):
                XmlMsgMessageBox msgMB = new XmlMsgMessageBox(MsgValue);
                msgMB.ParsingXmlContent();
                if (msgMB.errorPrompt.Contains("Evoware switches to offline mode and aborts script"))
                {
                    EVOOffline = true;
                    if (onOfflineStatus != null)
                    {
                        onOfflineStatus();
                    }
                }

                EVOErrorBox.MsgMessageBox messageBox = new EVOErrorBox.MsgMessageBox(msgMB);
                messageBox.ShowDialog();
                if (msgMB.errorPrompt.Contains("No connection to the instrument"))
                {
                    if (messageBox.ErrorResponse == ErrorResponseOption.DLG_NO)
                    {
                        EVOOffline = true;
                        if (onOfflineStatus != null)
                        {
                            onOfflineStatus();
                        }
                    }
                    else
                    {
                        isNoConnection = true;
                    }
                }
                SendRespons(m_OriginMsgGUID, messageBox.ErrorResponse);
                break;

            case (XmlMsgType.MST_DoorLockError):
                XmlMsgDoorLockError msgDoorLockError = new XmlMsgDoorLockError(MsgValue);
                msgDoorLockError.ParsingXmlContent();
                EVOErrorBox.DoorLockError doorLockError = new EVOErrorBox.DoorLockError(msgDoorLockError);
                doorLockError.ShowDialog();
                SendRespons(m_OriginMsgGUID, doorLockError.ErrorResponse);
                break;

            case (XmlMsgType.MST_GripError):
                XmlMsgGripError msgGripError = new XmlMsgGripError(MsgValue);
                msgGripError.ParsingXmlContent();
                EVOErrorBox.GripError gripError = new EVOErrorBox.GripError(msgGripError);
                gripError.ShowDialog();
                SendRespons(m_OriginMsgGUID, gripError.ErrorResponse);
                break;

            default:
                SendRespons(m_OriginMsgGUID, ErrorResponseOption.NONE);
                break;
                //All other message type here
            }
        }
Ejemplo n.º 2
0
        public DiTiMountedError(XmlMsgDiTiMountedError msg)
        {
            InitializeComponent();
            _msg = msg;

            string    ditiStatus = _msg.DiTiStatus;
            DataTable datatable  = new DataTable();

            datatable.Columns.Add("tip", typeof(int));
            datatable.Columns.Add("status", typeof(string));
            datatable.Columns.Add("statusChn", typeof(string));

            string[] ditiStatus_s = ditiStatus.Split(';');
            int      maxTip       = 0;

            if (ditiStatus_s.Count() > 0)
            {
                foreach (string _ditiStatus in ditiStatus_s)
                {
                    string[] oneditiStatus_s = _ditiStatus.Split(',');
                    if (oneditiStatus_s.Count() != 2)
                    {
                        continue;
                    }

                    System.Data.DataRow dRow = datatable.NewRow();
                    dRow["tip"]    = int.Parse(oneditiStatus_s[0]);
                    maxTip         = int.Parse(oneditiStatus_s[0]);
                    dRow["status"] = oneditiStatus_s[1];
                    string status    = oneditiStatus_s[1];
                    string statusChn = string.Empty;
                    if (!string.IsNullOrEmpty(status) && status.Contains("DiTi already mounted"))
                    {
                        statusChn = WanTai.Common.Resources.WanTaiResource.DiTialreadymounted;
                    }
                    else if (!string.IsNullOrEmpty(status) && status.Contains("OK / automatic handling"))
                    {
                        statusChn = WanTai.Common.Resources.WanTaiResource.OKautomatichandling;
                    }

                    dRow["statusChn"] = statusChn;
                    datatable.Rows.Add(dRow);
                }
            }

            if (maxTip < 8)
            {
                for (int i = maxTip + 1; i < 9; i++)
                {
                    System.Data.DataRow dRow = datatable.NewRow();
                    dRow["tip"]       = i;
                    dRow["statusChn"] = string.Empty;
                    dRow["status"]    = string.Empty;
                    datatable.Rows.Add(dRow);
                }
            }

            this.dataGridView1.DataSource = datatable;

            btnDiTiContPipetNone.Text     = WanTai.Common.Resources.WanTaiResource.btnDiTiContPipetNone;
            btnRetrySameSpot.Text         = WanTai.Common.Resources.WanTaiResource.RetryAtSamePosition;
            btnEjectThenMountNewDiTi.Text = WanTai.Common.Resources.WanTaiResource.btnEjectThenMountNewDiTi;
            btnAbort.Text = WanTai.Common.Resources.WanTaiResource.btnAbort;
        }