Exemplo n.º 1
0
        public static void DirectionOutput(ElectricalOIinheritance SourceInstance,
                                           IntrinsicElectronicData Thiswire,
                                           CableLine RelatedLine = null)
        {
            if (Thiswire.Data.connections.Count == 0)
            {
                Thiswire.FindPossibleConnections();
            }

            if (!(Thiswire.Data.SupplyDependent.TryGetValue(SourceInstance,
                                                            out ElectronicSupplyData outputSupplyingUsingData)))
            {
                outputSupplyingUsingData =
                    Thiswire.Data.SupplyDependent[SourceInstance] = ElectricalPool.GetElectronicSupplyData();
            }

            foreach (IntrinsicElectronicData Relatedindata in Thiswire.Data.connections)
            {
                if (!(outputSupplyingUsingData.Upstream.Contains(Relatedindata)) && (Thiswire != Relatedindata))
                {
                    bool pass = true;
                    if (RelatedLine != null)
                    {
                        if (RelatedLine.Covering.Contains(Relatedindata))
                        {
                            pass = false;
                        }
                    }

                    if (outputSupplyingUsingData.Downstream.Contains(Relatedindata) == false && pass && Relatedindata.Present != SourceInstance)
                    {
                        outputSupplyingUsingData.Downstream.Add(Relatedindata);
                        Relatedindata.DirectionInput(SourceInstance, Thiswire);
                    }
                }
            }
        }
Exemplo n.º 2
0
 ///// <summary>
 /////  Sets the upstream
 ///// </summary>
 public virtual void DirectionInput(ElectricalOIinheritance SourceInstance, IntrinsicElectronicData ComingFrom, CableLine PassOn = null)
 {
     if (Logall)
     {
         Logger.Log("this > " + this + "DirectionInput SourceInstance > " + SourceInstance + " ComingFrom > " + ComingFrom + "  PassOn > " + PassOn, Category.Electrical);
     }
     InputOutputFunctions.DirectionInput(SourceInstance, ComingFrom, InData);
 }
Exemplo n.º 3
0
 /// <summary>
 ///  Sets the upstream
 /// </summary>
 public virtual void DirectionInput(ElectricalOIinheritance SourceInstance, IntrinsicElectronicData ComingFrom, CableLine PassOn = null)
 {
     if (Present != null)
     {
         Present.DirectionInput(SourceInstance, ComingFrom);
     }
     else
     {
         InputOutputFunctions.DirectionInput(SourceInstance, ComingFrom, this);
     }
 }