Exemplo n.º 1
0
 public MaterialSurface(MaterialSurface source)
 {
     Family             = source.Family;
     Thickness          = source.Thickness;
     Ratio              = source.Ratio;
     MaterialUEVs       = new List <UEV>(source.MaterialUEVs);
     TransportationUEVs = new List <UEV>(source.TransportationUEVs);
     ServicesUEVs       = new List <UEV>(source.ServicesUEVs);
 }
Exemplo n.º 2
0
        private void newMaterialSurfaceMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode node = treeView.SelectedNode;

            if (node != null && node.Parent == treeView.Nodes["Materials"])
            {
                MaterialSurface newMaterialSurface = new MaterialSurface();
                MaterialFamily  materialFamily     = node.Tag as MaterialFamily;
                newMaterialSurface.Family = materialFamily;
                materialFamily.MaterialInstances.Add(newMaterialSurface);
                InitializeNewNode(newMaterialSurface.Name, newMaterialSurface, node);
            }
        }
Exemplo n.º 3
0
        //TODO: Potentially clean up + Add ratio textbox for material instances
        private void UpdateSelectedTagProperties()
        {
            TreeNode node = treeView.SelectedNode;

            if (node != null && node.Tag != null)
            {
                Type T = node.Tag.GetType();
                if (T == typeof(MaterialFamily))
                {
                    MaterialFamily materialFamily = node.Tag as MaterialFamily;
                    materialFamily.Name = mf_nameTextBox.Text;
                    node.Text           = mf_nameTextBox.Text;
                    node.Name           = mf_nameTextBox.Text;
                    double density = materialFamily.Density;
                    ParseTextBoxNumber(mf_densityTextBox, ref density);
                    materialFamily.Density = density;
                }
                else if (node.Tag is IMaterialInstance)
                {
                    IMaterialInstance materialInstance = node.Tag as IMaterialInstance;
                    materialInstance.Name = mi_nameTextBox.Text;
                    node.Text             = mi_nameTextBox.Text;
                    node.Name             = mi_nameTextBox.Text;
                    if (T == typeof(MaterialSurface))
                    {
                        MaterialSurface materialSurface = materialInstance as MaterialSurface;
                        double          thickness       = materialSurface.Thickness;
                        ParseTextBoxNumber(mi_thicknessTextBox, ref thickness);
                        materialSurface.Thickness = thickness;
                    }
                }
                else if (T == typeof(UEV))
                {
                    UEV UEV = node.Tag as UEV;
                    UEV.Name  = uev_nameTextBox.Text;
                    node.Text = uev_nameTextBox.Text;
                    node.Name = uev_nameTextBox.Text;
                    double value = UEV.Value;
                    ParseTextBoxNumber(uev_valueTextBox, ref value);
                    UEV.Value = value;
                    UEV.Unit  = (Units)Enum.Parse(typeof(Units), uev_unitsComboBox.Text);   //TODO: Check and potentially make cleaner
                    double geb = UEV.GeobiosphereEmergyBaseline;
                    ParseTextBoxNumber(uev_gebTextBox, ref geb);
                    UEV.GeobiosphereEmergyBaseline = geb;
                    UEV.Reference = uev_referenceTextBox.Text;
                }
                treeView.Sort();
            }
        }
Exemplo n.º 4
0
        private void RefreshMaterialInstancePanel(IMaterialInstance materialInstance)
        {
            tabControl.SelectedTab = tabControl.TabPages[2];
            mi_nameTextBox.Text    = materialInstance.Name;
            mi_densityTextBox.Text = materialInstance.Family.Density.ToString();

            MaterialSurface materialSurface = materialInstance as MaterialSurface;

            if (materialSurface != null)
            {
                mi_thicknessTextBox.ReadOnly = false;
                mi_thicknessTextBox.Text     = materialSurface.Thickness.ToString();
            }
            else
            {
                mi_thicknessTextBox.ReadOnly = true;
                mi_thicknessTextBox.Text     = "";
            }
        }