//public DryingMaterialComponentsCacheModel(string name, MaterialType materialType, ArrayList materialComponentList, Substance moistureSubstance) : base (name, materialComponentList) { // this.moistureSubstance = moistureSubstance; //} public void SetMaterialType(MaterialType type) { if (type == materialType) { return; } MaterialType oldValue = materialType; if (type == MaterialType.GenericMaterial) { RemoveAllMaterialComponents(); SubstanceCatalog sc = SubstanceCatalog.GetInstance(); //Substance absoluteDryMaterial = sc.GetSubstance("Dry Material"); Substance absoluteDryMaterial = sc.GetGenericSubstance(); materialComponentList.Add(new MaterialComponent(absoluteDryMaterial)); } else if (type == MaterialType.GenericFood) { SwitchToGenericFood(); } //else if (materialType == MaterialType.GenericFood) { // SwitchFromGenericFood(); //} materialType = type; OnMaterialTypeChanged(materialType, oldValue); }
public DryingMaterialCache(DryingMaterialCatalog catalog) : base() { this.materialType = MaterialType.GenericMaterial; this.catalog = catalog; //cacheType = CacheType.New; SubstanceCatalog sc = SubstanceCatalog.GetInstance(); //Substance absoluteDryMaterial = sc.GetSubstance("Dry Material"); Substance absoluteDryMaterial = sc.GetGenericSubstance(); materialComponentList.Add(new MaterialComponent(absoluteDryMaterial)); specificHeatOfAbsoluteDryMaterial = new ProcessVarDouble(StringConstants.SPECIFIC_HEAT_ABS_DRY, PhysicalQuantity.SpecificHeat, 1260.0, VarState.Specified, this); }
//public DryingMaterialCatalog(IList list) { // materialList = list; //} private void InitializeCatalog() { SubstanceCatalog sc = SubstanceCatalog.GetInstance(); //Substance absoluteDryMaterial = sc.GetSubstance("Dry Material"); Substance absoluteDryMaterial = sc.GetGenericSubstance(); Substance moisture = sc.GetSubstance("water"); ArrayList dryMatComponents = new ArrayList(); dryMatComponents.Add(new MaterialComponent(absoluteDryMaterial)); CompositeSubstance dryMat = new CompositeSubstance("Generic Dry Material", dryMatComponents); DryingMaterial dm = new DryingMaterial("Generic Material", MaterialType.GenericMaterial, dryMat, moisture, false); //materialList.Add(dm); DryingMaterial milk = (DryingMaterial)dm.Clone(); milk.Name = "Milk"; milk.MaterialType = MaterialType.SpecialFood; //materialList.Add(milk); }