Commit a8a4a7a8 by liulongfei

项目开发

parent 9a12d5d0
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Domain;
using VIZ.TimeSlice.Storage;
namespace VIZ.TimeSlice.Domain
{
/// <summary>
/// 应用程序域扩展
/// </summary>
public class ApplicationDomainEx : ApplicationDomain
{
/// <summary>
/// CSV数据上下文
/// </summary>
public static CsvContext CsvContext { get; private set; } = new CsvContext();
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TimeSlice.Domain
{
/// <summary>
/// 切片视频背景方案
/// 0 - 纯色 | 1 - 视频帧 | 2 - 图片文件
/// </summary>
public enum SliceVideoBackgroundTypeEnum
{
/// <summary>
/// 纯色
/// </summary>
[Description("纯色")]
SolidColor = 0,
/// <summary>
/// 视频帧
/// </summary>
[Description("视频帧")]
VideoFrame = 1,
/// <summary>
/// 图片文件
/// </summary>
[Description("图片文件")]
Image = 2
}
}
...@@ -64,9 +64,12 @@ ...@@ -64,9 +64,12 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Enum\SliceVideoBackgroundTypeEnum.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
...@@ -3,11 +3,192 @@ ...@@ -3,11 +3,192 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:VIZ.TimeSlice.Module" xmlns:local="clr-namespace:VIZ.TimeSlice.Module"
mc:Ignorable="d" mc:Ignorable="d" d:Background="White"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}" d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
d:DesignHeight="800" d:DesignWidth="1200"> d:DesignHeight="600" d:DesignWidth="800">
<Grid> <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="200"></RowDefinition>
</Grid.RowDefinitions>
<!-- 配置区 -->
<GroupBox Header="参数配置" Margin="20,20,20,10" Padding="5,5,20,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions>
<!-- 工作目录 -->
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="工作目录:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBox Grid.Column="1" Margin="10,0,0,0" Height="30" VerticalContentAlignment="Center"
Padding="5,0,5,0" VerticalAlignment="Center" AcceptsReturn="False"
TextWrapping="NoWrap"
Text="{Binding Path=WorkPath,Mode=TwoWay}"></TextBox>
<Button Width="60" Height="30" Grid.Column="2" Content="..." HorizontalAlignment="Right"
ToolTip="选择工作目录"
Command="{Binding Path=SelectWorkPathCommand}"></Button>
</Grid>
<Rectangle Height="1" Fill="#ffd5dfe5" VerticalAlignment="Bottom" Margin="10,0,5,0"></Rectangle>
<!-- 方案 & 背景图片 -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="视频背景方案:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<ComboBox Height="30" Grid.Column="1" Margin="10,0,0,0" VerticalContentAlignment="Center"
ItemsSource="{Binding Path=VideoBackgroundTypeItems}"
SelectedValue="{Binding Path=SelectedVideoBackgroundType,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Description}" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="背景图片:" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<Grid Grid.Column="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Margin="10,0,0,0" Height="30" VerticalContentAlignment="Center"
Padding="5,0,5,0" VerticalAlignment="Center" AcceptsReturn="False"
TextWrapping="NoWrap"
Text="{Binding Path=BackgroundImagePath,Mode=TwoWay}"></TextBox>
<Button Width="60" Height="30" Grid.Column="1" Content="..." HorizontalAlignment="Right"
ToolTip="选择背景图片"
Command="{Binding Path=SelectBackgroundImagePathCommand}"></Button>
</Grid>
</Grid>
<!-- 纯色 & 位置 -->
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="纯色背景:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<ComboBox Height="30" Grid.Column="1" Margin="10,0,0,0" VerticalContentAlignment="Center"
ItemsSource="{Binding Path=SliceBackgroundItems}"
SelectedValue="{Binding Path=SelectedSliceBackground,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name}" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="绘制坐标:" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<Grid Grid.Column="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="50"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="X:" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<toolkit:IntegerUpDown Grid.Column="1" Height="30" Minimum="0" Maximum="10000"
TextAlignment="Left" Padding="2,0,2,0"
Value="{Binding Path=PositionX,Mode=TwoWay}"></toolkit:IntegerUpDown>
<TextBlock Text="Y:" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<toolkit:IntegerUpDown Grid.Column="3" Height="30" Minimum="0" Maximum="10000"
TextAlignment="Left" Padding="2,0,2,0"
Value="{Binding Path=PositionY,Mode=TwoWay}"></toolkit:IntegerUpDown>
</Grid>
</Grid>
<Rectangle Height="1" Grid.Row="2" Fill="#ffd5dfe5" VerticalAlignment="Bottom" Margin="10,0,5,0"></Rectangle>
<!-- 输出 == 每帧保留 & 分辨率 -->
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="每X帧保留1帧:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<toolkit:IntegerUpDown Grid.Column="1" Height="30" Minimum="2" Maximum="20"
TextAlignment="Left" Padding="2,0,2,0" Margin="10,0,0,0"
Value="{Binding Path=Frames,Mode=TwoWay}"></toolkit:IntegerUpDown>
<TextBlock Text="分辨率:" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<ComboBox Height="30" Grid.Column="3" Margin="10,0,0,0" VerticalContentAlignment="Center"
ItemsSource="{Binding Path=SliceResolutionItems}"
SelectedValue="{Binding Path=SelectedSliceResolution,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name}" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<!-- 输出 == 帧率 & 输出格式 -->
<Grid Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="帧率:" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<toolkit:IntegerUpDown Grid.Column="1" Height="30" Minimum="25" Maximum="120"
TextAlignment="Left" Padding="2,0,2,0" Margin="10,0,0,0"
Value="{Binding Path=Fps,Mode=TwoWay}"></toolkit:IntegerUpDown>
<TextBlock Text="输出格式:" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<ComboBox Height="30" Grid.Column="3" Margin="10,0,0,0" VerticalContentAlignment="Center"
ItemsSource="{Binding Path=SliceFormatItems}"
SelectedValue="{Binding Path=SelectedSliceFormat,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name}" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</Grid>
</GroupBox>
<!-- 操作区 -->
<GroupBox Header="操作" Grid.Row="1" Margin="20,10,20,20" Padding="5,5,20,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="请求地址:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBlock Text="http://www.baidu.com" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,10,0"></TextBlock>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Width="120" Height="40" Content="开始" Grid.Row="1" Grid.Column="1"
HorizontalAlignment="Right" VerticalAlignment="Center"
Command="{Binding StartCommand}"></Button>
</Grid>
</Grid>
</GroupBox>
</Grid> </Grid>
</UserControl> </UserControl>
...@@ -3,7 +3,11 @@ using System.Collections.Generic; ...@@ -3,7 +3,11 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.Framework.Storage;
using VIZ.TimeSlice.Domain;
using VIZ.TimeSlice.Storage;
namespace VIZ.TimeSlice.Module namespace VIZ.TimeSlice.Module
{ {
...@@ -12,5 +16,390 @@ namespace VIZ.TimeSlice.Module ...@@ -12,5 +16,390 @@ namespace VIZ.TimeSlice.Module
/// </summary> /// </summary>
public class MainViewModel : ViewModelBase public class MainViewModel : ViewModelBase
{ {
public MainViewModel()
{
// 初始化命令
this.InitCommand();
// 初始化属性
this.InitProperty();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.StartCommand = new VCommand(this.Start);
this.SelectWorkPathCommand = new VCommand(this.SelectWorkPath);
this.SelectBackgroundImagePathCommand = new VCommand(this.SelectBackgroundImagePath);
}
/// <summary>
/// 初始化属性
/// </summary>
private void InitProperty()
{
// --------------------------------------------
// 数据集合
// --------------------------------------------
// 纯色集合
this.SliceBackgroundItems = ApplicationDomainEx.CsvContext.SliceBackgrounds;
// 分辨率集合
this.SliceResolutionItems = ApplicationDomainEx.CsvContext.SliceResolutions;
// 输出格式集合
this.SliceFormatItems = ApplicationDomainEx.CsvContext.SliceFormats;
// 背景颜色策略集合
this.VideoBackgroundTypeItems = EnumHelper.GetEnumModels<SliceVideoBackgroundTypeEnum>();
// --------------------------------------------
// 数据项
// --------------------------------------------
// 工作路径
this.workPath = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, string>(p => p.path);
// 背景方案
int videobackground = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, int>(p => p.videobackground);
this.selectedVideoBackgroundType = this.VideoBackgroundTypeItems.FirstOrDefault(p => (int)(SliceVideoBackgroundTypeEnum)p.Key == videobackground);
// 背景图片
this.backgroundImagePath = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, string>(p => p.imagepath);
// 纯色背景
string background = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, string>(p => p.background);
this.selectedSliceBackground = this.SliceBackgroundItems.FirstOrDefault(p => p.Name == background);
// 绘制坐标
this.positionX = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, int>(p => p.positionX);
this.positionY = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, int>(p => p.positionY);
// 每X帧保留1帧
this.frames = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, int>(p => p.frames);
// 分辨率
string resolution = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, string>(p => p.resolution);
this.selectedSliceResolution = this.SliceResolutionItems.FirstOrDefault(p => p.Name == resolution);
// 帧率
this.fps = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, int>(p => p.fps);
// 输出格式
string format = ApplicationDomainEx.IniStorage.GetValue<SliceConfig, string>(p => p.format);
this.selectedSliceFormat = this.SliceFormatItems.FirstOrDefault(p => p.Name == format);
}
// ==========================================================
// Property
// ==========================================================
#region WorkPath -- 工作路径
private string workPath;
/// <summary>
/// 工作路径
/// </summary>
public string WorkPath
{
get { return workPath; }
set
{
workPath = value;
this.RaisePropertyChanged(nameof(WorkPath));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.path, value);
}
}
#endregion
#region VideoBackgroundTypeItems -- 视频背景方案项集合
private List<EnumModel> videoBackgroundTypeItems;
/// <summary>
/// 视频背景方案项集合
/// <see cref="SliceVideoBackgroundTypeEnum"/>
/// </summary>
public List<EnumModel> VideoBackgroundTypeItems
{
get { return videoBackgroundTypeItems; }
set { videoBackgroundTypeItems = value; this.RaisePropertyChanged(nameof(VideoBackgroundTypeItems)); }
}
#endregion
#region SelectedVideoBackgroundType -- 选中的背景方案
private EnumModel selectedVideoBackgroundType;
/// <summary>
/// 选中的背景方案
/// <see cref="SliceVideoBackgroundTypeEnum"/>
/// </summary>
public EnumModel SelectedVideoBackgroundType
{
get { return selectedVideoBackgroundType; }
set
{
selectedVideoBackgroundType = value;
this.RaisePropertyChanged(nameof(SelectedVideoBackgroundType));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.videobackground, value == null ? 0 : (int)value.Key);
}
}
#endregion
#region BackgroundImagePath -- 背景图片路径
private string backgroundImagePath;
/// <summary>
/// 背景图片路径
/// </summary>
public string BackgroundImagePath
{
get { return backgroundImagePath; }
set
{
backgroundImagePath = value;
this.RaisePropertyChanged(nameof(BackgroundImagePath));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.imagepath, value);
}
}
#endregion
#region SliceBackgroundItems -- 纯色集合
private List<SliceBackground> sliceBackgroundItems;
/// <summary>
/// 纯色集合
/// </summary>
public List<SliceBackground> SliceBackgroundItems
{
get { return sliceBackgroundItems; }
set { sliceBackgroundItems = value; this.RaisePropertyChanged(nameof(SliceBackgroundItems)); }
}
#endregion
#region SelectedSliceBackground -- 选中的纯色
private SliceBackground selectedSliceBackground;
/// <summary>
/// 选中的纯色
/// </summary>
public SliceBackground SelectedSliceBackground
{
get { return selectedSliceBackground; }
set
{
selectedSliceBackground = value;
this.RaisePropertyChanged(nameof(SelectedSliceBackground));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.background, value == null ? string.Empty : value.Name);
}
}
#endregion
#region PositionX -- 绘制坐标X
private int positionX;
/// <summary>
/// 绘制坐标X值
/// </summary>
public int PositionX
{
get { return positionX; }
set
{
positionX = value;
this.RaisePropertyChanged(nameof(PositionX));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.positionX, value);
}
}
#endregion
#region PositionY -- 绘制坐标Y
private int positionY;
/// <summary>
/// 绘制坐标Y值
/// </summary>
public int PositionY
{
get { return positionY; }
set
{
positionY = value;
this.RaisePropertyChanged(nameof(PositionY));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.positionY, value);
}
}
#endregion
#region Frames -- X帧保留1
private int frames;
/// <summary>
/// 每X帧保留1帧
/// </summary>
public int Frames
{
get { return frames; }
set
{
frames = value;
this.RaisePropertyChanged(nameof(Frames));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.frames, value);
}
}
#endregion
#region SliceResolutionItems -- 分辨率集合
private List<SliceResolution> sliceResolutionItems;
/// <summary>
/// 分辨率集合
/// </summary>
public List<SliceResolution> SliceResolutionItems
{
get { return sliceResolutionItems; }
set { sliceResolutionItems = value; this.RaisePropertyChanged(nameof(SliceResolutionItems)); }
}
#endregion
#region SelectedSliceResolution -- 选中的分辨率
private SliceResolution selectedSliceResolution;
/// <summary>
/// 选中的分辨率
/// </summary>
public SliceResolution SelectedSliceResolution
{
get { return selectedSliceResolution; }
set
{
selectedSliceResolution = value;
this.RaisePropertyChanged(nameof(SelectedSliceResolution));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.resolution, value == null ? string.Empty : value.Name);
}
}
#endregion
#region Fps -- 帧率
private int fps;
/// <summary>
/// 帧率
/// </summary>
public int Fps
{
get { return fps; }
set
{
fps = value;
this.RaisePropertyChanged(nameof(Fps));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.fps, value);
}
}
#endregion
#region SliceFormatItems -- 输出格式集合
private List<SliceFormat> sliceFormatItems;
/// <summary>
/// 输出格式集合
/// </summary>
public List<SliceFormat> SliceFormatItems
{
get { return sliceFormatItems; }
set { sliceFormatItems = value; this.RaisePropertyChanged(nameof(SliceFormatItems)); }
}
#endregion
#region SelectedSliceFormat -- 选中的输出格式
private SliceFormat selectedSliceFormat;
/// <summary>
/// 选中的输出格式
/// </summary>
public SliceFormat SelectedSliceFormat
{
get { return selectedSliceFormat; }
set
{
selectedSliceFormat = value;
this.RaisePropertyChanged(nameof(SelectedSliceFormat));
ApplicationDomainEx.IniStorage.SetValue<SliceConfig>(p => p.format, value == null ? string.Empty : value.Name);
}
}
#endregion
// ==========================================================
// Commond
// ==========================================================
#region SelectWorkPathCommand -- 选择工作路径命令
/// <summary>
/// 选择工作路径命令
/// </summary>
public VCommand SelectWorkPathCommand { get; set; }
/// <summary>
/// 选择工作路径
/// </summary>
private void SelectWorkPath()
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
if (fbd.ShowDialog() != DialogResult.OK)
return;
this.WorkPath = fbd.SelectedPath;
}
#endregion
#region SelectBackgroundImagePathCommand -- 选择背景图片命令
/// <summary>
/// 选择背景图片命令
/// </summary>
public VCommand SelectBackgroundImagePathCommand { get; set; }
/// <summary>
/// 选择背景图片
/// </summary>
private void SelectBackgroundImagePath()
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "图片文件(*.jpg,*.gif,*.bmp)|*.jpg;*.gif;*.bmp|所有文件|*.*";
ofd.Multiselect = false;
if (ofd.ShowDialog() != DialogResult.OK)
return;
this.BackgroundImagePath = ofd.FileName;
}
#endregion
#region StartCommand -- 开始命令
/// <summary>
/// 开始命令
/// </summary>
public VCommand StartCommand { get; set; }
/// <summary>
/// 开始
/// </summary>
private void Start()
{
string str = HttpHelper.Get("http://www.baidu.com", null);
}
#endregion
// ==========================================================
// Private Function
// ==========================================================
} }
} }
using log4net;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Management;
using VIZ.Framework.Core;
using VIZ.Framework.Connection;
using VIZ.Framework.Module;
using VIZ.TimeSlice.Domain;
using CsvHelper;
using System.Globalization;
using System.IO;
namespace VIZ.TimeSlice.Module
{
/// <summary>
/// 应用程序启动 -- 初始化CSV数据
/// </summary>
public class AppSetup_InitCSV : AppSetupBase
{
/// <summary>
/// 日志
/// </summary>
private static ILog log = LogManager.GetLogger(typeof(AppSetup_InitCSV));
/// <summary>
/// 描述
/// </summary>
public override string Detail { get; } = "应用程序启动 -- 初始化CSV数据";
/// <summary>
/// 执行启动
/// </summary>
/// <param name="context">应用程序启动上下文</param>
/// <returns>是否成功执行</returns>
public override bool Setup(AppSetupContext context)
{
// 切片 纯色背景
string path_background = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config", "slice_background.csv");
ApplicationDomainEx.CsvContext.LoadSliceBackgrounds(path_background);
// 切片 分辨率
string path_resolution = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config", "slice_resolution.csv");
ApplicationDomainEx.CsvContext.LoadSliceResolutions(path_resolution);
// 切片 输出格式
string path_format = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config", "slice_format.csv");
ApplicationDomainEx.CsvContext.LoadSliceFormats(path_format);
return true;
}
/// <summary>
/// 执行关闭
/// </summary>
/// <param name="context">应用程序启动上下文</param>
public override void Shutdown(AppSetupContext context)
{
}
}
}
...@@ -50,16 +50,42 @@ ...@@ -50,16 +50,42 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CsvHelper, Version=29.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
<HintPath>..\packages\CsvHelper.29.0.0\lib\net47\CsvHelper.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.0.0\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.39\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath> <HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.39\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.0\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
...@@ -72,6 +98,21 @@ ...@@ -72,6 +98,21 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="MainView\View\MainView.xaml"> <Page Include="MainView\View\MainView.xaml">
...@@ -101,10 +142,12 @@ ...@@ -101,10 +142,12 @@
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<Compile Include="Setup\Providers\AppSetup_InitCSV.cs" />
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CsvHelper" version="29.0.0" targetFramework="net48" />
<package id="Extended.Wpf.Toolkit" version="4.4.0" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" /> <package id="log4net" version="2.0.14" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net48" />
<package id="Microsoft.Bcl.HashCode" version="1.0.0" targetFramework="net48" />
<package id="Microsoft.CSharp" version="4.3.0" targetFramework="net48" />
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net48" /> <package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net48" />
<package id="System.Buffers" version="4.4.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.0" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net48" />
</packages> </packages>
\ No newline at end of file
using CsvHelper;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TimeSlice.Storage
{
/// <summary>
/// CSV数据上下文
/// </summary>
public class CsvContext
{
/// <summary>
/// 切片纯色背景集合
/// </summary>
public List<SliceBackground> SliceBackgrounds { get; private set; }
/// <summary>
/// 切片分辨率集合
/// </summary>
public List<SliceResolution> SliceResolutions { get; private set; }
/// <summary>
/// 切片输出格式集合
/// </summary>
public List<SliceFormat> SliceFormats { get; private set; }
/// <summary>
/// 加载切片纯色背景集合
/// </summary>
/// <param name="path">文件路径</param>
public void LoadSliceBackgrounds(string path)
{
using (StreamReader sr = new StreamReader(path, Encoding.Default))
using (CsvReader reader = new CsvReader(sr, CultureInfo.InvariantCulture))
{
this.SliceBackgrounds = reader.GetRecords<SliceBackground>()?.ToList();
}
}
/// <summary>
/// 加载切片纯色背景集合
/// </summary>
/// <param name="path">文件路径</param>
public void LoadSliceResolutions(string path)
{
using (StreamReader sr = new StreamReader(path, Encoding.Default))
using (CsvReader reader = new CsvReader(sr, CultureInfo.InvariantCulture))
{
this.SliceResolutions = reader.GetRecords<SliceResolution>()?.ToList();
}
}
/// <summary>
/// 加载切片纯色背景集合
/// </summary>
/// <param name="path">文件路径</param>
public void LoadSliceFormats(string path)
{
using (StreamReader sr = new StreamReader(path, Encoding.Default))
using (CsvReader reader = new CsvReader(sr, CultureInfo.InvariantCulture))
{
this.SliceFormats = reader.GetRecords<SliceFormat>()?.ToList();
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TimeSlice.Storage
{
/// <summary>
/// 切片纯色背景
/// </summary>
public class SliceBackground
{
/// <summary>
/// 编号
/// </summary>
public int ID { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TimeSlice.Storage
{
/// <summary>
/// 切片输出格式
/// </summary>
public class SliceFormat
{
/// <summary>
/// 编号
/// </summary>
public int ID { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TimeSlice.Storage
{
/// <summary>
/// 分辨率值
/// </summary>
public class SliceResolution
{
/// <summary>
/// 编号
/// </summary>
public int ID { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Storage;
namespace VIZ.TimeSlice.Storage
{
/// <summary>
/// 切片配置
/// </summary>
public class SliceConfig : IniConfigBase
{
/// <summary>
/// 工作目录
/// </summary>
[Ini(Section = "slice", DefaultValue = "c:\\", Type = typeof(string))]
public string path { get; set; }
/// <summary>
/// 视频背景 0 - 纯色 | 1 - 视频帧 | 2 - 图片文件
/// </summary>
[Ini(Section = "slice", DefaultValue = "0", Type = typeof(int))]
public string videobackground { get; set; }
/// <summary>
/// 纯色背景
/// </summary>
[Ini(Section = "slice", DefaultValue = "0", Type = typeof(string))]
public string background { get; set; }
/// <summary>
/// 背景图片路径
/// </summary>
[Ini(Section = "slice", DefaultValue = "", Type = typeof(string))]
public string imagepath { get; set; }
/// <summary>
/// 绘制左上角X坐标
/// </summary>
[Ini(Section = "slice", DefaultValue = "500", Type = typeof(int))]
public string positionX { get; set; }
/// <summary>
/// 绘制左上角Y坐标
/// </summary>
[Ini(Section = "slice", DefaultValue = "400", Type = typeof(int))]
public string positionY { get; set; }
/// <summary>
/// 取值范围2-20,每X帧保留1帧
/// </summary>
[Ini(Section = "slice", DefaultValue = "5", Type = typeof(int))]
public string frames { get; set; }
/// <summary>
/// 分辨率
/// </summary>
[Ini(Section = "slice", DefaultValue = "4K", Type = typeof(string))]
public string resolution { get; set; }
/// <summary>
/// 帧率
/// </summary>
[Ini(Section = "slice", DefaultValue = "50", Type = typeof(int))]
public string fps { get; set; }
/// <summary>
/// 帧率
/// </summary>
[Ini(Section = "slice", DefaultValue = "mp4", Type = typeof(string))]
public string format { get; set; }
}
}
...@@ -49,12 +49,37 @@ ...@@ -49,12 +49,37 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CsvHelper, Version=29.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
<HintPath>..\packages\CsvHelper.29.0.0\lib\net47\CsvHelper.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.0.0\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.0\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
...@@ -64,9 +89,15 @@ ...@@ -64,9 +89,15 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Csv\CsvContext.cs" />
<Compile Include="Csv\Slice\SliceBackground.cs" />
<Compile Include="Csv\Slice\SliceFormat.cs" />
<Compile Include="Csv\Slice\SliceResolution.cs" />
<Compile Include="Ini\Config\SliceConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
...@@ -74,6 +105,10 @@ ...@@ -74,6 +105,10 @@
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project> <Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name> <Name>VIZ.Framework.Core</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TimeSlice.Core\VIZ.TimeSlice.Core.csproj"> <ProjectReference Include="..\VIZ.TimeSlice.Core\VIZ.TimeSlice.Core.csproj">
<Project>{bb9a3c16-84b5-4b0f-93b9-d966cdce8ea1}</Project> <Project>{bb9a3c16-84b5-4b0f-93b9-d966cdce8ea1}</Project>
<Name>VIZ.TimeSlice.Core</Name> <Name>VIZ.TimeSlice.Core</Name>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CsvHelper" version="29.0.0" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" /> <package id="log4net" version="2.0.14" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net48" />
<package id="Microsoft.Bcl.HashCode" version="1.0.0" targetFramework="net48" />
<package id="Microsoft.CSharp" version="4.3.0" targetFramework="net48" />
<package id="System.Buffers" version="4.4.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.0" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net48" />
</packages> </packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup> </startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>
\ No newline at end of file
...@@ -6,6 +6,7 @@ using System.Linq; ...@@ -6,6 +6,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using VIZ.Framework.Module; using VIZ.Framework.Module;
using VIZ.TimeSlice.Module;
namespace VIZ.TimeSlice namespace VIZ.TimeSlice
{ {
...@@ -16,9 +17,8 @@ namespace VIZ.TimeSlice ...@@ -16,9 +17,8 @@ namespace VIZ.TimeSlice
{ {
public App() public App()
{ {
// 初始化CSV
// 调试窗口 AppSetup.AppendSetup(new AppSetup_InitCSV());
//AppSetup.AppendLoad(new AppSetup_DebugWindow());
// 执行启动流程 // 执行启动流程
AppSetupContext context = AppSetup.Setup(); AppSetupContext context = AppSetup.Setup();
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
xmlns:module="clr-namespace:VIZ.TimeSlice.Module;assembly=VIZ.TimeSlice.Module" xmlns:module="clr-namespace:VIZ.TimeSlice.Module;assembly=VIZ.TimeSlice.Module"
xmlns:local="clr-namespace:VIZ.TimeSlice" xmlns:local="clr-namespace:VIZ.TimeSlice"
mc:Ignorable="d" WindowStartupLocation="CenterScreen" mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="时间切片工具" Height="800" Width="1200"> Title="时间切片工具" Height="600" Width="800">
<Grid> <Grid>
<module:MainView></module:MainView> <module:MainView></module:MainView>
</Grid> </Grid>
......
...@@ -77,6 +77,21 @@ ...@@ -77,6 +77,21 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ApplicationDefinition Include="App.xaml"> <ApplicationDefinition Include="App.xaml">
...@@ -114,7 +129,18 @@ ...@@ -114,7 +129,18 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="config\config.ini" /> <None Include="config\slice_resolution.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config\slice_format.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config\slice_background.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config\config.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config\log.config"> <None Include="config\log.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
......
...@@ -4,8 +4,12 @@ ...@@ -4,8 +4,12 @@
[slice] [slice]
; 工作目录 ; 工作目录
path=c:\export path=c:\export
; 视频背景 0 - 纯色 | 1 - 视频帧 ; 视频背景 0 - 纯色 | 1 - 视频帧 | 2 - 图片文件
videobackground=0 videobackground=0
; 纯色背景
background=red
; 背景图片路径
imagepath=c:\1.jpg
; 绘制左上角X坐标 ; 绘制左上角X坐标
positionX=500 positionX=500
; 绘制左上角Y坐标 ; 绘制左上角Y坐标
......
ID,Name
1,red
2,green
3,blue
\ No newline at end of file
ID,Name
1,mp4
\ No newline at end of file
ID,Name
1,4K
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Extended.Wpf.Toolkit" version="4.4.0" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" /> <package id="log4net" version="2.0.14" targetFramework="net48" />
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net48" /> <package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net48" />
</packages> </packages>
\ No newline at end of file
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