コード例 #1
0
        protected override void OnClick()
        {
            try
            {
                ResourceManager resourceManager = VariableMaintainer.CurrentResourceManager;
                if (VariableMaintainer.CurrentModel == EnumCurrentModel.Null)
                {
                    MessageBox.Show(resourceManager.GetString("String168"), resourceManager.GetString("String2"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                Thread thread = VariableMaintainer.SimulationThread;
                if (thread != null)
                {
                    if (thread.ThreadState != ThreadState.Stopped)
                    {
                        MessageBox.Show(resourceManager.GetString("String39"), resourceManager.GetString("String2"),
                                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }

                StructRasterMetaData structRasterMetaData = new StructRasterMetaData();
                string model = "";
                if (VariableMaintainer.CurrentModel == EnumCurrentModel.Simulation_CA_LogisticRegression)
                {
                    model = resourceManager.GetString("String104");
                }
                else if (VariableMaintainer.CurrentModel == EnumCurrentModel.Simulation_CA_ANN)
                {
                    model = resourceManager.GetString("String102");
                }
                else if (VariableMaintainer.CurrentModel == EnumCurrentModel.Simulation_CA_DT)
                {
                    model = resourceManager.GetString("String103");
                }
                else if (VariableMaintainer.CurrentModel == EnumCurrentModel.Optimization_Area)
                {
                    model = resourceManager.GetString("String167");
                }
                VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String82")
                                                                          + model + resourceManager.GetString("String101") + DateTime.Now.ToShortTimeString());
                VariableMaintainer.CurrentDockableWindowOutput.AppendText("\n");
                VariableMaintainer.CurrentDockableWindowOutput.AppendText("\n");
                ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String58"));
                VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String58"));
                VariableMaintainer.CurrentDockableWindowOutput.AppendText("\n");

                if (VariableMaintainer.CurrentModel == EnumCurrentModel.Simulation_CA_LogisticRegression)
                {
                    //ArcGIS操作在另一线程中执行效率降低很多,因此把数据读取及刷新操作在线程外执行
                    //首先读取模拟起始时刻和/或终止时刻影像
                    ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String12"));
                    VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String12") +
                                                                              VariableMaintainer.CurrentFormLogisticCAWizard.SimulationStartImageName + ".....\n");
                    VariableMaintainer.CurrentFormLogisticCAWizard.SimulationStartImage =
                        ArcGISOperator.ReadRasterAndGetMetaData(ArcGISOperator.GetRasterLayerByName(
                                                                    VariableMaintainer.CurrentFormLogisticCAWizard.SimulationStartImageName), out structRasterMetaData);
                    if (VariableMaintainer.CurrentFormLogisticCAWizard.SimulationEndImageName != "")
                    {
                        ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String13"));
                        VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String13") +
                                                                                  VariableMaintainer.CurrentFormLogisticCAWizard.SimulationEndImageName + ".....\n");
                        VariableMaintainer.CurrentFormLogisticCAWizard.SimulationEndImage = ArcGISOperator.ReadRaster(ArcGISOperator.GetRasterLayerByName(
                                                                                                                          VariableMaintainer.CurrentFormLogisticCAWizard.SimulationEndImageName), -9999f);
                    }
                    //然后读取各变量影像
                    if (VariableMaintainer.CurrentFormLogisticCAWizard.IsUsingDefault)
                    {
                        foreach (string layerName in VariableMaintainer.CurrentFormLogisticCAWizard.ListVariableLayersName)
                        {
                            ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String14") + layerName + ".....");
                            VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String14") + layerName + ".....\n");
                            VariableMaintainer.CurrentFormLogisticCAWizard.VaribaleImages.Add(
                                ArcGISOperator.ReadRaster(ArcGISOperator.GetRasterLayerByName(layerName), -9999f));
                        }
                        //获取最小空间范围
                        IRasterLayer rasterLayerStartImage = ArcGISOperator.GetRasterLayerByName(VariableMaintainer.CurrentFormLogisticCAWizard.SimulationStartImageName);
                        IRasterLayer rasterLayerEndImage   = ArcGISOperator.GetRasterLayerByName(VariableMaintainer.CurrentFormLogisticCAWizard.SimulationEndImageName);

                        List <IRasterLayer> listVariablesLayers = new List <IRasterLayer>();
                        for (int i = 0; i < VariableMaintainer.CurrentFormLogisticCAWizard.ListVariableLayersName.Count; i++)
                        {
                            listVariablesLayers.Add(ArcGISOperator.GetRasterLayerByName(VariableMaintainer.CurrentFormLogisticCAWizard.ListVariableLayersName[i]));
                        }
                        ArcGISOperator.GetSmallestBound(rasterLayerStartImage, rasterLayerEndImage, listVariablesLayers, ref structRasterMetaData);
                        VariableMaintainer.CurrentFormLogisticCAWizard.CurrentStructRasterMetaData = structRasterMetaData;
                    }
                    //最后用模拟起始时刻影像创建模拟影像
                    string dateTime   = GeneralOpertor.GetDataTimeFullString(DateTime.Now);
                    string rasterName = "sim" + dateTime + ".img";
                    ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String37"));
                    VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String37") + rasterName + ".....\n");

                    IRasterLayer simulationStartImageLayer = ArcGISOperator.GetRasterLayerByName(
                        VariableMaintainer.CurrentFormLogisticCAWizard.SimulationStartImageName);
                    IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactoryClass();
                    IWorkspace        workspace        = workspaceFactory.OpenFromFile(VariableMaintainer.CurrentFormLogisticCAWizard.OutputFolder, 0);
                    ISaveAs2          saveAs2          = (ISaveAs2)simulationStartImageLayer.Raster;
                    saveAs2.SaveAs(rasterName, workspace, "IMAGINE Image");
                    IRasterLayer simulationImageLayer = new RasterLayerClass();
                    simulationImageLayer.CreateFromFilePath(VariableMaintainer.CurrentFormLogisticCAWizard.OutputFolder + @"\" + rasterName);
                    simulationImageLayer.Renderer = simulationStartImageLayer.Renderer;
                    ArcGISOperator.FoucsMap.AddLayer((ILayer)simulationImageLayer);
                    VariableMaintainer.CurrentFormLogisticCAWizard.SimulationImage     = ArcGISOperator.ReadRaster(simulationImageLayer, -9999f);
                    VariableMaintainer.CurrentFormLogisticCAWizard.SimulationLayerName = rasterName;

                    LogisticRegreesionCA lrCA = new LogisticRegreesionCA();
                    lrCA.DockableWindowGraphy = VariableMaintainer.CurrentDockableWindowGraphy;
                    lrCA.DockableWindowOutput = VariableMaintainer.CurrentDockableWindowOutput;

                    thread = new Thread(new ThreadStart(lrCA.DoSimulation));
                }
                else if (VariableMaintainer.CurrentModel == EnumCurrentModel.Simulation_CA_ANN)
                {
                    //今后应使用父类和接口进行重构
                    //首先读取模拟起始时刻和/或终止时刻影像
                    ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String12"));
                    VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String12") +
                                                                              VariableMaintainer.CurrentFormANNCAWizard.SimulationStartImageName + ".....\n");
                    VariableMaintainer.CurrentFormANNCAWizard.SimulationStartImage =
                        ArcGISOperator.ReadRasterAndGetMetaData(ArcGISOperator.GetRasterLayerByName(
                                                                    VariableMaintainer.CurrentFormANNCAWizard.SimulationStartImageName), out structRasterMetaData);
                    //VariableMaintainer.CurrentANNCAWizard.CurrentStructRasterMetaData = structRasterMetaData;
                    if (VariableMaintainer.CurrentFormANNCAWizard.SimulationEndImageName != "")
                    {
                        ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String13"));
                        VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String13") +
                                                                                  VariableMaintainer.CurrentFormLogisticCAWizard.SimulationEndImageName + ".....\n");
                        VariableMaintainer.CurrentFormANNCAWizard.SimulationEndImage = ArcGISOperator.ReadRaster(ArcGISOperator.GetRasterLayerByName(
                                                                                                                     VariableMaintainer.CurrentFormANNCAWizard.SimulationEndImageName), -9999f);
                    }
                    //最后用模拟起始时刻影像创建模拟影像
                    string dateTime   = GeneralOpertor.GetDataTimeFullString(DateTime.Now);
                    string rasterName = "sim" + dateTime + ".img";
                    ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String37"));
                    VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String37") + rasterName + ".....\n");

                    IRasterLayer simulationStartImageLayer = ArcGISOperator.GetRasterLayerByName(
                        VariableMaintainer.CurrentFormANNCAWizard.SimulationStartImageName);
                    IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactoryClass();
                    IWorkspace        workspace        = workspaceFactory.OpenFromFile(VariableMaintainer.CurrentFormANNCAWizard.OutputFolder, 0);
                    ISaveAs2          saveAs2          = (ISaveAs2)simulationStartImageLayer.Raster;
                    saveAs2.SaveAs(rasterName, workspace, "IMAGINE Image");
                    IRasterLayer simulationImageLayer = new RasterLayerClass();
                    simulationImageLayer.CreateFromFilePath(VariableMaintainer.CurrentFormANNCAWizard.OutputFolder + @"\" + rasterName);
                    simulationImageLayer.Renderer = simulationStartImageLayer.Renderer;
                    ArcGISOperator.FoucsMap.AddLayer((ILayer)simulationImageLayer);
                    VariableMaintainer.CurrentFormANNCAWizard.SimulationImage     = ArcGISOperator.ReadRaster(simulationImageLayer, -9999f);
                    VariableMaintainer.CurrentFormANNCAWizard.SimulationLayerName = rasterName;

                    ANNCA annCA = new ANNCA();
                    annCA.DockableWindowGraphy = VariableMaintainer.CurrentDockableWindowGraphy;
                    annCA.DockableWindowOutput = VariableMaintainer.CurrentDockableWindowOutput;

                    thread = new Thread(new ThreadStart(annCA.DoSimulation));
                }
                else if (VariableMaintainer.CurrentModel == EnumCurrentModel.Simulation_CA_DT)
                {
                    //今后应使用父类和接口进行重构
                    //首先读取模拟起始时刻和/或终止时刻影像
                    ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String12"));
                    VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String12") +
                                                                              VariableMaintainer.CurrentFormDTCAWizard.SimulationStartImageName + ".....\n");
                    VariableMaintainer.CurrentFormDTCAWizard.SimulationStartImage =
                        ArcGISOperator.ReadRasterAndGetMetaData(ArcGISOperator.GetRasterLayerByName(
                                                                    VariableMaintainer.CurrentFormDTCAWizard.SimulationStartImageName), out structRasterMetaData);
                    //VariableMaintainer.CurrentDTCAWizard.CurrentStructRasterMetaData = structRasterMetaData;
                    if (VariableMaintainer.CurrentFormDTCAWizard.SimulationEndImageName != "")
                    {
                        ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String13"));
                        VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String13") +
                                                                                  VariableMaintainer.CurrentFormLogisticCAWizard.SimulationEndImageName + ".....\n");
                        VariableMaintainer.CurrentFormDTCAWizard.SimulationEndImage = ArcGISOperator.ReadRaster(ArcGISOperator.GetRasterLayerByName(
                                                                                                                    VariableMaintainer.CurrentFormDTCAWizard.SimulationEndImageName), -9999f);
                    }
                    //20170619添加限制层数据
                    //VariableMaintainer.CurrentDockableWindowOutput.AppendText("Add Restriction Layer " +
                    //        "ACOres" + ".....\n");
                    //VariableMaintainer.RestrictImage = ArcGISOperator.ReadRaster(ArcGISOperator.GetRasterLayerByName(
                    //        "ACOres"), -9999f);

                    //最后用模拟起始时刻影像创建模拟影像
                    string dateTime   = GeneralOpertor.GetDataTimeFullString(DateTime.Now);
                    string rasterName = "sim" + dateTime + ".img";
                    ArcMap.Application.StatusBar.set_Message(0, resourceManager.GetString("String37"));
                    VariableMaintainer.CurrentDockableWindowOutput.AppendText(resourceManager.GetString("String37") + rasterName + ".....\n");

                    IRasterLayer simulationStartImageLayer = ArcGISOperator.GetRasterLayerByName(
                        VariableMaintainer.CurrentFormDTCAWizard.SimulationStartImageName);
                    IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactoryClass();
                    IWorkspace        workspace        = workspaceFactory.OpenFromFile(VariableMaintainer.CurrentFormDTCAWizard.OutputFolder, 0);
                    ISaveAs2          saveAs2          = (ISaveAs2)simulationStartImageLayer.Raster;
                    saveAs2.SaveAs(rasterName, workspace, "IMAGINE Image");
                    IRasterLayer simulationImageLayer = new RasterLayerClass();
                    simulationImageLayer.CreateFromFilePath(VariableMaintainer.CurrentFormDTCAWizard.OutputFolder + @"\" + rasterName);
                    simulationImageLayer.Renderer = simulationStartImageLayer.Renderer;
                    ArcGISOperator.FoucsMap.AddLayer((ILayer)simulationImageLayer);
                    VariableMaintainer.CurrentFormDTCAWizard.SimulationImage     = ArcGISOperator.ReadRaster(simulationImageLayer, -9999f);
                    VariableMaintainer.CurrentFormDTCAWizard.SimulationLayerName = rasterName;

                    DecisionTreeCA dtCA = new DecisionTreeCA();
                    dtCA.DockableWindowGraphy = VariableMaintainer.CurrentDockableWindowGraphy;
                    dtCA.DockableWindowOutput = VariableMaintainer.CurrentDockableWindowOutput;

                    thread = new Thread(new ThreadStart(dtCA.DoSimulation));
                }
                else if (VariableMaintainer.CurrentModel == EnumCurrentModel.Optimization_Area)
                {
                    if (!VariableMaintainer.IsACOUtilitySet || !VariableMaintainer.IsACOParametersSet)
                    {
                        MessageBox.Show(resourceManager.GetString("String166"), resourceManager.GetString("String2"),
                                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    AreaOptimizationACO areaOptimizationACO = new AreaOptimizationACO();
                    areaOptimizationACO.Initialize(VariableMaintainer.CurrentStructACOParameters, 1, false,
                                                   VariableMaintainer.CurrentDockableWindowOutput, VariableMaintainer.CurrentDockableWindowGraphy, true);

                    thread = new Thread(new ThreadStart(areaOptimizationACO.Run));
                }
                else
                {
                    MessageBox.Show(resourceManager.GetString("String168"), resourceManager.GetString("String2"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                VariableMaintainer.SimulationThread = thread;
                thread.SetApartmentState(ApartmentState.STA);
                thread.Start();

                VariableMaintainer.CurrentTimer.Interval = 500;
                VariableMaintainer.CurrentTimer.Tick    += new EventHandler(t_Tick);
                VariableMaintainer.CurrentTimer.Enabled  = true;
                VariableMaintainer.CurrentTimer.Start();

                ArcMap.Application.CurrentTool = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
        /// <summary>
        /// 当向导页的新一页出现前可以做的该页初始化工作。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void wizardLogistcCA_AfterSwitchPages(object sender, CristiPotlog.Controls.Wizard.AfterSwitchPagesEventArgs e)
        {
            //切换至逻辑回归计算页时,应首先读取地图图层信息,填写部分控件
            if (e.OldIndex == 1 && e.NewIndex == 2)
            {
                //如果不是第一次打开窗体,则再次读取地图数据
                application             = ArcMap.Application;
                document                = application.Document as IMxDocument;
                map                     = document.FocusMap;
                ArcGISOperator.FoucsMap = document.FocusMap;
                //如果图层选择框为空
                if (comboBoxTrainingStartImage.Items.Count == 0)
                {
                    for (int i = 0; i < map.LayerCount; i++)
                    {
                        string layerName = map.get_Layer(i).Name;
                        comboBoxTrainingStartImage.Items.Add(layerName);
                        comboBoxTrainingEndImage.Items.Add(layerName);
                        comboBoxSimStartImage.Items.Add(layerName);
                        comboBoxSimEndImage.Items.Add(layerName);
                    }
                }
            }
            //切换到土地利用类型设置页时首先获取图层信息,然后填充土地利用类型
            else if (e.OldIndex == 2 && e.NewIndex == 3)
            {
                listVariableLayersName.Clear();
                trainingStartImageName = comboBoxTrainingStartImage.SelectedItem.ToString();
                trainingEndImageName   = comboBoxTrainingEndImage.SelectedItem.ToString();
                for (int i = 0; i < dataGridViewVariableDatas.Rows.Count; i++)
                {
                    listVariableLayersName.Add(dataGridViewVariableDatas.Rows[i].Cells[0].Value.ToString());
                }

                //如果已经完成了回归,则不再进行
                if (isRegressed)
                {
                    return;
                }

                dataGridViewLandUse.Rows.Clear();
                IRasterLayer rasterLayer = ArcGISOperator.GetRasterLayerByName(trainingStartImageName);
                IRasterUniqueValueRenderer  rasterUniqueValueRenderer  = (IRasterUniqueValueRenderer)rasterLayer.Renderer;
                IRasterRendererUniqueValues rasterRendererUniqueValues = (IRasterRendererUniqueValues)rasterUniqueValueRenderer;
                IUniqueValues uniqueValues     = rasterRendererUniqueValues.UniqueValues;
                List <object> listUniqueValues = new List <object>();
                for (int i = 0; i < uniqueValues.Count; i++)
                {
                    listUniqueValues.Add(uniqueValues.get_UniqueValue(i));
                }
                int classCount = rasterUniqueValueRenderer.get_ClassCount(0);
                for (int i = 0; i < classCount; i++)
                {
                    dataGridViewLandUse.Rows.Add();
                    dataGridViewLandUse.Rows[i].Cells[0].Value = listUniqueValues[i];
                    dataGridViewLandUse.Rows[i].Cells[1].Value = rasterUniqueValueRenderer.get_Label(0, i);

                    ISymbol     symbol     = rasterUniqueValueRenderer.get_Symbol(0, i);
                    IFillSymbol fillSymbol = symbol as IFillSymbol;
                    //ISimpleFillSymbol simpleFillSymbol = (ISimpleFillSymbol)symbol;
                    //IColor esriColor = simpleFillSymbol.Color;
                    IColor    esriColor = fillSymbol.Color;
                    IRgbColor rgbColor  = new RgbColorClass();
                    rgbColor.CMYK = esriColor.CMYK;
                    Color color = Color.FromArgb(rgbColor.Red, rgbColor.Green, rgbColor.Blue);
                    dataGridViewLandUse.Rows[i].Cells[3].Value =
                        GeneralOpertor.GetBitmap(15, 15, color);
                }
                ColumnLUCharacter.Items.Clear();
                ColumnLUCharacter.Items.Add(resourceManager.GetString("String6"));
                ColumnLUCharacter.Items.Add(resourceManager.GetString("String7"));
                ColumnLUCharacter.Items.Add(resourceManager.GetString("String8"));
            }
            //切换到逻辑回归计算页面时进行计算
            if (e.OldIndex == 3 && e.NewIndex == 4)
            {
                if (isRegressed)
                {
                    return;
                }

                dataGridViewLogisticRegressionCoeff.Rows.Clear();
                labelCalculte.Text           = resourceManager.GetString("String9");
                labelCalculte.Visible        = true;
                progressBarCalculate.Visible = true;
                Application.DoEvents();

                //1.读取起始图像、终止图像、各变量图像为数组
                IRasterLayer   rasterLayerStartImage = ArcGISOperator.GetRasterLayerByName(comboBoxTrainingStartImage.SelectedItem.ToString());
                IRasterLayer   rasterLayerEndImage   = ArcGISOperator.GetRasterLayerByName(comboBoxTrainingEndImage.SelectedItem.ToString());
                RasterSampling rasterSampling        = new RasterSampling();
                labelCalculte.Text = resourceManager.GetString("String12");
                Application.DoEvents();
                List <int> notNullRows;
                List <int> notNullColumns;
                trainingStartImage = ArcGISOperator.ReadRasterAndGetNotNullRowColumn(rasterLayerStartImage, out structRasterMetaData,
                                                                                     out notNullRows, out notNullColumns);
                //获取最小空间范围
                List <IRasterLayer> listVariablesLayers = new List <IRasterLayer>();
                for (int i = 0; i < listVariableLayersName.Count; i++)
                {
                    listVariablesLayers.Add(ArcGISOperator.GetRasterLayerByName(listVariableLayersName[i]));
                }
                ArcGISOperator.GetSmallestBound(rasterLayerStartImage, rasterLayerEndImage, listVariablesLayers, ref structRasterMetaData);

                labelCalculte.Text = resourceManager.GetString("String13");
                Application.DoEvents();
                trainingEndImage     = ArcGISOperator.ReadRaster(rasterLayerEndImage, structRasterMetaData.NoDataValue);
                float[,] changeImage = GeneralOpertor.GetBinaryImageByTwoImages(trainingStartImage, trainingEndImage, structRasterMetaData.RowCount,
                                                                                structRasterMetaData.ColumnCount, structRasterMetaData.NoDataValue);
                //GeneralOpertor.WriteDataFloat(GetOutputFolder() + @"\lr_change.txt", changeImage, structRasterMetaData.RowCount, structRasterMetaData.ColumnCount);

                foreach (string layerName in listVariableLayersName)
                {
                    labelCalculte.Text = resourceManager.GetString("String14") + layerName + ".....";
                    Application.DoEvents();
                    varibaleImages.Add(ArcGISOperator.ReadRaster(ArcGISOperator.GetRasterLayerByName(layerName), structRasterMetaData.NoDataValue));
                }
                //2.按设置的比例进行随机抽样,得到抽样结果,然后计算
                //1.进行抽样
                labelCalculte.Text = resourceManager.GetString("String11");
                Application.DoEvents();
                int samplingCellsCount = (int)(structRasterMetaData.RowCount * structRasterMetaData.ColumnCount * numericUpDownSamplingPrecent.Value / 100);
                float[,] datas = new float[samplingCellsCount, listVariableLayersName.Count + 1];
                //抽取真值的比例默认设置为一半
                datas = rasterSampling.SamplingData(varibaleImages, changeImage, (double)numericUpDownSamplingPrecent.Value,
                                                    50, structRasterMetaData, notNullRows, notNullColumns);
                //2.进行计算
                labelCalculte.Text = resourceManager.GetString("String9");
                Application.DoEvents();
                //输出抽样结果数据
                //GeneralOpertor.WriteDataFloat(GetOutputFolder() + @"\lrSamplingData.txt", datas,
                //    rasterSampling.SamplingCellsCount, listVariableLayersName.Count + 1);

                //3.使用Accord.NET进行逻辑回归计算
                labelCalculte.Text = resourceManager.GetString("String9");
                Application.DoEvents();
                LogisticRegression lr = new LogisticRegression();
                double[]           odds;
                double[]           stde;
                double[]           min;
                double[]           max;
                lr.LogisticRegresssionAanlysis(datas, rasterSampling.SamplingCellsCount, listVariableLayersName.Count + 1,
                                               out coef, out odds, out stde, out min, out max);

                for (int i = 0; i < listVariableLayersName.Count + 1; i++)
                {
                    dataGridViewLogisticRegressionCoeff.Rows.Add();
                    if (i == 0)
                    {
                        dataGridViewLogisticRegressionCoeff.Rows[i].Cells[0].Value = resourceManager.GetString("String15");
                    }
                    else
                    {
                        dataGridViewLogisticRegressionCoeff.Rows[i].Cells[0].Value = listVariableLayersName[i - 1];
                    }
                    dataGridViewLogisticRegressionCoeff.Rows[i].Cells[1].Value = coef[i];
                    dataGridViewLogisticRegressionCoeff.Rows[i].Cells[2].Value = odds[i];
                    dataGridViewLogisticRegressionCoeff.Rows[i].Cells[3].Value = stde[i];
                    dataGridViewLogisticRegressionCoeff.Rows[i].Cells[4].Value = max[i];
                    dataGridViewLogisticRegressionCoeff.Rows[i].Cells[5].Value = min[i];
                }

                labelCalculte.Visible        = false;
                progressBarCalculate.Visible = false;
                Application.DoEvents();
                isRegressed = true;
            }
            //切换到模拟参数设置页时给定控件初始值,同时保存模拟数据信息
            else if (e.OldIndex == 4 && e.NewIndex == 5)
            {
                if (comboBoxSimEndImage.SelectedIndex == -1)
                {
                    buttonCalConvertCells.Enabled = false;
                }
                else
                {
                    buttonCalConvertCells.Enabled = true;
                }
            }
            //切换到模拟过程参数设置页时给定控件初始值,同时保存模拟参数信息
            else if (e.OldIndex == 5 && e.NewIndex == 6)
            {
                simulationStartImageName = comboBoxSimStartImage.SelectedItem.ToString();
                if (comboBoxSimEndImage.SelectedIndex != -1)
                {
                    simulationEndImageName = comboBoxSimEndImage.SelectedItem.ToString();
                }

                convertCount         = Convert.ToInt32(numericUpDownConvertCount.Value);
                simulationIterations = Convert.ToInt32(numericUpDownIterations.Value);
                delta = Convert.ToInt32(numericUpDownDelta.Value);

                numericUpDownRefresh.Value     = 10;
                numericUpDownOutputImage.Value = 10;
                outputFolder             = GetOutputFolder();
                textBoxOutputFolder.Text = outputFolder;
            }
            //切换到完成页时填充摘要,同时保存模拟过程输出参数的信息
            else if (e.OldIndex == 6 && e.NewIndex == 7)
            {
                refreshInterval     = Convert.ToInt32(numericUpDownRefresh.Value);
                outputImageInterval = Convert.ToInt32(numericUpDownOutputImage.Value);
                if (radioButtonOutput.Checked)
                {
                    isOutput = true;
                }
                else
                {
                    isOutput = false;
                }
                outputFolder = textBoxOutputFolder.Text;

                textBoxSummay.Text = WriteSummay();
            }
        }