Пример #1
0
        void ProgramStarted()
        {
            Message("Initialising");

            Initialise("fez", true);

            light = new SensorLight(1000);
            temp  = new SensorTemp(20000);

            light.OnBeforeMeasurement += OnBeforeMeasure;
            light.OnAfterMeasurement  += OnMeasureCompleted;

            temp.OnBeforeMeasurement += OnBeforeMeasure;
            temp.OnAfterMeasurement  += OnMeasureCompleted;

            Message(string.Empty);
        }
Пример #2
0
        public MakerMain()
        {
            Initialise("hydra", false);

            using (SensorLight light = new SensorLight(500))
                using (SensorTemp temp = new SensorTemp(5000))
                    //  using (SensorMemory mem = new SensorMemory(5000))
                    using (SensorError error = new SensorError(5000)) {
                        light.OnBeforeMeasurement += OnBeforeMeasure;
                        light.OnAfterMeasurement  += OnMeasureCompleted;

                        temp.OnBeforeMeasurement += OnBeforeMeasure;
                        temp.OnAfterMeasurement  += OnMeasureCompleted;

                        //mem.OnBeforeMeasurement += OnBeforeMeasure;
                        //mem.OnAfterMeasurement += OnMeasureCompleted;

                        error.OnBeforeMeasurement += OnBeforeMeasure;
                        error.OnAfterMeasurement  += OnMeasureCompleted;

                        Thread.Sleep(Timeout.Infinite);
                    }
        }