Ejemplo n.º 1
0
 /// <summary>
 /// Build a new HeatLoop
 /// </summary>
 /// <param name="id">The loop ID number</param>
 public HeatLoop(int id)
 {
     ID          = id;
     modules     = new List <ModuleSystemHeat>();
     CoolantType = SystemHeatSettings.GetCoolantType("");
     Temperature = GetEnvironmentTemperature();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Build a new HeatLoop from a list of modules
 /// </summary>
 /// <param name="id">the loop ID</param>
 /// <param name="heatModules">the modules to add</param>
 public HeatLoop(int id, List <ModuleSystemHeat> heatModules)
 {
     ID          = id;
     modules     = new List <ModuleSystemHeat>();
     modules     = heatModules;
     Temperature = heatModules.Average(x => x.LoopTemperature);
     // Get loop properties set up
     CoolantName        = GetCoolantType();
     CoolantType        = SystemHeatSettings.GetCoolantType(CoolantName);
     Volume             = CalculateLoopVolume();
     NominalTemperature = CalculateNominalTemperature();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Load data from configuration
        /// </summary>
        public static void Load()
        {
            ConfigNode settingsNode;

            Utils.Log("[Settings]: Started loading", LogType.Settings);
            if (GameDatabase.Instance.ExistsConfigNode("SystemHeat/Settings/SYSTEMHEAT"))
            {
                Utils.Log("[Settings]: Located settings file");

                settingsNode = GameDatabase.Instance.GetConfigNodes("SYSTEMHEAT").First();

                settingsNode.TryGetValue("DebugOverlay", ref DebugOverlay);
                settingsNode.TryGetValue("DebugUI", ref DebugUI);
                settingsNode.TryGetValue("DebugModules", ref DebugModules);
                settingsNode.TryGetValue("DebugPartUI", ref DebugPartUI);
                settingsNode.TryGetValue("DebugSimulation", ref DebugSimulation);
                settingsNode.TryGetValue("maxLoopCount", ref maxLoopCount);
                settingsNode.TryGetValue("SpaceTemperature", ref SpaceTemperature);
                settingsNode.TryGetValue("ConvectionBaseCoefficient", ref ConvectionBaseCoefficient);

                settingsNode.TryGetValue("UIUpdateInterval", ref UIUpdateInterval);
                settingsNode.TryGetValue("TimeWarpLimit", ref TimeWarpLimit);
                settingsNode.TryGetValue("MaxDeltaTPerStep", ref MaxDeltaTPerStep);
                settingsNode.TryGetValue("MinSteps", ref MinSteps);
                settingsNode.TryGetValue("MaxSteps", ref MaxSteps);

                settingsNode.TryGetValue("SimulationRateEditor", ref SimulationRateEditor);
                settingsNode.TryGetValue("AbsFluxThreshold", ref AbsFluxThreshold);
                settingsNode.TryGetValue("OverlayBaseLineWidth", ref OverlayBaseLineWidth);
                settingsNode.TryGetValue("OverlayPadding", ref OverlayPadding);
                settingsNode.TryGetValue("OverlayBoundsPadding", ref OverlayBoundsPadding);
            }
            else
            {
                Utils.Log("[Settings]: Couldn't find settings file, using defaults", LogType.Settings);
            }


            Utils.Log("[Settings]: Loading coolant types ", LogType.Settings);
            ConfigNode[] coolantNodes = GameDatabase.Instance.GetConfigNodes("COOLANTTYPE");

            CoolantData = new Dictionary <string, CoolantType>();
            foreach (ConfigNode node in coolantNodes)
            {
                CoolantType newCoolant = new CoolantType(node);
                CoolantData.Add(newCoolant.Name, newCoolant);
            }
            Utils.Log("[Settings]: Loaded coolant types", LogType.Settings);

            Utils.Log("[Settings]: Finished loading", LogType.Settings);
        }