Ejemplo n.º 1
0
        public ForecastViewerRequest(Station station, DateTime dateOrDateTime, GivenForecastTimeKind givenMode, RequestTimeDeterminateness dateTimeMode, IEnumerable <IAbstractDataSource> sources = null, IEnumerable <string> parameterTypes = null)
        {
            Station             = station;
            DateTime            = dateOrDateTime;
            GivenTime           = givenMode;
            TimeDeterminateness = dateTimeMode;
            if (sources != null)
            {
                Sources = sources;
            }
            else
            {
                Sources = SourcesDirector.Instance.ForecastDataSources;
            }

            if (parameterTypes != null)
            {
                ParameterTypes = parameterTypes;
            }
            else
            {
                ParameterTypes = ParametersFactory.KnownParameterTypesNames;
            }
        }
Ejemplo n.º 2
0
        private static bool IsSuitableDateTime(DateTime inForecast, DateTime inRequest, RequestTimeDeterminateness mode)
        {
            bool hours;

            switch (mode)
            {
            case RequestTimeDeterminateness.DateAndHour:
                hours = inForecast.Hour == inRequest.Hour;
                break;

            default:
                hours = true;
                break;
            }
            return(inForecast.Date == inRequest.Date && hours);
        }