Exemple #1
0
        public CarboMaterial(string materialName)
        {
            Id          = -1;
            Name        = materialName;
            Category    = "Not specified";
            Description = "Carbon material and properties not set.";
            Density     = 1;
            //EEI = 1;
            ECI      = 0;
            ECI_A1A3 = 0;
            ECI_A4   = 0;
            ECI_A5   = 0;
            ECI_B1B5 = 0;
            ECI_C1C4 = 0;
            ECI_D    = 0;
            isLocked = false;
            //Properties = new List<CarboProperty>();

            //Calculated Values;
            materialA1A3Properties = new A1A3Element();
            materiaA4Properties    = new CarboA4Properties();
            materialA5Properties   = new CarboA5Properties();
            materialB1B5Properties = new CarboB1B5Properties();
            materialC1C4Properties = new CarboC1C4Properties();
            materialDProperties    = new CarboDProperties();

            ECI_A1A3_Override = false;
            ECI_A4_Override   = false;
            ECI_A5_Override   = false;
            ECI_B1B5_Override = false;
            ECI_C1C4_Override = false;
            ECI_D_Override    = false;
        }
Exemple #2
0
 internal void Add(A1A3Element newElement)
 {
     if (Elements != null)
     {
         if (newElement != null)
         {
             this.Elements.Add(newElement);
         }
     }
 }
Exemple #3
0
        public A1A3Element FindElement(string group, string name)
        {
            A1A3Element result = new A1A3Element();

            foreach (A1A3List list in a1a3List)
            {
                if (list.Name == group)
                {
                    foreach (A1A3Element element in list.Elements)
                    {
                        if (name == element.Name)
                        {
                            result = element;
                        }
                    }
                }
            }

            return(result);
        }
Exemple #4
0
        public CarboMaterial()
        {
            Id          = -1;
            Name        = "";
            Category    = "";
            Description = "";
            Density     = 500;
            ECI         = 1;
            ECI_A1A3    = 1;
            ECI_A4      = 1;
            ECI_A5      = 1;
            ECI_B1B5    = 1;
            ECI_C1C4    = 1;
            ECI_D       = 1;

            ECI_Mix      = 0;
            ECI_Mix_Info = "";

            isLocked = false;
            //Properties = new List<CarboProperty>();

            materialA1A3Properties = new A1A3Element();
            materiaA4Properties    = new CarboA4Properties();
            materiaA4Properties.calculate();
            materialA5Properties   = new CarboA5Properties();
            materialB1B5Properties = new CarboB1B5Properties();
            materialC1C4Properties = new CarboC1C4Properties();
            materialDProperties    = new CarboDProperties();

            ECI_A1A3_Override = false;
            ECI_A4_Override   = false;
            ECI_A5_Override   = false;
            ECI_B1B5_Override = false;
            ECI_C1C4_Override = false;
            ECI_D_Override    = false;
        }
Exemple #5
0
        /// <summary>
        /// Reads the csv files from the local path.
        /// </summary>
        public void LoadAll()
        {
            string myPath = Utils.getAssemblyPath() + "\\data\\A1A3Tables\\";

            List <string> DatabaseFiles = Directory.EnumerateFiles(myPath, "*.*", SearchOption.AllDirectories)
                                          .Where(s => s.EndsWith(".csv")).ToList();

            //List<A1A3List> result = new List<A1A3List>();

            //Find Profilelist;
            foreach (string path in DatabaseFiles)
            {
                A1A3List list = new A1A3List();

                if (File.Exists(path))
                {
                    string fileName = Path.GetFileNameWithoutExtension(path);
                    list.Name = fileName;
                    list.Path = path;


                    DataTable a1a3Table = Utils.LoadCSV(path);
                    foreach (DataRow dr in a1a3Table.Rows)
                    {
                        A1A3Element newElement = new A1A3Element();

                        int id = Convert.ToInt16(dr[0]);

                        string name        = dr[1].ToString();
                        string description = dr[2].ToString();
                        string category    = dr[3].ToString();

                        double density  = Utils.ConvertMeToDouble(dr[4].ToString());
                        double ECI_A1A3 = Utils.ConvertMeToDouble(dr[5].ToString());


                        newElement.Id          = id;
                        newElement.Name        = name;
                        newElement.Description = description;
                        newElement.Density     = density;
                        newElement.Category    = category;
                        newElement.ECI_A1A3    = ECI_A1A3;

                        newElement.Group = fileName;

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

                if (list.Elements.Count > 0)
                {
                    a1a3List.Add(list);
                }
            }

            //a1a3List = result;
        }