add/update ltepopup
authorStricted <info@stricted.de>
Thu, 12 Nov 2015 00:07:32 +0000 (01:07 +0100)
committerStricted <info@stricted.de>
Thu, 12 Nov 2015 00:07:32 +0000 (01:07 +0100)
SpeedportHybridControl/App.xaml
SpeedportHybridControl/Data/SpeedportHybrid.cs
SpeedportHybridControl/Model/LTECollection.cs [new file with mode: 0644]
SpeedportHybridControl/Model/LTEData.cs [new file with mode: 0644]
SpeedportHybridControl/PageModel/ltepopupModel.cs [new file with mode: 0644]
SpeedportHybridControl/SpeedportHybridControl.csproj
SpeedportHybridControl/ltepopup.xaml
SpeedportHybridControl/ltepopup.xaml.cs

index 34c0c8c62d6a80331808e4f6259c0127c0647c4d..17cacfb4b62b5d656a660ca1fc00a76b13ff269c 100644 (file)
@@ -20,6 +20,7 @@
             <pagemodel:LanPageModel x:Key="LanPageModel"></pagemodel:LanPageModel>
             <pagemodel:ControlsPageModel x:Key="ControlsPageModel"></pagemodel:ControlsPageModel>
             <pagemodel:AboutPageModel x:Key="AboutPageModel"></pagemodel:AboutPageModel>
+            <pagemodel:ltepopupModel x:Key="ltepopupModel"></pagemodel:ltepopupModel>
         </ResourceDictionary>
     </Application.Resources>
 </Application>
