public override bool IsValidDestination(AbstractProcessUnit unit) { // Heat streams can only have reactors as destinations (and of course the // reactor unit has to be accepting incoming streams). // TODO: Check with the chemistry guys to verify this return((unit is Reactor) && unit.CanAcceptIncomingStream(this)); }
public override bool IsValidSource(AbstractProcessUnit unit) { // Chemical streams can accept any type of process unit as a source, provided // that the unit is accepting outgoing streams. // TODO: Double check this with the chemistry guys return(unit.CanAcceptOutgoingStream(this)); }
public override bool IsValidDestination(AbstractProcessUnit unit) { // As far as I can tell, the chemical streams can accept any type of process // unit as a destination. So the only required check is that the unit is // accepting incoming streams. // TODO: Double check this with the chemistry guys return(unit.CanAcceptIncomingStream(this)); }
public void AddProcessUnit(AbstractProcessUnit unit) { // Make sure that the process unit ID is unique. This is very important. if (null != GetProcessUnit(unit.Id)) { throw new InvalidOperationException(string.Format( "A process unit with ID={0} already exists in the workspace. The new process unit that " + "was passed to \"AddProcessUnit\" also had this ID. Each process unit in the workspace is " + "required to have a unique ID.", unit.Id)); } m_procUnits.Add(unit); if (null != ProcessUnitsCollectionChanged) { ProcessUnitsCollectionChanged(this, EventArgs.Empty); } }
/// <summary> /// Removes a process unit from the workspace. Any streams in the workspace that referenced /// that process unit as a source or destination will have their references set to null. /// </summary> public void RemoveProcessUnit(AbstractProcessUnit unit) { // First go through all streams and remove references to this unit foreach (AbstractStream stream in m_streams) { if (object.ReferenceEquals(stream.Source, unit)) { stream.Source = null; } if (object.ReferenceEquals(stream.Destination, unit)) { stream.Destination = null; } } // Now remove it from the collection m_procUnits.Remove(unit); if (null != ProcessUnitsCollectionChanged) { ProcessUnitsCollectionChanged(this, EventArgs.Empty); } }
/// <summary> /// E.O. /// Every stream has a source and destination process unit. This method determines whether or /// not the specified unit is a valid destination. This may depend on multiple things, such /// as the type of the stream and whether or not the process unit can accept more incoming /// streams. /// </summary> /// <returns>True if the unit is a valid destination, false otherwise.</returns> public abstract bool IsValidDestination(AbstractProcessUnit unit);
/// <summary> /// Every stream has a source and destination process unit. This method determines whether or /// not the specified unit is a valid source. This may depend on multiple things, such /// as the type of the stream and whether or not the process unit can accept more outgoing /// streams. /// </summary> /// <returns>True if the unit is a valid source, false otherwise.</returns> public abstract bool IsValidSource(AbstractProcessUnit unit);
public override bool IsValidSource(AbstractProcessUnit unit) { return(false); }
public Reactor() : this(AbstractProcessUnit.GetNextUID()) { }
public HeatExchangerNoUtility() : this(AbstractProcessUnit.GetNextUID()) { }
public Separator() : this(AbstractProcessUnit.GetNextUID()) { }
public Mixer() : this(AbstractProcessUnit.GetNextUID()) { }