コード例 #1
0
        private void UpdateListener(StationLib.StationSocketListener updateplistener)
        {
            if (updateplistener != null)
            {
                StationLib.StationSocketListener plistener = m_StationListeners.getSelectedItem();
                if (plistener == updateplistener)
                {
                    if (updateplistener.WaterInletActive != m_WaterInletActivate)
                    {
                        this.m_WaterInletActivate = updateplistener.WaterInletActive;
                        OnPropertyChanged("WaterInletActivate");
                    }

                    if (updateplistener.PumpDryProtectionActive != m_PumpDryProtectionActive)
                    {
                        this.m_PumpDryProtectionActive = updateplistener.PumpDryProtectionActive;
                        OnPropertyChanged("PumpDryProtectionActive");
                    }

                    WaterInletActivateEnable = !updateplistener.ListenerMode && updateplistener.OutPutWellFillingLevelMinActiv;// && !updateplistener.WaterInletState; ;


                    PumpDryProtectionActiveEnable = !updateplistener.ListenerMode && updateplistener.OutPutFillingLevelMinActiv;// && !updateplistener.PumpDryProtectionState;
                }
            }
        }
コード例 #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter is FillingLevelApp.App)
            {
                FillingLevelApp.App AppEnvironment = e.Parameter as FillingLevelApp.App;

                if (AppEnvironment != null)
                {
                    m_Environment = AppEnvironment.Environment;

                    if (m_Environment != null)
                    {
                        this.m_SocketStationListeners = m_Environment.StationSocketListeners;

                        for (int i = 0; i < this.m_SocketStationListeners.SocketListeners.Count; i++)
                        {
                            StationLib.StationSocketListener plistener = this.m_SocketStationListeners.SocketListeners[i];
                            plistener.StationSensors.SensorValues.VectorChanged += SensorValues_VectorChanged;
                        }

                        if (m_SocketStationListeners.SelectedIndex == -1)
                        {
                            m_SocketStationListeners.SelectedIndex = 0;
                        }
                    }



                    this.startProcessing();
                }
            }

            base.OnNavigatedTo(e);
        }
コード例 #3
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));
                     }
                 }
             }
         }
     }
 }
コード例 #4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter is FillingLevelApp.App)
            {
                FillingLevelApp.App AppEnvironment = e.Parameter as FillingLevelApp.App;


                if (AppEnvironment != null)
                {
                    m_Environment = AppEnvironment.Environment;

                    this.StationListeners = m_Environment.getWeatherStationListeners();


                    for (int i = 0; i < StationListeners.SocketListeners.Count; i++)
                    {
                        StationLib.StationSocketListener plistener = m_StationListeners.SocketListeners[i];
                        plistener.MainFrame = this.Frame;

                        plistener.Update += Plistener_Update;
                    }

                    if (m_StationListeners.SelectedIndex == -1)
                    {
                        m_StationListeners.SelectedIndex = 0;
                    }
                }



                this.startProcessing();
            }

            base.OnNavigatedTo(e);
        }
コード例 #5
0
        private void SocketListener_stopStreaming(object sender, string args)
        {
            StationLib.StationSocketListener SocketListener = sender as StationLib.StationSocketListener;
            if (args.Length > 0)
            {
                if (SocketListener != null)
                {
                    ThreadPoolTimer timer = ThreadPoolTimer.CreateTimer((t) =>
                    {
                        SocketListener.stopProcessingPackagesAsync();// Restart Processing Packages
                        SocketListener.startProcessingPackagesAsync();
                        //do some work \ dispatch to UI thread as needed
                    }, TimeSpan.FromSeconds(20));
                }


                if (SocketListener.FailedConnectionCount <= 1)
                {
                    ShowMessage(args);
                    notificationEmail(SocketListener, args);
                }
            }

            ReleaseDisplay(SocketListener);
        }
コード例 #6
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");
                    }
                }
            }
        }
コード例 #7
0
 async void stopRecording_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     StationLib.StationSocketListener plistener = m_SocketStationListeners.getSelectedItem();
     if (plistener != null)
     {
         await plistener.stopProcessingPackagesAsync();
     }
 }
