Ejemplo n.º 1
0
        protected void FixedUpdate()
        {
            SystemFluxUI      = String.Format("{0:F0} kW", totalSystemFlux);
            LoopTemperatureUI = String.Format("{0:F0} / {1:F0} K", currentLoopTemperature, nominalLoopTemperature);
            if (totalSystemFlux > 0f)
            {
                Fields["SystemTemperatureUI"].guiActive       = true;
                Fields["SystemTemperatureUI"].guiActiveEditor = true;
                SystemTemperatureUI = String.Format("{0:F0} K", totalSystemTemperature);
            }
            else
            {
                Fields["SystemTemperatureUI"].guiActive       = false;
                Fields["SystemTemperatureUI"].guiActiveEditor = false;
            }
            if (simulator == null)
            {
                if (HighLogic.LoadedSceneIsFlight)
                {
                    simulator = part.vessel.GetComponent <SystemHeatVessel>().Simulator;
                }

                if (HighLogic.LoadedSceneIsEditor)
                {
                    simulator = SystemHeatEditor.Instance.Simulator;
                }
            }
        }
Ejemplo n.º 2
0
        protected void InitializeEditorConstruct(ShipConstruct ship, bool forceReset)
        {
            dataReady = false;
            if (ship != null)
            {
                if (simulator == null)
                {
                    simulator = new SystemHeatSimulator();
                    simulator.Reset(ship.Parts);
                }

                if (simulator != null && forceReset)
                {
                    simulator.Reset(ship.Parts);
                    simulator.ResetTemperatures();
                }
                else
                {
                    simulator.Refresh(ship.Parts);
                    simulator.ResetTemperatures();
                }

                dataReady = true;
            }
            else
            {
                if (SystemHeatSettings.DebugSimulation)
                {
                    Utils.Log(String.Format("[SystemHeatEditor]: Ship is null"));
                }
                simulator = new SystemHeatSimulator();
            }
        }
Ejemplo n.º 3
0
        public void Start()
        {
            loopIDs      = new List <int>();
            fluxes       = new Dictionary <string, float>();
            temperatures = new Dictionary <string, float>();

            for (int i = 0; i < SystemHeatSettings.maxLoopCount; i++)
            {
                loopIDs.Add(i);
            }

            SetupUI();

            Utils.Log("[ModuleSystemHeat]: Setup complete", LogType.Modules);


            Fields["totalSystemTemperature"].guiActive       = SystemHeatSettings.DebugPartUI;
            Fields["totalSystemTemperature"].guiActiveEditor = SystemHeatSettings.DebugPartUI;
            Fields["totalSystemFlux"].guiActive              = SystemHeatSettings.DebugPartUI;
            Fields["totalSystemFlux"].guiActiveEditor        = SystemHeatSettings.DebugPartUI;
            Fields["nominalLoopTemperature"].guiActive       = SystemHeatSettings.DebugPartUI;
            Fields["nominalLoopTemperature"].guiActiveEditor = SystemHeatSettings.DebugPartUI;
            Fields["currentLoopTemperature"].guiActive       = SystemHeatSettings.DebugPartUI;
            Fields["currentLoopTemperature"].guiActiveEditor = SystemHeatSettings.DebugPartUI;
            Fields["currentLoopFlux"].guiActive              = SystemHeatSettings.DebugPartUI;
            Fields["currentLoopFlux"].guiActiveEditor        = SystemHeatSettings.DebugPartUI;

            if (HighLogic.LoadedSceneIsFlight)
            {
                simulator = part.vessel.GetComponent <SystemHeatVessel>().Simulator;
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Build a new HeatLoop
 /// </summary>
 /// <param name="id">The loop ID number</param>
 public HeatLoop(SystemHeatSimulator sim, int id)
 {
     ID          = id;
     modules     = new List <ModuleSystemHeat>();
     CoolantType = SystemHeatSettings.GetCoolantType("");
     Temperature = GetEnvironmentTemperature();
     simulator   = sim;
 }
Ejemplo n.º 5
0
        protected override void OnStart()
        {
            base.OnStart();
            simulator = new SystemHeatSimulator();

            // These events need to trigger a refresh
            GameEvents.onVesselGoOnRails.Add(new EventData <Vessel> .OnEvent(RefreshVesselData));
            GameEvents.onVesselWasModified.Add(new EventData <Vessel> .OnEvent(RefreshVesselData));
            GameEvents.OnVesselRollout.Add(new EventData <ShipConstruct> .OnEvent(OnVesselRollout));
        }
Ejemplo n.º 6
0
        protected override void OnStart()
        {
            base.OnStart();
            simulator = new SystemHeatSimulator();

            // These events need to trigger a refresh
            GameEvents.onVesselGoOnRails.Add(new EventData <Vessel> .OnEvent(RefreshVesselData));
            GameEvents.onVesselWasModified.Add(new EventData <Vessel> .OnEvent(RefreshVesselData));
            GameEvents.onVesselDocking.Add(new EventData <uint, uint> .OnEvent(OnVesselsDocked));
            GameEvents.onVesselsUndocking.Add(new EventData <Vessel, Vessel> .OnEvent(OnVesselsUndocked));
        }
Ejemplo n.º 7
0
        protected void FixedUpdate()
        {
            SystemFluxUI        = String.Format("{0:F0} kW", totalSystemFlux);
            SystemTemperatureUI = String.Format("{0:F0} / {1:F0} K", LoopTemperature, nominalLoopTemperature);

            if (simulator == null)
            {
                if (HighLogic.LoadedSceneIsFlight)
                {
                    simulator = part.vessel.GetComponent <SystemHeatVessel>().Simulator;
                }

                if (HighLogic.LoadedSceneIsEditor)
                {
                    simulator = SystemHeatEditor.Instance.Simulator;
                }
            }
        }