浏览代码

fix Status界面添加Stop按钮 用于直接中止Job任务

jiangjy 1 月之前
父节点
当前提交
81d578979a

+ 14 - 4
Furnace/FurnaceUI/Views/Status/ControlJobStatusView.xaml

@@ -83,7 +83,7 @@
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </Button>
-                    <Button  Width="130" Height="46"  IsEnabled="{Binding IsEnablePause}">
+                    <Button  Width="130" Height="46" Margin="10,0,10,0" IsEnabled="{Binding IsEnablePause}">
                         <Button.Content>
                             <TextBlock Text="PAUSE" TextWrapping="Wrap" TextAlignment="Center" Foreground="Black" />
                         </Button.Content>
@@ -94,6 +94,16 @@
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </Button>
+                    <Button  Width="130" Height="46" IsEnabled="{Binding IsEnableStop}">
+                        <Button.Content>
+                            <TextBlock Text="Stop" TextWrapping="Wrap" TextAlignment="Center" Foreground="Black" />
+                        </Button.Content>
+                        <i:Interaction.Triggers>
+                            <i:EventTrigger EventName="Click">
+                                <cal:ActionMessage MethodName="AbortJob"></cal:ActionMessage>
+                            </i:EventTrigger>
+                        </i:Interaction.Triggers>
+                    </Button>
                 </StackPanel>
 
                 <Canvas Grid.Row="1">
@@ -702,7 +712,7 @@
                     <TextBlock  Text="{Binding SelectedControlJobsObjtID}" VerticalAlignment="Center" TextAlignment="Center" FontSize="16" />
                 </Border>
                 <Border Grid.Row="1" Grid.Column="1"  BorderBrush="Black" BorderThickness="0,0,1,1"  >
-                    <TextBlock  Text="{Binding CurrentStartMode}" VerticalAlignment="Center" TextAlignment="Center" FontSize="16" />
+                    <TextBlock  Text="{Binding SelectedControlJobsState}" VerticalAlignment="Center" TextAlignment="Center" FontSize="16" />
                 </Border>
             </Grid>
             <!--<StackPanel Orientation="Horizontal" Margin="0,2,0,0">
@@ -727,7 +737,7 @@
                     <DataGridTemplateColumn Width="60" Header="NUM">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <TextBlock Text="{Binding Num}" FontSize="16"/>
+                                <TextBlock Height="40" Text="{Binding Num}" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                             </DataTemplate>
                         </DataGridTemplateColumn.CellTemplate>
                     </DataGridTemplateColumn>
@@ -735,7 +745,7 @@
                     <DataGridTemplateColumn Width="*" Header="CJID">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <TextBlock Text="{Binding Name}" FontSize="16" VerticalAlignment="Center"/>
+                                <TextBlock  Height="40" Text="{Binding Name}" FontSize="16"  VerticalAlignment="Center" HorizontalAlignment="Center"/>
                             </DataTemplate>
                         </DataGridTemplateColumn.CellTemplate>
                     </DataGridTemplateColumn>

+ 5 - 4
Furnace/FurnaceUI/Views/Status/ControlJobStatusViewModel.cs

@@ -348,16 +348,17 @@ namespace FurnaceUI.Views.Status
         }
         public void AbortJob()
         {
+
+            if (!DialogBox.Confirm("Are you sure to abort the control job"))
+                return;
+
             if (string.IsNullOrEmpty(SelectedControlJobsObjtID))
             {
                 DialogBox.ShowWarning("Control job is not selected");
                 return;
             }
 
-            if (!DialogBox.Confirm("Are you sure to abort the control job"))
-            {
-                return;
-            }
+          
             var param = new object[] { SelectedControlJobsObjtID };
             InvokeClient.Instance.Service.DoOperation("System.AbortJob", param);
         }