コード例 #8
0
 void DeleteDataSensors_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     StationLib.StationSocketListener plistener = m_SocketStationListeners.getSelectedItem();
     if (plistener != null)
     {
         plistener.StationSensors.deleteSensorValues();
     }
 }
コード例 #9
0
 private void Plistener_Update(object sender, ulong args)
 {
     StationLib.StationSocketListener plistener = sender as StationLib.StationSocketListener;
     if (plistener != null)
     {
         UpdateListener(plistener);
     }
 }
コード例 #10
0
 public void setToDefault(object sender, RoutedEventArgs e)
 {
     StationLib.StationSocketListener listener = StationListeners.getSelectedItem();
     if (listener != null)
     {
         setListenerToDefaultValues(listener);
     }
 }
コード例 #11
0
 public void ButtonDeleteListener(object sender, RoutedEventArgs e)
 {
     StationLib.StationSocketListener listener = StationListeners.getSelectedItem();
     if (listener != null)
     {
         StationListeners.deleteListener(listener);
     }
 }
コード例 #12
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     for (int i = 0; i < StationListeners.SocketListeners.Count; i++)
     {
         StationLib.StationSocketListener plistener = m_StationListeners.SocketListeners[i];
         plistener.Update -= Plistener_Update;
     }
     base.OnNavigatingFrom(e);
 }
コード例 #13
0
 private async void ActivateDisplay(StationLib.StationSocketListener SocketListener)
 {
     await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     { // your code should be here
         SocketListener.FailedConnectionCount = SocketListener.FailedConnectionCount;
         m_displayRequest.RequestActive();
         m_displayRequestCnt++;
     });
 }
コード例 #14
0
        private void StationSocketListeners_NotificationLevel(object sender, int args)
        {
            StationLib.StationSocketListener SocketListener = sender as StationLib.StationSocketListener;


            if (SocketListener != null)
            {// email to
                notificationEmail(SocketListener, args);
            }
        }
コード例 #15
0
        private async void notificationEmail(StationLib.StationSocketListener SocketListener, string message)
        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
            { // your code should be here
              // FailedConnection in UI-Thread  NotifyPropertyChanged("FailedConnectionCount"); setzen , sonst Absturz

                string subject = String.Format("FillingLevelApp: {0} Date: {1} Connection Error", SocketListener.VisibleKeyName, SocketListener.StationSensors.ActSensorValue.ActSensorPackageDateTime);

                await m_eMailing.SendMailAsync(subject, message);
            });
        }
コード例 #16
0
        public void ListenerSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            GridView gridView = sender as GridView;

            if (gridView != null)
            {
                if (gridView.ItemsSource == this.StationListeners.SocketListeners)
                {
                    StationLib.StationSocketListener listener = StationListeners.getSelectedItem();
                    if (listener != null)
                    {
                    }
                }
            }
        }
コード例 #17
0
        private void ListenerGridViewTapped(object sender, TappedRoutedEventArgs e) // selection for GridView
        {
            GridView gridView = sender as GridView;

            if (gridView != null)
            {
                if (gridView.ItemsSource == this.StationListeners.SocketListeners)
                {
                    //       StationSocketListener Listener = gridView.ItemsSource as StationSocketListener;
                    StationLib.StationSocketListener listener = StationListeners.getSelectedItem();

                    if (listener != null && (gridView.SelectedItem != listener)) // already selected
                    {
                        gridView.SelectedItem = listener;
                    }
                }
            }
        }
コード例 #18
0
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            if (m_Environment != null)
            {
                for (int i = 0; i < this.m_SocketStationListeners.SocketListeners.Count; i++)
                {
                    StationLib.StationSocketListener plistener = this.m_SocketStationListeners.SocketListeners[i];

                    for (int j = 0; j < plistener.StationSensors.SensorValues.Count; j++)
                    {
                        plistener.StationSensors.SensorValues.VectorChanged -= SensorValues_VectorChanged;
                    }
                }
            }


            base.OnNavigatingFrom(e);
        }
