Beispiel #1
0
        private List <EoLElement> LoadElements()
        {
            List <EoLElement> result = new List <EoLElement>();

            //Find Profilelist;
            string myPath = Utils.getAssemblyPath() + "\\data\\" + "Eol.csv";

            double a1a3Value = carboMaterial.ECI_A1A3;

            if (a1a3Value < 0)
            {
                a1a3Value = a1a3Value * -1;
            }

            if (File.Exists(myPath))
            {
                DataTable profileTable = Utils.LoadCSV(myPath);
                foreach (DataRow dr in profileTable.Rows)
                {
                    EoLElement newElement = new EoLElement();

                    string material = dr[0].ToString();
                    double inc      = Utils.ConvertMeToDouble(dr[1].ToString());
                    double incP     = Utils.ConvertMeToDouble(dr[2].ToString());
                    double landf    = Utils.ConvertMeToDouble(dr[3].ToString());
                    double landfP   = Utils.ConvertMeToDouble(dr[4].ToString());
                    double reuse    = Utils.ConvertMeToDouble(dr[5].ToString());
                    double reuseP   = Utils.ConvertMeToDouble(dr[6].ToString());

                    newElement.Material = material;

                    newElement.Incineration  = a1a3Value;
                    newElement.IncinerationP = incP;
                    newElement.Landfill      = landf;
                    newElement.LandfillP     = landfP;
                    newElement.reuse         = reuse;
                    newElement.reuseP        = reuseP;

                    result.Add(newElement);
                }
            }
            else
            {
                MessageBox.Show("File: " + myPath + " could not be found, make sure you have the Eol list located in indicated folder");
            }

            return(result);
        }
Beispiel #2
0
        private void Cbb_Type_DropDownClosed(object sender, EventArgs e)
        {
            EoLElement selectedMaterial = materialList.Find(x => x.Material.Contains(cbb_Type.Text));

            if (selectedMaterial != null)
            {
                cbb_Type.Text = selectedMaterial.Material;

                eolProperties.c4DisposalName = selectedMaterial.Material;
                eolProperties.c4incfP        = Math.Round(selectedMaterial.IncinerationP, 3);
                eolProperties.c4incfV        = Math.Round(selectedMaterial.Incineration, 3);
                eolProperties.c4landfP       = Math.Round(selectedMaterial.LandfillP, 3);
                eolProperties.c4landfV       = Math.Round(selectedMaterial.Landfill, 3);
                eolProperties.c4reUseV       = Math.Round(selectedMaterial.reuse, 3);
                eolProperties.c4reUseP       = Math.Round(selectedMaterial.reuseP, 3);

                eolProperties.calculate();
                loadSettings();
            }
        }