Commit 404f3805 by liulongfei

1. 时间控件

2. Tally开发
parent 5398752d
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="Button_Restart" TargetType="Button">
<!-- 功能按钮 -->
<Style x:Key="Button_Function" TargetType="Button">
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
<Setter Property="Foreground" Value="#88ffc000"></Setter>
<Setter Property="FontSize" Value="14"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border" BorderBrush="#88ffc000" BorderThickness="2" Background="Transparent">
<Border x:Name="border" Background="Transparent">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"></ContentPresenter>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="BorderBrush" Value="#ccffc000"></Setter>
<Setter TargetName="border" Property="Background" Value="#11ffffff"></Setter>
<Setter TargetName="border" Property="Background" Value="#22ffffff"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.7"></Setter>
<Setter Property="Opacity" Value="0.35"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
......
......@@ -41,7 +41,7 @@
<Setter TargetName="border" Property="Background" Value="#22ffffff"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.7"></Setter>
<Setter Property="Opacity" Value="0.35"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
......
......@@ -67,7 +67,7 @@
<Setter TargetName="img_over" Property="Visibility" Value="Visible"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="border" Property="Opacity" Value="0.7"></Setter>
<Setter TargetName="border" Property="Opacity" Value="0.35"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#22ffffff"></Setter>
......@@ -99,7 +99,7 @@
<Setter TargetName="img_over" Property="Visibility" Value="Visible"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="border" Property="Opacity" Value="0.7"></Setter>
<Setter TargetName="border" Property="Opacity" Value="0.35"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#22ffffff"></Setter>
......@@ -131,7 +131,7 @@
<Setter TargetName="img_over" Property="Visibility" Value="Visible"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="border" Property="Opacity" Value="0.7"></Setter>
<Setter TargetName="border" Property="Opacity" Value="0.35"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#22ffffff"></Setter>
......@@ -163,7 +163,7 @@
<Setter TargetName="img_over" Property="Visibility" Value="Visible"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="border" Property="Opacity" Value="0.7"></Setter>
<Setter TargetName="border" Property="Opacity" Value="0.35"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#22ffffff"></Setter>
......
......@@ -208,5 +208,9 @@
<ItemGroup>
<Resource Include="Icons\navigation3d_24x24.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\ai_close_24x24.png" />
<Resource Include="Icons\ai_refresh_24x24.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
......@@ -6,6 +6,7 @@
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:local="clr-namespace:VIZ.H2V.Module"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.H2V.Domain;assembly=VIZ.H2V.Domain"
d:DataContext="{d:DesignInstance Type=local:NDIMainViewModel}" Background="Transparent"
mc:Ignorable="d"
......@@ -40,6 +41,7 @@
<StackPanel Orientation="Horizontal" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top">
<Button Command="{Binding Path=InitNavigation3DCommand}" ToolTip="初始化摇杆"
Style="{StaticResource Button_Navigation3D}" Height="30"></Button>
<Rectangle Width="2" Fill="#EEFFFFFF" Height="18"></Rectangle>
<Button Command="{Binding Path=SettingCommand}" ToolTip="系统设置"
Style="{StaticResource Button_Setting}" Height="30"></Button>
<Button Command="{Binding Path=MinCommand}" ToolTip="最小化"
......@@ -65,11 +67,12 @@
</Grid>
<!-- 底部 -->
<Border Grid.Row="2" Background="#ff12202d">
<Grid Margin="110,0,0,0">
<Grid Margin="110,0,110,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="120"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- 算法服务监控 -->
<StackPanel Orientation="Horizontal" Background="Transparent">
......@@ -128,6 +131,10 @@
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
<fcommon:TimeDisplayControl FontSize="12" Foreground="#AAFFFFFF"></fcommon:TimeDisplayControl>
</StackPanel>
</Grid>
</Border>
</Grid>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using VIZ.Framework.Core;
namespace VIZ.H2V.Module
{
/// <summary>
/// Tally窗口信号模型
/// </summary>
public class TallyCamSignalModel : ModelBase
{
#region PinIndex1 -- 信号1引脚索引
private int? pinIndex1;
/// <summary>
/// 信号1引脚索引
/// </summary>
public int? PinIndex1
{
get { return pinIndex1; }
set { pinIndex1 = value; this.RaisePropertyChanged(nameof(PinIndex1)); }
}
#endregion
#region PinIndex2 -- 信号2引脚索引
private int? pinIndex2;
/// <summary>
/// 信号2引脚索引
/// </summary>
public int? PinIndex2
{
get { return pinIndex2; }
set { pinIndex2 = value; this.RaisePropertyChanged(nameof(PinIndex2)); }
}
#endregion
#region Color1 -- 信号1颜色
private Color color1;
/// <summary>
/// 信号1颜色
/// </summary>
public Color Color1
{
get { return color1; }
set { color1 = value; this.RaisePropertyChanged(nameof(Color1)); }
}
#endregion
#region Color2 -- 信号2颜色
private Color color2;
/// <summary>
/// 信号2颜色
/// </summary>
public Color Color2
{
get { return color2; }
set { color2 = value; this.RaisePropertyChanged(nameof(Color2)); }
}
#endregion
}
}
......@@ -45,8 +45,8 @@
x:Name="rbStyle" Style="{StaticResource RadioButton_Setting}" IsChecked="True"></RadioButton>
<RadioButton Content="快捷键" Height="50" Foreground="White" FontSize="22" VerticalContentAlignment="Center"
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="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"
x:Name="rbAbout" Style="{StaticResource RadioButton_Setting}"></RadioButton>
</StackPanel>
......@@ -59,8 +59,8 @@
IsSelected="{Binding ElementName=rbStyle,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl ViewType="{x:Type local:HotkeySettingPanelView}"
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:TallySettingPanelView}"
IsSelected="{Binding ElementName=rbTally,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl ViewType="{x:Type local:AboutPanelView}"
IsSelected="{Binding ElementName=rbAbout,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
</fcommon:NavigationControl>
......
......@@ -34,58 +34,58 @@ namespace VIZ.H2V.Module
// === Property ===
// ======================================================================================
#region Tally_GPIO_Cam_1 -- 窗口1 信号引脚
#region TallyInfo1 -- Tally信号 -- 窗口1
private int tally_gpio_cam_1;
private TallyCamSignalModel tallyInfo1 = new TallyCamSignalModel();
/// <summary>
/// 信号引脚
/// Tally信号 -- 窗口1
/// </summary>
public int Tally_GPIO_Cam_1
public TallyCamSignalModel TallyInfo1
{
get { return tally_gpio_cam_1; }
set { tally_gpio_cam_1 = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Cam_1)); }
get { return tallyInfo1; }
set { tallyInfo1 = value; this.RaisePropertyChanged(nameof(TallyInfo1)); }
}
#endregion
#region Tally_GPIO_Cam_2 -- 窗口2 信号引脚
#region TallyInfo2 -- Tally信号 -- 窗口2
private int tally_gpio_cam_2;
private TallyCamSignalModel tallyInfo2 = new TallyCamSignalModel();
/// <summary>
/// 信号引脚
/// Tally信号 -- 窗口2
/// </summary>
public int Tally_GPIO_Cam_2
public TallyCamSignalModel TallyInfo2
{
get { return tally_gpio_cam_2; }
set { tally_gpio_cam_2 = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Cam_2)); }
get { return tallyInfo2; }
set { tallyInfo2 = value; this.RaisePropertyChanged(nameof(TallyInfo2)); }
}
#endregion
#region Tally_GPIO_Cam_3 -- 窗口3 信号引脚
#region TallyInfo3 -- Tally信号 -- 窗口3
private int tally_gpio_cam_3;
private TallyCamSignalModel tallyInfo3 = new TallyCamSignalModel();
/// <summary>
/// 信号引脚
/// Tally信号 -- 窗口3
/// </summary>
public int Tally_GPIO_Cam_3
public TallyCamSignalModel TallyInfo3
{
get { return tally_gpio_cam_3; }
set { tally_gpio_cam_3 = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Cam_3)); }
get { return tallyInfo3; }
set { tallyInfo3 = value; this.RaisePropertyChanged(nameof(TallyInfo3)); }
}
#endregion
#region Tally_GPIO_Cam_4 -- 窗口4 信号引脚
#region TallyInfo4 -- Tally信号 -- 窗口4
private int tally_gpio_cam_4;
private TallyCamSignalModel tallyInfo4 = new TallyCamSignalModel();
/// <summary>
/// 信号引脚
/// Tally信号 -- 窗口4
/// </summary>
public int Tally_GPIO_Cam_4
public TallyCamSignalModel TallyInfo4
{
get { return tally_gpio_cam_4; }
set { tally_gpio_cam_4 = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Cam_4)); }
get { return tallyInfo4; }
set { tallyInfo4 = value; this.RaisePropertyChanged(nameof(TallyInfo4)); }
}
#endregion
......@@ -118,16 +118,16 @@ namespace VIZ.H2V.Module
#endregion
#region Tally_GPIO_Pin_List -- GPIO引脚列表
#region GPIO_Pin_List -- GPIO引脚列表
private List<int> tally_gpio_pin_list;
private List<int?> gpio_pin_list;
/// <summary>
/// GPIO引脚列表
/// </summary>
public List<int> Tally_GPIO_Pin_List
public List<int?> GPIO_Pin_List
{
get { return tally_gpio_pin_list; }
set { tally_gpio_pin_list = value; this.RaisePropertyChanged(nameof(Tally_GPIO_Pin_List)); }
get { return gpio_pin_list; }
set { gpio_pin_list = value; this.RaisePropertyChanged(nameof(GPIO_Pin_List)); }
}
#endregion
......@@ -153,19 +153,21 @@ namespace VIZ.H2V.Module
vm.Settings.Add(this);
this.SystemConfig = vm.SystemConfig;
List<int> pin_list = new List<int>();
List<int?> pin_list = new List<int?>();
pin_list.Add(null);
for (int i = 0; i <= 15; i++)
{
pin_list.Add(i);
}
this.Tally_GPIO_Pin_List = pin_list;
this.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.loadTallyInfo(this.TallyInfo1, this.SystemConfig.TallyInfo1);
this.loadTallyInfo(this.TallyInfo2, this.SystemConfig.TallyInfo2);
this.loadTallyInfo(this.TallyInfo3, this.SystemConfig.TallyInfo3);
this.loadTallyInfo(this.TallyInfo4, this.SystemConfig.TallyInfo4);
// GPIO模型
this.GPIOModels = GPIOManager.Models;
this.SelectedGPIOModel = this.GPIOModels?.FirstOrDefault();
}
......@@ -182,13 +184,13 @@ namespace VIZ.H2V.Module
/// <returns>是否需要保存</returns>
public bool IsNeedSave()
{
if (this.Tally_GPIO_Cam_1 != this.SystemConfig.Tally_GPIO_CAM_1)
if (this.isTallyInfoNeedSave(this.TallyInfo1, this.SystemConfig.TallyInfo1))
return true;
if (this.Tally_GPIO_Cam_2 != this.SystemConfig.Tally_GPIO_CAM_2)
if (this.isTallyInfoNeedSave(this.TallyInfo2, this.SystemConfig.TallyInfo2))
return true;
if (this.Tally_GPIO_Cam_3 != this.SystemConfig.Tally_GPIO_CAM_3)
if (this.isTallyInfoNeedSave(this.TallyInfo3, this.SystemConfig.TallyInfo3))
return true;
if (this.Tally_GPIO_Cam_4 != this.SystemConfig.Tally_GPIO_CAM_4)
if (this.isTallyInfoNeedSave(this.TallyInfo4, this.SystemConfig.TallyInfo4))
return true;
return false;
......@@ -201,10 +203,10 @@ namespace VIZ.H2V.Module
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;
this.saveTallyInfo(this.TallyInfo1, this.SystemConfig.TallyInfo1);
this.saveTallyInfo(this.TallyInfo2, this.SystemConfig.TallyInfo2);
this.saveTallyInfo(this.TallyInfo3, this.SystemConfig.TallyInfo3);
this.saveTallyInfo(this.TallyInfo4, this.SystemConfig.TallyInfo4);
ApplicationDomainEx.LiteDbContext.SystemConfig.Update(this.SystemConfig);
......@@ -218,5 +220,52 @@ namespace VIZ.H2V.Module
// 返回
return true;
}
/// <summary>
/// 加载Tally信息
/// </summary>
/// <param name="model">模型</param>
/// <param name="entity">实体</param>
private void loadTallyInfo(TallyCamSignalModel model, TallyInfo entity)
{
// CAM 2
model.PinIndex1 = entity.PinIndex1;
model.PinIndex2 = entity.PinIndex2;
model.Color1 = (Color)ColorConverter.ConvertFromString(entity.Color1);
model.Color2 = (Color)ColorConverter.ConvertFromString(entity.Color2);
}
/// <summary>
/// 是否需要保存TallyInfo信息
/// </summary>
/// <param name="model">模型</param>
/// <param name="entity">实体</param>
/// <returns>是否需要保存TallyInfo信息</returns>
private bool isTallyInfoNeedSave(TallyCamSignalModel model, TallyInfo entity)
{
if (model.PinIndex1 != entity.PinIndex1)
return true;
if (model.PinIndex2 != entity.PinIndex2)
return true;
if (model.Color1.ToString() != entity.Color1)
return true;
if (model.Color2.ToString() != entity.Color2)
return true;
return false;
}
/// <summary>
/// 保存Tally信息
/// </summary>
/// <param name="model">模型</param>
/// <param name="entity">实体</param>
private void saveTallyInfo(TallyCamSignalModel model, TallyInfo entity)
{
entity.PinIndex1 = model.PinIndex1;
entity.PinIndex2 = model.PinIndex2;
entity.Color1 = model.Color1.ToString();
entity.Color2 = model.Color2.ToString();
}
}
}
\ No newline at end of file
......@@ -258,6 +258,7 @@
<Compile Include="Setup\Provider\AppSetup_Recording.cs" />
<Compile Include="Setup\Provider\AppSetup_InitUDP.cs" />
<Compile Include="Setup\Provider\AppSetup_SaveCenterClipBox.cs" />
<Compile Include="SystemSetting\Model\TallyCamSignalModel.cs" />
<Compile Include="SystemSetting\ViewModel\HotkeySettingPanelViewModel.cs" />
<Compile Include="SystemSetting\ViewModel\AboutPanelViewModel.cs" />
<Compile Include="SystemSetting\ViewModel\ISystemSetting.cs" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.H2V.Storage
{
/// <summary>
/// Tally信息
/// </summary>
public class TallyInfo
{
/// <summary>
/// 引脚位序 信号1
/// </summary>
public int? PinIndex1 { get; set; } = 0;
/// <summary>
/// 引脚位序 信号2
/// </summary>
public int? PinIndex2 { get; set; } = 1;
/// <summary>
/// 颜色 信号1
/// </summary>
public string Color1 { get; set; } = "#FFFF0000";
/// <summary>
/// 颜色 信号2
/// </summary>
public string Color2 { get; set; } = "#FF00FF00";
}
}
......@@ -66,24 +66,23 @@ namespace VIZ.H2V.Storage
public double ManualNavigation3DMappingMultiple { get; set; } = 1d;
/// <summary>
/// Tally信号GPIO引角 -- CAM 1
/// Tally信息 -- 窗口1
/// </summary>
public int Tally_GPIO_CAM_1 { get; set; } = 0;
public TallyInfo TallyInfo1 { get; set; } = new TallyInfo();
/// <summary>
/// Tally信号GPIO引角 -- CAM 2
/// Tally信息 -- 窗口2
/// </summary>
public int Tally_GPIO_CAM_2 { get; set; } = 1;
public TallyInfo TallyInfo2 { get; set; } = new TallyInfo();
/// <summary>
/// Tally信号GPIO引角 -- CAM 3
/// Tally信息 -- 窗口3
/// </summary>
public int Tally_GPIO_CAM_3 { get; set; } = 2;
public TallyInfo TallyInfo3 { get; set; } = new TallyInfo();
/// <summary>
/// Tally信号GPIO引角 -- CAM 4
/// Tally信息 -- 窗口4
/// </summary>
public int Tally_GPIO_CAM_4 { get; set; } = 3;
public TallyInfo TallyInfo4 { get; set; } = new TallyInfo();
}
}
......@@ -130,6 +130,7 @@
<Compile Include="LiteDB\LiteDbContext.cs" />
<Compile Include="LiteDB\NdiView\NdiViewConfig.cs" />
<Compile Include="LiteDB\System\HotkeyConfig.cs" />
<Compile Include="LiteDB\System\Info\TallyInfo.cs" />
<Compile Include="LiteDB\System\SystemConfig.cs" />
<Compile Include="LiteDB\Video\VideoEntity.cs" />
<Compile Include="LiteDB\Video\VideoGroupEntity.cs" />
......
......@@ -3,7 +3,7 @@
; ============================================================
[Application]
;是否是调试模式
APPLICATION_IS_DEBUG=true
APPLICATION_IS_DEBUG=false
;3D鼠标平滑系数
APPLICATION_3D_MOUSE_SMOOTH_COEFFICIENT=0.015
; ============================================================
......
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