Beispiel #1
0
        static void Main(string[] args)
        {
            var controller = new HeatingController();

            using (var termo = new Termometer(PollInterval))
            {
                var onEvent = new TemperatureEvent(termo, 3, 15, false);
                var offEvent = new TemperatureEvent(termo, 3, 15, true);

                var strategy = new HeatingStrategy(controller, onEvent, offEvent);
                //strategy.Start();

                termo.Start();

                //strategy.Stop();
                Console.ReadKey();
            }

            Console.WriteLine("Press any key..");
            Console.ReadKey();
        }
Beispiel #2
0
 public TemperatureEvent(Termometer termo, int period, double temperature, bool above)
 {
     this.movingAverage = new SimpleMovingAverageIndicator(period);
     this.termo = termo;
     this.above = above;
 }