Esempio n. 1
0
 private void Chart_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     Telerik.UI.Xaml.Controls.Chart.RadCartesianChart chart = sender as RadCartesianChart;
     if (chart != null)
     {
         StationLib.StationSocketListener plistener = chart.DataContext as StationLib.StationSocketListener;
         if (plistener != null)
         {
             StationLib.StationSensors SennsorValue = plistener.StationSensors;
             if (SennsorValue != null)
             {
                 for (int i = 0; i < chart.Series.Count; i++)
                 {
                     //   ScatterLineSeries lineseries = chart.Series[i] as ScatterLineSeries;
                     LineSeries lineseries = chart.Series[i] as LineSeries;
                     if (lineseries != null)
                     {
                         Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding Ybinding = lineseries.ValueBinding as Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding;
                         ChartViewType viewType = (ChartViewType)ChartViewCombo.SelectedItem;
                         Ybinding.PropertyName = viewType.ViewPropertyName;
                         //m_MapTemperatureChart.Add(SennsorValue.SensorValues, lineseries);
                         fillChart(SennsorValue.SensorValues, lineseries);
                         m_SensorMaps.Add(new SensorMapToScatterLine(lineseries, SennsorValue.SensorValues));
                     }
                 }
             }
         }
     }
 }
Esempio n. 2
0
        public void SelectSensorView()
        {
            SensorViewType viewType = (SensorViewType)SensorViewCombo.SelectedItem;

            if (viewType == null)
            {
                return;
            }

            StationLib.StationSocketListener plistener = m_StationListeners.getSelectedItem();
            if (plistener != null)
            {
                StationLib.StationSensors sensorValoues = plistener.StationSensors;
                //  Frame frame = null;
                FrameToPageType frameToPageType;

                m_SensorToFrame.TryGetValue(sensorValoues, out frameToPageType);
                if (frameToPageType != null)
                {
                    // Check if active Type !=
                    if (frameToPageType.PageType != viewType.PageType)
                    {
                        frameToPageType.PageFrame.Navigate(viewType.PageType, sensorValoues);
                        frameToPageType.PageType = viewType.PageType;
                        OnPropertyChanged("SelectedSensorValues");
                    }
                }
            }
        }
Esempio n. 3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter is StationLib.StationSensors)
            {
                m_SensorValues = e.Parameter as StationLib.StationSensors;
            }

            base.OnNavigatedTo(e);
        }
Esempio n. 4
0
        public bool writeSensorDatatoLocalStorage(StationLib.StationSensors sensorValues, Windows.Storage.ApplicationDataCompositeValue composite, int sensorValuesIdx)
        {
            bool bok = m_localStorage.writeSettingsToLocalStorage(composite, sensorValuesIdx);

            bok = m_localStorage.writeStringSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.SensorName", sensorValuesIdx), sensorValues.SensorName);
            bok = m_localStorage.writeStringSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.SensorViewName", sensorValuesIdx), sensorValues.SensorViewName);
            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.DevId", sensorValuesIdx), sensorValues.DevId);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.RecordingHours", sensorValuesIdx), sensorValues.RecordingHours);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.RecordingSamplePerHour", sensorValuesIdx), sensorValues.RecordingSamplePerHour);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.Height", sensorValuesIdx), sensorValues.Height);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.TemperatureMin", sensorValuesIdx), sensorValues.TemperatureMin);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.TemperatureMax", sensorValuesIdx), sensorValues.TemperatureMax);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellTemperatureMax", sensorValuesIdx), sensorValues.WellTemperatureMax);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellTemperatureMin", sensorValuesIdx), sensorValues.WellTemperatureMin);


            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.HumidityMin", sensorValuesIdx), sensorValues.HumidityMin);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.HumidityMax", sensorValuesIdx), sensorValues.HumidityMax);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellHumidityMax", sensorValuesIdx), sensorValues.WellHumidityMax);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellHumidityMin", sensorValuesIdx), sensorValues.WellHumidityMin);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.PressureMin", sensorValuesIdx), sensorValues.PressureMin);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.PressureMax", sensorValuesIdx), sensorValues.PressureMax);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellPressureMax", sensorValuesIdx), sensorValues.WellPressureMax);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellPressureMin", sensorValuesIdx), sensorValues.WellPressureMin);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.FillingLevelMin", sensorValuesIdx), sensorValues.FillingLevelMin);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.FillingLevelMax", sensorValuesIdx), sensorValues.FillingLevelMax);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellFillingLevelMin", sensorValuesIdx), sensorValues.WellFillingLevelMin);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellFillingLevelMax", sensorValuesIdx), sensorValues.WellFillingLevelMax);


            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.SensorDistanceMin", sensorValuesIdx), sensorValues.SensorDistanceMin);
            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.SensorDistanceMax", sensorValuesIdx), sensorValues.SensorDistanceMax);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.CysternDiameter", sensorValuesIdx), sensorValues.CysternDiameter);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.CysternVolumeProCm", sensorValuesIdx), sensorValues.CysternVolumeProCm);

            return(bok);
        }
