Commit 6f124f0f by liulongfei

Tally 开发

parent c995120d
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
x:Name="rbStyle" Style="{StaticResource RadioButton_Setting}" IsChecked="True"></RadioButton> x:Name="rbStyle" Style="{StaticResource RadioButton_Setting}" IsChecked="True"></RadioButton>
<RadioButton Content="快捷键" Height="50" Foreground="White" FontSize="22" VerticalContentAlignment="Center" <RadioButton Content="快捷键" Height="50" Foreground="White" FontSize="22" VerticalContentAlignment="Center"
x:Name="rbHotkey" Style="{StaticResource RadioButton_Setting}"></RadioButton> x:Name="rbHotkey" Style="{StaticResource RadioButton_Setting}"></RadioButton>
<!--<RadioButton Content="Tally" Height="50" Foreground="White" FontSize="22" VerticalContentAlignment="Center"
x:Name="rbTally" Style="{StaticResource RadioButton_Setting}"></RadioButton>-->
<RadioButton Content="关于" Height="50" Foreground="White" FontSize="22" VerticalContentAlignment="Center" <RadioButton Content="关于" Height="50" Foreground="White" FontSize="22" VerticalContentAlignment="Center"
x:Name="rbAbout" Style="{StaticResource RadioButton_Setting}"></RadioButton> x:Name="rbAbout" Style="{StaticResource RadioButton_Setting}"></RadioButton>
</StackPanel> </StackPanel>
...@@ -57,6 +59,8 @@ ...@@ -57,6 +59,8 @@
IsSelected="{Binding ElementName=rbStyle,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rbStyle,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl ViewType="{x:Type local:HotkeySettingPanelView}" <fcommon:NavigationItemControl ViewType="{x:Type local:HotkeySettingPanelView}"
IsSelected="{Binding ElementName=rbHotkey,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rbHotkey,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<!--<fcommon:NavigationItemControl ViewType="{x:Type local:TallySettingPanelView}"
IsSelected="{Binding ElementName=rbTally,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>-->
<fcommon:NavigationItemControl ViewType="{x:Type local:AboutPanelView}" <fcommon:NavigationItemControl ViewType="{x:Type local:AboutPanelView}"
IsSelected="{Binding ElementName=rbAbout,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rbAbout,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
</fcommon:NavigationControl> </fcommon:NavigationControl>
......
<UserControl x:Class="VIZ.H2V.Module.TallySettingPanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.H2V.Module"
mc:Ignorable="d"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
d:DataContext="{d:DesignInstance Type=local:TallySettingPanelViewModel}"
d:DesignHeight="800" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.H2V.Module.Resource;component/Style/ComboBox/ComboBox_Setting.xaml"></ResourceDictionary>
<ResourceDictionary Source="/VIZ.H2V.Module.Resource;component/Style/Button/Button_Setting.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="Loaded">
<behaviors:InvokeCommandAction Command="{Binding LoadedCommand}" />
</behaviors:EventTrigger>
</behaviors:Interaction.Triggers>
<Border>
<Grid Margin="45,60,40,0">
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="120"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="200"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- Tally USB设备 -->
<TextBlock Text="Tally信号GPIO引脚绑定" Foreground="White" FontSize="20" VerticalAlignment="Center"></TextBlock>
<Rectangle Height="1" VerticalAlignment="Bottom" Fill="#ff3d4758"></Rectangle>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- CAM 1 -->
<TextBlock Text="CAM 1" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="0"></TextBlock>
<ComboBox Style="{StaticResource ComboBox_Setting}" Grid.Column="1" Height="40" Margin="0,0,20,0"
ItemsSource="{Binding Path=Tally_GPIO_Pin_List,Mode=OneWay}"
SelectedValue="{Binding Path=Tally_GPIO_Cam_1,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding .}" Foreground="White" FontSize="16"></TextBlock>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- CAM 2 -->
<TextBlock Text="CAM 2" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="0" Grid.Column="2"></TextBlock>
<ComboBox Style="{StaticResource ComboBox_Setting}" Grid.Column="3" Height="40" Margin="0,0,20,0"
ItemsSource="{Binding Path=Tally_GPIO_Pin_List,Mode=OneWay}"
SelectedValue="{Binding Path=Tally_GPIO_Cam_2,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding .}" Foreground="White" FontSize="16"></TextBlock>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- CAM 3 -->
<TextBlock Text="CAM 3" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="1"></TextBlock>
<ComboBox Style="{StaticResource ComboBox_Setting}" Grid.Row="1" Grid.Column="1" Height="40" Margin="0,0,20,0"
ItemsSource="{Binding Path=Tally_GPIO_Pin_List,Mode=OneWay}"
SelectedValue="{Binding Path=Tally_GPIO_Cam_3,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding .}" Foreground="White" FontSize="16"></TextBlock>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- CAM 4 -->
<TextBlock Text="CAM 4" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2"></TextBlock>
<ComboBox Style="{StaticResource ComboBox_Setting}" Grid.Row="1" Grid.Column="3" Height="40" Margin="0,0,20,0"
ItemsSource="{Binding Path=Tally_GPIO_Pin_List,Mode=OneWay}"
SelectedValue="{Binding Path=Tally_GPIO_Cam_4,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding .}" Foreground="White" FontSize="16"></TextBlock>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<!-- 引脚状态 -->
<TextBlock Text="GPIO引脚状态" Grid.Row="2" Foreground="White" FontSize="20" VerticalAlignment="Center"></TextBlock>
<Rectangle Grid.Row="2" Height="1" VerticalAlignment="Bottom" Fill="#ff3d4758"></Rectangle>
<Grid Grid.Row="3">
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="120"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="设备" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="0"></TextBlock>
<ComboBox Style="{StaticResource ComboBox_Setting}" Grid.Column="1" Height="40" Margin="0,0,20,0"
ItemsSource="{Binding Path=GPIOModels,Mode=OneWay}"
SelectedValue="{Binding Path=SelectedGPIOModel,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding DeviceInfo.FirmwareName}" Foreground="White" FontSize="16"></TextBlock>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Button Grid.Column="2" Style="{StaticResource Button_Setting}" Width="100" Height="30"
Content="扫描设备"></Button>
</Grid>
<fcommon:GPIOPinTestControl Grid.Row="4" Height="140"></fcommon:GPIOPinTestControl>
</Grid>
</Border>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.H2V.Module
{
/// <summary>
/// TallySettingPanelView.xaml 的交互逻辑
/// </summary>
public partial class TallySettingPanelView : UserControl
{
public TallySettingPanelView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new TallySettingPanelViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.H2V.Domain;
using VIZ.H2V.Storage;
namespace VIZ.H2V.Module
{
/// <summary>
/// Tally设置面板视图模型
/// </summary>
public class TallySettingPanelViewModel : ViewModelBase, ISystemSetting
{
public TallySettingPanelViewModel()
{
this.LoadedCommand = new VCommand(this.Loaded);
}
// ======================================================================================
// === Field ===
// ======================================================================================
/// <summary>
/// 系统设置
/// </summary>
private SystemConfig SystemConfig;
// ======================================================================================
// === Property ===
// ======================================================================================
#region Tally_GPIO_Cam_1 -- 窗口1 信号引脚
private int tally_gpio_cam_1;
/// <summary>
/// 信号引脚
/// </summary>
public int Tally_GPIO_Cam_1
{
get { return tally_gpio_cam_1; }
set { tally_gpio_cam_1 = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Cam_1)); }
}
#endregion
#region Tally_GPIO_Cam_2 -- 窗口2 信号引脚
private int tally_gpio_cam_2;
/// <summary>
/// 信号引脚
/// </summary>
public int Tally_GPIO_Cam_2
{
get { return tally_gpio_cam_2; }
set { tally_gpio_cam_2 = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Cam_2)); }
}
#endregion
#region Tally_GPIO_Cam_3 -- 窗口3 信号引脚
private int tally_gpio_cam_3;
/// <summary>
/// 信号引脚
/// </summary>
public int Tally_GPIO_Cam_3
{
get { return tally_gpio_cam_3; }
set { tally_gpio_cam_3 = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Cam_3)); }
}
#endregion
#region Tally_GPIO_Cam_4 -- 窗口4 信号引脚
private int tally_gpio_cam_4;
/// <summary>
/// 信号引脚
/// </summary>
public int Tally_GPIO_Cam_4
{
get { return tally_gpio_cam_4; }
set { tally_gpio_cam_4 = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Cam_4)); }
}
#endregion
#region GPIOModels -- GPIO模型集合
private List<GPIOModel> gpioModels;
/// <summary>
/// GPIO模型集合
/// </summary>
public List<GPIOModel> GPIOModels
{
get { return gpioModels; }
set { gpioModels = value; this.RaisePropertyChanged(nameof(GPIOModels)); }
}
#endregion
#region SelectedGPIOModel -- 选中的GPIO模型
private GPIOModel selectedGPIOModel;
/// <summary>
/// 选中的GPIO模型
/// </summary>
public GPIOModel SelectedGPIOModel
{
get { return selectedGPIOModel; }
set { selectedGPIOModel = value; this.RaisePropertyChanged(nameof(SelectedGPIOModel)); }
}
#endregion
#region Tally_GPIO_Pin_List -- GPIO引脚列表
private List<int> tally_gpio_pin_list;
/// <summary>
/// GPIO引脚列表
/// </summary>
public List<int> Tally_GPIO_Pin_List
{
get { return tally_gpio_pin_list; }
set { tally_gpio_pin_list = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Pin_List)); }
}
#endregion
// ======================================================================================
// === Commond ===
// ======================================================================================
#region LoadedCommand -- 加载命令
/// <summary>
/// 加载命令
/// </summary>
public VCommand LoadedCommand { get; set; }
/// <summary>
/// 加载
/// </summary>
private void Loaded()
{
SystemSettingViewModel vm = WPFHelper.GetAncestorByType<SystemSettingView>(this.GetView<FrameworkElement>()).DataContext as SystemSettingViewModel;
vm.Settings.Add(this);
this.SystemConfig = vm.SystemConfig;
List<int> pin_list = new List<int>();
for (int i = 0; i <= 15; i++)
{
pin_list.Add(i);
}
this.Tally_GPIO_Pin_List = pin_list;
this.Tally_GPIO_Cam_1 = this.SystemConfig.Tally_GPIO_CAM_1;
this.Tally_GPIO_Cam_2 = this.SystemConfig.Tally_GPIO_CAM_2;
this.Tally_GPIO_Cam_3 = this.SystemConfig.Tally_GPIO_CAM_3;
this.Tally_GPIO_Cam_4 = this.SystemConfig.Tally_GPIO_CAM_4;
this.GPIOModels = GPIOManager.Models;
this.SelectedGPIOModel = this.GPIOModels?.FirstOrDefault();
}
#endregion
// ======================================================================================
// === ISystemSetting ===
// ======================================================================================
/// <summary>
/// 是否需要保存
/// </summary>
/// <returns>是否需要保存</returns>
public bool IsNeedSave()
{
if (this.Tally_GPIO_Cam_1 != this.SystemConfig.Tally_GPIO_CAM_1)
return true;
if (this.Tally_GPIO_Cam_2 != this.SystemConfig.Tally_GPIO_CAM_2)
return true;
if (this.Tally_GPIO_Cam_3 != this.SystemConfig.Tally_GPIO_CAM_3)
return true;
if (this.Tally_GPIO_Cam_4 != this.SystemConfig.Tally_GPIO_CAM_4)
return true;
return false;
}
/// <summary>
/// 保存
/// </summary>
/// <returns>是否成功保存</returns>
public bool Save()
{
// 保存
this.SystemConfig.Tally_GPIO_CAM_1 = this.Tally_GPIO_Cam_1;
this.SystemConfig.Tally_GPIO_CAM_2 = this.Tally_GPIO_Cam_2;
this.SystemConfig.Tally_GPIO_CAM_3 = this.Tally_GPIO_Cam_3;
this.SystemConfig.Tally_GPIO_CAM_4 = this.Tally_GPIO_Cam_4;
ApplicationDomainEx.LiteDbContext.SystemConfig.Update(this.SystemConfig);
// 应用
//ApplicationDomainEx.ServiceManager.GetServiceList<INDIViewService>().ForEach(p =>
//{
// p.LoadStyle();
// p.LoadClipBoxSmooth(this.ManualSmoothCoeff);
//});
// 返回
return true;
}
}
}
\ No newline at end of file
...@@ -181,6 +181,10 @@ ...@@ -181,6 +181,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="SystemSetting\View\TallySettingPanelView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="VideoMainView\View\VideoMainView.xaml"> <Page Include="VideoMainView\View\VideoMainView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -272,6 +276,7 @@ ...@@ -272,6 +276,7 @@
<Compile Include="NDISettingView\ViewModel\Algorithm\AlgorithmSixteenPanelViewModel.cs" /> <Compile Include="NDISettingView\ViewModel\Algorithm\AlgorithmSixteenPanelViewModel.cs" />
<Compile Include="NDISettingView\ViewModel\Algorithm\AlgorithmSinglePanelViewModel.cs" /> <Compile Include="NDISettingView\ViewModel\Algorithm\AlgorithmSinglePanelViewModel.cs" />
<Compile Include="SystemSetting\ViewModel\StyleSettingPanelViewModel.cs" /> <Compile Include="SystemSetting\ViewModel\StyleSettingPanelViewModel.cs" />
<Compile Include="SystemSetting\ViewModel\TallySettingPanelViewModel.cs" />
<Compile Include="SystemSetting\View\AboutPanelView.xaml.cs"> <Compile Include="SystemSetting\View\AboutPanelView.xaml.cs">
<DependentUpon>AboutPanelView.xaml</DependentUpon> <DependentUpon>AboutPanelView.xaml</DependentUpon>
</Compile> </Compile>
...@@ -306,6 +311,9 @@ ...@@ -306,6 +311,9 @@
</Compile> </Compile>
<Compile Include="Setup\Provider\AppSetup_InitCsv.cs" /> <Compile Include="Setup\Provider\AppSetup_InitCsv.cs" />
<Compile Include="Setup\Provider\AppSetup_InitNDI.cs" /> <Compile Include="Setup\Provider\AppSetup_InitNDI.cs" />
<Compile Include="SystemSetting\View\TallySettingPanelView.xaml.cs">
<DependentUpon>TallySettingPanelView.xaml</DependentUpon>
</Compile>
<Compile Include="VideoMainView\View\VideoMainView.xaml.cs"> <Compile Include="VideoMainView\View\VideoMainView.xaml.cs">
<DependentUpon>VideoMainView.xaml</DependentUpon> <DependentUpon>VideoMainView.xaml</DependentUpon>
</Compile> </Compile>
......
...@@ -64,5 +64,26 @@ namespace VIZ.H2V.Storage ...@@ -64,5 +64,26 @@ namespace VIZ.H2V.Storage
/// 手动裁切映射值倍率 /// 手动裁切映射值倍率
/// </summary> /// </summary>
public double ManualNavigation3DMappingMultiple { get; set; } = 1d; public double ManualNavigation3DMappingMultiple { get; set; } = 1d;
/// <summary>
/// Tally信号GPIO引角 -- CAM 1
/// </summary>
public int Tally_GPIO_CAM_1 { get; set; } = 0;
/// <summary>
/// Tally信号GPIO引角 -- CAM 2
/// </summary>
public int Tally_GPIO_CAM_2 { get; set; } = 1;
/// <summary>
/// Tally信号GPIO引角 -- CAM 3
/// </summary>
public int Tally_GPIO_CAM_3 { get; set; } = 2;
/// <summary>
/// Tally信号GPIO引角 -- CAM 4
/// </summary>
public int Tally_GPIO_CAM_4 { get; set; } = 3;
} }
} }
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