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); }
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; } }
public void SetDuhringLinesCache(DryingMaterialCache dryingMaterialCache, INumericFormat iNumericFormat) { this.SetUnits(UnitSystemService.GetInstance().CurrentUnitSystem); DuhringLinesCache duhringLinesCache = new DuhringLinesCache(dryingMaterialCache); this.UpdateTheUI(iNumericFormat, duhringLinesCache); }
public DuhringLinesForm(DryingMaterialCache dryingMaterialCache) { // // Required for Windows Form Designer support // InitializeComponent(); this.dryingMaterialCache = dryingMaterialCache; this.duhringLinesControl.SetDuhringLinesCache(dryingMaterialCache); }
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); }
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(); } }
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); }
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); }
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); } }
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); } }
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; }
public void SetMaterialComponents(DryingMaterialCache dryingMaterialCache) { this.dryingMaterialCache = dryingMaterialCache; this.UpdateTheUI(this.dryingMaterialCache.MaterialComponentList); this.dryingMaterialCache.AbsoluteDryMaterialComponentsChanged += new MaterialComponentsChangedEventHandler(dryingMaterialCache_AbsoluteDryMaterialComponentsChanged); }