コード例 #19
0
        private void SocketListener_Failed(object sender, string args)
        { // Failed after Trying Connection
            StationLib.StationSocketListener SocketListener = sender as StationLib.StationSocketListener;
            if (SocketListener.FailedConnectionCount <= 1)
            {
                ShowMessage(args);
                notificationEmail(SocketListener, args);
            }


            if (SocketListener != null)
            {
                ThreadPoolTimer timer = ThreadPoolTimer.CreateTimer((t) =>
                {
                    SocketListener.stopProcessingPackagesAsync();// Restart Processing Packages
                    SocketListener.startProcessingPackagesAsync();
                    //do some work \ dispatch to UI thread as needed
                }, TimeSpan.FromSeconds(5));
            }
        }
コード例 #20
0
        private async void ReleaseDisplay(StationLib.StationSocketListener SocketListener)
        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            { // your code should be here
                SocketListener.FailedConnectionCount = SocketListener.FailedConnectionCount;

                if (m_displayRequest == null)
                {
                    return;
                }

                if (SocketListener.FailedConnectionCount <= 1) // noch keinen FailedCount
                {
                    if (m_displayRequestCnt > 0)
                    {
                        //undo the request
                        m_displayRequest.RequestRelease();
                        m_displayRequestCnt--;
                    }
                }
            });
        }
コード例 #21
0
        public bool writeSocketListenerDatatoLocalStorage(StationLib.StationSocketListener listener, Windows.Storage.ApplicationDataCompositeValue composite, int ListenerIdx)
        {
            if (m_localStorage == null)
            {
                return(false);
            }
            m_localStorage.SetSourceIDName("StationSocketListener", ListenerIdx);

            int Idx = -1;

            bool bok = m_localStorage.writeSettingsToLocalStorage(composite, Idx);

            bok = m_localStorage.writeStringSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.HostName", Idx), listener.HostName);
            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.Port", Idx), listener.Port);
            bok = m_localStorage.writeStringSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.ViewName", Idx), listener.ViewName);


            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.SensorViewSelection", Idx), listener.SensorViewSelection);



            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.ChartViewSelection", Idx), listener.ChartViewSelection);

            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.BME280SensorId", Idx), listener.BME280SensorId);

            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.GPIOHCSR04EchoPin", Idx), listener.GPIOHCSR04EchoPin);

            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.GPIOHCSR04TriggPin", Idx), listener.GPIOHCSR04TriggPin);

            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLedPin", Idx), listener.OutPutLedPin);

            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLevel1Pin", Idx), listener.OutPutLevel1Pin);

            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLevel2Pin", Idx), listener.OutPutLevel2Pin);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.RefreshRateinSec", Idx), listener.RefreshRateinSec);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.MaxLevelMillimeterProSec", Idx), listener.MaxLevelMillimeterProSec);

            bok = m_localStorage.writeBoolSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.eMailWellFillingLevelMinActiv", Idx), listener.eMailWellFillingLevelMinActiv);

            bok = m_localStorage.writeBoolSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.eMailWellFillingLevelMaxActiv", Idx), listener.eMailWellFillingLevelMaxActiv);

            bok = m_localStorage.writeBoolSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.eMailFillingLevelMinActiv", Idx), listener.eMailFillingLevelMinActiv);

            bok = m_localStorage.writeBoolSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutWellFillingLevelMinActiv", Idx), listener.OutPutWellFillingLevelMinActiv);


            bok = m_localStorage.writeBoolSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutFillingLevelMinActiv", Idx), listener.OutPutFillingLevelMinActiv);

            bok = m_localStorage.writeBoolSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.ListenerMode", Idx), listener.ListenerMode);


            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLevel1PinActivValue", Idx), listener.OutPutLevel1PinActivValue);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLevel2PinActivValue", Idx), listener.OutPutLevel2PinActivValue);

            bok = m_localStorage.writeIntegerSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.ShutDownPin", Idx), listener.ShutDownPin);


            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.InletFillLevelInPercent", Idx), listener.InletFillLevelInPercent);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.InletMaxActiveTime", Idx), listener.InletMaxActiveTime);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.InletCycleFlushingTime", Idx), listener.InletCycleFlushingTime);

            bok = m_localStorage.writeDoubleSettingsToLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.InletMaxCycleFlushingActiveTime", Idx), listener.InletMaxCycleFlushingActiveTime);


            StationSensors sensorValue = listener.StationSensors;

            m_localStorage.ResetCompositeName();
            m_localStorage.DataCompositeIDName = m_localStorage.getCompositePropertyIDName("StationSensorValues", -1);


            int SensorsIdx = 0;

            bok = writeSensorDatatoLocalStorage(sensorValue, composite, SensorsIdx);



            return(bok);
        }
