Esempio n. 1
0
 public HeatLoop Loop(int id)
 {
     if (HeatLoops != null)
     {
         return(HeatLoops.Find(x => x.ID == id));
     }
     return(null);
 }
Esempio n. 2
0
 public HeatLoop Loop(int id)
 {
     if (HeatLoops != null)
     {
         return(HeatLoops.Find(x => x.ID == id));
     }
     Utils.Log("nah loop");
     return(null);
 }
Esempio n. 3
0
        /// <summary>
        /// Remove a heat module from a specific HeatLoop
        /// </summary>
        /// <param name="loopID">the loop to remove from</param>
        /// <param name="module">the module to remove</param>
        public void RemoveHeatModuleFromLoop(int loopID, ModuleSystemHeat module)
        {
            HeatLoops[loopID].RemoveHeatModule(module);


            Utils.Log(String.Format("[SystemHeatSimulator]: Removed module {0} from Heat Loop {1}", module.moduleID, loopID), LogType.Simulator);

            if (Loop(loopID).LoopModules.Count == 0)
            {
                HeatLoops.Remove(Loop(loopID));

                Utils.Log(String.Format("[SystemHeatSimulator]: Heat Loop {0} has no more members, removing", loopID), LogType.Simulator);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Remove a heat module from a specific HeatLoop
        /// </summary>
        /// <param name="loopID">the loop to remove from</param>
        /// <param name="module">the module to remove</param>
        public void RemoveHeatModuleFromLoop(int loopID, ModuleSystemHeat module)
        {
            HeatLoops[loopID].RemoveHeatModule(module);

            if (SystemHeatSettings.DebugSimulation)
            {
                Utils.Log(String.Format("[SystemHeatSimulator]: Removed module {0} from Heat Loop {1}", module.moduleID, loopID));
            }

            if (HeatLoops[loopID].LoopModules.Count == 0)
            {
                HeatLoops.Remove(loopID);
                if (SystemHeatSettings.DebugSimulation)
                {
                    Utils.Log(String.Format("[SystemHeatSimulator]: Heat Loop {0} has no more members, removing", loopID));
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Add a heat module to a specific HeatLoop
        /// </summary>
        /// <param name="loopID">the loop to add to</param>
        /// <param name="module">the module to add</param>
        public void AddHeatModuleToLoop(int loopID, ModuleSystemHeat module)
        {
            // Build a new heat loop as needed
            if (!HeatLoops.ContainsKey(loopID))
            {
                HeatLoops.Add(loopID, new HeatLoop(loopID));
                if (SystemHeatSettings.DebugSimulation)
                {
                    Utils.Log(String.Format("[SystemHeatSimulator]: Created new Heat Loop {0}", loopID));
                }
            }
            HeatLoops[loopID].AddHeatModule(module);

            if (SystemHeatSettings.DebugSimulation)
            {
                Utils.Log(String.Format("[SystemHeatSimulator]: Added module {0} to Heat Loop {1}", module.moduleID, loopID));
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Add a heat module to a specific HeatLoop
        /// </summary>
        /// <param name="loopID">the loop to add to</param>
        /// <param name="module">the module to add</param>
        public void AddHeatModuleToLoop(int loopID, ModuleSystemHeat module)
        {
            // Build a new heat loop as needed
            if (!HasLoop(loopID))
            {
                HeatLoops.Add(new HeatLoop(this, loopID));

                Utils.Log(String.Format("[SystemHeatSimulator]: Created new Heat Loop {0}", loopID), LogType.Simulator);
            }
            foreach (HeatLoop loop in HeatLoops)
            {
                if (loop.ID == loopID)
                {
                    loop.AddHeatModule(module);
                }
            }


            Utils.Log(String.Format("[SystemHeatSimulator]: Added module {0} to Heat Loop {1}", module.moduleID, loopID), LogType.Simulator);
        }