using System;
using System.IO;
-using System.Linq;
using System.Security.Cryptography;
using System.Text;
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>();
using System.Threading;
using System.Collections.Generic;
using SpeedportHybridControl.Implementations;
-using SpeedportHybridControl.Model;
using Newtonsoft.Json;
using 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); }
}
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 () {
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;
<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">
<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">
-using System.Windows;
-using System.Windows.Controls;
+using System.Windows.Controls;
namespace SpeedportHybridControl.page {
/// <summary>
public LanPage() {
InitializeComponent();
}
-
- private void button_click(object sender, RoutedEventArgs e) {
- /*
- if (sender.Equals(reload)) {
- util.init("Lan");
- }
- */
- }
}
}
<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"
<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">
<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">