Esempio n. 5
0
        private void SensorViewFrame_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            Frame frame = sender as Frame;

            if (frame != null)
            {
                StationLib.StationSensors sensorValues = frame.DataContext as StationLib.StationSensors;
                if (sensorValues != null)
                {
                    SensorViewType  viewType        = (SensorViewType)SensorViewCombo.SelectedItem;
                    Type            pageType        = null; // erste mal immer setzen
                    FrameToPageType frameToPageType = new FrameToPageType(frame, pageType);

                    m_SensorToFrame.Add(sensorValues, frameToPageType);
                    SelectSensorView();
                }
            }
            //   this.SensorViewFrame.Navigate(typeof(ViewSensorPage), sensorValues);
        }
Esempio n. 6
0
        private void ChartView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            StationLib.StationSocketListener plistener;

            {
                ComboBox combo = sender as ComboBox;

                if (combo == null)
                {
                    return;
                }
                plistener = combo.DataContext as StationLib.StationSocketListener;
                if (plistener != null)
                {
                    for (int i = 0; i < m_SensorMaps.Count; i++)
                    {
                        SensorMapToScatterLine            map          = m_SensorMaps[i];
                        LineSeries                        lineseries   = map.LineSeries;
                        IObservableVector <StationSensor> SennsorValue = map.Sensors;

                        for (int k = 0; k < plistener.StationSensors.SensorValues.Count; k++)
                        {
                            StationLib.StationSensors sensors = plistener.StationSensors;
                            if (sensors.SensorValues == SennsorValue)
                            {
                                Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding Ybinding = lineseries.ValueBinding as Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding;
                                ChartViewType viewType = (ChartViewType)combo.SelectedItem;

                                if (Ybinding.PropertyName != viewType.ViewPropertyName)
                                {
                                    Ybinding.PropertyName = viewType.ViewPropertyName;
                                    fillChart(SennsorValue, lineseries);
                                }

                                break;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 7
0
        public bool readSensorDatafromLocalStorage(StationLib.StationSensors sensorValues, Windows.Storage.ApplicationDataCompositeValue composite, int sensorValuesIdx)
        {
            string StringValue;
            int    IntValue;
            double doubleValue;
            bool   bStoreok = m_localStorage.readSettingsfromLocalStorage(composite, sensorValuesIdx);

            if (bStoreok)
            {
                bool bok = m_localStorage.readStringSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.SensorName", sensorValuesIdx), out StringValue);
                //    sensorValues.SensorName = StringValue;
                bok = m_localStorage.readStringSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.SensorViewName", sensorValuesIdx), out StringValue);

                sensorValues.SensorViewName = StringValue;
                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.DevId", sensorValuesIdx), out IntValue);
                sensorValues.DevId = IntValue;
                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.RecordingHours", sensorValuesIdx), out doubleValue);
                sensorValues.RecordingHours = doubleValue;
                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.RecordingSamplePerHour", sensorValuesIdx), out doubleValue);
                sensorValues.RecordingSamplePerHour = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.Height", sensorValuesIdx), out doubleValue);
                sensorValues.Height = (uint)doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.TemperatureMin", sensorValuesIdx), out doubleValue);
                sensorValues.TemperatureMin = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.TemperatureMax", sensorValuesIdx), out doubleValue);
                sensorValues.TemperatureMax = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellTemperatureMax", sensorValuesIdx), out doubleValue);
                sensorValues.WellTemperatureMax = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellTemperatureMin", sensorValuesIdx), out doubleValue);
                sensorValues.WellTemperatureMin = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.HumidityMin", sensorValuesIdx), out doubleValue);
                sensorValues.HumidityMin = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.HumidityMax", sensorValuesIdx), out doubleValue);
                sensorValues.HumidityMax = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellHumidityMax", sensorValuesIdx), out doubleValue);
                sensorValues.WellHumidityMax = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellHumidityMin", sensorValuesIdx), out doubleValue);
                sensorValues.WellHumidityMin = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.PressureMin", sensorValuesIdx), out doubleValue);
                sensorValues.PressureMin = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.PressureMax", sensorValuesIdx), out doubleValue);
                sensorValues.PressureMax = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellPressureMax", sensorValuesIdx), out doubleValue);
                sensorValues.WellPressureMax = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellPressureMin", sensorValuesIdx), out doubleValue);
                sensorValues.WellPressureMin = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.FillingLevelMin", sensorValuesIdx), out doubleValue);

                sensorValues.FillingLevelMin = doubleValue;
                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.FillingLevelMax", sensorValuesIdx), out doubleValue);
                sensorValues.FillingLevelMax = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellFillingLevelMin", sensorValuesIdx), out doubleValue);
                sensorValues.WellFillingLevelMin = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.WellFillingLevelMax", sensorValuesIdx), out doubleValue);
                sensorValues.WellFillingLevelMax = doubleValue;


                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.SensorDistanceMin", sensorValuesIdx), out doubleValue);
                sensorValues.SensorDistanceMin = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.SensorDistanceMax", sensorValuesIdx), out doubleValue);
                sensorValues.SensorDistanceMax = doubleValue;


                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.CysternDiameter", sensorValuesIdx), out doubleValue);
                sensorValues.CysternDiameter = doubleValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("sensorValues.CysternVolumeProCm", sensorValuesIdx), out doubleValue);
                sensorValues.CysternVolumeProCm = doubleValue;
            }


            return(bStoreok);
        }