Beispiel #1
0
        public static BHR.SimulationResult FromTAS(this TSD.SurfaceData tsdData, BHR.ProfileResultUnit unitType, BHR.ProfileResultType resultType, int hour, int day)
        {
            TSD.tsdSurfaceArray?srfType = resultType.ToTASSurfaceType();
            if (srfType == null)
            {
                BH.Engine.Base.Compute.RecordError("That Result Type is not valid for Building Element results - please choose a different result type");
                return(null);
            }

            List <double> results = new List <double>();

            switch (unitType)
            {
            case BHR.ProfileResultUnit.Yearly:
                object yearRes = tsdData.GetAnnualSurfaceResult((int)srfType.Value);
                results = ToDoubleList(yearRes);
                break;

            case BHR.ProfileResultUnit.Daily:
                if (day < 1 || day > 365)
                {
                    BH.Engine.Base.Compute.RecordError("Please set a day between 1 and 365 inclusive");
                    return(null);
                }
                object dayRes = tsdData.GetDailySurfaceResult(day, (int)srfType.Value);
                results = ToDoubleList(dayRes);
                break;

            case BHR.ProfileResultUnit.Hourly:
                if (hour < 1 || hour > 24)
                {
                    BH.Engine.Base.Compute.RecordError("Please set an hour between 1 and 24 inclusive");
                    return(null);
                }
                results.Add(tsdData.GetHourlySurfaceResult(hour, (int)srfType.Value));
                break;

            default:
                BH.Engine.Base.Compute.RecordError("That unit type is not valid for pulling results from TAS TSD. Please select a different result unit type");
                return(null);
            }

            BHR.SimulationResult result = new BHR.SimulationResult();
            result.SimulationResultType = BHR.SimulationResultType.SpaceResult;
            result.SimulationResults.Add(new BHR.ProfileResult {
                Name = tsdData.BEName, Type = resultType, Unit = unitType, Results = results
            });

            return(result);
        }
Beispiel #2
0
 public static TSD.SurfaceData ToTASSurface(this BHR.SimulationResult result)
 {
     throw new NotImplementedException("This method has not yet been created");
 }