Commit 1d0922c8 by liulongfei

修复裁切框发送配置bug

parent d24d5195
...@@ -289,6 +289,9 @@ namespace VIZ.H2V.Module ...@@ -289,6 +289,9 @@ namespace VIZ.H2V.Module
/// </summary> /// </summary>
public bool Save() public bool Save()
{ {
if (!this.CheckIsSendToCrop())
return false;
string streamName = this.SelectedNDIStreamInfo == null ? string.Empty : this.SelectedNDIStreamInfo.FullName; string streamName = this.SelectedNDIStreamInfo == null ? string.Empty : this.SelectedNDIStreamInfo.FullName;
int delay = this.SelectedNDIDelayInfo == null ? 0 : this.SelectedNDIDelayInfo.Value; int delay = this.SelectedNDIDelayInfo == null ? 0 : this.SelectedNDIDelayInfo.Value;
...@@ -331,11 +334,12 @@ namespace VIZ.H2V.Module ...@@ -331,11 +334,12 @@ namespace VIZ.H2V.Module
/// <summary> /// <summary>
/// 校验是否可以发送坐标给裁切程序 /// 校验是否可以发送坐标给裁切程序
/// </summary> /// </summary>
private void CheckIsSendToCrop() /// <returns>是否通过检测</returns>
private bool CheckIsSendToCrop()
{ {
// 当前设置的值为不需要向裁切程序发送坐标那么不处理 // 当前设置的值为不需要向裁切程序发送坐标那么不处理
if (!this.IsSendToCrop) if (!this.IsSendToCrop)
return; return true;
// 如果当前没有选中NDI流,那么不能设置该参数为True // 如果当前没有选中NDI流,那么不能设置该参数为True
if (this.SelectedNDIStreamInfo == null) if (this.SelectedNDIStreamInfo == null)
...@@ -347,7 +351,7 @@ namespace VIZ.H2V.Module ...@@ -347,7 +351,7 @@ namespace VIZ.H2V.Module
MessageBoxEx.ShowDialog($"请先选择NDI流", this.GetWindow()); MessageBoxEx.ShowDialog($"请先选择NDI流", this.GetWindow());
}); });
return; return false;
} }
// 如果除了当前视图外还有别的视图向选中的NDI流发送裁切坐标那么不能设置为True // 如果除了当前视图外还有别的视图向选中的NDI流发送裁切坐标那么不能设置为True
...@@ -358,7 +362,7 @@ namespace VIZ.H2V.Module ...@@ -358,7 +362,7 @@ namespace VIZ.H2V.Module
&& p.ViewKey != this.ViewKey); && p.ViewKey != this.ViewKey);
if (viewConfig == null) if (viewConfig == null)
return; return true;
this.IsSendToCrop = false; this.IsSendToCrop = false;
...@@ -367,7 +371,7 @@ namespace VIZ.H2V.Module ...@@ -367,7 +371,7 @@ namespace VIZ.H2V.Module
MessageBoxEx.ShowDialog($"视图:{viewConfig.DisplayName}, 已经配置了NDI流:{this.SelectedNDIStreamInfo.FullName},的裁切源", this.GetWindow()); MessageBoxEx.ShowDialog($"视图:{viewConfig.DisplayName}, 已经配置了NDI流:{this.SelectedNDIStreamInfo.FullName},的裁切源", this.GetWindow());
}); });
return; return false;
} }
} }
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
d:DataContext="{d:DesignInstance Type=local:StyleSettingPanelViewModel}" d:DataContext="{d:DesignInstance Type=local:StyleSettingPanelViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="800" d:DesignWidth="800">
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<fcommon:ColorPickButton Grid.Column="1" Color="{Binding Path=ManualCorrectionColor,Mode=TwoWay}" Height="30" Grid.Row="2"></fcommon:ColorPickButton> <fcommon:ColorPickButton Grid.Column="1" Color="{Binding Path=ManualCorrectionColor,Mode=TwoWay}" Height="30" Grid.Row="2"></fcommon:ColorPickButton>
</Grid> </Grid>
<!-- 裁切框移动 --> <!-- 裁切框移动 -->
<TextBlock Text="裁切框移动" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="4"></TextBlock> <TextBlock Text="手动裁切框移动" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="4"></TextBlock>
<Grid Grid.Row="5"> <Grid Grid.Row="5">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment