Example #1
0
 protected override void OnStart()
 {
     base.OnStart();
     m_SensorManager = new SensorManager(this);
     m_SensorManager.AddSensor(new SightingSensor(SightDist, SightAngle));
     m_SensorManager.AddSensor(new HearingSensor(HearingRadius));
 }
Example #2
0
        static void Main(string[] args)
        {
            var sensorManager              = new SensorManager();
            var imperialSensorCreator      = new ImperialSensorCreator();
            var internationalSensorCreator = new InternationalSensorCreator();

            sensorManager.AddSensor(imperialSensorCreator.CreateTemperatureSensor());
            sensorManager.AddSensor(internationalSensorCreator.CreateTemperatureSensor());
        }
        public static void Exercice2()
        {
            Console.WriteLine("Exercice 2 : Flux de données dynamiques de capteurs");
            SensorManager    manager    = new SensorManager();
            USASensorFactory usaFactory = new USASensorFactory();

            manager.AddSensor(usaFactory.CreateThermometer());
            manager.RunSensors();
        }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            sensor.setName(TxtName.Text);
            sensor.setMaximumValue(Int32.Parse(TxtMaxValue.Text));
            sensor.setMinimumValue(Int32.Parse(TxtMinValue.Text));

            SensorManager.AddSensor(sensor);
            this.mainWindow.OpenWindow(new SensorConfig(mainWindow));
        }
Example #5
0
        static void Main(string[] args)
        {
            SensorManager sensorManager = new SensorManager();

            sensorManager.AddSensor(SensorFactory.CreateSensor(EDataType.Temp, EUnit.Kelvin));

            while (true)
            {
                sensorManager.UpdateSensors();
                Thread.Sleep(5000);
            }
        }
        public void Add(int a_Rate, int a_Channels)
        {
            m_Rate     = a_Rate;
            m_Channels = a_Channels;
            m_IsAdded  = true;

            if (SensorManager != null)
            {
                SensorManager.AddSensor(this, m_bOverride);
            }
            else
            {
                Log.Error("SelfMicrophoneSensor", "SensorManager needs to be supported and can't be null.");
            }
        }
Example #7
0
 /// <summary>
 /// Saves the Changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, EventArgs e)
 {
     delSensor.setName(txtName.Text);
     try
     {
         delSensor.setMaximumValue(Int32.Parse(txtMaxValue.Text));
         delSensor.setMinimumValue(Int32.Parse(txtMinValue.Text));
         SensorManager.AddSensor(delSensor);
         this.Hide();
     }
     catch (FormatException ice)
     {
         new Notification("Error", "Maximum or Minimum is not a valid number");
     }
 }