public void ReportIntervalButton()

in sensors/Tools/SensorExplorer/Scenario1_View.xaml.cs [631:703]


        public void ReportIntervalButton(object sender, RoutedEventArgs e)
        {
            try
            {
                SensorDisplay selectedDisplay = Sensor.SensorDisplay[Sensor.CurrentId];
                SensorData selectedData = Sensor.SensorData[Sensor.CurrentId];

                uint newReportInterval = uint.Parse(selectedDisplay.TextboxReportInterval.Text);
                selectedData.UpdateReportInterval(newReportInterval);

                if (selectedDisplay.SensorType == Sensor.ACCELEROMETER)
                {
                    Sensor.AccelerometerStandardList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.ACCELEROMETERGRAVITY)
                {
                    Sensor.AccelerometerGravityList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.ACCELEROMETERLINEAR)
                {
                    Sensor.AccelerometerLinearList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.ALTIMETER)
                {
                    Sensor.Altimeter.ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.BAROMETER)
                {
                    Sensor.BarometerList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.COMPASS)
                {
                    Sensor.CompassList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.CUSTOMSENSOR)
                {
                    Sensor.CustomSensorList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.GYROMETER)
                {
                    Sensor.GyrometerList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.INCLINOMETER)
                {
                    Sensor.InclinometerList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.LIGHTSENSOR)
                {
                    Sensor.LightSensorList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.MAGNETOMETER)
                {
                    Sensor.MagnetometerList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.ORIENTATIONSENSOR)
                {
                    Sensor.OrientationAbsoluteList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.ORIENTATIONGEOMAGNETIC)
                {
                    Sensor.OrientationGeomagneticList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.ORIENTATIONRELATIVE)
                {
                    Sensor.OrientationRelativeList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
                else if (selectedDisplay.SensorType == Sensor.PEDOMETER)
                {
                    Sensor.PedometerList[selectedDisplay.Index].ReportInterval = newReportInterval;
                }
            }
            catch { }
        }