예제 #1
0
        static void Main(string[] args)
        {
            var weatherData = new WeatherData();

            var currentDisply    = new CurrentConditionDisplay(weatherData);
            var heatIndexDisplay = new HeatIndexDisplay(weatherData);
            var forecast         = new ForecastDisplay(weatherData);

            weatherData.Temperature = 80;

            Console.WriteLine("------------------------------------------");

            weatherData.Humidity = 65;

            Console.WriteLine("------------------------------------------");

            weatherData.Pressure = 30.4f;

            Console.WriteLine("------------------------------------------");


            weatherData.SetMeasurements(82, 70, 29.2f);

            Input(weatherData);
        }
예제 #2
0
        static void Main(string[] args)
        {
            WeatherData             weatherData    = new WeatherData();
            CurrentConditionDisplay currentDisplay = new CurrentConditionDisplay(weatherData);

            weatherData.setMeasurements(80, 65, 30.4f);
        }
예제 #3
0
        static void Main(string[] args)
        {
            WeatherData             weatherData    = new WeatherData();
            CurrentConditionDisplay currentDisplay = new CurrentConditionDisplay(weatherData);

            weatherData.SetMeasurement(20, 30, 40);

            Console.ReadKey();
        }
예제 #4
0
        private static void WeatherStation()
        {
            var weatherData       = new Weatherdata();
            var currentDisplay    = new CurrentConditionDisplay(weatherData);
            var statisticsDisplay = new StatisticsDisplay(weatherData);
            var forcastDisplay    = new ForecastDisplay(weatherData);

            weatherData.SetMeasurements(80, 65, 30.4f);
            weatherData.SetMeasurements(82, 70, 29.4f);
            weatherData.SetMeasurements(78, 80, 29.2f);
        }
예제 #5
0
        static void Main(string[] args)
        {
            WeathData weathData = new WeathData();

            CurrentConditionDisplay currentConditionDisplay = new CurrentConditionDisplay(weathData);

            weathData.SetMeasurements(30, 42, 30.2f);
            weathData.SetMeasurements(36, 20, 34.5f);
            weathData.SetMeasurements(40, 55, 38.8f);

            Console.Read();
        }
예제 #6
0
        static void Main(string[] args)
        {
            WeatherData weatherData = new WeatherData();

            CurrentConditionDisplay currentDisplay    = new CurrentConditionDisplay(weatherData);
            StatisticsDisplay       statisticsDisplay = new StatisticsDisplay(weatherData);
            ForecastDisplay         forecastDisplay   = new ForecastDisplay(weatherData);

            weatherData.setMeasurements(80, 65, 30.4f);
            weatherData.setMeasurements(82, 70, 29.9f);
            weatherData.setMeasurements(78, 90, 29.2f);
            Console.Read();
        }
예제 #7
0
        static void Main(string[] args)
        {
            WeatherData wd = new WeatherData();

            IDisplayElement currentConditionsDisplay = new CurrentConditionDisplay(wd);
            IDisplayElement statisticsDisplay        = new StatisticsDisplay(wd);
            IDisplayElement forecastDisplay          = new ForecastDisplay(wd);

            wd.SetMeasurements(80, 65, 30.4);
            Task.Delay(2000).Wait();
            wd.SetMeasurements(82, 70, 29.2);
            Task.Delay(2000).Wait();
            wd.SetMeasurements(78, 90, 29.2);
        }
예제 #8
0
        static void Main(string[] args)
        {
            //Create the weatherData object
            WeatherData weatherData = new WeatherData();

            //Create the 3 displays and pass them the weatherData object
            CurrentConditionDisplay currentDisplay    = new CurrentConditionDisplay(weatherData);
            StatisticsDisplay       statisticsDisplay = new StatisticsDisplay(weatherData);
            ForecastDisplay         forecastDisplay   = new ForecastDisplay(weatherData);
            //Add the new heat index display
            HeatIndexDisplay heatIndexDisplay = new HeatIndexDisplay(weatherData);

            //Input data (from fictional weather station)
            weatherData.SetMeasurements(80, 65, 30.4f);
            weatherData.SetMeasurements(82, 70, 29.2f);
            weatherData.SetMeasurements(78, 90, 29.2f);

            //Show display output in console
            Console.ReadLine();
        }
예제 #9
0
        static void Main(string[] args)
        {
            WeatherData weatherData = new WeatherData();

            CurrentConditionDisplay currentdDisplay = new CurrentConditionDisplay(weatherData);

            /*
             * Se deberia poner el StatisticDisplay y  el ForecastDisplay
             *
             * StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData);
             * ForecastDisplay forecastDisplay = ForecastDisplay(weatherData);
             *
             */

            HeatIndexDisplay heatDisplay = new HeatIndexDisplay(weatherData);

            weatherData.setMeasurements(80, 65, 30.4f);
            weatherData.setMeasurements(82, 70, 29.2f);
            weatherData.setMeasurements(78, 90, 29.2f);
        }
예제 #10
0
        static void Main(string[] args)
        {
            var weatherData = new WeatherData();

            var currentDisply = new CurrentConditionDisplay(weatherData);
            var heatIndexDisplay = new HeatIndexDisplay(weatherData);
            var forecast = new ForecastDisplay(weatherData);

            weatherData.Temperature = 80;

            Console.WriteLine("------------------------------------------");

            weatherData.Humidity = 65;

            Console.WriteLine("------------------------------------------");

            weatherData.Pressure = 30.4f;

            Console.WriteLine("------------------------------------------");

            weatherData.SetMeasurements(82, 70, 29.2f);

            Input(weatherData);
        }