Exemplo n.º 1
0
        /// <summary>
        /// This function adds a sensor with the data from the fields to the collection of sensors
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            SensorData data = new SensorData
            {
                Name            = txtName.Text,
                Description     = txtDesc.Text,
                Location        = new Location((double)numLat.Value, (double)numLong.Value),
                Type            = sensorTypeChooser.Text,
                PollingInterval = (int)numPoll.Value
            };

            RangeBoundaries <string> boundaries = new RangeBoundaries <string>(numMinVal.Text, numMaxVal.Text);

            if (logic.AddSensor(data, boundaries))
            {
                logic.SaveState();
            }
        }