Beispiel #1
0
 private void OnDryingGasChanged(DryingGas gas)
 {
     if (DryingGasChanged != null)
     {
         DryingGasChanged(gas);
     }
 }
Beispiel #2
0
 private void OnDryingGasAdded(DryingGas gas)
 {
     if (DryingGasAdded != null)
     {
         DryingGasAdded(gas);
     }
 }
Beispiel #3
0
 public void AddDryingGas(DryingGas gas)
 {
     if (!IsInCatalog(gas))
     {
         gasList.Add(gas);
         OnDryingGasAdded(gas);
     }
 }
Beispiel #4
0
        private void InitializeCatalog()
        {
            //SubstanceLibraryService sls = SubstanceLibraryService.GetInstance();
            SubstanceCatalog sc = SubstanceCatalog.GetInstance();
            DryingGas        dg = new DryingGas("Air", sc.GetSubstance("Air"), false);

            gasList.Add(dg);
        }
Beispiel #5
0
 public void RemoveDryingGas(DryingGas gas)
 {
     if (gas.IsUserDefined)
     {
         string name = gas.Name;
         gasList.Remove(gas);
         OnDryingGasDeleted(name);
     }
 }
Beispiel #6
0
        public override ErrorMessage FinishSpecifications(string gasName, bool isNew)
        {
            DoNormalization();
            Substance s = new CompositeSubstance(gasName, materialComponentList);

            DryingGas dg = new DryingGas(gasName, s, true);

            catalog.AddDryingGas(dg);
            return(null);
        }
Beispiel #7
0
        public override bool Equals(object obj)
        {
            DryingGas dg      = obj as DryingGas;
            bool      isEqual = false;

            if (dg != null && this.name == dg.Name && this.isUserDefined == dg.IsUserDefined && this.substance == dg.Substance)
            {
                isEqual = true;
            }
            return(isEqual);
        }
Beispiel #8
0
        //      public void Remove(int index) {
        //         if (index < gasList.Count && index >= 0) {
        //            DryingGas gas = (DryingGas) gasList[index];
        //            if (gas.IsUserDefined) {
        //               string name = gas.Name;
        //               gasList.RemoveAt(index);
        //               OnDryingGasDeleted(name);
        //            }
        //         }
        //      }
        //
        public DryingGas GetDryingGas(string name)
        {
            DryingGas ret = null;

            foreach (DryingGas gas in gasList)
            {
                if (gas.Name.Equals(name))
                {
                    ret = gas;
                    break;
                }
            }
            return(ret);
        }
Beispiel #9
0
        //      public void ChangedryingGas(DryingGas gas)
        //      {
        //         if (gas.IsUserDefined)
        //         {
        //            OnDryingGasChanged(gas);
        //         }
        //      }
        //
        public bool IsInCatalog(DryingGas gas)
        {
            bool isInCatalog = false;

            foreach (DryingGas dm in gasList)
            {
                if (dm.Name.Equals(gas.Name))
                {
                    isInCatalog = true;
                    break;
                }
            }

            return(isInCatalog);
        }
Beispiel #10
0
        //public DryingGasCatalog(IList list) {
        //   gasList = list;
        //}

        private void InitializeCatalog()
        {
            //SubstanceLibraryService sls = SubstanceLibraryService.GetInstance();
            SubstanceCatalog sc = SubstanceCatalog.GetInstance();

            DryingGas dgAir = new DryingGas("Air", sc.GetSubstance("air"), false);

            gasList.Add(dgAir);
            //gasMoistureSubstanceListTable.Add(dgAir, sc.GetMoistureSubstanceListForAir());

            DryingGas dgNitrogen = new DryingGas("Nitrogen", sc.GetSubstance("nitrogen"), false);

            gasList.Add(dgNitrogen);

            //gasMoistureSubstanceListTable.Add(dgNitrogen, sc.GetMoistureSubstanceListForNitrogen());
        }
Beispiel #11
0
        public DryingGas GetDryingGasForMoisture(Substance materialMoistureSubstance)
        {
            DryingGas gas = null;

            SubstanceCatalog  sc = SubstanceCatalog.GetInstance();
            IList <Substance> moistureSubstanceList = sc.GetMoistureSubstanceListForAir();

            if (moistureSubstanceList.Contains(materialMoistureSubstance))
            {
                gas = GetDryingGas("Air");
            }
            else
            {
                gas = GetDryingGas("Nitrogen");
            }
            return(gas);
        }
Beispiel #12
0
        public DryingGas GetDryingGasForMoisture(String materialMoistureSubstanceName)
        {
            DryingGas gas = null;

            SubstanceCatalog  sc = SubstanceCatalog.GetInstance();
            IList <Substance> moistureSubstanceList = sc.GetMoistureSubstanceListForAir();

            foreach (Substance s in moistureSubstanceList)
            {
                if (s.ToString() == materialMoistureSubstanceName)
                {
                    gas = GetDryingGas("Air");
                    break;
                }
            }

            if (gas == null)
            {
                gas = GetDryingGas("Nitrogen");
            }

            return(gas);
        }
Beispiel #13
0
 public DryingGasCache(DryingGas dryingGas)
     : base()
 {
     this.name = dryingGas.Name;
     this.materialComponentList = ((CompositeSubstance)dryingGas.Substance).Components;
 }