Example #1
0
 public void SetMaterialComponents(DryingMaterialCache dryingMaterialCache, INumericFormat iNumericFormat)
 {
     this.dryingMaterialCache = dryingMaterialCache;
     this.iNumericFormat      = iNumericFormat;
     this.UpdateTheUI(this.dryingMaterialCache.MaterialComponentList, iNumericFormat);
     this.dryingMaterialCache.AbsoluteDryMaterialComponentsChanged += new MaterialComponentsChangedEventHandler(dryingMaterialCache_AbsoluteDryMaterialComponentsChanged);
 }
Example #2
0
        public DMDetailsForm(DryingMaterial dryingMaterial, INumericFormat numericFormat)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            DryingMaterialCache dryingMaterialCache = new DryingMaterialCache(dryingMaterial);

            this.dmDetailsControl.SetDryingMaterial(dryingMaterialCache, numericFormat);
            if (dryingMaterialCache.GetDuhringLinesCache() == null)
            {
                int w = this.Width - this.dmDetailsControl.Width;
                int h = this.Height;
                this.Size = new Size(w, h);
            }

            if (dryingMaterialCache.MaterialType == MaterialType.GenericMaterial)
            {
                this.labelSpecificHeat.Visible   = true;
                this.textBoxSpecificHeat.Visible = true;
                this.labelSpecificHeat.InitializeVariable(dryingMaterialCache.SpecificHeatOfAbsoluteDryMaterial);
                this.textBoxSpecificHeat.InitializeVariable(numericFormat, dryingMaterialCache.SpecificHeatOfAbsoluteDryMaterial);
            }
            else
            {
                this.labelSpecificHeat.Visible   = false;
                this.textBoxSpecificHeat.Visible = false;
            }
        }
Example #3
0
        public void SetDuhringLinesCache(DryingMaterialCache dryingMaterialCache, INumericFormat iNumericFormat)
        {
            this.SetUnits(UnitSystemService.GetInstance().CurrentUnitSystem);

            DuhringLinesCache duhringLinesCache = new DuhringLinesCache(dryingMaterialCache);

            this.UpdateTheUI(iNumericFormat, duhringLinesCache);
        }
Example #4
0
        public DuhringLinesForm(DryingMaterialCache dryingMaterialCache)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.dryingMaterialCache = dryingMaterialCache;
            this.duhringLinesControl.SetDuhringLinesCache(dryingMaterialCache);
        }
Example #5
0
        public void SetDuhringLinesCache(DryingMaterialCache dryingMaterialCache)
        {
            // TODO: from where to get the numeric format?
            MainNumericFormat iNumericFormat = new MainNumericFormat();

            this.SetUnits(UnitSystemService.GetInstance().CurrentUnitSystem);

            DuhringLinesCache duhringLinesCache = new DuhringLinesCache(dryingMaterialCache);

            this.UpdateTheUI(iNumericFormat, duhringLinesCache);
        }
Example #6
0
 public void SetDryingMaterial(DryingMaterialCache dryingMaterialCache, INumericFormat iNumericFormat)
 {
     this.textBoxDMName.Text       = dryingMaterialCache.Name;
     this.textBoxUserDef.Text      = UI.GetBoolAsYesNo(dryingMaterialCache.IsUserDefined);
     this.textBoxMaterialType.Text = DryingMaterialsControl.GetDryingMaterialTypeAsString(dryingMaterialCache.MaterialType);
     this.textBoxMoisture.Text     = dryingMaterialCache.MoistureSubstance.ToString();
     this.SetMaterialComponents(dryingMaterialCache, iNumericFormat);
     this.readOnlyDuhringLinesControl.SetDuhringLinesCache(dryingMaterialCache, iNumericFormat);
     if (dryingMaterialCache.GetDuhringLinesCache() == null)
     {
         this.HideDuhringLinesUI();
     }
 }
Example #7
0
        public void SetDuhringLinesCache(DryingMaterialCache dryingMaterialCache, INumericFormat iNumericFormat)
        {
            this.iNumericFormat = iNumericFormat;

            this.baseIndex    = 0;
            this.panel.Click += new EventHandler(panel_Click);

            this.SetUnits(UnitSystemService.GetInstance().CurrentUnitSystem);
            UnitSystemService.GetInstance().CurrentUnitSystemChanged += new CurrentUnitSystemChangedEventHandler(DuhringLinesControl_CurrentUnitSystemChanged);

            this.duhringLinesCache = new DuhringLinesCache(dryingMaterialCache);
            this.UpdateTheUI(iNumericFormat, this.duhringLinesCache);
            this.duhringLinesCache.DuhringLinesChanged += new DuhringLinesChangedEventHandler(duhringLinesCache_DuhringLinesChanged);
        }
Example #8
0
        public void SetDuhringLinesCache(DryingMaterialCache dryingMaterialCache)
        {
            // TODO: from where to get the numeric format?
            this.iNumericFormat = new MainNumericFormat();

            this.baseIndex    = 0;
            this.panel.Click += new EventHandler(panel_Click);

            this.SetUnits(UnitSystemService.GetInstance().CurrentUnitSystem);
            UnitSystemService.GetInstance().CurrentUnitSystemChanged += new CurrentUnitSystemChangedEventHandler(DuhringLinesControl_CurrentUnitSystemChanged);

            this.duhringLinesCache = new DuhringLinesCache(dryingMaterialCache);
            this.UpdateTheUI(iNumericFormat, this.duhringLinesCache);
            this.duhringLinesCache.DuhringLinesChanged += new DuhringLinesChangedEventHandler(duhringLinesCache_DuhringLinesChanged);
        }
