diff options
| author | Mirta <mirta@twine-s.com> | 2020-11-23 16:13:53 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-11-23 16:13:53 +0200 |
| commit | 91c007adced573e09b77ab4be4a5aba623a816cc (patch) | |
| tree | 250221fc2def7d59f1393be8394f766faf576656 /Software/Visual_Studio/FSE/Modules | |
| parent | 4e9af2b852eb3b9eecfa09e9bc76869558e183cb (diff) | |
| parent | 50a3c0b857b4aa88a9e3970d69256f12b5b24eb8 (diff) | |
| download | Tango-91c007adced573e09b77ab4be4a5aba623a816cc.tar.gz Tango-91c007adced573e09b77ab4be4a5aba623a816cc.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/FSE/Modules')
56 files changed, 3483 insertions, 111 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/Tango.FSE.Firmware_0qifchtm_wpftmp.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/Tango.FSE.Firmware_0qifchtm_wpftmp.csproj new file mode 100644 index 000000000..8708fb9b0 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/Tango.FSE.Firmware_0qifchtm_wpftmp.csproj @@ -0,0 +1,203 @@ +<?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>{7CB96D74-8B71-4A81-B4E1-6DE7BFCA6174}</ProjectGuid> + <OutputType>library</OutputType> + <RootNamespace>Tango.FSE.Firmware</RootNamespace> + <AssemblyName>Tango.FSE.Firmware</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> + <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> + </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> + </ItemGroup> + <ItemGroup> + <Compile Include="Contracts\ILogsView.cs" /> + <Compile Include="Dialogs\FirmwareUpdateView.xaml.cs"> + <DependentUpon>FirmwareUpdateView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\FirmwareUpdateViewVM.cs" /> + <Compile Include="Navigation\PeekLogsNavigationObject.cs" /> + <Compile Include="ViewModelLocator.cs" /> + <Compile Include="FirmwareModule.cs" /> + <Compile Include="ViewModels\FileSystemViewVM.cs" /> + <Compile Include="ViewModels\LogsViewVM.cs" /> + <Compile Include="ViewModels\MainViewVM.cs" /> + <Compile Include="ViewModels\UpdatesViewVM.cs" /> + <Compile Include="Views\FileSystemView.xaml.cs"> + <DependentUpon>FileSystemView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\LogsView.xaml.cs"> + <DependentUpon>LogsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\MainView.xaml.cs"> + <DependentUpon>MainView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\UpdatesView.xaml.cs"> + <DependentUpon>UpdatesView.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="..\..\..\PPC\Tango.PPC.Shared\Tango.PPC.Shared.csproj"> + <Project>{208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}</Project> + <Name>Tango.PPC.Shared</Name> + </ProjectReference> + <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.FileSystem\Tango.FileSystem.csproj"> + <Project>{c6ebbbbe-2123-44dc-aef7-a0d47d736ac0}</Project> + <Name>Tango.FileSystem</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> + </ItemGroup> + <ItemGroup> + </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> + <ItemGroup> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\MahApps.Metro.1.6.5\lib\net46\MahApps.Metro.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\MaterialDesignColors.1.2.2\lib\net45\MaterialDesignColors.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\MaterialDesignThemes.3.0.1\lib\net45\MaterialDesignThemes.Wpf.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Microsoft.CSharp.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\mscorlib.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\PresentationCore.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\PresentationFramework.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.ComponentModel.DataAnnotations.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Core.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Data.DataSetExtensions.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Data.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Net.Http.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xaml.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xml.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xml.Linq.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\SideChains\Tango.AutoComplete\bin\Debug\Tango.AutoComplete.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.BL.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Core.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Tango.FileSystem\bin\Debug\Tango.FileSystem.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\FSE\Debug\Tango.FSE.BL.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\FSE\Debug\Tango.FSE.Common.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Integration.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Logging.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.PMR.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\PPC\Debug\Tango.PPC.Shared.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Settings.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.SharedUI.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Transport.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\WindowsBase.dll" /> + </ItemGroup> + <ItemGroup> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\FSE\Modules\Tango.FSE.Firmware\obj\Debug\App.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\FSE\Modules\Tango.FSE.Firmware\obj\Debug\Dialogs\FirmwareUpdateView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\FSE\Modules\Tango.FSE.Firmware\obj\Debug\Views\FileSystemView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\FSE\Modules\Tango.FSE.Firmware\obj\Debug\Views\LogsView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\FSE\Modules\Tango.FSE.Firmware\obj\Debug\Views\MainView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\FSE\Modules\Tango.FSE.Firmware\obj\Debug\Views\UpdatesView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\FSE\Modules\Tango.FSE.Firmware\obj\Debug\GeneratedInternalTypeHelper.g.cs" /> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/ViewModels/LogsViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/ViewModels/LogsViewVM.cs index ead8366ad..70c73a7be 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/ViewModels/LogsViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/ViewModels/LogsViewVM.cs @@ -200,8 +200,8 @@ namespace Tango.FSE.Firmware.ViewModels } catch (Exception ex) { - LogManager.Log(ex, "Error loading log files."); - NotificationProvider.PushErrorReportingSnackbar(ex, "PPC Module Error", "Could not initialize the remote PPC logs history."); + LogManager.Log(ex, "Error loading remote firmware log files."); + NotificationProvider.PushErrorReportingSnackbar(ex, "Firmware Module Error", "Could not initialize the remote Firmware logs history."); } finally { diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/App.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/App.xaml new file mode 100644 index 000000000..28a976e78 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/App.xaml @@ -0,0 +1,16 @@ +<Application x:Class="Tango.FSE.MachineConfiguration.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.MachineConfiguration/ConfigurationModule.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationModule.cs new file mode 100644 index 000000000..2f2c0dbb1 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationModule.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.MachineConfiguration.Views; + +namespace Tango.FSE.MachineConfiguration +{ + [FSEModule(index: 7)] + public class ConfigurationModule : FSEModuleBase + { + public override string Name { get; } = "Configuration"; + public override string Description { get; } = "Configuration 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.MachineConfiguration/ConfigurationViewModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationViewModel.cs new file mode 100644 index 000000000..bfcc60bcf --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common.Navigation; +using Tango.FSE.MachineConfiguration.Navigation; + +namespace Tango.FSE.MachineConfiguration +{ + public class ConfigurationViewModel : ModularNavigationFSEViewModel<ConfigurationView> + { + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs new file mode 100644 index 000000000..4acf7fd8e --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.DataStore; + +namespace Tango.FSE.MachineConfiguration.Converters +{ + public class DataStoreValueToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is IDataStoreItem item) + { + if (item != null) + { + return DataStoreHelper.FormatDataStoreItem(item).ToOneLine().Ellipsis(100); + } + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml new file mode 100644 index 000000000..2fd3b9cdf --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml @@ -0,0 +1,53 @@ +<UserControl x:Class="Tango.FSE.MachineConfiguration.Dialogs.DataStoreItemEditDialogView" + 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:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.MachineConfiguration.Dialogs" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + xmlns:sharedControls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:datastore="clr-namespace:Tango.DataStore;assembly=Tango.DataStore" + xmlns:pmr="clr-namespace:Tango.PMR.Common;assembly=Tango.PMR" + mc:Ignorable="d" + Width="400" Height="500" d:DataContext="{d:DesignInstance Type=local:DataStoreItemEditDialogViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid Margin="10"> + <DockPanel> + <StackPanel DockPanel.Dock="Top" > + <StackPanel Orientation="Horizontal"> + <material:PackIcon Width="40" Height="40" Kind="Key" /> + <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_LargerFontSize}" VerticalAlignment="Center" Text="{Binding Item.Key}"></TextBlock> + </StackPanel> + </StackPanel> + + <StackPanel Margin="0 10 0 0" DockPanel.Dock="Top"> + <TextBlock FontSize="{StaticResource FSE_SmallerFontSize}" Foreground="{StaticResource FSE_GrayBrush}">Data Type</TextBlock> + + <DockPanel> + <Button Visibility="{Binding Type,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Proto'}" DockPanel.Dock="Right" Style="{StaticResource FSE_RaisedButton_Dark_Hover_Accent_Foreground}" Margin="5 5 0 0" Padding="10 0" FontSize="{StaticResource FSE_SmallFontSize}" Height="20" VerticalAlignment="Center" Command="{Binding InitProtoCommand}" ToolTip="Create the basic structure for this proto message">Init</Button> + <Button Visibility="{Binding Type,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Bytes'}" DockPanel.Dock="Right" Style="{StaticResource FSE_RaisedButton_Dark_Hover_Accent_Foreground}" Margin="5 5 0 0" Padding="10 0" FontSize="{StaticResource FSE_SmallFontSize}" Height="20" VerticalAlignment="Center" Command="{Binding LoadFileCommand}" ToolTip="Load bytes from file">Load File</Button> + <controls:FSERoundedCornersComboBox IsEnabled="{Binding EnableTypeChange}" FontSize="{StaticResource FSE_SmallFontSize}" Margin="0 5 0 0" ItemsSource="{Binding Source={x:Type datastore:DataType},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding Type,Mode=TwoWay}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></controls:FSERoundedCornersComboBox> + </DockPanel> + + <StackPanel Margin="0 10 0 0" Visibility="{Binding Type,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Proto'}"> + <TextBlock Foreground="{StaticResource FSE_GrayBrush}" FontSize="{StaticResource FSE_SmallerFontSize}">Message Type</TextBlock> + <sharedControls:SearchComboBox IsEnabled="{Binding EnableTypeChange}" FontSize="{StaticResource FSE_SmallFontSize}" Margin="0 -5 5 0" ItemsSource="{Binding Source={x:Type pmr:MessageType},Converter={StaticResource EnumToItemsSourceConverter},ConverterParameter='false'}" SelectedItem="{Binding ProtoMessageType,Mode=TwoWay}"></sharedControls:SearchComboBox> + </StackPanel> + </StackPanel> + + <DockPanel DockPanel.Dock="Bottom" Margin="0 5 0 0" MinHeight="15"> + <DockPanel Visibility="{Binding HasError,Converter={StaticResource BooleanToVisibilityConverter}}"> + <material:PackIcon Margin="0 0 0 0" VerticalAlignment="Top" Kind="Alert" Foreground="{StaticResource FSE_ErrorBrush}" Width="12" Height="12" /> + <TextBlock Foreground="{StaticResource FSE_ErrorBrush}" Margin="5 0 0 0" Text="{Binding Error}" FontSize="{StaticResource FSE_SmallerFontSize}" TextWrapping="Wrap"></TextBlock> + </DockPanel> + </DockPanel> + + <Grid Margin="0 10 0 0"> + <TextBox Style="{StaticResource FSE_Rounded_Corners_TextBox_Multiline}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" TextWrapping="NoWrap" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" FontSize="{StaticResource FSE_SmallFontSize}" Text="{Binding EditingValue,UpdateSourceTrigger=PropertyChanged}"> + + </TextBox> + </Grid> + + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml.cs new file mode 100644 index 000000000..b0f741759 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.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.MachineConfiguration.Dialogs +{ + /// <summary> + /// Interaction logic for DataStoreItemEditDialogView.xaml + /// </summary> + public partial class DataStoreItemEditDialogView : UserControl + { + public DataStoreItemEditDialogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs new file mode 100644 index 000000000..9cde14c6f --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs @@ -0,0 +1,173 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Core.DI; +using Tango.Core.ExtensionMethods; +using Tango.Core.Helpers; +using Tango.DataStore; +using Tango.DataStore.Editing; +using Tango.FSE.Common; +using Tango.FSE.Common.Storage; +using Tango.PMR; +using Tango.PMR.Common; + +namespace Tango.FSE.MachineConfiguration.Dialogs +{ + public class DataStoreItemEditDialogViewVM : FSEDialogViewVM + { + private const int MAX_FILE_SIZE_KB = 100; + + [TangoInject] + private IStorageProvider StorageProvider { get; set; } + + [TangoInject] + private Common.Notifications.INotificationProvider NotificationProvider { get; set; } + + private DataStoreItemModel _item; + public DataStoreItemModel Item + { + get { return _item; } + set + { + _item = value; + RaisePropertyChangedAuto(); + + if (_item.IsGlobal) + { + Value = _item.GlobalItem.Value; + } + else + { + Value = _item.Value; + } + + Type = _item.Type; + + if (Type == DataType.Proto) + { + ProtoMessageType = (Value as DataStoreProtoObject).MessageType; + } + + if (_item.IsGlobal) + { + EditingValue = _item.GlobalItem.ToString(); + } + else + { + EditingValue = _item.ToString(); + } + } + } + + public bool EnableTypeChange { get; set; } + + private Object _value; + public Object Value + { + get { return _value; } + set { _value = value; RaisePropertyChangedAuto(); } + } + + private DataType _type; + public DataType Type + { + get { return _type; } + set { _type = value; RaisePropertyChangedAuto(); OnEditingValueChanged(); } + } + + private MessageType _protoMessageType; + public MessageType ProtoMessageType + { + get { return _protoMessageType; } + set { _protoMessageType = value; RaisePropertyChangedAuto(); OnEditingValueChanged(); } + } + + private String _editingValue; + public String EditingValue + { + get { return _editingValue; } + set { _editingValue = value; RaisePropertyChangedAuto(); OnEditingValueChanged(); } + } + + private String _error; + public String Error + { + get { return _error; } + set { _error = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasError)); InvalidateRelayCommands(); } + } + + public bool HasError + { + get { return Error != null; } + } + + public RelayCommand LoadFileCommand { get; set; } + + public RelayCommand InitProtoCommand { get; set; } + + public DataStoreItemEditDialogViewVM() + { + EnableTypeChange = true; + LoadFileCommand = new RelayCommand(LoadFile); + InitProtoCommand = new RelayCommand(InitProto); + TangoIOC.Default.Inject(this); + } + + private void InitProto() + { + if (Type == DataType.Proto) + { + var type = MessageFactory.GetPMRTypeFromMessageType(ProtoMessageType); + var instance = Activator.CreateInstance(type); + EditingValue = instance.ToJsonString(); + } + } + + private async void LoadFile() + { + if (Type == DataType.Bytes) + { + var result = await StorageProvider.OpenFile("Load a file"); + if (result) + { + if ((new FileInfo(result.SelectedItem).Length / 1024) > MAX_FILE_SIZE_KB) + { + await NotificationProvider.ShowError($"The selected file size exceeds the maximum {MAX_FILE_SIZE_KB}kb allowed."); + return; + } + + var bytes = File.ReadAllBytes(result.SelectedItem); + Value = bytes; + _editingValue = Convert.ToBase64String(bytes); + RaisePropertyChanged(nameof(EditingValue)); + } + } + } + + private void OnEditingValueChanged() + { + if (EditingValue != null) + { + try + { + Value = DataStoreHelper.ParseDataStoreValue(Type, EditingValue, ProtoMessageType); + Error = null; + } + catch (Exception ex) + { + Error = ex.Message; + } + } + } + + protected override bool CanOK() + { + return base.CanOK() && !HasError; + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogView.xaml new file mode 100644 index 000000000..55d0efc4f --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogView.xaml @@ -0,0 +1,114 @@ +<UserControl x:Class="Tango.FSE.MachineConfiguration.Dialogs.ExportDialogView" + 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:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + xmlns:local="clr-namespace:Tango.FSE.MachineConfiguration.Dialogs" + mc:Ignorable="d" + Width="800" Height="500" d:DataContext="{d:DesignInstance Type=local:ExportDialogViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid Margin="10"> + <DockPanel> + <StackPanel DockPanel.Dock="Top" > + <StackPanel Orientation="Horizontal"> + <material:PackIcon Width="40" Height="40" Kind="Export" /> + <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_LargerFontSize}" VerticalAlignment="Center" Text="Export Data Store"></TextBlock> + </StackPanel> + </StackPanel> + + <DockPanel Margin="0 10 0 0"> + <Border Padding="5" MinWidth="100" BorderBrush="{StaticResource FSE_PrimaryBackgroundLightBrush}" BorderThickness="1" CornerRadius="3" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}"> + <ListBox x:Name="listCollections" ItemsSource="{Binding DataStore.Collections}" SelectedIndex="0"> + <ListBox.ItemTemplate> + <DataTemplate> + <DockPanel> + <CheckBox IsChecked="{Binding IsSelected}" /> + <TextBlock Margin="10 0 0 0" Text="{Binding Name}"></TextBlock> + </DockPanel> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Border> + + <Border Margin="5 0 0 0" Padding="5" MinWidth="100" BorderBrush="{StaticResource FSE_PrimaryBackgroundLightBrush}" BorderThickness="1" CornerRadius="3" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}"> + <DataGrid IsReadOnly="True" AutoGenerateColumns="False" Style="{StaticResource FSE_DataGrid}" CellStyle="{StaticResource FSE_DataGrid_Cell}" CanUserReorderColumns="False" CanUserSortColumns="False" ItemsSource="{Binding ElementName=listCollections,Path=SelectedItem.Items}"> + <DataGrid.Columns> + <DataGridTemplateColumn> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <UniformGrid Columns="2"> + <CheckBox IsEnabled="{Binding IsGlobal,Converter={StaticResource BooleanInverseConverter}}" IsChecked="{Binding IsSelected,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> + <material:PackIcon Kind="Key" Width="32" /> + </UniformGrid> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="KEY" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding Key}"></TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="TYPE" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding Type}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Type}" Value="Boolean"> + <Setter Property="Foreground" Value="#FF9BFF"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Bytes"> + <Setter Property="Foreground" Value="#FFFBA3"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Double"> + <Setter Property="Foreground" Value="#85B1FF"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Float"> + <Setter Property="Foreground" Value="#FFDCB8"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Int32"> + <Setter Property="Foreground" Value="#FF858D "></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="String"> + <Setter Property="Foreground" Value="#B9FFA5"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Proto"> + <Setter Property="Foreground" Value="#A5FFF9"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="LOCAL" Width="1*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding FormattedValue,Converter={StaticResource StringToOneLineConverter},ConverterParameter='100',Mode=OneWay}" Visibility="{Binding IsDeleted,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="FontWeight" Value="Normal"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding HasDifference}" Value="True"> + <Setter Property="FontWeight" Value="Bold"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </Border> + </DockPanel> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogView.xaml.cs new file mode 100644 index 000000000..4ee37908c --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogView.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.MachineConfiguration.Dialogs +{ + /// <summary> + /// Interaction logic for ImportDialogView.xaml + /// </summary> + public partial class ExportDialogView : UserControl + { + public ExportDialogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogViewVM.cs new file mode 100644 index 000000000..9f605c79e --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DataStore.Editing; +using Tango.FSE.Common; + +namespace Tango.FSE.MachineConfiguration.Dialogs +{ + public class ExportDialogViewVM : FSEDialogViewVM + { + public DataStoreModel DataStore { get; set; } + + public ExportDialogViewVM() + { + OKText = "EXPORT"; + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml new file mode 100644 index 000000000..5d9653eb4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml @@ -0,0 +1,113 @@ +<UserControl x:Class="Tango.FSE.MachineConfiguration.Dialogs.ImportDialogView" + 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:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.MachineConfiguration.Dialogs" + mc:Ignorable="d" + Width="800" Height="500" d:DataContext="{d:DesignInstance Type=local:ImportDialogViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid Margin="10"> + <DockPanel> + <StackPanel DockPanel.Dock="Top" > + <StackPanel Orientation="Horizontal"> + <material:PackIcon Width="40" Height="40" Kind="Import" /> + <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_LargerFontSize}" VerticalAlignment="Center" Text="Import Data Store"></TextBlock> + </StackPanel> + </StackPanel> + + <DockPanel Margin="0 10 0 0"> + <Border Padding="5" MinWidth="100" BorderBrush="{StaticResource FSE_PrimaryBackgroundLightBrush}" BorderThickness="1" CornerRadius="3" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}"> + <ListBox x:Name="listCollections" ItemsSource="{Binding DataStore.Collections}" SelectedIndex="0"> + <ListBox.ItemTemplate> + <DataTemplate> + <DockPanel> + <CheckBox IsChecked="{Binding IsSelected}" /> + <TextBlock Margin="10 0 0 0" Text="{Binding Name}"></TextBlock> + </DockPanel> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Border> + + <Border Margin="5 0 0 0" Padding="5" MinWidth="100" BorderBrush="{StaticResource FSE_PrimaryBackgroundLightBrush}" BorderThickness="1" CornerRadius="3" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}"> + <DataGrid IsReadOnly="True" AutoGenerateColumns="False" Style="{StaticResource FSE_DataGrid}" CellStyle="{StaticResource FSE_DataGrid_Cell}" CanUserReorderColumns="False" CanUserSortColumns="False" ItemsSource="{Binding ElementName=listCollections,Path=SelectedItem.Items}"> + <DataGrid.Columns> + <DataGridTemplateColumn> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <UniformGrid Columns="2"> + <CheckBox IsEnabled="{Binding IsGlobal,Converter={StaticResource BooleanInverseConverter}}" IsChecked="{Binding IsSelected,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> + <material:PackIcon Kind="Key" Width="32" /> + </UniformGrid> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="KEY" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding Key}"></TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="TYPE" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding Type}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Type}" Value="Boolean"> + <Setter Property="Foreground" Value="#FF9BFF"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Bytes"> + <Setter Property="Foreground" Value="#FFFBA3"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Double"> + <Setter Property="Foreground" Value="#85B1FF"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Float"> + <Setter Property="Foreground" Value="#FFDCB8"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Int32"> + <Setter Property="Foreground" Value="#FF858D "></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="String"> + <Setter Property="Foreground" Value="#B9FFA5"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Proto"> + <Setter Property="Foreground" Value="#A5FFF9"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="LOCAL" Width="1*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding FormattedValue,Converter={StaticResource StringToOneLineConverter},ConverterParameter='100',Mode=OneWay}" Visibility="{Binding IsDeleted,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="FontWeight" Value="Normal"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding HasDifference}" Value="True"> + <Setter Property="FontWeight" Value="Bold"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </Border> + </DockPanel> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml.cs new file mode 100644 index 000000000..bc729601f --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.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.MachineConfiguration.Dialogs +{ + /// <summary> + /// Interaction logic for ImportDialogView.xaml + /// </summary> + public partial class ImportDialogView : UserControl + { + public ImportDialogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogViewVM.cs new file mode 100644 index 000000000..a4e53e85b --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DataStore.Editing; +using Tango.FSE.Common; + +namespace Tango.FSE.MachineConfiguration.Dialogs +{ + public class ImportDialogViewVM : FSEDialogViewVM + { + public DataStoreModel DataStore { get; set; } + + public ImportDialogViewVM() + { + OKText = "IMPORT"; + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/configuration.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/configuration.png Binary files differnew file mode 100644 index 000000000..f46a49d23 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/configuration.png diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/data_collection.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/data_collection.png Binary files differnew file mode 100644 index 000000000..95163a226 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/data_collection.png diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/EditingCompositionLoadedMessage.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/EditingCompositionLoadedMessage.cs new file mode 100644 index 000000000..b858c34e0 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/EditingCompositionLoadedMessage.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.FSE.BL.Services; +using static Tango.FSE.BL.Services.MachineConfigurationService; + +namespace Tango.FSE.MachineConfiguration.Messages +{ + public class EditingCompositionLoadedMessage + { + public MachineEditingComposition EditingComposition { get; set; } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Models/CsvModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Models/CsvModel.cs new file mode 100644 index 000000000..1e12fda4b --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Models/CsvModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.MachineConfiguration.Models +{ + public class CsvModel + { + public String Date { get; set; } + public String Collection { get; set; } + public String Key { get; set; } + public String Type { get; set; } + public String MessageType { get; set; } + public String Value { get; set; } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationNavigationManager.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationNavigationManager.cs new file mode 100644 index 000000000..c1dfdfda7 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationNavigationManager.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using Tango.FSE.Common.Navigation; +using Tango.SharedUI.Controls; + +namespace Tango.FSE.MachineConfiguration.Navigation +{ + public class ConfigurationNavigationManager : ModularNavigationManager<ConfigurationView> + { + public ConfigurationNavigationManager(FrameworkElement navigationControlParent) : base(navigationControlParent) + { + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationView.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationView.cs new file mode 100644 index 000000000..187e44ac9 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationView.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.MachineConfiguration.Navigation +{ + public enum ConfigurationView + { + SelectionView, + MachineView, + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/AssemblyInfo.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..027dd9516 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.MachineConfiguration")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.FSE.MachineConfiguration")] +[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.MachineConfiguration/Properties/Resources.Designer.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Resources.Designer.cs new file mode 100644 index 000000000..830d15d6a --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.MachineConfiguration.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.MachineConfiguration.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.MachineConfiguration/Properties/Resources.resx b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.MachineConfiguration/Properties/Settings.Designer.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Settings.Designer.cs new file mode 100644 index 000000000..e41736026 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.MachineConfiguration.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.MachineConfiguration/Properties/Settings.settings b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj new file mode 100644 index 000000000..6e48f0ee7 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj @@ -0,0 +1,266 @@ +<?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>{15BCB5BB-731E-4E2D-AA28-75485050A8DC}</ProjectGuid> + <OutputType>library</OutputType> + <RootNamespace>Tango.FSE.MachineConfiguration</RootNamespace> + <AssemblyName>Tango.FSE.MachineConfiguration</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="ConfigurationViewModel.cs" /> + <Compile Include="Converters\DataStoreValueToStringConverter.cs" /> + <Compile Include="Dialogs\DataStoreItemEditDialogView.xaml.cs"> + <DependentUpon>DataStoreItemEditDialogView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\DataStoreItemEditDialogViewVM.cs" /> + <Compile Include="Dialogs\ExportDialogView.xaml.cs"> + <DependentUpon>ExportDialogView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\ImportDialogView.xaml.cs"> + <DependentUpon>ImportDialogView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\ExportDialogViewVM.cs" /> + <Compile Include="Dialogs\ImportDialogViewVM.cs" /> + <Compile Include="Messages\EditingCompositionLoadedMessage.cs" /> + <Compile Include="Models\CsvModel.cs" /> + <Compile Include="Navigation\ConfigurationNavigationManager.cs" /> + <Compile Include="Navigation\ConfigurationView.cs" /> + <Compile Include="ViewModelLocator.cs" /> + <Compile Include="ConfigurationModule.cs" /> + <Compile Include="ViewModels\SettingsViewVM.cs" /> + <Compile Include="ViewModels\DataStoreViewVM.cs" /> + <Compile Include="ViewModels\MachineViewVM.cs" /> + <Compile Include="ViewModels\MainViewVM.cs" /> + <Compile Include="ViewModels\SelectionViewVM.cs" /> + <Compile Include="Views\SettingsView.xaml.cs"> + <DependentUpon>SettingsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DataStoreView.xaml.cs"> + <DependentUpon>DataStoreView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\SelectionView.xaml.cs"> + <DependentUpon>SelectionView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\MachineView.xaml.cs"> + <DependentUpon>MachineView.xaml</DependentUpon> + </Compile> + <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.CSV\Tango.CSV.csproj"> + <Project>{58e8825f-0c96-449c-b320-1e82b0aa876b}</Project> + <Name>Tango.CSV</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\DataStore\Tango.DataStore.Editing\Tango.DataStore.Editing.csproj"> + <Project>{ee088ff7-04d1-41fb-9d6a-cedeee7a7b9c}</Project> + <Name>Tango.DataStore.Editing</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\DataStore\Tango.DataStore.EF\Tango.DataStore.EF.csproj"> + <Project>{88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4}</Project> + <Name>Tango.DataStore.EF</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\DataStore\Tango.DataStore.Remote\Tango.DataStore.Remote.csproj"> + <Project>{29448f3c-9b3e-4da6-8555-46a8b9a6b3aa}</Project> + <Name>Tango.DataStore.Remote</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\DataStore\Tango.DataStore\Tango.DataStore.csproj"> + <Project>{e0364dfa-0721-4637-9d32-9d22aac109d6}</Project> + <Name>Tango.DataStore</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="Dialogs\DataStoreItemEditDialogView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Dialogs\ExportDialogView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Dialogs\ImportDialogView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\SettingsView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DataStoreView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\SelectionView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\MachineView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\MainView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\configuration.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\data_collection.png" /> + </ItemGroup> + <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.MachineConfiguration/ViewModelLocator.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModelLocator.cs new file mode 100644 index 000000000..b924868b2 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModelLocator.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.FSE.MachineConfiguration.Navigation; +using Tango.FSE.MachineConfiguration.ViewModels; +using Tango.FSE.MachineConfiguration.Views; + +namespace Tango.FSE.MachineConfiguration +{ + public static class ViewModelLocator + { + static ViewModelLocator() + { + TangoIOC.Default.Register<ConfigurationNavigationManager>(new ConfigurationNavigationManager(MainView.Instance)); + TangoIOC.Default.Register<MainViewVM>(); + TangoIOC.Default.Register<SelectionViewVM>(); + TangoIOC.Default.Register<MachineViewVM>(); + TangoIOC.Default.Register<SettingsViewVM>(); + TangoIOC.Default.Register<DataStoreViewVM>(); + } + + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance<MainViewVM>(); + } + } + + public static SelectionViewVM SelectionViewVM + { + get + { + return TangoIOC.Default.GetInstance<SelectionViewVM>(); + } + } + + public static MachineViewVM MachineViewVM + { + get + { + return TangoIOC.Default.GetInstance<MachineViewVM>(); + } + } + + public static SettingsViewVM SettingsViewVM + { + get + { + return TangoIOC.Default.GetInstance<SettingsViewVM>(); + } + } + + public static DataStoreViewVM DataStoreViewVM + { + get + { + return TangoIOC.Default.GetInstance<DataStoreViewVM>(); + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs new file mode 100644 index 000000000..46f388461 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs @@ -0,0 +1,517 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.Core.Commands; +using Tango.Core.DI; +using Tango.CSV; +using Tango.DataStore; +using Tango.DataStore.Editing; +using Tango.FSE.Common; +using Tango.FSE.Common.Connection; +using Tango.FSE.Common.DataStore; +using Tango.FSE.Common.Notifications; +using Tango.FSE.MachineConfiguration.Dialogs; +using Tango.FSE.MachineConfiguration.Messages; +using Tango.FSE.MachineConfiguration.Models; +using static Tango.FSE.BL.Services.MachineConfigurationService; +using static Tango.SharedUI.Controls.NavigationControl; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + public class DataStoreViewVM : FSEViewModel, INavigationViewModel + { + private String _machineGuid; + private MachineEditingComposition _editingComposition; + private ICollectionView _selectedCollectionView; + private ICollectionView _collectionsView; + + [TangoInject] + public IDataStoreProvider DataStoreProvider { get; set; } + + private DataStoreModel _dataStore; + public DataStoreModel DataStore + { + get { return _dataStore; } + set { _dataStore = value; RaisePropertyChangedAuto(); } + } + + private DataStoreCollectionModel _selectedCollection; + public DataStoreCollectionModel SelectedCollection + { + get { return _selectedCollection; } + set { _selectedCollection = value; RaisePropertyChangedAuto(); OnSelectedCollectionChanged(); } + } + + private DataStoreItemModel _selectedItem; + public DataStoreItemModel SelectedItem + { + get { return _selectedItem; } + set { _selectedItem = value; RaisePropertyChangedAuto(); } + } + + private String _filter; + public String Filter + { + get { return _filter; } + set { _filter = value; RaisePropertyChangedAuto(); _selectedCollectionView?.Refresh(); } + } + + public bool CanSync + { + get { return MachineProvider.IsPPCAvailable && MachineProvider.Machine != null && _machineGuid == MachineProvider.Machine.Guid; } + } + + public RelayCommand<DataStoreItemModel> RemoveItemCommand { get; set; } + public RelayCommand<DataStoreCollectionModel> RemoveCollectionCommand { get; set; } + public RelayCommand AddItemCommand { get; set; } + public RelayCommand AddCollectionCommand { get; set; } + public RelayCommand<DataStoreItemModel> EditItemCommand { get; set; } + public RelayCommand SaveCommand { get; set; } + public RelayCommand ReloadCommand { get; set; } + public RelayCommand ImportCommand { get; set; } + public RelayCommand ExportCommand { get; set; } + + public DataStoreViewVM() + { + RegisterForMessage<EditingCompositionLoadedMessage>(OnEditingCompositionLoaded); + RemoveItemCommand = new RelayCommand<DataStoreItemModel>(RemoveItem); + RemoveCollectionCommand = new RelayCommand<DataStoreCollectionModel>(RemoveCollection); + AddItemCommand = new RelayCommand(AddItem); + AddCollectionCommand = new RelayCommand(AddCollection); + EditItemCommand = new RelayCommand<DataStoreItemModel>(EditItem); + SaveCommand = new RelayCommand(SaveModel); + ReloadCommand = new RelayCommand(ReloadDataStore); + ExportCommand = new RelayCommand(ExportDataStore); + ImportCommand = new RelayCommand(ImportDataStore); + } + + [TangoInject] + public DataStoreViewVM(IMachineProvider machineProvider) : this() + { + machineProvider.MachineConnected += (_, __) => RaisePropertyChanged(nameof(CanSync)); + machineProvider.MachineDisconnected += (_, __) => RaisePropertyChanged(nameof(CanSync)); + } + + private async void ReloadDataStore() + { + if (DataStore != null) + { + if (DataStore.Collections.SelectMany(x => x.Items).Any(x => x.HasDifference)) + { + if (!await NotificationProvider.ShowWarningQuestion("Reloading the data store will discard all the current changes. Are you sure?", "RELOAD")) + { + return; + } + } + } + + await LoadDataStore(); + } + + private async void EditItem(DataStoreItemModel item) + { + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreWrite)) + { + await NotificationProvider.ShowError("The current user profile does not allow editing of the data store.\nPlease contact your administrator."); + return; + } + + var vm = await NotificationProvider.ShowDialog<DataStoreItemEditDialogViewVM>(new DataStoreItemEditDialogViewVM() { Item = item, EnableTypeChange = !item.IsGlobal && item.GlobalItem == null }); + + if (vm.DialogResult) + { + item.IsDeleted = false; + item.IsGlobal = false; + item.Type = vm.Type; + item.Value = vm.Value; + } + } + + private async void AddCollection() + { + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) + { + await NotificationProvider.ShowError("The current user profile does not allow creating new data store collections.\nPlease contact your administrator."); + return; + } + + var result = await NotificationProvider.ShowInputBox("Add Collection", "Please enter the collection name", MaterialDesignThemes.Wpf.PackIconKind.Collection, null, null, 20, null, null, (input) => + { + if (DataStore.Collections.ToList().Exists(x => x.Name.ToLower() == input.ToLower())) + { + return "The specified collection already exists."; + } + + if (!DataStoreHelper.ValidateCollectionOrKeyName(input)) + { + return "Collection name contains invalid characters."; + } + + return null; + }); + + if (result.Confirmed) + { + if (DataStore.Collections.ToList().Exists(x => x.Name.ToLower() == result.Input.ToLower())) + { + await NotificationProvider.ShowError("The specified collection already exists."); + AddCollection(); + return; + } + + DataStore.Collections.Add(new DataStoreCollectionModel() + { + Name = result.Input + }); + + SelectedCollection = DataStore.Collections.Last(); + } + } + + private async void AddItem() + { + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) + { + await NotificationProvider.ShowError("The current user profile does not allow creating new data store items.\nPlease contact your administrator."); + return; + } + + var result = await NotificationProvider.ShowInputBox("Add Item", "Please enter the item key", MaterialDesignThemes.Wpf.PackIconKind.KeyAdd, null, null, 20, null, null, (input) => + { + if (SelectedCollection.Items.ToList().Exists(x => x.Key.ToLower() == input.ToLower())) + { + return "The specified key already exists in the collection."; + } + + if (!DataStoreHelper.ValidateCollectionOrKeyName(input)) + { + return "Key name contains invalid characters."; + } + + return null; + }); + + if (result.Confirmed) + { + if (SelectedCollection.Items.ToList().Exists(x => x.Key == result.Input)) + { + await NotificationProvider.ShowError("The specified key already exists in the collection."); + AddItem(); + return; + } + + SelectedCollection.Items.Add(new DataStoreItemModel() + { + Date = DateTime.UtcNow, + Guid = Guid.NewGuid().ToString(), + Key = result.Input, + Type = DataType.Int32, + Value = 10 + }); + } + } + + private async void RemoveCollection(DataStoreCollectionModel collection) + { + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) + { + await NotificationProvider.ShowError("The current user profile does not allow deleting data store collections.\nPlease contact your administrator."); + return; + } + + collection.IsDeleted = true; + _collectionsView?.Refresh(); + } + + private async void RemoveItem(DataStoreItemModel item) + { + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) + { + await NotificationProvider.ShowError("The current user profile does not allow deleting data store items.\nPlease contact your administrator."); + return; + } + + item.IsDeleted = true; + _selectedCollectionView.Refresh(); + } + + private void OnEditingCompositionLoaded(EditingCompositionLoadedMessage obj) + { + DataStore = null; + _editingComposition = obj.EditingComposition; + _machineGuid = obj.EditingComposition.Machine.Guid; + } + + private void OnSelectedCollectionChanged() + { + if (SelectedCollection != null) + { + _selectedCollectionView = CollectionViewSource.GetDefaultView(SelectedCollection.Items); + _selectedCollectionView.Filter = (x) => FilterItems(x as DataStoreItemModel); + _selectedCollectionView.Refresh(); + } + } + + private bool FilterItems(DataStoreItemModel itemModel) + { + return (!itemModel.IsDeleted || itemModel.GlobalItem != null) && (String.IsNullOrWhiteSpace(Filter) || itemModel.Key.ToLower().Contains(Filter.ToLower())); + } + + private async void SaveModel() + { + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreWrite)) + { + await NotificationProvider.ShowError("The current user profile does not allow editing of the data store.\nPlease contact your administrator."); + return; + } + + try + { + using (NotificationProvider.PushTaskItem("Updating data store...")) + { + await DataStoreProvider.UpdateDataStoreModel(DataStore, _machineGuid); + } + + if (MachineProvider.IsPPCAvailable) + { + await NotificationProvider.ShowSuccess("The connected machine is now synchronized with the data store."); + } + else + { + await NotificationProvider.ShowSuccess("Data store saved successfully.\nThe machine will be updated on the next synchronization pass."); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error saving data store."); + await NotificationProvider.ShowError($"Error occurred while trying to save the data store.\n{ex.FlattenMessage()}"); + return; + } + + await LoadDataStore(); + } + + private async Task LoadDataStore() + { + try + { + using (NotificationProvider.PushTaskItem("Loading data store...")) + { + IsFree = false; + RaisePropertyChanged(nameof(CanSync)); + + var dataStore = await DataStoreProvider.GetDataStoreModel(_machineGuid); + + _collectionsView = CollectionViewSource.GetDefaultView(dataStore.Collections); + _collectionsView.Filter = (x) => { return !(x as DataStoreCollectionModel).IsDeleted; }; + _collectionsView.Refresh(); + + DataStore = dataStore; + SelectedCollection = DataStore.Collections.FirstOrDefault(); + + IsFree = true; + } + } + catch (Exception ex) + { + DataStore = null; + LogManager.Log(ex, "Error loading data store."); + if (await NotificationProvider.ShowWarningQuestion($"Error occurred while trying to load the data store.\n{ex.FlattenMessage()}", "RETRY", "CANCEL")) + { + await LoadDataStore(); + return; + } + } + } + + public async override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreRead)) + { + return; + } + + if (DataStore == null) + { + await LoadDataStore(); + } + } + + private async void ImportDataStore() + { + var result = await StorageProvider.OpenFile("Import data store", "CSV Files|*.csv"); + + if (result) + { + try + { + DataStoreModel model = new DataStoreModel(); + + using (NotificationProvider.PushTaskItem("Analyzing file...")) + { + await Task.Delay(1000); + + await Task.Factory.StartNew(() => + { + var items = CsvFile.Read<CsvModel>(new CsvSource(result.SelectedItem)).ToList(); + + foreach (var collection in items.GroupBy(x => x.Collection)) + { + DataStoreCollectionModel collectionModel = new DataStoreCollectionModel(); + + collectionModel = new DataStoreCollectionModel(); + collectionModel.Name = collection.First().Collection; + collectionModel.IsSelected = true; + model.Collections.Add(collectionModel); + + foreach (var item in collection) + { + DataStoreItemModel itemModel = new DataStoreItemModel(); + itemModel.Guid = Guid.NewGuid().ToString(); + itemModel.Key = item.Key; + itemModel.Date = DateTime.Parse(item.Date); + itemModel.IsSelected = true; + + DataType type = (DataType)Enum.Parse(typeof(DataType), item.Type); + itemModel.OriginalType = type; + itemModel.Type = type; + + PMR.Common.MessageType? messageType = null; + if (type == DataType.Proto && item.MessageType.IsNotNullOrEmpty()) + { + messageType = (PMR.Common.MessageType)Enum.Parse(typeof(PMR.Common.MessageType), item.MessageType); + } + + itemModel.OriginalValue = DataStoreHelper.ParseDataStoreValue(type, item.Value, messageType); + itemModel.Value = itemModel.OriginalValue; + + collectionModel.Items.Add(itemModel); + } + } + }); + } + + var vm = await NotificationProvider.ShowDialog<ImportDialogViewVM>(new ImportDialogViewVM() { DataStore = model }); + + if (vm.DialogResult) + { + if (!vm.DataStore.Collections.SelectMany(x => x.Items).Any(x => x.IsSelected)) + { + await NotificationProvider.ShowInfo("No items selected to import."); + return; + } + + foreach (var collection in vm.DataStore.Collections.Where(x => x.Items.Any(y => y.IsSelected))) + { + var collectionModel = DataStore.Collections.FirstOrDefault(x => x.Name == collection.Name); + + if (collectionModel == null) + { + DataStore.Collections.Add(collection); + } + else + { + foreach (var item in collection.Items.Where(x => x.IsSelected)) + { + var itemModel = collectionModel.Items.FirstOrDefault(x => x.Key == item.Key); + + if (itemModel == null) + { + itemModel = new DataStoreItemModel(); + itemModel.Guid = item.Guid; + itemModel.Key = item.Key; + collectionModel.Items.Add(itemModel); + } + + itemModel.Date = DateTime.UtcNow; + itemModel.IsDeleted = false; + itemModel.IsGlobal = false; + itemModel.Type = item.Type; + itemModel.Value = item.Value; + } + } + } + + await NotificationProvider.ShowSuccess("Data store imported successfully."); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error importing data store."); + await NotificationProvider.ShowError($"Error importing the data store.\n{ex.FlattenMessage()}"); + } + } + } + + private async void ExportDataStore() + { + var vm = await NotificationProvider.ShowDialog<ExportDialogViewVM>(new ExportDialogViewVM() { DataStore = DataStore }); + + if (vm.DialogResult) + { + if (!vm.DataStore.Collections.SelectMany(x => x.Items).Any(x => x.IsSelected)) + { + await NotificationProvider.ShowInfo("No items selected to export."); + return; + } + + var result = await StorageProvider.SaveFile("Export data store", "CSV Files|*.csv", $"{_editingComposition.Machine.SerialNumber}_datastore_{DateTime.Now.ToFileName()}.csv", ".csv"); + + if (result) + { + try + { + using (NotificationProvider.PushTaskItem("Exporting data store...")) + { + await Task.Delay(1000); + + await Task.Factory.StartNew(() => + { + using (DynamicCsvFile csvFile = new DynamicCsvFile(result.SelectedItem)) + { + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Date" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Collection" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Key" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Type" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "MessageType" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Value" }); + + foreach (var collection in DataStore.Collections) + { + foreach (var item in collection.Items.Where(x => x.IsSelected && !x.IsGlobal && x.Value != null)) + { + PMR.Common.MessageType? messageType = null; + + if (item.Type == DataType.Proto) + { + messageType = (item.Value as DataStoreProtoObject).MessageType; + } + + csvFile.Append(item.Date, $"\"{collection.Name}\"", $"\"{item.Key}\"", item.Type, messageType.ToStringSafe(), $"\"{item.FormattedValue.Replace("\"", "\"\"")}\""); + } + } + } + }); + } + + NotificationProvider.PushSnackbarItem(MessageType.Success, "Export Data Store", true, "Data store exported successfully.", TimeSpan.FromSeconds(8), null, () => + { + StorageProvider.ShowInExplorer(result.SelectedItem); + }); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error exporting data store."); + await NotificationProvider.ShowError($"Error exporting the data store.\n{ex.FlattenMessage()}"); + } + } + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs new file mode 100644 index 000000000..fd953a0b8 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.FSE.Common; +using Tango.FSE.Common.Navigation; +using Tango.FSE.MachineConfiguration.Messages; +using static Tango.FSE.BL.Services.MachineConfigurationService; +using static Tango.FSE.MachineConfiguration.ViewModels.MachineViewVM; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + public class MachineViewVM : ConfigurationViewModel, INavigationObjectReceiver<NavigationObject> + { + public class NavigationObject + { + public String MachineGuid { get; set; } + } + + public enum NavigationView + { + SettingsView, + DataStoreView, + } + + private NavigationView _selectedView; + public NavigationView SelectedView + { + get { return _selectedView; } + set + { + if (value == NavigationView.DataStoreView) + { + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreRead)) + { + Task.Delay(500).ContinueWith((x) => + { + SelectedView = _selectedView; + NotificationProvider.ShowError("The current user profile does not allow accessing the data store.\nPlease contact your administrator."); + }); + return; + } + } + + _selectedView = value; + RaisePropertyChangedAuto(); + } + } + + private MachineEditingComposition _editingComposition; + public MachineEditingComposition EditingComposition + { + get { return _editingComposition; } + set { _editingComposition = value; RaisePropertyChangedAuto(); } + } + + public void OnNavigatedToWithObject(NavigationObject obj) + { + SelectedView = NavigationView.SettingsView; + LoadMachine(obj.MachineGuid); + } + + private async void LoadMachine(String machineGuid) + { + using (NotificationProvider.PushTaskItem("Loading machine configuration...")) + { + EditingComposition = await Services.MachineConfigurationService.GetMachineEditingComposition(machineGuid); + RaiseMessage(new EditingCompositionLoadedMessage() { EditingComposition = EditingComposition }); + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..250dc1046 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs @@ -0,0 +1,63 @@ +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.FSE.MachineConfiguration.Navigation; +using Tango.SharedUI.Helpers; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + [ModularNavigationContainer] + public class MainViewVM : ConfigurationViewModel + { + public override void OnApplicationReady() + { + if (CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_RunConfigurationModule)) + { + InvokeUI(() => + { + NavigationManager.MenuItems.Add(new NavigationMenuItem(() => + { + NavigationManager.NavigateTo<ConfigurationModule>(); + }) + { + Name = "Configuration", + Index = 8, + Description = "Access to the organization machines configuration and settings", + Image = ResourceHelper.GetImageFromResources("Images/configuration.png"), + }); + }); + } + } + + public async override Task<bool> OnApplicationLogout() + { + while (ModularNavigationManager.CurrentView != ConfigurationView.SelectionView) + { + if (!await ModularNavigationManager.NavigateBack()) + { + return false; + } + } + + return await base.OnApplicationLogout(); + } + + public async override Task<bool> OnNavigateBackRequest() + { + if (ModularNavigationManager.CurrentView == ConfigurationView.SelectionView) + { + return await base.OnNavigateBackRequest(); + } + else + { + await ModularNavigationManager.NavigateBack(); + return false; + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs new file mode 100644 index 000000000..39772a4cf --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.FSE.Common; +using Tango.FSE.MachineConfiguration.Navigation; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + public class SelectionViewVM : ConfigurationViewModel + { + private Machine _selectedMachine; + /// <summary> + /// Gets or sets the selected machine. + /// </summary> + public Machine SelectedMachine + { + get { return _selectedMachine; } + set + { + _selectedMachine = value; + RaisePropertyChangedAuto(); + InvalidateRelayCommands(); + OnSelectedMachineChanged(); + } + } + + public RelayCommand ManageMachineCommand { get; set; } + + public SelectionViewVM() + { + ManageMachineCommand = new RelayCommand(ManageSelectedMachine, () => SelectedMachine != null); + } + + private async void OnSelectedMachineChanged() + { + if (SelectedMachine != null) + { + await Task.Delay(100); + this.SetFocus(() => ManageMachineCommand); + } + } + + private void ManageSelectedMachine() + { + if (SelectedMachine == null) + { + NotificationProvider.ShowError("No machine selected."); + return; + } + + ModularNavigationManager.NavigateTo(ConfigurationView.MachineView, new MachineViewVM.NavigationObject() + { + MachineGuid = SelectedMachine.Guid + }); + } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + if (SelectedMachine == null && MachineProvider.Machine != null) + { + SelectedMachine = MachineProvider.Machine; + } + } + + public override Task<bool> OnApplicationLogout() + { + ModularNavigationManager.NavigateTo(ConfigurationView.SelectionView); + SelectedMachine = null; + return base.OnApplicationLogout(); + } + } +} + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SettingsViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SettingsViewVM.cs new file mode 100644 index 000000000..ed2cbd714 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SettingsViewVM.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.Core.DI; +using Tango.FSE.BL; +using Tango.FSE.Common; +using Tango.FSE.Common.AutoComplete; +using Tango.FSE.Common.SQL; +using Tango.FSE.MachineConfiguration.Messages; +using static Tango.FSE.BL.Services.MachineConfigurationService; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + public class SettingsViewVM : FSEViewModel + { + [TangoInject] + private IRemoteSqlProvider RemoteSqlProvider { get; set; } + + private MachineEditingComposition _editingComposition; + public MachineEditingComposition EditingComposition + { + get { return _editingComposition; } + set { _editingComposition = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand SaveCommand { get; set; } + public RelayCommand ResetCountersCommand { get; set; } + public RelayCommand ResetDeviceRegistrationCommand { get; set; } + + private List<Site> _sites; + public List<Site> Sites + { + get { return _sites; } + set { _sites = value; RaisePropertyChangedAuto(); } + } + + private Site _selectedSite; + public Site SelectedSite + { + get { return _selectedSite; } + set { _selectedSite = value; RaisePropertyChangedAuto(); } + } + + public SettingsViewVM() + { + RegisterForMessage<EditingCompositionLoadedMessage>(OnEditingCompositionLoaded); + SaveCommand = new RelayCommand(SaveConfiguration); + ResetCountersCommand = new RelayCommand(ResetCounters); + ResetDeviceRegistrationCommand = new RelayCommand(ResetDeviceRegistration); + } + + private void OnEditingCompositionLoaded(EditingCompositionLoadedMessage msg) + { + using (NotificationProvider.PushTaskItem("Loading machine configuration...")) + { + EditingComposition = msg.EditingComposition; + EditingComposition.Machine.ForceVersionUpdateChanged += (x, value) => { if (value) EditingComposition.Machine.SuspendVersionUpdate = false; }; + EditingComposition.Machine.SuspendVersionUpdateChanged += (x, value) => { if (value) EditingComposition.Machine.ForceVersionUpdate = false; }; + EditingComposition.Machine.OrganizationChanged -= OnMachine_OrganizationChanged; + EditingComposition.Machine.OrganizationChanged += OnMachine_OrganizationChanged; + OnMachine_OrganizationChanged(EditingComposition.Machine, EditingComposition.Machine.Organization); + } + } + + private void OnMachine_OrganizationChanged(object sender, Organization organization) + { + var sites = organization.Sites.ToList(); + sites.Insert(0, new Site() { Guid = null, Name = "NONE", ID = -1 }); + Sites = sites; + SelectedSite = Sites.FirstOrDefault(x => x.Guid == EditingComposition.Machine.SiteGuid); + + if (SelectedSite == null) + { + SelectedSite = Sites.First(); + } + } + + private async void SaveConfiguration() + { + using (NotificationProvider.PushTaskItem("Saving machine configuration...")) + { + EditingComposition.Machine.SiteGuid = SelectedSite.Guid; + EditingComposition = await Services.MachineConfigurationService.SaveMachineEditingComposition(EditingComposition); + await NotificationProvider.ShowSuccess("Machine configuration saved successfully."); + } + } + + private async void ResetCounters() + { + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_ResetMachineCounters)) + { + await NotificationProvider.ShowError("The current user profile does not allow resetting the machine counters.\nPlease contact your administrator."); + return; + } + + if (!MachineProvider.IsPPCAvailable) + { + await NotificationProvider.ShowError("Resetting the machine counters requires an active connection to this machine."); + return; + } + + if (!await NotificationProvider.ShowWarningQuestion("Resetting the machine counters will delete the entire job runs history. Are you sure?", "RESET COUNTERS", "CANCEL")) return; + + using (var task = NotificationProvider.PushTaskItem("Resetting machine counters...")) + { + task.UpdateProgress("Resetting local machine counters..."); + + var result = await RemoteSqlProvider.ExecuteSqlCommandAsync(new RemoteSqlCommand() + { + Mode = RemoteSqlCommandMode.Local, + Timeout = 30, + SQL = "DELETE FROM JOB_RUNS" + }); + + int localJobRuns = result.LocalAffectedRecords; + + task.UpdateProgress("Resetting global machine counters..."); + + int remoteJobRuns = await Services.MachineConfigurationService.ResetCounters(EditingComposition.Machine.Guid); + + await NotificationProvider.ShowSuccess("Machine counters deleted successfully."); + } + } + + private async void ResetDeviceRegistration() + { + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_ResetMachineDeviceRegistration)) + { + await NotificationProvider.ShowError("The current user profile does not allow resetting the device registration.\nPlease contact your administrator."); + return; + } + + if (!await NotificationProvider.ShowWarningQuestion("Resetting the machine's device registration will allow other panel PCs to perform a machine setup for this machine. Are you sure?", "RESET", "CANCEL")) return; + + EditingComposition.Machine.IsDeviceRegistered = false; + EditingComposition.Machine.DeviceId = null; + EditingComposition.Machine.DeviceName = null; + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml new file mode 100644 index 000000000..52a140c81 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml @@ -0,0 +1,239 @@ +<UserControl x:Class="Tango.FSE.MachineConfiguration.Views.DataStoreView" + 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:Tango.FSE.MachineConfiguration.Views" + xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI" + xmlns:global="clr-namespace:Tango.FSE.MachineConfiguration" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + xmlns:vm="clr-namespace:Tango.FSE.MachineConfiguration.ViewModels" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:commonControls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + xmlns:resolution="clr-namespace:Tango.FSE.Common.Resolution;assembly=Tango.FSE.Common" + xmlns:converters="clr-namespace:Tango.FSE.MachineConfiguration.Converters" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:DataStoreViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.DataStoreViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}"> + + <UserControl.Resources> + <converters:DataStoreValueToStringConverter x:Key="DataStoreValueToStringConverter" /> + </UserControl.Resources> + + <DockPanel Margin="0 10 0 0"> + + <DockPanel DockPanel.Dock="Top"> + <DockPanel DockPanel.Dock="Left" HorizontalAlignment="Left"> + <Image Source="../Images/data_collection.png" Stretch="Uniform" Width="40" RenderOptions.BitmapScalingMode="Fant" Opacity="0.5" /> + <DockPanel Margin="10 0 0 0" > + <TextBlock Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}"> + <Run>The data store contains global and local (machine) configuration and calibration parameters.</Run> + <LineBreak/> + <Run>Updating the data store parameters will take effect on the next machine cloud synchronization pass.</Run> + <LineBreak/> + <Run>If this is the currently connected machine, updating the data store will take effect immediately.</Run> + </TextBlock> + </DockPanel> + </DockPanel> + + <DockPanel DockPanel.Dock="Right" Margin="0 0 10 0" VerticalAlignment="Center" ToolTip="Allow updates on this grid based on changes that are triggered by the machine's firmware device"> + <ToggleButton IsChecked="{Binding DataStoreProvider.AcceptFirmwareChanges}" /> + <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Center">Accept Real-Time Firmware Updates</TextBlock> + </DockPanel> + + <Grid> + + </Grid> + </DockPanel> + + <DockPanel Margin="0 20 0 0"> + <DockPanel DockPanel.Dock="Bottom" > + + <Grid DockPanel.Dock="Left"> + <DockPanel VerticalAlignment="Center" Visibility="{Binding CanSync,Converter={StaticResource BooleanToVisibilityConverter}}"> + <material:PackIcon Kind="InfoCircleOutline" Foreground="{StaticResource FSE_GreenBrush}" /> + <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GreenBrush}" VerticalAlignment="Center" Margin="5 2 0 0">Machine is connected, updating the data store will be take effect immediately.</TextBlock> + </DockPanel> + </Grid> + + <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="0 10 0 5"> + <Button IsEnabled="{Binding IsFree}" ToolTip="Import a data store csv file" Width="120" VerticalAlignment="Center" Margin="0 0 10 0" Height="35" material:ButtonAssist.CornerRadius="18" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Command="{Binding ImportCommand}"> + <DockPanel> + <material:PackIcon Kind="Import" /> + <TextBlock Margin="5 0 0 0">IMPORT</TextBlock> + </DockPanel> + </Button> + <Button IsEnabled="{Binding IsFree}" ToolTip="Export this data store to a csv file" Width="120" VerticalAlignment="Center" Margin="0 0 10 0" Height="35" material:ButtonAssist.CornerRadius="18" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Command="{Binding ExportCommand}"> + <DockPanel> + <material:PackIcon Kind="Export" /> + <TextBlock Margin="5 0 0 0">EXPORT</TextBlock> + </DockPanel> + </Button> + <Button ToolTip="Apply the data store changes" IsEnabled="{Binding IsFree}" Width="200" Height="45" material:ButtonAssist.CornerRadius="25" Command="{Binding SaveCommand}"> + <DockPanel> + <material:PackIcon Kind="ContentSaveAll" /> + <TextBlock Margin="5 0 0 0"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Text" Value="UPDATE"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding CanSync}" Value="True"> + <Setter Property="Text" Value="UPDATE & SYNC"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + </DockPanel> + </Button> + </StackPanel> + + <Grid> + <!--FOOTER CENTER CONTENT--> + </Grid> + </DockPanel> + <Grid> + <DockPanel> + + <Grid DockPanel.Dock="Top" Panel.ZIndex="100"> + <!--TOP BAR--> + + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 5 -45"> + <DockPanel Margin="0 0 20 0" VerticalAlignment="Center"> + <material:PackIcon Kind="Search" resolution:ResolutionHelper.Mode="High" Foreground="{StaticResource FSE_PrimaryAccentBrush}" VerticalAlignment="Center" Width="24" Height="24" Margin="0 0 5 0" /> + <TextBox IsEnabled="{Binding IsFree}" material:HintAssist.Hint="Search" Text="{Binding Filter,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,Delay=500}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Width="250" Style="{StaticResource FSE_Rounded_Corners_TextBox}" Height="33"></TextBox> + </DockPanel> + <controls:TextIconButton IsEnabled="{Binding IsFree}" material:ButtonAssist.CornerRadius="15" Command="{Binding AddItemCommand}" Icon="Add" Width="150">ADD ITEM</controls:TextIconButton> + <commonControls:IconButton Margin="10 0 0 0" Icon="Refresh" Foreground="{StaticResource FSE_PrimaryAccentBrush}" Cursor="Hand" ToolTip="Reload the data store" Command="{Binding ReloadCommand}" /> + </StackPanel> + </Grid> + + <DockPanel> + <!--<TextBlock Margin="0 -25 0 0" DockPanel.Dock="Top" FontFamily="{StaticResource hand}" Foreground="{StaticResource FSE_PrimaryAccentBrush}" FontSize="{StaticResource FSE_LargerFontSize}">Collections</TextBlock>--> + + <DockPanel> + + <Border DockPanel.Dock="Bottom" Height="50" Background="#404040" CornerRadius="0 0 5 5"> + <controls:TextIconButton IsEnabled="{Binding IsFree}" material:ButtonAssist.CornerRadius="15" Command="{Binding AddCollectionCommand}" Icon="Add" Width="180">ADD COLLECTION</controls:TextIconButton> + </Border> + + <Border Padding="8" Background="{StaticResource FSE_PrimaryBackgroundMidBrush}" CornerRadius="5 5 0 0" BorderThickness="1" BorderBrush="{StaticResource FSE_PrimaryBackgroundLightBrush}"> + <ListBox IsEnabled="{Binding IsFree}" ItemsSource="{Binding DataStore.Collections}" SelectedItem="{Binding SelectedCollection}" MinWidth="200" HorizontalContentAlignment="Stretch"> + <ListBox.ItemTemplate> + <DataTemplate> + <DockPanel> + <material:PackIcon Kind="Collection" /> + <controls:IconButton DockPanel.Dock="Right" HorizontalAlignment="Right" ToolTip="Delete collection" Cursor="Hand" Width="20" Height="20" Padding="0" Icon="Close" Foreground="{StaticResource FSE_RedBrush}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveCollectionCommand}" CommandParameter="{Binding}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding Name}"></TextBlock> + </DockPanel> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Border> + </DockPanel> + </DockPanel> + + <Grid Margin="10 0 0 0"> + <Border Background="#8B202020" Padding="0 0 0 5" CornerRadius="5" BorderThickness="1" BorderBrush="{StaticResource FSE_PrimaryBackgroundLightBrush}"> + <Grid> + <Border VerticalAlignment="Top" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Height="47" CornerRadius="5 5 0 0"> + + </Border> + <DataGrid IsEnabled="{Binding IsFree}" IsReadOnly="True" helpers:DataGridHelper.DoubleClickCommand="{Binding EditItemCommand}" AutoGenerateColumns="False" Style="{StaticResource FSE_DataGrid}" CellStyle="{StaticResource FSE_DataGrid_Cell}" CanUserReorderColumns="False" CanUserSortColumns="False" ItemsSource="{Binding SelectedCollection.Items}" SelectedItem="{Binding SelectedItem}"> + <DataGrid.Columns> + <DataGridTemplateColumn Width="50"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <material:PackIcon Kind="Key" Width="32" /> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="KEY" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding Key}"></TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="TYPE" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding Type}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Type}" Value="Boolean"> + <Setter Property="Foreground" Value="#FF9BFF"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Bytes"> + <Setter Property="Foreground" Value="#FFFBA3"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Double"> + <Setter Property="Foreground" Value="#85B1FF"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Float"> + <Setter Property="Foreground" Value="#FFDCB8"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Int32"> + <Setter Property="Foreground" Value="#FF858D "></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="String"> + <Setter Property="Foreground" Value="#B9FFA5"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Type}" Value="Proto"> + <Setter Property="Foreground" Value="#A5FFF9"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="GLOBAL" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding GlobalItem,Converter={StaticResource DataStoreValueToStringConverter},TargetNullValue='-'}"></TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="LOCAL" Width="1*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding FormattedValue,Converter={StaticResource StringToOneLineConverter},ConverterParameter='100',Mode=OneWay}" Visibility="{Binding IsDeleted,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="FontWeight" Value="Normal"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding HasDifference}" Value="True"> + <Setter Property="FontWeight" Value="Bold"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Width="100"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <UniformGrid Columns="2"> + <controls:IconButton ToolTip="Edit local value" Cursor="Hand" Width="20" Padding="0" Height="20" Icon="Edit" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.EditItemCommand}" CommandParameter="{Binding}" /> + <Grid IsEnabled="{Binding IsGlobal,Converter={StaticResource BooleanInverseConverter}}"> + <controls:IconButton ToolTip="Delete local" IsEnabled="{Binding IsDeleted,Converter={StaticResource BooleanInverseConverter}}" Cursor="Hand" Width="20" Height="20" Padding="0" Icon="Close" Foreground="{StaticResource FSE_RedBrush}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveItemCommand}" CommandParameter="{Binding}" /> + </Grid> + </UniformGrid> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </Grid> + </Border> + </Grid> + </DockPanel> + </Grid> + </DockPanel> + </DockPanel> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml.cs new file mode 100644 index 000000000..add553b35 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.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.MachineConfiguration.Views +{ + /// <summary> + /// Interaction logic for MachineDataStoreView.xaml + /// </summary> + public partial class DataStoreView : UserControl + { + public DataStoreView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml new file mode 100644 index 000000000..d33966e18 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml @@ -0,0 +1,49 @@ +<UserControl x:Class="Tango.FSE.MachineConfiguration.Views.MachineView" + 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.MachineConfiguration" + xmlns:vm="clr-namespace:Tango.FSE.MachineConfiguration.ViewModels" + xmlns:local="clr-namespace:Tango.FSE.MachineConfiguration.Views" + xmlns:commonControls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + xmlns:resolution="clr-namespace:Tango.FSE.Common.Resolution;assembly=Tango.FSE.Common" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:MachineViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}"> + <Grid> + + <Grid Margin="0 20 0 0"> + <Grid> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Margin" Value="100 0"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ResolutionService.IsLowResolution}" Value="True"> + <Setter Property="Margin" Value="10"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <DockPanel> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" HorizontalAlignment="Left"> + <Image Source="{StaticResource FSE_Machine_Full}" Width="100" Stretch="Uniform" RenderOptions.BitmapScalingMode="Fant" /> + <StackPanel Margin="5 0 0 0"> + <TextBlock Text="{Binding EditingComposition.Machine.SerialNumber,FallbackValue='101010'}" FontSize="{StaticResource FSE_ModuleHeaderFontSize}"></TextBlock> + <TextBlock Text="{Binding EditingComposition.Machine.Organization.Name,FallbackValue='Organization'}" FontSize="{StaticResource FSE_LargerFontSize}" Foreground="{StaticResource FSE_GrayBrush}"></TextBlock> + </StackPanel> + </StackPanel> + <Grid Margin="0 20 0 0"> + <commonControls:FSETabControl TabsWidth="500" x:Name="tabs" SelectedObject="{Binding SelectedView,Mode=TwoWay}"> + <local:SettingsView Tag="SETTINGS"/> + <local:DataStoreView Tag="DATA STORE"/> + </commonControls:FSETabControl> + + <TextBlock resolution:ResolutionHelper.MinWidth="1500" Margin="10 0 0 0" FontFamily="{StaticResource hand}" FontSize="{StaticResource FSE_ModuleHeaderFontSize}" Foreground="{StaticResource FSE_PrimaryAccentDarkBrush}" VerticalAlignment="Top" HorizontalAlignment="Left" Text="{Binding ElementName=tabs,Path=SelectedElement.Tag,Converter={StaticResource StringToTitleCaseConverter}}"></TextBlock> + </Grid> + </DockPanel> + </Grid> + </Grid> + + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml.cs new file mode 100644 index 000000000..5e4d5ed7d --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.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.MachineConfiguration.Views +{ + /// <summary> + /// Interaction logic for MachineView.xaml + /// </summary> + public partial class MachineView : UserControl + { + public MachineView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml new file mode 100644 index 000000000..a321a1bb8 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml @@ -0,0 +1,18 @@ +<UserControl x:Class="Tango.FSE.MachineConfiguration.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.MachineConfiguration" + xmlns:vm="clr-namespace:Tango.FSE.MachineConfiguration.ViewModels" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.FSE.MachineConfiguration.Views" + mc:Ignorable="d" + d:DesignHeight="1920" d:DesignWidth="1080" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}"> + <Grid> + <controls:NavigationControl TransitionType="Slide" TransitionDuration="00:00:0.2"> + <local:SelectionView/> + <local:MachineView/> + </controls:NavigationControl> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml.cs new file mode 100644 index 000000000..650c297a4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml.cs @@ -0,0 +1,31 @@ +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.MachineConfiguration.Views +{ + /// <summary> + /// Interaction logic for MainView.xaml + /// </summary> + public partial class MainView : UserControl + { + public static MainView Instance { get; set; } + + public MainView() + { + Instance = this; + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml new file mode 100644 index 000000000..51039ca89 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml @@ -0,0 +1,61 @@ +<UserControl x:Class="Tango.FSE.MachineConfiguration.Views.SelectionView" + 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:Tango.FSE.MachineConfiguration.Views" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:global="clr-namespace:Tango.FSE.MachineConfiguration" + xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" + xmlns:vm="clr-namespace:Tango.FSE.MachineConfiguration.ViewModels" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:SelectionViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.SelectionViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}"> + <Grid> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> + + <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource FSE_ModuleHeaderFontSize}">Machine Configuration</TextBlock> + <TextBlock TextWrapping="Wrap" Margin="0 20 0 0" TextAlignment="Center" LineHeight="25"> + <Run>The machine configuration module allows you to manage the currently connected machine configuration and other machine settings.</Run> + <LineBreak/> + <Run>Given the proper permissions, you will also be able to manage other organization machines.</Run> + </TextBlock> + + <StackPanel Margin="0 40 0 0" Width="500" HorizontalAlignment="Center"> + <Image Source="../Images/configuration.png" Stretch="None" /> + + <TextBlock Margin="60" HorizontalAlignment="Center" FontWeight="SemiBold" Foreground="{StaticResource FSE_PrimaryAccentBrush}" FontSize="{StaticResource FSE_LargerFontSize}">Select Machine</TextBlock> + <autoComplete:AutoCompleteTextBox material:HintAssist.Hint="Serial Number" MaxPopupHeight="300" Margin="0 5 0 0" Provider="{Binding MachinesAutoCompleteProvider}" SelectedItem="{Binding SelectedMachine,Mode=TwoWay}" DisplayMember="SerialNumber"> + <autoComplete:AutoCompleteTextBox.SelectedItemTemplate> + <DataTemplate> + <DockPanel VerticalAlignment="Center"> + <Image RenderOptions.BitmapScalingMode="Fant" Source="{StaticResource FSE_Machine_Small}" Width="24" /> + <StackPanel VerticalAlignment="Center" Margin="10 0 0 0" Orientation="Horizontal"> + <TextBlock Text="{Binding SerialNumber}" FontSize="{StaticResource FSE_SmallFontSize}"></TextBlock> + <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Name}"></TextBlock> + </StackPanel> + </DockPanel> + </DataTemplate> + </autoComplete:AutoCompleteTextBox.SelectedItemTemplate> + <autoComplete:AutoCompleteTextBox.ItemTemplate> + <DataTemplate> + <DockPanel VerticalAlignment="Center"> + <Image RenderOptions.BitmapScalingMode="Fant" Source="{StaticResource FSE_Machine_Small}" Width="32" /> + <StackPanel Margin="5 0 0 0"> + <TextBlock Text="{Binding SerialNumber}"></TextBlock> + <TextBlock Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallerFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Name}"></TextBlock> + </StackPanel> + </DockPanel> + </DataTemplate> + </autoComplete:AutoCompleteTextBox.ItemTemplate> + </autoComplete:AutoCompleteTextBox> + + <Button material:ButtonAssist.CornerRadius="25" Command="{Binding ManageMachineCommand}" Margin="0 100 0 0" Height="50" Width="250" FocusVisualStyle="{x:Null}"> + <DockPanel> + <TextBlock>CONTINUE</TextBlock> + <material:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" /> + </DockPanel> + </Button> + </StackPanel> + </StackPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml.cs new file mode 100644 index 000000000..618ae299a --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.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.MachineConfiguration.Views +{ + /// <summary> + /// Interaction logic for MachineSelectionView.xaml + /// </summary> + public partial class SelectionView : UserControl + { + public SelectionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml new file mode 100644 index 000000000..88df5a0b3 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml @@ -0,0 +1,196 @@ +<UserControl x:Class="Tango.FSE.MachineConfiguration.Views.SettingsView" + 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:Tango.FSE.MachineConfiguration.Views" + xmlns:global="clr-namespace:Tango.FSE.MachineConfiguration" + xmlns:auth="clr-namespace:Tango.FSE.Common.Authorization;assembly=Tango.FSE.Common" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:vm="clr-namespace:Tango.FSE.MachineConfiguration.ViewModels" + xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" + xmlns:commonControls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + xmlns:resolution="clr-namespace:Tango.FSE.Common.Resolution;assembly=Tango.FSE.Common" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" + mc:Ignorable="d" + d:DesignHeight="2000" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:SettingsViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.SettingsViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}"> + + <Grid Margin="0 20"> + + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="0 0 20 0" FocusVisualStyle="{x:Null}"> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="4*" /> + <ColumnDefinition Width="5*" /> + </Grid.ColumnDefinitions> + + <!--<Grid Grid.Column="1"> + <commonControls:MachineView Opacity="0.6" DataContext="{Binding EditingComposition.Machine}" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="50 100 50 50" MaxWidth="600" /> + </Grid>--> + + <StackPanel Grid.Column="0" > + + <GroupBox Margin="0 20" Style="{StaticResource FSE_Game_GroupBox}" Header="Provisioning" auth:AuthorizationHelper.Mode="Disabled" auth:AuthorizationHelper.Permission="FSE_ModifyMachineProvisioning"> + <StackPanel Margin="0 0 0 5"> + <DockPanel VerticalAlignment="Top" Margin="0 10 0 0" ToolTip="Activate the windows operating system license"> + <ToggleButton IsChecked="{Binding EditingComposition.Machine.SetupActivation}" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Activate Windows License</TextBlock> + </DockPanel> + + <StackPanel Margin="43 0 0 0"> + <TextBlock Foreground="{StaticResource FSE_GrayBrush}" FontSize="{StaticResource FSE_SmallerFontSize}">License Key</TextBlock> + <TextBox Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding EditingComposition.Machine.OsKey,UpdateSourceTrigger=PropertyChanged}" FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Center" Style="{StaticResource FSE_Rounded_Corners_TextBox}" Margin="0 2 0 0" Width="250" HorizontalAlignment="Left"></TextBox> + </StackPanel> + + <DockPanel Margin="0 20 0 0" ToolTip="Install Team Viewer for remote desktop support"> + <ToggleButton IsChecked="{Binding EditingComposition.Machine.SetupRemoteAssistance}" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Setup Team Viewer</TextBlock> + </DockPanel> + + <DockPanel Margin="0 20 0 0" ToolTip="Perform UWF activation for protecting the disk by resetting file system changes after each system restart"> + <ToggleButton IsChecked="{Binding EditingComposition.Machine.SetupUwf}" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Activate Disk Protection</TextBlock> + </DockPanel> + + <DockPanel Margin="0 20 0 0" ToolTip="Connect the panel PC application to an in-memory emulator (for testing purpose only)"> + <ToggleButton IsChecked="{Binding EditingComposition.Machine.IsDemo}" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Use Firmware Emulator (Demo Machine)</TextBlock> + </DockPanel> + <StackPanel Margin="2 40 0 0"> + + <Separator Margin="0 10" /> + + <TextBlock FontWeight="SemiBold" Foreground="{StaticResource FSE_RedBrush}">Device Registration</TextBlock> + + <DockPanel> + <StackPanel> + + <TextBlock Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}"> + <Run>Registered:</Run> + <Run Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding EditingComposition.Machine.IsDeviceRegistered,Mode=OneWay,Converter={StaticResource BooleanToYesNoConverter},FallbackValue='No'}"></Run> + </TextBlock> + + <TextBlock Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}"> + <Run>Device ID:</Run> + <Run Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding EditingComposition.Machine.DeviceId,Mode=OneWay,FallbackValue='N/A',TargetNullValue='N/A'}"></Run> + </TextBlock> + + <TextBlock Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}"> + <Run>Device Name:</Run> + <Run Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding EditingComposition.Machine.DeviceName,Mode=OneWay,FallbackValue='N/A',TargetNullValue='N/A'}"></Run> + </TextBlock> + </StackPanel> + + <Button Width="180" Command="{Binding ResetDeviceRegistrationCommand}" Margin="0 0 10 0" ToolTip="Device registration protects the system from provisioning of the same machine on multiple devices (panel PC's). Use this reset option when replacing an existing panel PC with a new one." IsEnabled="{Binding Machine.IsDeviceRegistered}" Cursor="Hand" HorizontalAlignment="Right" FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Bottom" Style="{StaticResource FSE_Button_Red}">Reset Device Registration</Button> + </DockPanel> + </StackPanel> + + <StackPanel Margin="2 40 0 0"> + + <Separator Margin="0 10" /> + + <TextBlock FontWeight="SemiBold" Foreground="{StaticResource FSE_RedBrush}">Machine Counters</TextBlock> + + <DockPanel> + <StackPanel> + + <TextBlock Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}"> + <Run>Total Dye Time:</Run> + <Run Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding EditingComposition.TotalDyeTime,Mode=OneWay,FallbackValue='N/A',TargetNullValue='N/A'}"></Run> + </TextBlock> + + <TextBlock Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}"> + <Run>Total Dye Meters:</Run> + <Run Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding EditingComposition.TotalDyeMeters,Mode=OneWay,FallbackValue='N/A',TargetNullValue='N/A'}"></Run> + </TextBlock> + </StackPanel> + + <Button Width="180" Command="{Binding ResetCountersCommand}" Margin="0 0 10 0" ToolTip="Reset the entire job runs history for this machine" IsEnabled="{Binding Machine.IsDeviceRegistered}" Cursor="Hand" HorizontalAlignment="Right" FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Bottom" Style="{StaticResource FSE_Button_Red}">Reset Machine Counters</Button> + </DockPanel> + </StackPanel> + </StackPanel> + </GroupBox> + + <GroupBox Margin="0 20" Style="{StaticResource FSE_Game_GroupBox}" Header="Machine Update" auth:AuthorizationHelper.Mode="Disabled" auth:AuthorizationHelper.Permission="FSE_ModifyMachineUpdate"> + <StackPanel Margin="0 10 0 5"> + <DockPanel ToolTip="Prevent firmware upgrade when updating"> + <ToggleButton material:ToggleButtonAssist.SwitchTrackOnBackground="{StaticResource FSE_PrimaryBackgroundLighterBrush}" IsChecked="{Binding EditingComposition.Machine.SetupFirmware,Converter={StaticResource BooleanInverseConverter}}" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Disable Firmware Upgrade</TextBlock> + </DockPanel> + + <DockPanel Margin="0 20 0 0" ToolTip="Force the machine to perform an update even if there is no update available"> + <ToggleButton IsChecked="{Binding EditingComposition.Machine.ForceVersionUpdate}" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Force Version Update</TextBlock> + </DockPanel> + + <DockPanel Margin="0 20 0 0" ToolTip="Prevent this machine from updating software"> + <ToggleButton IsChecked="{Binding EditingComposition.Machine.SuspendVersionUpdate}" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Suspend Version Update</TextBlock> + </DockPanel> + </StackPanel> + </GroupBox> + + <GroupBox Margin="0 20" Style="{StaticResource FSE_Game_GroupBox}" Header="Machine Identity" auth:AuthorizationHelper.Mode="Disabled" auth:AuthorizationHelper.Permission="FSE_ModifyMachineIdentity"> + <StackPanel Margin="0 0 0 5"> + + <StackPanel Margin="0 10 0 0"> + <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}">Serial Number</TextBlock> + <TextBox Margin="0 2 0 0" Text="{Binding EditingComposition.Machine.SerialNumber}" Width="250" HorizontalAlignment="Left"></TextBox> + </StackPanel> + + <StackPanel Margin="0 20 0 0"> + <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}">Name</TextBlock> + <TextBox Margin="0 2 0 0" Text="{Binding EditingComposition.Machine.Name}" Width="250" HorizontalAlignment="Left"></TextBox> + </StackPanel> + + <StackPanel Margin="0 20 0 0"> + <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}">Organization</TextBlock> + <ComboBox Width="250" HorizontalAlignment="Left" ItemsSource="{Binding EditingComposition.Organizations}" SelectedItem="{Binding EditingComposition.Machine.Organization}" DisplayMemberPath="Name" /> + </StackPanel> + + <StackPanel Margin="0 20 0 0"> + <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}">Site</TextBlock> + <ComboBox Width="250" HorizontalAlignment="Left" ItemsSource="{Binding Sites}" SelectedItem="{Binding SelectedSite}" DisplayMemberPath="Name" /> + </StackPanel> + </StackPanel> + </GroupBox> + + <GroupBox Margin="0 20" Style="{StaticResource FSE_Game_GroupBox}" Header="Hardware" auth:AuthorizationHelper.Mode="Disabled" auth:AuthorizationHelper.Permission="FSE_ModifyMachineHardware"> + <StackPanel> + <StackPanel Margin="0 10 0 0"> + <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}">Head Type</TextBlock> + <ComboBox Width="250" HorizontalAlignment="Left" ItemsSource="{Binding Source={x:Type enumerations:HeadTypes},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding EditingComposition.Machine.MachineHeadType}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" /> + </StackPanel> + + <StackPanel Margin="0 20 0 0"> + <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}">Hardware Version</TextBlock> + <controls:SearchComboBox MinWidth="250" HorizontalAlignment="Left" ItemsSource="{Binding EditingComposition.HardwareVersions}" SelectedItem="{Binding EditingComposition.Machine.Configuration.HardwareVersion}" SearchProperty="FullName" /> + </StackPanel> + </StackPanel> + </GroupBox> + </StackPanel> + </Grid> + </ScrollViewer> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="4*" /> + <ColumnDefinition Width="5*" /> + </Grid.ColumnDefinitions> + + <Grid Grid.Column="1" Margin="0 0 50 0"> + <DockPanel> + <Button Command="{Binding SaveCommand}" DockPanel.Dock="Bottom" VerticalAlignment="Top" HorizontalAlignment="Center" Width="250" Height="50" Margin="0 -40 0 0" material:ButtonAssist.CornerRadius="25"> + <DockPanel> + <material:PackIcon Kind="ContentSave" /> + <TextBlock Margin="5 0 0 0">SAVE</TextBlock> + </DockPanel> + </Button> + <commonControls:MachineView Opacity="0.6" DataContext="{Binding EditingComposition.Machine}" HorizontalAlignment="Center" VerticalAlignment="Top" resolution:ResolutionHelper.HighResolutionMargin="50 50 50 50" resolution:ResolutionHelper.LowResolutionMargin="50 0 50 50" MaxWidth="600" /> + </DockPanel> + </Grid> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml.cs new file mode 100644 index 000000000..bdf8d904d --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.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.MachineConfiguration.Views +{ + /// <summary> + /// Interaction logic for MachineDataStoreView.xaml + /// </summary> + public partial class SettingsView : UserControl + { + public SettingsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/app.config b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/app.config new file mode 100644 index 000000000..36bc04f85 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.MachineConfiguration/packages.config b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/packages.config new file mode 100644 index 000000000..dd8c723e4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.Procedures.Documentation/Help/proc-doc.chm b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm Binary files differindex c77ff4e85..ef7ec26c0 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Tango.FSE.Procedures.Documentation.shfbproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Tango.FSE.Procedures.Documentation.shfbproj index dc353ec12..10bf82219 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Tango.FSE.Procedures.Documentation.shfbproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Tango.FSE.Procedures.Documentation.shfbproj @@ -34,7 +34,7 @@ <DocumentationSource sourceFile="..\Tango.FSE.Procedures\Tango.FSE.Procedures.csproj" /> <DocumentationSource sourceFile="..\..\Tango.FSE.Common\Tango.FSE.Common.csproj" /> <DocumentationSource sourceFile="..\..\..\PPC\Tango.PPC.Shared\Tango.PPC.Shared.csproj" /> - <DocumentationSource sourceFile="..\..\..\Tango.DataStore\Tango.DataStore.csproj" /> + <DocumentationSource sourceFile="..\..\..\DataStore\Tango.DataStore\Tango.DataStore.csproj" /> </DocumentationSources> <HelpFileFormat>HtmlHelp1</HelpFileFormat> <SyntaxFilters>C#</SyntaxFilters> @@ -57,106 +57,107 @@ <VisibleItems>InheritedMembers, InheritedFrameworkMembers, ProtectedInternalAsProtected, NonBrowsable</VisibleItems> <ApiFilter> <Filter entryType="Namespace" fullName="" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.DataStore" isExposed="True"> - <Filter entryType="Class" fullName="Tango.DataStore.DataStoreHelper" filterName="DataStoreHelper" isExposed="False" /> -</Filter> -<Filter entryType="Namespace" fullName="Tango.FSE.Common" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Authentication" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Authorization" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.AutoComplete" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Behaviors" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.BugReporting" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Connection" isExposed="False"> - <Filter entryType="Enumeration" fullName="Tango.FSE.Common.Connection.MachineConnectionTypes" filterName="MachineConnectionTypes" isExposed="True" /> -</Filter> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Connectivity" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Console" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Controls" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Converters" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Core" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.DemoMode" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Diagnostics" isExposed="False"> - <Filter entryType="Class" fullName="Tango.FSE.Common.Diagnostics.DiagnosticsPackage" filterName="DiagnosticsPackage" isExposed="True"> - <Filter entryType="Property" fullName="Tango.FSE.Common.Diagnostics.DiagnosticsPackage.Frame" filterName="Frame" isExposed="False" /> - <Filter entryType="Property" fullName="Tango.FSE.Common.Diagnostics.DiagnosticsPackage.MonitorsProperties" filterName="MonitorsProperties" isExposed="False" /> - </Filter> -</Filter> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Dialogs" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Events" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.EventTriggerActions" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.FileAssociation" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.FileSystem" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Firmware" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.FSEApplication" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Graphs" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Helpers" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Insights" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Logging" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.MachineUpdates" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Modules" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Navigation" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Notifications" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Performance" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.RemoteDesktop" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.RemoteJob" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.RemoteUpgrade" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Resolution" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Storage" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.SystemInfo" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Threading" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Tiles" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.Updates" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Common.WindowsManager" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures" isExposed="False"> - <Filter entryType="Enumeration" fullName="Tango.FSE.Procedures.ArrayParsingStyle" filterName="ArrayParsingStyle" isExposed="True" /> - <Filter entryType="Interface" fullName="Tango.FSE.Procedures.IDialogController" filterName="IDialogController" isExposed="True" /> - <Filter entryType="Interface" fullName="Tango.FSE.Procedures.IProcedureContext" filterName="IProcedureContext" isExposed="True"> - <Filter entryType="Method" fullName="Tango.FSE.Procedures.IProcedureContext.BreakPoint" filterName="BreakPoint" isExposed="False" /> - <Filter entryType="Property" fullName="Tango.FSE.Procedures.IProcedureContext.Results" filterName="Results" isExposed="False" /> - <Filter entryType="Event" fullName="Tango.FSE.Procedures.IProcedureContext.BreakPointRequest" filterName="BreakPointRequest" isExposed="False" /> - <Filter entryType="Event" fullName="Tango.FSE.Procedures.IProcedureContext.Progress" filterName="Progress" isExposed="False" /> - </Filter> - <Filter entryType="Class" fullName="Tango.FSE.Procedures.Result" filterName="Result" isExposed="True"> - <Filter entryType="Property" fullName="Tango.FSE.Procedures.Result.IsBitmap" filterName="IsBitmap" isExposed="False" /> - <Filter entryType="Property" fullName="Tango.FSE.Procedures.Result.IsGraph" filterName="IsGraph" isExposed="False" /> - <Filter entryType="Property" fullName="Tango.FSE.Procedures.Result.IsValueArray" filterName="IsValueArray" isExposed="False" /> - </Filter> - <Filter entryType="Enumeration" fullName="Tango.FSE.Procedures.ResultType" filterName="ResultType" isExposed="True" /> - <Filter entryType="Class" fullName="Tango.FSE.Procedures.UserInput" filterName="UserInput" isExposed="True" /> -</Filter> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Contracts" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Controls" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Converters" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.CSV" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Designer" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Dialogs" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.AddResult" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Connection" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Csv" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Diagnostics" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.RequestUserInputFor" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Send" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.SendContinuous" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Sql" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Helpers" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Messages" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Navigation" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.ViewModels" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Views" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Windows" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.PPC.Shared.Information" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.PPC.Shared.Insights" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.PPC.Shared.Jobs" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.PPC.Shared.Logs" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.PPC.Shared.Performance" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.PPC.Shared.RemoteActions" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.PPC.Shared.RemoteUpgrade" isExposed="False" /> -<Filter entryType="Namespace" fullName="Tango.PPC.Shared.SQL" isExposed="True"> - <Filter entryType="Class" fullName="Tango.PPC.Shared.SQL.ExecuteSqlRequest" filterName="ExecuteSqlRequest" isExposed="False" /> - <Filter entryType="Class" fullName="Tango.PPC.Shared.SQL.ExecuteSqlResponse" filterName="ExecuteSqlResponse" isExposed="False" /> -</Filter> -<Filter entryType="Namespace" fullName="Tango.PPC.Shared.Updates" isExposed="False" /> -<Filter entryType="Namespace" fullName="" isExposed="False" /></ApiFilter> + <Filter entryType="Namespace" fullName="Tango.DataStore" isExposed="True"> + <Filter entryType="Class" fullName="Tango.DataStore.DataStoreHelper" filterName="DataStoreHelper" isExposed="False" /> + </Filter> + <Filter entryType="Namespace" fullName="Tango.FSE.Common" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Authentication" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Authorization" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.AutoComplete" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Behaviors" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.BugReporting" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Connection" isExposed="False"> + <Filter entryType="Enumeration" fullName="Tango.FSE.Common.Connection.MachineConnectionTypes" filterName="MachineConnectionTypes" isExposed="True" /> + </Filter> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Connectivity" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Console" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Controls" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Converters" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Core" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.DemoMode" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Diagnostics" isExposed="False"> + <Filter entryType="Class" fullName="Tango.FSE.Common.Diagnostics.DiagnosticsPackage" filterName="DiagnosticsPackage" isExposed="True"> + <Filter entryType="Property" fullName="Tango.FSE.Common.Diagnostics.DiagnosticsPackage.Frame" filterName="Frame" isExposed="False" /> + <Filter entryType="Property" fullName="Tango.FSE.Common.Diagnostics.DiagnosticsPackage.MonitorsProperties" filterName="MonitorsProperties" isExposed="False" /> + </Filter> + </Filter> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Dialogs" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Events" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.EventTriggerActions" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.FileAssociation" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.FileSystem" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Firmware" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.FSEApplication" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Graphs" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Helpers" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Insights" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Logging" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.MachineUpdates" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Modules" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Navigation" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Notifications" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Performance" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.RemoteDesktop" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.RemoteJob" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.RemoteUpgrade" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Resolution" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Storage" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.SystemInfo" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Threading" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Tiles" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.Updates" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Common.WindowsManager" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures" isExposed="False"> + <Filter entryType="Enumeration" fullName="Tango.FSE.Procedures.ArrayParsingStyle" filterName="ArrayParsingStyle" isExposed="True" /> + <Filter entryType="Interface" fullName="Tango.FSE.Procedures.IDialogController" filterName="IDialogController" isExposed="True" /> + <Filter entryType="Interface" fullName="Tango.FSE.Procedures.IProcedureContext" filterName="IProcedureContext" isExposed="True"> + <Filter entryType="Method" fullName="Tango.FSE.Procedures.IProcedureContext.BreakPoint" filterName="BreakPoint" isExposed="False" /> + <Filter entryType="Property" fullName="Tango.FSE.Procedures.IProcedureContext.Results" filterName="Results" isExposed="False" /> + <Filter entryType="Event" fullName="Tango.FSE.Procedures.IProcedureContext.BreakPointRequest" filterName="BreakPointRequest" isExposed="False" /> + <Filter entryType="Event" fullName="Tango.FSE.Procedures.IProcedureContext.Progress" filterName="Progress" isExposed="False" /> + </Filter> + <Filter entryType="Class" fullName="Tango.FSE.Procedures.Result" filterName="Result" isExposed="True"> + <Filter entryType="Property" fullName="Tango.FSE.Procedures.Result.IsBitmap" filterName="IsBitmap" isExposed="False" /> + <Filter entryType="Property" fullName="Tango.FSE.Procedures.Result.IsGraph" filterName="IsGraph" isExposed="False" /> + <Filter entryType="Property" fullName="Tango.FSE.Procedures.Result.IsValueArray" filterName="IsValueArray" isExposed="False" /> + </Filter> + <Filter entryType="Enumeration" fullName="Tango.FSE.Procedures.ResultType" filterName="ResultType" isExposed="True" /> + <Filter entryType="Class" fullName="Tango.FSE.Procedures.UserInput" filterName="UserInput" isExposed="True" /> + </Filter> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Contracts" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Controls" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Converters" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.CSV" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Designer" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Dialogs" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.AddResult" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Connection" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Csv" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Diagnostics" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.RequestUserInputFor" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Send" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.SendContinuous" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Examples.Sql" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Helpers" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Messages" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Navigation" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.ViewModels" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Views" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.FSE.Procedures.Windows" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.PPC.Shared.Information" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.PPC.Shared.Insights" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.PPC.Shared.Jobs" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.PPC.Shared.Logs" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.PPC.Shared.Performance" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.PPC.Shared.RemoteActions" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.PPC.Shared.RemoteUpgrade" isExposed="False" /> + <Filter entryType="Namespace" fullName="Tango.PPC.Shared.SQL" isExposed="True"> + <Filter entryType="Class" fullName="Tango.PPC.Shared.SQL.ExecuteSqlRequest" filterName="ExecuteSqlRequest" isExposed="False" /> + <Filter entryType="Class" fullName="Tango.PPC.Shared.SQL.ExecuteSqlResponse" filterName="ExecuteSqlResponse" isExposed="False" /> + </Filter> + <Filter entryType="Namespace" fullName="Tango.PPC.Shared.Updates" isExposed="False" /> + <Filter entryType="Namespace" fullName="" isExposed="False" /> + </ApiFilter> <ProjectSummary>This is the global summery for the help file.</ProjectSummary> <NamespaceSummaries> <NamespaceSummaryItem name="(global)" isDocumented="True">This is the global summery for the help file.</NamespaceSummaryItem> @@ -211,10 +212,10 @@ </Content> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\..\Tango.DataStore\Tango.DataStore.csproj"> + <ProjectReference Include="..\..\..\DataStore\Tango.DataStore\Tango.DataStore.csproj"> <Name>Tango.DataStore</Name> <Project>{e0364dfa-0721-4637-9d32-9d22aac109d6}</Project> - <Private>True</Private> + <Private>False</Private> </ProjectReference> <ProjectReference Include="..\..\Tango.FSE.Common\Tango.FSE.Common.csproj"> <Name>Tango.FSE.Common</Name> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Dialogs/SelectFolderDialogView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Dialogs/SelectFolderDialogView.xaml new file mode 100644 index 000000000..0541c5dcb --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Dialogs/SelectFolderDialogView.xaml @@ -0,0 +1,28 @@ +<UserControl x:Class="Tango.FSE.Procedures.Dialogs.SelectFolderDialogView" + 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:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.Procedures.Dialogs" + mc:Ignorable="d" + Width="600" Height="200" d:DataContext="{d:DesignInstance Type=local:SelectFolderDialogViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid Margin="10"> + <DockPanel> + <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> + <material:PackIcon Kind="FolderOpen" Width="32" Height="32" /> + <TextBlock Margin="10 0 0 0" FontSize="{StaticResource FSE_LargeFontSize}" VerticalAlignment="Center">Select Folder</TextBlock> + </StackPanel> + + <StackPanel Margin="0 10 0 0"> + <TextBlock Text="{Binding Message}"></TextBlock> + + <DockPanel Margin="0 5 0 0"> + <controls:IconButton Command="{Binding BrowseCommand}" Margin="5 0 0 0" DockPanel.Dock="Right" Icon="FolderOpen" /> + <TextBox material:HintAssist.Hint="Selected Folder" material:HintAssist.IsFloating="True" Text="{Binding SelectedFolder}" IsReadOnly="True"></TextBox> + </DockPanel> + </StackPanel> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Dialogs/SelectFolderDialogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Dialogs/SelectFolderDialogView.xaml.cs new file mode 100644 index 000000000..846ffa67e --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Dialogs/SelectFolderDialogView.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.Procedures.Dialogs +{ + /// <summary> + /// Interaction logic for UserFileDialogView.xaml + /// </summary> + public partial class SelectFolderDialogView : UserControl + { + public SelectFolderDialogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Dialogs/SelectFolderDialogViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Dialogs/SelectFolderDialogViewVM.cs new file mode 100644 index 000000000..3e871e0ca --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Dialogs/SelectFolderDialogViewVM.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Core.DI; +using Tango.FSE.Common; +using Tango.FSE.Common.Storage; + +namespace Tango.FSE.Procedures.Dialogs +{ + public class SelectFolderDialogViewVM : FSEDialogViewVM + { + [TangoInject] + protected IStorageProvider StorageProvider { get; set; } + + private String _selectedFolder; + public String SelectedFolder + { + get { return _selectedFolder; } + set { _selectedFolder = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public String Message { get; set; } + + public RelayCommand BrowseCommand { get; set; } + + public SelectFolderDialogViewVM(String message) + { + TangoIOC.Default.Inject(this); + + AutoMode = true; + Message = message; + + BrowseCommand = new RelayCommand(BrowseForFolder); + } + + private async void BrowseForFolder() + { + var result = await StorageProvider.SelectFolder("Select folder"); + + if (result.Confirmed) + { + SelectedFolder = result.SelectedItem; + } + } + + protected override bool CanOK() + { + return base.CanOK() && SelectedFolder != null; + } + + protected override void Cancel() + { + SelectedFolder = null; + base.Cancel(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/IProcedureContext.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/IProcedureContext.cs index 69b747906..ff45a7df4 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/IProcedureContext.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/IProcedureContext.cs @@ -496,6 +496,13 @@ namespace Tango.FSE.Procedures String RequestFileSave(String message, String extension = "*.*", String defaultFileName = null); /// <summary> + /// Requests a folder path from the user. + /// </summary> + /// <param name="message">The message.</param> + /// <returns></returns> + String RequestFolderSelect(String message); + + /// <summary> /// Updates the procedure user progress. /// </summary> /// <param name="message">The progress message.</param> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/ProcedureContext.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/ProcedureContext.cs index 43c969a35..f47f1174e 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/ProcedureContext.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/ProcedureContext.cs @@ -566,6 +566,22 @@ namespace Tango.FSE.Procedures return result; } + public string RequestFolderSelect(string message) + { + SelectFolderDialogViewVM vm = new SelectFolderDialogViewVM(message); + + TaskCompletionSource<String> completion = new TaskCompletionSource<String>(); + + DispatcherProvider.Invoke(async () => + { + await NotificationProvider.ShowDialog(vm); + completion.SetResult(vm.SelectedFolder); + }); + + var result = completion.Task.GetAwaiter().GetResult(); + return result; + } + public void UpdateProgress(string message, bool isIndeterminate = true, double value = 0, double maximum = 100) { Progress?.Invoke(this, new TangoProgressChangedEventArgs<double>() diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Tango.FSE.Procedures.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Tango.FSE.Procedures.csproj index 2e7099857..72b3dadd1 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Tango.FSE.Procedures.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Tango.FSE.Procedures.csproj @@ -134,6 +134,10 @@ <DependentUpon>LoadPublishedProjectView.xaml</DependentUpon> </Compile> <Compile Include="Dialogs\LoadPublishedProjectViewVM.cs" /> + <Compile Include="Dialogs\SelectFolderDialogView.xaml.cs"> + <DependentUpon>SelectFolderDialogView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\SelectFolderDialogViewVM.cs" /> <Compile Include="Dialogs\ProcedureDialogEditorView.xaml.cs"> <DependentUpon>ProcedureDialogEditorView.xaml</DependentUpon> </Compile> @@ -284,7 +288,7 @@ <Project>{58e8825f-0c96-449c-b320-1e82b0aa876b}</Project> <Name>Tango.CSV</Name> </ProjectReference> - <ProjectReference Include="..\..\..\Tango.DataStore\Tango.DataStore.csproj"> + <ProjectReference Include="..\..\..\DataStore\Tango.DataStore\Tango.DataStore.csproj"> <Project>{e0364dfa-0721-4637-9d32-9d22aac109d6}</Project> <Name>Tango.DataStore</Name> </ProjectReference> @@ -350,6 +354,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Dialogs\SelectFolderDialogView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Dialogs\ProcedureDialogEditorView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Themes/Generic.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Themes/Generic.xaml index 3917368f2..0e055d730 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Themes/Generic.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Themes/Generic.xaml @@ -635,7 +635,6 @@ </Style.Triggers> </Style> - <Style x:Key="FSE_Debug_TextBoxStyle" TargetType="TextBox"> <Setter Property="Background" Value="Transparent"></Setter> <Setter Property="BorderBrush" Value="{StaticResource FSE_BorderBrush}"></Setter> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/OrganizationSelectionViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/OrganizationSelectionViewVM.cs index 9a84cca7d..0abc285a9 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/OrganizationSelectionViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/OrganizationSelectionViewVM.cs @@ -63,7 +63,7 @@ namespace Tango.FSE.UsersAndRoles.ViewModels try { - return Services.OrganizationsService.GetCurrentUserOrganizations().Result.Where(x => x.Name.ToLower().StartsWith(key.ToLower())).Take(4).ToList(); + return Services.OrganizationsService.GetCurrentUserOrganizations().Result.Where(x => x.Name.ToLower().StartsWith(key.ToLower())).ToList(); } catch (Exception ex) { diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/UserDetailsViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/UserDetailsViewVM.cs index 0e243e02d..20953faa1 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/UserDetailsViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/UserDetailsViewVM.cs @@ -189,9 +189,10 @@ namespace Tango.FSE.UsersAndRoles.ViewModels { collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETwineTechnician), Roles.FSETechnician, Roles.FSEAdvancedTechnician)); collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETwineAdministrator), Roles.FSETechnician, Roles.FSEAdvancedTechnician, Roles.FSEAdministrator, Roles.FSETwineTechnician)); - collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETwineProcedureDesigner), Roles.FSETechnician)); - collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETwineProcedurePublisher), Roles.FSETechnician, Roles.FSETwineProcedureDesigner)); - collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETwineDeveloper), Roles.FSETechnician) { IsVisible = CurrentUser.HasRole(Roles.FSETwineDeveloper) }); + collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETwineProcedureDesigner), Roles.FSETechnician, Roles.FSEAdvancedTechnician, Roles.FSETwineTechnician)); + collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETwineProcedurePublisher), Roles.FSETechnician, Roles.FSEAdvancedTechnician, Roles.FSETwineTechnician, Roles.FSETwineProcedureDesigner)); + collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETwineDataStoreDeveloper), Roles.FSETechnician, Roles.FSEAdvancedTechnician, Roles.FSETwineTechnician)); + collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETwineDeveloper), Roles.FSETechnician, Roles.FSEAdvancedTechnician, Roles.FSETwineTechnician) { IsVisible = CurrentUser.HasRole(Roles.FSETwineDeveloper) }); } collection.ToList().ForEach(x => x.IsSelected = user.FSERoles.Any(y => y.Code == x.Role.Code)); |
