Example #1
0
        //public int[] N_NODES = new int[2];

        //public List<string[]> NodeData1 = new List<string[]>();
        //public List<string[]> NodeData2 = new List<string[]>();

        //public string[] split;

        //public FEDFile()
        //{
        //    loadData();
        //}


        //private void loadData()
        //{
        //    //Load all data into the data manager

        //    DataManager dataManager = DataManager.Instance;

        //    dataManager.set("NELEMS", N_NODES[0]);
        //    dataManager.set("NNODES", N_NODES[1]);
        //    dataManager.set("MESHNODESDATA", NodeData1);
        //    dataManager.set("MESHCONECTIVITYDATA", NodeData2);


        //}

        //public void save(string filename)
        //{
        //    TextWriter w = new StreamWriter(filename);

        //    string newLine;
        //    DataManager dataManager = DataManager.Instance;

        //    NodeData1 = (List<string[]>)dataManager.get("MESHNODESDATA");
        //    NodeData2 = (List<string[]>)dataManager.get("MESHCONECTIVITYDATA");

        //    newLine = Convert.ToString(N_NODES[0]) + "   " + Convert.ToString(N_NODES[1]);

        //    w.WriteLine(newLine);

        //    for (int i = 0; i < 2; ++i)
        //    {

        //        for (int j = 0; j < N_NODES[i]; ++j)
        //        {

        //            if (i == 0)
        //                newLine = NodeData1[j][0];
        //            else
        //                newLine = NodeData2[j][0];

        //            w.WriteLine(newLine);
        //        }
        //    }
        //    w.Close();

        //}

        //public bool load(string filename)
        //{

        //    StreamReader s = File.OpenText(filename);
        //    string read;

        //    NodeData1.Clear();
        //    NodeData2.Clear();

        //    read = s.ReadLine().Trim();

        //    split = read.Split(new Char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);

        //    N_NODES[0] = Convert.ToInt32(split[0]);
        //    N_NODES[1] = Convert.ToInt32(split[1]);

        //    for (int i = 0; i < 2; ++i)
        //    {

        //        for (int j = 0; j < N_NODES[i]; ++j)
        //        {
        //            read = s.ReadLine().Trim();
        //            split = read.Split(new Char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);


        //            if (i == 0)
        //                NodeData1.Add(new string[] { Convert.ToDouble(split[0]).ToString("N2"), Convert.ToDouble(split[1]).ToString("N2"),
        //                                             Convert.ToDouble(split[2]).ToString("N2"), Convert.ToDouble(split[3]).ToString("N2"),
        //                                             Convert.ToDouble(split[4]).ToString("N2"),Convert.ToDouble(split[5]).ToString("N2")});
        //            else
        //                NodeData2.Add(new String[] { read });
        //        }
        //    }


        //    s.Close();

        //    loadData();

        //    return true;
        //}
        #endregion for old code for loading and saving .FED files

        //read file names
        public string[] ReadFileNames(string filename)
        {
            StreamReader s    = File.OpenText(filename);
            string       line = s.ReadLine();

            string[] split            = line.Split(new Char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            int      numberOfElements = Convert.ToInt32(split[0]);
            int      numberOfNodes    = Convert.ToInt32(split[1]);

            var fileNames = new string[numberOfNodes];

            try
            {
                for (int i = 0; i < numberOfNodes; ++i)
                {
                    //node, X, Y, initial bed elevation, initial water elevation, max erosion depth, boundary condition type, file name
                    line  = s.ReadLine();
                    split = line.Split(new Char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);

                    fileNames[i] = split[6];
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 0601120956: error trying to read .FED file.", "ERROR 0601120956: error leyendo archivo .FED."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            s.Close();

            return(fileNames);
        }
Example #2
0
 public static void AddColumnsToBedLoadSedimentTable(string fileName, DataGridView dataBedLoadSediment)
 {
     try
     {
         //Add required number of columns to dataBedLoadSediment dataGridView.
         StreamReader s;
         s = File.OpenText(fileName.Remove(fileName.Length - 4) + "SEDB");
         string read = s.ReadLine();
         read = s.ReadLine();                 //Number of sediments.
         for (int i = 1; i <= Convert.ToInt32(read); i++)
         {
             DataGridViewColumn col = new DataGridViewTextBoxColumn();
             col.Name       = "Sediment" + (i).ToString();
             col.HeaderText = "Frac. " + (i).ToString();
             col.Width      = 63;
             col.SortMode   = DataGridViewColumnSortMode.NotSortable;
             dataBedLoadSediment.Columns.Add(col);
         }
         s.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(Universal.Idioma("ERROR 1811131622: error adding columns to bed load sediment table. ", "ERROR 1811131622: error agregando columnas a la tabla de sedimentos. ") +
                         ex.Message, "RiverFlow2D",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #3
0
        // Read file names.
        public string[] ReadFileNames(string filename)
        {
            StreamReader s    = File.OpenText(filename);
            string       read = s.ReadLine();
            int          numberOfCoulverts = Convert.ToInt32(read);

            var fileNames = new string[numberOfCoulverts];

            try
            {
                for (int i = 0; i < numberOfCoulverts; ++i)
                {
                    //culvert ID
                    s.ReadLine();
                    //culvert type
                    s.ReadLine();
                    //name of file
                    fileNames[i] = s.ReadLine();
                    //x1 y1 x2 y2
                    s.ReadLine();
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 1412110914: error trying to read .CULVERTS file.", "ERROR 1412110914: error leyendo archivo .CULVERTS."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            s.Close();
            return(fileNames);
        }
Example #4
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (txtProjectNameAndLocation.Text == "")
     {
         MessageBox.Show(Universal.Idioma("A project name is required.", "Se requiere un nombre de proyecto."),
                         "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         if (radioPlusGPU.Checked)
         {
             Universal.OpenProjectExit = "Model GPU";
             Close();
         }
         else if (radioPlus.Checked)
         {
             Universal.OpenProjectExit = "Model CPU";
             Close();
         }
         else if (radioFE.Checked)
         {
             Universal.OpenProjectExit = "Model FE";
             Close();
         }
         Universal.ProjectPathAndName = txtProjectNameAndLocation.Text;
     }
 }
Example #5
0
        public static void RemoveColumnsFromBedLoadSedimentTable(DataGridView dataBedLoadSediment, int fromColumn)
        {
            try
            {
                while (dataBedLoadSediment.Columns.Count > fromColumn)
                {
                    string columnName;
                    if (fromColumn == 0)
                    {
                        columnName = dataBedLoadSediment.Columns[0].Name;
                    }
                    else
                    {
                        columnName = dataBedLoadSediment.Columns[1].Name;
                    }

                    dataBedLoadSediment.Columns.Remove(columnName);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Universal.Idioma("ERROR 1811131609: error while creating bed load sediment table. ", "ERROR 1811131609: error creando tabla de sedimentos. ") +
                                ex.Message, "RiverFlow2D",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #6
0
        //read file names
        public string[] ReadFileNames(string filename)
        {
            StreamReader s             = File.OpenText(filename);
            string       read          = s.ReadLine();
            int          numberOfNodes = Convert.ToInt32(read);

            var fileNames = new string[numberOfNodes];

            try
            {
                for (int i = 0; i < numberOfNodes; ++i)
                {
                    //node, boundary condition type, file name
                    string   line  = s.ReadLine();
                    string[] split = line.Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);

                    fileNames[i] = split[2];
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 1412111009: error trying to read .IFL file.", "ERROR 1412111009: error leyendo archivo .IFL."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            s.Close();

            return(fileNames);
        }
Example #7
0
        //read file names
        public string[] ReadFileNames(string filename)
        {
            StreamReader s               = File.OpenText(filename);
            string       read            = s.ReadLine();
            int          numberOfSOURCES = Convert.ToInt32(read);

            var fileNames = new string[numberOfSOURCES];

            try
            {
                new List <string[]>();
                for (int i = 0; i < numberOfSOURCES; ++i)
                {
                    //source name
                    s.ReadLine();
                    //source type
                    s.ReadLine();
                    //name of file
                    fileNames[i] = s.ReadLine();
                    //x y
                    string line = s.ReadLine();
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 1412110624: error trying to read .SOURCES file.", "ERROR 1412110624: error leyendo archivo .SOURCES."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            s.Close();

            return(fileNames);
        }
Example #8
0
        //Update grapher when a new dataset is selected
        private void cmboDataShown_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (cmboDataShown.SelectedIndex == 0)
                {
                    //"All" is selected
                    for (int i = 0; i < _mINumDatos; ++i)
                    {
                        _mBShown[i] = true;
                    }
                }
                else
                {
                    //Set the specified dataset
                    for (int i = 0; i < _mINumDatos; ++i)
                    {
                        _mBShown[i] = false;
                    }
                    _mBShown[cmboDataShown.SelectedIndex - 1] = true;
                }

                UpdateData();
                Refresh();
            }
            catch (Exception ex)
            {
                MessageBox.Show(Universal.Idioma("ERROR 2003160956: error while selecting graph. ", "ERROR 2003160956: error seleccionando gráfico. ") +
                                ex.Message, "RiverFlow2D",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
        public virtual void Load(string filename)
        {
            UpdateDependants();

            //Load all data into the data manager
            StreamReader s = File.OpenText(filename);

            try
            {
                int cantLines = FileStructure.Count;
                for (int i = 0; i < cantLines; ++i)
                {
                    //Check if data member is dependent
                    if (FileStructure[i][0].Dependent != null)
                    {
                        ProcessDependentVariables(s, i);
                    }
                    else
                    {
                        ProcessNormalVariables(s, i);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Universal.Idioma("ERROR 1205121043: error trying to open file ", "ERROR 1205121043: error abriendo archivo ")
                                + filename + ". " + Environment.NewLine + ex.Message, "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                s.Close();
            }
        }
Example #10
0
        //Save data to file
        public virtual void Save(string filename)
        {
            TextWriter w = new StreamWriter(filename);

            try
            {
                var profiles   = (List <string[]>)GetVariable("PROFILE_VALUES");
                var n_profiles = (int)GetVariable("NUMBER_OF_PROFILES");

                //number of profiles
                w.WriteLine(n_profiles);

                string name = "";
                for (int j = 0; j < profiles.Count; ++j)
                {
                    if (name != profiles[j][0].Trim())
                    {
                        //profiled name
                        w.WriteLine(profiles[j][0]);
                        name = profiles[j][0].Trim();
                        //Number of vertices & profile coeff
                        w.WriteLine(profiles[j][1] + " " + profiles[j][2]);
                    }

                    //X, Y
                    w.WriteLine(profiles[j][3] + " " + profiles[j][4]);
                }



                //   var profiles = (List<string[]>)GetVariable("PROFILE_VALUES");
                //   var numberOfRows = (int)GetVariable("NUMBER_OF_PROFILES");

                ////number of profiles
                //   w.WriteLine(profiles.Count);

                //   string name = "";
                //   for (int j = 0; j < profiles.Count; ++j)
                //   {
                //       if (name != profiles[j][0].Trim())
                //       {
                //           //profiled name
                //           w.WriteLine(profiles[j][0]);
                //           name = profiles[j][0].Trim();
                //           //Number of vertices & profile coeff
                //           w.WriteLine(profiles[j][1] + " " + profiles[j][2]);
                //       }

                //       //X, Y
                //       w.WriteLine(profiles[j][3] + " " + profiles[j][4]);
                //   }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 2199110812: error trying to save .PROFILES file.", "ERROR 2199110812: error leyendo archivo .PROFILES."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            w.Close();
        }
Example #11
0
        //Load data from file
        public virtual void Load(string filename)
        {
            //Load all data into the data manager
            StreamReader s = File.OpenText(filename);

            try
            {
                string read             = s.ReadLine();
                int    numberOfPROFILES = Convert.ToInt32(read);

                AddVariable("NUMBER_OF_PROFILES", numberOfPROFILES);

                var profiles = new List <string[]>();
                for (int i = 0; i < numberOfPROFILES; ++i)
                {
                    //profile name
                    string name = s.ReadLine().Trim();

                    string   line  = s.ReadLine();
                    string[] split = line.Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);

                    var row = new string[3];

                    row[0] = name;
                    // number of vertices:
                    row[1] = split[0];
                    // number of intervals:
                    row[2] = split[1];

                    for (int j = 0; j < Convert.ToInt32(row[1]); ++j)
                    {
                        var row2 = new string[5];

                        //Name
                        row2[0] = row[0];
                        //N vertices
                        row2[1] = row[1];
                        //N intervals
                        row2[2] = row[2];
                        //x1 y1
                        line    = s.ReadLine();
                        split   = line.Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                        row2[3] = split[0];
                        row2[4] = split[1];

                        profiles.Add(row2);
                    }
                }

                AddVariable("PROFILE_VALUES", profiles);
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 2199110811: error trying to read .PROFILES file.", "ERROR 2199110811: error leyendo archivo .PROFILES."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            s.Close();
        }
Example #12
0
        //Save WIND data to file
        public virtual void Save(string WINDPLUSFileName)
        {
            try
            {
                if (WINDFileContents.Count > 0)
                {
                    { //Write .WIND file:
                        TextWriter w = new StreamWriter(WINDPLUSFileName);
                        //number of wind zones and parameters:
                        w.WriteLine(WINDFileContents.Count);
                        w.WriteLine(GetVariable("WINDPLUS_STRESSCOEFF_CD"));
                        w.WriteLine(GetVariable("WINDPLUS_AIRDENSITY"));

                        for (int i = 0; i < WINDFileContents.Count; ++i)
                        {
                            //wind file name, rows
                            w.WriteLine(WINDFileContents[i].SecondaryFileName);
                            w.WriteLine(WINDFileContents[i].nExtraLines);
                            for (int j = 0; j < WINDFileContents[i].nExtraLines; ++j)
                            {
                                w.WriteLine(WINDFileContents[i].ExtraData[j]);
                            }
                        }
                        w.Close();
                    }

                    // Write secondary wind data files.
                    int nColumns = 3;
                    Universal.SaveSecondaryTables("WIND", nColumns);

                    //foreach (Universal.SecondaryGroup aGroup in Universal.SecondaryGroups.Values)
                    //{
                    //    if (aGroup.Component == "WIND")
                    //    {
                    //        TextWriter secondaryFile = new StreamWriter(aGroup.FileName);

                    //        secondaryFile.WriteLine(aGroup.NPoints);
                    //        for (int i = 0; i < aGroup.NPoints; i++)
                    //        {
                    //            secondaryFile.WriteLine(aGroup.Table[i].Col0 + "   " +
                    //                                aGroup.Table[i].Col1 + "   " +
                    //                                aGroup.Table[i].Col2);
                    //        }
                    //        secondaryFile.Close();
                    //    }
                    //}
                }
                else
                {
                    MessageBox.Show(Universal.Idioma("The wins table is empty. It was not saved.", "La tabla de viento está vacía. No fue almacenada."),
                                    "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 1903170641: error while saving .WIND file.", "ERROR 1903170641: error almacenando archivo .WIND."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #13
0
        //Save .LRAIN data to file
        public virtual void Save(string LINFFileName)
        {
            try
            {
                if (LRAINFileContents.Count > 0)
                {
                    {        //Write .LRAIN file:
                        TextWriter w = new StreamWriter(LINFFileName);
                        //number of rain/evaporation zones and parameters:
                        w.WriteLine(LRAINFileContents.Count);


                        for (int i = 0; i < LRAINFileContents.Count; ++i)
                        {
                            w.WriteLine(LRAINFileContents[i].SecondaryFileName);
                            w.WriteLine(LRAINFileContents[i].nExtraLines);
                            for (int j = 0; j < LRAINFileContents[i].nExtraLines; ++j)
                            {
                                w.WriteLine(LRAINFileContents[i].ExtraData[j]);
                            }
                        }
                        w.Close();
                    }

                    // Write secondary rain/evaporation data files.
                    int nColumns = 3;
                    Universal.SaveSecondaryTables("LRAIN", nColumns);

                    //foreach (Universal.SecondaryGroup aGroup in Universal.SecondaryGroups.Values)
                    //{
                    //    if (aGroup.Component == "LRAIN")
                    //    {
                    //	    TextWriter secondaryFile = new StreamWriter(aGroup.FileName);

                    //	    secondaryFile.WriteLine(aGroup.NPoints);
                    //	    for (int i = 0; i < aGroup.NPoints; i++)
                    //	    {
                    //	    secondaryFile.WriteLine(aGroup.Table[i].Col0 + "   " +
                    //						    aGroup.Table[i].Col1 + "   " +
                    //						    aGroup.Table[i].Col2);
                    //	    }
                    //	    secondaryFile.Close();
                    //    }
                    //}
                }
                else
                {
                    MessageBox.Show(Universal.Idioma("The rain/evaporation table is empty. It was not saved.",
                                                     "La tabla de lluvia/evaporación está vacía. No fue almacenada"),
                                    "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 2103170805: error while saving .LRAIN file.", "ERROR 2103170805: error almacenando .LRAIN."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #14
0
        public virtual void LoadOBCPNodes(int group)
        {
            StreamReader OBCPFile = File.OpenText(OBCPFilePathAndName);

            try
            {
                string nGroups        = OBCPFile.ReadLine().Trim();
                int    numberOfGroups = Convert.ToInt32(nGroups);

                var nodes = new List <string[]>();

                for (int i = 0; i < numberOfGroups; ++i)
                {
                    if (i == group)
                    {
                        string dummy            = OBCPFile.ReadLine().Trim();
                        string openBoundaryType = OBCPFile.ReadLine().Trim();
                        string fileName         = OBCPFile.ReadLine().Trim();

                        int nNodes = Convert.ToInt16(OBCPFile.ReadLine().Trim());

                        for (int j = 0; j < nNodes; ++j)
                        {
                            string node = OBCPFile.ReadLine().Trim();
                            var    row  = new string[2];
                            row[0] = Convert.ToString(j + 1);
                            row[1] = node;
                            nodes.Add(row);
                        }

                        AddVariable("OBCP_NODES_VALUES", nodes);
                        break;
                    }
                    else
                    {
                        string dummy    = OBCPFile.ReadLine();
                        string type     = OBCPFile.ReadLine();
                        string fileName = OBCPFile.ReadLine();

                        int nNodes = Convert.ToInt16(OBCPFile.ReadLine().Trim());
                        for (int j = 0; j < nNodes; ++j)
                        {
                            OBCPFile.ReadLine();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Universal.Idioma("ERROR 0102161050: error trying to read .OBCP file. ", "ERROR 0102161050: error leyendo archivo .OBCP. ") +
                                ex.Message, "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            OBCPFile.Close();
        }
Example #15
0
        private void btnReactivateLicense_Click(object sender, EventArgs e)
        {
            var    proc        = new Process();
            string licensePath = Application.StartupPath;

            if (File.Exists(licensePath + "\\ReactivateLicense.exe"))
            {
                try
                {
                    //proc.StartInfo.FileName = @"C:\WINDOWS\NOTEPAD.EXE";
                    proc.StartInfo.FileName               = Application.StartupPath + "\\ReactivateLicense.exe";
                    proc.StartInfo.UseShellExecute        = true;
                    proc.StartInfo.RedirectStandardOutput = false;
                    proc.StartInfo.WindowStyle            = ProcessWindowStyle.Hidden;
                    proc.Start();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(Universal.Idioma("ERROR 100618.0659: error reactivating RiverFlow2D license!. ", "ERROR 100618.0659: ¡error reactivando licencia de RiverFlow2D! ") + ex.Message,
                                    "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show(Universal.Idioma("Reactivation of license of RiverFlow2D not found!", "¡No se encontró el reactivador de licencia de RiverFLow2D¡"),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                var openFileDialog = new OpenFileDialog
                {
                    Filter          = "ReactivateLicense.exe (*.exe)|*.exe",
                    FilterIndex     = 1,
                    Title           = "Choose ReactivateLicense.exe",
                    CheckFileExists = true,
                    FileName        = "ReactivateLicense.exe"
                };

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        proc.StartInfo.FileName               = openFileDialog.FileName;
                        proc.StartInfo.UseShellExecute        = true;
                        proc.StartInfo.RedirectStandardOutput = false;
                        proc.StartInfo.WindowStyle            = ProcessWindowStyle.Hidden;
                        proc.Start();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(Universal.Idioma("ERROR 100618.0659: error reactivating RiverFlow2D license!. ", "ERROR 100618.0659: ¡error reactivando licencia de RiverFlow2D! ") + ex.Message,
                                        "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
 private void btnApply_Click(object sender, EventArgs e)
 {
     if (dataPolylineCoords.Rows.Count == 2)
     {
         MessageBox.Show(Universal.Idioma("A line can't have only one point.", "Una línea no puede tener un solo punto."),
                         "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         Close();
     }
 }
Example #17
0
        //***** Data File *****
        //Insert data that wants to be included in the text file with the X and Y
        public void AddExtraData(ArrayList newData, string dataName)
        {
            if (((ArrayList)_mData[0]).Count != newData.Count)
            {
                MessageBox.Show(Universal.Idioma("The number of extra data is different than the number of points being plotted.",
                                                 "El número de datos extra es distinto al de número de puntos."));
                return;
            }

            //Add data to data array
            _mExtraData.Add(newData);
            _mExtraDataName.Add(dataName);
        }
Example #18
0
        private void RiverFlo2DAboutBox_Load(object sender, EventArgs e)
        {
            if (RiverFlo2D.RiverDipModel == "Model CPU")
            {
                labelProductName.Text = "RiverFlow2D CPU";
                labelVersion.Text     = "Version 06.10.05";
                labelCopyright.Text   = "Copyright ©2009-2018";
                //textBoxDescription.Text = Universal.Idioma(
                //    "RiverFlow2D Plus is a hydrodynamic model for rivers and estuaries that uses a stable and powerful finite volume" +
                //    " method to compute high resolution flood hydraulics, including supercritical and subcritical flows over dry or wet river beds. " +
                //    "RiverFlow2D Plus offers several complementary components including one for Mud and Debris flow simulations. " +
                //    "RiverFlow2D Plus uses flexible triangular-cell meshes that allow resolving the flow field, pollutant concentration distribution, " +
                //    "sediment transport and bed elevation changes in complex river environments.", "");

                textBoxDescription.Text = Universal.Idioma(
                    "RiverFlow2D is a integrated hydrodynamic-hydrologic model for rivers, estuaries, and coastal areas,  that uses a stable and powerful finite volume method to compute high resolution flood hydraulics, including supercritical and subcritical flows over dry or wet river beds. RiverFlow2D offers several complementary components including hydraulic structures, Sediment Transport, Water Quality, and Mud and Debris flow simulations. RiverFlow2D uses flexible triangular-cell meshes that allow resolving the flow field, pollutant concentration distribution, sediment transport and bed elevation changes in any river, coastal, and floodplain environments.",

                    "RiverFlow2D es un modelo hidrodinámico-hidrológico para ríos, estuarios y zonas costeras que utiliza un método de volúmenes finitos para calcular la hidráulica de inundaciones en alta resolución, incluyendo flujos supercríticos y subcríticos sobre lechos de secos o mojados. RiverFlow2D ofrece varios componentes complementarios que incluyen estructuras hidráulicas,  simulaciones de transporte de sedimentos, calidad del agua y flujo de lodo y escombros. RiverFlow2D utiliza mallas flexibles de celdas triangulares que permiten resolver el campo de flujo, la distribución de la concentración de contaminantes, el transporte de sedimentos y los cambios de elevación del lecho en cualquier entorno fluvial, costero y llanuras de inundación.");
            }
            else if (RiverFlo2D.RiverDipModel == "Model GPU")
            {
                labelProductName.Text = "RiverFlow2D GPU";
                labelVersion.Text     = "Version 06.10.05";
                labelCopyright.Text   = "Copyright ©2009-2018";
                //textBoxDescription.Text = Universal.Idioma(
                //	"RiverFlow2D Plus GPU is a hydrodynamic model for rivers and estuaries that uses a stable and powerful " +
                //	"finite volume method to compute high resolution flood hydraulics, including supercritical and subcritical " +
                //	"flows over dry or wet river beds. It runs in specialized Graphical Processing Unit hardware and is able to " +
                //	"run orders of magnitude faster than RiverFlow2D Plus.  RiverFlow2D Plus GPU offers several complementary " +
                //	"components including one for Mud and Debris flow simulations. RiverFlow2D Plus GPU uses flexible " +
                //	"triangular-cell meshes that allow resolving the flow field, pollutant concentration distribution, " +
                //	"sediment transport and bed elevation changes in complex river environments.", "");

                textBoxDescription.Text = Universal.Idioma(
                    "RiverFlow2D is a integrated hydrodynamic-hydrologic model for rivers, estuaries, and coastal areas,  that uses a stable and powerful finite volume method to compute high resolution flood hydraulics, including supercritical and subcritical flows over dry or wet river beds. RiverFlow2D offers several complementary components including hydraulic structures, Sediment Transport, Water Quality, and Mud and Debris flow simulations. RiverFlow2D uses flexible triangular-cell meshes that allow resolving the flow field, pollutant concentration distribution, sediment transport and bed elevation changes in any river, coastal, and floodplain environments.",

                    "RiverFlow2D es un modelo hidrodinámico-hidrológico para ríos, estuarios y zonas costeras que utiliza un método de volúmenes finitos para calcular la hidráulica de inundaciones en alta resolución, incluyendo flujos supercríticos y subcríticos sobre lechos de secos o mojados. RiverFlow2D ofrece varios componentes complementarios que incluyen estructuras hidráulicas,  simulaciones de transporte de sedimentos, calidad del agua y flujo de lodo y escombros. RiverFlow2D utiliza mallas flexibles de celdas triangulares que permiten resolver el campo de flujo, la distribución de la concentración de contaminantes, el transporte de sedimentos y los cambios de elevación del lecho en cualquier entorno fluvial, costero y llanuras de inundación.");
            }
            else if (RiverFlo2D.RiverDipModel == "Model FE")
            {
                labelProductName.Text   = "RiverFlow2D FE Model";
                labelVersion.Text       = "Version 06.10.05";
                labelCopyright.Text     = "Copyright ©2009-2018";
                textBoxDescription.Text =
                    "RiverFlow2D FE is a hydrodynamic  model for rivers and estuaries that uses a stable" +
                    " and powerful finite element method to compute high resolution flood hydraulics, including " +
                    "supercritical and subcritical flows over dry or wet river beds. RiverFlow2D FE offers Sediment " +
                    "and Pollutant Transport Modules using a flexible triangular mesh that allow resolving the flow field, " +
                    "pollutant concentration distribution, sediment transport and bed elevation changes in complex river environments.";
            }
        }
Example #19
0
        private void btnInstallNetworkLicenseServer_Click(object sender, EventArgs e)
        {
            var    proc       = new Process();
            string serverPath = Application.StartupPath;

            if (File.Exists("C:\\Program Files\\Hydronia\\LicenseManager\\CMSERVER.EXE"))
            {
                try
                {
                    proc.StartInfo.Arguments              = "/s";
                    proc.StartInfo.FileName               = "C:\\Program Files\\Hydronia\\LicenseManager\\CMSERVER.EXE";
                    proc.StartInfo.UseShellExecute        = true;
                    proc.StartInfo.RedirectStandardOutput = false;
                    proc.Start();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(Universal.Idioma("ERROR 100618.0713: error running RiverFlow2D network license server! ", "ERROR 100618.0659:¡error corriemdo el servidor de redes de RiverFlow2D¡ ") + ex.Message,
                                    "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show(Universal.Idioma("RiverFlow2d network license server not found!", "¡No se encontró el servidor de licencias de redes de RiverFlow2D!"), "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                var openFileDialog = new OpenFileDialog
                {
                    Filter          = "CMSERVER.EXE (*.exe)|*.exe",
                    FilterIndex     = 1,
                    Title           = "Choose CMSERVER.EXE",
                    CheckFileExists = true,
                    FileName        = "CMSERVER.EXE"
                };

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        proc.StartInfo.FileName               = openFileDialog.FileName;
                        proc.StartInfo.UseShellExecute        = true;
                        proc.StartInfo.RedirectStandardOutput = false;
                        proc.Start();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(Universal.Idioma("ERROR 100618.0713: error running RiverFlow2D network license server! ", "ERROR 100618.0659:¡error corriemdo el servidor de redes de RiverFlow2D¡ ") + ex.Message,
                                        "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Example #20
0
        public static void OpenHelp()
        {
            //Show help
            try
            {
                string filePathAndName = Application.StartupPath + "\\RiverFlow2D_Reference_Manual.pdf";
                bool   fileExists      = File.Exists(filePathAndName);
                if (!fileExists)
                {
                    if (DialogResult.OK ==
                        MessageBox.Show(Universal.Idioma(
                                            "RiverFlow2D_Reference_Manual.pdf file could not be found.\nPlease, search for a directory to find it.",
                                            "El archivo RiverFlow2D_Reference_Manual.pdf no se pudo encontrar.\nPor favor, indique un directorio para localizarlo."),
                                        "RiverFlow2D", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
                    {
                        var openFileDialog = new OpenFileDialog
                        {
                            Filter           = "RiverFlow2D help (*.pdf)|*.pdf",
                            FileName         = "RiverFlow2D_Reference_Manual.pdf",
                            FilterIndex      = 1,
                            RestoreDirectory = true,
                            CheckFileExists  = true,
                            ShowHelp         = true
                        };

                        if (openFileDialog.ShowDialog() == DialogResult.OK)
                        {
                            filePathAndName = openFileDialog.FileName;
                            fileExists      = true;
                        }
                    }
                }
                if (fileExists)
                {
                    string page       = "1";
                    var    pdfProcess = new Process();
                    pdfProcess.StartInfo.FileName  = "AcroRd32.exe";
                    pdfProcess.StartInfo.Arguments = "/A \"page=" + page + "\"C:\\TRACKS\\DOCS\\RiverFlow2D\\RiverFlow2D Manuals\\RiverFlow2D_Reference_Manual.pdf";
                    pdfProcess.Start();
                    //Process.Start(filePathAndName,"/a Page=5");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Universal.Idioma("Could not process the help file. ", "No se pudo procesar el archivo de ayuda")
                                + ex.Message, "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #21
0
        static void Main(string[] args)
        {
            try
            {
                Application.EnableVisualStyles();

                Application.SetCompatibleTextRenderingDefault(false);

                string[] arguments = Environment.GetCommandLineArgs();

                //Check that .2DM exists:
                if (args.Length > 0)
                {
                    var file2DM = args[0];

                    Boolean exists = File.Exists(file2DM);
                    if (exists)
                    {
                        //MessageBox.Show("% " + "(Main) " + ".2DM file: " + file2DM);
                        string fileDAT = file2DM.Remove(file2DM.Length - 3) + "DAT";
                        if (File.Exists(fileDAT))
                        {
                            //MessageBox.Show("% " + "(Main) " + ".DAT file: " + file2DM);
                            RiverFlo2D._DATPathAndFile = fileDAT;
                        }
                        else
                        {
                            MessageBox.Show(Universal.Idioma("ERROR 3003160939: file " + fileDAT + " doesn´t exist.", "ERROR 3003160939: archivo " + fileDAT + " no existe."),
                                            "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                    }
                    else
                    {
                        MessageBox.Show(Universal.Idioma("ERROR 1203160950: file " + file2DM + " doesn´t exist.", "ERROR 1203160950: archivo " + file2DM + " no existe."),
                                        "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }

                RiverFlo2D river = new RiverFlo2D();
                Application.Run(river);
            }
            catch (Exception ex)
            {
                MessageBox.Show(Universal.Idioma("ERROR 0403160714: error while starting Main in Program Class. ", "ERROR 0403160714: error comenzando Main en Program Class. ") +
                                ex.Message, "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #22
0
        //Save GATES data to file.
        public virtual void Save(string DAMBREACHFileName)
        {
            try
            {
                if (DAMBREACHFileContents.Count > 0)
                {
                    {//Write .DAMBREACH file:
                        TextWriter w = new StreamWriter(DAMBREACHFileName);
                        //number of breaches::
                        w.WriteLine(DAMBREACHFileContents.Count);



                        for (int i = 0; i < DAMBREACHFileContents.Count; ++i)
                        {
                            //dam breach name, coordinates, parameters, filename, rows
                            w.WriteLine(DAMBREACHFileContents[i].DamBreachName);
                            w.WriteLine(DAMBREACHFileContents[i].Coordinates);
                            w.WriteLine(DAMBREACHFileContents[i].Parameters);
                            w.WriteLine(DAMBREACHFileContents[i].SecondaryFileName);
                            w.WriteLine(DAMBREACHFileContents[i].nExtraLines);
                            for (int j = 0; j < DAMBREACHFileContents[i].nExtraLines; ++j)
                            {
                                w.WriteLine(DAMBREACHFileContents[i].ExtraData[j]);
                            }
                        }
                        w.Close();
                    }

                    //Write secondary temporal evolution data files.
                    int nColumns = 3;
                    Universal.SaveSecondaryTables("DAMBREACH", nColumns);
                }
                else
                {
                    MessageBox.Show(Universal.Idioma("The dam breach table is empty. It was not saved.", "La tabla de brechas esá vacía. No fue almacanada."),
                                    "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 1206171122: error while saving .DAMBREACH file.", "ERROR 1206171122: error almacenando archivo .DAMBREACH file."),

                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #23
0
        //Save data to file
        public virtual void Save(string filename) 
        {
            TextWriter w = new StreamWriter(filename);
            try
            {

                var weirs = (List<string[]>)GetVariable("WEIR_VALUES");
                int numberOfWEIRS = (int)GetVariable("NUMBER_OF_WEIRS");

                if (numberOfWEIRS > 0)
                {
	                //number of weirds 
                    w.WriteLine(numberOfWEIRS);

                    string name = "";
                    for (int j = 0; j < weirs.Count; ++j)
                    {
                        if (name != weirs[j][0].Trim())
                        {
                            //weird name
                            w.WriteLine(weirs[j][0]);
                            name = weirs[j][0].Trim();
                            //Number of vertices & weir coeff & crest elevation
														w.WriteLine(weirs[j][1] + " " + weirs[j][2] + " " + weirs[j][3]);
                        }

                        //X, Y
                        w.WriteLine(weirs[j][4] + " " + weirs[j][5] + " " + weirs[j][3]);
                    }
                }
                else
                {
                    //saveAllwarnings += "{0} " + "The weirs table is empty. It was not saved.";
                   MessageBox.Show(Universal.Idioma("The weirs table is empty. It was not saved.", "La tabla de vertederos está vacía. No fue almacenada."),
                       "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }                      
            }
            catch 
            {
                MessageBox.Show(Universal.Idioma("ERROR 1199119251: error trying to save .WEIRS file.", "ERROR 1199119251: error almacenando archivo .WEIRS."),
                    "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            w.Close();
        }
Example #24
0
        //Load data from file
        public virtual void Load(string filename)
        {
            //Load all data into the data manager
            StreamReader s = File.OpenText(filename);

            try
            {
                string read        = s.ReadLine();
                int    numberOfOBS = Convert.ToInt32(read);

                AddVariable("NUMBER_OF_OBS", numberOfOBS);

                var obs = new List <string[]>();

                for (int i = 0; i < numberOfOBS; ++i)
                {
                    //string[] row = new string[2];

                    //obs name
                    string name = s.ReadLine();

                    var row = new string[3];

                    row[0] = name.Trim();
                    string line = s.ReadLine();

                    //x1 y1
                    string[] split = line.Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    row[1] = split[0];
                    row[2] = split[1];

                    obs.Add(row);
                }

                AddVariable("OBS_VALUES", obs);
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 1599110742: error trying to read .OBS file.", "ERROR 1599110742: error leyendo archivo .OBS."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            s.Close();
        }
Example #25
0
        //Save data to file
        public virtual void Save(string filename)
        {
            TextWriter w = new StreamWriter(filename);

            try
            {
                var xsecs = (List <string[]>)GetVariable("XSEC_VALUES");

                //int numberOfRows = (int)GetVariable("NUMBER_OF_XSECS");
                //var xsecsNames = new List<string>();
                //new List<int>();

                w.WriteLine(xsecs.Count - 1);

                string name = "";

                for (int j = 0; j < xsecs.Count; ++j)
                {
                    if (name != xsecs[j][0].Trim())
                    {
                        if (xsecs[j][0].Trim() != "0.00")
                        {
                            //xsec name
                            w.WriteLine(xsecs[j][0]);
                            name = xsecs[j][0].Trim();
                            //Number of vertices & xsec coeff
                            w.WriteLine("2  " + xsecs[j][1]);

                            //X1, Y1, X2, Y2
                            w.WriteLine("   " + xsecs[j][2] + " " + xsecs[j][3]);
                            w.WriteLine("   " + xsecs[j][4] + " " + xsecs[j][5]);
                        }
                    }
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 1399110846: error trying to save .XSECS file.", "ERROR 1399110846: error al almacenar archivo .XSECS."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            w.Close();
        }
Example #26
0
        public static bool ReadOilpViscosityDensitiesFile(string oilpViscosityDensityFileName, List <string[]> viscosityDensityList)
        {
            StreamReader oilplusFileViscosityDensity = null;

            try
            {
                oilplusFileViscosityDensity = File.OpenText(oilpViscosityDensityFileName);
                var nextLine = oilplusFileViscosityDensity.ReadLine();
                int nTimes   = Convert.ToInt32(nextLine);
                for (int i = 0; i < nTimes; ++i)
                {
                    nextLine = oilplusFileViscosityDensity.ReadLine();
                    if (nextLine != null)
                    {
                        string[] split = nextLine.Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);

                        var row = new string[3];
                        row[0] = split[0];
                        row[1] = split[1];
                        row[2] = split[2];
                        viscosityDensityList.Add(row);
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(Universal.Idioma("ERROR 1903151533: error while reading file " + oilpViscosityDensityFileName + ". " + Environment.NewLine + ex.Message,
                                                 "ERROR 1903151533: error leyendo archivo " + oilpViscosityDensityFileName + ". " + Environment.NewLine + ex.Message),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
            finally
            {
                if (oilplusFileViscosityDensity != null)
                {
                    oilplusFileViscosityDensity.Close();
                }
            }
        }
Example #27
0
        //Save data to file
        public virtual void Save(string SOURCESfilename)
        {
            try
            {
                if (SOURCESFileContents.Count > 0)
                {
                    {//Write .SOURCES file:
                        TextWriter w = new StreamWriter(SOURCESfilename);
                        //number of sources:
                        w.WriteLine(SOURCESFileContents.Count);


                        for (int i = 0; i < SOURCESFileContents.Count; ++i)
                        {
                            //Sources name, file name, XY:
                            w.WriteLine(SOURCESFileContents[i].SourceName);
                            w.WriteLine(SOURCESFileContents[i].SourceType);
                            w.WriteLine(SOURCESFileContents[i].SecondaryFileName);
                            w.WriteLine(SOURCESFileContents[i].XY);
                        }
                        w.Close();
                    }

                    // Write secondary sources data files.
                    int nColumns = 3;
                    Universal.SaveSecondaryTables("SOURCES", nColumns);
                }
                else
                {
                    MessageBox.Show(Universal.Idioma("The sources table is empty. It was not saved.", "La tabla de fuentes y sumideros está vacía. No fue almacenada."),
                                    "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 0308171717: error while saving .SOURCES file.", "ERROR 0308171717: error almacenando archivo .SOURCES."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #28
0
        //read file names
        public string[] ReadFileNames(string filename)
        {
            StreamReader s            = File.OpenText(filename);
            string       read         = s.ReadLine();
            int          numberOfIrts = Convert.ToInt32(read);

            var fileNames = new string[numberOfIrts];

            try
            {
                for (int i = 0; i < numberOfIrts; ++i)
                {
                    //IRT name
                    s.ReadLine();
                    // number of points, boundary condition type, file name
                    string   line    = s.ReadLine();
                    string[] split   = line.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    int      nPoints = Convert.ToInt32(split[0]);
                    //name of file
                    fileNames[i] = split[2];
                    for (int j = 0; j < nPoints; ++j)
                    {
                        //x y
                        line = s.ReadLine();
                    }
                }
            }
            catch
            {
                MessageBox.Show(Universal.Idioma("ERROR 1412110939: error trying to read .IRT file.", "ERROR 1412110939: error leyendo archivo .IRT."),
                                "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            s.Close();

            return(fileNames);
        }
Example #29
0
        private void btnProjectNameAndLocation_Click(object sender, EventArgs e)
        {
            var saveFileDialog = new SaveFileDialog
            {
                Filter           = "DAT files (*.DAT)|*.DAT",
                FileName         = "",
                FilterIndex      = 1,
                RestoreDirectory = false,
                OverwritePrompt  = false
            };

            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                if (saveFileDialog.FileName == "")
                {
                    MessageBox.Show(Universal.Idioma("A project name is required.", "Se require un nombre de proyecto"),
                                    "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    txtProjectNameAndLocation.Text = saveFileDialog.FileName;
                }
            }
        }
Example #30
0
        //Load data from file
        public virtual void Load(string LINFFileName)
        {
            StreamReader LINFFile     = File.OpenText(LINFFileName);
            var          warnings     = new List <string>();
            int          index        = LINFFileName.LastIndexOf("\\", StringComparison.Ordinal);
            string       LINFFilePath = LINFFileName.Remove(index);

            //Read number of infiltration groups in .LINF file:
            string nLINF = LINFFile.ReadLine();
            int    numberOfInfiltrations = Convert.ToInt32(nLINF);

            AddVariable("NUMBER_OF_INFILTRATION_ZONES", numberOfInfiltrations);

            //Reset data structs:
            var infiltrationTable = new List <string[]>(); //Structure for the table shown in panel

            Universal.InfiltrationParametersFiles.Clear();
            WholeLINFFileContents.Clear();

            for (int i = 0; i < numberOfInfiltrations; ++i)
            { //Read all rest of data groups from .LINF file....
                try
                {
                    //Parameters file name:
                    string parametersFileName = LINFFile.ReadLine().Trim();

                    //Read pairs of vertices of polygons for this infiltration zone,
                    //not to be shown but to restore them later.
                    int nVertices     = Convert.ToInt32(LINFFile.ReadLine().Trim());
                    var polygonPoints = new string[nVertices];
                    for (var ii = 0; ii < nVertices; ++ii)
                    {
                        polygonPoints[ii] = LINFFile.ReadLine();
                    }

                    //Create this polygon group from data just read:
                    var currentPolygonGroup = new LINF();
                    currentPolygonGroup.InfiltrationParametersFileName = parametersFileName;
                    currentPolygonGroup.NZoneVertices = nVertices;
                    currentPolygonGroup.ZonePolygon   = polygonPoints;

                    //Store data in memory for this polygon zone:
                    WholeLINFFileContents.Add(currentPolygonGroup);

                    //Store in infiltrationTable a  row to be shown in gates table in DIP tab:
                    // (gate name, crest elevation, gate height, Cd, openings table name)
                    var row = new string[2];
                    row[0] = (i + 1).ToString();
                    row[1] = parametersFileName;

                    infiltrationTable.Add(row);

                    //Potential new parameters group (secundary dependant data). Depending on the model type (Horton, Green-Ampt, SCS-CN)
                    // stored in a file whose name could be repeated in the .LINF file for another zone. Only one copy of the file contents is
                    //stored in memory in OpeningsFiles (of GATEOpenings structure). If modified, only that copy is changed.
                    //It will be permanently stored when the user clicks "Save .GATES".

                    LoadInfiltrationSecondaryData(LINFFilePath + "\\" + parametersFileName, ref warnings);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(Universal.Idioma("ERROR 2504172221: error while proccessing  ", "ERROR 2504172221: error procesando  ") +
                                    LINFFileName + ". " +
                                    Environment.NewLine + ex.Message, "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            LINFFile.Close();

            //Save gatesTable data in "datagates" DataGridView control in the GATES panel.
            AddVariable("INFILTRATION_VALUES", infiltrationTable);

            if (warnings.Count > 0)
            {
                string warningsList = Universal.Idioma("WARNING 2003171725: The following gates files do not exist: \n\n", "WARNING 2003171725: Los siguientes archivos no existen: \n\n");
                for (int i = 0; i < warnings.Count; i++)
                {
                    warningsList += "   ° " + warnings[i] + "\n";
                }
                warningsList += Universal.Idioma("\nDefault files were created.", "\nAchivos por defecto fueron creados.");
                MessageBox.Show(warningsList, "RiverFlow2D", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }