Esempio n. 1
0
        private void CalIMD()
        {
            DXSplashScreen.Show <Cal_DXSplashScreen>();
            DXSplashScreen.Progress(0);
            TestPlanVM vm = (new ViewModelLocator()).CurrentTestPlanVm;

            if (!GeneTestSetup.Instance.IsSimulated)
            {
                foreach (var conn in ManualConnList)
                {
                    //foreach (var step in conn.TestStepList)
                    //{
                    //    if (step.IsTest)
                    //    {
                    //        (step.TestStep as IMDTestStep).CalIMDPower();
                    //    }
                    //}
                }
                Interface.SaveAllLocalSettings(vm);
            }
            DXSplashScreen.Progress(1);
            if (DXSplashScreen.IsActive)
            {
                DXSplashScreen.Close();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 没有用到
        /// </summary>
        /// <param name="SN"></param>
        /// <returns></returns>
        private bool GetSNData(string SN)
        {
            routeLine.GetRouteBySN(SN);

            //亨鑫使用
            string token = (new ViewModelLocator()).MainWindow.StatusInfo.Token;

            string resValue = ServiceInterface.DataService.CheckINBYSN(token, SN);

            if (resValue.StartsWith("ER"))
            {
                DXMessageBox.Show("序号:[" + SN + "]处理异常!异常消息:[" + resValue + "]");
                return(false);
            }

            if (false)
            {
                TestPlanVM MTSM      = new ViewModelLocator().CurrentTestPlanVm;
                byte[]     StateFile = Interface.SerializerStateModel(MTSM.TestPlan);

                string StateFileHasCode  = Interface.GetMD5HashFromByte(StateFile);
                bool   CheckStatFileBySn = ServiceInterface.DataService.CheckStatFileBySn(token, SN, StateFileHasCode);
                if (!CheckStatFileBySn)
                {
                    return(true);
                }

                byte[] bStatFile = ServiceInterface.DataService.DownLoadStatFile(token, SN);

                if (bStatFile != null)
                {
                    TestPlanVM testPlan = Interface.DeSerializerStateModel(bStatFile, testPlan) as TestPlanVM;
                    if (testPlan != null)
                    {
                        MTSM.TestPlan = testPlan.TestPlan;
                    }
                }
                else
                {
                    MTSM.TestPlan = new TestPlan();
                }
                MTSM.ApplyTestPlan();

                vm            = MTSM;
                vm.UpdateData = new Action <int>(UpdateTestData);
            }

            return(true);
        }
Esempio n. 3
0
        public static void SaveAllLocalSettings(TestPlanVM vm)
        {
            string        fileName = Environment.CurrentDirectory + "/configfiles/" + vm.DisplayName + ".xml";
            List <object> objects  = new List <object>();

            foreach (var mcNode in vm.ManualConnList)
            {
                foreach (var stepNode in mcNode.SubTreeNodeList)
                {
                    object obj = (stepNode.NodeObj as TestStep).GetLocalSetting();
                    objects.Add(obj);
                }
            }
            byte[] bytes = Interface.SerializerStepData(objects);
            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }
            System.IO.File.WriteAllBytes(fileName, bytes);
        }
Esempio n. 4
0
 public void InitialData(TestPlanVM testPlanVM)
 {
     //IMDTestStepCal.ManualConnList.Clear();
     //NFTestStepCal.ManualConnList.Clear();
     //foreach (ManualConnectionVM mcNode in testPlanVM.ManualConnList)
     //{
     //    if (mcNode.TestStepList.Select(x => x.TestStep.GetType() == typeof(NFTestStep)).Count() > 0)
     //    {
     //        ManualConnectionVM manualNode = new ManualConnectionVM() { DisplayName = mcNode.DisplayName };
     //        foreach (TestStepVM stepNode in mcNode.TestStepList)
     //        {
     //            if (stepNode.TestStep.GetType() == typeof(NFTestStep))
     //            {
     //                manualNode.TestStepList.Add(stepNode);
     //            }
     //        }
     //        if (manualNode.TestStepList.Count() > 0)
     //        {
     //            NFTestStepCal.ManualConnList.Add(manualNode);
     //        }
     //    }
     //    if (mcNode.TestStepList.Select(x => x.TestStep.GetType() == typeof(IMDTestStep)).Count() > 0)
     //    {
     //        ManualConnectionVM manualNode = new ManualConnectionVM() { DisplayName = mcNode.DisplayName };
     //        foreach (TestStepVM stepNode in mcNode.TestStepList)
     //        {
     //            if (stepNode.TestStep.GetType() == typeof(IMDTestStep))
     //            {
     //                manualNode.TestStepList.Add(stepNode);
     //            }
     //        }
     //        if (manualNode.TestStepList.Count() > 0)
     //        {
     //            IMDTestStepCal.ManualConnList.Add(manualNode);
     //        }
     //    }
     //}
     //testPlanVM.TestPlan.InitAllCal();
 }
Esempio n. 5
0
        public ResultDisplay()
        {
            InitializeComponent();
            //LoadLayoutFromDB();
            //saveLayoutToXml();
            snRule             = new DataUtils.SNRule();
            vm                 = grid.DataContext as TestPlanVM;
            vm.UpdateData      = new Action <int>(UpdateTestData);
            vm.StepStart       = new Action <int>(StepStart);
            vm.ManualConnStart = new Action(ManualConnStart);
            vm.TestSeqFinish   = new Action(TestPlan_SeqFish);
            vm.PointFinish     = new Action <int, int, int>(PointFinish);
            AddDelegateToLoopStep();

            panel2 = new System.Windows.Forms.Panel();
            this.panel2.BackColor = System.Drawing.Color.White;
            this.panel2.Dock      = System.Windows.Forms.DockStyle.Top;
            this.panel2.Location  = new System.Drawing.Point(3, 3);
            this.panel2.Name      = "panel2";
            this.panel2.Size      = new System.Drawing.Size(0, 726);
            this.panel2.TabIndex  = 130;
            tabPage1                = new System.Windows.Forms.TabPage();
            tabPage1.AutoScroll     = true;
            this.tabPage1.BackColor = System.Drawing.Color.White;
            this.tabPage1.Controls.Add(this.panel2);
            this.tabPage1.Location = new System.Drawing.Point(4, 26);
            this.tabPage1.Name     = "tabPage1";
            this.tabPage1.Padding  = new System.Windows.Forms.Padding(3);
            this.tabPage1.Size     = new System.Drawing.Size(0, 699);
            this.tabPage1.TabIndex = 0;
            this.tabPage1.Text     = "工艺路径";

            this.tabcontrol.Controls.Add(tabPage1);
            routeLine = new RouteLine.RouteLine(panel2);
            getAllResultDisplaylistener();
            getSNContentControl();
            getRemarksInfo();
        }
Esempio n. 6
0
 public SelectConfigPath(TestPlanVM vm)
 {
     InitializeComponent();
     grid.DataContext = vm;
 }
Esempio n. 7
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            TestPlanVM testPlanVM = (new ViewModelLocator()).CurrentTestPlanVm;

            vm.InitialData(testPlanVM);
        }
Esempio n. 8
0
 public TestSpecUC(TestPlanVM vm)
 {
     InitializeComponent();
     this.vm          = vm;
     this.DataContext = vm;
 }