This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,182 @@
using System;
using System.Collections.Specialized;
using System.ComponentModel.Composition.Hosting;
using System.Configuration;
using System.IO;
using System.Runtime.InteropServices.ComTypes;
using System.Windows;
using System.Windows.Controls;
using DTS.Common;
using DTS.Common.Base;
using DTS.Common.Core.PluginLib;
using DTS.Common.Interface;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Prism.UnityExtensions;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Unity;
// ReSharper disable InconsistentNaming
// ReSharper disable ConvertToAutoProperty
namespace DTS.Viewer.PSDReport
{
/// <summary>
/// https://msdn.microsoft.com/en-us/library/ff921075(v=pandp.20).aspx
/// </summary>
public class Bootstrapper : UnityBootstrapper
{
private IRegionManager _regionManager;
private IUnityContainer _unityContainer => Container;
public IServiceLocator _ServiceLocator { get; private set; }
public IEventAggregator _EventAggregator { get; private set; }
private bool _standalone;
public bool Standalone
{
get => _standalone;
set => _standalone = value;
}
private string _customConfigPath = string.Empty;
public string CustomConfigPath { get => _customConfigPath; set => _customConfigPath = value; }
public Bootstrapper(bool standalone, string customConfigPath = "")
{
_customConfigPath = customConfigPath;
_standalone = standalone;
}
protected override void ConfigureContainer()
{
Container = ServiceLocator.Current.GetInstance<IUnityContainer>();
//if (Standalone)
//{ _unityContainer.RegisterType<IPSDReportMainView, PSDReportMainView>(); _unityContainer.RegisterType<IPSDReportMainViewModel, PSDReportMainViewModel>(new ContainerControlledLifetimeManager()); }
//else
//{ _unityContainer.RegisterType<IPSDReportMainViewGrid, PSDReportMainViewGrid>(); _unityContainer.RegisterType<IPSDReportMainViewModel, PSDReportMainViewModel>(new ContainerControlledLifetimeManager()); }
//_unityContainer.RegisterType<IPSDReportMainView, PSDReportMainView>();
_unityContainer.RegisterType<IPSDReportMainViewGrid, PSDReportMainViewGrid>();
_unityContainer.RegisterType<IPSDReportMainViewModel, PSDReportMainViewModel>(new ContainerControlledLifetimeManager());
base.ConfigureContainer();
}
protected override RegionAdapterMappings ConfigureRegionAdapterMappings()
{
//var regionAdapterMappings = base.ConfigureRegionAdapterMappings();
//re-implement base CRAM. doesn't catch already registered mappings
//https://prismlibrary.com/docs/wpf/legacy/Appendix-D-Extending-Prism.html#customizing-the-region-adapter-mappings
RegionAdapterMappings regionAdapterMappings = ServiceLocator.Current.GetInstance<RegionAdapterMappings>();
if (regionAdapterMappings != null)
{
try { regionAdapterMappings.RegisterMapping(typeof(System.Windows.Controls.Primitives.Selector), ServiceLocator.Current.GetInstance<SelectorRegionAdapter>()); } catch { }
try { regionAdapterMappings.RegisterMapping(typeof(ItemsControl), ServiceLocator.Current.GetInstance<ItemsControlRegionAdapter>()); } catch { }
try { regionAdapterMappings.RegisterMapping(typeof(ContentControl), ServiceLocator.Current.GetInstance<ContentControlRegionAdapter>()); } catch { }
}
if (Standalone) { try { regionAdapterMappings.RegisterMapping(typeof(StackPanel), ServiceLocator.Current.GetInstance<StackPanelRegionAdapter>()); } catch { } }
return regionAdapterMappings;
}
/// <summary>
/// The CreateShell method allows a developer to specify the top-level window for a Prism application.
/// The shell is usually the MainWindow or MainPage. Implement this method by returning an instance of
/// your application's shell class. In a Prism application, you can create the shell object, or resolve
/// it from the container, depending on your application's requirements.
/// </summary>
/// <returns></returns>
protected override DependencyObject CreateShell()
{
try
{
Container = ServiceLocator.Current.GetInstance<IUnityContainer>();
_EventAggregator = Container.Resolve<IEventAggregator>();
_ServiceLocator = Container.Resolve<IServiceLocator>();
var viewModel = _unityContainer.TryResolve<IPSDReportMainViewModel>();
if (viewModel == null) return new DependencyObject();
var view = viewModel.View;
// Registering region
if (!Container.IsRegistered<IRegionManager>()) return ServiceLocator.Current.GetInstance<PSDReportMainView>();
_regionManager = Container.Resolve<IRegionManager>();
foreach (var region in viewModel.GetRegions())
{
if (_regionManager.Regions.ContainsRegionWithName(region.Name)) continue;
_regionManager.Regions.Add(new Region { Name = region.Name, Context = region });
RegionManager.SetRegionManager(region, _regionManager);
RegionManager.UpdateRegions();
}
view.DataContext = viewModel;
//((ViewerMainView)view).Visibility = Visibility.Visible;
if (Standalone)
{
var parent = _unityContainer.Resolve<IShellViewModel>();
viewModel.Initialize(parent);
parent.ContextMainRegion = view;
}
else
{
viewModel.Initialize();
}
return (DependencyObject)view; //ServiceLocator.Current.GetInstance<MainView>();
}
catch (Exception e)
{
var s = e.Message;
}
return null;
}
/// <summary>
/// Returns the module catalog that will be used to initialize the modules.
/// </summary>
/// <returns>
/// An instance of <see cref="IModuleCatalog"/> that will be used to initialize the modules.
/// </returns>
protected override IModuleCatalog CreateModuleCatalog()
{
// The module catalog is used by the ModuleManager and ModuleLoader components, which are responsible for downloading the modules.
if (Container == null) Container = ServiceLocator.Current.GetInstance<IUnityContainer>();
var catalog = Container.TryResolve<IModuleCatalog>();
return catalog ?? new AggregateModuleCatalog();
}
/// <summary>
/// Modules are packages of functionality that can be independently developed, tested, and (optionally) deployed.
/// In a composite application, modules must be discovered and loaded at run time by the host application.
/// The module catalog is used by the ModuleManager and ModuleLoader components, which are responsible for downloading the modules.
/// Modules are copied to a directory as part of a post-build step. These modules are not referenced in the project and are discovered by inspecting a directory.
/// Module projects have a post-build step to copy themselves into that directory.
/// </summary>
protected override void ConfigureModuleCatalog()
{
var pluginFolders = string.Empty;
if (!Standalone) return;
var applicationSettings = ConfigurationManager.GetSection("DTS.Common.Core.PluginLib.Config");
foreach (FilterHashElement key in ((PluginConfigSectionHandler)applicationSettings).HashKeys) { if (key.Key != "viewerPlugins") continue; pluginFolders = key.Value; break; }
if (string.IsNullOrEmpty(pluginFolders)) return;
var directoryCatalog = new DirectoryModuleCatalog { ModulePath = pluginFolders };
((AggregateModuleCatalog)ModuleCatalog).AddCatalog(directoryCatalog);
}
protected override void InitializeModules()
{
if (!Standalone) return;
// Register the DTSRegionManager with Unity dependency injection container as a singleton.
Container.RegisterType<IDTSViewRegionManager, DTSViewRegionManager>(new ContainerControlledLifetimeManager(), new InjectionMember[] { });
base.InitializeModules();
}
}
}

View File

@@ -0,0 +1,170 @@
<?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>{3D57CA12-A637-4CDB-B673-D9A5FF0CF062}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DTS.Viewer.PSDReport</RootNamespace>
<AssemblyName>DTS.Viewer.PSDReport</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xaml.Behaviors">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Prism">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.dll</HintPath>
</Reference>
<Reference Include="Prism.Unity.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Unity.Wpf.dll</HintPath>
</Reference>
<Reference Include="Prism.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<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="Unity.Abstractions">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Unity.Container">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Container.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="Xceed.Wpf.AvalonDock">
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero">
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro">
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010">
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit">
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="PSDReportModule.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources\StringResources.Designer.cs">
<DependentUpon>StringResources.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Resources\TranslateExtension.cs" />
<Compile Include="ViewModel\PSDReportMainViewModel.cs" />
<Compile Include="View\PSDReportMainViewGrid.xaml.cs">
<DependentUpon>PSDReportMainViewGrid.xaml</DependentUpon>
</Compile>
<Compile Include="View\PSDReportMainView.xaml.cs">
<DependentUpon>PSDReportMainView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\DTS.Common.Calculations\DTS.Common.Calculations.csproj">
<Project>{5ce6f27b-1c5b-4101-88de-58a30b1e5f37}</Project>
<Name>DTS.Common.Calculations</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\DTS.Common.Core\DTS.Common.Core.csproj">
<Project>{fab1f470-1574-4301-b56e-d3364aa93679}</Project>
<Name>DTS.Common.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\DTS.Common.DAS.Concepts\DTS.Common.DAS.Concepts.csproj">
<Project>{ae3987f7-c4c6-40fb-a353-1a2dadef7a9a}</Project>
<Name>DTS.Common.DAS.Concepts</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\DTS.Common.SerializationPlus\DTS.Common.SerializationPlus.csproj">
<Project>{b9d1ac5b-7a6f-4b14-9ff8-3a1fc03519e2}</Project>
<Name>DTS.Common.SerializationPlus</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\DTS.Common.Serialization\DTS.Common.Serialization.csproj">
<Project>{0679d014-59c2-4327-b288-0e3bd1374710}</Project>
<Name>DTS.Common.Serialization</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\DTS.Common.SettingsDB\DTS.Common.Settings.csproj">
<Project>{61017104-d8ee-41d1-b9ca-dad863ff78b2}</Project>
<Name>DTS.Common.Settings</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\DTS.Common.Utilities\DTS.Common.Utilities.csproj">
<Project>{d6da1b74-c711-43c2-91b1-1908a8d04dbf}</Project>
<Name>DTS.Common.Utilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\DTS.Common\DTS.Common.csproj">
<Project>{f7a0804f-61a4-40ae-83d0-f1137622b592}</Project>
<Name>DTS.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\DataPRO\IService\IService.csproj">
<Project>{c9c45b72-05a3-4962-bc13-a78b1f4b1925}</Project>
<Name>IService</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\StringResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>StringResources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Page Include="View\PSDReportMainViewGrid.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\PSDReportMainView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Content Include="app.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,138 @@
using System;
using System.Windows.Media.Imaging;
using DTS.Common;
using DTS.Common.Events;
using DTS.Common.Interface;
using DTS.Viewer.PSDReport;
using Prism.Events;
using Prism.Ioc;
using Prism.Modularity;
using Unity;
using Unity.Lifetime;
[assembly: PSDReportModuleName()]
[assembly: PSDReportModuleImageAttribute()]
namespace DTS.Viewer.PSDReport
{
[Module(ModuleName = "PSDReport")]
public class PSDReportModule : IPSDReportModule
{
/// <summary>
/// Injected unity container
/// </summary>
private readonly IUnityContainer _unityContainer;
public bool SessionStarted { get; private set; }
public PSDReportModule(IUnityContainer unityContainer)
{
_unityContainer = unityContainer;
}
public void Initialize()
{
_unityContainer.RegisterType<IPSDReportModule, PSDReportModule>(new ContainerControlledLifetimeManager());
}
public void StartSession()
{
var eventAggregator = _unityContainer.Resolve<IEventAggregator>();
eventAggregator.GetEvent<LoadViewModulEvent>().Publish(new LoadViewModulArg());
SessionStarted = true;
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
Initialize();
}
public void OnInitialized(IContainerProvider containerProvider)
{
}
}
/// <summary>
/// Attribute class contains assembly name
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class PSDReportModuleNameAttribute : TextAttribute
{
public PSDReportModuleNameAttribute() : this(null) { }
public PSDReportModuleNameAttribute(string s)
{
AssemblyName = AssemblyNames.PSDReport.ToString();
}
public override string AssemblyName { get; }
public override Type GetAttributeType()
{
return typeof(TextAttribute);
}
public override string GetAssemblyName()
{
return AssemblyName;
}
}
/// <summary>
/// Attribute class contains assembly image and name - used on the Main screen to display available components
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class PSDReportModuleImageAttribute : ImageAttribute
{
private BitmapImage _img;
public PSDReportModuleImageAttribute() : this(null) { }
public override BitmapImage AssemblyImage
{
get { _img = AssemblyInfo.GetImage(AssemblyNames.PSDReport.ToString()); return _img; }
}
public PSDReportModuleImageAttribute(string s)
{
_img = AssemblyInfo.GetImage(AssemblyNames.PSDReport.ToString());
}
public override Type GetAttributeType()
{
return typeof(ImageAttribute);
}
public override BitmapImage GetAssemblyImage()
{
return AssemblyImage;
}
private string _name;
public override string AssemblyName
{
get { _name = AssemblyNames.PSDReport.ToString(); return _name; }
}
public override string GetAssemblyName()
{
return AssemblyName;
}
private string _group;
public override string AssemblyGroup
{
get { _group = eAssemblyGroups.Viewer.ToString(); return _group; }
}
public override string GetAssemblyGroup()
{
return AssemblyGroup;
}
private eAssemblyRegion _region;
public override eAssemblyRegion AssemblyRegion
{
get { _region = eAssemblyRegion.PSDReportRegion; return _region; }
}
public override eAssemblyRegion GetAssemblyRegion()
{
return AssemblyRegion;
}
}
}

