add set Frequency prototype
authorStricted <info@stricted.net>
Thu, 12 Jan 2017 05:45:54 +0000 (06:45 +0100)
committerStricted <info@stricted.net>
Thu, 12 Jan 2017 05:45:54 +0000 (06:45 +0100)
SpeedportHybridControl/PageModel/LteInfoModel.cs
SpeedportHybridControl/page/LteInfoPage.xaml

index 2f64760546d1f6fae0cc4ed925014fee410bbb14..c9e357bb49b929679a33bca0ce7484a10c7ced38 100644 (file)
@@ -15,14 +15,17 @@ namespace SpeedportHybridControl.PageModel
         private DelegateCommand _reloadCommand;
         private DelegateCommand _autoReloadCommand;
         private DelegateCommand _saveCommand;
-        private DelegateCommand _popupCommand;
+        private DelegateCommand _saveFrequencyCommand;
+               private DelegateCommand _popupCommand;
         private System.Timers.Timer _timer;
         private bool _autoReload;
         private ltepopup _ltepopup;
         private ComboBoxItem _selectedItem;
+               private ComboBoxItem _selectedFrequency;
+               private Visibility _frequencySettingsVisibility = Visibility.Hidden;
 
 
-        private string _imei;
+               private string _imei;
         private string _imsi;
         private string _device_status;
         private string _card_status;
@@ -57,7 +60,13 @@ namespace SpeedportHybridControl.PageModel
             set { SetProperty(ref _saveCommand, value); }
         }
 
-        public DelegateCommand PopupCommand
+
+               public DelegateCommand SaveFrequencyCommand
+               {
+                       get { return _saveFrequencyCommand; }
+                       set { SetProperty(ref _saveFrequencyCommand, value); }
+               }
+               public DelegateCommand PopupCommand
         {
             get { return _popupCommand; }
             set { SetProperty(ref _popupCommand, value); }
@@ -67,9 +76,21 @@ namespace SpeedportHybridControl.PageModel
         {
             get { return _selectedItem; }
             set { SetProperty(ref _selectedItem, value); }
-        }
+               }
+
+               public ComboBoxItem SelectedFrequency
+               {
+                       get { return _selectedFrequency; }
+                       set { SetProperty(ref _selectedFrequency, value); }
+               }
 
-        private void OnReloadCommandExecute()
+               public Visibility FrequencySettingsVisibility
+               {
+                       get { return _frequencySettingsVisibility; }
+                       set { SetProperty(ref _frequencySettingsVisibility, value); }
+               }
+
+               private void OnReloadCommandExecute()
         {
             new Thread(() => { SpeedportHybrid.initLTE(); }).Start();
         }
@@ -99,6 +120,11 @@ namespace SpeedportHybridControl.PageModel
             OnReloadCommandExecute();
         }
 
+               private void OnSaveFrequencyCommandExecute()
+               {
+                       // @TODO:
+               }
+
         private void OnPopupCommandExecute()
         {
             if (Object.Equals(_ltepopup, null))
@@ -268,7 +294,13 @@ namespace SpeedportHybridControl.PageModel
             ReloadCommand = new DelegateCommand(new Action(OnReloadCommandExecute));
             AutoReloadCommand = new DelegateCommand(new Action(OnAutoReloadCommandExecute));
             SaveCommand = new DelegateCommand(new Action(OnSaveCommandExecute));
-            PopupCommand = new DelegateCommand(new Action(OnPopupCommandExecute));
+            SaveFrequencyCommand = new DelegateCommand(new Action(OnSaveFrequencyCommandExecute));
+                       PopupCommand = new DelegateCommand(new Action(OnPopupCommandExecute));
+
+                       if (util.checkLteModul().Equals(true))
+                       {
+                               FrequencySettingsVisibility = Visibility.Visible;
+                       }
         }
     }
 }
index 9696e8858f8281d141cf961f6def5c325125cb98..605abde2af9cdbc4b0807a419d419db0c5ea11f0 100644 (file)
@@ -9,55 +9,71 @@
       Width="Auto" Height="Auto"
       Title="LteInfoPage">
 
