Exemple #1
0
    //Update the current State of the SMES (sprites and statistics)
    void UpdateState(bool _isOn)
    {
        isOn             = _isOn;
        isOnForInterface = _isOn;
        if (isOn)
        {
            ElectricalSynchronisation.AddSupply(this, ApplianceType);
            ElectricalSynchronisation.StructureChangeReact = true;
            ElectricalSynchronisation.ResistanceChange     = true;         //Potential optimisation
            ElectricalSynchronisation.CurrentChange        = true;
            Logger.Log("on");
            OnOffIndicator.sprite = onlineSprite;
            chargeIndicator.gameObject.SetActive(true);
            statusIndicator.gameObject.SetActive(true);

            int chargeIndex = (currentCharge / 100) * 4;
            chargeIndicator.sprite = chargeIndicatorSprites [chargeIndex];
            if (chargeIndex == 0)
            {
                statusIndicator.sprite = statusCriticalSprite;
            }
            else
            {
                statusIndicator.sprite = statusSupplySprite;
            }
        }
        else
        {
            Logger.Log("off");
            ChangeToOff           = true;
            OnOffIndicator.sprite = offlineSprite;
            chargeIndicator.gameObject.SetActive(false);
            statusIndicator.gameObject.SetActive(false);
        }
    }
Exemple #2
0
 public static void TurnOnSupply(IElectricityIO Supply)
 {
     ElectricalSynchronisation.AddSupply(Supply.InData.ControllingUpdate, Supply.InData.Categorytype);
     ElectricalSynchronisation.NUStructureChangeReact.Add(Supply.InData.ControllingUpdate);
     ElectricalSynchronisation.NUResistanceChange.Add(Supply.InData.ControllingUpdate);
     ElectricalSynchronisation.NUCurrentChange.Add(Supply.InData.ControllingUpdate);
 }
Exemple #3
0
 public static void TurnOnSupply(ModuleSupplyingDevice Supply)
 {
     Supply.ControllingNode.Node.Data.ChangeToOff = false;
     ElectricalSynchronisation.AddSupply(Supply.ControllingNode, Supply.ControllingNode.ApplianceType);
     ElectricalSynchronisation.NUStructureChangeReact.Add(Supply.ControllingNode);
     ElectricalSynchronisation.NUResistanceChange.Add(Supply.ControllingNode);
     ElectricalSynchronisation.NUCurrentChange.Add(Supply.ControllingNode);
 }
 public static void TurnOnSupply(ElectricalOIinheritance Supply)
 {
     Supply.Data.ChangeToOff = false;
     Supply.InData.ControllingDevice.isOnForInterface = true;
     ElectricalSynchronisation.AddSupply(Supply.InData.ControllingUpdate, Supply.InData.Categorytype);
     ElectricalSynchronisation.NUStructureChangeReact.Add(Supply.InData.ControllingUpdate);
     ElectricalSynchronisation.NUResistanceChange.Add(Supply.InData.ControllingUpdate);
     ElectricalSynchronisation.NUCurrentChange.Add(Supply.InData.ControllingUpdate);
 }
Exemple #5
0
 void UpdateState(bool _isOn)
 {
     isOn             = _isOn;
     isOnForInterface = _isOn;
     if (isOn)
     {
         ElectricalSynchronisation.AddSupply(this, ApplianceType);
         ElectricalSynchronisation.StructureChangeReact = true;
         ElectricalSynchronisation.ResistanceChange     = true;         //Potential optimisation
         ElectricalSynchronisation.CurrentChange        = true;
         Logger.Log("on");
     }
     else
     {
         Logger.Log("off");
         ChangeToOff = true;
     }
 }
Exemple #6
0
 void UpdateState(bool _isOn)
 {
     isOn = _isOn;
     if (isOn)
     {
         ElectricalSynchronisation.AddSupply(this, ApplianceType);
         ElectricalSynchronisation.StructureChangeReact = true;
         ElectricalSynchronisation.ResistanceChange     = true;
         ElectricalSynchronisation.CurrentChange        = true;
         powerSupply.TurnOnSupply();
         Logger.Log("on");
     }
     else
     {
         Logger.Log("off");
         ChangeToOff = true;
     }
 }
Exemple #7
0
    //Update the current State of the SMES (sprites and statistics)
    void UpdateState(bool _isOn)
    {
        isOn             = _isOn;
        isOnForInterface = _isOn;
        if (isOn)
        {
            ElectricalSynchronisation.AddSupply(this, ApplianceType);


            ElectricalSynchronisation.StructureChangeReact = true;
            ElectricalSynchronisation.ResistanceChange     = true;         //Potential optimisation
            ElectricalSynchronisation.CurrentChange        = true;

            //				Resistance = (1000/((StandardChargeNumber * ChargingMultiplier)/1000));
            //				powerSupply.PassedDownResistance = Resistance;
            //				powerSupply.CanProvideResistance = true;

            //powerSupply.TurnOnSupply (0); //Test supply of 3000volts and 20amps, lol yeah
            Logger.Log("on");
            OnOffIndicator.sprite = onlineSprite;
            chargeIndicator.gameObject.SetActive(true);
            statusIndicator.gameObject.SetActive(true);

            int chargeIndex = (currentCharge / 100) * 4;
            chargeIndicator.sprite = chargeIndicatorSprites [chargeIndex];
            if (chargeIndex == 0)
            {
                statusIndicator.sprite = statusCriticalSprite;
            }
            else
            {
                statusIndicator.sprite = statusSupplySprite;
            }
        }
        else
        {
            Logger.Log("off");
            ChangeToOff           = true;
            OnOffIndicator.sprite = offlineSprite;
            chargeIndicator.gameObject.SetActive(false);
            statusIndicator.gameObject.SetActive(false);
        }
    }