瀏覽代碼

UI 차단, 경고 메시지 추가

gubonseon 5 年之前
父節點
當前提交
c75d80191e

+ 1 - 0
Dev/OHV/OHV.LanguageHalper/Languages/Chinese.xaml

@@ -43,6 +43,7 @@
     <system:String x:Key="SettingView_Parameter">参数</system:String>
     <system:String x:Key="SettingView_Drive">行驶</system:String>
     <system:String x:Key="SettingView_Clamp">夹子</system:String>
+    <system:String x:Key="SettingView_DriveWarning">不连接OCS进行操作很危险</system:String>
 
     <!-->Control View</-->
     <system:String x:Key="ControlView_PIO">PIO</system:String>

+ 1 - 0
Dev/OHV/OHV.LanguageHalper/Languages/English.xaml

@@ -45,6 +45,7 @@
     <system:String x:Key="SettingView_DistanceView">Drive Distance</system:String>
     <system:String x:Key="SettingView_Drive">Drive</system:String>
     <system:String x:Key="SettingView_Clamp">Clamp</system:String>
+    <system:String x:Key="SettingView_DriveWarning">Please Check OCS Connection !</system:String>
 
     <!-->Control View</-->
     <system:String x:Key="ControlView_PIO">PIO</system:String>

+ 25 - 18
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoView.xaml

@@ -84,7 +84,9 @@
 
                 <!--#region DataGrid -->
                 <!--<Grid Grid.Row="0" Background="#FF606E83">
-                    --><!--<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Foreground="White">Drive Point List</TextBlock>--><!--
+                    -->
+                <!--<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Foreground="White">Drive Point List</TextBlock>-->
+                <!--
                     <DockPanel>
                         <DataGrid ItemsSource="{Binding RouteList}" CanUserSortColumns="True" CanUserAddRows="False" AutoGenerateColumns="False" materialDesign:DataGridAssist.CellPadding="13 8 8 8" 
                                   materialDesign:DataGridAssist.ColumnHeaderPadding="8" Background="{x:Null}" Foreground="White" IsSynchronizedWithCurrentItem="True" SelectedItem="{Binding SelectedRoute, Mode=TwoWay}"
@@ -126,7 +128,9 @@
                                 <DataGridCheckBoxColumn Header="UsePIO" Binding="{Binding UsePIO}" EditingElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnEditingStyle}"></DataGridCheckBoxColumn>
                             </DataGrid.Columns>
                         </DataGrid>
-                        --><!--</ScrollViewer>--><!--
+                        -->
+                <!--</ScrollViewer>-->
+                <!--
                     </DockPanel>
                 </Grid>-->
                 <!--#endregion-->
@@ -161,7 +165,7 @@
                                     <!--<TextBlock  Foreground="Orange" FontSize="20">
                                         Current
                                     </TextBlock>-->
-                                    <TextBlock Margin="15,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center"  Foreground="Orange" FontSize="20" Text="MCR"/>
+                                    <TextBlock Margin="15,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center"  Foreground="Orange" FontSize="20"><Run Text="MCR"/></TextBlock>
                                 </StackPanel>
                             </Border>
 
@@ -226,9 +230,9 @@
                                 <materialDesign:PackIcon Kind="Steering" Margin="0,0,10,0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="52" Width="auto"/>
                                 <TextBlock VerticalAlignment="Center" FontSize="30" Foreground="Orange" Text="{DynamicResource DriveView_SteerHandle}"/>
                             </StackPanel>
-                            
+
                             <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal">
-                                    <Button Width="Auto"
+                                <Button Width="Auto"
                                     HorizontalAlignment="Stretch" 
                                     Height="Auto" 
                                     Style="{StaticResource MaterialDesignRaisedButton}"
@@ -238,13 +242,13 @@
                                     Command="{Binding SteeringMoveCommand}"
                                     CommandParameter="CW" 
                                     Margin="0,0,10,0">
-                                        <StackPanel HorizontalAlignment="Center">
-                                            <materialDesign:PackIcon Kind="TransferLeft" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
-                                            <TextBlock Text="{DynamicResource DriveView_SteerLeft}" VerticalAlignment="Stretch" TextAlignment="Center" FontSize="20" Width="120"/>
-                                        </StackPanel>
-                                    </Button>
+                                    <StackPanel HorizontalAlignment="Center">
+                                        <materialDesign:PackIcon Kind="TransferLeft" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                        <TextBlock Text="{DynamicResource DriveView_SteerLeft}" VerticalAlignment="Stretch" TextAlignment="Center" FontSize="20" Width="120"/>
+                                    </StackPanel>
+                                </Button>
 
-                                    <Button Width="Auto"
+                                <Button Width="Auto"
                                     HorizontalAlignment="Stretch" 
                                     Height="Auto" 
                                     Style="{StaticResource MaterialDesignRaisedButton}"
@@ -254,13 +258,13 @@
                                     Command="{Binding SteeringMoveCommand}"
                                     CommandParameter="CCW"
                                     Margin="10,0,0,0">