コード例 #22
0
        private async void notificationEmail(StationLib.StationSocketListener SocketListener, int message)
        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
            { // your code should be here
                string errorLevel = "";

                string body = "";
                switch (message)
                {
                case 0:
                    {
                        body       = String.Format("Level Min overstepped {0} > : {1} ", SocketListener.StationSensors.ActSensorValue.FillingLevel, SocketListener.StationSensors.FillingLevelMin);
                        errorLevel = "warning";
                        break;
                    }

                case 1:
                    {
                        body       = String.Format("Pump dry protection understepped {0} < : {1} ", SocketListener.StationSensors.ActSensorValue.FillingLevel, SocketListener.StationSensors.FillingLevelMin);
                        errorLevel = "error";
                        break;
                    }

                case 2:
                    {
                        body       = String.Format("Well Level Min overstepped {0} > : {1} ", SocketListener.StationSensors.ActSensorValue.FillingLevel, SocketListener.StationSensors.WellFillingLevelMin);
                        errorLevel = "info";
                        break;
                    }

                case 3:
                    {
                        body       = String.Format("Water Inlet Level understepped {0} < : {1} ", SocketListener.StationSensors.ActSensorValue.FillingLevel, SocketListener.StationSensors.WellFillingLevelMin);
                        errorLevel = "info";
                        break;
                    }

                case 4:
                    {
                        body       = String.Format("Well Level Max overstepped {0} > : {1} ", SocketListener.StationSensors.ActSensorValue.FillingLevel, SocketListener.StationSensors.WellFillingLevelMax);
                        errorLevel = "info";
                        break;
                    }

                case 5:
                    {
                        body       = String.Format("Well Level Max understepped {0} < : {1} ", SocketListener.StationSensors.ActSensorValue.FillingLevel, SocketListener.StationSensors.WellFillingLevelMax);
                        errorLevel = "info";
                        break;
                    }

                case 6:    // Water Inlet Filling Time Over
                    {
                        body = String.Format("Water Inlet Time Out Monitoring occured:{1} -> Restart Recording ", SocketListener.StationSensors.ActSensorValue.FillingLevel, SocketListener.InletMaxActiveTime);

                        errorLevel = "error";
                        ShowMessage(body);
                        break;
                    }

                case 100:     // Shutdown: Filling Level Station
                    {
                        body       = String.Format("Filling Level Station: Shutdown");
                        errorLevel = "error";
                        break;
                    }

                case 101:    // Restart: Filling Level Station
                    {
                        body       = String.Format("Filling Level Station: Restart");
                        errorLevel = "error";
                        break;
                    }

                default:
                    {
                        body = String.Format("no Level Min Assoziated {0}  ", SocketListener.StationSensors.ActSensorValue.FillingLevel);
                        break;
                    }
                }

                string subject = String.Format("FillingLevelApp: {0} Date: {1} Notifation : {2}", SocketListener.VisibleKeyName, SocketListener.StationSensors.ActSensorValue.ActSensorPackageDateTime, errorLevel);



                await m_eMailing.SendMailAsync(subject, body);
            });
        }
