Beispiel #1
0
        //--------------------------------------------------------------------------------------------------------------------

        private void buttonFicIn_Click(object sender, EventArgs e)
        {
            if (openFileDialogFicIn.ShowDialog() == DialogResult.OK)
            {
                if ((myStream = openFileDialogFicIn.OpenFile()) != null)
                {
                    string nomFicIn = Path.GetFileNameWithoutExtension(openFileDialogFicIn.FileName);
                    textBoxFicIn.Text  = nomFicIn;
                    textBoxFicOut.Text = "Startlist " + nomFicIn;
                    // Insert code to read the stream here.
                    myStream.Close();
                    fichierGeco = File.ReadAllLines(openFileDialogFicIn.FileName);
                    if (fichierGeco.GetLength(0) > 1)
                    {
                        bool first = true;
                        foreach (string s in fichierGeco)
                        {
                            if (first)
                            {
                                // saut de la première ligne
                                first = false;
                            }
                            else
                            {
                                Resultats lig = new Resultats();
                                if (lig.Parse(s, double.Parse(textBoxPenalitePM.Text)))
                                {
                                    if (table.ContainsKey(lig.Puce))
                                    {
                                        // puce deja utilisee : on ajoute le nouveau temps
                                        table[lig.Puce].AddTemps(lig.TempsTotal, lig.Indice);
                                    }
                                    else
                                    {
                                        table.Add(lig.Puce, lig);
                                    }
                                }
                            }
                        }// fichier OK
                        buttonRun.Enabled   = true;
                        groupBox1.Enabled   = true;
                        groupBox2.Enabled   = true;
                        buttonFicIn.Enabled = false;

                        CreationTableauPrec();
                        CreationTableauNouv();
                    }
                }
            }
        }
Beispiel #2
0
        //--------------------------------------------------------------------------------------------------------------------
        private void buttonFicIn_Click(object sender, EventArgs e)
        {
            if (openFileDialogFicIn.ShowDialog() == DialogResult.OK)
            {
                if ((myStream = openFileDialogFicIn.OpenFile()) != null)
                {
                    string nomFicIn = Path.GetFileNameWithoutExtension(openFileDialogFicIn.FileName);
                    textBoxFicIn.Text = nomFicIn;
                    textBoxFicOut.Text = "Startlist " + nomFicIn;
                    // Insert code to read the stream here.
                    myStream.Close();
                    fichierGeco = File.ReadAllLines(openFileDialogFicIn.FileName);
                    if (fichierGeco.GetLength(0) > 1)
                    {
                        bool first = true;
                        foreach (string s in fichierGeco)
                        {
                            if (first)
                            {
                                // saut de la première ligne
                                first = false;
                            }
                            else
                            {
                                Resultats lig = new Resultats();
                                if (lig.Parse(s,double.Parse(textBoxPenalitePM.Text)))
                                {
                                    if (table.ContainsKey(lig.Puce))
                                    {
                                        // puce deja utilisee : on ajoute le nouveau temps
                                        table[lig.Puce].AddTemps(lig.TempsTotal,lig.Indice);
                                    }
                                    else
                                    {
                                        table.Add(lig.Puce, lig);
                                    }
                                }
                            }
                        }// fichier OK
                        buttonRun.Enabled = true;
                        groupBox1.Enabled = true;
                        groupBox2.Enabled = true;
                        buttonFicIn.Enabled = false;

                        CreationTableauPrec();
                        CreationTableauNouv();

                    }
                }
            }
        }