-                                        <StackPanel>
-                                            <materialDesign:PackIcon Kind="TransferRight" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
-                                            <TextBlock Text="{DynamicResource DriveView_SteerRight}" TextAlignment="Center" VerticalAlignment="Stretch" FontSize="20" Width="120"/>
-                                        </StackPanel>
-                                    </Button>
+                                    <StackPanel>
+                                        <materialDesign:PackIcon Kind="TransferRight" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                        <TextBlock Text="{DynamicResource DriveView_SteerRight}" TextAlignment="Center" VerticalAlignment="Stretch" FontSize="20" Width="120"/>
+                                    </StackPanel>
+                                </Button>
                             </StackPanel>
-                            
+
                         </Grid>
                     </Grid>
 
@@ -417,7 +421,9 @@
                     <!--<Button Margin="10,10,10,5" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" 
                         Command="{Binding MoveToCommand}">
                         <StackPanel>
-                            --><!--<materialDesign:PackIcon Kind="MoveResizeVariant" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>--><!--
+                            -->
+                    <!--<materialDesign:PackIcon Kind="MoveResizeVariant" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
+                    <!--
                             <TextBlock Text="Move To" VerticalAlignment="Stretch" HorizontalAlignment="Center" FontSize="20"/>
                         </StackPanel>
                     </Button>-->
@@ -447,6 +453,7 @@
                     </Button>
                 </StackPanel>
             </Grid>
+            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{DynamicResource ResourceKey=SettingView_DriveWarning}" TextAlignment="Center" Foreground="#DDFF0000" VerticalAlignment="Top" Margin="0,526,0,-132" Grid.Row="1" Height="100" Width="1126" FontSize="78" Grid.ColumnSpan="2"/>
 
             <!--<xctk:BusyIndicator x:Name="MyProgress" Grid.RowSpan="2" Grid.ColumnSpan="2" IsBusy="{Binding IsBusy, FallbackValue=true}" BusyContent="{Binding BusyText}"/>-->
 

+ 30 - 0
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoViewModel.cs

@@ -221,6 +221,14 @@ namespace OHV.Module.Interactivity.PopUp
             get { return busyText; }
             set { SetProperty(ref this.busyText, value); }
         }
+
+        private bool warningEnabled;
+        public bool WarningEnabled
+        {
+            get { return warningEnabled; }
+            set { SetProperty(ref this.warningEnabled, value); }
+        }
+
         #endregion
 
         VCSystem vcSystem;
@@ -238,6 +246,10 @@ namespace OHV.Module.Interactivity.PopUp
             this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Unsubscribe( UICallBackCommunication );
             this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Subscribe( UICallBackCommunication , ThreadOption.UIThread );
 
+            this.eventAggregator.GetEvent<HostConnectedPubSubEvent>().Unsubscribe(OcsConnectCallBack);
+            this.eventAggregator.GetEvent<HostConnectedPubSubEvent>().Subscribe(OcsConnectCallBack, ThreadOption.UIThread);
+
+
             this.sql = _sql;
 
             this.messageController = _messageController;
@@ -270,6 +282,8 @@ namespace OHV.Module.Interactivity.PopUp
             this.IsBreakOff = this.vcSystem.IO.IsOn("OUT_DRIVE_BRAKE_OFF", false);
             var ezIO = this.vcSystem.IO as EzIO;
             ezIO.OnChangedIO += EzIO_OnChangedIO;
+
+            WarningEnabled = true;
         }
 
         private void ExecuteBreakOffCommand()
@@ -573,6 +587,22 @@ namespace OHV.Module.Interactivity.PopUp
         }
 
         #region Execute Method
+
+        private void OcsConnectCallBack(HostConnectedEventArgs obj)
+        {
+            var state = obj.State;
+
+            switch(state)
+            {
+                case HostConnectedEventArgs.eConnectedState.Connected:
+                    WarningEnabled = false;
+                    break;
+                case HostConnectedEventArgs.eConnectedState.Disconnected:
+                    WarningEnabled = true;
+                    break;
+            }
+        }
+
         private void ExecuteJogCommand(object obj)
         {
             if ( this.JogVelocity <= 0 )

+ 2 - 2
Dev/OHV/OHV.Module.ListViews/Views/CommandListView.xaml

@@ -91,7 +91,7 @@
             </DataGrid>
 
             <Grid Background="#263238" Grid.Column="1">
-                <Grid.RowDefinitions>
+                <!--<Grid.RowDefinitions>
                     <RowDefinition Height="30"/>
                     <RowDefinition Height="140"/>
                     <RowDefinition Height="*"/>
@@ -129,7 +129,7 @@
                 <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="2" VerticalAlignment="Top" Margin="0,15,0,0">
                     <Button Margin="0,0,10,0" Height="45" Content="Add" Command="{Binding SaveCommand}" Width="100" IsEnabled="{c:Binding 'MachineMode == Shared:eMachineMode.LocalMode'}" />
                     <Button Height="45" Content="Delete" Command="{Binding DeleteCommand}" Width="100"/>
-                </StackPanel>
+                </StackPanel>-->
             </Grid>
 
 

二進制
Dev/OHV/UpgradeLog.htm


二進制
Dev/OHV/UpgradeLog2.htm