Beispiel #1
0
        private void btnMPre_Click(object sender, RoutedEventArgs e)
        {
            LstBxMltAns.ItemsSource = null;
            if (SDK_Ctrl.UGPMan == null)
            {
                MAnalizeBtnSet(); return;
            }

            SDK_Ctrl.MovePre();
            if (SDK_Ctrl.UGPMan == null)
            {
                _ResetAnalizer(true); return;
            }

            List <UPuzzle> pMltUProbLst = SDK_Ctrl.UGPMan.MltUProbLst;

            if (!GNPXApp000.chbConfirmMultipleCells || pMltUProbLst == null)
            {
                return;
            }

            AnalyzerCC = SDK_Ctrl.UGPMan.stageNo;
            GNPZ_Engin.GNPX_AnalyzerMessage = SDK_Ctrl.UGPMan.pGPsel.Sol_ResultLong;
            txbStepCC.Text         = AnalyzerCC.ToString();
            txbStepMCC.Text        = txbStepCC.Text;
            lblAnalyzerResult.Text = SDK_Ctrl.UGPMan.pGPsel.Sol_ResultLong;

            selXUPP = SDK_Ctrl.UGPMan.pGPsel.IDm;
            if (selXUPP < 0)
            {
                return;
            }
            UPP = pMltUProbLst.ConvertAll(P => new UProbS(P));
            LstBxMltAns.ItemsSource   = UPP;
            LstBxMltAns.SelectedIndex = selXUPP;

            if (selXUPP < UPP.Count)
            {
                LstBxMltAns.ScrollIntoView(UPP[selXUPP]);
            }
            _Set_DGViewMethodCounter(); //Counter of applied algorithm
        }
        private void _Display_AnalyzeProb()
        {
            //WriteLine("----------------"+__DispMode);
            if (__DispMode == "Canceled")
            {
                shortMessage("cancellation accepted", new sysWin.Point(120, 188), Colors.Red, 3000);
                lblUnderAnalysis.Foreground = Brushes.LightCoral;
                Lbl_onAnalyzerM.Foreground  = Brushes.LightCoral;
                displayTimer.Stop();
            }

            else if (__DispMode == "Complated")
            {
                lblUnderAnalysis.Content = pRes.msgAnalysisComplate;
                if ((string)SDK_Ctrl.MltAnsOption["abortResult"] != "")
                {
                    Lbl_onAnalyzerM.Content = SDK_Ctrl.MltAnsOption["abortResult"];
                }
                else
                {
                    Lbl_onAnalyzerM.Content    = pRes.msgAnalysisComplate;
                    Lbl_onAnalyzerM.Foreground = Brushes.LightBlue;

                    if ((bool)chbDifficultySetting.IsChecked)
                    {
                        string prbMessage;
                        int    DifLevel = GNP00.GNPX_Eng.GetDifficultyLevel(out prbMessage);
                        pGP.DifLevel = DifLevel;
                    }
                }
                btnSolve.Content            = pRes.btnSolve;
                btnMultiSolve.Content       = pRes.btnMultiSolve;
                btnMultiSolve.IsEnabled     = true;
                lblUnderAnalysis.Foreground = Brushes.LightBlue;

                _Set_DGViewMethodCounter();  //Aggregation of methods
                string msgST = pGP.Sol_ResultLong;
                if (!ErrorStopB)
                {
                    lblAnalyzerResult.Text = msgST;
                }
                if (msgST.LastIndexOf("anti-rule") >= 0 || msgST.LastIndexOf("Unparsable") >= 0)
                {
                }
                displayTimer.Stop();
            }
            else
            {
                if (!ErrorStopB)
                {
                    lblAnalyzerResult.Text = GNPZ_Engin.GNPX_AnalyzerMessage;
                }
                Lbl_onAnalyzerM.Content = pRes.lblUnderAnalysis + " : " + GNPZ_Engin.GNPX_AnalyzerMessage;
            }

            if (UPP != null && UPP.Count > 0)
            {
                try{
                    if (__DispMode == "Complated")
                    {
                        LstBxMltAns.ItemsSource = null;
                    }
                    LstBxMltAns.ItemsSource = UPP;

                    if (__DispMode == "Complated")
                    {
                        LstBxMltAns.ScrollIntoView(UPP.First());
                        selXUPP = 0;
                        AnalyzerLap.Stop();
                    }
                    else
                    {
                        LstBxMltAns.ScrollIntoView(UPP.Last());
                        selXUPP = UPP.Count - 1;
                    }
                    LstBxMltAns.SelectedIndex = selXUPP;

                    var Q = (UProbS)LstBxMltAns.SelectedItem;
                    if (Q == null)
                    {
                        Q = UPP[0];
                    }
                    lblAnalyzerResultM.Text = "[" + (Q.IDmp1) + "] " + Q.Sol_ResultLong;
                }
                catch (Exception e) {
                    WriteLine(e.Message);
                    WriteLine(e.StackTrace);
                }
            }

            string st = AnalyzerLapElaped;

            Lbl_onAnalyzerTS.Content  = st;
            Lbl_onAnalyzerTSM.Content = st;
            txbEpapsedTimeTS3.Text    = st;

            btnSolveUp.Content = pRes.btnSolveUp;

            if (GNPZ_Engin.GNPX_AnalyzerMessage.Contains("sys"))
            {
                lblAnalyzerResultM.Text = GNPZ_Engin.GNPX_AnalyzerMessage;
            }

            this.Cursor = Cursors.Arrow;
            if (__DispMode == "Complated")
            {
                _SetScreenProblem();
            }

            OnWork = 0;
//            __DispMode="";
        }