Exemple #1
0
        static void Main(string[] args)
        {
            WeatherData weatherData = new WeatherData();
            CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(weatherData);

            weatherData.setMeasurements(80, 65, 30.4F);
            weatherData.setMeasurements(82, 70, 29.2F);
            weatherData.setMeasurements(78, 90, 29.2F);
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            WeatherData weatherData = new WeatherData();
            CurrentConditionsDisplay currentDisplay = new CurrentConditionsDisplay(weatherData);

            weatherData.setMeasurements(80, 65, 34.5f);
            weatherData.setMeasurements(45, 78, 32.5f);
            weatherData.setMeasurements(78, 90, 37.5f);
            Console.ReadKey();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            var weatherData    = new WeatherData();
            var currentDisplay = new CurrentConditionsDisplay(weatherData);

            weatherData.setMeasurements(new WeatherDataObserverInput(80, 65, 30.4f));
            weatherData.setMeasurements(new WeatherDataObserverInput(82, 70, 29.2f));
            weatherData.setMeasurements(new WeatherDataObserverInput(78, 90, 29.2f));
            Console.ReadLine();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            WeatherData weatherData = new WeatherData();


            currentConditionsDisplay currentDisplay = new currentConditionsDisplay(weatherData);

            Console.WriteLine("New data:");

            weatherData.setMeasurements(80, 65, 30.4);
            weatherData.setMeasurements(82, 70, 29.2);
            weatherData.setMeasurements(78, 90, 29.2);

            Console.WriteLine("Changes:");

            weatherData.setMeasurements(65, 65, 31.4);
            weatherData.setMeasurements(80, 50, 25.2);
            weatherData.setMeasurements(76, 70, 25.9);

            Console.WriteLine("Changes:");

            weatherData.setMeasurements(6, 65, 31.4);
            weatherData.setMeasurements(80, 50, 25.2);
            weatherData.setMeasurements(76, 70, 25.9);

            Console.ReadKey();
        }
        public static void Main(string[] args)
        {
            WeatherData weatherData = new WeatherData();

            CurrentConditionsDisplay currentDisplay = new CurrentConditionsDisplay(weatherData);

            weatherData.setMeasurements(80, 65, 30.4f);
            weatherData.setMeasurements(82, 70, 29.2f);
            weatherData.setMeasurements(78, 90, 29.2f);

            Console.ReadLine();
        }
Exemple #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();
        }
        static void Main(string[] args)
        {
            WeatherData      weatherData      = new WeatherData();
            ForecastDisplay  forecastDisplay  = new ForecastDisplay(weatherData);
            HeatIndexDisplay heatIndexDisplay = new HeatIndexDisplay(weatherData);

            //weatherData.registerObserver(forecastDisplay);
            //weatherData.registerObserver(heatIndexDisplay);


            weatherData.setMeasurements(80, 65, 30.4f);
            weatherData.setMeasurements(82, 70, 29.2f);
            weatherData.setMeasurements(78, 90, 29.2f);
        }
Exemple #8
0
        static void Main(string[] args)
        {
            WeatherData weatherData = new WeatherData();
            CurrentConditionsDisplay currentDisplay  = new CurrentConditionsDisplay(weatherData);
            CurrentHumidityDisplay   currentDisplay2 = new CurrentHumidityDisplay(weatherData);
            CurrentPressureDisplay   currentDisplay3 = new CurrentPressureDisplay(weatherData);

            weatherData.setMeasurements(20, 60, 30);
            weatherData.setMeasurements(23, 55, 20);
            weatherData.setMeasurements(25, 50, 25);
            weatherData.setMeasurements(22, 52, 30);
            weatherData.setMeasurements(20, 70, 40);
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            //register the subject (What everyone is listening to)
            WeatherData weatherData = new WeatherData();

            //register the observer passing the subject (who is actually listening)
            CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(weatherData);
            ChangedConditionsDisplay changedConditionsDisplay = new ChangedConditionsDisplay(weatherData);

            //update the subject (this will send the data to all the subjects)
            weatherData.setMeasurements(80, 65, 30);
            weatherData.setMeasurements(20, 20, 20);

            Console.ReadKey();
        }
Exemple #10
0
        static void Main(string[] args)
        {
            //first create the weatherdata object
            WeatherData weatherData = new WeatherData();

            CurrentConditionsDisplay cd = new CurrentConditionsDisplay(weatherData);

            //StatisticsDisplay
            //ForecastDisplay

            //simulate new weather measurements
            weatherData.setMeasurements(60, 65, 40);
            weatherData.setMeasurements(70, 45, 30);
            weatherData.setMeasurements(80, 65, 48);
        }
Exemple #11
0
        static void Main(string[] args)
        {
            // create subject weather data to get updated from the weather station
            WeatherData weatherData = new WeatherData();

            // create three differenet display observers
            CurrentConditionsDisplay currentDisplay    = new CurrentConditionsDisplay(weatherData);
            StatisticsDisplay        statisticsDisplay = new StatisticsDisplay(weatherData);
            ForecastDisplay          forecastDisplay   = new ForecastDisplay(weatherData);
            HeadIndexDisplay         heatIndexDisplay  = new HeadIndexDisplay(weatherData);

            // simulate new weather measurements
            weatherData.setMeasurements(80, 65, 30.4f);
            weatherData.setMeasurements(82, 70, 29.2f);
            weatherData.setMeasurements(78, 90, 29.2f);
        }
Exemple #12
0
        static void Main(string[] args)
        {
            WeatherData             weatherData    = new WeatherData();
            CurrentConditionDisplay currentDisplay = new CurrentConditionDisplay(weatherData);

            weatherData.setMeasurements(80, 65, 30.4f);
        }
Exemple #13
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);
        }
Exemple #14
0
        static void Main(string[] args)
        {
            WeatherData WD = new WeatherData();
            CurrentConditionsDisplay CCdisplay = new CurrentConditionsDisplay(WD);
            StatisticalDisplay STDisplay = new StatisticalDisplay(WD);
            WD.setMeasurements(15.4f, 65.2f, 1002f);
            WD.setMeasurements(15.6f, 64.0f, 1004f);
            WD.setMeasurements(15.7f, 63.8f, 1004f);
            WD.setMeasurements(15.7f, 63.2f, 1004f);
            WD.setMeasurements(15.8f, 63.4f, 1003f);
            WD.setMeasurements(15.8f, 63.3f, 1004f);
            WD.setMeasurements(15.8f, 63.3f, 1004f);
            WD.setMeasurements(15.9f, 63.2f, 1005f);
            WD.setMeasurements(15.9f, 63.4f, 1005f);
            WD.setMeasurements(15.9f, 62.9f, 1005f);
            WD.setMeasurements(15.9f, 62.8f, 1005f);
            WD.setMeasurements(15.8f, 62.9f, 1006f);
            WD.setMeasurements(15.8f, 62.9f, 1005f);
            WD.setMeasurements(15.7f, 62.8f, 1005f);
            WD.setMeasurements(15.7f, 63.0f, 1006f);
            WD.setMeasurements(15.6f, 63.2f, 1005f);
            WD.setMeasurements(15.5f, 63.1f, 1005f);
            WD.setMeasurements(15.4f, 63.2f, 1005f);

            Console.ReadKey();
        }