-    <Grid DataContext="{StaticResource LteInfoModel}">
-        <GroupBox Header="LTE-parameter" HorizontalAlignment="Left" VerticalAlignment="Top">
-            <Grid>
-                <StackPanel HorizontalAlignment="Left" Width="86">
-                    <TextBlock Text="IMEI:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="IMSI:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="Device Status:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="Sim Card Status:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="Antenna Mode:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="Pysical Cell ID:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="Cell ID:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="RSRP:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="RSRQ:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="Service Status:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="TAC:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="Frequenz:" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                </StackPanel>
-                <StackPanel Margin="90,0,0,0" HorizontalAlignment="Left">
-                    <TextBlock Text="{Binding imei}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="{Binding imsi}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="{Binding device_status}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="{Binding card_status}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="{Binding antenna_mode}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="{Binding phycellid}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="{Binding cellid}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Background="{Binding rsrp_bg}" Text="{Binding rsrp}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Background="{Binding rsrq_bg}" Text="{Binding rsrq}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="{Binding service_status}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="{Binding tac}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                    <TextBlock Text="{Binding frequenz}" HorizontalAlignment="Left" VerticalAlignment="Top" />
-                </StackPanel>
-            </Grid>
-        </GroupBox>
-        <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"/>
+       <Grid DataContext="{StaticResource LteInfoModel}">
+               <GroupBox Header="LTE-parameter" HorizontalAlignment="Left" VerticalAlignment="Top">
+                       <Grid>
+                               <StackPanel HorizontalAlignment="Left" Width="86">
+                                       <TextBlock Text="IMEI:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="IMSI:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="Device Status:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="Sim Card Status:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="Antenna Mode:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="Pysical Cell ID:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="Cell ID:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="RSRP:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="RSRQ:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="Service Status:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="TAC:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="Frequenz:" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                               </StackPanel>
+                               <StackPanel Margin="90,0,0,0" HorizontalAlignment="Left">
+                                       <TextBlock Text="{Binding imei}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="{Binding imsi}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="{Binding device_status}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="{Binding card_status}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="{Binding antenna_mode}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="{Binding phycellid}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="{Binding cellid}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Background="{Binding rsrp_bg}" Text="{Binding rsrp}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Background="{Binding rsrq_bg}" Text="{Binding rsrq}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="{Binding service_status}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="{Binding tac}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                                       <TextBlock Text="{Binding frequenz}" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                               </StackPanel>
+                       </Grid>
+               </GroupBox>
+               <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}" 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 Command="{Binding Path=SaveCommand}" x:Name="btnSave" Content="Speichern" HorizontalAlignment="Left" Margin="197,1,0,2" Width="75"/>
-            </Grid>
-        </GroupBox>
+               <GroupBox Header="Einstellungen" 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}" 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 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 Command="{Binding Path=ReloadCommand}" x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom"/>
-    </Grid>
+               <GroupBox Visibility="{Binding Path=FrequencySettingsVisibility}" Header="LTE Einstellungen" HorizontalAlignment="Right" Width="122" Height="122" VerticalAlignment="Top">
+                       <StackPanel Margin="0,0,0,0">
+                               <TextBlock Text="Frequenz" TextAlignment="Center" Height="20" />
+                               <ComboBox x:Name="lteFrequency" SelectedItem="{Binding Path=SelectedFrequency, Mode=TwoWay}" SelectedValuePath="Name" HorizontalAlignment="Left" Width="110">
+                                       <ComboBoxItem Content="800" Name="B1" HorizontalAlignment="Left" Width="110"/>
+                                       <ComboBoxItem Content="1800" Name="B2" HorizontalAlignment="Left" Width="110"/>
+                                       <ComboBoxItem Content="2600" Name="B3" HorizontalAlignment="Left" Width="110"/>
+                                       <ComboBoxItem Content="800 + 1800 + 2600" Name="B4" HorizontalAlignment="Left" Width="110"/>
+                                       <ComboBoxItem Content="800 + 1800" Name="B5" HorizontalAlignment="Left" Width="110"/>
+                                       <ComboBoxItem Content="800 + 2600" Name="B6" HorizontalAlignment="Left" Width="110"/>
+                                       <ComboBoxItem Content="1800 + 2600" Name="B7" HorizontalAlignment="Left" Width="110"/>
+                               </ComboBox>
+                               <Button Command="{Binding Path=SaveFrequencyCommand}" Content="Speichern"/>
+                       </StackPanel>
+               </GroupBox>
+
+               <TextBlock Text="{Binding datetime}" Margin="0,0,10,0" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
+               <Button Command="{Binding Path=ReloadCommand}" x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom"/>
+       </Grid>
 </Page>