Commit b5d858a0 by wangonghui
parents 5f012605 4eaef4ab
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.Desktop.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Printing.v22.2.Core, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Core.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2.Core, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<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>
......
<?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>{E4912BCE-BC90-4457-9EE3-06435496D979}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>VIZ.Package.Common</RootNamespace>
<AssemblyName>VIZ.Package.Common</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="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, 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>
</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="Widgets\InputControl\TextInputControl\TextInputWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Widgets\InputControl\TextInputControl\TextInputControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Log\ErrorMessageAppender.cs" />
<Compile Include="Log\LogExpand.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>
<Compile Include="Widgets\InputControl\TextInputControl\TextInputWindow.xaml.cs">
<DependentUpon>TextInputWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Widgets\InputControl\TextInputControl\TextInputControl.xaml.cs">
<DependentUpon>TextInputControl.xaml</DependentUpon>
</Compile>
<Compile Include="Widgets\GridColumnEx\GridColumnResizeMinHeight.cs" />
<Compile Include="Widgets\InputControl\TextInputControl\TextInputControlModel.cs" />
<Compile Include="Widgets\InputControl\TextInputControl\TextInputWindowModel.cs" />
<Compile Include="Widgets\LeftRightTextEdit\LeftRightTextEdit.cs" />
<Compile Include="Widgets\TreeViewControl\DefaultTreeListNodeImageSelector.cs" />
<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.Common\VIZ.Framework.Common.csproj">
<Project>{92834c05-703e-4f05-9224-f36220939d8f}</Project>
<Name>VIZ.Framework.Common</Name>
</ProjectReference>
<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.Package.Domain\VIZ.Package.Domain.csproj">
<Project>{dbaeae47-1f2d-4b05-82c3-abf7cc33aa2d}</Project>
<Name>VIZ.Package.Domain</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
...@@ -33,6 +33,11 @@ namespace VIZ.Package.Domain ...@@ -33,6 +33,11 @@ namespace VIZ.Package.Domain
public const string PROJECT_FILE_FILTER = "viz_pkg files(*.viz_pkg)|*.viz_pkg"; public const string PROJECT_FILE_FILTER = "viz_pkg files(*.viz_pkg)|*.viz_pkg";
/// <summary> /// <summary>
/// VIZ命令返回错误前缀
/// </summary>
public const string VIZ_COMMAND_RESULT_ERROR_PREFIX = "ERROR";
/// <summary>
/// Viz 层集合 /// Viz 层集合
/// </summary> /// </summary>
public readonly static List<VizLayer> VIZ_LAYERS = new List<VizLayer> { VizLayer.FRONT_LAYER, VizLayer.MAIN_LAYER, VizLayer.BACK_LAYER }; public readonly static List<VizLayer> VIZ_LAYERS = new List<VizLayer> { VizLayer.FRONT_LAYER, VizLayer.MAIN_LAYER, VizLayer.BACK_LAYER };
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Domain
{
/// <summary>
/// 应用程序域方法
/// </summary>
public partial class ApplicationDomainEx
{
/// <summary>
/// 根据页获取场景信息
/// </summary>
/// <param name="page">页</param>
/// <returns>场景信息</returns>
public static SceneInfoModel GetSceneInfo(PageModel page)
{
SceneInfoModel sceneInfo = ApplicationDomainEx.SceneInfoList.FirstOrDefault(p => p.ScenePath == page.ScenePath && p.ConnGroupID == p.ConnGroupID);
if (sceneInfo != null)
return sceneInfo;
lock (ApplicationDomainEx.SceneInfoList)
{
SceneInfoModel sceneInfoInner = ApplicationDomainEx.SceneInfoList.FirstOrDefault(p => p.ScenePath == page.ScenePath && p.ConnGroupID == p.ConnGroupID);
if (sceneInfoInner != null)
return sceneInfoInner;
sceneInfo = new SceneInfoModel();
sceneInfo.ConnGroupID = page.ConnGroupID;
sceneInfo.Scene = page.Scene;
sceneInfo.ScenePath = page.ScenePath;
ApplicationDomainEx.SceneInfoList.Add(sceneInfo);
}
return sceneInfo;
}
}
}
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -14,7 +15,7 @@ namespace VIZ.Package.Domain ...@@ -14,7 +15,7 @@ namespace VIZ.Package.Domain
/// <summary> /// <summary>
/// 应用程序域 /// 应用程序域
/// </summary> /// </summary>
public class ApplicationDomainEx : ApplicationDomain public partial class ApplicationDomainEx : ApplicationDomain
{ {
// ============================================================= // =============================================================
// 窗口 // 窗口
...@@ -110,7 +111,7 @@ namespace VIZ.Package.Domain ...@@ -110,7 +111,7 @@ namespace VIZ.Package.Domain
/// <summary> /// <summary>
/// 连接分组 /// 连接分组
/// </summary> /// </summary>
public static List<ConnGroupModel> ConnGroups { get; set; } public static ObservableCollection<ConnGroupModel> ConnGroups { get; private set; } = new ObservableCollection<ConnGroupModel>();
/// <summary> /// <summary>
/// Viz预览进程 /// Viz预览进程
...@@ -126,5 +127,18 @@ namespace VIZ.Package.Domain ...@@ -126,5 +127,18 @@ namespace VIZ.Package.Domain
/// 当前页 /// 当前页
/// </summary> /// </summary>
public static PageModelBase CurrentPage { get; set; } public static PageModelBase CurrentPage { get; set; }
/// <summary>
/// 场景是否正在加载
/// </summary>
public static bool IsSceneLoading { get; set; }
/// <summary>
/// 场景信息列表
/// </summary>
/// <remarks>
/// 该值不会入库,仅在内存中保留
/// </remarks>
public static List<SceneInfoModel> SceneInfoList { get; private set; } = new List<SceneInfoModel>();
} }
} }
...@@ -12,8 +12,8 @@ namespace VIZ.Package.Domain ...@@ -12,8 +12,8 @@ namespace VIZ.Package.Domain
public class PageDeleteMessage public class PageDeleteMessage
{ {
/// <summary> /// <summary>
/// /// 删除的页集合
/// </summary> /// </summary>
public PageModelBase Page { get; set; } public List<PageModelBase> Pages { get; set; }
} }
} }
...@@ -69,6 +69,20 @@ namespace VIZ.Package.Domain ...@@ -69,6 +69,20 @@ namespace VIZ.Package.Domain
#endregion #endregion
#region FieldDetails -- 字段描述
private string fieldDetails;
/// <summary>
/// 字段描述
/// </summary>
public string FieldDetails
{
get { return fieldDetails; }
set { fieldDetails = value; this.RaisePropertyChanged(nameof(FieldDetails)); }
}
#endregion
#region FieldNodes -- 字段节点集合 #region FieldNodes -- 字段节点集合
private List<ControlFieldNodeModel> fieldNodes = new List<ControlFieldNodeModel>(); private List<ControlFieldNodeModel> fieldNodes = new List<ControlFieldNodeModel>();
......
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
...@@ -68,5 +69,23 @@ namespace VIZ.Package.Domain ...@@ -68,5 +69,23 @@ namespace VIZ.Package.Domain
} }
#endregion #endregion
// ===========================================================
// 扩展属性
// ===========================================================
#region SelectedPages -- 当前选中的页集合
private IList selectedPages;
/// <summary>
/// 当前选中的页集合
/// </summary>
public IList SelectedPages
{
get { return selectedPages; }
set { selectedPages = value; this.RaisePropertyChanged(nameof(SelectedPages)); }
}
#endregion
} }
} }
...@@ -106,7 +106,30 @@ namespace VIZ.Package.Domain ...@@ -106,7 +106,30 @@ namespace VIZ.Package.Domain
public Guid ConnGroupID public Guid ConnGroupID
{ {
get { return connGroupID; } get { return connGroupID; }
set { connGroupID = value; this.RaisePropertyChanged(nameof(ConnGroupID)); } set
{
connGroupID = value;
this.RaisePropertyChanged(nameof(ConnGroupID));
this.SceneInfo = ApplicationDomainEx.GetSceneInfo(this);
}
}
#endregion
// =============================================================
// 扩展属性
// =============================================================
#region SceneInfo -- 场景信息
private SceneInfoModel sceneInfo;
/// <summary>
/// 场景信息
/// </summary>
public SceneInfoModel SceneInfo
{
get { return sceneInfo; }
set { sceneInfo = value; this.RaisePropertyChanged(nameof(SceneInfo)); }
} }
#endregion #endregion
......
...@@ -72,7 +72,7 @@ namespace VIZ.Package.Domain ...@@ -72,7 +72,7 @@ namespace VIZ.Package.Domain
#region Layer -- 包装层 #region Layer -- 包装层
private VizLayer layer; private VizLayer layer = VizLayer.MAIN_LAYER;
/// <summary> /// <summary>
/// 包装层 /// 包装层
/// </summary> /// </summary>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.Package.Domain
{
/// <summary>
/// 场景信息模型
/// </summary>
public class SceneInfoModel : ModelBase
{
#region ConnGroupID -- 所属连接ID
private Guid connGroupID;
/// <summary>
/// 所属连接ID
/// </summary>
public Guid ConnGroupID
{
get { return connGroupID; }
set { connGroupID = value; this.RaisePropertyChanged(nameof(ConnGroupID)); }
}
#endregion
#region Scene -- 场景名
private string scene;
/// <summary>
/// 场景名
/// </summary>
public string Scene
{
get { return scene; }
set { scene = value; this.RaisePropertyChanged(nameof(Scene)); }
}
#endregion
#region ScenePath -- 场景路径
private string scenePath;
/// <summary>
/// 场景路径
/// </summary>
public string ScenePath
{
get { return scenePath; }
set { scenePath = value; this.RaisePropertyChanged(nameof(ScenePath)); }
}
#endregion
#region TakeInitedProgress -- 远端初始化进度(0 - 1
private double takeInitedProgress;
/// <summary>
/// 远端初始化进度(0 - 1)
/// </summary>
public double TakeInitedProgress
{
get { return takeInitedProgress; }
set { takeInitedProgress = value; this.RaisePropertyChanged(nameof(TakeInitedProgress)); }
}
#endregion
#region TakeInitedMessage -- 远端初始化消息
private string takeInitedMessage;
/// <summary>
/// 远端初始化消息
/// </summary>
public string TakeInitedMessage
{
get { return takeInitedMessage; }
set { takeInitedMessage = value; this.RaisePropertyChanged(nameof(TakeInitedMessage)); }
}
#endregion
}
}
\ No newline at end of file
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,11 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Mvvm.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Mvvm.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Core.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2.Core, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Extensions, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2.Extensions, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<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>
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ApplicationConstants.cs" /> <Compile Include="ApplicationConstants.cs" />
<Compile Include="ApplicationDomainEx.Action.cs" />
<Compile Include="ApplicationDomainEx.cs" /> <Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Core\GridColumnDefinition.cs" /> <Compile Include="Core\GridColumnDefinition.cs" />
<Compile Include="Enum\ConnGroupStatus.cs" /> <Compile Include="Enum\ConnGroupStatus.cs" />
...@@ -116,6 +117,7 @@ ...@@ -116,6 +117,7 @@
<Compile Include="Model\Resource\ResourceDragData.cs" /> <Compile Include="Model\Resource\ResourceDragData.cs" />
<Compile Include="Model\Resource\ResourceFileModelBase.cs" /> <Compile Include="Model\Resource\ResourceFileModelBase.cs" />
<Compile Include="Model\Resource\ResourceFolderModelBase.cs" /> <Compile Include="Model\Resource\ResourceFolderModelBase.cs" />
<Compile Include="Model\Scene\SceneInfoModel.cs" />
<Compile Include="Model\Setting\SettingPageModel.cs" /> <Compile Include="Model\Setting\SettingPageModel.cs" />
<Compile Include="Model\Task\PackageTaskModel.cs" /> <Compile Include="Model\Task\PackageTaskModel.cs" />
<Compile Include="Plugin\IPluginLifeCycle.cs" /> <Compile Include="Plugin\IPluginLifeCycle.cs" />
......
<?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>{DBAEAE47-1F2D-4B05-82C3-ABF7CC33AA2D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VIZ.Package.Domain</RootNamespace>
<AssemblyName>VIZ.Package.Domain</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<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="DevExpress.Mvvm.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Extensions, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, 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>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="ApplicationConstants.cs" />
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Core\GridColumnDefinition.cs" />
<Compile Include="Enum\ConnGroupStatus.cs" />
<Compile Include="Enum\ModulePluginIds.cs" />
<Compile Include="Enum\ViewServiceKeys.cs" />
<Compile Include="Info\VizTreeNodeInfo.cs" />
<Compile Include="Message\Application\ApplicationClosedMessage.cs" />
<Compile Include="Message\Application\ApplicationClosingMessage.cs" />
<Compile Include="Message\Conn\ConnChangedMessage.cs" />
<Compile Include="Message\ControlObject\ControlListFieldChangedMessage.cs" />
<Compile Include="Message\ControlObject\ControlFieldChangedMessage.cs" />
<Compile Include="Message\Log\ErrorLogMessage.cs" />
<Compile Include="Message\Log\VizCommandLogMessage.cs" />
<Compile Include="Message\Page\PageDeleteMessage.cs" />
<Compile Include="Message\Page\PageGroupDeleteMessage.cs" />
<Compile Include="Message\Page\PageOpenMessage.cs" />
<Compile Include="Message\Page\PageInitedMessage.cs" />
<Compile Include="Message\Project\ProjectSaveMessage.cs" />
<Compile Include="Message\Project\ProjectCloseMessage.cs" />
<Compile Include="Message\Project\ProjectOpenMessage.cs" />
<Compile Include="Message\Viz\VizPreviewReadyMessage.cs" />
<Compile Include="Message\Viz\VizPreviewRestartMessage.cs" />
<Compile Include="Model\Conn\ConnGroupModel.cs" />
<Compile Include="Model\Conn\ConnModel.cs" />
<Compile Include="Core\IPackageEndpointManager.cs" />
<Compile Include="Model\ControlObject\ControlFieldNodeModel.cs" />
<Compile Include="Model\ControlObject\ControlObjectModel.cs" />
<Compile Include="Model\File\FileModel.cs" />
<Compile Include="Model\File\FolderModel.cs" />
<Compile Include="Model\Page\PageGroupModel.cs" />
<Compile Include="Model\Page\PageModel.cs" />
<Compile Include="Model\Page\PageModelBase.cs" />
<Compile Include="Model\Page\PageTemplateModel.cs" />
<Compile Include="Model\Resource\Enum\ResourceFileSelectionMode.cs" />
<Compile Include="Model\Resource\Enum\ResourceFileType.cs" />
<Compile Include="Model\Resource\Enum\ResourceFolderType.cs" />
<Compile Include="Model\Resource\GH\GHResourceFileModel.cs" />
<Compile Include="Model\Resource\GH\GHResourceFolderModel.cs" />
<Compile Include="Model\Resource\MH\MHResourceFileModel.cs" />
<Compile Include="Model\Resource\MH\MHResourceFolderModel.cs" />
<Compile Include="Model\Resource\ResourceDragData.cs" />
<Compile Include="Model\Resource\ResourceFileModelBase.cs" />
<Compile Include="Model\Resource\ResourceFolderModelBase.cs" />
<Compile Include="Model\Scene\SceneInfoModel.cs" />
<Compile Include="Model\Setting\SettingPageModel.cs" />
<Compile Include="Model\Task\PackageTaskModel.cs" />
<Compile Include="Plugin\IPluginLifeCycle.cs" />
<Compile Include="Plugin\IPluginSettingView.cs" />
<Compile Include="Plugin\IPluginView.cs" />
<Compile Include="Plugin\PluginInfo.cs" />
<Compile Include="Plugin\PluginType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Common\VIZ.Framework.Common.csproj">
<Project>{92834c05-703e-4f05-9224-f36220939d8f}</Project>
<Name>VIZ.Framework.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Connection\VIZ.Framework.Connection.csproj">
<Project>{e07528dd-9dee-47c2-b79d-235ecfa6b003}</Project>
<Name>VIZ.Framework.Connection</Name>
</ProjectReference>
<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.Package.Storage\VIZ.Package.Storage.csproj">
<Project>{5bf08a07-9405-4f5d-a7f7-9d9ee17d6dd0}</Project>
<Name>VIZ.Package.Storage</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.Desktop.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Printing.v22.2.Core, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Core.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2.Core, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
...@@ -255,5 +255,8 @@ ...@@ -255,5 +255,8 @@
<ItemGroup> <ItemGroup>
<Resource Include="Icons\file_32x32.png" /> <Resource Include="Icons\file_32x32.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Icons\icon_clear_32x32.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
...@@ -137,13 +137,13 @@ namespace VIZ.Package.Module ...@@ -137,13 +137,13 @@ namespace VIZ.Package.Module
ThreadHelper.SafeRun(action: () => ThreadHelper.SafeRun(action: () =>
{ {
// 获取控制对象 // 从本地数据库获取控制对象
ControlObjectModel controlObject = this.vizCommandControlObjectService.GetControlObject(ApplicationDomainEx.PreviewConn); ControlObjectEntity entity = this.controlObjectService.GetControlObject(msg.Page)?.FirstOrDefault();
ControlObjectModel controlObject = new ControlObjectModel();
this.vizCommandControlObjectService.UpdateControlObjectModel(controlObject, entity);
// 从本地数据库中获取字段数据 // 从本地数据库中获取字段
List<ControlFieldEntity> fields = this.controlObjectService.GetControlFields(msg.Page); List<ControlFieldEntity> fields = this.controlObjectService.GetControlFields(msg.Page);
// 从本地数据库中更新值
controlObjectService.UpdateControlFieldValue(controlObject.AllFiledNodes, fields); controlObjectService.UpdateControlFieldValue(controlObject.AllFiledNodes, fields);
WPFHelper.Invoke(() => WPFHelper.Invoke(() =>
......
...@@ -21,5 +21,11 @@ namespace VIZ.Package.Module ...@@ -21,5 +21,11 @@ namespace VIZ.Package.Module
/// 加载布局 /// 加载布局
/// </summary> /// </summary>
void LoadLayout(); void LoadLayout();
/// <summary>
/// 设置主视图是否可用
/// </summary>
/// <param name="isEnabled">是否可用</param>
void SetIsEnabled(bool isEnabled);
} }
} }
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<Image Source="/VIZ.Package;component/logo.ico" Margin="2,5,2,2" <Image Source="/VIZ.Package;component/logo.ico" Margin="2,5,2,2"
VerticalAlignment="Center"></Image> VerticalAlignment="Center"></Image>
<dxb:MainMenuControl Caption="MainMenu" VerticalAlignment="Center" Margin="10,0,0,0"> <dxb:MainMenuControl Caption="MainMenu" VerticalAlignment="Center" Margin="5,0,0,0">
<dxb:MainMenuControl.Resources> <dxb:MainMenuControl.Resources>
<Style TargetType="dxb:BarSubItem"> <Style TargetType="dxb:BarSubItem">
<Setter Property="Margin" Value="0,0,3,0"></Setter> <Setter Property="Margin" Value="0,0,3,0"></Setter>
......
...@@ -12,12 +12,15 @@ ...@@ -12,12 +12,15 @@
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core" xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:plugin="clr-namespace:VIZ.Package.Plugin;assembly=VIZ.Package.Plugin" xmlns:plugin="clr-namespace:VIZ.Package.Plugin;assembly=VIZ.Package.Plugin"
xmlns:domain="clr-namespace:VIZ.Package.Domain;assembly=VIZ.Package.Domain" xmlns:domain="clr-namespace:VIZ.Package.Domain;assembly=VIZ.Package.Domain"
xmlns:local="clr-namespace:VIZ.Package.Module" xmlns:local="clr-namespace:VIZ.Package.Module"
IsEnabled="{Binding Path=IsEnabled}"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}" d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources> <UserControl.Resources>
<fcore:Bool2BoolConverter x:Key="Bool2BoolConverter"></fcore:Bool2BoolConverter>
<DataTemplate DataType="{x:Type domain:PluginInfo}"> <DataTemplate DataType="{x:Type domain:PluginInfo}">
<plugin:PluginLoader ViewType="{Binding ViewType,Mode=OneWay}"></plugin:PluginLoader> <plugin:PluginLoader ViewType="{Binding ViewType,Mode=OneWay}"></plugin:PluginLoader>
</DataTemplate> </DataTemplate>
...@@ -55,4 +58,5 @@ ...@@ -55,4 +58,5 @@
AutoHideExpandMode="MouseDown"> AutoHideExpandMode="MouseDown">
<dxdo:LayoutGroup ItemsSource="{Binding ItemsSource}"></dxdo:LayoutGroup> <dxdo:LayoutGroup ItemsSource="{Binding ItemsSource}"></dxdo:LayoutGroup>
</dxdo:DockLayoutManager> </dxdo:DockLayoutManager>
</UserControl> </UserControl>
...@@ -132,7 +132,8 @@ namespace VIZ.Package.Module ...@@ -132,7 +132,8 @@ namespace VIZ.Package.Module
private void OnVizPreviewReadyMessage(VizPreviewReadyMessage msg) private void OnVizPreviewReadyMessage(VizPreviewReadyMessage msg)
{ {
List<ConnGroupModel> groups = this.connService.LoadGroups(); List<ConnGroupModel> groups = this.connService.LoadGroups();
ApplicationDomainEx.ConnGroups = groups; ApplicationDomainEx.ConnGroups.Clear();
ApplicationDomainEx.ConnGroups.AddRange(groups);
this.InitAndConnnectGroups(); this.InitAndConnnectGroups();
} }
......
...@@ -66,6 +66,20 @@ namespace VIZ.Package.Module ...@@ -66,6 +66,20 @@ namespace VIZ.Package.Module
#endregion #endregion
#region IsEnabled -- 是否可用
private bool isEnabled = true;
/// <summary>
/// 是否可用
/// </summary>
public bool IsEnabled
{
get { return isEnabled; }
set { isEnabled = value; this.RaisePropertyChanged(nameof(IsEnabled)); }
}
#endregion
// ============================================================ // ============================================================
// Command // Command
// ============================================================ // ============================================================
...@@ -177,6 +191,15 @@ namespace VIZ.Package.Module ...@@ -177,6 +191,15 @@ namespace VIZ.Package.Module
view.dockLayoutManager.RestoreLayoutFromXml(path); view.dockLayoutManager.RestoreLayoutFromXml(path);
} }
/// <summary>
/// 设置主视图是否可用
/// </summary>
/// <param name="isEnabled">是否可用</param>
public void SetIsEnabled(bool isEnabled)
{
this.IsEnabled = isEnabled;
}
// ============================================================ // ============================================================
// Private Function // Private Function
// ============================================================ // ============================================================
......
using DevExpress.XtraPrinting.Native;
using log4net;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.Package.Module
{
/// <summary>
/// 页视图模型辅助类
/// </summary>
public class PageViewModelHelper
{
/// <summary>
/// 日志
/// </summary>
private readonly static ILog log = LogManager.GetLogger(typeof(PageViewModelHelper));
/// <summary>
/// GH服务
/// </summary>
private GHService ghService = new GHService();
/// <summary>
/// Viz命令服务
/// </summary>
private VizCommandService vizCommandService = new VizCommandService();
/// <summary>
/// Viz控制对象下载服务
/// </summary>
private VizControlObjectDownloadService vizControlObjectDownloadService = new VizControlObjectDownloadService();
/// <summary>
/// 开始下载图片任务
/// </summary>
/// <param name="pages">页集合</param>
public void BeginDownLoadIamge(List<PageModelBase> pages)
{
ThreadHelper.SafeRun(() =>
{
foreach (PageModelBase page in pages)
{
if (page.ThumbnailBitmap != null)
continue;
if (string.IsNullOrWhiteSpace(page.ThumbnailUri))
continue;
var bitmap = this.ghService.GetImage(page.ThumbnailUri);
WPFHelper.BeginInvoke(() =>
{
page.ThumbnailBitmap = bitmap;
});
}
});
}
/// <summary>
/// 开始下载控制对象
/// </summary>
/// <param name="pages">页集合</param>
/// <param name="callback">下载完成回调</param>
public void BeginDownLoadControlObject(List<PageModelBase> pages, Action callback)
{
if (pages == null || pages.Count == 0)
return;
PageLoadingWindow window = new PageLoadingWindow();
window.Owner = ApplicationDomainEx.MainWindow;
Task.Run(() =>
{
IMainViewService service = ApplicationDomainEx.ServiceManager.GetService<IMainViewService>(ViewServiceKeys.MAIN_VIEW_SERVICE);
// 设置主窗口不可用
WPFHelper.Invoke(() =>
{
ApplicationDomainEx.IsSceneLoading = true;
service?.SetIsEnabled(false);
window?.Show();
});
// 下载页控制对象信息
try
{
this.vizControlObjectDownloadService.Load(pages);
}
catch (Exception ex)
{
log.Error(ex);
}
finally
{
// 恢复主窗口可用
WPFHelper.Invoke(() =>
{
ApplicationDomainEx.IsSceneLoading = false;
service?.SetIsEnabled(true);
window?.Close();
// 回调
callback?.Invoke();
});
}
});
}
/// <summary>
/// 开始清理
/// </summary>
/// <param name="groups">链接分组</param>
public void BeginTakeClear(List<ConnGroupModel> groups)
{
if (groups == null || groups.Count == 0)
return;
ThreadHelper.SafeRun(() =>
{
ApplicationDomainEx.IsSceneLoading = true;
foreach (ConnGroupModel group in groups)
{
if (group == ApplicationDomainEx.PreviewConnGroup)
continue;
if (group.Items == null || group.Items.Count == 0)
continue;
List<ConnModel> items = group.Items.ToList();
foreach (ConnModel item in items)
{
try
{
if (!item.IsEnabled || !item.IsConnected)
continue;
this.vizCommandService.TakeClear(ApplicationDomainEx.PreviewConn);
}
catch (Exception ex)
{
log.Error(ex);
}
}
}
ApplicationDomainEx.IsSceneLoading = true;
});
}
/// <summary>
/// 开始初始化页
/// </summary>
/// <param name="pages">页集合</param>
public void BeginTakeInit(List<PageModel> pages)
{
if (pages == null || pages.Count == 0)
return;
ThreadHelper.SafeRun(() =>
{
ApplicationDomainEx.IsSceneLoading = true;
// 清理状态
WPFHelper.Invoke(() =>
{
foreach (PageModel page in pages)
{
if (page.SceneInfo == null)
continue;
page.SceneInfo.TakeInitedProgress = 0d;
page.SceneInfo.TakeInitedMessage = null;
}
});
// 已经处理过的场景信息列表
List<SceneInfoModel> executedList = new List<SceneInfoModel>();
foreach (PageModel page in pages)
{
if (page.SceneInfo == null)
continue;
if (executedList.Contains(page.SceneInfo))
continue;
executedList.Add(page.SceneInfo);
// 是否拥有关联的连接分组信息
ConnGroupModel group = ApplicationDomainEx.ConnGroups.FirstOrDefault(p => p.GroupID == page.ConnGroupID);
if (group == null)
{
WPFHelper.BeginInvoke(() =>
{
page.SceneInfo.TakeInitedMessage = $"未找到页关联的连接分组";
});
continue;
}
// 连接分组是否拥有可用的连接
var conns = group.Items.Where(p => p.IsEnabled).ToList();
if (conns.Count == 0)
{
WPFHelper.BeginInvoke(() =>
{
page.SceneInfo.TakeInitedMessage = $"连接分组没有连接可用";
});
continue;
}
int progressMax = conns.Count;
int progress = 0;
StringBuilder message = new StringBuilder();
foreach (ConnModel conn in conns)
{
try
{
if (!conn.IsConnected || !conn.IsEnabled)
{
message.AppendLine($"{conn.IP}:{conn.Port} 连接中断");
continue;
}
string result = this.vizCommandService.TakeInit(conn, page.ScenePath);
// 是否执行成功
if (result.StartsWith(ApplicationConstants.VIZ_COMMAND_RESULT_ERROR_PREFIX))
{
message.AppendLine(result);
continue;
}
++progress;
}
catch (Exception ex)
{
log.Error(ex);
message.AppendLine(ex.Message);
}
}
WPFHelper.BeginInvoke(() =>
{
page.SceneInfo.TakeInitedProgress = (double)progress / (double)progressMax;
page.SceneInfo.TakeInitedMessage = message.ToString();
});
}
ApplicationDomainEx.IsSceneLoading = true;
});
}
}
}
<Window x:Class="VIZ.Package.Module.PageLoadingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
ShowInTaskbar="False"
mc:Ignorable="d" AllowsTransparency="True" Background="{x:Null}"
WindowStyle="None" WindowStartupLocation="CenterScreen"
Title="Loading" Height="140" Width="300">
<Grid>
<dx:WaitIndicator DeferedVisibility="True" Content="Loading..." />
</Grid>
</Window>
using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace VIZ.Package.Module
{
/// <summary>
/// Interaction logic for PageLoadingWindow.xaml
/// </summary>
public partial class PageLoadingWindow : Window
{
public PageLoadingWindow()
{
InitializeComponent();
}
}
}
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.Package.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<resource:RowHandleConverter x:Key="RowHandleConverter"></resource:RowHandleConverter> <resource:RowHandleConverter x:Key="RowHandleConverter"></resource:RowHandleConverter>
<fcore:Bitmap2ImageSourceConverter x:Key="Bitmap2ImageSourceConverter"></fcore:Bitmap2ImageSourceConverter> <fcore:Bitmap2ImageSourceConverter x:Key="Bitmap2ImageSourceConverter"></fcore:Bitmap2ImageSourceConverter>
<fcore:Enum2EnumDescriptionConverter x:Key="Enum2EnumDescriptionConverter" EnumType="{x:Type storage:PageType}"></fcore:Enum2EnumDescriptionConverter> <fcore:Enum2EnumDescriptionConverter x:Key="Enum2EnumDescriptionConverter" EnumType="{x:Type storage:PageType}"></fcore:Enum2EnumDescriptionConverter>
...@@ -29,6 +33,22 @@ ...@@ -29,6 +33,22 @@
</UserControl.Resources> </UserControl.Resources>
<Grid IsEnabled="{Binding IsEnabled}"> <Grid IsEnabled="{Binding IsEnabled}">
<Grid.RowDefinitions>
<RowDefinition Height="35"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 按钮组 -->
<Border Background="#11FFFFFF">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<!-- 清理 -->
<fcommon:IconButton Icon="/VIZ.Package.Module.Resource;component/Icons/icon_clear_32x32.png"
Style="{StaticResource IconButton_Menu_Mask}"
ToolTip="清理内存" Margin="5,0,0,0"
IconWidth="24" IconHeight="24" Width="24" Height="24"
Command="{Binding TakeClearCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<dx:DXTabControl Grid.Row="1" Margin="0,5,0,0" Padding="0,5,0,0" <dx:DXTabControl Grid.Row="1" Margin="0,5,0,0" Padding="0,5,0,0"
ItemsSource="{Binding Path=PageGroupModels}" ItemsSource="{Binding Path=PageGroupModels}"
SelectedItem="{Binding Path=SelectedPageGroupModel,Mode=TwoWay}"> SelectedItem="{Binding Path=SelectedPageGroupModel,Mode=TwoWay}">
...@@ -39,6 +59,9 @@ ...@@ -39,6 +59,9 @@
<MenuItem Header="新建分组" Command="{Binding Path=PlacementTarget.DataContext.AddGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="新建分组" Command="{Binding Path=PlacementTarget.DataContext.AddGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="重命名分组" Command="{Binding Path=PlacementTarget.DataContext.RenameGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="重命名分组" Command="{Binding Path=PlacementTarget.DataContext.RenameGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator></Separator> <Separator></Separator>
<MenuItem Header="更新页" Command="{Binding Path=PlacementTarget.DataContext.UpdateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="初始化页" Command="{Binding Path=PlacementTarget.DataContext.TakeInitCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator></Separator>
<MenuItem Header="删除分组" Command="{Binding Path=PlacementTarget.DataContext.DeleteGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="删除分组" Command="{Binding Path=PlacementTarget.DataContext.DeleteGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="删除节目单项" Command="{Binding Path=PlacementTarget.DataContext.DeleteItemCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="删除节目单项" Command="{Binding Path=PlacementTarget.DataContext.DeleteItemCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
</ContextMenu> </ContextMenu>
...@@ -62,8 +85,8 @@ ...@@ -62,8 +85,8 @@
<Setter Property="ContentTemplate"> <Setter Property="ContentTemplate">
<Setter.Value> <Setter.Value>
<DataTemplate> <DataTemplate>
<dxg:GridControl ItemsSource="{Binding Pages}" ShowBorder="False" IsFilterEnabled="False" <dxg:GridControl ItemsSource="{Binding Path=Pages}" ShowBorder="False" IsFilterEnabled="False" SelectionMode="Row"
SelectedItem="{Binding ElementName=uc, Path=DataContext.SelectedPageModel,Mode=TwoWay}"> SelectedItems="{Binding Path=SelectedPages,Mode=OneWayToSource}">
<dxg:GridControl.Columns> <dxg:GridControl.Columns>
<dxg:GridColumn Header="编号" AllowSorting="False" AllowColumnFiltering="False" AllowResizing="True" <dxg:GridColumn Header="编号" AllowSorting="False" AllowColumnFiltering="False" AllowResizing="True"
FieldName="PageNum"> FieldName="PageNum">
...@@ -108,6 +131,12 @@ ...@@ -108,6 +131,12 @@
DisplayMember="Name" ValueMember="GroupID" IsTextEditable="False"></dxe:ComboBoxEditSettings> DisplayMember="Name" ValueMember="GroupID" IsTextEditable="False"></dxe:ComboBoxEditSettings>
</dxg:GridColumn.EditSettings> </dxg:GridColumn.EditSettings>
</dxg:GridColumn> </dxg:GridColumn>
<dxg:GridColumn Header="加载" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False" AllowEditing="False"
Binding="{Binding Path=SceneInfo.TakeInitedProgress}">
<dxg:GridColumn.EditSettings>
<dxe:ProgressBarEditSettings ContentDisplayMode="Value" Minimum="0" Maximum="1" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="引擎类型" FieldName="EngineType" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False"></dxg:GridColumn> <dxg:GridColumn Header="引擎类型" FieldName="EngineType" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False"></dxg:GridColumn>
<dxg:GridColumn Header="模板类型" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False" <dxg:GridColumn Header="模板类型" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False"
Binding="{Binding Path=PageType,Converter={StaticResource Enum2EnumDescriptionConverter}}"> Binding="{Binding Path=PageType,Converter={StaticResource Enum2EnumDescriptionConverter}}">
......
...@@ -16,7 +16,7 @@ namespace VIZ.Package.Module ...@@ -16,7 +16,7 @@ namespace VIZ.Package.Module
/// <summary> /// <summary>
/// 添加场景模板 /// 添加场景模板
/// </summary> /// </summary>
/// <param name="fileModel">文件模型</param> /// <param name="fileModels">文件模型集合</param>
void AddSceneTemplate(GHResourceFileModel fileModel); void AddSceneTemplate(List<GHResourceFileModel> fileModels);
} }
} }
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
</UserControl.Resources> </UserControl.Resources>
<Grid IsEnabled="{Binding Path=IsEnabled}" Margin="0,10,0,10"> <Grid IsEnabled="{Binding Path=IsEnabled}" Margin="0,10,0,10">
<dxg:GridControl ItemsSource="{Binding Path=SceneTemplateModels}" ShowBorder="False" <dxg:GridControl ItemsSource="{Binding Path=SceneTemplateModels}" ShowBorder="False" SelectionMode="Row"
SelectedItem="{Binding Path=SelectedSceneTemplateModel,Mode=TwoWay}"> SelectedItems="{Binding Path=SelectedSceneTemplateModels,Mode=OneWayToSource}">
<dxg:GridControl.ContextMenu> <dxg:GridControl.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem Header="打开" Command="{Binding Path=PlacementTarget.DataContext.OpenScenePageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="打开" Command="{Binding Path=PlacementTarget.DataContext.OpenScenePageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
......
...@@ -203,14 +203,17 @@ namespace VIZ.Package.Module ...@@ -203,14 +203,17 @@ namespace VIZ.Package.Module
/// <param name="msg">消息</param> /// <param name="msg">消息</param>
private void OnPageDeleteMessage(PageDeleteMessage msg) private void OnPageDeleteMessage(PageDeleteMessage msg)
{ {
if (msg.Page == null) if (msg.Pages == null || msg.Pages.Count == 0)
return; return;
PluginNavigationConfig config = this.ItemsSource.FirstOrDefault(p => p.PageModel == msg.Page); foreach (PageModelBase page in msg.Pages)
if (config == null) {
return; PluginNavigationConfig config = this.ItemsSource.FirstOrDefault(p => p.PageModel == page);
if (config == null)
return;
this.ItemsSource.Remove(config); this.ItemsSource.Remove(config);
}
} }
/// <summary> /// <summary>
......
...@@ -57,10 +57,12 @@ namespace VIZ.Package.Module ...@@ -57,10 +57,12 @@ namespace VIZ.Package.Module
if (service == null) if (service == null)
return; return;
List<GHResourceFileModel> list = new List<GHResourceFileModel>();
foreach (GHResourceFileModel file in this.SelectedFileModels) foreach (GHResourceFileModel file in this.SelectedFileModels)
{ {
service.AddSceneTemplate(file); list.Add(file);
} }
service.AddSceneTemplate(list);
} }
#endregion #endregion
......
...@@ -242,8 +242,8 @@ namespace VIZ.Package.Module ...@@ -242,8 +242,8 @@ namespace VIZ.Package.Module
{ {
// 保存配置 // 保存配置
this.connService.SaveGroups(this.Groups); this.connService.SaveGroups(this.Groups);
ApplicationDomainEx.ConnGroups.Clear();
ApplicationDomainEx.ConnGroups = this.Groups.ToList(); ApplicationDomainEx.ConnGroups.AddRange(this.Groups.ToList());
// 发送连接改变消息 // 发送连接改变消息
ConnChangedMessage msg = new ConnChangedMessage(); ConnChangedMessage msg = new ConnChangedMessage();
......
...@@ -137,10 +137,10 @@ namespace VIZ.Package.Module ...@@ -137,10 +137,10 @@ namespace VIZ.Package.Module
/// <param name="msg">消息</param> /// <param name="msg">消息</param>
private void OnPageDeleteMessage(PageDeleteMessage msg) private void OnPageDeleteMessage(PageDeleteMessage msg)
{ {
if (msg.Page == null) if (msg.Pages == null || msg.Pages.Count == 0)
return; return;
var query = this.ItemsSource.Where(p => p.PageModel == msg.Page).ToList(); var query = this.ItemsSource.Where(p => msg.Pages.Contains(p.PageModel)).ToList();
foreach (PackageTaskModel task in query) foreach (PackageTaskModel task in query)
{ {
this.Cancel(task); this.Cancel(task);
...@@ -221,8 +221,8 @@ namespace VIZ.Package.Module ...@@ -221,8 +221,8 @@ namespace VIZ.Package.Module
/// <param name="task">任务</param> /// <param name="task">任务</param>
private void ExecuteTask(PackageTaskModel task) private void ExecuteTask(PackageTaskModel task)
{ {
// 任务没有在运行状态 || 任务不可以执行 // 任务没有在运行状态 || 任务不可以执行 || 正在加载场景
if (!task.IsRunning || !task.CanExecute) if (!task.IsRunning || !task.CanExecute || ApplicationDomainEx.IsSceneLoading)
return; return;
List<string> updateMessage = new List<string>(); List<string> updateMessage = new List<string>();
......
...@@ -50,16 +50,16 @@ ...@@ -50,16 +50,16 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.Desktop.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Mvvm.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Mvvm.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Printing.v22.2.Core, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Core.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1.Extensions, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Core.v22.2.Extensions, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Docking.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Docking.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2.Core, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Extensions, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.2.Extensions, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="LiteDB, Version=5.0.15.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL"> <Reference Include="LiteDB, Version=5.0.15.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
<HintPath>..\packages\LiteDB.5.0.15\lib\net45\LiteDB.dll</HintPath> <HintPath>..\packages\LiteDB.5.0.15\lib\net45\LiteDB.dll</HintPath>
</Reference> </Reference>
...@@ -118,6 +118,10 @@ ...@@ -118,6 +118,10 @@
<Compile Include="ControlObject\FieldEdit\ViewModel\FieldEditViewModelBase.cs" /> <Compile Include="ControlObject\FieldEdit\ViewModel\FieldEditViewModelBase.cs" />
<Compile Include="ControlObject\FieldTree\Service\IFieldTreeService.cs" /> <Compile Include="ControlObject\FieldTree\Service\IFieldTreeService.cs" />
<Compile Include="Log\ViewModel\VizCommandWindowModel.cs" /> <Compile Include="Log\ViewModel\VizCommandWindowModel.cs" />
<Compile Include="Page\Core\Helper\PageViewModelHelper.cs" />
<Compile Include="Page\Core\View\PageLoadingWindow.xaml.cs">
<DependentUpon>PageLoadingWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Main\ViewModel\MainConnViewModel.cs" /> <Compile Include="Main\ViewModel\MainConnViewModel.cs" />
<Compile Include="Main\View\MainConnView.xaml.cs"> <Compile Include="Main\View\MainConnView.xaml.cs">
<DependentUpon>MainConnView.xaml</DependentUpon> <DependentUpon>MainConnView.xaml</DependentUpon>
...@@ -412,6 +416,10 @@ ...@@ -412,6 +416,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Page\Core\View\PageLoadingWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Main\View\MainConnView.xaml"> <Page Include="Main\View\MainConnView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
......
...@@ -21,24 +21,15 @@ namespace VIZ.Package.Service ...@@ -21,24 +21,15 @@ namespace VIZ.Package.Service
/// <param name="fields">控制字段</param> /// <param name="fields">控制字段</param>
public void SaveControlFields(PageModelBase pageBase, IList<ControlFieldNodeModel> fields) public void SaveControlFields(PageModelBase pageBase, IList<ControlFieldNodeModel> fields)
{ {
Guid id = Guid.Empty; Guid id = this.GetTemplateIdOrPageId(pageBase);
if (pageBase is PageTemplateModel template)
{
id = template.TemplateID;
}
else if (pageBase is PageModel page)
{
id = page.PageID;
}
ILiteCollection<ControlFieldEntity> collection = ApplicationDomainEx.ProjectDbContext.GetControlFiled(id);
collection.DeleteAll(); ApplicationDomainEx.ProjectDbContext.ControlField.DeleteMany(p => p.PageID == id);
List<ControlFieldEntity> list = new List<ControlFieldEntity>(); List<ControlFieldEntity> list = new List<ControlFieldEntity>();
foreach (ControlFieldNodeModel field in fields) foreach (ControlFieldNodeModel field in fields)
{ {
ControlFieldEntity entity = new ControlFieldEntity(); ControlFieldEntity entity = new ControlFieldEntity();
entity.PageID = id;
entity.FieldIdentifier = field.FieldIdentifier; entity.FieldIdentifier = field.FieldIdentifier;
entity.Value = field.Value; entity.Value = field.Value;
entity.Type = field.Type; entity.Type = field.Type;
...@@ -46,43 +37,24 @@ namespace VIZ.Package.Service ...@@ -46,43 +37,24 @@ namespace VIZ.Package.Service
list.Add(entity); list.Add(entity);
} }
collection.Insert(list); ApplicationDomainEx.ProjectDbContext.ControlField.Insert(list);
}
/// <summary>
/// 保存控制字段
/// </summary>
/// <param name="pageBase">页或模板</param>
/// <param name="fields">控制字段</param>
public void SaveControlFields(PageModelBase pageBase, IList<ControlFieldEntity> fields)
{
Guid id = Guid.Empty;
if (pageBase is PageTemplateModel template)
{
id = template.TemplateID;
}
else if (pageBase is PageModel page)
{
id = page.PageID;
}
ILiteCollection<ControlFieldEntity> collection = ApplicationDomainEx.ProjectDbContext.GetControlFiled(id);
collection.DeleteAll();
collection.Insert(fields);
} }
/// <summary> /// <summary>
/// 拷贝控制字段 /// 拷贝控制字段
/// </summary> /// </summary>
/// <param name="srcID">源ID</param> /// <param name="srcID">源ID</param>
/// <param name="distID">目标ID</param> /// <param name="dstID">目标ID</param>
public void CopyControlFields(Guid srcID, Guid distID) public void CopyControlFields(Guid srcID, Guid dstID)
{ {
ILiteCollection<ControlFieldEntity> srcCollection = ApplicationDomainEx.ProjectDbContext.GetControlFiled(srcID); var src = ApplicationDomainEx.ProjectDbContext.ControlField.Find(p => p.PageID == srcID).ToList();
ILiteCollection<ControlFieldEntity> dstCollection = ApplicationDomainEx.ProjectDbContext.GetControlFiled(distID); ApplicationDomainEx.ProjectDbContext.ControlField.DeleteMany(p => p.PageID == dstID);
src.ForEach(p =>
dstCollection.DeleteAll(); {
dstCollection.Insert(srcCollection.FindAll()); p.Id = 0;
p.PageID = dstID;
});
ApplicationDomainEx.ProjectDbContext.ControlField.Insert(src);
} }
/// <summary> /// <summary>
...@@ -92,19 +64,11 @@ namespace VIZ.Package.Service ...@@ -92,19 +64,11 @@ namespace VIZ.Package.Service
/// <returns>控制字段</returns> /// <returns>控制字段</returns>
public List<ControlFieldEntity> GetControlFields(PageModelBase pageBase) public List<ControlFieldEntity> GetControlFields(PageModelBase pageBase)
{ {
Guid id = Guid.Empty; Guid id = this.GetTemplateIdOrPageId(pageBase);
if (pageBase is PageTemplateModel template)
{
id = template.TemplateID;
}
else if (pageBase is PageModel page)
{
id = page.PageID;
}
ILiteCollection<ControlFieldEntity> collection = ApplicationDomainEx.ProjectDbContext.GetControlFiled(id); var result = ApplicationDomainEx.ProjectDbContext.ControlField.Find(p => p.PageID == id);
return collection.FindAll().ToList(); return result.ToList();
} }
/// <summary> /// <summary>
...@@ -127,5 +91,81 @@ namespace VIZ.Package.Service ...@@ -127,5 +91,81 @@ namespace VIZ.Package.Service
model.Value = entity.Value; model.Value = entity.Value;
} }
} }
/// <summary>
/// 保存控制对象
/// </summary>
/// <param name="pageBase">页或模板</param>
/// <param name="obj">控制对象</param>
/// <remarks>
/// 目前每个页只保留主控制对象
/// </remarks>
public void SaveControlObject(PageModelBase pageBase, ControlObjectModel obj)
{
Guid id = this.GetTemplateIdOrPageId(pageBase);
ControlObjectEntity entity = ApplicationDomainEx.ProjectDbContext.ControlObject.FindOne(p => p.PageID == id);
entity = entity ?? new ControlObjectEntity();
entity.PageID = id;
entity.TreeNodeName = obj.TreeNodeName;
entity.TreeNodePath = obj.TreeNodePath;
entity.Description = obj.Description;
entity.UseAllDirectors = obj.UseAllDirectors;
entity.FieldDetails = obj.FieldDetails;
ApplicationDomainEx.ProjectDbContext.ControlObject.Upsert(entity);
}
/// <summary>
/// 拷贝控制对象
/// </summary>
/// <param name="srcID">源ID</param>
/// <param name="dstID">目标ID</param>
public void CopyControlObjects(Guid srcID, Guid dstID)
{
var src = ApplicationDomainEx.ProjectDbContext.ControlObject.Find(p => p.PageID == srcID).ToList();
src.ForEach(p =>
{
p.Id = 0;
p.PageID = dstID;
});
ApplicationDomainEx.ProjectDbContext.ControlObject.DeleteMany(p => p.PageID == dstID);
ApplicationDomainEx.ProjectDbContext.ControlObject.Insert(src);
}
/// <summary>
/// 获取控制对象
/// </summary>
/// <param name="pageBase">页基类</param>
/// <returns>控制对象</returns>
public List<ControlObjectEntity> GetControlObject(PageModelBase pageBase)
{
Guid id = this.GetTemplateIdOrPageId(pageBase);
var result = ApplicationDomainEx.ProjectDbContext.ControlObject.Find(p => p.PageID == id).ToList();
return result;
}
/// <summary>
/// 获取模板ID或页ID
/// </summary>
/// <param name="pageBase">页基类</param>
/// <returns>模板ID或页ID</returns>
private Guid GetTemplateIdOrPageId(PageModelBase pageBase)
{
Guid id = Guid.Empty;
if (pageBase is PageTemplateModel template)
{
id = template.TemplateID;
}
else if (pageBase is PageModel page)
{
id = page.PageID;
}
return id;
}
} }
} }
...@@ -60,12 +60,14 @@ ...@@ -60,12 +60,14 @@
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Windows" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="DB\Conn\ConnService.cs" /> <Compile Include="DB\Conn\ConnService.cs" />
...@@ -75,6 +77,7 @@ ...@@ -75,6 +77,7 @@
<Compile Include="DB\Registry\RegistryService.cs" /> <Compile Include="DB\Registry\RegistryService.cs" />
<Compile Include="Logic\Plugin\PluginService.cs" /> <Compile Include="Logic\Plugin\PluginService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Viz\VizControlObjectDownloadService.cs" />
<Compile Include="Viz\GHResourceService.cs" /> <Compile Include="Viz\GHResourceService.cs" />
<Compile Include="Viz\GHService.cs" /> <Compile Include="Viz\GHService.cs" />
<Compile Include="Viz\VizCommandControlObjectService.cs" /> <Compile Include="Viz\VizCommandControlObjectService.cs" />
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Dynamic; using System.Dynamic;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
...@@ -34,6 +35,10 @@ namespace VIZ.Package.Service ...@@ -34,6 +35,10 @@ namespace VIZ.Package.Service
VizControlFieldType.font VizControlFieldType.font
}; };
// =======================================================================
// public Function
// =======================================================================
/// <summary> /// <summary>
/// 获取控制对象List列定义 /// 获取控制对象List列定义
/// </summary> /// </summary>
...@@ -211,65 +216,32 @@ namespace VIZ.Package.Service ...@@ -211,65 +216,32 @@ namespace VIZ.Package.Service
// Step 5. 获取第一个控制对象的字段描述 // Step 5. 获取第一个控制对象的字段描述
string fieldDetails = this.GetControlObjectResult(conn, obj.TreeNodePath); string fieldDetails = this.GetControlObjectResult(conn, obj.TreeNodePath);
obj.FieldDetails = fieldDetails ?? string.Empty;
foreach (string fieldDetail in fieldDetails.Split('\n')) // Step 6. 更新控制对象字段
{ this.UpdateControlObjectField(conn, obj, obj.FieldDetails, true);
// 返回示例: BTNAME:#10245*GEOM*TEXT:text:::-1:BTNAME:single_line, location_id=#10245, location=2/3/5
if (string.IsNullOrWhiteSpace(fieldDetail))
continue;
string[] pars = fieldDetail.Split(':');
string num = pars[1].Split('*').FirstOrDefault();
ControlFieldNodeModel node = new ControlFieldNodeModel();
node.FieldIdentifier = pars[0];
node.Route = node.FieldIdentifier.Split('.').ToList();
node.Num = num;
node.TypeSchema = pars[2];
node.Type = this.GetControlFieldType(node.TypeSchema);
node.Value = this.GetControlFieldValue(conn, obj.TreeNodePath, node.FieldIdentifier);
if (pars.Length >= 7)
{
node.Description = pars[6];
}
obj.AllFiledNodes.Add(node);
}
// Step 6. 根据字段FieldIdentifier构建树形结构
int count = 1;
List<ControlFieldNodeModel> fieldNodes = obj.AllFiledNodes.Where(p => p.Route.Count == count).ToList();
List<ControlFieldNodeModel> parents = fieldNodes;
while (true)
{
++count;
List<ControlFieldNodeModel> items = obj.AllFiledNodes.Where(p => p.Route.Count == count).ToList();
if (items.Count == 0)
break;
foreach (ControlFieldNodeModel item in items)
{
string parentFieldIdentifier = string.Join(".", item.Route.Take(count - 1));
ControlFieldNodeModel parent = parents.FirstOrDefault(p => p.FieldIdentifier == parentFieldIdentifier);
if (parent == null)
continue;
parent.Items.Add(item);
}
parents = items;
}
obj.FieldNodes = fieldNodes;
return obj; return obj;
} }
/// <summary> /// <summary>
/// 更新控制对象模型
/// </summary>
/// <param name="model">模型</param>
/// <param name="entity">实体</param>
public void UpdateControlObjectModel(ControlObjectModel model, ControlObjectEntity entity)
{
// Step 1. 获取第一个控制对象的信息
model.TreeNodePath = entity.TreeNodePath;
model.TreeNodeName = entity.TreeNodeName;
model.Description = entity.Description;
model.UseAllDirectors = entity.UseAllDirectors;
model.FieldDetails = entity.FieldDetails ?? string.Empty;
this.UpdateControlObjectField(null, model, model.FieldDetails, false);
}
/// <summary>
/// 获取控制对象参数 /// 获取控制对象参数
/// </summary> /// </summary>
/// <param name="conn">连接</param> /// <param name="conn">连接</param>
...@@ -408,12 +380,16 @@ namespace VIZ.Package.Service ...@@ -408,12 +380,16 @@ namespace VIZ.Package.Service
} }
} }
// =======================================================================
// Private Function
// =======================================================================
/// <summary> /// <summary>
/// 获取控制字段类型 /// 获取控制字段类型
/// </summary> /// </summary>
/// <param name="type">字段类型</param> /// <param name="type">字段类型</param>
/// <returns>控制对象字段类型</returns> /// <returns>控制对象字段类型</returns>
public VizControlFieldType GetControlFieldType(string type) private VizControlFieldType GetControlFieldType(string type)
{ {
if (type == "text") if (type == "text")
return VizControlFieldType.text; return VizControlFieldType.text;
...@@ -447,5 +423,73 @@ namespace VIZ.Package.Service ...@@ -447,5 +423,73 @@ namespace VIZ.Package.Service
return VizControlFieldType.none; return VizControlFieldType.none;
} }
/// <summary>
/// 更新控制对象字段
/// </summary>
/// <param name="conn">连接</param>
/// <param name="model">控制字段模型</param>
/// <param name="fieldDetails">字段描述</param>
/// <param name="isGetValueFromViz">是否从Viz获取字段值</param>
private void UpdateControlObjectField(ConnModel conn, ControlObjectModel model, string fieldDetails, bool isGetValueFromViz)
{
foreach (string fieldDetail in fieldDetails.Split('\n'))
{
// 返回示例: BTNAME:#10245*GEOM*TEXT:text:::-1:BTNAME:single_line, location_id=#10245, location=2/3/5
if (string.IsNullOrWhiteSpace(fieldDetail))
continue;
string[] pars = fieldDetail.Split(':');
string num = pars[1].Split('*').FirstOrDefault();
ControlFieldNodeModel node = new ControlFieldNodeModel();
node.FieldIdentifier = pars[0];
node.Route = node.FieldIdentifier.Split('.').ToList();
node.Num = num;
node.TypeSchema = pars[2];
node.Type = this.GetControlFieldType(node.TypeSchema);
if (isGetValueFromViz)
{
node.Value = this.GetControlFieldValue(conn, model.TreeNodePath, node.FieldIdentifier);
}
if (pars.Length >= 7)
{
node.Description = pars[6];
}
model.AllFiledNodes.Add(node);
}
// Step 6. 根据字段FieldIdentifier构建树形结构
int count = 1;
List<ControlFieldNodeModel> fieldNodes = model.AllFiledNodes.Where(p => p.Route.Count == count).ToList();
List<ControlFieldNodeModel> parents = fieldNodes;
while (true)
{
++count;
List<ControlFieldNodeModel> items = model.AllFiledNodes.Where(p => p.Route.Count == count).ToList();
if (items.Count == 0)
break;
foreach (ControlFieldNodeModel item in items)
{
string parentFieldIdentifier = string.Join(".", item.Route.Take(count - 1));
ControlFieldNodeModel parent = parents.FirstOrDefault(p => p.FieldIdentifier == parentFieldIdentifier);
if (parent == null)
continue;
parent.Items.Add(item);
}
parents = items;
}
model.FieldNodes = fieldNodes;
}
} }
} }
...@@ -244,7 +244,7 @@ namespace VIZ.Package.Service ...@@ -244,7 +244,7 @@ namespace VIZ.Package.Service
/// 开始动画 /// 开始动画
/// </summary> /// </summary>
/// <param name="conn">连接</param> /// <param name="conn">连接</param>
/// <param name="layer">层</param>s /// <param name="layer">层</param>
public void Start(ConnModel conn, VizLayer layer) public void Start(ConnModel conn, VizLayer layer)
{ {
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE START"); conn.EndpointManager.Send($"RENDERER*{layer}*STAGE START");
...@@ -303,5 +303,33 @@ namespace VIZ.Package.Service ...@@ -303,5 +303,33 @@ namespace VIZ.Package.Service
string sceneName = conn.EndpointManager.Request($"{scene}*NAME GET"); string sceneName = conn.EndpointManager.Request($"{scene}*NAME GET");
return sceneName; return sceneName;
} }
/// <summary>
/// 清理页
/// </summary>
/// <param name="conn">连接</param>
public void TakeClear(ConnModel conn)
{
conn.EndpointManager.Request("RENDERER*FRONT_LAYER SET_OBJECT");
conn.EndpointManager.Request("RENDERER*MAIN_LAYER SET_OBJECT");
conn.EndpointManager.Request("RENDERER*BACK_LAYER SET_OBJECT");
conn.EndpointManager.Request("SCENE CLEANUP");
conn.EndpointManager.Request("GEOM CLEANUP");
conn.EndpointManager.Request("IMAGE CLEANUP");
conn.EndpointManager.Request("FONT CLEANUP");
conn.EndpointManager.Request("MATERIAL CLEANUP");
conn.EndpointManager.Request("MAPS CACHE CLEANUP");
}
/// <summary>
/// 初始化页
/// </summary>
/// <param name="conn">连接</param>
/// <param name="scene">场景</param>
/// <returns>初始化返回</returns>
public string TakeInit(ConnModel conn, string scene)
{
return conn.EndpointManager.Request($"SCENE*{scene} LOAD");
}
} }
} }
using log4net;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Storage;
namespace VIZ.Package.Service
{
/// <summary>
/// Viz控制对象下载服务
/// </summary>
public class VizControlObjectDownloadService
{
/// <summary>
/// 日志
/// </summary>
private readonly static ILog log = LogManager.GetLogger(typeof(VizControlObjectDownloadService));
/// <summary>
/// Viz命令控制对象服务
/// </summary>
private VizCommandControlObjectService vizCommandControlObjectService = new VizCommandControlObjectService();
/// <summary>
/// Viz命令服务
/// </summary>
private VizCommandService vizCommandService = new VizCommandService();
/// <summary>
/// 控制对象服务
/// </summary>
private ControlObjectService controlObjectService = new ControlObjectService();
/// <summary>
/// 加载
/// </summary>
/// <param name="pageBases"></param>
public void Load(List<PageModelBase> pageBases)
{
// 停止更新
this.vizCommandService.SetEnabledUpdate(ApplicationDomainEx.PreviewConn, false);
// 更新场景
foreach (PageModelBase page in pageBases)
{
try
{
Debug.WriteLine($"加载场景 开始 [ {page.Scene} ]");
this.ExecuteLoadOnePage(page);
Debug.WriteLine($"加载场景 结束 [ {page.Scene} ]");
}
catch (Exception ex)
{
log.Error(ex);
}
}
// 启用更新
this.vizCommandService.SetEnabledUpdate(ApplicationDomainEx.PreviewConn, true);
}
/// <summary>
/// 执行加载
/// </summary>
/// <param name="pageBase">模板或页</param>
private void ExecuteLoadOnePage(PageModelBase pageBase)
{
if (pageBase == null)
return;
// 切换场景
this.vizCommandService.SetObject(ApplicationDomainEx.PreviewConn, pageBase.ScenePath, pageBase.Layer);
// 获取控制对象
ControlObjectModel controlObject = this.vizCommandControlObjectService.GetControlObject(ApplicationDomainEx.PreviewConn);
// 保存控制对象到本地
this.controlObjectService.SaveControlObject(pageBase, controlObject);
// 保存控制对象字段到本地
this.controlObjectService.SaveControlFields(pageBase, controlObject.AllFiledNodes);
}
}
}
...@@ -19,6 +19,11 @@ namespace VIZ.Package.Storage ...@@ -19,6 +19,11 @@ namespace VIZ.Package.Storage
public int Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// 所属模板ID或页ID
/// </summary>
public Guid PageID { get; set; }
/// <summary>
/// 字段名称 /// 字段名称
/// </summary> /// </summary>
public string FieldIdentifier { get; set; } public string FieldIdentifier { get; set; }
......
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// 控制对象实体
/// </summary>
public class ControlObjectEntity
{
/// <summary>
/// 编号
/// </summary>
[BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 所属模板ID或页ID
/// </summary>
public Guid PageID { get; set; }
/// <summary>
/// 所在场景节点名称
/// </summary>
public string TreeNodeName { get; set; }
/// <summary>
/// 所在场景节点路径
/// </summary>
public string TreeNodePath { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 使用所有的控制器
/// </summary>
public bool UseAllDirectors { get; set; }
/// <summary>
/// 字段描述
/// </summary>
public string FieldDetails { get; set; }
}
}
...@@ -37,6 +37,8 @@ namespace VIZ.Package.Storage ...@@ -37,6 +37,8 @@ namespace VIZ.Package.Storage
this.PageTemplate = this.Database.GetCollection<PageTemplateEntity>(); this.PageTemplate = this.Database.GetCollection<PageTemplateEntity>();
this.PageGroup = this.Database.GetCollection<PageGroupEntity>(); this.PageGroup = this.Database.GetCollection<PageGroupEntity>();
this.Page = this.Database.GetCollection<PageEntity>(); this.Page = this.Database.GetCollection<PageEntity>();
this.ControlField = this.Database.GetCollection<ControlFieldEntity>();
this.ControlObject = this.Database.GetCollection<ControlObjectEntity>();
} }
/// <summary> /// <summary>
...@@ -60,16 +62,14 @@ namespace VIZ.Package.Storage ...@@ -60,16 +62,14 @@ namespace VIZ.Package.Storage
public ILiteCollection<PageEntity> Page { get; private set; } public ILiteCollection<PageEntity> Page { get; private set; }
/// <summary> /// <summary>
/// 根据ID获取控制字段, ID 为 TemplateID 或者 PageID /// 控制字段
/// </summary> /// </summary>
/// <param name="id">TemplateID 或者 PageID</param> public ILiteCollection<ControlFieldEntity> ControlField { get; private set; }
/// <returns>控制字段</returns>
public ILiteCollection<ControlFieldEntity> GetControlFiled(Guid id)
{
string name = $"PAGE_{id.ToString().Replace("-", string.Empty)}";
return this.Database.GetCollection<ControlFieldEntity>(name); /// <summary>
} /// 控制对象
/// </summary>
public ILiteCollection<ControlObjectEntity> ControlObject { get; private set; }
/// <summary> /// <summary>
/// 销毁 /// 销毁
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
<Compile Include="Entity\Conn\ConnEntity.cs" /> <Compile Include="Entity\Conn\ConnEntity.cs" />
<Compile Include="Entity\Conn\ConnGroupEntity.cs" /> <Compile Include="Entity\Conn\ConnGroupEntity.cs" />
<Compile Include="Entity\ControlObject\ControlFieldEntity.cs" /> <Compile Include="Entity\ControlObject\ControlFieldEntity.cs" />
<Compile Include="Entity\ControlObject\ControlObjectEntity.cs" />
<Compile Include="Entity\Page\PageEntityBase.cs" /> <Compile Include="Entity\Page\PageEntityBase.cs" />
<Compile Include="Entity\Page\PageEntity.cs" /> <Compile Include="Entity\Page\PageEntity.cs" />
<Compile Include="Entity\Page\PageGroupEntity.cs" /> <Compile Include="Entity\Page\PageGroupEntity.cs" />
......
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.Desktop.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Printing.v22.2.Core, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Core.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<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>
......
<?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>{680C8D29-A993-492E-9E1A-DA80513ADBFE}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>VIZ.Package.WpfTest</RootNamespace>
<AssemblyName>VIZ.Package.WpfTest</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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>
<Prefer32Bit>true</Prefer32Bit>
</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>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, 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>
</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>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="MainWindowModel.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>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Common.Resource\VIZ.Framework.Common.Resource.csproj">
<Project>{76ef480a-e486-41b7-b7a5-2a849fc8d5bf}</Project>
<Name>VIZ.Framework.Common.Resource</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Common\VIZ.Framework.Common.csproj">
<Project>{92834c05-703e-4f05-9224-f36220939d8f}</Project>
<Name>VIZ.Framework.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Connection\VIZ.Framework.Connection.csproj">
<Project>{e07528dd-9dee-47c2-b79d-235ecfa6b003}</Project>
<Name>VIZ.Framework.Connection</Name>
</ProjectReference>
<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.Module\VIZ.Framework.Module.csproj">
<Project>{47cf6fb0-e37d-4ef1-afc7-03db2bca8892}</Project>
<Name>VIZ.Framework.Module</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.Package.Common\VIZ.Package.Common.csproj">
<Project>{e4912bce-bc90-4457-9ee3-06435496d979}</Project>
<Name>VIZ.Package.Common</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Connection\VIZ.Package.Connection.csproj">
<Project>{421527f6-37b8-4615-9317-ffd5e272181b}</Project>
<Name>VIZ.Package.Connection</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Domain\VIZ.Package.Domain.csproj">
<Project>{dbaeae47-1f2d-4b05-82c3-abf7cc33aa2d}</Project>
<Name>VIZ.Package.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Module.Resource\VIZ.Package.Module.Resource.csproj">
<Project>{327ea1f4-f23c-418a-a2ef-da4f1039b333}</Project>
<Name>VIZ.Package.Module.Resource</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Plugin\VIZ.Package.Plugin.csproj">
<Project>{9c7d3994-340a-480f-8d06-92c562137810}</Project>
<Name>VIZ.Package.Plugin</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Service\VIZ.Package.Service.csproj">
<Project>{bf693c2d-3de8-463b-8394-a0667dca7b42}</Project>
<Name>VIZ.Package.Service</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Storage\VIZ.Package.Storage.csproj">
<Project>{5bf08a07-9405-4f5d-a7f7-9d9ee17d6dd0}</Project>
<Name>VIZ.Package.Storage</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using DevExpress.Xpf.Core; using DevExpress.Xpf.Core;
using DevExpress.Xpf.Core.DragAndDrop;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Configuration; using System.Configuration;
...@@ -24,10 +25,11 @@ namespace VIZ.Package ...@@ -24,10 +25,11 @@ namespace VIZ.Package
public App() public App()
{ {
// 设置DevExpress主题 // 设置DevExpress主题
VizThemeThemePalette palette = new VizThemeThemePalette(); //VizThemeThemePalette palette = new VizThemeThemePalette();
Theme theme = Theme.CreateTheme(palette, Theme.VS2019Dark); //Theme theme = Theme.CreateTheme(palette, Theme.Win11Dark);
Theme.RegisterTheme(theme); //Theme.RegisterTheme(theme);
ApplicationThemeHelper.ApplicationThemeName = theme.Name; //ApplicationThemeHelper.ApplicationThemeName = theme.Name;
ApplicationThemeHelper.ApplicationThemeName = Theme.Win10DarkName;
// 初始化LiteDB // 初始化LiteDB
AppSetup.AppendSetup(new AppSetup_InitLiteDB()); AppSetup.AppendSetup(new AppSetup_InitLiteDB());
......
...@@ -58,11 +58,11 @@ ...@@ -58,11 +58,11 @@
<ApplicationIcon>logo.ico</ApplicationIcon> <ApplicationIcon>logo.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.Desktop.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Printing.v22.2.Core, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Core.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Themes.VS2019Dark.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Themes.VS2019Dark.v22.2, Version=22.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="LiteDB, Version=5.0.15.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL"> <Reference Include="LiteDB, Version=5.0.15.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
<HintPath>..\packages\LiteDB.5.0.15\lib\net45\LiteDB.dll</HintPath> <HintPath>..\packages\LiteDB.5.0.15\lib\net45\LiteDB.dll</HintPath>
</Reference> </Reference>
......
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