Exemple #1
0
        public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {
            StringBuilder   stringBuilder  = new StringBuilder();
            CompTempControl tempControl    = req.Thing.TryGetComp <CompTempControl>();
            Thing           tempController = req.Thing;

            float roomTemp              = tempController.Position.GetTemperature(tempController.Map);
            float energyPerSecond       = tempControl.Props.energyPerSecond; // the power of the radiator
            float roomSurface           = tempController.Position.GetRoomGroup(tempController.Map).CellCount;
            float coolingConversionRate = 4.16666651f;                       // Celsius cooled per Joules*Second*Meter^2  conversion rate
            float minTemp        = 20;
            float maxTemp        = 120;
            float efficiency     = 1 - Mathf.Min(Mathf.Max((roomTemp - minTemp) / (maxTemp - minTemp), 0), 1);
            float maxACPerSecond = energyPerSecond * efficiency / roomSurface * coolingConversionRate; // max cooling power possible

            SEB seb = new SEB("StatsReport_RWHS");

            seb.Simple("AmbientRoomTemp", roomTemp);
            seb.Simple("EnergyPerSecond", energyPerSecond);
            seb.Simple("RoomSurface", roomSurface);
            seb.Simple("ACConversionRate", coolingConversionRate);
            seb.Full("LerpEfficiency", efficiency * 100, roomTemp, minTemp, maxTemp);
            seb.Full("MaxACPerSecond", maxACPerSecond, energyPerSecond, efficiency, roomSurface, coolingConversionRate);

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

            IntVec3 intVec3_2 = tempController.Position + IntVec3.North.RotatedBy(tempController.Rotation);
            IntVec3 intVec3_1 = 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             = intVec3_1.GetRoomGroup(tempController.Map).CellCount;
            float coolingConversionRate   = 4.16666651f;                                               // Celsius cooled per Joules*Second*Meter^2  conversion rate
            float sidesTempGradient       = extRoomTemp - (cooledRoomTemp < 40 ? cooledRoomTemp : 40);
            float efficiency     = (1f - sidesTempGradient * efficiencyLossPerDegree);                 // a negative value indicates heat generation
            float maxACPerSecond = energyPerSecond * efficiency / roomSurface * coolingConversionRate; // max cooling power possible, positive value indicates heat generation

            SEB seb = new SEB("StatsReport_RWHS");

            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, extRoomTemp, cooledRoomTemp);
            seb.Full("RelativeEfficiency", efficiency * 100, sidesTempGradient, efficiencyLossPerDegree);
            seb.Full("MaxACPerSecond", maxACPerSecond, energyPerSecond, efficiency, roomSurface, coolingConversionRate);

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

            float heatPerSecond       = comp.Props.heatPerSecond;
            float surface             = comp.parent.PositionHeld.GetRoomGroup(comp.parent.Map).CellCount;
            float heatPushedPerSecond = heatPerSecond / surface;

            SEB seb = new SEB("StatsReport_RWHS");

            seb.Simple("HeatPushedPerSecond", heatPerSecond);
            seb.Simple("RoomSurface", surface);
            seb.Full("HeatOutputPerSecond", heatPushedPerSecond, heatPerSecond, surface);

            return(seb.ToString());
        }
Exemple #4
0
        public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {
            float     heatPerSecond = RWHS_PowerPlantSteam.GetHeatPerSecond();
            float     surface       = 25;
            RoomGroup roomGroup     = req.Thing.Position.GetRoomGroup(req.Thing.Map);

            if (roomGroup != null)
            {
                surface = roomGroup.CellCount; // TODO DEBUG THIS LINE
            }
            float heatPushedPerSecond = heatPerSecond / surface;

            SEB seb = new SEB("StatsReport_RWHS");

            seb.Simple("HeatPushedPerSecond", heatPerSecond);
            seb.Simple("RoomSurface", surface);
            seb.Full("HeatOutputPerSecond", heatPushedPerSecond, heatPerSecond, surface);

            return(seb.ToString());
        }
Exemple #5
0
        public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {

            StringBuilder stringBuilder = new StringBuilder();
            CompTempControl tempControl = req.Thing.TryGetComp<CompTempControl>();
            Thing tempController = req.Thing;

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

            float cooledRoomTemp = intVec3_1.GetTemperature(tempController.Map);
            float targetTemp = tempControl.targetTemperature;
            float targetTempDiff = targetTemp - cooledRoomTemp;
            float maxACPerSecond = RWHS_TempControl_RoomExchange.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_RWHS");
            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();
        }
Exemple #6
0
        public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {
            CompTempControl tempControl    = req.Thing.TryGetComp <CompTempControl>();
            Thing           tempController = req.Thing;

            float roomTemp       = tempController.Position.GetTemperature(tempController.Map);
            float targetTemp     = tempControl.targetTemperature;
            float targetTempDiff = targetTemp - roomTemp;
            float maxACPerSecond = RWHS_TempControl_InPlace.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_RWHS");

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

            return(seb.ToString());
        }