Beispiel #1
0
        public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {
            var   heatPushed          = SOS2HS_SOS2_Heatsink.GetMaxHeatPushed();
            var   heatPushTick        = SOS2HS_SOS2_Heatsink.GetHeatVentTick(req);
            float surface             = SOS2HS_SOS2_Heatsink.GetRoomSurface(req.Thing);
            float heatPushedPerSecond = heatPushed / heatPushTick * 60;
            float heatOutputPerSecond = heatPushedPerSecond / surface;

            SEB seb = new SEB("StatsReport_SOS2HS");

            seb.Simple("MaxHeatPushed", heatPushed);
            seb.Simple("HeatPushTickInterval", heatPushTick);
            seb.Simple("RoomSurface", surface);
            seb.Full("HeatPushedPerSecond", heatPushedPerSecond, heatPushed, heatPushTick);
            seb.Full("HeatOutputPerSecond", heatOutputPerSecond, heatPushedPerSecond, surface);

            return(seb.ToString());
        }
Beispiel #2
0
        public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {
            CompTempControl tempControl    = req.Thing.TryGetComp <CompTempControl>();
            Thing           tempController = req.Thing;

            IntVec3 intVec3_1 = tempController.Position + IntVec3.North.RotatedBy(tempController.Rotation);

            float cooledRoomTemp = intVec3_1.GetTemperature(tempController.Map);
            float targetTemp     = tempControl.targetTemperature;
            float targetTempDiff = targetTemp - cooledRoomTemp;
            float maxACPerSecond = SOS2HS_SOS2_Radiator.GetMaxACPerSecond(req); // max cooling power possible
            bool  isHeater       = tempControl.Props.energyPerSecond > 0;
            float actualAC;

            if (isHeater)
            {
                actualAC = Mathf.Max(Mathf.Min(targetTempDiff, maxACPerSecond), 0);
            }
            else
            {
                actualAC = Mathf.Min(Mathf.Max(targetTempDiff, maxACPerSecond), 0);
            }

            SEB seb = new SEB("StatsReport_SOS2HS");

            seb.Simple("CooledRoomTemp", cooledRoomTemp);
            seb.Simple("TargetTemperature", targetTemp);
            seb.Full("TargetTempDiff", targetTempDiff, targetTemp, cooledRoomTemp);
            seb.Simple("MaxACPerSecond", maxACPerSecond);
            if (isHeater)
            {
                seb.Full("ActualHeaterACPerSecond", actualAC, targetTempDiff, maxACPerSecond);
            }
            else
            {
                seb.Full("ActualCoolerACPerSecond", actualAC, targetTempDiff, maxACPerSecond);
            }

            return(seb.ToString());
        }
        public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {
            CompTempControl tempControl    = req.Thing.TryGetComp <CompTempControl>();
            Thing           tempController = req.Thing;

            IntVec3 intVec3_1 = tempController.Position + IntVec3.North.RotatedBy(tempController.Rotation);
            IntVec3 intVec3_2 = tempController.Position + IntVec3.South.RotatedBy(tempController.Rotation);

            float cooledRoomTemp          = intVec3_1.GetTemperature(tempController.Map);
            float extRoomTemp             = intVec3_2.GetTemperature(tempController.Map);
            float efficiencyLossPerDegree = 1.0f / 130.0f;                     // SOS2 internal value, means loss of efficiency for each degree above targettemp, lose 50% at 65C above targetTemp, 100% at 130+
            float energyPerSecond         = tempControl.Props.energyPerSecond; // the power of the radiator
            float roomSurface             = SOS2HS_SOS2_Radiator.GetRoomSurface(req.Thing);
            float coolingConversionRate   = 4.16666651f;                       // Celsius cooled per JoulesSecond*Meter^2  conversion rate
            float sidesTempGradient       = (cooledRoomTemp - extRoomTemp);
            float efficiency     = (1f - sidesTempGradient * efficiencyLossPerDegree);
            float maxACPerSecond = energyPerSecond * efficiency / roomSurface * coolingConversionRate; // max cooling power possible


            SEB seb = new SEB("StatsReport_SOS2HS");

            seb.Simple("CooledRoomTemp", cooledRoomTemp);
            seb.Simple("ExteriorRoomTemp", extRoomTemp);
            seb.Simple("EfficiencyLossPerDegree", efficiencyLossPerDegree);
            seb.Simple("EnergyPerSecond", energyPerSecond);
            seb.Simple("CooledRoomSurface", roomSurface);
            seb.Simple("ACConversionRate", coolingConversionRate);
            seb.Full("SidesTempGradient", sidesTempGradient, cooledRoomTemp, extRoomTemp);
            seb.Full("RelativeEfficiency", efficiency * 100, sidesTempGradient, efficiencyLossPerDegree);
            seb.Full("MaxACPerSecond", maxACPerSecond, energyPerSecond, efficiency, roomSurface, coolingConversionRate);

            return(seb.ToString());
        }