Example #1
0
 public Flowsheet RemoveDesignSpecification(Equation eq)
 {
     if (DesignSpecifications.Contains(eq))
     {
         DesignSpecifications.Remove(eq);
     }
     return(this);
 }
Example #2
0
        public Flowsheet RemoveDesignSpecification(string name)
        {
            var spec = DesignSpecifications.FirstOrDefault(eq => eq.Name == name);

            if (spec != null)
            {
                DesignSpecifications.Remove(spec);
            }

            return(this);
        }
Example #3
0
        public Flowsheet ReplaceDesignSpecification(string name, Equation eq)
        {
            var spec = DesignSpecifications.FirstOrDefault(s => s.Name == name);

            if (spec != null)
            {
                DesignSpecifications.Remove(spec);
                eq.Name  = name;
                eq.Group = "Design Spec";
                AddDesignSpecification(eq);
            }

            return(this);
        }
Example #4
0
        public Flowsheet AddDesignSpecification(Equation eq)
        {
            if (!DesignSpecifications.Contains(eq))
            {
                eq.ModelClass = "Flowsheet";
                DesignSpecifications.Add(eq);
            }
            else
            {
                throw new InvalidOperationException("Design spec " + eq.Name + " already included in flowsheet");
            }

            return(this);
        }