Example #1
0
        public void GenerateDummyList()
        {
            //Create a large list of dummy elements;
            elementList = new ObservableCollection <CarboElement>();

            Random rnd = new Random(1000);

            for (int i = 0; i < 100; i++)
            {
                double volume = rnd.Next(10, 100); // creates a random Volume
                int    value1 = rnd.Next(1, 5);    // creates a random Volume
                int    value2 = rnd.Next(1, 5);    // creates a random Volume

                string materialName = CarboElementImporter.getRandomMaterial(value1);
                string category     = CarboElementImporter.getRandomCategory(value2);
                int    id           = rnd.Next(10000, 20000);

                CarboElement carboLifeElement = new CarboElement();

                carboLifeElement.Id           = id;
                carboLifeElement.MaterialName = materialName;
                carboLifeElement.Volume       = volume;
                carboLifeElement.Category     = category;
                carboLifeElement.SubCategory  = "";
                carboLifeElement.Density      = 1000;
                //carboLifeElement.Material = new CarboMaterial(materialName);

                elementList.Add(carboLifeElement);
            }

            CalculateProject();
        }
Example #2
0
        public void CreateGroups()
        {
            //get default group settings;
            CarboSettings groupSettings = new CarboSettings().Load();

            //groupSettings = groupSettings.DeSerializeXML();

            this.groupList = CarboElementImporter.GroupElementsAdvanced(this.elementList, groupSettings.groupCategory, groupSettings.groupSubCategory, groupSettings.groupType, groupSettings.groupMaterial, groupSettings.groupSubStructure, groupSettings.groupDemolition, CarboDatabase, groupSettings.uniqueTypeNames);
            CalculateProject();
        }