//Case 981: 1.3.10_ImportImage_N01_WithNotification
        public void Run_Import_TestNotification_Case981()
        {
            int runCount = 0;
            string patientUID = string.Empty;
            bool isCreatePatient = false;
            bool isDeletePatient = false;
            string stopMessageType = "teststop";
            string stopMessageContent = "teststop";
            //LaunchNotification();

            NotificationSim.ReceiveNotification rn = new NotificationSim.ReceiveNotification();
            //NotificationSim.ReceiveNotification rn = new NotificationSim.ReceiveNotification("10.112.39.167");
            System.Collections.Generic.List<string> rms = new System.Collections.Generic.List<string>();
            rms.Add("topic.patientCreated");
            rms.Add("topic.acquisitionCompleted");
            rms.Add("topic.imageCreated");
            rms.Add("topic.presentationStateModified");
            rn.startListon(rms, stopMessageType, stopMessageContent);

            foreach (InputDataSet ids in this.Input.DataSets)
            {
                isCreatePatient = false;
                isDeletePatient = false;
                runCount++;
                Round r = this.NewRound(runCount.ToString(), "Import image");
                CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
                r.CheckPoints.Add(pCreate);
                PatientService ps = new PatientService();
                ImportService ims = new ImportService();
                ApplicationService ass = new ApplicationService();
                XMLParameter pa = new XMLParameter("patient");
                XMLParameter ia = new XMLParameter("import");
                for (int i = 0; i < ids.InputParameters.Count; i++)
                {
                    if (ids.InputParameters.GetParameter(i).Step == "create")
                    {
                        pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                        isCreatePatient = true;
                    }
                    if (ids.InputParameters.GetParameter(i).Step == "import")
                    {
                        ia.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                    }
                    if (ids.InputParameters.GetParameter(i).Step == "delete")
                    {
                        isDeletePatient = true;
                    }
                }
                if (isCreatePatient)
                {
                    XMLResult result = ps.createPatient(pa);
                    if (!result.IsErrorOccured)
                    {
                        patientUID = result.SingleResult;
                        pCreate.Result = TestResult.Pass;
                        pCreate.Outputs.AddParameter("create", "Create patient UID", patientUID);
                    }
                }
                System.Threading.Thread.Sleep(500);

                CheckPoint pImport = new CheckPoint("Import Image", "Test import");
                r.CheckPoints.Add(pImport);

                string filePath = string.Empty;
                string archivePath = string.Empty;
                for (int c = 0; c < ia.Length; c++)
                {
                    if (ia.GetParameterName(c) == "path")
                        filePath = ia.GetParameterValue(c);
                    if (ia.GetParameterName(c) == "archivepath")
                        archivePath = ia.GetParameterValue(c);
                }

                XMLResult rslImport = ims.importObject(patientUID, "", filePath, archivePath, true, "false");
                if (rslImport.IsErrorOccured)
                {
                    pImport.Result = TestResult.Fail;
                    pImport.Outputs.AddParameter("import", "Import image fail", rslImport.Message);
                    pImport.Outputs.AddParameter("import", "Import image error code", rslImport.Code.ToString());
                }
                else
                {
                    pImport.Result = TestResult.Pass;
                    pImport.Outputs.AddParameter("import", "Import image OK", rslImport.Message);
                }

                System.Threading.Thread.Sleep(500);
                ass.sendGenericNotification(stopMessageType, stopMessageContent);
                System.Threading.Thread.Sleep(500);

                int getn = rn.getNotificationNumber();

                CheckPoint pNotification = new CheckPoint("Receive Notification", "import message");
                r.CheckPoints.Add(pNotification);

                if (getn == 3)
                {
                    pNotification.Result = TestResult.Pass;
                    foreach (string mmm in rn.getNotificationContent())
                        pNotification.Outputs.AddParameter("Notification message", "Content:", mmm);
                }
                else
                {
                    pNotification.Result = TestResult.Fail;
                    pNotification.Outputs.AddParameter("Message", "Content:", "miss message on receive");
                }
                if (isDeletePatient)
                {
                    XMLResult rslDelete = ps.deletePatient(patientUID);
                    if (!rslDelete.IsErrorOccured)
                    {
                        pNotification.Outputs.AddParameter("Delete created patient", "Delete Patient", rslDelete.ResultContent);
                    }
                }
                SaveRound(r);
            }
            Output();
        }
        public void Run_Acquisition_GetImageInfo_Case1173()
        {
            int runCount = 0;
            string acquireType = string.Empty;

            ApplicationService app = new ApplicationService();
            NotificationSim.ReceiveNotification rn = new NotificationSim.ReceiveNotification();
            System.Collections.Generic.List<string> topics = new System.Collections.Generic.List<string>();
            topics.Add("topic.acquisitionCompleted");
            topics.Add("topic.imageCreated");

            string stopTopic = "teststop";
            string stopContent = "teststop";
            rn.startListon(topics, stopTopic, stopContent);

            foreach (InputDataSet ids in this.Input.DataSets)
            {
                runCount++;
                Round r = this.NewRound(runCount.ToString(), "Acquisition");

                AcquisitionService acqs = new AcquisitionService();

                XMLParameter acq = new XMLParameter("acq_info");
                for (int i = 0; i < ids.InputParameters.Count; i++)
                {
                    if (ids.InputParameters.GetParameter(i).Step == "acquire")
                    {
                        acq.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                    }
                    if (ids.InputParameters.GetParameter(i).Step == "acquireType")
                    {
                        acquireType = ids.InputParameters.GetParameter(i).Key;
                    }
                }

                CheckPoint pAcquire = new CheckPoint("Acquire Image", "Acquisition CR7600");
                r.CheckPoints.Add(pAcquire);
                System.Diagnostics.Debug.Print("Acquire start");

                XMLResult rslAcqRVG = acqs.startAcquisition(acq);
                System.Threading.Thread.Sleep(10000);

                switch (acquireType)
                {
                    case "CR7600":
                        System.Diagnostics.Debug.Print("CR7600 Acquire");
                        System.Diagnostics.Process p = System.Diagnostics.Process.Start("7600helper.exe");
                        p.WaitForExit();
                        break;
                    default:
                        System.Diagnostics.Debug.Print("NOT CR7600 Acquire");
                        break;
                }
                System.Threading.Thread.Sleep(60000);//Wait acqpanel exit
                app.sendGenericNotification(stopTopic, stopContent);
                System.Threading.Thread.Sleep(1000);

                if (rslAcqRVG.IsErrorOccured)
                {
                    System.Diagnostics.Debug.Print("Acquire fail:");
                    pAcquire.Result = TestResult.Fail;
                    pAcquire.Outputs.AddParameter("Acquire image error", "startAcquisition", rslAcqRVG.Message);
                    continue;
                }
                else
                {
                    pAcquire.Outputs.AddParameter("Acquire session ID", "startAcquisition", rslAcqRVG.SingleResult);
                    int msgnum = rn.getNotificationNumber();
                    if (msgnum != 3)
                    {
                        pAcquire.Result = TestResult.Fail;
                        pAcquire.Outputs.AddParameter("Notification Error", "startAcquisition", "RecievedMessageNo:" + msgnum.ToString() + ",Expected:3");
                        continue;
                    }

                    System.Collections.Generic.List<string> mmm = rn.getNotificationContent();
                    string[] token = mmm[0].Split('=');
                    string imageid = token[token.Length - 1];
                    ImageService imgs = new ImageService();
                    XMLParameter cInputImgid = new XMLParameter("image");
                    cInputImgid.AddParameter("internal_id", imageid);
                    XMLResult getRsl = imgs.getImageInfo(cInputImgid);
                    if (!getRsl.IsErrorOccured)
                    {
                        pAcquire.Result = TestResult.Pass;
                        pAcquire.Outputs.AddParameter("Acquistion Success", "startAcquisition", "Message:OK");
                    }
                    else
                    {
                        pAcquire.Result = TestResult.Fail;
                        pAcquire.Outputs.AddParameter("GetImageInfo Error", "startAcquisition", "Message:" + getRsl.Message);
                        continue;
                    }

                }

                SaveRound(r);
                Output();
            }
        }
        public void Run_Acquisition_New_Ceph_4_Case1672()
        {
            int runCount = 0;
            foreach (InputDataSet ids in this.Input.DataSets)
            {
                runCount++;
                string acquireType = string.Empty;
                Round r = this.NewRound(runCount.ToString(), "Acquisition");
                ApplicationService apps = new ApplicationService();
                //start 2D simulator and register 2D simulator to CSDM with same port number
                Start2DSimulator s2d = new Start2DSimulator(10000);
                System.Threading.Thread.Sleep(20);
                apps.registerApplication("2DViewer", "localhost", 10000, true);

                //get acquire information and expect information
                XMLParameter acq = new XMLParameter("acq_info");
                for (int i = 0; i < ids.InputParameters.Count; i++)
                {
                    if (ids.InputParameters.GetParameter(i).Step == "acquire")
                    {
                        acq.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                    }
                    if (ids.InputParameters.GetParameter(i).Step == "acquireType")
                    {
                        acquireType = ids.InputParameters.GetParameter(i).Key;
                    }
                }
                Dictionary<string, string> expectVal = new Dictionary<string, string>();
                for (int j = 0; j < ids.ExpectedValues.Count; j++)
                {
                    if (ids.InputParameters.GetParameter(j).Step == "acquire")
                    {
                        expectVal.Add(ids.ExpectedValues.GetParameter(j).Key, ids.ExpectedValues.GetParameter(j).Value);
                    }
                }

                CheckPoint pAcquire = new CheckPoint("Acquire Image", "Acquisition RVG");
                r.CheckPoints.Add(pAcquire);
                System.Diagnostics.Debug.Print("Acquire start");

                string stopMessageType = "teststop";
                string stopMessageContent = "teststop";

                string hostadd = PAS.AutoTest.TestUtility.Utility.GetCSDMConfig(PAS.AutoTest.TestUtility.CSDMConfigSection.remote, "host");
                string portnoti = PAS.AutoTest.TestUtility.Utility.GetCSDMConfig(PAS.AutoTest.TestUtility.CSDMConfigSection.remote, "notificationPort");
                NotificationSim.ReceiveNotification rn = new NotificationSim.ReceiveNotification(hostadd, int.Parse(portnoti));

                System.Collections.Generic.List<string> rms = new System.Collections.Generic.List<string>();
                rms.Add("topic.acquisitionCompleted");
                rn.startListon(rms, stopMessageType, stopMessageContent);

                AcquisitionService acqs = new AcquisitionService();
                XMLResult rslAcqRVG = acqs.startAcquisition(acq);
                string acq_session_id = "";

                System.Threading.Thread.Sleep(1000);
                switch (acquireType)
                {
                    case "PANO":
                        System.Diagnostics.Debug.Print("PANO Acquire");
                        //Utility.AcqPanoImage(300);
                        System.Threading.Thread tx = new System.Threading.Thread(Utility.AcquirePanoOne);
                        tx.Start();
                        break;
                    case "CEPH":
                        System.Diagnostics.Debug.Print("CEPH Acquire");
                        //Utility.AcqCephImage(50);
                        System.Threading.Thread tx1 = new System.Threading.Thread(Utility.AcquireCephOne);
                        tx1.Start();
                        break;
                    default:
                        System.Diagnostics.Debug.Print("NOT FMS/PANO/CEPH/CR Acquire");
                        break;
                }
                if (rslAcqRVG.IsErrorOccured)
                {
                    System.Diagnostics.Debug.Print("Acquire fail:");
                    pAcquire.Result = TestResult.Fail;
                    pAcquire.Outputs.AddParameter("Acquire image error", "startAcquisition", rslAcqRVG.Message);
                    continue;
                }
                else
                {
                    acq_session_id = rslAcqRVG.SingleResult;
                    pAcquire.Result = TestResult.Pass;
                    pAcquire.Outputs.AddParameter("Acquire image success", "startAcquisition", rslAcqRVG.ResultContent);

                    //start an advanced simulator to receive the specified command
                    int port = 10000;
                    string sRet = "";
                    TwoDSim.AdvanceSimulator asi = new TwoDSim.AdvanceSimulator(port);
                    asi.StartSimulater("0,OK;open_acquired_objects");
                    sRet = asi.StopSimulator(120000);

                    CheckPoint pCheckMessage = new CheckPoint("Check Command", "Acquisition SOCKET Message");
                    r.CheckPoints.Add(pCheckMessage);
                    if (sRet == "")
                    {
                        pCheckMessage.Result = TestResult.Fail;
                        pCheckMessage.Outputs.AddParameter("NO COMMAND", "Check Command", "TIMEOUT: The socket message doesn't received");
                        SaveRound(r);
                        continue;
                    }
                    else
                    {
                        pCheckMessage.Outputs.AddParameter("open_acquired_objects COMMAND parameter", "Record Command", sRet);
                    }

                    ParseMessageContent cn = new ParseMessageContent(sRet);

                    //get patient internal id from command message
                    string patient_uid = cn.getValueFromKey("-patient_internal_id");
                    bool gotPatientId = false;
                    foreach (KeyValuePair<string, string> kvp in expectVal)
                    {
                        if (kvp.Key == "patient_internal_id" && kvp.Value == patient_uid)
                        {
                            gotPatientId = true;
                        }
                    }
                    if (!gotPatientId)
                    {
                        pCheckMessage.Result = TestResult.Fail;
                        pCheckMessage.Outputs.AddParameter("Patient ID Check ERROR", "Check Command", "The socket message content with WRONG patient ID");
                        SaveRound(r);
                        continue;
                    }

                    string image_internal_id_from_acqResult = "";
                    string ps_internal_id_from_acqResult = "";
                    string image_internal_id_from_mapfile = "";
                    string ps_internal_id_from_mapfile = "";

                    //get acquisition session id from command message
                    string session_uid_from_command = cn.getValueFromKey("-session_id");
                    if (acq_session_id != session_uid_from_command)
                    {
                        pCheckMessage.Result = TestResult.Fail;
                        pCheckMessage.Outputs.AddParameter("Session ID Check ERROR", "Check Command", "The session id from command not equals the id from startAcquisition!");
                        SaveRound(r);
                        continue;
                    }
                    int timeout = 0;
                    do
                    {
                        XMLResult rslgetAcqResult = acqs.getAcquisitionResult(session_uid_from_command);
                        //timeout added
                        if (!rslgetAcqResult.IsErrorOccured && rslgetAcqResult.Code == 0)
                        {
                            pCheckMessage.Outputs.AddParameter("Show the content after getAcquisitionResult", "Output getAcquisitionResult", rslgetAcqResult.ResultContent);
                            ParseXMLContent rslacqResult = new ParseXMLContent(rslgetAcqResult.ResultContent);
                            image_internal_id_from_acqResult = rslacqResult.getStringWithPathAndType("trophy/object_info", "image", "value");
                            ps_internal_id_from_acqResult = rslacqResult.getStringWithPathAndType("trophy/object_info", "presentation_state", "value");
                            break;
                        }
                        timeout++;
                        System.Threading.Thread.Sleep(1000);
                    } while (timeout < 120);
                    if (timeout >= 120)
                    {
                        pCheckMessage.Result = TestResult.Fail;
                        pCheckMessage.Outputs.AddParameter("Try too many times", "Check getAcquisitionResult", "TIMEOUT of getAcquisitionResult");
                        break;
                    }

                    //parser the mapping xml content from command message
                    string mapping_xml = cn.getValueFromKey("-mapping_xml");
                    string mapping_content = base64tools.DecodeString4base(mapping_xml);
                    pCheckMessage.Outputs.AddParameter("Show the decode mapping file content", "Output mappingfile", mapping_content);
                    string target_path = "";

                    if (mapping_content != null)
                    {
                        ParseXMLContent pc = new ParseXMLContent(mapping_content);
                        pc.getValueFromPath("path_mapping/instance");
                        string type = pc.getValueByKey("type");

                        int indexKey = type.IndexOf(";");
                        if (indexKey != -1)
                            type = type.Substring(0, indexKey);

                        bool gotType = false;
                        foreach (KeyValuePair<string, string> kvp in expectVal)
                        {
                            if (kvp.Key == "type" && kvp.Value == type)
                            {
                                gotType = true;
                            }
                        }
                        if (!gotType)
                        {
                            pCheckMessage.Result = TestResult.Fail;
                            pCheckMessage.Outputs.AddParameter("Type Check ERROR", "Check Command ", "The socket message content with WRONG type");
                            SaveRound(r);
                            continue;
                        }

                        string original_path = pc.getValueByKey("original_path");

                        //check the acquired image has been put into correct position.
                        target_path = pc.getValueByKey("target_path");
                        int indexPath = target_path.IndexOf(";");
                        if (indexPath != -1)
                            target_path = target_path.Substring(0, indexPath);
                        //now the Processing data file not provide correct after send command
                        bool dicomfileexist = Utility.isFileExisted(target_path);
                        if (!dicomfileexist)
                        {
                            pCheckMessage.Result = TestResult.Fail;
                            pCheckMessage.Outputs.AddParameter("Dicom File Check ERROR", "Check Command", "The acquired image not in cache place");
                            SaveRound(r);
                            continue;
                        }

                        image_internal_id_from_mapfile = pc.getWithPathAndTypeFromMappingFile("path_mapping", "Image", "instance_internal_id");
                        ps_internal_id_from_mapfile = pc.getWithPathAndTypeFromMappingFile("path_mapping", "Image", "ps_internal_id");
                    }
                    if (image_internal_id_from_acqResult != image_internal_id_from_mapfile)
                    {
                        pCheckMessage.Result = TestResult.Fail;
                        pCheckMessage.Outputs.AddParameter("Message and Interface result", "Check Command", "The image id from command not equals the id from getAcquisitionResult!");
                        SaveRound(r);
                        continue;
                    }
                    if (ps_internal_id_from_acqResult != ps_internal_id_from_mapfile)
                    {
                        pCheckMessage.Result = TestResult.Fail;
                        pCheckMessage.Outputs.AddParameter("Message and Interface result", "Check Command", "The presentation id from command not equals the id from getAcquisitionResult!");
                        SaveRound(r);
                        continue;
                    }

                    //parser the trophy xml content from command message
                    string acq_out_xml = cn.getValueFromKey("-acq_out_xml");
                    string acq_out = base64tools.DecodeString4base(acq_out_xml);
                    pCheckMessage.Outputs.AddParameter("XML From SDK", "Output acquisition SDK content", acq_out);
                    pCheckMessage.Result = TestResult.Pass;
                    pCheckMessage.Outputs.AddParameter("Message and Interface result", "Check Command", "All ID is matched");

                    CheckPoint pCheckGetImage = new CheckPoint("Check NOTIFICATION", "Acquisition complete Message");
                    r.CheckPoints.Add(pCheckGetImage);
                    apps.sendGenericNotification(stopMessageType, stopMessageContent);
                    System.Threading.Thread.Sleep(1000);

                    //check getImageInfo
                    int getn = rn.getNotificationNumber();
                    if (getn == 2)
                    {

                        XMLParameter getImage = new XMLParameter("image");
                        int indexImage = image_internal_id_from_acqResult.IndexOf(";");
                        if (indexImage != -1)
                            image_internal_id_from_acqResult = image_internal_id_from_acqResult.Substring(0, indexImage);
                        getImage.AddParameter("internal_id", image_internal_id_from_acqResult);
                        ImageService imagesrv = new ImageService();
                        XMLResult getImageRsl = imagesrv.getImageInfo(getImage);
                        //match items
                        pCheckGetImage.Outputs.AddParameter("Get Image Info result", "Get Return XML", getImageRsl.ResultContent);
                        int matchValueCount = 0;
                        for (int i = 0; i < getImageRsl.DicomArrayResult.Length; i++)
                        {
                            if (getImageRsl.DicomArrayResult.Parameters[i].ParameterName == "internal_id"
                                && getImageRsl.DicomArrayResult.Parameters[i].ParameterValue == image_internal_id_from_acqResult)
                            {
                                matchValueCount++;
                            }

                            if (getImageRsl.DicomArrayResult.Parameters[i].ParameterName == "patient_internal_id"
                                && getImageRsl.DicomArrayResult.Parameters[i].ParameterValue == patient_uid)
                            {
                                matchValueCount++;
                            }
                            target_path = target_path.Replace('\\', '/');
                            if (getImageRsl.DicomArrayResult.Parameters[i].ParameterName == "path"
                                && getImageRsl.DicomArrayResult.Parameters[i].ParameterValue == target_path)
                            {
                                matchValueCount++;
                            }
                        }
                        if (matchValueCount == 3)
                        {
                            pCheckGetImage.Result = TestResult.Pass;
                            pCheckGetImage.Outputs.AddParameter("Get Image Info result", "Check Return XML", "All ID is matched");
                        }
                        else
                        {
                            pCheckGetImage.Result = TestResult.Fail;
                            pCheckGetImage.Outputs.AddParameter("Get Image Info result", "Check Return XML", "Some ID is not matched");
                        }

                    }
                    else
                    {
                        pCheckGetImage.Result = TestResult.Fail;
                        pCheckGetImage.Outputs.AddParameter("Notification not received", "Check Return", "No acquisition complete Message be received");
                    }

                }
                SaveRound(r);
            }
            Output();
        }
        public void Run_Acquisition_Notification_Case985()
        {
            int runCount = 0;
            string patientUID = string.Empty;
            bool isCreatePatient = false;

            string stopMessageType = "teststop";
            string stopMessageContent = "teststop";

            NotificationSim.ReceiveNotification rn = new NotificationSim.ReceiveNotification();
            //NotificationSim.ReceiveNotification rn = new NotificationSim.ReceiveNotification("10.112.39.167");
            System.Collections.Generic.List<string> rms = new System.Collections.Generic.List<string>();
            rms.Add("topic.patientCreated");
            rms.Add("topic.acquisitionCompleted");
            rms.Add("topic.imageCreated");
            rms.Add("topic.presentationStateModified");
            rn.startListon(rms, stopMessageType, stopMessageContent);

            foreach (InputDataSet ids in this.Input.DataSets)
            {
                isCreatePatient = false;
                runCount++;
                Round r = this.NewRound(runCount.ToString(), "Acquire image");
                CheckPoint pCreate = new CheckPoint("Create Patient", "Test create");
                r.CheckPoints.Add(pCreate);
                PatientService ps = new PatientService();
                AcquisitionService acqs = new AcquisitionService();
                ApplicationService ass = new ApplicationService();

                XMLParameter pa = new XMLParameter("patient");
                XMLParameter acq = new XMLParameter("acq_info");
                for (int i = 0; i < ids.InputParameters.Count; i++)
                {
                    if (ids.InputParameters.GetParameter(i).Step == "create")
                    {
                        pa.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                        isCreatePatient = true;
                    }
                    if (ids.InputParameters.GetParameter(i).Step == "acquire")
                    {
                        acq.AddParameter(ids.InputParameters.GetParameter(i).Key, ids.InputParameters.GetParameter(i).Value);
                    }
                }
                if (isCreatePatient)
                {
                    XMLResult result = ps.createPatient(pa);
                    if (!result.IsErrorOccured)
                    {
                        pCreate.Result = TestResult.Pass;
                        patientUID = result.SingleResult;
                        pCreate.Outputs.AddParameter("create", "Create patient UID", patientUID);
                    }
                    else
                    {
                        pCreate.Result = TestResult.Fail;
                        pCreate.Outputs.AddParameter("create patient error", "Create patient", result.Message);
                    }
                }

                CheckPoint pAcquire = new CheckPoint("Acquire Image", "Test acquire");
                r.CheckPoints.Add(pAcquire);
                acq.AddParameter("patient_internal_id", patientUID);
                System.Diagnostics.Debug.Print("Acquire start");

                XMLResult rslAcq = acqs.startAcquisition(acq);
                System.Diagnostics.Debug.Print("Acquire :");
                System.Threading.Thread.Sleep(5000);

                if (rslAcq.IsErrorOccured)
                {
                    System.Diagnostics.Debug.Print("Acquire fail:");
                    pAcquire.Result = TestResult.Fail;
                    pAcquire.Outputs.AddParameter("acquire", "Acquire image error", rslAcq.Message);
                }
                else
                {
                    pAcquire.Outputs.AddParameter("acquire", "Acquire session ID", rslAcq.SingleResult);
                    int DOcount = 0;
                    XMLResult getAcq = new XMLResult();
                    do
                    {
                        System.Threading.Thread.Sleep(3000);
                        System.Diagnostics.Debug.Print("get acquire in do");
                        DOcount++;
                        getAcq = acqs.getAcquisitionResult(rslAcq.SingleResult);
                        if (!getAcq.IsErrorOccured)
                        {
                            pAcquire.Result = TestResult.Pass;
                            pAcquire.Outputs.AddParameter("acquire", "Get acquire image", getAcq.Message);
                            break;
                        }
                        if (getAcq.IsErrorOccured && getAcq.Code != 499)
                            continue;
                        if (getAcq.Code != 0 && getAcq.Code != 499)
                        {
                            pAcquire.Result = TestResult.Fail;
                            pAcquire.Outputs.AddParameter("acquire", "Get acquire image error", getAcq.Message);
                            break;
                        }
                        System.Diagnostics.Debug.Print("get acquireResult:" + DOcount);
                        if (DOcount > 60)
                        {
                            pAcquire.Result = TestResult.Fail;
                            pAcquire.Outputs.AddParameter("acquire", "Get acquire image error", "Acquire greate with 3 minutes, timeout!");
                            break;
                        }
                    } while (true);
                }

                System.Threading.Thread.Sleep(500);

                ass.sendGenericNotification(stopMessageType, stopMessageContent);

                System.Threading.Thread.Sleep(500);

                int getn = rn.getNotificationNumber();

                CheckPoint pNotification = new CheckPoint("Receive Notification", "acquire message");
                r.CheckPoints.Add(pNotification);

                if (getn == 4)
                {
                    pNotification.Result = TestResult.Pass;
                    foreach (string mmm in rn.getNotificationContent())
                    {
                        pNotification.Outputs.AddParameter("Notification message", "Content:", mmm);
                    }
                }
                else
                {
                    pNotification.Result = TestResult.Fail;
                    foreach (string mmm in rn.getNotificationContent())
                    {
                        pNotification.Outputs.AddParameter("Notification message", "Content:", mmm);
                    }
                    pNotification.Outputs.AddParameter("Message", "Content:", "miss message on receive");
                }

                SaveRound(r);
            }
            Output();
        }