Example #9
0
        public DMDetailsForm(DryingMaterial dryingMaterial)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            DryingMaterialCache dryingMaterialCache = new DryingMaterialCache(dryingMaterial);

            this.dmDetailsControl.SetDryingMaterial(dryingMaterialCache);
            if (dryingMaterialCache.GetDuhringLinesCache() == null)
            {
                int w = this.Width - this.dmDetailsControl.Width;
                int h = this.Height;
                this.Size = new Size(w, h);
            }
        }
Example #10
0
        private void SetMaterialComponents(DryingMaterialCache cache, INumericFormat iNumericFormat)
        {
            IEnumerator en = cache.MaterialComponentList.GetEnumerator();

            while (en.MoveNext())
            {
                MaterialComponent mc  = (MaterialComponent)en.Current;
                ListViewItem      lvi = new ListViewItem();

                ListViewItem.ListViewSubItem lvsi = new ListViewItem.ListViewSubItem(lvi, mc.Name);
                lvi.SubItems.Insert(0, lvsi);

                lvsi = new ListViewItem.ListViewSubItem(lvi, mc.MassFraction.Value.ToString(iNumericFormat.NumericFormatString));
                lvi.SubItems.Insert(1, lvsi);

                this.listViewMaterialComponents.Items.Add(lvi);
            }
        }
Example #11
0
        public AddOrEditDryingMaterialForm(DryingMaterial dryingMaterial, INumericFormat numericFormat)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.inConstruction = true;
            this.iNumericFormat = numericFormat;

            // populate the moisture substance combobox
            IEnumerator en = SubstanceCatalog.GetInstance().GetMoistureSubstanceList().GetEnumerator();

            while (en.MoveNext())
            {
                Substance substance = (Substance)en.Current;
                this.comboBoxMoistureSubstance.Items.Add(substance);
            }
            this.comboBoxMoistureSubstance.SelectedIndex = 0;

            if (dryingMaterial == null)
            {
                // new
                this.isNew = true;
                this.Text  = "New Drying Material";

                this.dryingMaterialCache = new DryingMaterialCache(DryingMaterialCatalog.GetInstance());
                this.textBoxName.Text    = "New Drying Material";

                // populate the material type combobox
                this.comboBoxType.Items.Add(DryingMaterialsControl.STR_MAT_TYPE_GENERIC_MATERIAL);
                this.comboBoxType.Items.Add(DryingMaterialsControl.STR_MAT_TYPE_GENERIC_FOOD);
//            this.comboBoxType.Items.Add(DryingMaterialsControl.STR_MAT_TYPE_SPECIAL_FOOD);
                this.comboBoxType.SelectedIndex = 0;

                string       matTypeStr  = this.comboBoxType.SelectedItem as string;
                MaterialType matTypeEnum = DryingMaterialsControl.GetDryingMaterialTypeAsEnum(matTypeStr);
                this.dryingMaterialCache.SetMaterialType(matTypeEnum);

                Substance subst = this.comboBoxMoistureSubstance.SelectedItem as Substance;
                this.dryingMaterialCache.MoistureSubstance = subst;
            }
            else
            {
                // edit
                this.isNew = false;
                this.Text  = "Edit Drying Material";

                this.dryingMaterialCache = new DryingMaterialCache(dryingMaterial, DryingMaterialCatalog.GetInstance());
                this.textBoxName.Text    = this.dryingMaterialCache.Name;

                // populate the material type combobox
                this.comboBoxType.Items.Add(DryingMaterialsControl.GetDryingMaterialTypeAsString(this.dryingMaterialCache.MaterialType));
                this.comboBoxType.SelectedIndex             = 0;
                this.comboBoxMoistureSubstance.SelectedItem = this.dryingMaterialCache.MoistureSubstance;
            }

            this.labelSpecificHeat.InitializeVariable(this.dryingMaterialCache.SpecificHeatOfAbsoluteDryMaterial);
            this.textBoxSpecificHeat.InitializeVariable(numericFormat, this.dryingMaterialCache.SpecificHeatOfAbsoluteDryMaterial);

            this.substancesControl.SubstancesToShow = SubstancesToShow.Material;
            this.dmComponentsControl.SetMaterialComponents(this.dryingMaterialCache, numericFormat);
            this.UpdateTheUI(this.dryingMaterialCache.MaterialType);

            this.dryingMaterialCache.MaterialTypeChanged      += new MaterialTypeChangedEventHandler(dryingMaterialCache_MaterialTypeChanged);
            this.dryingMaterialCache.MoistureSubstanceChanged += new MoistureSubstanceChangedEventHandler(dryingMaterialCache_MoistureSubstanceChanged);
            this.substancesControl.ListViewSubstances.SelectedIndexChanged += new EventHandler(ListViewSubstances_SelectedIndexChanged);

            this.inConstruction = false;
        }
Example #12
0
 public void SetMaterialComponents(DryingMaterialCache dryingMaterialCache)
 {
     this.dryingMaterialCache = dryingMaterialCache;
     this.UpdateTheUI(this.dryingMaterialCache.MaterialComponentList);
     this.dryingMaterialCache.AbsoluteDryMaterialComponentsChanged += new MaterialComponentsChangedEventHandler(dryingMaterialCache_AbsoluteDryMaterialComponentsChanged);
 }