Browse Source

add time on Topview

zhouhr 1 year ago
parent
commit
c71aa92a49

+ 8 - 0
Venus/Venus_MainPages/ViewModels/TopViewModel.cs

@@ -42,6 +42,7 @@ namespace Venus_MainPages.ViewModels
         private int logMaxCount = 50;//log在ui最多显示数量
         private AITSignalTowerData m_SignalTowerData;
         private string m_HostCommunicationStatus;
+        private string m_TimeTick;
 
         private JetChamber m_SelectedJetChamber = JetChamber.None;
 
@@ -71,6 +72,12 @@ namespace Venus_MainPages.ViewModels
             set { SetProperty(ref m_SoftwareVersion, value); }
         }
 
+        public string TimeTick
+        {
+            get { return m_TimeTick; }
+            set { SetProperty(ref m_TimeTick, value); }
+        }
+
         public Dictionary<string, object> RtDataValues
         {
             get { return m_RtDataValues; }
@@ -295,6 +302,7 @@ namespace Venus_MainPages.ViewModels
 
         void timer_Tick(object sender, EventArgs e)
         {
+            TimeTick = DateTime.Now.ToString();
             RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);    
             
             SignalTowerData = CommonFunction.GetValue<AITSignalTowerData>(RtDataValues, $"System.SignalTower.DeviceData");

+ 3 - 3
Venus/Venus_MainPages/Views/TMOperationView.xaml

@@ -613,21 +613,21 @@
                 </Border>
                 <Border  Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" Background="{DynamicResource Table_BG_Content}" BorderThickness="1,0,1,0" Padding="5,1">
                     <WrapPanel Margin="10,10,10,0" Orientation="Horizontal" HorizontalAlignment="Center">
-                        <RadioButton Content="TM"  Width="80" Margin="2 0 0 10" IsChecked="True">
+                        <RadioButton Content="TM"  Width="80" Margin="2 0 0 10" IsChecked="True"  Template="{StaticResource TabRadio}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="Checked">
                                     <i:InvokeCommandAction Command="{Binding ModuleCheckedCommand}" CommandParameter="TM"/>
                                 </i:EventTrigger>
                             </i:Interaction.Triggers>
                         </RadioButton>
-                        <RadioButton Content="LLA" Width="80" Margin="2 0 0 10" Visibility="{Binding LLAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}">
+                        <RadioButton Content="LLA" Width="80" Margin="2 0 0 10" Visibility="{Binding LLAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"  Template="{StaticResource TabRadio}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="Checked">
                                     <i:InvokeCommandAction Command="{Binding ModuleCheckedCommand}" CommandParameter="LLA"/>
                                 </i:EventTrigger>
                             </i:Interaction.Triggers>
                         </RadioButton>
-                        <RadioButton Content="LLB" Width="80" Margin="2 0 0 10" Visibility="{Binding LLBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}">
+                        <RadioButton Content="LLB" Width="80" Margin="2 0 0 10" Visibility="{Binding LLBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"  Template="{StaticResource TabRadio}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="Checked">
                                     <i:InvokeCommandAction Command="{Binding ModuleCheckedCommand}" CommandParameter="LLB"/>

+ 5 - 0
Venus/Venus_MainPages/Views/TopView.xaml

@@ -121,6 +121,11 @@
                     </Button.Template>
                 </Button>
             </StackPanel>
+            <StackPanel Grid.Column="5"  Grid.Row="2" Orientation="Vertical">
+                <Border Background="#376092" Margin="3" BorderBrush="White" BorderThickness="1" CornerRadius="3">
+                    <TextBlock Text="{Binding TimeTick}" Padding="3,1" Foreground="White" TextAlignment="Center"></TextBlock>
+                </Border>
+            </StackPanel>
         </Grid>