xmlns:local="clr-namespace:SpeedportHybridControl"
xmlns:model="clr-namespace:SpeedportHybridControl.Model"
xmlns:pagemodel="clr-namespace:SpeedportHybridControl.PageModel"
+ ShutdownMode="OnMainWindowClose"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<pagemodel:StatusPageModel x:Key="StatusPageModel"></pagemodel:StatusPageModel>
<pagemodel:OverviewPageModel x:Key="OverviewPageModel"></pagemodel:OverviewPageModel>
<pagemodel:DslPageModel x:Key="DslPageModel"></pagemodel:DslPageModel>
+ <pagemodel:LteInfoModel x:Key="LteInfoModel"></pagemodel:LteInfoModel>
- <model:LTE x:Key="LTE"></model:LTE>
- <model:LTE x:Key="LTE2"></model:LTE>
<model:SyslogData x:Key="SyslogData"></model:SyslogData>
<model:TR181 x:Key="TR181"></model:TR181>
<model:PhoneCallData x:Key="PhoneCallData"></model:PhoneCallData>
if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
return;
- LTE lte = null;
+ LteInfoModel lte = null;
if (popup.Equals(true)) {
- lte = Application.Current.FindResource("LTE2") as LTE;
+ //lte = Application.Current.FindResource("LTE2") as LTE;
}
else {
- lte = Application.Current.FindResource("LTE") as LTE;
+ lte = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
}
string response = SpeedportHybridAPI.getInstance().sendEnryptedRequest("data/lteinfo.json");
if (response.IsNullOrEmpty())
return;
- LTE obj = JsonConvert.DeserializeObject<LTE>(response);
+ LteInfoModel obj = JsonConvert.DeserializeObject<LteInfoModel>(response);
response = null;
lte.imei = obj.imei;
// Funkzellen Info
if (msg.ToString().Contains("(LT004)") && isLTE.Equals(true)) {
- LTE lte = Application.Current.FindResource("LTE") as LTE;
+ LteInfoModel lte = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
//LTE lte2 = Application.Current.FindResource("LTE2") as LTE;
string[] parts = msg.ToString().Split(',');
if (response.IsNullOrEmpty())
return;
try {
- LTE obj = JsonConvert.DeserializeObject<LTE>(response);
+ LteInfoModel obj = JsonConvert.DeserializeObject<LteInfoModel>(response);
string antenna_mode;
if (obj.antenna_mode.Equals("Antennal set to internal")) {
Width="530"
MinHeight="350"
MinWidth="530"
- Title="Speedport Hybrid Konfigurationsprogramm"
+ DataContext="{StaticResource MainWindowModel}"
+ Title="{Binding Path=Title}"
Icon="t-com icon.ico">
- <Grid DataContext="{StaticResource MainWindowModel}" >
+ <Grid>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Left">
<StackPanel.Resources>
<Style TargetType="{x:Type Button}">
+++ /dev/null
-using System.Windows.Media;
-
-namespace SpeedportHybridControl.Model {
- public class LTE : SuperViewModel {
- private string _imei;
- private string _imsi;
- private string _device_status;
- private string _card_status;
- private string _antenna_mode;
- private string _antenna_mode2;
- 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 _service_status;
- private string _tac;
- private string _datetime;
- private string _frequenz;
-
- public string imei {
- get { return _imei; }
- set { SetProperty(ref _imei, value); }
- }
-
- public string imsi {
- get { return _imsi; }
- set { SetProperty(ref _imsi, value); }
- }
-
- public string device_status {
- get { return _device_status; }
- set { SetProperty(ref _device_status, value); }
- }
-
- public string card_status {
- get { return _card_status; }
- set { SetProperty(ref _card_status, value); }
- }
-
- public string antenna_mode {
- get { return _antenna_mode; }
- set { SetProperty(ref _antenna_mode, value); }
- }
-
- public string antenna_mode2 {
- get { return _antenna_mode2; }
- set { SetProperty(ref _antenna_mode2, 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 service_status {
- get { return _service_status; }
- set { SetProperty(ref _service_status, value); }
- }
-
- public string tac {
- get { return _tac; }
- set { SetProperty(ref _tac, value); }
- }
-
- public string datetime {
- get { return _datetime; }
- set { SetProperty(ref _datetime, value); }
- }
-
- public string frequenz {
- get { return _frequenz; }
- set { SetProperty(ref _frequenz, value); }
- }
-
- public LTE() {
- }
- }
-}
get { return _autoReloadCommand; }
set { SetProperty(ref _autoReloadCommand, value); }
}
+
public bool AutoReload {
get { return _autoReload; }
set { SetProperty(ref _autoReload, value); }
--- /dev/null
+using SpeedportHybridControl.Data;
+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;
+using System.Windows.Media;
+
+namespace SpeedportHybridControl.PageModel {
+ class LteInfoModel : SuperViewModel {
+ private DelegateCommand _reloadCommand;
+ private DelegateCommand _autoReloadCommand;
+ private DelegateCommand _saveCommand;
+ private DelegateCommand _popupCommand;
+ private System.Timers.Timer _timer;
+ private bool _autoReload;
+ private ltepopup _ltepopup;
+ private ComboBoxItem _selectedItem;
+
+
+ private string _imei;
+ private string _imsi;
+ private string _device_status;
+ private string _card_status;
+ private string _antenna_mode;
+ private string _antenna_mode2;
+ 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 _service_status;
+ private string _tac;
+ private string _datetime;
+ private string _frequenz;
+
+ public DelegateCommand ReloadCommand {
+ get { return _reloadCommand; }
+ set { SetProperty(ref _reloadCommand, value); }
+ }
+
+ public DelegateCommand AutoReloadCommand {
+ get { return _autoReloadCommand; }
+ set { SetProperty(ref _autoReloadCommand, value); }
+ }
+
+ public DelegateCommand SaveCommand {
+ get { return _saveCommand; }
+ set { SetProperty(ref _saveCommand, value); }
+ }
+
+ public DelegateCommand PopupCommand {
+ get { return _popupCommand; }
+ set { SetProperty(ref _popupCommand, value); }
+ }
+
+ public ComboBoxItem SelectedItem {
+ get { return _selectedItem; }
+ set { SetProperty(ref _selectedItem, value); }
+ }
+
+ private void OnReloadCommandExecute () {
+ new Thread(() => { SpeedportHybrid.initLTE(); }).Start();
+ }
+
+ private void OnAutoReloadCommandExecute () {
+ if (AutoReload.Equals(true)) {
+ StartTimer();
+ }
+ else {
+ StopTimer();
+ }
+ }
+
+ private void OnSaveCommandExecute () {
+ SpeedportHybridAPI.getInstance().setAntennaMode(SelectedItem.Name);
+ OnReloadCommandExecute();
+ }
+
+ private void OnPopupCommandExecute () {
+ if (Object.Equals(_ltepopup, null)) {
+ _ltepopup = new ltepopup();
+ }
+ else if (Object.Equals(_ltepopup, null).Equals(false) && _ltepopup.IsLoaded.Equals(false)) {
+ _ltepopup = null;
+ _ltepopup = new ltepopup();
+ }
+
+ if (_ltepopup.Visibility.Equals(Visibility.Visible).Equals(false)) {
+ _ltepopup.Show();
+ StopTimer();
+ }
+ }
+
+ public bool AutoReload {
+ get { return _autoReload; }
+ set { SetProperty(ref _autoReload, value); }
+ }
+
+ public void StopTimer () {
+ if (Object.Equals(_timer, null).Equals(false)) {
+ _timer.Stop();
+ }
+
+ if (AutoReload.Equals(true)) {
+ AutoReload = false;
+ }
+ }
+
+ private void StartTimer () {
+ _timer = new System.Timers.Timer {
+ Interval = 1000, // every second
+ };
+
+ _timer.Elapsed += timer_Elapsed;
+ _timer.Start();
+ }
+
+ private void timer_Elapsed (object sender, ElapsedEventArgs e) {
+ OnReloadCommandExecute();
+ }
+
+ public string imei {
+ get { return _imei; }
+ set { SetProperty(ref _imei, value); }
+ }
+
+ public string imsi {
+ get { return _imsi; }
+ set { SetProperty(ref _imsi, value); }
+ }
+
+ public string device_status {
+ get { return _device_status; }
+ set { SetProperty(ref _device_status, value); }
+ }
+
+ public string card_status {
+ get { return _card_status; }
+ set { SetProperty(ref _card_status, value); }
+ }
+
+ public string antenna_mode {
+ get { return _antenna_mode; }
+ set { SetProperty(ref _antenna_mode, value); }
+ }
+
+ public string antenna_mode2 {
+ get { return _antenna_mode2; }
+ set { SetProperty(ref _antenna_mode2, 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 service_status {
+ get { return _service_status; }
+ set { SetProperty(ref _service_status, value); }
+ }
+
+ public string tac {
+ get { return _tac; }
+ set { SetProperty(ref _tac, value); }
+ }
+
+ public string datetime {
+ get { return _datetime; }
+ set { SetProperty(ref _datetime, value); }
+ }
+
+ public string frequenz {
+ get { return _frequenz; }
+ set { SetProperty(ref _frequenz, value); }
+ }
+
+ public LteInfoModel () {
+ ReloadCommand = new DelegateCommand(new Action(OnReloadCommandExecute));
+ AutoReloadCommand = new DelegateCommand(new Action(OnAutoReloadCommandExecute));
+ SaveCommand = new DelegateCommand(new Action(OnSaveCommandExecute));
+ PopupCommand = new DelegateCommand(new Action(OnPopupCommandExecute));
+ }
+ }
+}
private Page _FrameSource;
+ private string _title;
+
public string LoginButtonContent {
get { return _loginButtonContent; }
set { SetProperty(ref _loginButtonContent, value); }
set { SetProperty(ref _FrameSource, value); }
}
+ public string Title {
+ get { return _title; }
+ set { SetProperty(ref _title, value); }
+ }
+
private void OnSwitchToLoginPageExecute () {
changePage("login");
}
private void changePage (string page) {
if (object.Equals(FrameSource, null).Equals(false)) {
- Console.WriteLine("HERE!!!");
if (FrameSource.GetType().Equals(typeof(LteInfoPage))) {
- // TODO: lteInfoPage.StopTimer();
+ LteInfoModel lte = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
+ lte.StopTimer();
}
if (FrameSource.GetType().Equals(typeof(DslPage))) {
}
public MainWindowModel () {
+ Title = string.Concat("Speedport Hybrid Konfigurationsprogramm", " (version ", VERSION, ")");
+
if (util.checkInstalled("Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219").Equals(false)) {
new Thread(() => { MessageBox.Show("Bitte installiere das 'Microsoft Visual C++ 2010 Redistributable Package' aus den ordner 'vcredis' um das programm vollständig benutzen zu können.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Warning); }).Start();
}
new Thread(() => { MessageBox.Show("Ein Update ist verfügbar.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Warning); }).Start();
}
-
changePage("login");
SwitchToLoginPage = new DelegateCommand(new Action(OnSwitchToLoginPageExecute));
<ApplicationIcon>t-com icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="DynamicDataDisplay, Version=0.3.0.1, Culture=neutral, PublicKeyToken=5b7d744a7263923f, processorArchitecture=MSIL">
+ <HintPath>..\packages\DynamicDataDisplay.0.3.0.1\lib\net45\DynamicDataDisplay.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Data\SpeedportHybrid.cs" />
+ <Compile Include="ltepopup.xaml.cs">
+ <DependentUpon>ltepopup.xaml</DependentUpon>
+ </Compile>
<Compile Include="Model\bonding_client.cs" />
<Compile Include="Model\Connection.cs" />
<Compile Include="Model\DeviceViewModel.cs" />
<Compile Include="Model\StatusPhoneListModel.cs" />
<Compile Include="PageModel\DslPageModel.cs" />
<Compile Include="PageModel\LoginPageModel.cs" />
- <Compile Include="Model\LTEViewModel.cs" />
+ <Compile Include="PageModel\LteInfoModel.cs" />
<Compile Include="PageModel\MainWindowModel.cs" />
<Compile Include="Model\PhoneCallViewModel.cs" />
<Compile Include="Model\SuperViewModel.cs" />
<Compile Include="Data\SpeedportHybridAPI.cs" />
+ <Page Include="ltepopup.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
--- /dev/null
+<Window x:Class="SpeedportHybridControl.ltepopup"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:local="clr-namespace:SpeedportHybridControl"
+ mc:Ignorable="d"
+ xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
+ Height="423.4"
+ Width="530"
+ Closing="Window_Closing"
+ Title="LteInfo"
+ 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">
+ <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"/>
+ <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"/>
+
+ <TextBlock TextAlignment="Center" HorizontalAlignment="Left" Margin="285,2,0,0" TextWrapping="Wrap" Text="Physical Cell ID" VerticalAlignment="Top" Width="85"/>
+ <TextBlock FontSize="20" TextAlignment="Center" HorizontalAlignment="Left" Margin="264,15,0,0" TextWrapping="Wrap" Text="{Binding phycellid}" VerticalAlignment="Top" Width="122" Height="27"/>
+
+
+ <TextBlock TextAlignment="Center" HorizontalAlignment="Left" Margin="76,57,0,0" TextWrapping="Wrap" Text="RSRQ" VerticalAlignment="Top" Width="85"/>
+ <TextBlock TextAlignment="Center" Background="{Binding rsrq_bg}" FontSize="100" HorizontalAlignment="Left" Margin="0,73,0,0" TextWrapping="Wrap" Text="{Binding rsrq}" VerticalAlignment="Top" Width="236" Height="127" />
+ <TextBlock TextAlignment="Center" HorizontalAlignment="Left" Margin="76,209,0,0" TextWrapping="Wrap" Text="RSRP" VerticalAlignment="Top" Width="85"/>
+ <TextBlock TextAlignment="Center" Background="{Binding rsrp_bg}" FontSize="100" HorizontalAlignment="Left" Margin="0,225,0,0" TextWrapping="Wrap" Text="{Binding rsrp}" VerticalAlignment="Top" Width="236" Height="138" />
+
+ <TextBlock Text="{Binding datetime}" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
+
+ <d3:ChartPlotter x:Name="plotter" Margin="241,73,0,0" HorizontalAlignment="Left" Width="271" Height="147" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
+ <d3:ChartPlotter.HorizontalAxis>
+ <d3:HorizontalDateTimeAxis Name="dateAxis"/>
+ </d3:ChartPlotter.HorizontalAxis>
+ <d3:VerticalAxisTitle FontFamily="Georgia" Content="RSRQ" />
+ <d3:HorizontalAxisTitle FontFamily="Georgia" Content="Date"/>
+ </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:ChartPlotter.HorizontalAxis>
+ <d3:VerticalAxisTitle FontFamily="Georgia" Content="RSRP" />
+ <d3:HorizontalAxisTitle FontFamily="Georgia" Content="Date"/>
+ </d3:ChartPlotter>
+
+ </Grid>
+ -->
+</Window>
--- /dev/null
+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;
+
+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;
+ }
+ }
+ }
+ */
+ }
+}
<?xml version="1.0" encoding="utf-8"?>
<packages>
+ <package id="DynamicDataDisplay" version="0.3.0.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
</packages>
\ No newline at end of file
Width="Auto" Height="Auto"
Title="LteInfoPage">
- <Grid DataContext="{StaticResource LTE}">
+ <Grid DataContext="{StaticResource LteInfoModel}">
<GroupBox Header="LTE-parameter" HorizontalAlignment="Left" VerticalAlignment="Top">
<Grid>
<StackPanel HorizontalAlignment="Left" Width="86">
</StackPanel>
</Grid>
</GroupBox>
- <ToggleButton x:Name="autoreload" Content="Automatisch aktualisieren" HorizontalAlignment="Left" Margin="0,214,0,0" VerticalAlignment="Top" Click="button_click"/>
- <Button x:Name="btnPopup" Content="Popup" HorizontalAlignment="Left" Margin="145,214,0,0" VerticalAlignment="Top" Click="button_click"/>
+ <ToggleButton Command="{Binding Path=AutoReloadCommand}" IsChecked="{Binding Path=AutoReload}" x:Name="autoreload" Content="Automatisch aktualisieren" HorizontalAlignment="Left" Margin="0,214,0,0" VerticalAlignment="Top"/>
+ <Button Command="{Binding Path=PopupCommand}" x:Name="btnPopup" Content="Popup" HorizontalAlignment="Left" Margin="145,214,0,0" VerticalAlignment="Top"/>
<GroupBox Header="Einstelungen" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="188,209,0,0" Height="45" Width="284">
<Grid>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Antennen Modus:" VerticalAlignment="Top"/>
- <ComboBox x:Name="cbAntenna" SelectedValue="{Binding antenna_mode2}" SelectedValuePath="Name" HorizontalAlignment="Left" Width="91" Margin="101,1,0,0">
+ <ComboBox x:Name="cbAntenna" SelectedValue="{Binding antenna_mode2}" SelectedItem="{Binding Path=SelectedItem, Mode=TwoWay}" SelectedValuePath="Name" HorizontalAlignment="Left" Width="91" Margin="101,1,0,0">
<ComboBoxItem Content="Automatisch" Name="Auto" HorizontalAlignment="Left" Width="92"/>
<ComboBoxItem Content="Intern" Name="Inner" HorizontalAlignment="Left" Width="92"/>
<ComboBoxItem Content="Extern" Name="Outer" HorizontalAlignment="Left" Width="92"/>
</ComboBox>
- <Button x:Name="btnSave" Content="Speichern" HorizontalAlignment="Left" Margin="197,1,0,2" Width="75" Click="button_click" />
+ <Button Command="{Binding Path=SaveCommand}" x:Name="btnSave" Content="Speichern" HorizontalAlignment="Left" Margin="197,1,0,2" Width="75"/>
</Grid>
</GroupBox>
<TextBlock Text="{Binding datetime}" Margin="0,0,10,0" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
- <Button x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom" Click="button_click" />
+ <Button Command="{Binding Path=ReloadCommand}" x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom"/>
</Grid>
</Page>
-using System.Windows;
-using System.Windows.Controls;
-using System.Timers;
-using System;
+using System.Windows.Controls;
namespace SpeedportHybridControl.page {
-
-
/// <summary>
/// Interaction logic for LteInfoPage.xaml
/// </summary>
public partial class LteInfoPage : Page {
- public Timer _timer;
- //public ltepopup _ltepopup;
public LteInfoPage() {
InitializeComponent();
}
-
- public void StopTimer () {
- if (Object.Equals(_timer, null).Equals(false)) {
- _timer.Stop();
- }
-
- if (autoreload.IsChecked.Equals(true)) {
- autoreload.IsChecked = false;
- }
- }
-
- private void StartTimer () {
- _timer = new Timer {
- Interval = 1000, // every second
- };
-
- _timer.Elapsed += timer_Elapsed;
- _timer.Start();
- }
-
- void timer_Elapsed (object sender, ElapsedEventArgs e) {
- //util.init("LTE");
- }
-
- private void button_click(object sender, RoutedEventArgs e) {
- /*
- if (sender.Equals(reload)) {
- util.init("LTE");
- }
- else if (sender.Equals(autoreload)) {
- if (autoreload.IsChecked.Equals(true)) {
- StartTimer();
- }
- else {
- StopTimer();
- }
- }
- else if (sender.Equals(btnSave)) {
- ComboBoxItem item = cbAntenna.SelectedItem as ComboBoxItem;
- SpeedportHybridAPI.getInstance().setAntennaMode(item.Name);
- util.init("LTE");
- }
- else if (sender.Equals(btnPopup)) {
- if (Object.Equals(_ltepopup, null)) {
- _ltepopup = new ltepopup();
- }
- else if (Object.Equals(_ltepopup, null).Equals(false) && _ltepopup.IsLoaded.Equals(false)) {
- _ltepopup = null;
- _ltepopup = new ltepopup();
- }
-
- if (_ltepopup.Visibility.Equals(Visibility.Visible).Equals(false)) {
- _ltepopup.Show();
- StopTimer();
- }
- }
- */
- }
}
}