index cee3ed7d53fea4fa81b251cf20d6beee9cad1aa0..ac6a427f2a4c1f4830af46f2a2ea0a0ecbb263b2 100644 (file)
@@ -11,7 +11,7 @@ using SpeedportHybridControl.Implementations;
 namespace SpeedportHybridControl.Data {
        public class SpeedportHybrid {
                public SpeedportHybrid() { }
-               
+
                public static void initOverview () {
                        try {
                                if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
@@ -301,19 +301,13 @@ namespace SpeedportHybridControl.Data {
                                LogManager.WriteToLog(ex.Message);
                        }
                }
-               
-               public static void initLTE (bool popup = false) {
+
+               public static void initLTE () {
                        try {
                                if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
                                        return;
 
-                               LteInfoModel lte = null;
-                               if (popup.Equals(true)) {
-                                       //lte = Application.Current.FindResource("LTE2") as LTE;
-                               }
-                               else {
-                                       lte = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
-                               }
+                               LteInfoModel lte = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
 
                                string response = SpeedportHybridAPI.getInstance().sendEnryptedRequest("data/lteinfo.json");
                                if (response.IsNullOrEmpty())
@@ -350,9 +344,8 @@ namespace SpeedportHybridControl.Data {
                                DateTime time = DateTime.Now;
                                string format = "dd.MM.yyyy HH:mm:ss";
                                lte.datetime = time.ToString(format);
-                               if (popup.Equals(false)) {
-                                       initSyslog(true);
-                               }
+
+                               initSyslog(true);
 
                                obj = null;
                        }
@@ -360,7 +353,39 @@ namespace SpeedportHybridControl.Data {
                                LogManager.WriteToLog(ex.Message);
                        }
                }
-               
+
+               public static void initLtePopup () {
+                       try {
+                               if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
+                                       return;
+
+                               ltepopupModel lte = Application.Current.FindResource("ltepopupModel") as ltepopupModel;
+
+                               string response = SpeedportHybridAPI.getInstance().sendEnryptedRequest("data/lteinfo.json");
+                               if (response.IsNullOrEmpty())
+                                       return;
+
+                               LteInfoModel obj = JsonConvert.DeserializeObject<LteInfoModel>(response);
+                               response = null;
+
+                               lte.phycellid = obj.phycellid;
+                               lte.cellid = obj.cellid;
+                               lte.rsrp = obj.rsrp;
+                               lte.rsrp_bg = util.getRSRPColor(obj.rsrp.ToInt());
+                               lte.rsrq = obj.rsrq;
+                               lte.rsrq_bg = util.getRSRQColor(obj.rsrq.ToInt());
+
+                               DateTime time = DateTime.Now;
+                               string format = "dd.MM.yyyy HH:mm:ss";
+                               lte.datetime = time.ToString(format);
+                               
+                               obj = null;
+                       }
+                       catch (Exception ex) {
+                               LogManager.WriteToLog(ex.Message);
+                       }
+               }
+
                public static void initDSL () {
                        if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
                                return;
@@ -370,7 +395,7 @@ namespace SpeedportHybridControl.Data {
                        string response = SpeedportHybridAPI.getInstance().sendEnryptedRequest("data/dsl.json");
                        if (response.IsNullOrEmpty())
                                return;
-                       
+
                        try {
                                DslPageModel obj = JsonConvert.DeserializeObject<DslPageModel>(response);
 
@@ -384,14 +409,14 @@ namespace SpeedportHybridControl.Data {
 
                                obj.Line.uFECsec = Math.Ceiling(obj.Line.uFEC / difference);
                                obj.Line.dFECsec = Math.Ceiling(obj.Line.dFEC / difference);
-                               
+
                                dsl.Connection = obj.Connection;
                                dsl.Line = obj.Line;
 
                                DateTime time = DateTime.Now;
                                string format = "dd.MM.yyyy HH:mm:ss";
                                dsl.datetime = time.ToString(format);
-                               
+
                                obj = null;
                        }
                        catch (Exception ex) {
@@ -407,7 +432,7 @@ namespace SpeedportHybridControl.Data {
                                string response = SpeedportHybridAPI.getInstance().sendRequest("data/status.json");
                                if (response.IsNullOrEmpty())
                                        return;
-                               
+
                                JToken jArray = JToken.Parse(response);
                                response = null;
 
@@ -558,7 +583,7 @@ namespace SpeedportHybridControl.Data {
                                LogManager.WriteToLog(ex.Message);
                        }
                }
-               
+
                public static void initSyslog (bool isLTE = false) {
                        try {
                                if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
@@ -600,7 +625,6 @@ namespace SpeedportHybridControl.Data {
                                                // Funkzellen Info
                                                if (msg.ToString().Contains("(LT004)") && isLTE.Equals(true)) {
                                                        LteInfoModel lte = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
-                                                       //LTE lte2 = Application.Current.FindResource("LTE2") as LTE;
 
                                                        string[] parts = msg.ToString().Split(',');
                                                        string frequenz = parts[2];
@@ -616,7 +640,6 @@ namespace SpeedportHybridControl.Data {
                                                        }
 
                                                        lte.frequenz = frequenz;
-                                                       //lte2.frequenz = frequenz;
 
                                                        varid = null;
                                                        jArray = null;
@@ -745,7 +768,7 @@ namespace SpeedportHybridControl.Data {
                                LogManager.WriteToLog(ex.Message);
                        }
                }
-               
+
                public static void initLan () {
                        try {
                                if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
diff --git a/SpeedportHybridControl/Model/LTECollection.cs b/SpeedportHybridControl/Model/LTECollection.cs
new file mode 100644 (file)
index 0000000..cf59b3a
--- /dev/null
@@ -0,0 +1,10 @@
+using Microsoft.Research.DynamicDataDisplay.Common;
+
+namespace SpeedportHybridControl.Model {
+       public class LTECollection : RingArray<LTEData> {
+               private const int TOTAL_POINTS = 200;
+
+               public LTECollection () : base(TOTAL_POINTS) {
+               }
+       }
+}
diff --git a/SpeedportHybridControl/Model/LTEData.cs b/SpeedportHybridControl/Model/LTEData.cs
new file mode 100644 (file)
index 0000000..74ff52b
--- /dev/null
@@ -0,0 +1,9 @@
+using System;
+
+namespace SpeedportHybridControl.Model {
+       public class LTEData {
+               public DateTime Date { get; set; }
+
+               public int Data { get; set; }
+       }
+}
diff --git a/SpeedportHybridControl/PageModel/ltepopupModel.cs b/SpeedportHybridControl/PageModel/ltepopupModel.cs
new file mode 100644 (file)
index 0000000..07e6ce8
--- /dev/null
@@ -0,0 +1,208 @@
+using System;
+using SpeedportHybridControl.Data;
+using SpeedportHybridControl.Model;
+using SpeedportHybridControl.Implementations;
+using Microsoft.Research.DynamicDataDisplay.DataSources;
+using Microsoft.Research.DynamicDataDisplay.Charts;
+using System.Timers;
+using System.Windows.Media;
+using System.IO;
+using System.Windows;
+using System.Threading;
+
+namespace SpeedportHybridControl.PageModel {
+       class ltepopupModel : SuperViewModel {
+               private System.Timers.Timer _timer;
+               private DelegateCommand _pinCommand;
+               private DelegateCommand _closeWindowCommand;
+               private bool _pinActive;
+               private bool _logActive;
+
+               private bool _topmost = false;
+               private LTECollection _lteCollection;
+               private LTECollection _lteCollection2;
+               private EnumerableDataSource<LTEData> _rsrqGraph;
+               private EnumerableDataSource<LTEData> _rsrpGraph;
+               private HorizontalDateTimeAxis _dateTimeAxis1;
+               private HorizontalDateTimeAxis _dateTimeAxis2;
+
+               private string _phycellid;
+               private string _cellid;
+               private string _rsrp;
+               private Brush _rsrp_bg = Brushes.Transparent;
+               private string _rsrq;
+               private Brush _rsrq_bg = Brushes.Transparent;
+               private string _datetime;
+
+               public DelegateCommand PinCommand {
+                       get { return _pinCommand; }
+                       set { SetProperty(ref _pinCommand, value); }
+               }
+
+               public DelegateCommand CloseWindowCommand {
+                       get { return _closeWindowCommand; }
+                       set { SetProperty(ref _closeWindowCommand, value); }
+               }
+
+               public bool PinActive {
+                       get { return _pinActive; }
+                       set { SetProperty(ref _pinActive, value); }
+               }
+
+               public bool LogActive {
+                       get { return _logActive; }
+                       set { SetProperty(ref _logActive, value); }
+               }
+
+               public bool Topmost {
+                       get { return _topmost; }
+                       set { SetProperty(ref _topmost, value); }
+               }
+
+               public LTECollection LTECollection {
+                       get { return _lteCollection; }
+                       set { SetProperty(ref _lteCollection, value); }
+               }
+
+               public LTECollection LTECollection2 {
+                       get { return _lteCollection2; }
+                       set { SetProperty(ref _lteCollection2, value); }
+               }
+
+               public EnumerableDataSource<LTEData> RsrqGraph {
+                       get { return _rsrqGraph; }
+                       set { SetProperty(ref _rsrqGraph, value); }
+               }
+
+               public EnumerableDataSource<LTEData> RsrpGraph {
+                       get { return _rsrpGraph; }
+                       set { SetProperty(ref _rsrpGraph, value); }
+               }
+
+               public HorizontalDateTimeAxis DateTimeAxis1 {
+                       get { return _dateTimeAxis1; }
+                       set { SetProperty(ref _dateTimeAxis1, value); }
+               }
+
+               public HorizontalDateTimeAxis DateTimeAxis2 {
+                       get { return _dateTimeAxis2; }
+                       set { SetProperty(ref _dateTimeAxis2, value); }
+               }
+
+               public string phycellid {
+                       get { return _phycellid; }
+                       set { SetProperty(ref _phycellid, value); }
+               }
+
+               public string cellid {
+                       get { return _cellid; }
+                       set { SetProperty(ref _cellid, value); }
+               }
+
+               public string rsrp {
+                       get { return _rsrp; }
+                       set { SetProperty(ref _rsrp, value); }
+               }
+
+               public Brush rsrp_bg {
+                       get { return _rsrp_bg; }
+                       set { SetProperty(ref _rsrp_bg, value); }
+               }
+
+               public string rsrq {
+                       get { return _rsrq; }
+                       set { SetProperty(ref _rsrq, value); }
+               }
+
+               public Brush rsrq_bg {
+                       get { return _rsrq_bg; }
+                       set { SetProperty(ref _rsrq_bg, value); }
+               }
+
+               public string datetime {
+                       get { return _datetime; }
+                       set { SetProperty(ref _datetime, value); }
+               }
+
+               public void StopTimer () {
+                       if (Object.Equals(_timer, null).Equals(false)) {
+                               _timer.Stop();
+                       }
+               }
+
+               private void StartTimer () {
+                       _timer = new System.Timers.Timer {
+                               Interval = 1000, // every second
+                       };
+
+                       _timer.Elapsed += timer_Elapsed;
+                       _timer.Start();
+               }
+
+               void timer_Elapsed (object sender, ElapsedEventArgs e) {
+                       new Thread(() => {
+                               SpeedportHybrid.initLtePopup();
+                               Application.Current.Dispatcher.BeginInvoke(new Action(() => {
+                                       LTECollection.Add(new LTEData() { Date = DateTime.Now, Data = rsrq.ToInt() });
+                                       LTECollection2.Add(new LTEData() { Date = DateTime.Now, Data = rsrp.ToInt() });
+
+                                       if (LogActive.Equals(true)) {
+                                               // log
+                                               log(string.Concat("Pysical Cell ID: ", phycellid, ", Cell ID: ", cellid, ", RSRP: ", rsrp, ", RSRQ: ", rsrq));
+                                       }
+                               }));
+                       }).Start();
+               }
+
+               private void log (string value) {
+                       DateTime time = DateTime.Now;
+
+                       if (Directory.Exists("log/").Equals(false))
+                               Directory.CreateDirectory("log/");
+
+                       if (Directory.Exists("log/lte/").Equals(false))
+                               Directory.CreateDirectory("log/lte/");
+
+                       StreamWriter file = new StreamWriter(string.Concat("log/lte/", time.ToString("dd.MM.yyyy"), ".txt"), true);
+                       file.WriteLine(string.Concat("[", time.ToString("dd.MM.yyyy HH:mm:ss"), "]: ", value));
+                       file.Close();
+               }
+
+               private void OnPinCommandExecute () {
+                       if (PinActive.Equals(true)) {
+                               Topmost = true;
+                       }
+                       else {
+                               Topmost = false;
+                       }
+               }
+
+               private void OnCloseWindowCommandExecute () {
+                       StopTimer();
+               }
+
+               public ltepopupModel () {
+                       PinCommand = new DelegateCommand(new Action(OnPinCommandExecute));
+                       CloseWindowCommand = new DelegateCommand(new Action(OnCloseWindowCommandExecute));
+
+                       LTECollection = new LTECollection();
+                       LTECollection2 = new LTECollection();
+                       DateTimeAxis1 = new HorizontalDateTimeAxis();
+                       DateTimeAxis2 = new HorizontalDateTimeAxis();
+
+                       var ds = new EnumerableDataSource<LTEData>(LTECollection);
+                       ds.SetXMapping(x => DateTimeAxis1.ConvertToDouble(x.Date));
+                       ds.SetYMapping(y => y.Data);
+
+                       RsrqGraph = ds;
+
+                       var ds2 = new EnumerableDataSource<LTEData>(LTECollection2);
+                       ds2.SetXMapping(x => DateTimeAxis1.ConvertToDouble(x.Date));
+                       ds2.SetYMapping(y => y.Data);
+
+                       RsrpGraph = ds2;
+
+                       StartTimer();
+        }
+       }
+}
index 8b325186ee127b203ed7a9a941848e71aa4bdaa0..3244f9ee12a5616221cf69986fd27b0f72713e4b 100644 (file)
@@ -48,6 +48,8 @@
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
+    <Reference Include="System.Windows" />
+    <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
     <Reference Include="System.Xml" />
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Core" />
@@ -74,6 +76,8 @@
     <Compile Include="Model\Connection.cs" />
     <Compile Include="Model\DeviceList.cs" />
     <Compile Include="Model\Line.cs" />
+    <Compile Include="Model\LTECollection.cs" />
+    <Compile Include="Model\LTEData.cs" />
     <Compile Include="Model\PhoneCallList.cs" />
     <Compile Include="Model\StatusPhoneList.cs" />
     <Compile Include="Model\SyslogList.cs" />
@@ -83,6 +87,7 @@
     <Compile Include="PageModel\LanPageModel.cs" />
     <Compile Include="PageModel\LoginPageModel.cs" />
     <Compile Include="PageModel\LteInfoModel.cs" />
+    <Compile Include="PageModel\ltepopupModel.cs" />
     <Compile Include="PageModel\MainWindowModel.cs" />
     <Compile Include="Model\SuperViewModel.cs" />
     <Compile Include="Data\SpeedportHybridAPI.cs" />
index cf176350ae58a4c93b9be63deeb53e1e1528e126..897bd0583e44202319e40bb00f69543c82f531c4 100644 (file)
@@ -6,17 +6,24 @@
         xmlns:local="clr-namespace:SpeedportHybridControl"
         mc:Ignorable="d"
         xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
+        xmlns:ig="http://schemas.infragistics.com/xaml"
+        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         Height="423.4"
         Width="530"
-        Closing="Window_Closing"
         Title="LteInfo"
+        DataContext="{StaticResource ltepopupModel}"
+        Topmost="{Binding Path=Topmost}"
         Icon="t-com icon.ico">
-    <!--
-    <Grid DataContext="{StaticResource LTE2}">
-        <ToggleButton Background="Transparent" BorderBrush="Transparent" x:Name="btnPin" HorizontalAlignment="Left" Margin="10,2,0,0" Height="20" VerticalAlignment="Top" Click="button_click">
+    <i:Interaction.Triggers>
+        <i:EventTrigger EventName="Closing">
+            <i:InvokeCommandAction Command="{Binding CloseWindowCommand}" />
+        </i:EventTrigger>
+    </i:Interaction.Triggers>
+    <Grid>
+        <ToggleButton Command="{Binding Path=PinCommand}" IsChecked="{Binding Path=PinActive, Mode=TwoWay}" Background="Transparent" BorderBrush="Transparent" x:Name="btnPin" HorizontalAlignment="Left" Margin="10,2,0,0" Height="20" VerticalAlignment="Top">
             <Image Source="assets/pin.png" x:Name="image" HorizontalAlignment="Left"  VerticalAlignment="Top"/>
         </ToggleButton>
-        <ToggleButton x:Name="btnLog" Content="Log" HorizontalAlignment="Right" Margin="0,2,10,0" Height="20" VerticalAlignment="Top"/>
+        <ToggleButton IsChecked="{Binding Path=LogActive, Mode=TwoWay}" x:Name="btnLog" Content="Log" HorizontalAlignment="Right" Margin="0,2,10,0" Height="20" VerticalAlignment="Top"/>
         <TextBlock TextAlignment="Center" HorizontalAlignment="Left" Margin="54,2,0,0" TextWrapping="Wrap" Text="Cell ID" VerticalAlignment="Top" Width="85"/>
         <TextBlock FontSize="20" TextAlignment="Center" HorizontalAlignment="Left" Margin="39,15,0,0" TextWrapping="Wrap" Text="{Binding cellid}" VerticalAlignment="Top" Width="122" Height="27"/>
 
             </d3:ChartPlotter.HorizontalAxis>
             <d3:VerticalAxisTitle FontFamily="Georgia" Content="RSRQ" />
             <d3:HorizontalAxisTitle FontFamily="Georgia" Content="Date"/>
+            <d3:LineGraph DataSource="{Binding Path=RsrqGraph}" Stroke="green" x:Name="line" StrokeThickness="1">
+                <d3:ViewportElement2D.Description >
+                    <d3:PenDescription DescriptionString="rsrq"/>
+                </d3:ViewportElement2D.Description>
+            </d3:LineGraph>
         </d3:ChartPlotter>
 
         <d3:ChartPlotter x:Name="plotter2" Margin="241,225,0,0" HorizontalAlignment="Left" Width="271" Height="159" VerticalAlignment="Top" HorizontalContentAlignment="Center"  VerticalContentAlignment="Center">
             <d3:ChartPlotter.HorizontalAxis>
-                <d3:HorizontalDateTimeAxis Name="dateAxis2"/>
+                <d3:HorizontalDateTimeAxis DataContext="{Binding Path=DateTimeAxis1, Mode=TwoWay}" Name="dateAxis2"/>
             </d3:ChartPlotter.HorizontalAxis>
             <d3:VerticalAxisTitle FontFamily="Georgia" Content="RSRP" />
             <d3:HorizontalAxisTitle FontFamily="Georgia" Content="Date"/>
+            <d3:LineGraph DataSource="{Binding Path=RsrpGraph}" Stroke="green" x:Name="line2" StrokeThickness="1">
+                <d3:ViewportElement2D.Description >
+                    <d3:PenDescription DescriptionString="rsrp"/>
+                </d3:ViewportElement2D.Description>
+            </d3:LineGraph>
         </d3:ChartPlotter>
 
     </Grid>
-    -->
 </Window>
index d7d9117bba58ed5bb57297bdfcd03f888731c829..2ce635c834da12b801497c5ea101d20d0c0b5457 100644 (file)
-using System;
-using System.Windows;
-using System.Windows.Media;
-using System.Timers;
-using Microsoft.Research.DynamicDataDisplay.DataSources;
-using Microsoft.Research.DynamicDataDisplay;
-using Microsoft.Research.DynamicDataDisplay.Common;
-using System.ComponentModel;
-using System.IO;
-using SpeedportHybridControl.Data;
-using SpeedportHybridControl.Model;
+using System.Windows;
 
 namespace SpeedportHybridControl {
-       public class LTECollection : RingArray<LTEData> {
-               private const int TOTAL_POINTS = 200;
-
-               public LTECollection () : base(TOTAL_POINTS) {
-               }
-       }
-
-       public class LTEData {
-               public DateTime Date { get; set; }
-
-               public int Data { get; set; }
-       }
-
        /// <summary>
        /// Interaction logic for Window1.xaml
        /// </summary>
        public partial class ltepopup : Window {
-               public Timer _timer;
-               public LTECollection lteCollection;
-               public LTECollection lteCollection2;
-
                public ltepopup () {
                        InitializeComponent();
-                       /*
-                       util.init("LTE2");
-
-                       lteCollection = new LTECollection();
-                       lteCollection2 = new LTECollection();
-
-                       var ds = new EnumerableDataSource<LTEData>(lteCollection);
-                       ds.SetXMapping(x => dateAxis.ConvertToDouble(x.Date));
-                       ds.SetYMapping(y => y.Data);
-                       plotter.AddLineGraph(ds, Colors.Green, 1, "rsrq");
-
-                       var ds2 = new EnumerableDataSource<LTEData>(lteCollection2);
-                       ds2.SetXMapping(x => dateAxis.ConvertToDouble(x.Date));
-                       ds2.SetYMapping(y => y.Data);
-                       plotter2.AddLineGraph(ds2, Colors.Green, 1, "rsrp");
-
-                       StartTimer();
-                       */
-               }
-
-               void Window_Closing (object sender, CancelEventArgs e) {
-                       //StopTimer();
-               }
-               /*
-               public void StopTimer () {
-                       if (Object.Equals(_timer, null).Equals(false)) {
-                               _timer.Stop();
-                       }
-               }
-
-               private void StartTimer () {
-                       _timer = new Timer {
-                               Interval = 1000, // every second
-                       };
-
-                       _timer.Elapsed += timer_Elapsed;
-                       _timer.Start();
-               }
-
-               private void log (string value) {
-                       DateTime time = DateTime.Now;
-
-                       if (Directory.Exists("log/").Equals(false))
-                               Directory.CreateDirectory("log/");
-
-                       if (Directory.Exists("log/lte/").Equals(false))
-                               Directory.CreateDirectory("log/lte/");
-
-                       StreamWriter file = new StreamWriter(string.Concat("log/lte/", time.ToString("dd.MM.yyyy"), ".txt"), true);
-                       file.WriteLine(string.Concat("[", time.ToString("dd.MM.yyyy HH:mm:ss"), "]: ", value));
-                       file.Close();
-               }
-
-               void timer_Elapsed (object sender, ElapsedEventArgs e) {
-                       new System.Threading.Thread(() => {
-                               util.init("LTE2");
-
-                               LTE lte = Application.Current.FindResource("LTE2") as LTE;
-                               int rsrq = lte.rsrq.ToInt();
-                               int rsrp = lte.rsrp.ToInt();
-                               Application.Current.Dispatcher.BeginInvoke(new Action(() => {
-                                       lteCollection.Add(new LTEData() { Date = DateTime.Now, Data = rsrq });
-                                       lteCollection2.Add(new LTEData() { Date = DateTime.Now, Data = rsrp });
-
-                                       if (btnLog.IsChecked.Equals(true)) {
-                                               // log
-                                               log(string.Concat("Pysical Cell ID: ", lte.phycellid, ", Cell ID: ", lte.cellid, ", RSRP: ", lte.rsrp, ", RSRQ: ", lte.rsrq));
-                                       }
-                               }));
-                       }).Start();
-               }
-
-               private void button_click (object sender, RoutedEventArgs e) {
-                       if (sender.Equals(btnPin)) {
-                               if (btnPin.IsChecked.Equals(true)) {
-                                       Topmost = true;
-                               }
-                               else {
-                                       Topmost = false;
-                               }
-                       }
                }
-               */
        }
 }