View File

@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using DTS.Common.Events;
using DTS.Common.Core.PluginLib;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Unity;
// ReSharper disable EmptyConstructor
// ReSharper disable InconsistentNaming
namespace DTS.Viewer.PSDReport
{
/// <summary>
/// I think we need it...
/// </summary>
public class PSDReportSession
{
/// <summary>
/// Custom Bootstrapper
/// </summary>
///<remarks>
/// Do not try to re-create the bootstrapper. Once modules are loaded, they will be be loaded into the DirectoryModuleCatalog and each
/// Module initialization will not be called (thus no registered types).
/// It appears that the current bootstrapper loads around 40 MB into memory.
/// To completely unload the bootstrapper would take same research and effort.
/// </remarks>
private Bootstrapper _bootstrapper;
public IUnityContainer Container { get; private set; }
public IServiceLocator _serviceLocator { get; private set; }
public IEventAggregator _eventAggregator { get; private set; }
public IRegionManager _regionManager { get; private set; }
private string _customConfigPath = string.Empty;
public string CustomConfigPath { get => _customConfigPath; set => _customConfigPath = value; }
/// <summary>
/// empty constructor
/// </summary>
public PSDReportSession()
{
}
public void CreateSession(bool standalone, string customConfigPath = "")
{
CustomConfigPath = customConfigPath;
CreateBootstrapper(standalone, customConfigPath);
if (_bootstrapper == null) return;
Container = _bootstrapper.Container;
_eventAggregator = Container.Resolve<IEventAggregator>();
_serviceLocator = Container.Resolve<IServiceLocator>();
_regionManager = Container.Resolve<IRegionManager>();
//TODO: review publishPlugins vs base.InitializeModules();
publishPlugins(_eventAggregator, LoadPlugins());
}
private List<Assembly> LoadPlugins()
{
var pluginManager = PluginManager.GetPluginManager(CustomConfigPath);
return pluginManager.GetPluginList<IModule>();
}
private void publishPlugins(IEventAggregator eventAggregator, List<Assembly> pluginList)
{
eventAggregator.GetEvent<AssemblyListNotificationViewer>().Publish(new AssemblyListInfo(pluginList));
}
/// <summary>
/// Create bootstrapper for prism-based modules and views.
/// </summary>
/// <remarks>
/// Currently, there is no course of action for destroying the bootstrapper.
/// </remarks>
private void CreateBootstrapper(bool standalone, string customConfigPath = "")
{
if (_bootstrapper == null)
{
try
{
_bootstrapper = new Bootstrapper(standalone, customConfigPath);
_bootstrapper.Run();
}
catch (ApplicationException ex)
{
throw new Exception("Failed to create bootstrapper ", ex);
}
}
if (_bootstrapper == null)
{
throw new Exception("Failed to create Bootstrapper!");
}
}
/// <summary>
/// The Terminate method is called only when JMPS is in the process of shutting down.
/// If a component is just being closed, only the class destructor will be called.
/// Part of IComponent implementation.
/// </summary>
public void Terminate()
{
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DTS.Viewer.PSDReport")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DTS.Viewer.PSDReport")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3d57ca12-a637-4cdb-b673-d9a5ff0cf062")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,144 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DTS.Viewer.PSDReport.Resources {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class StringResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal StringResources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DTS.Viewer.PSDReport.Resources.StringResources", typeof(StringResources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Data.
/// </summary>
internal static string DataHeader {
get {
return ResourceManager.GetString("DataHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Data selection.
/// </summary>
internal static string DataSelectionHeader {
get {
return ResourceManager.GetString("DataSelectionHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Graphs .
/// </summary>
internal static string GraphsDefaultTitle {
get {
return ResourceManager.GetString("GraphsDefaultTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Modify.
/// </summary>
internal static string ModificationsHeader {
get {
return ResourceManager.GetString("ModificationsHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PSD.
/// </summary>
internal static string PSDHeader {
get {
return ResourceManager.GetString("PSDHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Results.
/// </summary>
internal static string PSDResultsHeader {
get {
return ResourceManager.GetString("PSDResultsHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PSD Settings.
/// </summary>
internal static string PSDSettingsHeader {
get {
return ResourceManager.GetString("PSDSettingsHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Settings.
/// </summary>
internal static string SettingsTitle {
get {
return ResourceManager.GetString("SettingsTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tests .
/// </summary>
internal static string TestsDefaultTitle {
get {
return ResourceManager.GetString("TestsDefaultTitle", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DataHeader" xml:space="preserve">
<value>Data</value>
</data>
<data name="DataSelectionHeader" xml:space="preserve">
<value>Data selection</value>
</data>
<data name="GraphsDefaultTitle" xml:space="preserve">
<value>Graphs </value>
</data>
<data name="ModificationsHeader" xml:space="preserve">
<value>Modify</value>
</data>
<data name="PSDHeader" xml:space="preserve">
<value>PSD</value>
</data>
<data name="PSDResultsHeader" xml:space="preserve">
<value>Results</value>
</data>
<data name="PSDSettingsHeader" xml:space="preserve">
<value>PSD Settings</value>
</data>
<data name="SettingsTitle" xml:space="preserve">
<value>Settings</value>
</data>
<data name="TestsDefaultTitle" xml:space="preserve">
<value>Tests </value>
</data>
</root>

View File

@@ -0,0 +1,21 @@
using System;
using System.Windows.Markup;
using DTS.Viewer.PSDReport.Resources;
namespace DTS.Viewer.PSDReport
{
[MarkupExtensionReturnType(typeof(string))]
public class TranslateExtension : MarkupExtension
{
private readonly string _key;
public TranslateExtension(string key) { _key = key; }
private const string NotFound = "#stringnotfound#";
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (string.IsNullOrEmpty(_key)) { return NotFound; }
return StringResources.ResourceManager.GetString(_key) ?? NotFound + " " + _key;
}
}
}

View File

@@ -0,0 +1,333 @@
<base:BaseView x:Class="DTS.Viewer.PSDReport.PSDReportMainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:interactionRequest="clr-namespace:DTS.Common.Interactivity;assembly=DTS.Common"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="Auto" Height="Auto" >
<base:BaseView.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:WidthConverter x:Key="WidthConverter" />
</base:BaseView.Resources>
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<toolkit:BusyIndicator IsBusy="{Binding IsBusy, UpdateSourceTrigger=PropertyChanged}" BusyContent="{Binding IsBusyMessage}" Visibility="Visible" >
<DockPanel x:Name="MainShell" FlowDirection="LeftToRight" LastChildFill="True" SnapsToDevicePixels="True" WindowChrome.ResizeGripDirection="TopLeft" >
<dock:DockingManager Name="DockManager" BorderBrush="Black" BorderThickness="1" AllowMixedOrientation="True" Style="{DynamicResource {x:Type dock:DockingManager}}"
ShowSystemMenu="False" UseLayoutRounding="False" IsManipulationEnabled="True"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" >
<dock:DockingManager.Resources>
<Style TargetType="{x:Type dock:LayoutDocumentTabItem}">
<Setter Property="Width" Value="100" />
</Style>
</dock:DockingManager.Resources>
<dock:DockingManager.Theme>
<dock:AeroTheme/>
</dock:DockingManager.Theme>
<dock:DockingManager.AnchorablePaneControlStyle>
<Style TargetType="{x:Type dock:LayoutAnchorablePaneControl}" >
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="TabStripPlacement" Value="Top"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="{Binding Model.Root.Manager.Foreground, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Background" Value="{Binding Model.Root.Manager.Background, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dock:LayoutAnchorablePaneControl}">
<Grid x:Name="grid" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Background="Transparent" Grid.RowSpan="2"/>
<Border Grid.Row="0" x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Cycle"/>
<dock:AnchorablePaneTabPanel Grid.Row="0" x:Name="HeaderPanel" Margin="0,0,2,2" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
<Grid Grid.Row="1">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource Self}}" Value="1">
<Setter Property="Margin" Value="0" TargetName="HeaderPanel"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="{x:Type TabItem}" >
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor4, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor5, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor12, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="ToolTip" Value="{Binding ToolTip}"/>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid SnapsToDevicePixels="True">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentSource="Header" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor2, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor3, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="1"/>
<Setter Property="Margin" Value="0,0,0,0"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor32, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor27, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="0"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor13, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor9, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="1">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableTabItem Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableControl Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</dock:DockingManager.AnchorablePaneControlStyle>
<dock:LayoutRoot x:Name="_layoutRoot" >
<dock:LayoutPanel Orientation="Horizontal" IsMaximized="True" DockHeight="*" >
<dock:LayoutAnchorablePane Name="NavigationPane" DockWidth="250" DockHeight="*">
<dock:LayoutAnchorable ContentId="NavigationRegionPanel" IsMaximized="True" AutoHideWidth="100" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="NavigationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}"
Width="250" VerticalAlignment="Stretch" HorizontalAlignment="Left">
<ContentControl.Template >
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Left"/>
<ContentPresenter Content="{TemplateBinding Content}" MinWidth="240" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutPanel Orientation="Vertical" IsMaximized="True" DockHeight="*" DockWidth="Auto">
<dock:LayoutAnchorablePane Name="GraphPane" DockWidth="*" DockHeight="*">
<dock:LayoutAnchorable CanAutoHide="False" CanClose="False" CanHide="False">
<ContentControl x:Name="GraphRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphsRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Height="Auto" Width="Auto" MinHeight="500" MinWidth="500">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutAnchorablePane Name="TestPane" DockMinHeight="100" DockWidth="*" DockHeight="*" >
<dock:LayoutAnchorable ContentId="TestRegionPanel" x:Name="TestRegionPanel" Title="Tests" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True" >
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestsRegion}"
Width="{Binding Path=ActualWidth, ElementName=TestPane, Converter={StaticResource WidthConverter}, ConverterParameter='1'}"
Height="{Binding Path=ActualHeight, ElementName=TestPane, Converter={StaticResource WidthConverter}, ConverterParameter='1'}"
VerticalAlignment="Top" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="GraphRegionPanel" x:Name="GraphListPanel" Title="Graphs" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True">
<ContentControl x:Name="GraphListRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphListRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="SettingsRegionPanel" x:Name="SettingsPanel" Title="Settings" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True">
<ContentControl x:Name="SettingsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerSettingsRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="LegendRegionPanel" Title="Legend" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True">
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
<dock:LayoutPanel Orientation="Vertical" DockWidth="320" DockMinWidth="300" DockHeight="Auto" >
<dock:LayoutAnchorablePane Name="DiagnosticPane" DockWidth="300" DockMinWidth="300" DockHeight="*" IsMaximized="True" >
<dock:LayoutAnchorable ContentId="DiagRegionPanel" Title="Diag" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="DiagRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerDiagRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="StatsRegionPanel" Title="Stats" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="StatsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerStatsRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="CursorRegionPanel" Title="Cursor" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="CursorRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerCursorRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutAnchorablePane Name="ModificationPane" DockWidth="300" DockMinWidth="300" DockHeight="*" IsMaximized="True" >
<dock:LayoutAnchorable ContentId="ChartOptionsPanel" Title="Display" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="ChartOptionsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerChartOptionsRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="ModifyRegionPanel" Title="Modify" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="TestModificationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestModificationRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="AddRegionPanel" Title="Add" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="AddRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyAddRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
</dock:LayoutPanel>
</dock:LayoutRoot>
</dock:DockingManager>
<!--</Grid>-->
</DockPanel>
</toolkit:BusyIndicator>
</base:BaseView>

View File

@@ -0,0 +1,47 @@
using DTS.Common.Interface;
// ReSharper disable CheckNamespace
// ReSharper disable ArrangeTypeMemberModifiers
// ReSharper disable UnusedMember.Local
// ReSharper disable UnusedParameter.Local
// ReSharper disable RedundantDefaultMemberInitializer
// ReSharper disable ConvertClosureToMethodGroup
// ReSharper disable PossibleNullReferenceException
namespace DTS.Viewer.PSDReport
{
/// <summary>
/// Interaction logic for PSDReportMainView.xaml
/// </summary>
public partial class PSDReportMainView : IPSDReportMainView
{
public PSDReportMainView()
{
InitializeComponent();
//this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
//this.Unloaded += new RoutedEventHandler(MainWindow_Unloaded);
}
//void MainWindow_Loaded(object sender, RoutedEventArgs e)
//{
// var serializer = new XmlLayoutSerializer(DockManager);
// serializer.LayoutSerializationCallback += (s, args) =>
// {
// args.Content = args.Content;
// };
// if (File.Exists(@".\DataProViewerAvalonDock.config"))
// serializer.Deserialize(@".\DataProViewerAvalonDock.config");
//}
//void MainWindow_Unloaded(object sender, RoutedEventArgs e)
//{
// var serializer = new XmlLayoutSerializer(DockManager);
// serializer.Serialize(@".\DataProViewerAvalonDock.config");
//}
}
}

View File

@@ -0,0 +1,199 @@
<base:BaseView x:Class="DTS.Viewer.PSDReport.PSDReportMainViewGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DTS.Viewer.PSDReport"
mc:Ignorable="d"
xmlns:prism="http://prismlibrary.com/"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:strings="clr-namespace:DTS.Viewer.PSDReport"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:interactionRequest="clr-namespace:DTS.Common.Interactivity;assembly=DTS.Common"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<Grid x:Name="MainShell" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" UseLayoutRounding="True" SnapsToDevicePixels="True" >
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="testsColumn" Width="310" />
<ColumnDefinition x:Name="separatorColumn" Width="5" />
<ColumnDefinition x:Name="graphsColumn" Width="*" />
<ColumnDefinition x:Name="optionsColumn" Width="310" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Nav-->
<Grid Grid.Column="0" Grid.Row="0" Visibility="Collapsed" >
<ContentControl x:Name="NavigationRegion" VerticalAlignment="Stretch" HorizontalAlignment="Left" Visibility="Collapsed">
<ContentControl.Template >
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Left"/>
<ContentPresenter Content="{TemplateBinding Content}" MinWidth="240" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</Grid>
<!-- FB12164, a repurposed FB11709 -->
<ToggleButton Grid.Column="0" Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Right" Panel.ZIndex="140" FontSize="8" AutomationProperties.AutomationId="btnCollapseNavPanel"
Height="15" Width="15" Background="{StaticResource Brush_ApplicationContentBackground}" Content="&lt;&lt;">
<ToggleButton.Triggers>
<EventTrigger RoutedEvent="ToggleButton.Unchecked">
<BeginStoryboard>
<Storyboard x:Name="ShowTabPanel">
<controls:GridLengthAnimation Storyboard.TargetName="testsColumn" Storyboard.TargetProperty="Width" From="15" Duration="0:0:0.1" FillBehavior="Stop" />
<DoubleAnimation Storyboard.TargetName="graphSelectionTabPane" Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:0.1" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Content">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="&lt;&lt;" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="ToggleButton.Checked">
<BeginStoryboard>
<Storyboard x:Name="HideTabPanel">
<controls:GridLengthAnimation Storyboard.TargetName="testsColumn" Storyboard.TargetProperty="Width" To="15" Duration="0:0:0.1" />
<DoubleAnimation Storyboard.TargetName="graphSelectionTabPane" Storyboard.TargetProperty="Opacity" From="1.0" To="0.0" Duration="0:0:0.1" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Content">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="&gt;&gt;" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ToggleButton.Triggers>
</ToggleButton>
<TabControl x:Name="graphSelectionTabPane" Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AutomationProperties.AutomationId="GraphSelectionTabPane">
<TabItem x:Name="testsTab" Header="{Binding Path=TitleTests}" AutomationProperties.AutomationId="TestsTab">
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestsRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem x:Name="graphsTab" Header="{Binding Path=TitleGraphs}" AutomationProperties.AutomationId="GraphsTab">
<ContentControl x:Name="GraphListRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphListRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem Header="{strings:TranslateExtension SettingsTitle}" Visibility="Collapsed" AutomationProperties.AutomationId="SettingsTab">
</TabItem>
<TabItem Header="Legend" Visibility="Collapsed" AutomationProperties.AutomationId="LegendTab">
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
</TabControl>
<GridSplitter Grid.Row="0" Grid.Column="1" VerticalAlignment="Stretch" Width="5" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns"/>
<!-- Graphs -->
<Grid Grid.Column="2" Grid.Row="0" x:Name="GraphsGrid" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Header="{strings:Translate DataSelectionHeader}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentControl x:Name="DataSelectRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PSDDataSelectRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</GroupBox>
<GroupBox Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Header="{strings:Translate PSDHeader}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentControl x:Name="GraphRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PSDGraphRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</GroupBox>
</Grid>
<!-- Results/Settings -->
<TabControl Grid.Column="3" Grid.Row="0" Width="310" HorizontalAlignment="Right" VerticalAlignment="Stretch" AutomationProperties.AutomationId="SettingsTabPane">
<TabItem x:Name="chartResultsTab" Header="{strings:TranslateExtension PSDResultsHeader}" AutomationProperties.AutomationId="ChartResTab">
<ContentControl x:Name="ReportResultsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ReportResultsRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" HorizontalContentAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem x:Name="psdSettingsTab" Header="{strings:TranslateExtension PSDSettingsHeader}" AutomationProperties.AutomationId="psdSettingsTab">
<ContentControl x:Name="SettingsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerSettingsRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" HorizontalContentAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem x:Name="chartOptTab" Header="{strings:TranslateExtension ChartOptionsHeader}" Visibility="Collapsed" AutomationProperties.AutomationId="ChartOptTab">
<StackPanel>
<ContentControl x:Name="ChartOptionsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerChartOptionsRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" HorizontalContentAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
<ContentControl x:Name="ReportChartOptionsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ReportChartOptionsRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" HorizontalContentAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</StackPanel>
</TabItem>
</TabControl>
</Grid>
</base:BaseView>

View File

@@ -0,0 +1,48 @@
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interface;
using Prism.Ioc;
using Prism.Events;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace DTS.Viewer.PSDReport
{
/// <summary>
/// Interaction logic for PSDReportMainViewGrid.xaml
/// </summary>
public partial class PSDReportMainViewGrid : IPSDReportMainViewGrid
{
public PSDReportMainViewGrid()
{
InitializeComponent();
Loaded += PSDReportMainViewGrid_Loaded;
}
private IEventAggregator _eventAggregator { get; set; }
private void SetFocus()
{
chartResultsTab.IsSelected = true;
chartResultsTab.Focusable = true;
chartResultsTab.Focus();
}
//FB 14797 Subscribe to event after the page loaded to make sure eventAggregator is available
private void PSDReportMainViewGrid_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
_eventAggregator = ContainerLocator.Container.Resolve<IEventAggregator>();
_eventAggregator?.GetEvent<GraphLoadedCountNotification>().Subscribe(OnGraphLoadedCountNotification);
}
//FB 14797 Set the focus to first tab (chartOptTab) after the graph is fully loaded (3 sec)
private void OnGraphLoadedCountNotification(GraphLoadedCountNotificationArg arg)
{
if (null != DataContext && (IBaseViewModel)DataContext != arg.ParentVM) return;
Task.Run(() =>
{
Thread.Sleep(TimeSpan.FromSeconds(3));
Dispatcher.BeginInvoke((Action)SetFocus);
});
}
}
}

View File

@@ -0,0 +1,443 @@
using DTS.Common.Base;
using DTS.Common.Enums;
using DTS.Common.Enums.Sensors;
using DTS.Common.Interface;
using System;
using System.Windows;
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading.Tasks;
using DTS.Common.Events;
using DTS.Viewer.PSDReport.Resources;
using DTS.Common.Utils;
using Prism.Events;
using Unity;
using Prism.Regions;
using DTS.Common.Interactivity;
namespace DTS.Viewer.PSDReport
{
public class PSDReportMainViewModel : BaseViewModel<IPSDReportMainViewModel>, IPSDReportMainViewModel
{
public IBaseView View { get; set; }
private IBaseWindowModel Parent { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the MainViewModel.
/// </summary>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The Unity container.</param>
public PSDReportMainViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
_unityContainer = unityContainer;
View = _unityContainer.Resolve<IPSDReportMainViewGrid>();
View.DataContext = this;
}
#region properties
public object ContextNavigationRegion
{
get => ((PSDReportMainViewGrid)View).NavigationRegion.Content;
set
{
((PSDReportMainViewGrid)View).NavigationRegion.Content = value;
OnPropertyChanged("ContextNavigationRegion");
}
}
public object ContextGraphsRegion { get => ((PSDReportMainViewGrid)View).GraphListRegion.Content; set { ((PSDReportMainViewGrid)View).GraphListRegion.Content = value; OnPropertyChanged("ContextGraphsRegion"); } }
public object ContextGraphListRegion { get => ((PSDReportMainViewGrid)View).GraphListRegion.Content; set { ((PSDReportMainViewGrid)View).GraphListRegion.Content = value; OnPropertyChanged("ContextGraphListRegion"); } }
public object ContextTestsRegion { get => ((PSDReportMainViewGrid)View).TestsRegion.Content; set { ((PSDReportMainViewGrid)View).TestsRegion.Content = value; OnPropertyChanged("ContextTestsRegion"); } }
public object ContextLegendRegion { get => ((PSDReportMainViewGrid)View).LegendRegion.Content; set { ((PSDReportMainViewGrid)View).LegendRegion.Content = value; OnPropertyChanged("ContextLegendRegion"); } }
public object ContextPropertyRegion { get; set; }
public object ContextChartOptionsRegion { get => ((PSDReportMainViewGrid)View).ChartOptionsRegion.Content; set { ((PSDReportMainViewGrid)View).ChartOptionsRegion.Content = value; OnPropertyChanged("ContextChartOptionsRegion"); } }
public object ContextViewerSettingsRegion { get => ((PSDReportMainViewGrid)View).SettingsRegion.Content; set { ((PSDReportMainViewGrid)View).SettingsRegion.Content = value; OnPropertyChanged("ContextViewerSettingsRegion"); } }
public object ContextReportDataSelectRegion { get => ((PSDReportMainViewGrid)View).DataSelectRegion.Content; set { ((PSDReportMainViewGrid)View).DataSelectRegion.Content = value; OnPropertyChanged("ContextReportDataSelectRegion"); } }
public object ContextGraphRegion { get => ((PSDReportMainViewGrid)View).GraphRegion.Content; set { ((PSDReportMainViewGrid)View).GraphRegion.Content = value; OnPropertyChanged("ContextGraphRegion"); } }
public object ContextReportChartOptionsRegion { get => ((PSDReportMainViewGrid)View).ReportChartOptionsRegion.Content; set { ((PSDReportMainViewGrid)View).ReportChartOptionsRegion.Content = value; OnPropertyChanged("ContextPSDChartOptionsRegion"); } }
public object ContextReportResultsRegion { get => ((PSDReportMainViewGrid)View).ReportResultsRegion.Content; set { ((PSDReportMainViewGrid)View).ReportResultsRegion.Content = value; OnPropertyChanged("ContextPSDResultsRegion"); } }
public string ConfigPath { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
#region Test Title
private string _titleTests = StringResources.TestsDefaultTitle;
public string TitleTests
{
get => _titleTests;
set
{
_titleTests = value;
OnPropertyChanged("TitleTests");
}
}
private int _totalSelectedTests = 0;
public int TotalSelectedTests
{
get => _totalSelectedTests;
set
{
_totalSelectedTests = value;
TitleTests = StringResources.TestsDefaultTitle + TotalSelectedTests + "/" + TotalLoadedTests;
if (_totalSelectedTests == 0) { TitleGraphs = StringResources.GraphsDefaultTitle; }
OnPropertyChanged("TotalSelectedTests");
}
}
private int _totalLoadedTests = 0;
public int TotalLoadedTests
{
get => _totalLoadedTests;
set { _totalLoadedTests = value; TitleTests = StringResources.TestsDefaultTitle + TotalSelectedTests + "/" + TotalLoadedTests; OnPropertyChanged("TotalLoadedTests"); }
}
#endregion Test Title
#region Graph Title
private string _titleGraphs = StringResources.GraphsDefaultTitle;
public string TitleGraphs
{
get => _titleGraphs;
set
{
_titleGraphs = value;
OnPropertyChanged("TitleGraphs");
}
}
private int _totalSelectedGraphs = 0;
public int TotalSelectedGraphs
{
get => _totalSelectedGraphs;
set { _totalSelectedGraphs = value; TitleGraphs = StringResources.GraphsDefaultTitle + TotalSelectedGraphs + "/" + TotalLoadedGraphs; OnPropertyChanged("TotalSelectedGraphs"); }
}
private int _totalLoadedGraphs = 0;
public int TotalLoadedGraphs
{
get => _totalLoadedGraphs;
set { _totalLoadedGraphs = value; TitleGraphs = StringResources.GraphsDefaultTitle + TotalSelectedGraphs + "/" + TotalLoadedGraphs; OnPropertyChanged("TotalLoadedGraphs"); }
}
#endregion Graph Title
private string _selectedDataFolder = string.Empty;
public string SelectedDataFolder
{
get => _selectedDataFolder;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFolder = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = _selectedDataFolder, File = string.Empty, SelectAll = false, ParentVM = this }); OnPropertyChanged("SelectedDataFolder");
}
}
public bool DoesUserHaveEditPermission { get; set; } = false;
private string _selectedDataFile = string.Empty;
public string SelectedDataFile
{
get => _selectedDataFile;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFile = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = string.Empty, File = _selectedDataFile, SelectAll = false, ParentVM = this }); OnPropertyChanged("SelectedDataFile");
}
}
private IsoViewMode _channelCodeViewMode = IsoViewMode.ISOAndUserCode;
public IsoViewMode ChannelCodeViewMode
{
get => _channelCodeViewMode;
set { _channelCodeViewMode = value; _eventAggregator.GetEvent<ChannelCodesViewChangedEvent>().Publish(value); OnPropertyChanged("ChannelCodeViewMode"); }
}
private CalibrationBehaviors _calibrationBehaviorSetting = CalibrationBehaviors.NonLinearIfAvailable;
public CalibrationBehaviors CalibrationBehaviorSetting
{
get => _calibrationBehaviorSetting;
set { _calibrationBehaviorSetting = value; _eventAggregator.GetEvent<CalibrationBehaviorSettingChangedEvent>().Publish(value); OnPropertyChanged("CalibrationBehaviorSetting"); }
}
private bool _calibrationBehaviorSettableInViewer = true;
public bool CalibrationBehaviorSettableInViewer
{
get => _calibrationBehaviorSettableInViewer;
set
{
_calibrationBehaviorSettableInViewer = value;
_eventAggregator.GetEvent<CalibrationBehaviorSettableInViewerChangedEvent>().Publish(value);
OnPropertyChanged("CalibrationBehaviorSettableInViewer");
//FB13946: Test tab should be the first if in Viewer Tile, graphs tab if in Run Test/Download
//CalibrationSettableInViewer is a proxy here for which tile we're in
((PSDReportMainViewGrid)View).graphsTab.IsSelected = !value;
((PSDReportMainViewGrid)View).testsTab.IsSelected = value;
//FB 14797 select first tab always to not switch when the graph is loading.
((PSDReportMainViewGrid)View).chartResultsTab.IsSelected = true;
((PSDReportMainViewGrid)View).chartResultsTab.Focusable = true;
((PSDReportMainViewGrid)View).chartResultsTab.Focus();
}
}
private Visibility _settingsVisibility = Visibility.Visible;
public Visibility SettingsVisibility
{
get => _settingsVisibility;
private set
{
_settingsVisibility = value;
OnPropertyChanged("SettingsVisibility");
}
}
private bool _isBusy = false;
/// <summary>
/// Display or hide Busy Indicator
/// </summary>
public new bool IsBusy { get => _isBusy; set { _isBusy = value; OnPropertyChanged("IsBusy"); } }
private string _isBusyMessage = string.Empty;
/// <summary>
/// Busy Message text
/// </summary>
public new string IsBusyMessage { get => _isBusyMessage; set { _isBusyMessage = value; OnPropertyChanged("IsBusyMessage"); } }
private bool _isMenuIncluded = false;
public new bool IsMenuIncluded { get => _isMenuIncluded; set { _isMenuIncluded = value; OnPropertyChanged("IsMenuIncluded"); } }
private bool _isNavigationIncluded = false;
public new bool IsNavigationIncluded { get => _isNavigationIncluded; set { _isNavigationIncluded = value; OnPropertyChanged("IsNavigationIncluded"); } }
public bool IsDirty => throw new NotImplementedException();
#endregion
#region methods
public List<System.Windows.FrameworkElement> GetRegions()
{
var items = new List<FrameworkElement>();
Utils.GetChildrenByName(((PSDReportMainViewGrid)View).MainShell, "Region", ref items);
return items;
}
/// <summary>
/// Initialize without parameter
/// </summary>
public override void Initialize()
{
Subscribe();
}
/// <summary>
/// Initialize with parameter - Parent
/// </summary>
public override void Initialize(object parameter)
{
Parent = (IBaseWindowModel)parameter;
Parent.IsMenuIncluded = _isMenuIncluded;
Parent.IsNavigationIncluded = _isNavigationIncluded;
Subscribe();
View.DataContext = this;
}
public void LeftKeyPress()
{
throw new NotImplementedException();
}
public void RightKeyPress()
{
throw new NotImplementedException();
}
public void ZoomReset()
{
_eventAggregator.GetEvent<ResetZoomChangedEvent>().Publish(true);
}
///<summary>
///Occurs when a property value changes.
///</summary>
public new event PropertyChangedEventHandler PropertyChanged;
private new void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); }
private void OnDataFileSelected(DataFileSelectionArg arg)
{
if (this != arg.ParentVM) return;
SelectAndIncludeDataFile(arg?.File);
}
public void SelectAndIncludeDataFile(string value)
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFile = value;
_eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg
{ Path = string.Empty, File = _selectedDataFile, SetSelected = true, SelectAll = false, ParentVM = this });
OnPropertyChanged("SelectedDataFile");
}
private void Subscribe()
{
_eventAggregator.GetEvent<LoadViewModulEvent>().Subscribe(OnLoadViewModul, ThreadOption.PublisherThread, true);
_eventAggregator.GetEvent<TestLoadedCountNotification>().Subscribe(OnTestLoadedChanged);
_eventAggregator.GetEvent<TestSummaryCountNotification>().Subscribe(OnTestSelectedCountChanged);
_eventAggregator.GetEvent<GraphLoadedCountNotification>().Subscribe(OnGraphLoadedCountChanged);
_eventAggregator.GetEvent<GraphSelectedChannelCountNotification>().Subscribe(OnGraphSelectedCountChanged);
_eventAggregator.GetEvent<DataFileSelectedEvent>().Subscribe(OnDataFileSelected);
_eventAggregator.GetEvent<GraphChannelsReadCompletedNotification>().Subscribe(OnGraphChannelsReadCompleted, ThreadOption.UIThread);
}
private void OnLoadViewModul(LoadViewModulArg arg)
{
IsBusy = true;
IsBusyMessage = "Loading view list";
if (null == ContextGraphRegion) ContextGraphRegion = GetGraphView(this, "Graph");
if (null == ContextReportDataSelectRegion) ContextReportDataSelectRegion = GetGraphView(this, "DataSelect");
if (null == ContextTestsRegion) ContextTestsRegion = GetTestDefinitionView(this);
if (null == ContextGraphListRegion) ContextGraphListRegion = GetGraphListView(this);
if (null == ContextChartOptionsRegion) ContextChartOptionsRegion = GetChartOptionsView(this, "DataSelect");
if (null == ContextReportChartOptionsRegion) ContextReportChartOptionsRegion = GetChartOptionsView(this, "Graph");
if (null == ContextReportResultsRegion) ContextReportResultsRegion = GetReportResultsView(this);
if (null == ContextViewerSettingsRegion) ContextViewerSettingsRegion = GetReportSettingsView(this);
IsBusy = false;
IsBusyMessage = string.Empty;
}
private void OnGraphLoadedCountChanged(GraphLoadedCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalLoadedGraphs = arg.LoadedCount;
}
private void OnGraphSelectedCountChanged(GraphSelectedChannelCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalSelectedGraphs = arg.SelectedChannelCount;
}
private void OnTestLoadedChanged(TestLoadedCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalLoadedTests = arg.LoadedCount;
}
private void OnTestSelectedCountChanged(TestSummaryCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalSelectedTests = arg.SummaryCount;
}
int reads = 0;
private void OnGraphChannelsReadCompleted(GraphChannelsReadCompletedNotificationArgs arg)
{
if (null == arg) { return; }
if (((IGraphView)ContextGraphRegion).DataContext != arg?.GraphVM &&
(((IGraphView)ContextReportDataSelectRegion).DataContext != arg?.GraphVM))
return;
if (arg.IsReadCompleted)
{
if (reads > 0) reads--;
if (reads == 0) _eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(false);
}
else
{
reads++;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(true);
}
}
#endregion
#region subscription methods
private void OnViewerSettingsVisibilityChanged(Visibility settingsVisibility)
{
SettingsVisibility = settingsVisibility;
}
#endregion
#region views
private INavigationView GetNavigationView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<INavigationView>();
var viewModel = _unityContainer.Resolve<INavigationViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private INavigationViewModel GetNavigationViewModel(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<INavigationView>();
var viewModel = _unityContainer.Resolve<INavigationViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return viewModel;
}
private IPSDReportResultsView GetReportResultsView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IPSDReportResultsView>();
var viewModel = _unityContainer.Resolve<IPSDReportResultsViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private IPSDReportSettingsView GetReportSettingsView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IPSDReportSettingsView>();
var viewModel = _unityContainer.Resolve<IPSDReportSettingsViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private IChartOptionsView GetChartOptionsView(IBaseViewModel parent, string chartType)
{
var view = _unityContainer.Resolve<IChartOptionsView>();
var viewModel = _unityContainer.Resolve<IChartOptionsViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(new Tuple<IBaseViewModel, string>(parent, chartType));
return view;
}
private IGraphView GetGraphView(IBaseViewModel parent, string graphType)
{
var view = _unityContainer.Resolve<IGraphView>();
var viewModel = _unityContainer.Resolve<IGraphViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(new Tuple<IBaseViewModel, string>(parent, graphType));
return view;
}
private IGraphMainView GetGraphListView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IGraphMainView>();
var viewModel = _unityContainer.Resolve<IGraphMainViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private IViewerSettingsView GetViewerSettingsView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IViewerSettingsView>();
var viewModel = _unityContainer.Resolve<IViewerSettingsViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private ITestSummaryListView GetTestDefinitionView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<ITestSummaryListView>();
var viewModel = _unityContainer.Resolve<ITestSummaryListViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
#endregion
}
}

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="DTS.Common.Core.PluginLib.Config" type="DTS.Common.Core.PluginLib.PluginConfigSectionHandler, DTS.Common.Core"/>
</configSections>
<!--<DTS.Common.Core.PluginLib.Config>
<PluginFolders>
<add key="viewerPlugins" value="..//..//..//..//RunTimeModules"/>
</PluginFolders>
</DTS.Common.Core.PluginLib.Config>-->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = "")]

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" requireReinstallation="true" />
</packages>

View File

@@ -0,0 +1,109 @@
<?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>{486AF003-0DEC-4B05-A7A5-39E6CA9EC629}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DTS.Viewer.PSDReportResults</RootNamespace>
<AssemblyName>DTS.Viewer.PSDReportResults</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xaml.Behaviors">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Prism">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.dll</HintPath>
</Reference>
<Reference Include="Prism.Unity.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Unity.Wpf.dll</HintPath>
</Reference>
<Reference Include="Prism.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Common\DTS.Common\lib\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xaml" />
<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="Unity.Abstractions">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Unity.Container">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Container.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PSDReportResultsModule.cs" />
<Compile Include="Resources\StringResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>StringResources.resx</DependentUpon>
</Compile>
<Compile Include="Resources\TranslateExtension.cs" />
<Compile Include="ViewModel\PSDReportResultsViewModel.cs" />
<Compile Include="View\PSDReportResultsView.xaml.cs">
<DependentUpon>PSDReportResultsView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\StringResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>StringResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Page Include="View\PSDReportResultsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\DTS.Common\DTS.Common.csproj">
<Project>{f7a0804f-61a4-40ae-83d0-f1137622b592}</Project>
<Name>DTS.Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,127 @@
using System;
using System.Windows.Media.Imaging;
using DTS.Common;
using DTS.Common.Interface;
using DTS.Viewer.PSDReportResults;
using Prism.Ioc;
using Prism.Modularity;
using Unity;
[assembly: PSDReportResultsModuleName()]
[assembly: PSDReportResultsModuleImageAttribute()]
namespace DTS.Viewer.PSDReportResults
{
[Module(ModuleName = "PSDReportResults")]
public class PSDReportResultsModule : IModule
{
/// <summary>
/// Injected unity container
/// </summary>
private readonly IUnityContainer _unityContainer;
public PSDReportResultsModule(IUnityContainer unityContainer)
{
_unityContainer = unityContainer;
}
public void Initialize()
{
_unityContainer.RegisterType<IPSDReportResultsViewModel, PSDReportResultsViewModel>();
_unityContainer.RegisterType<IPSDReportResultsView, PSDReportResultsView>();
}
public void OnInitialized(IContainerProvider containerProvider)
{
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
Initialize();
}
}
/// <summary>
/// Attribute class contains assembly name
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class PSDReportResultsModuleNameAttribute : TextAttribute
{
public PSDReportResultsModuleNameAttribute() : this(null) { }
public PSDReportResultsModuleNameAttribute(string s)
{
AssemblyName = AssemblyNames.PSDReportResults.ToString();
}
public override string AssemblyName { get; }
public override Type GetAttributeType()
{
return typeof(TextAttribute);
}
public override string GetAssemblyName()
{
return AssemblyName;
}
}
/// <summary>
/// Attribute class contains assembly image and name - used on the Main screen to display available components
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class PSDReportResultsModuleImageAttribute : ImageAttribute
{
private BitmapImage _img;
public PSDReportResultsModuleImageAttribute() : this(null) { }
public override BitmapImage AssemblyImage
{
get { _img = AssemblyInfo.GetImage(AssemblyNames.PSDReportResults.ToString()); return _img; }
}
public PSDReportResultsModuleImageAttribute(string s)
{
_img = AssemblyInfo.GetImage(AssemblyNames.PSDReportResults.ToString());
}
public override Type GetAttributeType()
{
return typeof(ImageAttribute);
}
public override BitmapImage GetAssemblyImage()
{
return AssemblyImage;
}
private string _name;
public override string AssemblyName
{
get { _name = AssemblyNames.PSDReportResults.ToString(); return _name; }
}
public override string GetAssemblyName()
{
return AssemblyName;
}
private string _group;
public override string AssemblyGroup
{
get { _group = eAssemblyGroups.Viewer.ToString(); return _group; }
}
public override string GetAssemblyGroup()
{
return AssemblyGroup;
}
private eAssemblyRegion _region;
public override eAssemblyRegion AssemblyRegion
{
get { _region = eAssemblyRegion.PSDReportResultsRegion; return _region; }
}
public override eAssemblyRegion GetAssemblyRegion()
{
return AssemblyRegion;
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DTS.Viewer.PSDReportResults")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DTS.Viewer.PSDReportResults")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("486af003-0dec-4b05-a7a5-39e6ca9ec629")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,126 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DTS.Viewer.PSDReportResults.Resources {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class StringResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal StringResources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DTS.Viewer.PSDReportResults.Resources.StringResources", typeof(StringResources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Name.
/// </summary>
internal static string ChannelName {
get {
return ResourceManager.GetString("ChannelName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export.
/// </summary>
internal static string ExportPSDHeader {
get {
return ResourceManager.GetString("ExportPSDHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export PSD to CSV.
/// </summary>
internal static string ExportPSDtoCSV {
get {
return ResourceManager.GetString("ExportPSDtoCSV", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export PSD to PDF.
/// </summary>
internal static string ExportPSDtoPDF {
get {
return ResourceManager.GetString("ExportPSDtoPDF", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to GRMS.
/// </summary>
internal static string GRMS {
get {
return ResourceManager.GetString("GRMS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Results.
/// </summary>
internal static string PSDResultsHeader {
get {
return ResourceManager.GetString("PSDResultsHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sample Rate.
/// </summary>
internal static string SampleRate {
get {
return ResourceManager.GetString("SampleRate", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ChannelName" xml:space="preserve">
<value>Name</value>
</data>
<data name="ExportPSDHeader" xml:space="preserve">
<value>Export</value>
</data>
<data name="ExportPSDtoCSV" xml:space="preserve">
<value>Export PSD to CSV</value>
</data>
<data name="ExportPSDtoPDF" xml:space="preserve">
<value>Export PSD to PDF</value>
</data>
<data name="GRMS" xml:space="preserve">
<value>GRMS</value>
</data>
<data name="PSDResultsHeader" xml:space="preserve">
<value>Results</value>
</data>
<data name="SampleRate" xml:space="preserve">
<value>Sample Rate</value>
</data>
</root>

View File

@@ -0,0 +1,21 @@
using System;
using System.Windows.Markup;
using DTS.Viewer.PSDReportResults.Resources;
namespace DTS.Viewer.PSDReportResults
{
[MarkupExtensionReturnType(typeof(string))]
public class TranslateExtension : MarkupExtension
{
private readonly string _key;
public TranslateExtension(string key) { _key = key; }
private const string NotFound = "#stringnotfound#";
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (string.IsNullOrEmpty(_key)) { return NotFound; }
return StringResources.ResourceManager.GetString(_key) ?? NotFound + " " + _key;
}
}
}

View File

@@ -0,0 +1,61 @@
<base:BaseView x:Class="DTS.Viewer.PSDReportResults.PSDReportResultsView"
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"
mc:Ignorable="d"
xmlns:strings="clr-namespace:DTS.Viewer.PSDReportResults"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common">
<base:BaseView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/DTS.Common;component/Themes/CommonStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<converters:IsGreaterThanConverter x:Key="IsGreaterThanConverter" />
</ResourceDictionary>
</base:BaseView.Resources>
<StackPanel>
<GroupBox Header="{strings:TranslateExtension ExportPSDHeader}" Margin="5,0,5,0" AutomationProperties.AutomationId="PSDExportGrpBx"
HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" IsEnabled="{Binding Results.Count, Converter={StaticResource IsGreaterThanConverter}, ConverterParameter=0}">
<Button Content="{strings:TranslateExtension ExportPSDtoPDF}" Margin="10" Padding="10, 5" Command="{Binding ExportToPDFCommand}" AutomationProperties.AutomationId="ExportToPDFBtn" />
<Button Content="{strings:TranslateExtension ExportPSDtoCSV}" Margin="10" Padding="10, 5" Command="{Binding ExportToCSVCommand}" AutomationProperties.AutomationId="ExportToCSVBtn" />
</StackPanel>
</GroupBox>
<GroupBox Header="{strings:TranslateExtension PSDResultsHeader}" Margin="5,0,5,0" AutomationProperties.AutomationId="PSDResultsGrpBx"
HorizontalAlignment="Stretch">
<ListView Grid.Row="1" HorizontalAlignment="Stretch" ItemsSource="{Binding Results, UpdateSourceTrigger=PropertyChanged}" AutomationProperties.AutomationId="ResultsListView" SelectionMode="Single" GridViewColumnHeader.Click="GridViewColumnHeader_OnClick">
<ListView.View>
<controls:AutoSizedGridView AutomationProperties.AutomationId="GRMSResultsGridView">
<GridViewColumn AutomationProperties.AutomationId="ChannelName">
<controls:GridViewColumnHeaderSearchable Tag="ChannelName" HeaderTitle="{strings:TranslateExtension ChannelName}" Search="GridViewColumnHeaderSearchable_OnSearch" ClickHandler="GridViewColumnHeader_OnClick" ListviewId="{Binding ListViewId}"/>
<GridViewColumn.CellTemplate>
<ItemContainerTemplate>
<TextBlock Text="{Binding ChannelName,FallbackValue='ChannelName'}" AutomationProperties.AutomationId="ChannelNameLbl"/>
</ItemContainerTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn AutomationProperties.AutomationId="SampleRate">
<controls:GridViewColumnHeaderSearchable Tag="SampleRate" HeaderTitle="{strings:TranslateExtension SampleRate}" Search="GridViewColumnHeaderSearchable_OnSearch" ClickHandler="GridViewColumnHeader_OnClick" ListviewId="{Binding ListViewId}"/>
<GridViewColumn.CellTemplate>
<ItemContainerTemplate>
<TextBlock Text="{Binding SampleRate,FallbackValue='SampleRate',StringFormat='N0', TargetNullValue='---'}" AutomationProperties.AutomationId="SampleRateLbl" />
</ItemContainerTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn AutomationProperties.AutomationId="GRMS">
<controls:GridViewColumnHeaderSearchable Tag="GRMS" HeaderTitle="{strings:TranslateExtension GRMS}" Search="GridViewColumnHeaderSearchable_OnSearch" ClickHandler="GridViewColumnHeader_OnClick" ListviewId="{Binding ListViewId}"/>
<GridViewColumn.CellTemplate>
<ItemContainerTemplate>
<TextBlock Text="{Binding GRMS,FallbackValue='GRMS'}" AutomationProperties.AutomationId="GRMSLbl" />
</ItemContainerTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</controls:AutoSizedGridView>
</ListView.View>
</ListView>
</GroupBox>
</StackPanel>
</base:BaseView>

View File

@@ -0,0 +1,25 @@
using DTS.Common.Interface;
namespace DTS.Viewer.PSDReportResults
{
/// <summary>
/// Interaction logic for PSDReportResultsView.xaml
/// </summary>
public partial class PSDReportResultsView : IPSDReportResultsView
{
public PSDReportResultsView()
{
InitializeComponent();
}
private void GridViewColumnHeader_OnClick(object sender, System.Windows.RoutedEventArgs e)
{
}
private void GridViewColumnHeaderSearchable_OnSearch(object sender, System.Windows.RoutedEventArgs e)
{
}
}
}

View File

@@ -0,0 +1,96 @@
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interactivity;
using DTS.Common.Interface;
using DTS.Common.Utils;
using Prism.Commands;
using Prism.Events;
using Prism.Regions;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Unity;
namespace DTS.Viewer.PSDReportResults
{
public class PSDReportResultsViewModel : BaseViewModel<IPSDReportResultsViewModel>, IPSDReportResultsViewModel
{
#region properties / fields
public IBaseView View { get; set; }
public IBaseViewModel Parent { get; set; }
public ObservableCollection<IChannelGRMSSummary> Results { get; set; }
private string Directory { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private new IRegionManager _regionManager { get; set; }
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
#endregion
/// <summary>
/// Creates a new instance of the MainViewModel.
/// </summary>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The Unity container.</param>
public PSDReportResultsViewModel(IPSDReportSettingsView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
View = view;
View.DataContext = this;
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
_unityContainer = unityContainer;
_regionManager = regionManager;
}
public override void Initialize(object parameter)
{
Parent = (IBaseViewModel)parameter;
Results = new ObservableCollection<IChannelGRMSSummary>();
Subscribe();
}
private void Subscribe()
{
_eventAggregator.GetEvent<PSDReportGRMSValuesUpdatedEvent>().Subscribe(OnGRMSValuesUpdated, ThreadOption.UIThread);
_eventAggregator.GetEvent<GraphSelectedChannelsNotification>().Subscribe(OnGraphSelectedChannelsChanged);
}
private void OnGRMSValuesUpdated(PSDReportGRMSValuesUpdatedEventArg arg)
{
if (Parent != arg.ParentVM) return;
Results.Clear();
foreach (var val in arg.Values)
{
Results.Add(val);
}
}
private void OnGraphSelectedChannelsChanged(GraphSelectedChannelsNotificationArg arg)
{
if (Parent != arg?.ParentVM) return;
var channels = arg?.SelectedChannels ?? new System.Collections.Generic.List<ITestChannel>();
Directory = channels.Count > 0 ? channels[0].BinaryFilePath.ReplaceLast("Binary", "Reports") : string.Empty;
}
private DelegateCommand _exportToPDFCommand;
public DelegateCommand ExportToPDFCommand => _exportToPDFCommand ?? (_exportToPDFCommand = new DelegateCommand(ExportToPDFMethod));
private void ExportToPDFMethod()
{
_eventAggregator.GetEvent<SaveReportToPDFRequestedEvent>().Publish(new SaveReportToPDFRequestedEventArgs() { Directory = Directory, ParentVM = Parent });
}
private DelegateCommand _exportToCSVCommand;
public DelegateCommand ExportToCSVCommand => _exportToCSVCommand ?? (_exportToCSVCommand = new DelegateCommand(ExportToCSVMethod));
private void ExportToCSVMethod()
{
_eventAggregator.GetEvent<SaveReportToCSVRequestedEvent>().Publish(new SaveReportToCSVRequestedEventArgs() { Directory = Directory, ParentVM = Parent });
}
}
}

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = "")]

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@@ -0,0 +1,114 @@
<?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>{82FAAE11-3BE9-4223-BEB8-8A53643866F8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DTS.Viewer.PSDReportSettings</RootNamespace>
<AssemblyName>DTS.Viewer.PSDReportSettings</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xaml.Behaviors">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Prism">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.dll</HintPath>
</Reference>
<Reference Include="Prism.Unity.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Unity.Wpf.dll</HintPath>
</Reference>
<Reference Include="Prism.Wpf">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Common\DTS.Common\lib\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xaml" />
<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="Unity.Abstractions">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Unity.Container">
<HintPath>..\..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Container.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="Xceed.Wpf.Toolkit, Version=3.8.19076.18510, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Model\PSDReportSettingsModel.cs" />
<Compile Include="PSDReportSettingsModule.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources\StringResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>StringResources.resx</DependentUpon>
</Compile>
<Compile Include="Resources\TranslateExtension.cs" />
<Compile Include="ViewModel\PSDReportSettingsViewModel.cs" />
<Compile Include="View\PSDReportSettingsView.xaml.cs">
<DependentUpon>PSDReportSettingsView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\DTS.Common\DTS.Common.csproj">
<Project>{f7a0804f-61a4-40ae-83d0-f1137622b592}</Project>
<Name>DTS.Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\StringResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>StringResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Page Include="View\PSDReportSettingsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,72 @@
using DTS.Common.Enums.Viewer.Reports;
using DTS.Common.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DTS.Viewer.PSDReportSettings
{
public class PSDReportSettingsModel : Common.Base.BasePropertyChanged, IPSDReportSettingsModel
{
private IPSDReportSettingsViewModel _parent;
public IPSDReportSettingsViewModel Parent { get => _parent; set { if (_parent != null && _parent.Equals(value)) return; _parent = value; OnPropertyChanged("Parent"); } }
private bool _canPublishChanges = true;
public bool CanPublishChanges { get => _canPublishChanges; set { _canPublishChanges = value; OnPropertyChanged("CanPublishChanges"); } }
private bool _lowPassFilterEnabled = false;
public bool LowPassFilterEnabled { get => _lowPassFilterEnabled; set { ReadData = true; SetProperty(ref _lowPassFilterEnabled, value, "LowPassFilterEnabled"); } }
private double _lowPassFilterFrequency = 2000;
public double LowPassFilterFrequency { get => _lowPassFilterFrequency; set { ReadData = true; SetProperty(ref _lowPassFilterFrequency, value, "LowPassFilterFrequency"); } }
private PassFilterType _lowPassFilterType = PassFilterType.Butterworth;
public PassFilterType LowPassFilterType { get => _lowPassFilterType; set { ReadData = true; SetProperty(ref _lowPassFilterType, value, "LowPassFilterType"); } }
private int _lowPassFilterOrder = 8;
public int LowPassFilterOrder { get => _lowPassFilterOrder; set { ReadData = true; SetProperty(ref _lowPassFilterOrder, value, "LowPassFilterOrder"); } }
private bool _highPassFilterEnabled = false;
public bool HighPassFilterEnabled { get => _highPassFilterEnabled; set { ReadData = true; SetProperty(ref _highPassFilterEnabled, value, "HighPassFilterEnabled"); } }
private double _highPassFilterFrequency = 5;
public double HighPassFilterFrequency { get => _highPassFilterFrequency; set { ReadData = true; SetProperty(ref _highPassFilterFrequency, value, "HighPassFilterFrequency"); } }
private PassFilterType _highPassFilterType = PassFilterType.Butterworth;
public PassFilterType HighPassFilterType { get => _highPassFilterType; set { ReadData = true; SetProperty(ref _highPassFilterType, value, "HighPassFilterType"); } }
private int _highPassFilterOrder = 8;
public int HighPassFilterOrder { get => _highPassFilterOrder; set { ReadData = true; SetProperty(ref _highPassFilterOrder, value, "HighPassFilterOrder"); } }
private WindowWidth _windowWidth = WindowWidth.FortyNinetySix;
public WindowWidth WindowWidth { get => _windowWidth; set { ReadData = true; SetProperty(ref _windowWidth, value, "WindowWidth"); } }
private WindowType _windowType = WindowType.Hanning;
public WindowType WindowType { get => _windowType; set { ReadData = true; SetProperty(ref _windowType, value, "WindowType"); } }
private WindowAveragingType _windowAveragingType = WindowAveragingType.Averaging;
public WindowAveragingType WindowAveragingType { get => _windowAveragingType; set { ReadData = true; SetProperty(ref _windowAveragingType, value, "WindowAveragingType"); } }
private double _windowOverlappingPercent = 50;
public double WindowOverlappingPercent { get => _windowOverlappingPercent; set { ReadData = true; SetProperty(ref _windowOverlappingPercent, value, "WindowOverlappingPercent"); } }
private bool _showEnvelope = false;
public bool ShowEnvelope { get => _showEnvelope; set { ReadData = true; SetProperty(ref _showEnvelope, value, "ShowEnvelope"); } }
public bool IsSaved { get; }
private bool _readData = false;
public bool ReadData { get => _readData; set => SetProperty(ref _readData, value, "ReadData"); }
private double _dataStart = 0D;
public double DataStart { get => _dataStart; set { ReadData = true; SetProperty(ref _dataStart, value, "DataStart"); } }
private double _dataEnd = 0D;
public double DataEnd { get => _dataEnd; set { ReadData = true; SetProperty(ref _dataEnd, value, "DataEnd"); } }
public override event PropertyChangedEventHandler PropertyChanged;
public override void OnPropertyChanged(string propertyName)
{
var handler = PropertyChanged;
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
if (propertyName == "CanPublishChanges"
|| propertyName == "Parent"
|| propertyName == "ReadData") return;
if (CanPublishChanges) { Parent?.PublishChanges(); }
}
}
}

View File

@@ -0,0 +1,129 @@
using System;
using System.Windows.Media.Imaging;
using DTS.Common;
using DTS.Common.Interface;
using DTS.Viewer.PSDReportSettings;
using Prism.Ioc;
using Prism.Modularity;
using Unity;
[assembly: PSDReportSettingsModuleName()]
[assembly: PSDReportSettingsModuleImageAttribute()]
namespace DTS.Viewer.PSDReportSettings
{
[Module(ModuleName = "PSDReportSettings")]
public class PSDReportSettingsModule : IModule
{
/// <summary>
/// Injected unity container
/// </summary>
private readonly IUnityContainer _unityContainer;
public PSDReportSettingsModule(IUnityContainer unityContainer)
{
_unityContainer = unityContainer;
}
public void Initialize()
{
_unityContainer.RegisterType<IPSDReportSettingsViewModel, PSDReportSettingsViewModel>();
_unityContainer.RegisterType<IPSDReportSettingsModel, PSDReportSettingsModel>();
_unityContainer.RegisterType<IPSDReportSettingsView, PSDReportSettingsView>();
}
public void OnInitialized(IContainerProvider containerProvider)
{
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
Initialize();
}
}
/// <summary>
/// Attribute class contains assembly name
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class PSDReportSettingsModuleNameAttribute : TextAttribute
{
public PSDReportSettingsModuleNameAttribute() : this(null) { }
public PSDReportSettingsModuleNameAttribute(string s)
{
AssemblyName = AssemblyNames.PSDReportSettings.ToString();
}
public override string AssemblyName { get; }
public override Type GetAttributeType()
{
return typeof(TextAttribute);
}
public override string GetAssemblyName()
{
return AssemblyName;
}
}
/// <summary>
/// Attribute class contains assembly image and name - used on the Main screen to display available components
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class PSDReportSettingsModuleImageAttribute : ImageAttribute
{
private BitmapImage _img;
public PSDReportSettingsModuleImageAttribute() : this(null) { }
public override BitmapImage AssemblyImage
{
get { _img = AssemblyInfo.GetImage(AssemblyNames.PSDReportSettings.ToString()); return _img; }
}
public PSDReportSettingsModuleImageAttribute(string s)
{
_img = AssemblyInfo.GetImage(AssemblyNames.PSDReportSettings.ToString());
}
public override Type GetAttributeType()
{
return typeof(ImageAttribute);
}
public override BitmapImage GetAssemblyImage()
{
return AssemblyImage;
}
private string _name;
public override string AssemblyName
{
get { _name = AssemblyNames.PSDReportSettings.ToString(); return _name; }
}
public override string GetAssemblyName()
{
return AssemblyName;
}
private string _group;
public override string AssemblyGroup
{
get { _group = eAssemblyGroups.Viewer.ToString(); return _group; }
}
public override string GetAssemblyGroup()
{
return AssemblyGroup;
}
private eAssemblyRegion _region;
public override eAssemblyRegion AssemblyRegion
{
get { _region = eAssemblyRegion.PSDReportSettingsRegion; return _region; }
}
public override eAssemblyRegion GetAssemblyRegion()
{
return AssemblyRegion;
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DTS.Viewer.PSDReportSettings")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DTS.Viewer.PSDReportSettings")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("82faae11-3be9-4223-beb8-8a53643866f8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,252 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DTS.Viewer.PSDReportSettings.Resources {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class StringResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal StringResources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DTS.Viewer.PSDReportSettings.Resources.StringResources", typeof(StringResources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Envelope.
/// </summary>
internal static string EnvelopeHeader {
get {
return ResourceManager.GetString("EnvelopeHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export.
/// </summary>
internal static string ExportPSDHeader {
get {
return ResourceManager.GetString("ExportPSDHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export PSD to CSV.
/// </summary>
internal static string ExportPSDtoCSV {
get {
return ResourceManager.GetString("ExportPSDtoCSV", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Export PSD to PDF.
/// </summary>
internal static string ExportPSDtoPDF {
get {
return ResourceManager.GetString("ExportPSDtoPDF", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Center frequency.
/// </summary>
internal static string FilterCenterFrequency {
get {
return ResourceManager.GetString("FilterCenterFrequency", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Filter order.
/// </summary>
internal static string FilterOrder {
get {
return ResourceManager.GetString("FilterOrder", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Filters.
/// </summary>
internal static string FilterSettingsHeader {
get {
return ResourceManager.GetString("FilterSettingsHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Filter type.
/// </summary>
internal static string FilterType {
get {
return ResourceManager.GetString("FilterType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bessel.
/// </summary>
internal static string FilterType_Bessel {
get {
return ResourceManager.GetString("FilterType_Bessel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Butterworth.
/// </summary>
internal static string FilterType_Butterworth {
get {
return ResourceManager.GetString("FilterType_Butterworth", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Linkwitz-Riley.
/// </summary>
internal static string FilterType_LinkwitzRiley {
get {
return ResourceManager.GetString("FilterType_LinkwitzRiley", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to High pass filter.
/// </summary>
internal static string HighPassFilter {
get {
return ResourceManager.GetString("HighPassFilter", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Hz.
/// </summary>
internal static string Hz {
get {
return ResourceManager.GetString("Hz", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Low pass filter.
/// </summary>
internal static string LowPassFilter {
get {
return ResourceManager.GetString("LowPassFilter", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PSD settings.
/// </summary>
internal static string PSDSettingsHeader {
get {
return ResourceManager.GetString("PSDSettingsHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show Envelope.
/// </summary>
internal static string ShowEnvelope {
get {
return ResourceManager.GetString("ShowEnvelope", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Averaging type.
/// </summary>
internal static string WindowAveragingType {
get {
return ResourceManager.GetString("WindowAveragingType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Overlapping %.
/// </summary>
internal static string WindowOverlappingPercent {
get {
return ResourceManager.GetString("WindowOverlappingPercent", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Window.
/// </summary>
internal static string WindowSettingsHeader {
get {
return ResourceManager.GetString("WindowSettingsHeader", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Window type.
/// </summary>
internal static string WindowType {
get {
return ResourceManager.GetString("WindowType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Window width.
/// </summary>
internal static string WindowWidth {
get {
return ResourceManager.GetString("WindowWidth", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="EnvelopeHeader" xml:space="preserve">
<value>Envelope</value>
</data>
<data name="ExportPSDHeader" xml:space="preserve">
<value>Export</value>
</data>
<data name="ExportPSDtoCSV" xml:space="preserve">
<value>Export PSD to CSV</value>
</data>
<data name="ExportPSDtoPDF" xml:space="preserve">
<value>Export PSD to PDF</value>
</data>
<data name="FilterCenterFrequency" xml:space="preserve">
<value>Center frequency</value>
</data>
<data name="FilterOrder" xml:space="preserve">
<value>Filter order</value>
</data>
<data name="FilterSettingsHeader" xml:space="preserve">
<value>Filters</value>
</data>
<data name="FilterType" xml:space="preserve">
<value>Filter type</value>
</data>
<data name="FilterType_Bessel" xml:space="preserve">
<value>Bessel</value>
</data>
<data name="FilterType_Butterworth" xml:space="preserve">
<value>Butterworth</value>
</data>
<data name="FilterType_LinkwitzRiley" xml:space="preserve">
<value>Linkwitz-Riley</value>
</data>
<data name="HighPassFilter" xml:space="preserve">
<value>High pass filter</value>
</data>
<data name="Hz" xml:space="preserve">
<value>Hz</value>
</data>
<data name="LowPassFilter" xml:space="preserve">
<value>Low pass filter</value>
</data>
<data name="PSDSettingsHeader" xml:space="preserve">
<value>PSD settings</value>
</data>
<data name="ShowEnvelope" xml:space="preserve">
<value>Show Envelope</value>
</data>
<data name="WindowAveragingType" xml:space="preserve">
<value>Averaging type</value>
</data>
<data name="WindowOverlappingPercent" xml:space="preserve">
<value>Overlapping %</value>
</data>
<data name="WindowSettingsHeader" xml:space="preserve">
<value>Window</value>
</data>
<data name="WindowType" xml:space="preserve">
<value>Window type</value>
</data>
<data name="WindowWidth" xml:space="preserve">
<value>Window width</value>
</data>
</root>

View File

@@ -0,0 +1,21 @@
using System;
using System.Windows.Markup;
using DTS.Viewer.PSDReportSettings.Resources;
namespace DTS.Viewer.PSDReportSettings
{
[MarkupExtensionReturnType(typeof(string))]
public class TranslateExtension : MarkupExtension
{
private readonly string _key;
public TranslateExtension(string key) { _key = key; }
private const string NotFound = "#stringnotfound#";
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (string.IsNullOrEmpty(_key)) { return NotFound; }
return StringResources.ResourceManager.GetString(_key) ?? NotFound + " " + _key;
}
}
}

View File

@@ -0,0 +1,128 @@
<base:BaseView x:Class="DTS.Viewer.PSDReportSettings.PSDReportSettingsView"
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:sys="clr-namespace:System;assembly=mscorlib"
xmlns:xc="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
mc:Ignorable="d"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:enums="clr-namespace:DTS.Common.Enums;assembly=DTS.Common"
xmlns:reports="clr-namespace:DTS.Common.Enums.Viewer.Reports;assembly=DTS.Common"
xmlns:strings="clr-namespace:DTS.Viewer.PSDReportSettings">
<base:BaseView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/DTS.Common;component/Themes/CommonStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- ReSharper disable once Xaml.RedundantResource -->
<converters:BooleanToOpacityConverter x:Key="BooleanToOpacityConverter" />
<!-- ReSharper disable once Xaml.RedundantResource -->
<converters:EnumBooleanConverter x:Key="EnumBooleanConverter" />
<converters:InverseBooleanToOpacityConverter x:Key="InverseBooleanToOpacityConverter" />
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
<converters:BooleanToColorConverter x:Key="InvertedBooleanToAttentionBackgroundColorConverter" Background="True" Inverted="True" AttentionBrush="True" />
<Style TargetType="TextBlock" BasedOn="{StaticResource PageContentTextStyle}">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<sys:Double x:Key="PASS_FILTER_FREQ_MIN">0</sys:Double>
<sys:Double x:Key="PASS_FILTER_ORDER_MIN">2</sys:Double>
<sys:Double x:Key="PASS_FILTER_ORDER_MAX">16</sys:Double>
<sys:Double x:Key="WINDOW_OVERLAP_PCT_MIN">0</sys:Double>
<sys:Double x:Key="WINDOW_OVERLAP_PCT_MAX">100</sys:Double>
</ResourceDictionary>
</base:BaseView.Resources>
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Top">
<GroupBox Header="{strings:TranslateExtension PSDSettingsHeader}" Margin="5,0,5,0" AutomationProperties.AutomationId="PSDSettingsGrpBx"
HorizontalAlignment="Stretch">
<StackPanel Orientation="Vertical" HorizontalAlignment="Stretch">
<GroupBox Header="{strings:TranslateExtension FilterSettingsHeader}" Margin="5,0,5,0" AutomationProperties.AutomationId="FilterSettingsGrpBx"
HorizontalAlignment="Stretch" >
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="5" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<CheckBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{strings:Translate LowPassFilter}" IsChecked="{Binding Model.LowPassFilterEnabled, Mode=TwoWay}" />
<TextBlock Grid.Row="1" Grid.Column="0" Text="{strings:Translate FilterCenterFrequency}" />
<xc:DoubleUpDown Grid.Row="1" Grid.Column="1" FormatString="N1" Increment="1" Minimum="{StaticResource PASS_FILTER_FREQ_MIN}" Maximum="{x:Static sys:Double.MaxValue}"
ClipValueToMinMax="True" Value="{Binding Model.LowPassFilterFrequency}" UpdateValueOnEnterKey="True"
AutomationProperties.AutomationId="upd_LPFFreq" />
<TextBlock Grid.Row="1" Grid.Column="2" Text="{strings:Translate Hz}" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="{strings:Translate FilterType}" />
<ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
ItemsSource="{Binding Source={enums:EnumBindingSourceExtension {x:Type reports:PassFilterType}}}"
SelectedItem="{Binding Model.LowPassFilterType}" AutomationProperties.AutomationId="cmb_LPFType" />
<TextBlock Grid.Row="3" Grid.Column="0" Text="{strings:Translate FilterOrder}" />
<xc:DoubleUpDown Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" FormatString="N0" Increment="1" Minimum="{StaticResource PASS_FILTER_ORDER_MIN}" Maximum="{StaticResource PASS_FILTER_ORDER_MAX}"
ClipValueToMinMax="True" Value="{Binding Model.LowPassFilterOrder}" UpdateValueOnEnterKey="True"
AutomationProperties.AutomationId="upd_LPFOrder"/>
<CheckBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Content="{strings:Translate HighPassFilter}" IsChecked="{Binding Model.HighPassFilterEnabled, Mode=TwoWay}" />
<TextBlock Grid.Row="6" Grid.Column="0" Text="{strings:Translate FilterCenterFrequency}" />
<xc:DoubleUpDown Grid.Row="6" Grid.Column="1" FormatString="N1" Increment="1" Minimum="{StaticResource PASS_FILTER_FREQ_MIN}" Maximum="{x:Static sys:Double.MaxValue}"
ClipValueToMinMax="True" Value="{Binding Model.HighPassFilterFrequency}" UpdateValueOnEnterKey="True"
AutomationProperties.AutomationId="upd_HPFFreq" />
<TextBlock Grid.Row="6" Grid.Column="2" Text="{strings:Translate Hz}" />
<TextBlock Grid.Row="7" Grid.Column="0" Text="{strings:Translate FilterType}" />
<ComboBox Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="2"
ItemsSource="{Binding Source={enums:EnumBindingSourceExtension {x:Type reports:PassFilterType}}}"
SelectedItem="{Binding Model.HighPassFilterType}" AutomationProperties.AutomationId="cmb_HPFType" />
<TextBlock Grid.Row="8" Grid.Column="0" Text="{strings:Translate FilterOrder}" />
<xc:DoubleUpDown Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="2" FormatString="N0" Increment="1" Minimum="{StaticResource PASS_FILTER_ORDER_MIN}" Maximum="{StaticResource PASS_FILTER_ORDER_MAX}"
ClipValueToMinMax="True" Value="{Binding Model.HighPassFilterOrder}" UpdateValueOnEnterKey="True"
AutomationProperties.AutomationId="upd_HPFOrder" />
</Grid>
</GroupBox>
<GroupBox Header="{strings:TranslateExtension WindowSettingsHeader}" Margin="5,0,5,0" AutomationProperties.AutomationId="FilterSettingsGrpBx"
HorizontalAlignment="Stretch">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{strings:Translate WindowWidth}" />
<ComboBox Grid.Row="0" Grid.Column="1"
ItemsSource="{Binding Source={enums:EnumBindingSourceExtension {x:Type reports:WindowWidth}}}"
SelectedItem="{Binding Model.WindowWidth}" />
<TextBlock Grid.Row="1" Grid.Column="0" Text="{strings:Translate WindowType}" />
<ComboBox Grid.Row="1" Grid.Column="1"
ItemsSource="{Binding Source={enums:EnumBindingSourceExtension {x:Type reports:WindowType}}}"
SelectedItem="{Binding Model.WindowType}" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="{strings:Translate WindowOverlappingPercent}" />
<xc:DoubleUpDown Grid.Row="2" Grid.Column="1" FormatString="N0" Increment="1" Minimum="{StaticResource WINDOW_OVERLAP_PCT_MIN}" Maximum="{StaticResource WINDOW_OVERLAP_PCT_MAX}"
ClipValueToMinMax="True" Value="{Binding Model.WindowOverlappingPercent}"
AutomationProperties.AutomationId="upd_WindowOverlapPercent" UpdateValueOnEnterKey="True" />
<TextBlock Grid.Row="3" Grid.Column="0" Text="{strings:Translate WindowAveragingType}" />
<ComboBox Grid.Row="3" Grid.Column="1"
ItemsSource="{Binding Source={enums:EnumBindingSourceExtension {x:Type reports:WindowAveragingType}}}"
SelectedItem="{Binding Model.WindowAveragingType}" />
</Grid>
</GroupBox>
</StackPanel>
</GroupBox>
<GroupBox Header="{strings:TranslateExtension EnvelopeHeader}" Margin="5,0,5,0" AutomationProperties.AutomationId="EnvelopeGrpBx"
HorizontalAlignment="Stretch">
<CheckBox Content="{strings:Translate ShowEnvelope}" IsChecked="{Binding Model.ShowEnvelope, Mode=TwoWay}" />
</GroupBox>
</StackPanel>
</base:BaseView>

View File

@@ -0,0 +1,27 @@
using DTS.Common.Interface;
using System.Collections.Generic;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace DTS.Viewer.PSDReportSettings
{
/// <summary>
/// Interaction logic for PSDReportSettingsView.xaml
/// </summary>
public partial class PSDReportSettingsView : IPSDReportSettingsView
{
public PSDReportSettingsView()
{
InitializeComponent();
}
//private IItemsSource _availablePassFilterTypes = new DTS.Common.Enums.Viewer.Reports.PassFilterTypeEnumItemSource();
//public List<string> AvailablePassFilterTypes => _availablePassFilterTypes;
//private IItemsSource _availableWindowAveragingTypes = new DTS.Common.Enums.Viewer.Reports.WindowAveragingTypeEnumItemSource();
//public IItemsSource AvailableWindowAveragingTypes => _availableWindowAveragingTypes;
//private IItemsSource _availableWindowTypes = new DTS.Common.Enums.Viewer.Reports.WindowTypeEnumItemSource();
//public IItemsSource AvailableWindowTypes => _availableWindowTypes;
public List<int> AvailableWindowWidths => new List<int>() { 512, 1024, 2048, 4096, 8192 };
}
}

View File

@@ -0,0 +1,131 @@
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interactivity;
using DTS.Common.Interface;
using Prism.Events;
using Prism.Regions;
using System;
using System.Threading.Tasks;
using Unity;
namespace DTS.Viewer.PSDReportSettings
{
public class PSDReportSettingsViewModel : BaseViewModel<IPSDReportSettingsModel>, IPSDReportSettingsViewModel
{
public IBaseView View { get; set; }
//public bool Standalone { get; set; }
public IBaseViewModel Parent { get; set; }
private IPSDReportSettingsModel _model;
public new IPSDReportSettingsModel Model { get => _model; set { _model = value; OnPropertyChanged("Model"); } }
private IEventAggregator _eventAggregator { get; set; }
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the MainViewModel.
/// </summary>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The Unity container.</param>
public PSDReportSettingsViewModel(IPSDReportSettingsView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
View = view;
View.DataContext = this;
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
_unityContainer = unityContainer;
}
#region Methods
public override void Initialize()
{
}
public override void Initialize(object parameter)
{
Parent = (IBaseViewModel)parameter;
Subscribe();
Model = _unityContainer.Resolve<IPSDReportSettingsModel>();
Model.Parent = this;
//View.DataContext = Model;
}
private void Subscribe()
{
//_eventAggregator.GetEvent<CursorsAlailableChangedEvent>().Subscribe(OnCursorsAlailableChanged);
_eventAggregator.GetEvent<GraphSelectedChannelsNotification>().Subscribe(OnGraphSelectedChannelsChanged);
_eventAggregator.GetEvent<GraphClearNotification>().Subscribe(OnGraphCleared);
_eventAggregator.GetEvent<ChartAxisChangedEvent>().Subscribe(OnChartAxisChanged);
}
private void OnChartAxisChanged(ChartAxisChangedEventArg arg)
{
if (arg?.ParentVM != Parent) return;
switch (arg.Axis)
{
case "Y":
//Model.MinFixedY = args.MinValue;
//Model.MaxFixedY = args.MaxValue;
break;
case "X":
Model.CanPublishChanges = false;
Model.DataStart = arg.MinValue;
Model.DataEnd = arg.MaxValue;
Model.CanPublishChanges = true;
PublishChanges();
break;
}
//throw new NotImplementedException();
}
private void OnGraphCleared(GraphClearNotificationArg obj)
{
//Graph's been cleared. Init our settings
Model.ReadData = false;
PublishChanges();
}
private void OnGraphSelectedChannelsChanged(GraphSelectedChannelsNotificationArg arg)
{
if (Parent != arg?.ParentVM) return;
var channels = arg.SelectedChannels;
Model.Parent = this;
//PublishChanges();
}
/// <summary>
/// Private Event handler for RaiseNotification event.
/// </summary>
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
{
// Notification object expects a NotificationContentEventArgsWithoutTitle object and a Title string.
var eventArgsWithoutTitle = new NotificationContentEventArgs(eventArgsWithTitle.Message, eventArgsWithTitle.MessageDetails, eventArgsWithTitle.Image);
NotificationRequest.Raise(new Notification
{
Content = eventArgsWithoutTitle,
Title = eventArgsWithTitle.Title
});
}
public void PublishChanges()
{
_eventAggregator.GetEvent<PSDReportSettingsChangedEvent>().Publish(new PSDReportSettingsChangedEventArg() { Model = Model, ParentVM = Parent });
}
#endregion
}
}

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = "")]

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]