コード例 #23
0
        public bool readSocketListenerDatafromLocalStorage(StationLib.StationSocketListener listener, Windows.Storage.ApplicationDataCompositeValue composite, int ListenerIdx)
        {
            if (m_localStorage == null)
            {
                return(false);
            }
            m_localStorage.SetSourceIDName("StationSocketListener", ListenerIdx);


            int  Idx      = -1;
            bool bStoreOk = m_localStorage.readSettingsfromLocalStorage(composite, Idx);

            if (bStoreOk)
            {
                string StringValue;
                int    IntValue;
                double dblValue;
                bool   boolValue;

                bool bok = m_localStorage.readStringSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.HostName", Idx), out StringValue);
                listener.HostName = StringValue;

                bok           = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.Port", Idx), out IntValue);
                listener.Port = IntValue;

                bok = m_localStorage.readStringSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.ViewName", Idx), out StringValue);
                listener.ViewName = StringValue;

                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.SensorViewSelection", Idx), out IntValue);
                listener.SensorViewSelection = IntValue;


                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.ChartViewSelection", Idx), out IntValue);
                listener.ChartViewSelection = IntValue;

                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.BME280SensorId", Idx), out IntValue);
                listener.BME280SensorId = IntValue;

                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.GPIOHCSR04EchoPin", Idx), out IntValue);
                listener.GPIOHCSR04EchoPin = IntValue;

                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.GPIOHCSR04TriggPin", Idx), out IntValue);
                listener.GPIOHCSR04TriggPin = IntValue;

                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLedPin", Idx), out IntValue);
                listener.OutPutLedPin = IntValue;

                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLevel1Pin", Idx), out IntValue);
                listener.OutPutLevel1Pin = IntValue;

                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLevel2Pin", Idx), out IntValue);

                listener.OutPutLevel2Pin = IntValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.RefreshRateinSec", Idx), out dblValue);

                listener.RefreshRateinSec = dblValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.MaxLevelMillimeterProSec", Idx), out dblValue);

                listener.MaxLevelMillimeterProSec = dblValue;

                bok = m_localStorage.readBoolSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.eMailWellFillingLevelMinActiv", Idx), out boolValue);

                listener.eMailWellFillingLevelMinActiv = boolValue;

                bok = m_localStorage.readBoolSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.eMailWellFillingLevelMaxActiv", Idx), out boolValue);

                listener.eMailWellFillingLevelMaxActiv = boolValue;

                bok = m_localStorage.readBoolSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.eMailFillingLevelMinActiv", Idx), out boolValue);

                listener.eMailFillingLevelMinActiv = boolValue;

                bok = m_localStorage.readBoolSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutWellFillingLevelMinActiv", Idx), out boolValue);

                listener.OutPutWellFillingLevelMinActiv = boolValue;

                bok = m_localStorage.readBoolSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutFillingLevelMinActiv", Idx), out boolValue);

                listener.OutPutFillingLevelMinActiv = boolValue;


                bok = m_localStorage.readBoolSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.ListenerMode", Idx), out boolValue);

                listener.ListenerMode = boolValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLevel1PinActivValue", Idx), out dblValue);

                listener.OutPutLevel1PinActivValue = dblValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.OutPutLevel2PinActivValue", Idx), out dblValue);

                listener.OutPutLevel2PinActivValue = dblValue;


                bok = m_localStorage.readIntegerSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.ShutDownPin", Idx), out IntValue);
                listener.ShutDownPin = IntValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.InletFillLevelInPercent", Idx), out dblValue);
                listener.InletFillLevelInPercent = dblValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.InletMaxActiveTime", Idx), out dblValue);
                listener.InletMaxActiveTime = dblValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.InletCycleFlushingTime", Idx), out dblValue);
                listener.InletCycleFlushingTime = dblValue;

                bok = m_localStorage.readDoubleSettingsfromLocalStorage(composite, m_localStorage.getCompositePropertyIDName("listener.InletMaxCycleFlushingActiveTime", Idx), out dblValue);
                listener.InletMaxCycleFlushingActiveTime = dblValue;



                StationSensors sensorValue = listener.StationSensors;
                int            SensorsIdx  = 0;

                m_localStorage.ResetCompositeName();
                m_localStorage.DataCompositeIDName = m_localStorage.getCompositePropertyIDName("StationSensorValues", -1);
                bool bfound = readSensorDatafromLocalStorage(sensorValue, composite, SensorsIdx);


/*
 *              int SensorsIdx = 0;
 *              while (true) // vorhandene Profiles aus den Settings lesen
 *              {
 *                  StationLib.StationSensors SensorValues =  new StationSensors();
 *                  listener.StationSensors.AddSensorValues(SensorValues);
 *                  m_localStorage.ResetCompositeName();
 *                  m_localStorage.DataCompositeIDName = m_localStorage.getCompositePropertyIDName("StationSensorValues", -1);
 *
 *                  bool bfound = readSensorDatafromLocalStorage(SensorValues, composite, SensorsIdx);
 *                  if (!bfound)
 *                  {// wiede loeschen, wenn nicht gefunden
 *                      listener.BME280SensorsValues.deleteSensorValues(SensorValues);
 *                      break;
 *                  }
 *
 *
 *                  SensorsIdx++;
 *              }
 */
            }

            return(bStoreOk);
        }
