cleanup
authorStricted <info@stricted.de>
Wed, 11 Nov 2015 22:22:57 +0000 (23:22 +0100)
committerStricted <info@stricted.de>
Wed, 11 Nov 2015 22:22:57 +0000 (23:22 +0100)
SpeedportHybridControl.Implementations/Cryptography.cs
SpeedportHybridControl/Data/SpeedportHybrid.cs
SpeedportHybridControl/Data/SpeedportHybridAPI.cs
SpeedportHybridControl/PageModel/DslPageModel.cs
SpeedportHybridControl/PageModel/LteInfoModel.cs
SpeedportHybridControl/page/AboutPage.xaml
SpeedportHybridControl/page/ControlsPage.xaml
SpeedportHybridControl/page/LanPage.xaml.cs
SpeedportHybridControl/page/LoginPage.xaml
SpeedportHybridControl/page/LteInfoPage.xaml
SpeedportHybridControl/page/StatusPage.xaml

index d5480393c28ad2b4ed42f8b94381cc028a1c5330..7fda3fe938e92e3d809f6e1f8ce88301b1375b01 100644 (file)
@@ -1,6 +1,5 @@
 using System;
 using System.IO;
-using System.Linq;
 using System.Security.Cryptography;
 using System.Text;
 
index 27ac08e2132ff6eff7e8cad61b80043511042f3e..cee3ed7d53fea4fa81b251cf20d6beee9cad1aa0 100644 (file)
@@ -751,7 +751,7 @@ namespace SpeedportHybridControl.Data {
                                if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
                                        return;
 
-                               DeviceData deviceData = Application.Current.FindResource("DeviceData") as DeviceData;
+                               LanPageModel deviceData = Application.Current.FindResource("LanPageModel") as LanPageModel;
 
                                List<DeviceList> deviceList = new List<DeviceList>();
 
index 3535f049f50225d98f808e41f9dd2c498f05f675..3d760ad590f561cf6bb4c42e67792cef782e8190 100644 (file)
@@ -9,7 +9,6 @@ using System.Windows;
 using System.Threading;
 using System.Collections.Generic;
 using SpeedportHybridControl.Implementations;
-using SpeedportHybridControl.Model;
 using Newtonsoft.Json;
 using SpeedportHybridControl.PageModel;
 
index e68c75d0a89ecbffba9eb3581d79814dae67eb23..33283f0cf7074f792a654bdaffa68178c640eb5f 100644 (file)
@@ -24,7 +24,14 @@ namespace SpeedportHybridControl.PageModel {
                private string _lastHEC;
                private string _lastFEC;
 
-
+               private int lastdFEC;
+               private int lastuFEC;
+               private int lastdHEC;
+               private int lastuHEC;
+               private int lastdCRC;
+               private int lastuCRC;
+               private DateTime lastReload;
+               
                public Connection Connection {
                        get { return _Connection; }
                        set { SetProperty(ref _Connection, value); }
@@ -82,7 +89,36 @@ namespace SpeedportHybridControl.PageModel {
                }
 
                private void OnReloadCommandExecute () {
-                       new Thread(() => { SpeedportHybrid.initDSL(); }).Start();
+                       new Thread(() => {
+                               SpeedportHybrid.initDSL();
+
+                               if (lastReload.Equals(DateTime.MinValue).Equals(false)) {
+                                       DateTime now = DateTime.Now;
+                                       double difference = Math.Ceiling(Math.Ceiling((DateTime.Now - lastReload).TotalSeconds) / 60);
+
+                                       double diffdCRC = Math.Ceiling((Line.dCRC - lastdCRC) / difference);
+                                       double diffuCRC = Math.Ceiling((Line.uCRC - lastuCRC) / difference);
+                                       lastCRC = string.Format("CRC/min (last {0} min) Upstream: {1} Downstream: {2}", difference, diffuCRC, diffdCRC);
+
+                                       double diffdHEC = Math.Ceiling((Line.dHEC - lastdHEC) / difference);
+                                       double diffuHEC = Math.Ceiling((Line.uHEC - lastuHEC) / difference);
+                                       lastHEC = string.Format("HEC/min (last {0} min) Upstream: {1} Downstream: {2}", difference, diffuHEC, diffdHEC);
+
+                                       double diffdFEC = Math.Ceiling((Line.dFEC - lastdFEC) / difference);
+                                       double diffuFEC = Math.Ceiling((Line.uFEC - lastuFEC) / difference);
+                                       lastFEC = string.Format("FEC/min (last {0} min) Upstream: {1} Downstream: {2}", difference, diffuFEC, diffdFEC);
+                               }
+
+                               lastReload = DateTime.Now;
+                               lastdCRC = Line.dCRC;
+                               lastuCRC = Line.uCRC;
+
+                               lastdHEC = Line.dHEC;
+                               lastuHEC = Line.uHEC;
+
+                               lastdFEC = Line.dFEC;
+                               lastuFEC = Line.uFEC;
+                       }).Start();
                }
 
                private void OnAutoReloadCommandExecute () {
index c9e3b3d0efcec939ca3bab03f12a0d0f89f117b2..3a0a0df7a6505e68be02123b826992d2153fa83d 100644 (file)
@@ -2,11 +2,7 @@
 using SpeedportHybridControl.Implementations;
 using SpeedportHybridControl.Model;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Threading;
-using System.Threading.Tasks;
 using System.Timers;
 using System.Windows;
 using System.Windows.Controls;
index 62c0b3a49b8b63f9d78d05d0ce2ea68c4c924b03..89249645fe7191bf0c4b2c9b7643095bed2f5a4e 100644 (file)
@@ -1,10 +1,10 @@
 <Page x:Class="SpeedportHybridControl.page.AboutPage"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:local="clr-namespace:SpeedportHybridControl.page"
-      mc:Ignorable="d" 
+      mc:Ignorable="d"
       Width="Auto" Height="Auto"
       Title="AboutPage">
 
index f29c5d96ce8a346fa5b8ae67f94b0abcce59c4e0..f80ecf28d56e583e10828206f378015860be799f 100644 (file)
@@ -1,10 +1,10 @@
 <Page x:Class="SpeedportHybridControl.page.ControlsPage"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:local="clr-namespace:SpeedportHybridControl"
-      mc:Ignorable="d" 
+      mc:Ignorable="d"
       Width="Auto" Height="Auto"
       Title="ControlsPage">
 
index a96079d55983e8621d90448e974b0db690d7c035..7afd286ed098368eabad9bf4cc92c083ddebf43b 100644 (file)
@@ -1,5 +1,4 @@
-using System.Windows;
-using System.Windows.Controls;
+using System.Windows.Controls;
 
 namespace SpeedportHybridControl.page {
        /// <summary>
@@ -9,13 +8,5 @@ namespace SpeedportHybridControl.page {
                public LanPage() {
                        InitializeComponent();
                }
-
-               private void button_click(object sender, RoutedEventArgs e) {
-                       /*
-                       if (sender.Equals(reload)) {
-                               util.init("Lan");
-                       }
-                       */
-               }
        }
 }
index e51f2fe79847410c95f781f6e5e279abbf645b3f..a67cdad54a7944eb9b1ff4270e07556b85b74c90 100644 (file)
@@ -1,8 +1,8 @@
 <Page x:Class="SpeedportHybridControl.page.LoginPage"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:local="clr-namespace:SpeedportHybridControl"
       xmlns:Implementations="clr-namespace:SpeedportHybridControl.Implementations;assembly=SpeedportHybridControl.Implementations"
       mc:Ignorable="d"
index 2607d1790b2ebf96197a1e2643008a08bb5e93c6..fdca91b3aa701fd766de465b4375da27b9f5e84f 100644 (file)
@@ -1,10 +1,10 @@
 <Page x:Class="SpeedportHybridControl.page.LteInfoPage"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:local="clr-namespace:SpeedportHybridControl"
-      mc:Ignorable="d" 
+      mc:Ignorable="d"
       Width="Auto" Height="Auto"
       Title="LteInfoPage">
 
index 5b2e542f382974a92a0eb7844cf37d4e2ad5aa20..dfa348bb66b3deb4e65f86b09b56c9cd802095f4 100644 (file)
@@ -1,10 +1,10 @@
 <Page x:Class="SpeedportHybridControl.page.StatusPage"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:local="clr-namespace:SpeedportHybridControl"
-      mc:Ignorable="d" 
+      mc:Ignorable="d"
       Width="Auto" Height="Auto"
       Title="StatusPage">