diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-11-03 09:16:24 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-11-03 09:16:24 +0200 |
| commit | bcfaaf57b60a63acacf0651f5a69b45304abc132 (patch) | |
| tree | a8f7166e9b522af1af019c636825659ae1a84c44 /Software/Visual_Studio | |
| parent | b93d7795c84da2e5317fd12d9a41cdd63fcb6659 (diff) | |
| download | Tango-bcfaaf57b60a63acacf0651f5a69b45304abc132.tar.gz Tango-bcfaaf57b60a63acacf0651f5a69b45304abc132.zip | |
FSE Statistics module starter.
Diffstat (limited to 'Software/Visual_Studio')
36 files changed, 1079 insertions, 19 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/App.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/App.xaml new file mode 100644 index 000000000..384ab9cca --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/App.xaml @@ -0,0 +1,16 @@ +<Application x:Class="Tango.FSE.Statistics.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + <Application.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="pack://application:,,,/Tango.FSE.Common;component/Resources/Converters.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.FSE.Common;component/Resources/Colors.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.FSE.Common;component/Resources/Fonts.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.FSE.Common;component/Resources/Images.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.FSE.Common;component/Resources/Styles.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.FSE.Common;component/Resources/Controls.xaml" /> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </Application.Resources> +</Application>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Images/statistics.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Images/statistics.png Binary files differnew file mode 100644 index 000000000..bf818a6f1 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Images/statistics.png diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/AssemblyInfo.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..61d2c5bb6 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("Tango.FSE.Statistics")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.FSE.Statistics")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[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)] + +//In order to begin building localizable applications, set +//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file +//inside a <PropertyGroup>. For example, if you are using US english +//in your source files, set the <UICulture> to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// 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")] diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Resources.Designer.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Resources.Designer.cs new file mode 100644 index 000000000..8a60559df --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// <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 Tango.FSE.Statistics.Properties +{ + + + /// <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", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// <summary> + /// 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 ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.FSE.Statistics.Properties.Resources", typeof(Resources).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; + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Resources.resx b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Settings.Designer.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Settings.Designer.cs new file mode 100644 index 000000000..b2e12cbff --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// <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 Tango.FSE.Statistics.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Settings.settings b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Properties/Settings.settings @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/StatisticsModule.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/StatisticsModule.cs new file mode 100644 index 000000000..919cfe466 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/StatisticsModule.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.BL.Enumerations; +using Tango.FSE.Common; +using Tango.FSE.Statistics.Views; + +namespace Tango.FSE.Statistics +{ + [FSEModule(index: 1)] + public class StatisticsModule : FSEModuleBase + { + public override string Name { get; } = "Statistics"; + public override string Description { get; } = "Statistics module"; + public override Type MainViewType { get; } = typeof(MainView); + public override Permissions Permission { get; } = Permissions.FSE_RunFSE; + + public override void Dispose() + { + + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Tango.FSE.Statistics.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Tango.FSE.Statistics.csproj new file mode 100644 index 000000000..8562c73ca --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Tango.FSE.Statistics.csproj @@ -0,0 +1,180 @@ +<?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>{7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}</ProjectGuid> + <OutputType>library</OutputType> + <RootNamespace>Tango.FSE.Statistics</RootNamespace> + <AssemblyName>Tango.FSE.Statistics</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + <Deterministic>true</Deterministic> + <NuGetPackageImportStamp> + </NuGetPackageImportStamp> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\..\Build\FSE\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>..\..\..\Build\FSE\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll</HintPath> + </Reference> + <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath> + </Reference> + <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath> + </Reference> + <Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath> + </Reference> + <Reference Include="MahApps.Metro, Version=1.6.5.1, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MahApps.Metro.1.6.5\lib\net46\MahApps.Metro.dll</HintPath> + </Reference> + <Reference Include="MaterialDesignColors, Version=1.2.2.920, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MaterialDesignColors.1.2.2\lib\net45\MaterialDesignColors.dll</HintPath> + </Reference> + <Reference Include="MaterialDesignThemes.Wpf, Version=3.0.1.920, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MaterialDesignThemes.3.0.1\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath> + </Reference> + <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.ComponentModel.DataAnnotations" /> + <Reference Include="System.Data" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll</HintPath> + </Reference> + <Reference Include="System.Xml" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xaml"> + <RequiredTargetFramework>4.0</RequiredTargetFramework> + </Reference> + <Reference Include="WindowsBase" /> + <Reference Include="PresentationCore" /> + <Reference Include="PresentationFramework" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ViewModelLocator.cs" /> + <Compile Include="StatisticsModule.cs" /> + <Compile Include="ViewModels\MainViewVM.cs" /> + <Compile Include="Views\MainView.xaml.cs"> + <DependentUpon>MainView.xaml</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + <None Include="app.config" /> + <None Include="packages.config" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\SideChains\Tango.AutoComplete\Tango.AutoComplete.csproj"> + <Project>{bb2abb74-ba58-4812-83aa-ec8171f42df4}</Project> + <Name>Tango.AutoComplete</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj"> + <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> + <Name>Tango.BL</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Integration\Tango.Integration.csproj"> + <Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project> + <Name>Tango.Integration</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Logging\Tango.Logging.csproj"> + <Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project> + <Name>Tango.Logging</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.PMR\Tango.PMR.csproj"> + <Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project> + <Name>Tango.PMR</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Settings\Tango.Settings.csproj"> + <Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project> + <Name>Tango.Settings</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.SharedUI\Tango.SharedUI.csproj"> + <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project> + <Name>Tango.SharedUI</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Transport\Tango.Transport.csproj"> + <Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project> + <Name>Tango.Transport</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.FSE.BL\Tango.FSE.BL.csproj"> + <Project>{834c81c3-09b5-45d7-be12-e7d1e6655a7c}</Project> + <Name>Tango.FSE.BL</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.FSE.Common\Tango.FSE.Common.csproj"> + <Project>{bc37cccb-7392-4f78-8d1c-e9629e6e046e}</Project> + <Name>Tango.FSE.Common</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Page Include="App.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\MainView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\statistics.png" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <Import Project="..\..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets" Condition="Exists('..\..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets')" /> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets'))" /> + </Target> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModelLocator.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModelLocator.cs new file mode 100644 index 000000000..4afef5a01 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModelLocator.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.FSE.Statistics.ViewModels; + +namespace Tango.FSE.Statistics +{ + public static class ViewModelLocator + { + static ViewModelLocator() + { + TangoIOC.Default.Register<MainViewVM>(); + } + + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance<MainViewVM>(); + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..bfcc9cbd2 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common; +using Tango.FSE.Common.Navigation; +using Tango.SharedUI.Helpers; + +namespace Tango.FSE.Statistics.ViewModels +{ + public class MainViewVM : FSEViewModel + { + public override void OnApplicationStarted() + { + InvokeUI(() => + { + NavigationManager.MenuItems.Add(new NavigationMenuItem(() => + { + NavigationManager.NavigateTo<StatisticsModule>(); + }) + { + Name = "Statistics", + Index = 11, + Description = "Query for statistical data of a machine.", + Image = ResourceHelper.GetImageFromResources("Images/statistics.png"), + }); + }); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml new file mode 100644 index 000000000..24afcc9c0 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml @@ -0,0 +1,14 @@ +<UserControl x:Class="Tango.FSE.Statistics.Views.MainView" + 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:global="clr-namespace:Tango.FSE.Statistics" + xmlns:vm="clr-namespace:Tango.FSE.Statistics.ViewModels" + xmlns:local="clr-namespace:Tango.FSE.Statistics.Views" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + <Grid> + <TextBlock FontSize="60" HorizontalAlignment="Center" VerticalAlignment="Center">Statistics View</TextBlock> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml.cs new file mode 100644 index 000000000..db93b84fc --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Views/MainView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.FSE.Statistics.Views +{ + /// <summary> + /// Interaction logic for MainView.xaml + /// </summary> + public partial class MainView : UserControl + { + public MainView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/app.config b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/app.config new file mode 100644 index 000000000..36bc04f85 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/app.config @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <configSections> + <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> + <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> + </configSections> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.0.5.0" newVersion="5.0.5.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> + </dependentAssembly> + </assemblyBinding> + </runtime> + <entityFramework> + <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> + <providers> + <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> + </providers> + </entityFramework> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/packages.config b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/packages.config new file mode 100644 index 000000000..dd8c723e4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/packages.config @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="ControlzEx" version="3.0.2.4" targetFramework="net461" /> + <package id="EntityFramework" version="6.2.0" targetFramework="net461" /> + <package id="Google.Protobuf" version="3.4.1" targetFramework="net461" /> + <package id="MahApps.Metro" version="1.6.5" targetFramework="net461" /> + <package id="MaterialDesignColors" version="1.2.2" targetFramework="net461" /> + <package id="MaterialDesignThemes" version="3.0.1" targetFramework="net461" /> + <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" /> +</packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/MainViewVM.cs index 17a361932..842db47be 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/MainViewVM.cs @@ -27,7 +27,7 @@ namespace Tango.FSE.UsersAndRoles.ViewModels }) { Name = "Users & Roles", - Index = 11, + Index = 12, Description = "Manage users and their permissions on your organization.", Image = ResourceHelper.GetImageFromResources("Images/users_and_roles.png"), }); diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/MachineConfigurationService.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/MachineConfigurationService.cs index 3b33719d0..46b3a5beb 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/MachineConfigurationService.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/MachineConfigurationService.cs @@ -71,10 +71,10 @@ namespace Tango.FSE.BL.Services //Tags composition.Tags = db.TangoVersions.Select(x => x.Tag).Where(x => x != null).Distinct().ToList(); - composition.Tags.Insert(0, String.Empty); + composition.Tags.Insert(0, string.Empty); //Counters - var jobRuns = db.JobRuns.Where(x => x.MachineGuid == machineGuid).Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).ToList(); + var jobRuns = db.JobRuns.Where(x => x.MachineGuid == machineGuid).Select(x => new { StartDate=x.StartDate, x.EndDate, x.EndPosition }).ToList(); composition.TotalDyeTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToStringUnlimitedHours(); int meters = (int)jobRuns.Select(x => x.EndPosition).Sum(); composition.TotalDyeMeters = $"{meters.ToString("N0")} meters"; diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/IStatisticsProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/IStatisticsProvider.cs new file mode 100644 index 000000000..2f72b3b32 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/IStatisticsProvider.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Common.Statistics +{ + public interface IStatisticsProvider + { + Task<StatisticsModel> GetStatistics(); + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/StatisticsFilterData.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/StatisticsFilterData.cs new file mode 100644 index 000000000..aa04574b0 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/StatisticsFilterData.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Common.Statistics +{ + public class StatisticsFilterData + { + public List<String> Rmls { get; set; } + + public List<String> Jobs { get; set; } + + public StatisticsFilterData() + { + Rmls = new List<string>(); + Jobs = new List<string>(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/StatisticsModel.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/StatisticsModel.cs new file mode 100644 index 000000000..d23105b30 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Statistics/StatisticsModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.DTO; +using Tango.BL.Entities; + +namespace Tango.FSE.Common.Statistics +{ + public class StatisticsModel + { + public List<JobRun> JobRuns { get; set; } + + public StatisticsModel() + { + JobRuns = new List<JobRun>(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index 3e389289e..47fb9a46e 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -322,6 +322,9 @@ <Compile Include="SQL\RemoteSqlCommand.cs" /> <Compile Include="SQL\RemoteSqlCommandMode.cs" /> <Compile Include="SQL\RemoteSqlCommandResult.cs" /> + <Compile Include="Statistics\IStatisticsProvider.cs" /> + <Compile Include="Statistics\StatisticsFilterData.cs" /> + <Compile Include="Statistics\StatisticsModel.cs" /> <Compile Include="Storage\IStorageProvider.cs" /> <Compile Include="Storage\IStorageResult.cs" /> <Compile Include="Storage\SingleStorageResult.cs" /> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index ce2aa999f..4147629ab 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -793,6 +793,10 @@ <Project>{1754f846-4763-4000-807f-c7bfaa145db2}</Project> <Name>Tango.FSE.Procedures</Name> </ProjectReference> + <ProjectReference Include="..\Modules\Tango.FSE.Statistics\Tango.FSE.Statistics.csproj"> + <Project>{7a30b35f-94dc-4a9c-b9d2-cb5caa735788}</Project> + <Name>Tango.FSE.Statistics</Name> + </ProjectReference> <ProjectReference Include="..\Modules\Tango.FSE.Upgrade\Tango.FSE.Upgrade.csproj"> <Project>{0c0b24cb-79af-4253-aac3-b2badf034675}</Project> <Name>Tango.FSE.Upgrade</Name> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs new file mode 100644 index 000000000..a603410d0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.Core; +using Tango.Core.DI; +using Tango.Integration.ExternalBridge; +using Tango.PPC.Common.ExternalBridge; +using Tango.PPC.Shared.Statistics; + +namespace Tango.PPC.Common.Statistics +{ + [TangoCreateWhenRegistered] + public class DefaultStatisticsService : ExtendedObject, IStatisticsService, IExternalBridgeRequestHandler + { + public bool Enabled { get; set; } = true; + + public DefaultStatisticsService(IPPCExternalBridgeService externalBridge) + { + try + { + externalBridge.RegisterRequestHandler(this); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error initializing the statistics service."); + Enabled = false; + } + } + + [ExternalBridgeRequestHandlerMethod(typeof(GetStatisticsRequiredFiltersRequest), RequestHandlerLoggingMode.LogRequestName)] + public async Task OnGetStatisticsRequiredFiltersRequest(GetStatisticsRequiredFiltersRequest request, String token, ExternalBridgeReceiver receiver) + { + this.ThrowIfDisabled(); + + var response = new GetStatisticsRequiredFiltersResponse(); + + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var jobNames = await db.JobRuns.Select(x => x.JobName).ToListAsync(); + var threadNames = await db.Rmls.Select(x => x.DisplayName).ToListAsync(); + response.FiltersData.Jobs = jobNames; + response.FiltersData.Rmls = threadNames; + } + + await receiver.SendGenericResponse(response, token); + } + + [ExternalBridgeRequestHandlerMethod(typeof(GetStatisticsRequest), RequestHandlerLoggingMode.LogRequestName)] + public async Task OnGetStatisticsRequest(GetStatisticsRequest request, String token, ExternalBridgeReceiver receiver) + { + this.ThrowIfDisabled(); + + var response = new GetStatisticsResponse(); + + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var filters = request.Filters; + + var db_JobRuns = db.JobRuns.Where(x => (x.StartDate <= filters.EndDateUTC && x.StartDate >= filters.StartDateUTC)); + + int[] jobRunStatusArr = filters.EndStatuses.Distinct().ToArray(); + if (jobRunStatusArr.Length > 0) + { + db_JobRuns = db_JobRuns.Where(x => jobRunStatusArr.Contains(x.Status)); + } + + if (!filters.IncludeHeadCleaning) + { + db_JobRuns = db_JobRuns.Where(x => !x.IsHeadCleaning); + } + + List<String> rmlGuids = filters.Threads; + + if (filters.Threads.Count > 0) + { + db_JobRuns = db_JobRuns.Where(x => rmlGuids.Contains(x.RmlGuid)); + } + + if (filters.JobName.IsNotNullOrEmpty()) + { + db_JobRuns = db_JobRuns.Where(x => x.JobName.ToLower().StartsWith(filters.JobName.ToLower())); + } + + db_JobRuns = db_JobRuns.Where(x => x.JobLength < filters.MinLength && x.JobLength >= filters.MaxLength); + + var runs_db = await db_JobRuns.ToListAsync(); + + runs_db.ForEach(x => x.LiquidQuantityString = null); + } + + await receiver.SendGenericResponse(response, token); + } + + public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) + { + + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/IStatisticsService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/IStatisticsService.cs new file mode 100644 index 000000000..553264d42 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/IStatisticsService.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.Statistics +{ + public interface IStatisticsService : IPPCService + { + + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index 0adce35a0..d0476647b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -198,6 +198,8 @@ <Compile Include="RemoteNotifications\IRemoteNotificationsService.cs" /> <Compile Include="SQL\DefaultRemoteSqlService.cs" /> <Compile Include="SQL\IRemoteSqlService.cs" /> + <Compile Include="Statistics\DefaultStatisticsService.cs" /> + <Compile Include="Statistics\IStatisticsService.cs" /> <Compile Include="Synchronization\DefaultMachineDataSynchronizer.cs" /> <Compile Include="Synchronization\IMachineDataSynchronizer.cs" /> <Compile Include="Synchronization\SynchronizationEndedEventArgs.cs" /> @@ -587,7 +589,7 @@ </Target> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/Filters.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/Filters.cs new file mode 100644 index 000000000..0438c699a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/Filters.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Statistics +{ + public class Filters + { + public DateTime StartDateUTC { get; set; } + public DateTime EndDateUTC { get; set; } + public List<String> Threads { get; set; } + public String JobName { get; set; } + public int MinLength { get; set; } + public int MaxLength { get; set; } + public List<int> EndStatuses { get; set; } + public bool IncludeHeadCleaning { get; set; } + + public Filters() + { + Threads = new List<string>(); + EndStatuses = new List<int>(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsRequest.cs new file mode 100644 index 000000000..cacd8db2f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Statistics +{ + public class GetStatisticsRequest + { + public Filters Filters { get; set; } + + public GetStatisticsRequest() + { + Filters = new Filters(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsRequiredFiltersRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsRequiredFiltersRequest.cs new file mode 100644 index 000000000..fb10cfbfc --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsRequiredFiltersRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Statistics +{ + public class GetStatisticsRequiredFiltersRequest + { + + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsRequiredFiltersResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsRequiredFiltersResponse.cs new file mode 100644 index 000000000..44611f68e --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsRequiredFiltersResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Statistics +{ + public class GetStatisticsRequiredFiltersResponse + { + public RequiredFiltersData FiltersData { get; set; } + + public GetStatisticsRequiredFiltersResponse() + { + FiltersData = new RequiredFiltersData(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsResponse.cs new file mode 100644 index 000000000..a46f15b63 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/GetStatisticsResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Statistics +{ + public class GetStatisticsResponse + { + public StatisticsResult Result { get; set; } + + public GetStatisticsResponse() + { + Result = new StatisticsResult(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunComposition.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunComposition.cs new file mode 100644 index 000000000..643f5a63c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/JobRunComposition.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.DTO; + +namespace Tango.PPC.Shared.Statistics +{ + public class JobRunComposition + { + public JobRunDTO JobRun { get; set; } + public List<MachinesEventDTO> Events { get; set; } + + public JobRunComposition() + { + Events = new List<MachinesEventDTO>(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/RequiredFiltersData.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/RequiredFiltersData.cs new file mode 100644 index 000000000..6b934fa49 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/RequiredFiltersData.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Statistics +{ + public class RequiredFiltersData + { + public List<String> Rmls { get; set; } + + public List<String> Jobs { get; set; } + + public RequiredFiltersData() + { + Rmls = new List<string>(); + Jobs = new List<string>(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/StatisticsResult.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/StatisticsResult.cs new file mode 100644 index 000000000..8cee4c545 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Statistics/StatisticsResult.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.DTO; + +namespace Tango.PPC.Shared.Statistics +{ + public class StatisticsResult + { + public List<JobRunComposition> JobRuns { get; set; } + + public StatisticsResult() + { + JobRuns = new List<JobRunComposition>(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj index 73f142f67..4f06312c6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj @@ -121,6 +121,14 @@ <Compile Include="SQL\RemoteSqlColumnCollection.cs" /> <Compile Include="SQL\RemoteSqlDataSet.cs" /> <Compile Include="SQL\RemoteSqlRow.cs" /> + <Compile Include="Statistics\Filters.cs" /> + <Compile Include="Statistics\GetStatisticsRequest.cs" /> + <Compile Include="Statistics\GetStatisticsRequiredFiltersRequest.cs" /> + <Compile Include="Statistics\GetStatisticsRequiredFiltersResponse.cs" /> + <Compile Include="Statistics\GetStatisticsResponse.cs" /> + <Compile Include="Statistics\JobRunComposition.cs" /> + <Compile Include="Statistics\RequiredFiltersData.cs" /> + <Compile Include="Statistics\StatisticsResult.cs" /> <Compile Include="Updates\GetUpdatesAndPackagesRequest.cs" /> <Compile Include="Updates\GetUpdatesAndPackagesResponse.cs" /> <Compile Include="Updates\PackageInstallation.cs" /> diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs index 1750b835d..2ab10f14d 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs @@ -143,24 +143,24 @@ namespace Tango.BL.Entities } } - + public TimeSpan TotalDyeingTime { get - { - if( this.ActualStartDate == null || this.EndDate == default(DateTime) || this.EndDate < this.ActualStartDate) - return TimeSpan.Zero; + { + if (this.ActualStartDate == null || this.EndDate == default(DateTime) || this.EndDate < this.ActualStartDate) + return TimeSpan.Zero; return EndDate - (DateTime)ActualStartDate; } - + } - /// <summary> - /// Initializes a new instance of the <see cref="JobRun" /> class. - /// </summary> - public JobRun() : base() + /// <summary> + /// Initializes a new instance of the <see cref="JobRun" /> class. + /// </summary> + public JobRun() : base() { } diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 03bcbcb97..9c0920e8b 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -483,6 +483,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.BulkEmailModifier.CLI EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tango.ColorLib_v6", "ColorLib\Tango.ColorLib_v6\Tango.ColorLib_v6.vcxproj", "{D74E49AA-4C6B-4427-BEFF-D7CE2690D059}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.Statistics", "FSE\Modules\Tango.FSE.Statistics\Tango.FSE.Statistics.csproj", "{7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -4610,6 +4612,26 @@ Global {D74E49AA-4C6B-4427-BEFF-D7CE2690D059}.Release|x64.Build.0 = Release|x64 {D74E49AA-4C6B-4427-BEFF-D7CE2690D059}.Release|x86.ActiveCfg = Release|Win32 {D74E49AA-4C6B-4427-BEFF-D7CE2690D059}.Release|x86.Build.0 = Release|Win32 + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|ARM.ActiveCfg = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|ARM.Build.0 = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|ARM64.Build.0 = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|x64.ActiveCfg = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|x64.Build.0 = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|x86.ActiveCfg = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Debug|x86.Build.0 = Debug|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|Any CPU.Build.0 = Release|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|ARM.ActiveCfg = Release|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|ARM.Build.0 = Release|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|ARM64.ActiveCfg = Release|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|ARM64.Build.0 = Release|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|x64.ActiveCfg = Release|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|x64.Build.0 = Release|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|x86.ActiveCfg = Release|Any CPU + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4782,14 +4804,15 @@ Global {0F87D32E-B65F-4AE8-862C-29F4CCC38240} = {7181F9DE-0760-46B7-AD8F-BDBCAEDEF1B7} {DA4FCA0B-E0EA-431F-B0CC-AA9B0A4C73C2} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} {D74E49AA-4C6B-4427-BEFF-D7CE2690D059} = {7181F9DE-0760-46B7-AD8F-BDBCAEDEF1B7} + {7A30B35F-94DC-4A9C-B9D2-CB5CAA735788} = {4EE6DBA1-71BC-49E2-8DC7-266487E61050} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - BuildVersion_UseGlobalSettings = False - BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs - BuildVersion_StartDate = 2000/1/1 - BuildVersion_UpdateFileVersion = False - BuildVersion_UpdateAssemblyVersion = True - BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} + BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear + BuildVersion_UpdateAssemblyVersion = True + BuildVersion_UpdateFileVersion = False + BuildVersion_StartDate = 2000/1/1 + BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs + BuildVersion_UseGlobalSettings = False EndGlobalSection EndGlobal |