コード例 #24
0
 private void SocketListener_startStreaming(object sender, Windows.Networking.Sockets.StreamSocket args)
 {
     StationLib.StationSocketListener SocketListener = sender as StationLib.StationSocketListener;
     ActivateDisplay(SocketListener);
 }
コード例 #25
0
        public void setListenerToDefaultValues(StationLib.StationSocketListener listener)
        {
            listener.HostName = "localhost";
            listener.Port     = 3005;
            listener.ViewName = "Cysterne";

            listener.GPIOHCSR04EchoPin  = 12;
            listener.GPIOHCSR04TriggPin = 23;
            listener.BME280SensorId     = 0x76;
            listener.OutPutLedPin       = 21;

            listener.OutPutLevel1Pin = 17;

            listener.OutPutLevel2Pin = 27;

            listener.ShutDownPin = 24;

            listener.MaxLevelMillimeterProSec = 3;

            listener.eMailWellFillingLevelMinActiv = false;

            listener.eMailWellFillingLevelMaxActiv  = false;
            listener.eMailFillingLevelMinActiv      = false;
            listener.OutPutWellFillingLevelMinActiv = false;
            listener.OutPutFillingLevelMinActiv     = false;

            listener.ListenerMode = false;

            listener.OutPutLevel1PinActivValue = 0; // Ausgang ist low aktiv

            listener.OutPutLevel2PinActivValue = 0; // Ausgang ist low aktiv

            listener.InletFillLevelInPercent = 2;

            listener.InletMaxActiveTime = 1;
            listener.InletMaxCycleFlushingActiveTime = 1;

            listener.InletCycleFlushingTime = 2; // alle 2 Tage


            StationSensors sensorValue = listener.StationSensors;

            sensorValue.DevId          = 118;
            sensorValue.SensorViewName = "";

            sensorValue.RecordingHours         = 24;
            sensorValue.RecordingSamplePerHour = 50;

            sensorValue.HumidityMax     = 100;
            sensorValue.HumidityMin     = 0;
            sensorValue.WellHumidityMax = 90;
            sensorValue.WellHumidityMin = 40;

            sensorValue.TemperatureMax     = 45;
            sensorValue.TemperatureMin     = 0;
            sensorValue.WellTemperatureMax = 25;
            sensorValue.WellTemperatureMin = 20;

            sensorValue.PressureMax     = 1500;
            sensorValue.PressureMin     = 500;
            sensorValue.WellPressureMax = 1100;
            sensorValue.WellPressureMin = 900;

            sensorValue.FillingLevelMin = 0;

            sensorValue.FillingLevelMax = 100;

            sensorValue.WellFillingLevelMax = 40;

            sensorValue.WellFillingLevelMin = 10;

            sensorValue.SensorDistanceMin  = 20;  // in cm
            sensorValue.SensorDistanceMax  = 180;
            sensorValue.CysternDiameter    = 230; // Cysterne Durchmesser in cm
            sensorValue.CysternVolumeProCm = 0;
        }