コード例 #1
0
        private void BtnImportar_Click(object sender, EventArgs e)
        {
            LerArquivo leitor = new LerArquivo();

            if (!leitor.CancelouOperação())
            {
                g.Clear(Color.White);
                ForcarLimpeza();
                leitor.PlotarCoordenadas();

                #region Cria a população assim que importa

                //Cria a população assim que importa e já gera os ponto na tela
                txtTamPop.Text = txtTamPop.Text.Equals("") ? "1" : txtTamPop.Text;
                ConfigurationGA.tamPopulacao = int.Parse(txtTamPop.Text);

                pop                 = new Population();
                countAux            = count;
                btnCriarPop.Enabled = true;
                btnExecutar.Enabled = false;
                btnLimpar.Enabled   = true;

                pointCount        += TablePoints.pointCount;
                lbQtdeCidades.Text = pointCount.ToString();
                PlotPoints();

                #endregion
            }
            else
            {
                PlotPoints();

                if (pop != null || count_exec != 0)
                {
                    PlotLines(pop, Color.Blue);
                }
            }
        }