public virtual void BroadcastSetUpMessage(ElectricalNodeControl Node)
 {
     RequiresUpdateOn = new HashSet <ElectricalUpdateTypeCategory>
     {
         ElectricalUpdateTypeCategory.PowerUpdateStructureChange,
         ElectricalUpdateTypeCategory.PowerUpdateStructureChangeReact,
         ElectricalUpdateTypeCategory.PowerUpdateCurrentChange,
         ElectricalUpdateTypeCategory.TurnOnSupply,
         ElectricalUpdateTypeCategory.TurnOffSupply,
         ElectricalUpdateTypeCategory.PowerNetworkUpdate,
         ElectricalUpdateTypeCategory.PotentialDestroyed,
         ElectricalUpdateTypeCategory.GoingOffStage,
         ElectricalUpdateTypeCategory.ObjectStateChange,
     };
     ModuleType      = ElectricalModuleTypeCategory.SupplyingDevice;
     ControllingNode = Node;
     ControllingNode.Node.InData.Data.SupplyingVoltage   = SupplyingVoltage;
     ControllingNode.Node.InData.Data.InternalResistance = InternalResistance;
     ControllingNode.Node.InData.Data.SupplyingCurrent   = current;
     Node.AddModule(this);
     if (StartOnStartUp)
     {
         TurnOnSupply();
     }
 }
 public void BroadcastSetUpMessage(ElectricalNodeControl node)
 {
     RequiresUpdateOn = new HashSet <ElectricalUpdateTypeCategory>
     {
         ElectricalUpdateTypeCategory.ModifyElectricityInput,
         ElectricalUpdateTypeCategory.ModifyResistancyOutput,
     };
     ModuleType      = ElectricalModuleTypeCategory.Transformer;
     ControllingNode = node;
     if (InvertingTurnRatio)
     {
         TurnRatio = 1 / TurnRatio;
     }
     node.AddModule(this);
 }
Esempio n. 3
0
 public override void BroadcastSetUpMessage(ElectricalNodeControl Node)
 {
     RequiresUpdateOn = new HashSet <ElectricalUpdateTypeCategory>
     {
         ElectricalUpdateTypeCategory.PowerUpdateStructureChange,
         ElectricalUpdateTypeCategory.PowerUpdateStructureChangeReact,
         ElectricalUpdateTypeCategory.PowerUpdateCurrentChange,
         ElectricalUpdateTypeCategory.TurnOnSupply,
         ElectricalUpdateTypeCategory.TurnOffSupply,
         ElectricalUpdateTypeCategory.PowerNetworkUpdate,
         ElectricalUpdateTypeCategory.ModifyElectricityOutput,
         ElectricalUpdateTypeCategory.PotentialDestroyed,                 //Remember to keep the inherited updates
     };
     ModuleType      = ElectricalModuleTypeCategory.BatterySupplyingDevice;
     ControllingNode = Node;
     Node.AddModule(this);
     if (StartOnStartUp)
     {
         TurnOnSupply();
     }
 }
 public void BroadcastSetUpMessage(ElectricalNodeControl Node)
 {
     RequiresUpdateOn = new HashSet <ElectricalUpdateTypeCategory>
     {
         ElectricalUpdateTypeCategory.InitialPowerUpdateResistance,
         ElectricalUpdateTypeCategory.PowerUpdateResistanceChange,
         ElectricalUpdateTypeCategory.PowerNetworkUpdate,
         ElectricalUpdateTypeCategory.PotentialDestroyed,
     };
     ModuleType      = ElectricalModuleTypeCategory.ResistanceSource;
     ControllingNode = Node;
     //resistance.Ohms = ReactionTo.ResistanceReactionA.Resistance.Ohms;
     ReactionTo.ResistanceReactionA.Resistance = resistance;
     if (resistance.Ohms == 0)
     {
         resistance.Ohms = 9999991;
     }
     ControllingNode.Node.InData.ConnectionReaction[ReactionTo.ConnectingDevice] = ReactionTo;
     ElectricalManager.Instance.electricalSync.PoweredDevices.Add(ControllingNode);
     ComingFromDevice.SetDeadEnd();
     Node.AddModule(this);
 }