Ejemplo n.º 1
0
        public ClotError(XmlMsgClotError clotError)
        {
            InitializeComponent();
            _clotError = clotError;

            string    tipStatus = _clotError.tipStatus;
            DataTable datatable = new DataTable();

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

            string[] tipStatus_s = tipStatus.Split(';');
            if (tipStatus_s.Count() > 0)
            {
                foreach (string _tipStatus in tipStatus_s)
                {
                    string[] oneTipStatus_s = _tipStatus.Split(',');
                    if (oneTipStatus_s.Count() != 2)
                    {
                        continue;
                    }

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

                    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;

            btnDispenseRetry.Text     = WanTai.Common.Resources.WanTaiResource.btnDispenseRetry;
            btnDispensePipetNone.Text = WanTai.Common.Resources.WanTaiResource.btnDispensePipetNone;
            btnGoWithClot.Text        = WanTai.Common.Resources.WanTaiResource.btnGoWithClot;
            btnContinueIgnore.Text    = WanTai.Common.Resources.WanTaiResource.btnContinueIgnore;
        }
Ejemplo n.º 2
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
            }
        }