Commit 957236bc by liulongfei

功能开发

parent a8a4a7a8
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using VIZ.TimeSlice.Domain;
using VIZ.TimeSlice.Storage;
namespace VIZ.TimeSlice.Module.Resource
{
/// <summary>
/// 推送消息URL地址转化器
/// </summary>
public class PullMessageUrlConverter : IValueConverter
{
/// <summary>
/// 推送消息地址
/// </summary>
/// <remarks>
/// 示例: http://localhost:8888/olympic/pull/message?status=1&path={path}
/// </remarks>
private readonly static string CLIENT_PULL_MESSAGE_URL = ApplicationDomainEx.IniStorage.GetValue<ClientConfig, string>(p => p.CLIENT_PULL_MESSAGE_URL);
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string path = (value ?? string.Empty).ToString();
return CLIENT_PULL_MESSAGE_URL.Replace("{path}", path);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.TimeSlice.Module.Resource")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.TimeSlice.Module.Resource")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.TimeSlice.Module.Resource.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VIZ.TimeSlice.Module.Resource.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.TimeSlice.Module.Resource.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VIZ.TimeSlice.Module.Resource">
</ResourceDictionary>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E0ADF1DF-5A1B-478C-A044-07032707BB79}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>VIZ.TimeSlice.Module.Resource</RootNamespace>
<AssemblyName>VIZ.TimeSlice.Module.Resource</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<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>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Converter\PullMessageUrlConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Domain\VIZ.Framework.Domain.csproj">
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name>
</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">
<Project>{bb9a3c16-84b5-4b0f-93b9-d966cdce8ea1}</Project>
<Name>VIZ.TimeSlice.Core</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TimeSlice.Domain\VIZ.TimeSlice.Domain.csproj">
<Project>{880942f7-4357-4885-a745-37457433fe39}</Project>
<Name>VIZ.TimeSlice.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TimeSlice.Storage\VIZ.TimeSlice.Storage.csproj">
<Project>{42df2a9c-ea1f-4173-b147-eaba166bf67b}</Project>
<Name>VIZ.TimeSlice.Storage</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
......@@ -5,13 +5,21 @@
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:resource="clr-namespace:VIZ.TimeSlice.Module.Resource;assembly=VIZ.TimeSlice.Module.Resource"
mc:Ignorable="d" d:Background="White"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
d:DesignHeight="600" d:DesignWidth="800">
d:DesignHeight="800" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<resource:PullMessageUrlConverter x:Key="PullMessageUrlConverter"></resource:PullMessageUrlConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="200"></RowDefinition>
<RowDefinition Height="200"></RowDefinition>
</Grid.RowDefinitions>
<!-- 配置区 -->
<GroupBox Header="参数配置" Margin="20,20,20,10" Padding="5,5,20,5">
......@@ -172,23 +180,53 @@
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="200"></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>
<TextBlock Text="目标目录:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<Grid Grid.Column="1">
<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=DestPath,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
<Button Width="60" Height="30" Grid.Column="1" Content="..." HorizontalAlignment="Right"
ToolTip="选择背景图片"
Command="{Binding Path=SelectDestPathCommand}"></Button>
</Grid>
<Button Width="120" Height="60" Content="开始" Grid.Row="1" Grid.Column="2"
HorizontalAlignment="Right" VerticalAlignment="Center"
IsEnabled="{Binding Path=IsStartButtonEnabled}"
Command="{Binding StartCommand}"></Button>
</Grid>
<Rectangle Height="1" Grid.Row="0" Fill="#ffd5dfe5" VerticalAlignment="Bottom" Margin="10,0,5,0"></Rectangle>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<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>
<TextBlock Text="请求URL:" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left"
Margin="10,0,10,0" TextWrapping="Wrap" TextTrimming="CharacterEllipsis"
ToolTip="{Binding Path=DestPath,Converter={StaticResource ResourceKey=PullMessageUrlConverter},Mode=OneWay}"
Text="{Binding Path=DestPath,Converter={StaticResource ResourceKey=PullMessageUrlConverter},Mode=OneWay}"></TextBlock>
</Grid>
</Grid>
</GroupBox>
<!-- 日志区 -->
<GroupBox Header="日志" Grid.Row="2" Margin="20,10,20,20" Padding="5,5,20,5">
<TextBox IsReadOnly="True" Padding="5,2,5,2" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
TextWrapping="Wrap"
Text="{Binding Path=LogString,Mode=OneWay}"></TextBox>
</GroupBox>
</Grid>
</UserControl>
using System;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......@@ -16,6 +17,11 @@ namespace VIZ.TimeSlice.Module
/// </summary>
public class MainViewModel : ViewModelBase
{
/// <summary>
/// 日志
/// </summary>
private readonly static ILog log = LogManager.GetLogger(typeof(MainViewModel));
public MainViewModel()
{
// 初始化命令
......@@ -33,6 +39,7 @@ namespace VIZ.TimeSlice.Module
this.StartCommand = new VCommand(this.Start);
this.SelectWorkPathCommand = new VCommand(this.SelectWorkPath);
this.SelectBackgroundImagePathCommand = new VCommand(this.SelectBackgroundImagePath);
this.SelectDestPathCommand = new VCommand(this.SelectDestPath);
}
/// <summary>
......@@ -103,6 +110,20 @@ namespace VIZ.TimeSlice.Module
#endregion
#region DestPath -- 目标路径
private string destPath;
/// <summary>
/// 目标路径
/// </summary>
public string DestPath
{
get { return destPath; }
set { destPath = value; this.RaisePropertyChanged(nameof(DestPath)); }
}
#endregion
#region VideoBackgroundTypeItems -- 视频背景方案项集合
private List<EnumModel> videoBackgroundTypeItems;
......@@ -332,6 +353,48 @@ namespace VIZ.TimeSlice.Module
#endregion
#region LogString -- 日志字符串
private string logString;
/// <summary>
/// 日志字符串
/// </summary>
public string LogString
{
get { return logString; }
set { logString = value; this.RaisePropertySaveChanged(nameof(LogString)); }
}
#endregion
#region IsStartButtonEnabled -- 开始按钮是否可用
private bool isStartButtonEnabled = true;
/// <summary>
/// 开始按钮是否可用
/// </summary>
public bool IsStartButtonEnabled
{
get { return isStartButtonEnabled; }
set { isStartButtonEnabled = value; this.RaisePropertySaveChanged(nameof(IsStartButtonEnabled)); }
}
#endregion
// ==========================================================
// Field
// ==========================================================
/// <summary>
/// 推送消息地址
/// </summary>
private readonly static string CLIENT_PULL_MESSAGE_URL = ApplicationDomainEx.IniStorage.GetValue<ClientConfig, string>(p => p.CLIENT_PULL_MESSAGE_URL);
/// <summary>
/// 推送间隔限制(单位:毫秒)
/// </summary>
private readonly static int CLIENT_PULL_MESSAGE_INTERVAL = ApplicationDomainEx.IniStorage.GetValue<ClientConfig, int>(p => p.CLIENT_PULL_MESSAGE_INTERVAL);
// ==========================================================
// Commond
// ==========================================================
......@@ -380,6 +443,33 @@ namespace VIZ.TimeSlice.Module
#endregion
#region SelectDestPathCommand -- 选择目标目录命令
/// <summary>
/// 选择目标目录命令
/// </summary>
public VCommand SelectDestPathCommand { get; set; }
/// <summary>
/// 选择目标目录
/// </summary>
private void SelectDestPath()
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.SelectedPath = this.WorkPath;
if (fbd.ShowDialog() != DialogResult.OK)
return;
string destPath = fbd.SelectedPath.Replace(this.WorkPath, string.Empty);
if (destPath.StartsWith("\\"))
{
destPath = destPath.Substring(1);
}
this.DestPath = destPath;
}
#endregion
#region StartCommand -- 开始命令
/// <summary>
......@@ -392,7 +482,31 @@ namespace VIZ.TimeSlice.Module
/// </summary>
private void Start()
{
string str = HttpHelper.Get("http://www.baidu.com", null);
this.IsStartButtonEnabled = false;
Task.Run(() =>
{
try
{
string url = CLIENT_PULL_MESSAGE_URL.Replace("{path}", this.DestPath);
this.LogString = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} -- HTTP请求:{url}";
string result = HttpHelper.Get(url, null);
this.LogString = $"{this.LogString}\r\n{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} -- 返回: {result}";
}
catch (Exception ex)
{
log.Error(ex);
this.LogString = $"{this.LogString}\r\n{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} -- 异常: {ex.Message}";
}
finally
{
this.IsStartButtonEnabled = true;
}
});
}
#endregion
......
......@@ -195,6 +195,10 @@
<Project>{880942f7-4357-4885-a745-37457433fe39}</Project>
<Name>VIZ.TimeSlice.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TimeSlice.Module.Resource\VIZ.TimeSlice.Module.Resource.csproj">
<Project>{e0adf1df-5a1b-478c-a044-07032707bb79}</Project>
<Name>VIZ.TimeSlice.Module.Resource</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TimeSlice.Storage\VIZ.TimeSlice.Storage.csproj">
<Project>{42df2a9c-ea1f-4173-b147-eaba166bf67b}</Project>
<Name>VIZ.TimeSlice.Storage</Name>
......
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 ClientConfig : IniConfigBase
{
/// <summary>
/// 推送消息地址
/// </summary>
[Ini(Section = "Client", DefaultValue = "http://localhost:8888/olympic/pull/message?status=1&path={path}", Type = typeof(string))]
public string CLIENT_PULL_MESSAGE_URL { get; set; }
/// <summary>
/// 推送间隔限制(单位:毫秒)
/// </summary>
[Ini(Section = "Client", DefaultValue = "3000", Type = typeof(int))]
public string CLIENT_PULL_MESSAGE_INTERVAL { get; set; }
}
}
......@@ -93,6 +93,7 @@
<Compile Include="Csv\Slice\SliceBackground.cs" />
<Compile Include="Csv\Slice\SliceFormat.cs" />
<Compile Include="Csv\Slice\SliceResolution.cs" />
<Compile Include="Ini\Config\ClientConfig.cs" />
<Compile Include="Ini\Config\SliceConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
......
......@@ -55,6 +55,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TimeSlice.Module", "VIZ
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TimeSlice", "VIZ.TimeSlice\VIZ.TimeSlice.csproj", "{6D1F9A64-75F0-402C-86FE-ED6956E134F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TimeSlice.Module.Resource", "VIZ.TimeSlice.Module.Resource\VIZ.TimeSlice.Module.Resource.csproj", "{E0ADF1DF-5A1B-478C-A044-07032707BB79}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -141,48 +143,56 @@ Global
{BB9A3C16-84B5-4B0F-93B9-D966CDCE8EA1}.Debug|x64.Build.0 = Debug|x64
{BB9A3C16-84B5-4B0F-93B9-D966CDCE8EA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB9A3C16-84B5-4B0F-93B9-D966CDCE8EA1}.Release|Any CPU.Build.0 = Release|Any CPU
{BB9A3C16-84B5-4B0F-93B9-D966CDCE8EA1}.Release|x64.ActiveCfg = Release|Any CPU
{BB9A3C16-84B5-4B0F-93B9-D966CDCE8EA1}.Release|x64.Build.0 = Release|Any CPU
{BB9A3C16-84B5-4B0F-93B9-D966CDCE8EA1}.Release|x64.ActiveCfg = Release|x64
{BB9A3C16-84B5-4B0F-93B9-D966CDCE8EA1}.Release|x64.Build.0 = Release|x64
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Debug|x64.ActiveCfg = Debug|x64
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Debug|x64.Build.0 = Debug|x64
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Release|Any CPU.Build.0 = Release|Any CPU
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Release|x64.ActiveCfg = Release|Any CPU
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Release|x64.Build.0 = Release|Any CPU
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Release|x64.ActiveCfg = Release|x64
{42DF2A9C-EA1F-4173-B147-EABA166BF67B}.Release|x64.Build.0 = Release|x64
{880942F7-4357-4885-A745-37457433FE39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{880942F7-4357-4885-A745-37457433FE39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{880942F7-4357-4885-A745-37457433FE39}.Debug|x64.ActiveCfg = Debug|x64
{880942F7-4357-4885-A745-37457433FE39}.Debug|x64.Build.0 = Debug|x64
{880942F7-4357-4885-A745-37457433FE39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{880942F7-4357-4885-A745-37457433FE39}.Release|Any CPU.Build.0 = Release|Any CPU
{880942F7-4357-4885-A745-37457433FE39}.Release|x64.ActiveCfg = Release|Any CPU
{880942F7-4357-4885-A745-37457433FE39}.Release|x64.Build.0 = Release|Any CPU
{880942F7-4357-4885-A745-37457433FE39}.Release|x64.ActiveCfg = Release|x64
{880942F7-4357-4885-A745-37457433FE39}.Release|x64.Build.0 = Release|x64
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Debug|x64.ActiveCfg = Debug|x64
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Debug|x64.Build.0 = Debug|x64
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Release|Any CPU.Build.0 = Release|Any CPU
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Release|x64.ActiveCfg = Release|Any CPU
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Release|x64.Build.0 = Release|Any CPU
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Release|x64.ActiveCfg = Release|x64
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65}.Release|x64.Build.0 = Release|x64
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Debug|x64.ActiveCfg = Debug|x64
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Debug|x64.Build.0 = Debug|x64
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Release|Any CPU.Build.0 = Release|Any CPU
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Release|x64.ActiveCfg = Release|Any CPU
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Release|x64.Build.0 = Release|Any CPU
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Release|x64.ActiveCfg = Release|x64
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D}.Release|x64.Build.0 = Release|x64
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Debug|x64.ActiveCfg = Debug|x64
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Debug|x64.Build.0 = Debug|x64
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Release|Any CPU.Build.0 = Release|Any CPU
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Release|x64.ActiveCfg = Release|Any CPU
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Release|x64.Build.0 = Release|Any CPU
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Release|x64.ActiveCfg = Release|x64
{6D1F9A64-75F0-402C-86FE-ED6956E134F1}.Release|x64.Build.0 = Release|x64
{E0ADF1DF-5A1B-478C-A044-07032707BB79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0ADF1DF-5A1B-478C-A044-07032707BB79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0ADF1DF-5A1B-478C-A044-07032707BB79}.Debug|x64.ActiveCfg = Debug|x64
{E0ADF1DF-5A1B-478C-A044-07032707BB79}.Debug|x64.Build.0 = Debug|x64
{E0ADF1DF-5A1B-478C-A044-07032707BB79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0ADF1DF-5A1B-478C-A044-07032707BB79}.Release|Any CPU.Build.0 = Release|Any CPU
{E0ADF1DF-5A1B-478C-A044-07032707BB79}.Release|x64.ActiveCfg = Release|x64
{E0ADF1DF-5A1B-478C-A044-07032707BB79}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -203,6 +213,7 @@ Global
{C3C7D5C6-2FD3-4A42-8BF3-78E9A9C48B65} = {06638C0C-2E63-455C-B0EA-F8114487099A}
{2B1125B5-AAD7-41DF-894B-33FF75DC1E2D} = {22CF4045-D048-4096-B97A-48D111925DE7}
{6D1F9A64-75F0-402C-86FE-ED6956E134F1} = {27B24B0B-6286-496A-8652-48D4A3DD33AB}
{E0ADF1DF-5A1B-478C-A044-07032707BB79} = {22CF4045-D048-4096-B97A-48D111925DE7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C4A18A60-3FBA-4417-B0E4-7B9B508815D9}
......
......@@ -6,7 +6,8 @@
xmlns:module="clr-namespace:VIZ.TimeSlice.Module;assembly=VIZ.TimeSlice.Module"
xmlns:local="clr-namespace:VIZ.TimeSlice"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="时间切片工具" Height="600" Width="800">
Icon="icon.ico"
Title="时间切片工具" Height="800" Width="800" MinWidth="800" MinHeight="800">
<Grid>
<module:MainView></module:MainView>
</Grid>
......
......@@ -54,6 +54,9 @@
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<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>
......@@ -194,6 +197,10 @@
<Project>{880942f7-4357-4885-a745-37457433fe39}</Project>
<Name>VIZ.TimeSlice.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TimeSlice.Module.Resource\VIZ.TimeSlice.Module.Resource.csproj">
<Project>{e0adf1df-5a1b-478c-a044-07032707bb79}</Project>
<Name>VIZ.TimeSlice.Module.Resource</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TimeSlice.Module\VIZ.TimeSlice.Module.csproj">
<Project>{2b1125b5-aad7-41df-894b-33ff75dc1e2d}</Project>
<Name>VIZ.TimeSlice.Module</Name>
......@@ -203,6 +210,9 @@
<Name>VIZ.TimeSlice.Storage</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>echo ==========================================================
......
; ============================================================
; === slice ===
; === slice === 时间切片相关配置
; ============================================================
[slice]
; 工作目录
......@@ -21,4 +21,12 @@ resolution=4K
; 帧率
fps=50
; 输出格式
format=mp4
\ No newline at end of file
format=mp4
; ============================================================
; === Client === 客户端相关配置
; ============================================================
[Client]
; 推送消息地址
CLIENT_PULL_MESSAGE_URL=http://localhost:8888/olympic/pull/message?status=1&path={path}
; 推送间隔限制(单位:秒)
CLIENT_PULL_MESSAGE_INTERVAL=3
\ 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