diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-09-16 17:48:16 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-09-16 17:48:16 +0300 |
| commit | 161fe6f6d2b29ba3deb641cdc049ad0d8f58004e (patch) | |
| tree | 20318bb7ea4a243b8c2e9757e4635e8d5f5cb728 /Software/Visual_Studio/MachineStudio/Modules | |
| parent | 30fcfa4100a9d00e887c6e17e32e427b05296ce7 (diff) | |
| parent | b674a2e7751daa80c0d74207968bf8e3d18d7faf (diff) | |
| download | Tango-161fe6f6d2b29ba3deb641cdc049ad0d8f58004e.tar.gz Tango-161fe6f6d2b29ba3deb641cdc049ad0d8f58004e.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
165 files changed, 6570 insertions, 1026 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispenserView.xaml b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispenserView.xaml index 0b295b620..977ab865a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispenserView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispenserView.xaml @@ -45,7 +45,7 @@ <ColumnDefinition Width="237*"/> </Grid.ColumnDefinitions> - <Border Margin="100 140" CornerRadius="5" Background="#68F6F6F6" Padding="10" BorderBrush="Silver" BorderThickness="1"> + <Border Margin="100 140" CornerRadius="5" Background="{StaticResource TransparentBackgroundBrush600}" Padding="10" BorderBrush="Silver" BorderThickness="1"> <controls:TableGrid RowHeight="50" Margin="10"> <TextBlock FontWeight="SemiBold">Serial Number:</TextBlock> <TextBox Text="{Binding ActiveDispenser.SerialNumber}"></TextBox> diff --git a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispensersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispensersView.xaml index a8262667e..7caca4b40 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispensersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Views/DispensersView.xaml @@ -32,13 +32,13 @@ </Grid> <Grid DockPanel.Dock="Bottom" IsEnabled="{Binding IsFree}"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0"> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveDispenserCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveDispenserCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddDispenserCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddDispenserCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">NEW DISPENSER</TextBlock> @@ -55,7 +55,7 @@ </StackPanel> </Grid> <Grid IsEnabled="{Binding IsFree}"> - <controls:DoubleClickDataGrid Style="{StaticResource {x:Type DataGrid}}" DoubleClickCommand="{Binding ManageDispenserCommand}" Margin="0 0 0 10" BorderBrush="Silver" IsReadOnly="True" BorderThickness="1" Background="#93FFFFFF" AlternatingRowBackground="#C9F6F6F6" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Dispensers}" SelectedItem="{Binding SelectedDispenser}"> + <controls:DoubleClickDataGrid Style="{StaticResource {x:Type DataGrid}}" DoubleClickCommand="{Binding ManageDispenserCommand}" Margin="0 0 0 10" BorderBrush="{StaticResource borderBrush}" IsReadOnly="True" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Dispensers}" SelectedItem="{Binding SelectedDispenser}"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/App.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/App.config new file mode 100644 index 000000000..2285e8847 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/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> + <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> + <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="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="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="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="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="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/CatalogsModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/CatalogsModule.cs new file mode 100644 index 000000000..389a2cb5d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/CatalogsModule.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.BL.Enumerations; +using Tango.MachineStudio.Catalogs.Views; +using Tango.MachineStudio.Common; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.Catalogs +{ + [StudioModule(20)] + public class CatalogsModule : StudioModuleBase + { + public override string Name + { + get + { + return "Catalogs"; + } + } + + public override string Description + { + get + { + return "Create and manage Twine's global color catalogs."; + } + } + + public override BitmapSource Image + { + get + { + return ResourceHelper.GetImageFromResources("Images/catalogs_module.jpg"); + } + } + + public override Type MainViewType + { + get + { + return typeof(MainView); + } + } + + public override Permissions Permission + { + get + { + return Permissions.RunCatalogsModule; + } + } + + public override void Dispose() + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Contracts/IMainView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Contracts/IMainView.cs new file mode 100644 index 000000000..615dec081 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Contracts/IMainView.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.MachineStudio.Catalogs.Contracts +{ + public enum CatalogsNavigationView + { + CatalogsView, + CatalogView, + } + + public interface IMainView : IView + { + void NavigateTo(CatalogsNavigationView view); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Converters/ObservableCollectionToViewSourceConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Converters/ObservableCollectionToViewSourceConverter.cs new file mode 100644 index 000000000..050539741 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Converters/ObservableCollectionToViewSourceConverter.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.MachineStudio.Catalogs.Converters +{ + public class ObservableCollectionToViewSourceConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + String sortMember = parameter != null ? parameter.ToString() : null; + IList list = value as IList; + if (list != null) + { + var view = CollectionViewSource.GetDefaultView(list); + view.SortDescriptions.Clear(); + + //Delay because the DataGrid clears the sort description after source change. + Task.Factory.StartNew(() => + { + Thread.Sleep(10); + + Application.Current.Dispatcher.BeginInvoke(new Action(() => + { + view.SortDescriptions.Add(new SortDescription(sortMember, ListSortDirection.Ascending)); + view.Refresh(); + })); + }); + return view; + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/ColorGroup.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/ColorGroup.cs new file mode 100644 index 000000000..852311883 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/ColorGroup.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; + +namespace Tango.MachineStudio.Catalogs.Excel +{ + public class ColorGroup + { + public Color GroupColor { get; set; } + public String GroupName { get; set; } + public int GroupIndex { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/ColorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/ColorItem.cs new file mode 100644 index 000000000..9d5011325 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/ColorItem.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; + +namespace Tango.MachineStudio.Catalogs.Excel +{ + public class ColorItem + { + public Color ItemColor { get; set; } + public String Group { get; set; } + public int Code { get; set; } + public String Name { get; set; } + public int ItemIndex { get; set; } + public int Red { get; set; } + public int Green { get; set; } + public int Blue { get; set; } + public double L { get; set; } + public double A { get; set; } + public double B { get; set; } + public double Cyan { get; set; } + public double Magenta { get; set; } + public double Yellow { get; set; } + public double Black { get; set; } + public int Region { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/ColorRecipe.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/ColorRecipe.cs new file mode 100644 index 000000000..724652cd4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/ColorRecipe.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; + +namespace Tango.MachineStudio.Catalogs.Excel +{ + public class ColorRecipe + { + public Color R_Color { get; set; } + public String R_Name { get; set; } + public String R_Media { get; set; } + public double R_Cyan { get; set; } + public double R_Magenta { get; set; } + public double R_Yellow { get; set; } + public double R_Black { get; set; } + public int R_Region { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/Media.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/Media.cs new file mode 100644 index 000000000..d65b1a986 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Excel/Media.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Catalogs.Excel +{ + public class Media + { + public String MediaName { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Images/catalogs.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Images/catalogs.png Binary files differnew file mode 100644 index 000000000..4e38508f5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Images/catalogs.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Images/catalogs_module.jpg b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Images/catalogs_module.jpg Binary files differnew file mode 100644 index 000000000..bc551452b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Images/catalogs_module.jpg diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..9cafc7e46 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +[assembly: AssemblyTitle("Tango - Machine Studio Catalogs Module")] +[assembly: AssemblyVersion("2.0.12.1608")] + +[assembly: ComVisible(false)] + +[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) +)] diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/Resources.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/Resources.Designer.cs new file mode 100644 index 000000000..c272c440d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// <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.MachineStudio.Catalogs.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.MachineStudio.Catalogs.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/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/Resources.resx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/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/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/Settings.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/Settings.Designer.cs new file mode 100644 index 000000000..8a2599f0a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/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.MachineStudio.Catalogs.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/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/Settings.settings b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/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/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Tango.MachineStudio.Catalogs.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Tango.MachineStudio.Catalogs.csproj new file mode 100644 index 000000000..5473c28bc --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Tango.MachineStudio.Catalogs.csproj @@ -0,0 +1,174 @@ +<?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>{7D0FCE3C-9A37-439C-9F9F-B26CFD6A8A33}</ProjectGuid> + <OutputType>library</OutputType> + <RootNamespace>Tango.MachineStudio.Catalogs</RootNamespace> + <AssemblyName>Tango.MachineStudio.Catalogs</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> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\..\Build\Machine Studio\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\Machine Studio\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <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="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath> + </Reference> + <Reference Include="MaterialDesignColors, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll</HintPath> + </Reference> + <Reference Include="MaterialDesignThemes.Wpf, Version=2.3.1.953, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.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\MahApps.Metro.1.5.0\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="Contracts\IMainView.cs" /> + <Compile Include="Converters\ObservableCollectionToViewSourceConverter.cs" /> + <Compile Include="Excel\ColorGroup.cs" /> + <Compile Include="Excel\ColorItem.cs" /> + <Compile Include="Excel\ColorRecipe.cs" /> + <Compile Include="Excel\Media.cs" /> + <Compile Include="ViewModelLocator.cs" /> + <Compile Include="ViewModels\MainViewVM.cs" /> + <Compile Include="Views\CatalogView.xaml.cs"> + <DependentUpon>CatalogView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\CatalogsView.xaml.cs"> + <DependentUpon>CatalogsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\MainView.xaml.cs"> + <DependentUpon>MainView.xaml</DependentUpon> + </Compile> + <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> + <Link>GlobalVersionInfo.cs</Link> + </Compile> + <Compile Include="CatalogsModule.cs" /> + <Page Include="Views\CatalogView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\CatalogsView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\MainView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + </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> + <EmbeddedResource Include="Templates\ExportTemplate.xlsx" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj"> + <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> + <Name>Tango.BL</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.ColorConversion\Tango.ColorConversion.csproj"> + <Project>{b4fe6485-4161-4b36-bc08-67e0b53d01b7}</Project> + <Name>Tango.ColorConversion</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Documents\Tango.Documents.csproj"> + <Project>{ca87a608-7b17-4c98-88f2-42abee10f4c1}</Project> + <Name>Tango.Documents</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Logging\Tango.Logging.csproj"> + <Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project> + <Name>Tango.Logging</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.MachineStudio.Common\Tango.MachineStudio.Common.csproj"> + <Project>{cb0b0aa2-bb24-4bca-a720-45e397684e12}</Project> + <Name>Tango.MachineStudio.Common</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\catalogs.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\catalogs_module.jpg" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Models\" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Templates/ExportTemplate - BACKUP.xlsx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Templates/ExportTemplate - BACKUP.xlsx Binary files differnew file mode 100644 index 000000000..44abd31db --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Templates/ExportTemplate - BACKUP.xlsx diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Templates/ExportTemplate - bad.xlsx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Templates/ExportTemplate - bad.xlsx Binary files differnew file mode 100644 index 000000000..d95727038 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Templates/ExportTemplate - bad.xlsx diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Templates/ExportTemplate.xlsx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Templates/ExportTemplate.xlsx Binary files differnew file mode 100644 index 000000000..e57422725 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Templates/ExportTemplate.xlsx diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModelLocator.cs new file mode 100644 index 000000000..27970c466 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModelLocator.cs @@ -0,0 +1,29 @@ +using Tango.Core.DI; +using Tango.MachineStudio.Catalogs.ViewModels; +using Tango.MachineStudio.Catalogs.Views; + +namespace Tango.MachineStudio.Catalogs +{ + /// <summary> + /// This class contains static references to all the view models in the + /// application and provides an entry point for the bindings. + /// </summary> + public static class ViewModelLocator + { + /// <summary> + /// Initializes a new instance of the ViewModelLocator class. + /// </summary> + static ViewModelLocator() + { + TangoIOC.Default.Register<MainViewVM>(); + } + + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance<MainViewVM>(); + } + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..652ad3093 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/ViewModels/MainViewVM.cs @@ -0,0 +1,602 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; +using Tango.MachineStudio.Common; +using System.Data.Entity; +using Tango.MachineStudio.Catalogs.Contracts; +using Tango.MachineStudio.Common.Notifications; +using Tango.Core.Commands; +using Tango.BL.Builders; +using Tango.Documents; +using Microsoft.Win32; +using Tango.Core.Helpers; +using System.IO; +using Tango.MachineStudio.Catalogs.Excel; + +namespace Tango.MachineStudio.Catalogs.ViewModels +{ + public class MainViewVM : StudioViewModel<IMainView> + { + private ObservablesContext _catalogsContext; + private ObservablesContext _activeCatalogContext; + private INotificationProvider _notification; + + #region Properties + + private ObservableCollection<ColorCatalog> _catalogs; + /// <summary> + /// Gets or sets the catalogs. + /// </summary> + public ObservableCollection<ColorCatalog> Catalogs + { + get { return _catalogs; } + set { _catalogs = value; RaisePropertyChangedAuto(); } + } + + private ColorCatalog _selectedCatalog; + /// <summary> + /// Gets or sets the selected catalog. + /// </summary> + public ColorCatalog SelectedCatalog + { + get { return _selectedCatalog; } + set { _selectedCatalog = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + private ColorCatalog _activeCatalog; + /// <summary> + /// Gets or sets the active catalog. + /// </summary> + public ColorCatalog ActiveCatalog + { + get { return _activeCatalog; } + set { _activeCatalog = value; RaisePropertyChangedAuto(); } + } + + private ColorCatalogsGroup _selectedGroup; + /// <summary> + /// Gets or sets the selected group. + /// </summary> + public ColorCatalogsGroup SelectedGroup + { + get { return _selectedGroup; } + set { _selectedGroup = value; RaisePropertyChangedAuto(); } + } + + private ColorCatalogsItem _selectedItem; + /// <summary> + /// Gets or sets the selected item. + /// </summary> + public ColorCatalogsItem SelectedItem + { + get { return _selectedItem; } + set { _selectedItem = value; RaisePropertyChangedAuto(); } + } + + private List<Rml> _rmls; + /// <summary> + /// Gets or sets the RMLS. + /// </summary> + public List<Rml> RMLS + { + get { return _rmls; } + set { _rmls = value; RaisePropertyChangedAuto(); } + } + + #endregion + + #region Commands + + /// <summary> + /// Gets or sets the new catalog command. + /// </summary> + public RelayCommand NewCatalogCommand { get; set; } + + /// <summary> + /// Gets or sets the delete catalog command. + /// </summary> + public RelayCommand DeleteCatalogCommand { get; set; } + + /// <summary> + /// Gets or sets the edit catalog command. + /// </summary> + public RelayCommand EditCatalogCommand { get; set; } + + /// <summary> + /// Gets or sets the back to catalogs command. + /// </summary> + public RelayCommand BackToCatalogsCommand { get; set; } + + /// <summary> + /// Gets or sets the save active catalog command. + /// </summary> + public RelayCommand SaveActiveCatalogCommand { get; set; } + + /// <summary> + /// Gets or sets the export excel command. + /// </summary> + public RelayCommand ExportExcelCommand { get; set; } + + /// <summary> + /// Gets or sets the import excel command. + /// </summary> + public RelayCommand ImportExcelCommand { get; set; } + + #endregion + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="MainViewVM"/> class. + /// </summary> + public MainViewVM() + { + Catalogs = new ObservableCollection<ColorCatalog>(); + + EditCatalogCommand = new RelayCommand(EditSelectedCatalog, () => SelectedCatalog != null); + NewCatalogCommand = new RelayCommand(CreateNewCatalog); + DeleteCatalogCommand = new RelayCommand(DeleteSelectedCatalog, () => SelectedCatalog != null); + BackToCatalogsCommand = new RelayCommand(BackToCatalogs); + SaveActiveCatalogCommand = new RelayCommand(SaveActiveCatalog); + ExportExcelCommand = new RelayCommand(ExportCatalogToExcel); + ImportExcelCommand = new RelayCommand(ImportCatalogFromExcel); + } + + /// <summary> + /// Initializes a new instance of the <see cref="MainViewVM"/> class. + /// </summary> + /// <param name="notificationProvider">The notification provider.</param> + public MainViewVM(INotificationProvider notificationProvider) : this() + { + _notification = notificationProvider; + } + + #endregion + + #region Edit / Delete / Create Catalog + + public async Task LoadCatalogs() + { + using (_notification.PushTaskItem("Loading color catalogs...")) + { + IsFree = false; + + if (_catalogsContext != null) + { + _catalogsContext.Dispose(); + } + + _catalogsContext = ObservablesContext.CreateDefault(); + + Catalogs = (await _catalogsContext.ColorCatalogs.Include(x => x.ColorCatalogsGroups.Select(g => g.ColorCatalogsItems)).ToListAsync()).ToSynchronizedObservableCollection(); + SelectedCatalog = null; + + IsFree = true; + } + } + + public async void EditSelectedCatalog() + { + if (SelectedCatalog != null) + { + using (_notification.PushTaskItem("Loading selected catalog...")) + { + try + { + IsFree = false; + + if (_activeCatalogContext != null) + { + _activeCatalogContext.Dispose(); + } + + _activeCatalogContext = ObservablesContext.CreateDefault(); + + ActiveCatalog = await new ColorCatalogBuilder(_activeCatalogContext).Set(SelectedCatalog.Guid).WithGroups().WithItems().WithRecipes().BuildAsync(); + SelectedGroup = ActiveCatalog.ColorCatalogsGroups.FirstOrDefault(); + RMLS = await _activeCatalogContext.Rmls.ToListAsync(); + + if (SelectedGroup != null) + { + SelectedItem = SelectedGroup.ColorCatalogsItems.FirstOrDefault(); + } + + View.NavigateTo(CatalogsNavigationView.CatalogView); + } + catch (Exception ex) + { + _notification.ShowError($"An error occurred while trying to load the selected catalog.\n{ex.Message}"); + LogManager.Log(ex, $"Error loading selected catalog '{SelectedCatalog.Name}'."); + } + finally + { + IsFree = true; + } + } + } + } + + private async void DeleteSelectedCatalog() + { + if (SelectedCatalog != null) + { + if (_notification.ShowQuestion("Are you sure you want to delete the selected catalog ?")) + { + using (_notification.PushTaskItem("Deleting selected catalog...")) + { + try + { + IsFree = false; + await SelectedCatalog.DeleteCascadeAsync(_catalogsContext); + SelectedCatalog = null; + } + catch (Exception ex) + { + _notification.ShowError($"An error occurred while trying to delete the selected catalog.\n{ex.Message}"); + LogManager.Log(ex, $"Error deleting catalog {SelectedCatalog.Name}."); + } + finally + { + IsFree = true; + } + } + } + } + } + + private async void CreateNewCatalog() + { + String name = _notification.ShowTextInput("Please enter a catalog name", "Catalog name"); + if (!String.IsNullOrWhiteSpace(name)) + { + using (_notification.PushTaskItem("Generating catalog...")) + { + try + { + IsFree = false; + ColorCatalog newCatalog = new ColorCatalog(); + newCatalog.Name = name; + newCatalog.Description = name; + newCatalog.Company = "Twine"; + _catalogsContext.ColorCatalogs.Add(newCatalog); + await _catalogsContext.SaveChangesAsync(); + SelectedCatalog = newCatalog; + EditSelectedCatalog(); + } + catch (Exception ex) + { + _notification.ShowError($"An error occurred while trying to create the catalog.\n{ex.Message}"); + LogManager.Log(ex, $"Error creating new catalog."); + } + finally + { + IsFree = true; + } + } + } + } + + public void OnGroupDeleted(ColorCatalogsGroup group) + { + group.Delete(_activeCatalogContext); + } + + public void OnItemDeleted(ColorCatalogsItem item) + { + item.Delete(_activeCatalogContext); + } + + public void OnRecipeDeleted(ColorCatalogsItemsRecipe recipe) + { + recipe.Delete(_activeCatalogContext); + } + + private async void SaveActiveCatalog() + { + if (ActiveCatalog != null) + { + using (_notification.PushTaskItem("Updating catalog...")) + { + try + { + IsFree = false; + await _activeCatalogContext.SaveChangesAsync(); + await LoadCatalogs(); + _notification.ShowInfo("Catalog updated successfully."); + } + catch (Exception ex) + { + _notification.ShowError($"An error occurred while trying to update the catalog.\n{ex.Message}"); + LogManager.Log(ex, $"Error updating catalog {ActiveCatalog.Name}."); + } + finally + { + IsFree = true; + } + } + } + } + + private void BackToCatalogs() + { + View.NavigateTo(CatalogsNavigationView.CatalogsView); + } + + #endregion + + #region Export / Import Excel + + public void ExportCatalogToExcel() + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Filter = "Excel Documents|*.xlsx"; + if (dlg.ShowDialog().Value) + { + using (_notification.PushTaskItem("Exporting catalog to file...")) + { + Task.Factory.StartNew(() => + { + try + { + IsFree = false; + + Stream stream = null; + bool dispose = false; + String file = AssemblyHelper.GetCurrentAssemblyFolder() + "\\Templates\\ExportTemplate.xlsx"; + + if (File.Exists(file)) + { + stream = File.OpenRead(file); + dispose = true; + } + else + { + stream = EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.MachineStudio.Catalogs.Templates.ExportTemplate.xlsx"); + } + + byte[] data = new byte[stream.Length]; + stream.Read(data, 0, data.Length); + File.WriteAllBytes(dlg.FileName, data); + + if (dispose) + { + stream.Dispose(); + } + + ExcelWriter writer = new ExcelWriter(dlg.FileName); + + List<Media> medias = RMLS.Select(x => new Media() + { + MediaName = x.Name, + }).ToList(); + + writer.WriteData(medias, "RML"); + + List<ColorGroup> groups = ActiveCatalog.ColorCatalogsGroups.Select(x => new ColorGroup() + { + GroupColor = x.Color, + GroupName = x.Name, + GroupIndex = x.GroupIndex, + }).ToList(); + + writer.WriteData(groups, "Groups"); + + List<ColorItem> items = ActiveCatalog.ColorCatalogsGroups.SelectMany(x => x.ColorCatalogsItems).Select(x => new ColorItem() + { + + ItemColor = x.Color, + Group = x.ColorCatalogsGroup.Name, + Code = x.Code, + Name = x.Name, + ItemIndex = x.ItemIndex, + Red = x.Red, + Green = x.Green, + Blue = x.Blue, + L = x.L, + A = x.A, + B = x.B, + Cyan = x.Cyan, + Magenta = x.Magenta, + Yellow = x.Yellow, + Black = x.Black, + Region = x.ProcessParametersTableIndex, + + }).ToList(); + + writer.WriteData(items, "Colors"); + + List<ColorRecipe> recipes = ActiveCatalog.ColorCatalogsGroups.SelectMany(x => x.ColorCatalogsItems).SelectMany(x => x.ColorCatalogsItemsRecipes).Select(x => new ColorRecipe() + { + + R_Color = x.ColorCatalogsItem.Color, + R_Name = x.ColorCatalogsItem.Name, + R_Media = x.Rml.Name, + R_Cyan = x.Cyan, + R_Magenta = x.Magenta, + R_Yellow = x.Yellow, + R_Black = x.Black, + R_Region = x.ProcessParametersTableIndex, + + + }).ToList(); + + writer.WriteData(recipes, "Recipes"); + + writer.Dispose(); + + InvokeUI(() => + { + _notification.ShowInfo("Catalog exported successfully."); + }); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error exporting color catalog to {dlg.FileName}"); + + InvokeUI(() => + { + _notification.ShowError($"An error occurred while trying to export the catalog. Make sure the selected excel file is closed and data is valid.\n{ex.FlattenMessage()}"); + }); + } + finally + { + IsFree = true; + } + }); + } + } + } + + public void ImportCatalogFromExcel() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "Excel Documents|*.xlsx"; + if (dlg.ShowDialog().Value) + { + using (_notification.PushTaskItem("Merging catalog from file...")) + { + Task.Factory.StartNew(() => + { + try + { + ExcelReader reader = new ExcelReader(dlg.FileName); + var groups = reader.GetData<ColorGroup>("Groups"); + reader.Dispose(); + + reader = new ExcelReader(dlg.FileName); + var colors = reader.GetData<ColorItem>("Colors"); + reader.Dispose(); + + reader = new ExcelReader(dlg.FileName); + var recipes = reader.GetData<ColorRecipe>("Recipes"); + reader.Dispose(); + + foreach (var group in groups) + { + ColorCatalogsGroup existinGroup = ActiveCatalog.ColorCatalogsGroups.SingleOrDefault(x => x.Name == group.GroupName); + + bool inserting = false; + if (existinGroup == null) + { + existinGroup = new ColorCatalogsGroup(); + inserting = true; + } + + existinGroup.Name = group.GroupName; + existinGroup.GroupIndex = group.GroupIndex; + + if (inserting) + { + ActiveCatalog.ColorCatalogsGroups.Add(existinGroup); + } + } + + foreach (var item in colors) + { + var existinItem = ActiveCatalog.ColorCatalogsGroups.SelectMany(x => x.ColorCatalogsItems).SingleOrDefault(x => x.Code == item.Code); + var group = ActiveCatalog.ColorCatalogsGroups.SingleOrDefault(x => x.Name == item.Group); + + bool inserting = false; + + if (existinItem == null) + { + existinItem = new ColorCatalogsItem(); + inserting = true; + } + else + { + if (existinItem.ColorCatalogsGroup != group) + { + existinItem.ColorCatalogsGroup.ColorCatalogsItems.Remove(existinItem); + group.ColorCatalogsItems.Add(existinItem); + } + } + + existinItem.ColorCatalogsGroup = group; + existinItem.Code = item.Code; + existinItem.Name = item.Name; + existinItem.ItemIndex = item.ItemIndex; + existinItem.Red = item.Red; + existinItem.Green = item.Green; + existinItem.Blue = item.Blue; + existinItem.L = item.L; + existinItem.A = item.A; + existinItem.B = item.B; + existinItem.Cyan = item.Cyan; + existinItem.Magenta = item.Magenta; + existinItem.Yellow = item.Yellow; + existinItem.Black = item.Black; + existinItem.ProcessParametersTableIndex = item.Region; + + if (inserting) + { + _activeCatalogContext.ColorCatalogsItems.Add(existinItem); + } + } + + foreach (var recipe in recipes) + { + var existingRecipe = ActiveCatalog.ColorCatalogsGroups.SelectMany(x => x.ColorCatalogsItems).SelectMany(x => x.ColorCatalogsItemsRecipes).SingleOrDefault(x => x.ColorCatalogsItem.Name == recipe.R_Name && x.Rml.Name == recipe.R_Media); + + bool inserting = false; + + if (existingRecipe == null) + { + existingRecipe = new ColorCatalogsItemsRecipe(); + existingRecipe.Rml = RMLS.SingleOrDefault(x => x.Name == recipe.R_Media); + existingRecipe.ColorCatalogsItem = ActiveCatalog.ColorCatalogsGroups.SelectMany(x => x.ColorCatalogsItems).SingleOrDefault(x => x.Name == recipe.R_Name); + inserting = true; + } + + existingRecipe.Cyan = recipe.R_Cyan; + existingRecipe.Magenta = recipe.R_Magenta; + existingRecipe.Yellow = recipe.R_Yellow; + existingRecipe.Black = recipe.R_Black; + existingRecipe.ProcessParametersTableIndex = recipe.R_Region; + + if (inserting) + { + _activeCatalogContext.ColorCatalogsItemsRecipes.Add(existingRecipe); + } + } + + InvokeUI(() => + { + _notification.ShowInfo("Catalog imported successfully."); + }); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error importing color catalog to {dlg.FileName}"); + + InvokeUI(() => + { + _notification.ShowError($"An error occurred while trying to merge the catalog. Please check your data.\n{ex.FlattenMessage()}"); + }); + } + finally + { + IsFree = true; + } + }); + } + } + } + + #endregion + + #region Application Ready + + public async override void OnApplicationReady() + { + await LoadCatalogs(); + } + + #endregion + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml new file mode 100644 index 000000000..ded1acb2d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml @@ -0,0 +1,232 @@ +<UserControl x:Class="Tango.MachineStudio.Catalogs.Views.CatalogView" + 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:vm="clr-namespace:Tango.MachineStudio.Catalogs.ViewModels" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:localConverters="clr-namespace:Tango.MachineStudio.Catalogs.Converters" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:global="clr-namespace:Tango.MachineStudio.Catalogs" + xmlns:local="clr-namespace:Tango.MachineStudio.Catalogs.Views" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" Foreground="#232323" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + + <UserControl.Resources> + <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> + <localConverters:ObservableCollectionToViewSourceConverter x:Key="ObservableCollectionToViewSourceConverter" /> + + <Style x:Key="EditableGrid" TargetType="DataGrid" BasedOn="{StaticResource {x:Type DataGrid}}"> + <Setter Property="AutoGenerateColumns" Value="False"></Setter> + </Style> + + <Style x:Key="EditableCell" TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type DataGridCell}"> + <Grid Background="{TemplateBinding Background}"> + <ContentPresenter VerticalAlignment="Center" Margin="8" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="VerticalContentAlignment" Value="Center"></Setter> + <Style.Triggers> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="BorderBrush" Value="Cyan"/> + </Trigger> + </Style.Triggers> + </Style> + + </UserControl.Resources> + + <Grid Margin="20"> + <DockPanel> + <Grid DockPanel.Dock="Top"> + <StackPanel Orientation="Horizontal"> + <Button Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Command="{Binding BackToCatalogsCommand}"> + <materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="#202020" ToolTip="Back to RML list" /> + </Button> + <TextBlock Text="{Binding ActiveCatalog.Name}" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="34"></TextBlock> + </StackPanel> + + <StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> + <Button Background="#65C682" BorderBrush="#65C682" Width="170" Height="45" VerticalAlignment="Center" Command="{Binding ImportExcelCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Import" Width="24" Height="24" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">IMPORT EXCEL</TextBlock> + </StackPanel> + </Button> + <Button Margin="10 0 0 0" Background="#65C682" BorderBrush="#65C682" Width="170" Height="45" VerticalAlignment="Center" Command="{Binding ExportExcelCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Export" Width="24" Height="24" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">EXPORT EXCEL</TextBlock> + </StackPanel> + </Button> + <Button Margin="10 0 0 0" Width="170" Height="45" VerticalAlignment="Center" Command="{Binding SaveActiveCatalogCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="ContentSaveAll" Width="24" Height="24" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">SAVE</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Grid> + + <Grid Margin="0 20"> + <Grid.RowDefinitions> + <RowDefinition Height="113*"/> + <RowDefinition Height="358*"/> + </Grid.RowDefinitions> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="302*"/> + <ColumnDefinition Width="399*"/> + <ColumnDefinition Width="1179*"/> + </Grid.ColumnDefinitions> + + <Grid Margin="10"> + <materialDesign:Card Background="{DynamicResource MaterialDesignBackground}" VerticalAlignment="Stretch"> + <Border Padding="20"> + <DockPanel> + <TextBlock DockPanel.Dock="Top" FontSize="16">PROPERTIES</TextBlock> + <controls:TableGrid RowHeight="35"> + <TextBlock Text="Company:" ></TextBlock> + <TextBox Text="{Binding ActiveCatalog.Company}"></TextBox> + + <TextBlock Text="Name:" ></TextBlock> + <TextBox Text="{Binding ActiveCatalog.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox> + + <TextBlock Text="Description:" ></TextBlock> + <TextBox Text="{Binding ActiveCatalog.Description}"></TextBox> + + <TextBlock Text="Design:" ></TextBlock> + <ComboBox ItemsSource="{Binding Source={x:Type enumerations:CatalogDesignType},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding ActiveCatalog.Design}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></ComboBox> + + </controls:TableGrid> + </DockPanel> + </Border> + </materialDesign:Card> + </Grid> + + <Grid Grid.Column="1" Margin="10"> + <materialDesign:Card Background="{DynamicResource MaterialDesignBackground}" VerticalAlignment="Stretch"> + <Border Padding="20"> + <DockPanel> + <TextBlock DockPanel.Dock="Top" FontSize="16">DESIGN CONTENT</TextBlock> + + </DockPanel> + </Border> + </materialDesign:Card> + </Grid> + + <Grid Grid.ColumnSpan="3"> + + </Grid> + </Grid> + + <Grid Grid.Row="1" Margin="0 20 0 0"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="300"/> + <ColumnDefinition Width="930"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + + <DockPanel Margin="10"> + <TextBlock DockPanel.Dock="Top" FontSize="16">CATALOG GROUPS</TextBlock> + + <materialDesign:Card Margin="0 5 0 0" Background="{DynamicResource MaterialDesignBackground}" VerticalAlignment="Stretch"> + <DataGrid x:Name="gridGroups" Style="{StaticResource EditableGrid}" CellStyle="{StaticResource EditableCell}" ItemsSource="{Binding ActiveCatalog.ColorCatalogsGroups,Converter={StaticResource ObservableCollectionToViewSourceConverter},ConverterParameter='GroupIndex'}" SelectedItem="{Binding SelectedGroup}" CanUserDeleteRows="False" PreviewKeyDown="OnGroupsGrid_PreviewKeyDown"> + <DataGrid.Columns> + <DataGridTemplateColumn Header="" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Ellipse Width="30" Height="30"> + <Ellipse.Fill> + <SolidColorBrush Color="{Binding Color}" /> + </Ellipse.Fill> + </Ellipse> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="NAME" Binding="{Binding Name}" Width="150" /> + <DataGridTextColumn Header="IDX" Binding="{Binding GroupIndex}" Width="1*" SortMemberPath="GroupIndex" SortDirection="Ascending" /> + </DataGrid.Columns> + </DataGrid> + </materialDesign:Card> + </DockPanel> + + + <DockPanel Margin="10" Grid.Column="1"> + <TextBlock DockPanel.Dock="Top" FontSize="16"> + <Run>GROUP COLORS</Run> + <Run>(</Run><Run Text="{Binding SelectedGroup.ColorCatalogsItems.Count,Mode=OneWay}"></Run><Run>)</Run> + </TextBlock> + <materialDesign:Card Margin="0 5 0 0" Background="{DynamicResource MaterialDesignBackground}" VerticalAlignment="Stretch"> + <DataGrid x:Name="gridItems" Style="{StaticResource EditableGrid}" CellStyle="{StaticResource EditableCell}" ItemsSource="{Binding SelectedGroup.ColorCatalogsItems,Converter={StaticResource ObservableCollectionToViewSourceConverter},ConverterParameter='ItemIndex'}" SelectedItem="{Binding SelectedItem}" PreviewKeyDown="OnItemsGrid_PreviewKeyDown"> + <DataGrid.Columns> + <DataGridTemplateColumn Header="" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Ellipse Width="25" Height="25"> + <Ellipse.Fill> + <SolidColorBrush Color="{Binding Color}" /> + </Ellipse.Fill> + </Ellipse> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="CODE" Binding="{Binding Code}" Width="Auto" /> + <DataGridTextColumn Header="NAME" Binding="{Binding Name}" Width="Auto" /> + <DataGridTextColumn Header="IDX" Binding="{Binding ItemIndex}" Width="Auto" /> + + <DataGridTextColumn Header="R" Binding="{Binding Red,UpdateSourceTrigger=PropertyChanged}" Width="Auto" /> + <DataGridTextColumn Header="G" Binding="{Binding Green,UpdateSourceTrigger=PropertyChanged}" Width="Auto" /> + <DataGridTextColumn Header="B" Binding="{Binding Blue,UpdateSourceTrigger=PropertyChanged}" Width="Auto" /> + + <DataGridTextColumn Header="L" Binding="{Binding L}" Width="60" /> + <DataGridTextColumn Header="A" Binding="{Binding A}" Width="60" /> + <DataGridTextColumn Header="B" Binding="{Binding B}" Width="60" /> + + <DataGridTextColumn Header="CYAN" Binding="{Binding Cyan}" Width="65" /> + <DataGridTextColumn Header="MAGENTA" Binding="{Binding Magenta}" Width="80" /> + <DataGridTextColumn Header="YELLOW" Binding="{Binding Yellow}" Width="70" /> + <DataGridTextColumn Header="BLACK" Binding="{Binding Black}" Width="65" /> + + <DataGridTextColumn Header="REGION" Binding="{Binding ProcessParametersTableIndex}" Width="69" /> + </DataGrid.Columns> + </DataGrid> + </materialDesign:Card> + </DockPanel> + + <DockPanel Margin="10" Grid.Column="2"> + <TextBlock DockPanel.Dock="Top" FontSize="16"> + <Run>COLOR MEDIA RECIPES</Run> + <Run>(</Run><Run Text="{Binding SelectedItem.ColorCatalogsItemsRecipes.Count,Mode=OneWay}"></Run><Run>)</Run> + </TextBlock> + <materialDesign:Card Margin="0 5 0 0" Background="{DynamicResource MaterialDesignBackground}" VerticalAlignment="Stretch"> + <DataGrid x:Name="gridRecipes" Style="{StaticResource EditableGrid}" CellStyle="{StaticResource EditableCell}" ItemsSource="{Binding SelectedItem.ColorCatalogsItemsRecipes}" PreviewKeyDown="OnRecipesGrid_PreviewKeyDown" CanUserSortColumns="False"> + <DataGrid.Columns> + <materialDesign:MaterialDataGridComboBoxColumn Header="MEDIA" Width="180" SortMemberPath="Name" ItemsSourceBinding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RMLS}" SelectedItemBinding="{Binding Rml}" DisplayMemberPath="Name" /> + <DataGridTextColumn Header="CYAN" Binding="{Binding Cyan}" Width="80" /> + <DataGridTextColumn Header="MAGENTA" Binding="{Binding Magenta}" Width="80" /> + <DataGridTextColumn Header="YELLOW" Binding="{Binding Yellow}" Width="80" /> + <DataGridTextColumn Header="BLACK" Binding="{Binding Black}" Width="80" /> + <DataGridTextColumn Header="REGION" Binding="{Binding ProcessParametersTableIndex}" Width="Auto" /> + </DataGrid.Columns> + </DataGrid> + </materialDesign:Card> + </DockPanel> + </Grid> + </Grid> + </Grid> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml.cs new file mode 100644 index 000000000..4ba37416d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogView.xaml.cs @@ -0,0 +1,59 @@ +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; +using Tango.MachineStudio.Catalogs.ViewModels; + +namespace Tango.MachineStudio.Catalogs.Views +{ + /// <summary> + /// Interaction logic for CatalogsView.xaml + /// </summary> + public partial class CatalogView : UserControl + { + private MainViewVM _vm; + + public CatalogView() + { + InitializeComponent(); + Loaded += (_, __) => _vm = DataContext as MainViewVM; + } + + private void OnGroupsGrid_PreviewKeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Delete && gridGroups.SelectedItem != null) + { + _vm.OnGroupDeleted(gridGroups.SelectedItem as BL.Entities.ColorCatalogsGroup); + e.Handled = true; + } + } + + private void OnItemsGrid_PreviewKeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Delete && gridItems.SelectedItem != null) + { + _vm.OnItemDeleted(gridItems.SelectedItem as BL.Entities.ColorCatalogsItem); + e.Handled = true; + } + } + + private void OnRecipesGrid_PreviewKeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Delete && gridRecipes.SelectedItem != null) + { + _vm.OnRecipeDeleted(gridRecipes.SelectedItem as BL.Entities.ColorCatalogsItemsRecipe); + e.Handled = true; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogsView.xaml new file mode 100644 index 000000000..221afe568 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogsView.xaml @@ -0,0 +1,78 @@ +<UserControl x:Class="Tango.MachineStudio.Catalogs.Views.CatalogsView" + 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:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:vm="clr-namespace:Tango.MachineStudio.Catalogs.ViewModels" + xmlns:global="clr-namespace:Tango.MachineStudio.Catalogs" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.MachineStudio.Catalogs.Views" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" Foreground="#BBBBBB" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + + <UserControl.Resources> + <converters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter" /> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + + <Grid> + <DockPanel Margin="100" MaxWidth="1200"> + <Grid DockPanel.Dock="Top"> + <Image Source="../Images/catalogs.png" Width="200" Margin="10" /> + </Grid> + <Grid DockPanel.Dock="Bottom"> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding DeleteCatalogCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> + <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> + </StackPanel> + </Button> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding NewCatalogCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> + <TextBlock Margin="5 0 0 0" FontSize="16">NEW CATALOG</TextBlock> + </StackPanel> + </Button> + </StackPanel> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Margin="50 0 0 0" MinWidth="200" Height="60" Command="{Binding EditCatalogCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Pencil" Width="24" Height="24" /> + <TextBlock Margin="10 0 0 0" FontSize="18">EDIT</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Grid> + <Grid> + <DataGrid Margin="0 0 0 10" BorderBrush="Silver" IsReadOnly="True" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Catalogs}" SelectedItem="{Binding SelectedCatalog}"> + <DataGrid.CellStyle> + <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="VerticalContentAlignment" Value="Center"></Setter> + </Style> + </DataGrid.CellStyle> + <DataGrid.Columns> + <!--<DataGridTemplateColumn Header="#" Width="Auto"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn>--> + <DataGridTextColumn Header="COMPANY" Binding="{Binding Company}" Width="Auto" /> + <DataGridTextColumn Header="NAME" Binding="{Binding Name}" Width="Auto" /> + <DataGridTextColumn Header="DESCRIPTION" Binding="{Binding Description}" Width="Auto" /> + <DataGridTextColumn Header="DESIGN" Binding="{Binding Design}" Width="Auto" /> + <DataGridTextColumn Header="GROUPS" Binding="{Binding ColorCatalogsGroups.Count}" Width="Auto" /> + <DataGridTextColumn Header="COLORS" Binding="{Binding TotalColors}" Width="Auto" /> + <DataGridTextColumn Header="LAST UPDATED" Binding="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="1*" /> + </DataGrid.Columns> + </DataGrid> + </Grid> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogsView.xaml.cs new file mode 100644 index 000000000..02418b677 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/CatalogsView.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.MachineStudio.Catalogs.Views +{ + /// <summary> + /// Interaction logic for CatalogsView.xaml + /// </summary> + public partial class CatalogsView : UserControl + { + public CatalogsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/MainView.xaml new file mode 100644 index 000000000..140a616e1 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/MainView.xaml @@ -0,0 +1,18 @@ +<UserControl x:Class="Tango.MachineStudio.Catalogs.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:local="clr-namespace:Tango.MachineStudio.Catalogs.Views" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.Catalogs.ViewModels" + xmlns:global="clr-namespace:Tango.MachineStudio.Catalogs" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" Foreground="#BBBBBB" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + <Grid IsEnabled="{Binding IsFree}"> + <controls:NavigationControl x:Name="navigationControl" TransitionType="Slide"> + <local:CatalogsView /> + <local:CatalogView/> + </controls:NavigationControl> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/MainView.xaml.cs new file mode 100644 index 000000000..fdfd23c2b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/Views/MainView.xaml.cs @@ -0,0 +1,36 @@ +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; +using Tango.Core.DI; +using Tango.MachineStudio.Catalogs.Contracts; + +namespace Tango.MachineStudio.Catalogs.Views +{ + /// <summary> + /// Interaction logic for MainView.xaml + /// </summary> + public partial class MainView : UserControl, IMainView + { + public MainView() + { + InitializeComponent(); + TangoIOC.Default.Register<IMainView>(this); + } + + public void NavigateTo(CatalogsNavigationView view) + { + navigationControl.NavigateTo(view.ToString()); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/packages.config new file mode 100644 index 000000000..2c357dae6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Catalogs/packages.config @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="EntityFramework" version="6.2.0" targetFramework="net461" /> + <package id="MahApps.Metro" version="1.5.0" targetFramework="net461" /> + <package id="MaterialDesignColors" version="1.1.2" targetFramework="net461" /> + <package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net461" /> +</packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/CaptureMode.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/CaptureMode.cs index 389bff178..7e38b57ae 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/CaptureMode.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/CaptureMode.cs @@ -10,6 +10,7 @@ namespace Tango.MachineStudio.ColorCapture { Camera, Emulated2D, - Emulated3D + Emulated3D, + Desktop } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Contracts/IMainView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Contracts/IMainView.cs index 3c0a5ecca..333ad4457 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Contracts/IMainView.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Contracts/IMainView.cs @@ -10,6 +10,7 @@ namespace Tango.MachineStudio.ColorCapture.Contracts { public interface IMainView : IView { + event Action<BitmapSource> DesktopCaptured; void SetCardSource(BitmapSource source); BitmapSource GetViewportImage(); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Tango.MachineStudio.ColorCapture.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Tango.MachineStudio.ColorCapture.csproj index 4825f1812..dab747e8d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Tango.MachineStudio.ColorCapture.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Tango.MachineStudio.ColorCapture.csproj @@ -84,6 +84,7 @@ <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath> </Reference> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs index 2cf3ed63f..3be6bf8e2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs @@ -20,6 +20,7 @@ using System.Windows.Media.Imaging; using System.Windows.Threading; using Tango.Core; using Tango.Core.Commands; +using Tango.Core.ExtensionMethods; using Tango.Core.Threading; using Tango.CSV; using Tango.Logging; @@ -307,6 +308,12 @@ namespace Tango.MachineStudio.ColorCapture.ViewModels SelectedVideoDevice = videoProvider.AvailableCaptureDevices.FirstOrDefault(); } + protected override void OnViewAttached(IMainView view) + { + base.OnViewAttached(view); + view.DesktopCaptured += View_DesktopCaptured; + } + private void OnCaptureModeChanged() { if (CaptureMode == CaptureMode.Emulated2D || CaptureMode == CaptureMode.Emulated3D) @@ -770,6 +777,12 @@ namespace Tango.MachineStudio.ColorCapture.ViewModels View.SetCardSource(EmulatedImage); }); + Rgb rgb = new Rgb(EmulatedR, EmulatedG, EmulatedB); + Lab lab = rgb.To<Lab>(); + MeasureL = lab.L; + MeasureA = lab.A; + MeasureB = lab.B; + PerformDetection(bitmapContainer.ToBitmapSource()); bitmapContainer.Dispose(); @@ -793,5 +806,10 @@ namespace Tango.MachineStudio.ColorCapture.ViewModels } } } + + private void View_DesktopCaptured(BitmapSource source) + { + PerformDetection(source); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml index 96e5fc488..f4bb09caa 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml @@ -35,11 +35,11 @@ <SolidColorBrush x:Key="Foreground" Color="#BBBBBB" /> <SolidColorBrush x:Key="Background" Color="#202020" /> - <SolidColorBrush x:Key="Accent" Color="#03A9F4" /> - <SolidColorBrush x:Key="Red" Color="#FF5F5F" /> - <SolidColorBrush x:Key="Green" Color="#68E46E" /> - <SolidColorBrush x:Key="Blue" Color="#64B8EC" /> - <SolidColorBrush x:Key="BorderBrush" Color="#3E3E3E" /> + <SolidColorBrush x:Key="Accent" Color="{Binding Color, Source={StaticResource BlueBrush100}}" /> + <SolidColorBrush x:Key="Red" Color="{Binding Color, Source={StaticResource RedBrush100}}" /> + <SolidColorBrush x:Key="Green" Color="{Binding Color, Source={StaticResource GreenBrush100}}"/> + <SolidColorBrush x:Key="Blue" Color="{Binding Color, Source={StaticResource BlueBrush}}" /> + <SolidColorBrush x:Key="BorderBrush" Color="{Binding Color, Source={StaticResource GrayBrush280}}" /> <SolidColorBrush x:Key="LightBackground" Color="#303030" /> <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> @@ -237,7 +237,6 @@ </Grid> </Grid> - <!--{Binding CaptureMode,Converter={StaticResource CaptureModeToVisibilityConverter},ConverterParameter={x:Static global:CaptureMode.Emulated3D}}--> <Grid Visibility="{Binding CaptureMode,Converter={StaticResource CaptureModeToVisibilityConverter},ConverterParameter={x:Static global:CaptureMode.Emulated3D}}"> <Grid.RowDefinitions> <RowDefinition Height="60"/> @@ -335,6 +334,37 @@ </Grid> </Grid> </Grid> + + <Grid Visibility="{Binding CaptureMode,Converter={StaticResource CaptureModeToVisibilityConverter},ConverterParameter={x:Static global:CaptureMode.Desktop}}"> + <Grid.RowDefinitions> + <RowDefinition Height="60"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Grid Background="{StaticResource Background}"> + + </Grid> + + <Grid x:Name="desktopRectGrid" Grid.Row="1" Background="{StaticResource Background}" Margin="1" ClipToBounds="True"> + <Canvas> + <Grid x:Name="desktopRect" Width="200" Height="200" Canvas.Left="10" Canvas.Top="10"> + <Image x:Name="desktopImage" Stretch="Fill" /> + <Rectangle Fill="Gray" Stroke="White" StrokeThickness="1" Opacity="0.5" /> + <Thumb x:Name="thumbMove" DragDelta="thumbMove_DragDelta" Opacity="0" Cursor="SizeAll" /> + <Thumb x:Name="thumbWidth" DragDelta="thumbWidth_DragDelta" Opacity="0" HorizontalAlignment="Right" Width="5" Margin="0 0 -2 0" Cursor="SizeWE" /> + <Thumb x:Name="thumbHeight" DragDelta="thumbHeight_DragDelta" Opacity="0" VerticalAlignment="Bottom" Height="5" Margin="0 0 0 -2" Cursor="SizeNS" /> + </Grid> + </Canvas> + + <TextBlock x:Name="txtDesktop" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="{StaticResource Red}" Text="0,0 100x100" Margin="5"></TextBlock> + + <Button Click="CaptureClick" Margin="10" Height="35" HorizontalAlignment="Right" VerticalAlignment="Top" Style="{StaticResource MaterialDesignFlatButton}" BorderBrush="{StaticResource Accent}" BorderThickness="1"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Flash" VerticalAlignment="Center" /> + </StackPanel> + </Button> + </Grid> + </Grid> </Grid> </Border> @@ -462,17 +492,17 @@ <UniformGrid Columns="3" Margin="20 0 70 0"> <DockPanel> <TextBlock FontWeight="SemiBold">L:</TextBlock> - <mahapps:NumericUpDown BorderBrush="{StaticResource BorderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureL,UpdateSourceTrigger=PropertyChanged}" Minimum="0" Maximum="100" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> + <mahapps:NumericUpDown BorderBrush="{StaticResource borderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureL,UpdateSourceTrigger=PropertyChanged}" Minimum="0" Maximum="100" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> </DockPanel> <DockPanel> <TextBlock Margin="20 0 0 0" FontWeight="SemiBold">A:</TextBlock> - <mahapps:NumericUpDown BorderBrush="{StaticResource BorderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureA,UpdateSourceTrigger=PropertyChanged}" Minimum="-127" Maximum="128" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> + <mahapps:NumericUpDown BorderBrush="{StaticResource borderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureA,UpdateSourceTrigger=PropertyChanged}" Minimum="-127" Maximum="128" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> </DockPanel> <DockPanel> <TextBlock Margin="20 0 0 0" FontWeight="SemiBold">B:</TextBlock> - <mahapps:NumericUpDown BorderBrush="{StaticResource BorderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureB,UpdateSourceTrigger=PropertyChanged}" Minimum="-127" Maximum="128" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> + <mahapps:NumericUpDown BorderBrush="{StaticResource borderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureB,UpdateSourceTrigger=PropertyChanged}" Minimum="-127" Maximum="128" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> </DockPanel> </UniformGrid> </DockPanel> @@ -627,7 +657,7 @@ </Grid> </Grid> - <UniformGrid VerticalAlignment="Top" HorizontalAlignment="Left" Width="340" Columns="3" Margin="200 -35 0 0"> + <UniformGrid VerticalAlignment="Top" HorizontalAlignment="Left" Width="450" Columns="4" Margin="100 -35 0 0"> <Button Command="{Binding CaptureModeCommand}" CommandParameter="{x:Static global:CaptureMode.Camera}" Height="35" Style="{StaticResource MaterialDesignFlatButton}" BorderThickness="0" Padding="5"> <StackPanel Orientation="Horizontal"> <StackPanel.Style> @@ -676,6 +706,22 @@ <TextBlock Margin="5 0 0 0">Emulated 3D</TextBlock> </StackPanel> </Button> + <Button Command="{Binding CaptureModeCommand}" CommandParameter="{x:Static global:CaptureMode.Desktop}" Height="35" Style="{StaticResource MaterialDesignFlatButton}" BorderThickness="0" Padding="5"> + <StackPanel Orientation="Horizontal"> + <StackPanel.Style> + <Style TargetType="StackPanel"> + <Setter Property="TextElement.Foreground" Value="#808080"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding CaptureMode}" Value="{x:Static global:CaptureMode.Desktop}"> + <Setter Property="TextElement.Foreground" Value="{StaticResource Accent}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </StackPanel.Style> + <materialDesign:PackIcon Kind="Monitor" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">Desktop</TextBlock> + </StackPanel> + </Button> </UniformGrid> </Grid> </TabItem> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml.cs index 2759b44dc..097116be4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml.cs @@ -16,6 +16,7 @@ using System.Windows.Media.Media3D; using System.Windows.Navigation; using System.Windows.Shapes; using Tango.Core.DI; +using Tango.Core.Threading; using Tango.MachineStudio.ColorCapture.Contracts; using Tango.MachineStudio.ColorCapture.Models; using Tango.MachineStudio.ColorCapture.ViewModels; @@ -27,7 +28,12 @@ namespace Tango.MachineStudio.ColorCapture.Views /// </summary> public partial class MainView : UserControl, IMainView { + public event Action<BitmapSource> DesktopCaptured; + private MainViewVM _vm; + private double _captureMaxWidth; + private double _captureMaxHeight; + private ActionTimer _desktopTimer; public MainView() { @@ -44,6 +50,11 @@ namespace Tango.MachineStudio.ColorCapture.Views viewport.ChangeFieldOfViewGesture = new MouseGesture(MouseAction.LeftClick, ModifierKeys.Shift); TangoIOC.Default.Register<IMainView>(this); + + _captureMaxWidth = System.Windows.Forms.Screen.AllScreens.Sum(x => x.Bounds.Width); + _captureMaxHeight = System.Windows.Forms.Screen.AllScreens.Max(x => x.Bounds.Height); + + _desktopTimer = new ActionTimer(TimeSpan.FromMilliseconds(100)); } private void OnResetBrightness(object sender, MouseButtonEventArgs e) @@ -102,8 +113,6 @@ namespace Tango.MachineStudio.ColorCapture.Views g.CopyFromScreen((int)location.X, (int)location.Y, 0, 0, bmp.Size); } - bmp.Save("D:\\Test\\ttt.bmp"); - using (MemoryStream ms = new MemoryStream()) { bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); @@ -145,5 +154,76 @@ namespace Tango.MachineStudio.ColorCapture.Views lightsContainer.Children.Add(_vm.Emulated3DModel.CurrentLight); } } + + private void thumbMove_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e) + { + Canvas.SetLeft(desktopRect, Canvas.GetLeft(desktopRect) + e.HorizontalChange); + Canvas.SetTop(desktopRect, Canvas.GetTop(desktopRect) + e.VerticalChange); + CaptureDesktop(); + } + + private void thumbWidth_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e) + { + if (desktopRect.Width + e.HorizontalChange > 10) + { + desktopRect.Width += e.HorizontalChange; + CaptureDesktop(); + } + } + + private void thumbHeight_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e) + { + if (desktopRect.Height + e.VerticalChange > 10) + { + desktopRect.Height += e.VerticalChange; + CaptureDesktop(); + } + } + + protected void CaptureDesktop() + { + _desktopTimer.ResetReplace(() => + { + Dispatcher.BeginInvoke(new Action(() => + { + + double left = (Canvas.GetLeft(desktopRect) / desktopRectGrid.ActualWidth) * _captureMaxWidth; + double top = (Canvas.GetTop(desktopRect) / desktopRectGrid.ActualHeight) * _captureMaxHeight; + double right = ((Canvas.GetLeft(desktopRect) + desktopRect.Width) / desktopRectGrid.ActualWidth) * _captureMaxWidth; + double bottom = ((Canvas.GetTop(desktopRect) + desktopRect.Height) / desktopRectGrid.ActualHeight) * _captureMaxHeight; + double width = right - left; + double height = bottom - top; + + txtDesktop.Text = $"{(int)left},{(int)top} {(int)width}x{(int)height}"; + + try + { + using (System.Drawing.Bitmap bmp = new System.Drawing.Bitmap((int)width, (int)height)) + { + using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp)) + { + g.CopyFromScreen((int)left, (int)top, 0, 0, bmp.Size); + } + + using (MemoryStream ms = new MemoryStream()) + { + bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); + ms.Position = 0; + var source = ms.ToArray().ToBitmapSource(); + desktopImage.Source = source; + DesktopCaptured?.Invoke(source); + } + } + } + catch { } + + })); + }); + } + + private void CaptureClick(object sender, RoutedEventArgs e) + { + CaptureDesktop(); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Models/CctModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Models/CctModel.cs new file mode 100644 index 000000000..bb5525ffb --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Models/CctModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.ColorLab.Models +{ + public class CctModel + { + public String Guid { get; set; } + public String FileName { get; set; } + public bool IsNew { get; set; } + public byte[] Data { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj index b1e6c05da..ef01ae5f9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj @@ -73,6 +73,7 @@ <Link>GlobalVersionInfo.cs</Link> </Compile> <Compile Include="ColorLabModuleSettings.cs" /> + <Compile Include="Models\CctModel.cs" /> <Compile Include="ViewModelLocator.cs" /> <Compile Include="ViewModels\CalibrationDataPointVM.cs" /> <Compile Include="ViewModels\CalibrationDataViewVM.cs" /> @@ -128,6 +129,10 @@ <Project>{40085232-aced-4cbe-945b-90ba8153c151}</Project> <Name>Tango.BrushPicker</Name> </ProjectReference> + <ProjectReference Include="..\..\..\Tango.ColorConversion\Tango.ColorConversion.csproj"> + <Project>{b4fe6485-4161-4b36-bc08-67e0b53d01b7}</Project> + <Name>Tango.ColorConversion</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Tango.ColorPicker\Tango.ColorPicker.csproj"> <Project>{a2f5af44-29ff-45d6-9d25-ecda5cce88b5}</Project> <Name>Tango.ColorPicker</Name> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs index f01637b5b..a521127e1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs @@ -6,16 +6,18 @@ using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using System.Windows.Media; using Tango.BL; using Tango.BL.Builders; -using Tango.BL.ColorConversion; using Tango.BL.Entities; using Tango.BL.Enumerations; +using Tango.ColorConversion; using Tango.Core.Commands; +using Tango.MachineStudio.ColorLab.Models; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Controls; using Tango.MachineStudio.Common.Notifications; @@ -24,6 +26,7 @@ using Tango.PMR.ColorLab; using Tango.Settings; using Tango.SharedUI; using Tango.SharedUI.Controls; +using System.Data.Entity; namespace Tango.MachineStudio.ColorLab.ViewModels { @@ -31,7 +34,6 @@ namespace Tango.MachineStudio.ColorLab.ViewModels { private ObservablesContext _dbContext; private INotificationProvider _notification; - private bool _isNewCCT; private bool _prevent_inverse_conversion; #region Properties @@ -182,16 +184,40 @@ namespace Tango.MachineStudio.ColorLab.ViewModels set { _targetColor = value; RaisePropertyChangedAuto(); } } - private Cct _cct; - /// <summary> - /// Gets or sets the CCT. - /// </summary> - public Cct CCT + private ObservableCollection<CctModel> _ccts; + public ObservableCollection<CctModel> CCTS { - get { return _cct; } - set { _cct = value; RaisePropertyChangedAuto(); } + get { return _ccts; } + set + { + _ccts = value; + RaisePropertyChangedAuto(); + } + } + + private CctModel _selectedCCT; + public CctModel SelectedCCT + { + get { return _selectedCCT; } + set + { + _selectedCCT = value; + RaisePropertyChangedAuto(); + InvalidateRelayCommands(); + OnSelectedCCTChanged(); + } } + //private Cct _cct; + ///// <summary> + ///// Gets or sets the CCT. + ///// </summary> + //public Cct CCT + //{ + // get { return _cct; } + // set { _cct = value; RaisePropertyChangedAuto(); } + //} + private int _deltaChroma; /// <summary> /// Gets or sets the delta chroma. @@ -248,12 +274,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels public RelayCommand ImportForwardDataCommand { get; set; } - public RelayCommand ImportInverseDataCommand { get; set; } - public RelayCommand ExportForwardDataCommand { get; set; } - public RelayCommand ExportInverseDataCommand { get; set; } - public RelayCommand SaveCommand { get; set; } #endregion @@ -268,16 +290,14 @@ namespace Tango.MachineStudio.ColorLab.ViewModels { _notification = notification; - CCT = new Cct(); + // CCT = new Cct(); SourceColor = new RgbVM(); SourceColor.ColorChanged += SourceColor_ColorChanged; ImportForwardDataCommand = new RelayCommand(ImportForwardData, () => SelectedRML != null && IsFree); - ImportInverseDataCommand = new RelayCommand(ImportInverseData, () => SelectedRML != null && IsFree); - ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && CCT != null && CCT.ForwardFileName != null && IsFree); - ExportInverseDataCommand = new RelayCommand(ExportInverseData, () => SelectedRML != null && CCT != null && CCT.InverseFileName != null && IsFree); + ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && SelectedCCT != null && IsFree); SaveCommand = new RelayCommand(Save, () => SelectedRML != null && IsFree); } @@ -304,6 +324,15 @@ namespace Tango.MachineStudio.ColorLab.ViewModels Machines = _dbContext.Machines.ToObservableCollection(); ColorSpaces = _dbContext.ColorSpaces.ToObservableCollection(); Rmls = _dbContext.Rmls.ToObservableCollection(); + + CCTS = _dbContext.Ccts.Select(x => new CctModel() + { + Guid = x.Guid, + FileName = x.FileName, + + }).ToObservableCollection(); + + CCTS.Where(x => String.IsNullOrWhiteSpace(x.FileName)).ToList().ForEach(x => x.FileName = x.Guid); }); var settings = SettingsManager.Default.GetOrCreate<ColorLabModuleSettings>(); @@ -336,24 +365,26 @@ namespace Tango.MachineStudio.ColorLab.ViewModels { try { - if (LiquidsCalibrationData == null || CCT.ForwardData == null) return; + if (LiquidsCalibrationData == null || SelectedCCT == null || SelectedCCT.Data == null) return; ConversionInput input = new ConversionInput(); input.ColorSpace = SourceColor.IsLab ? PMR.ColorLab.ColorSpace.Lab : PMR.ColorLab.ColorSpace.Rgb; input.DeltaChroma = DeltaChroma; input.DeltaL = DeltaL; - input.ForwardData = ByteString.CopyFrom(CCT.ForwardData); + input.ForwardData = ByteString.CopyFrom(SelectedCCT.Data); input.InputCoordinates = new InputCoordinates(); input.InputCoordinates.Red = (int)SourceColor.Red; input.InputCoordinates.Green = (int)SourceColor.Green; input.InputCoordinates.Blue = (int)SourceColor.Blue; + input.InputCoordinates.L = SourceColor.L; input.InputCoordinates.A = SourceColor.A; input.InputCoordinates.B = SourceColor.B; - input.ThreadL = 92.1815; //SelectedRML.MediaColor.L; - input.ThreadA = 2.2555; //SelectedRML.MediaColor.A; - input.ThreadB = -10.9325; //SelectedRML.MediaColor.B; + + input.ThreadL = SelectedRML.WhitePointL; + input.ThreadA = SelectedRML.WhitePointA; + input.ThreadB = SelectedRML.WhitePointB; //Validate calibration data foreach (var vm in LiquidsCalibrationData.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32())) @@ -402,11 +433,13 @@ namespace Tango.MachineStudio.ColorLab.ViewModels }); } - var output = TangoColorConverter.GetSuggestions(input); + IColorConverter converter = new DefaultColorConverter(); + + var output = converter.Convert(input); IsOutOfGamut = output.OutOfGamut; - HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(output); + HiveSuggestions = output.CreateHiveSuggestions(); } catch (Exception ex) { @@ -453,36 +486,57 @@ namespace Tango.MachineStudio.ColorLab.ViewModels String file = GetCCTFileOpen(); if (file != null) { - CCT.ForwardFileName = Path.GetFileName(file); - CCT.ForwardData = File.ReadAllBytes(file); - } - } + CctModel cctModel = new CctModel(); + cctModel.Guid = Guid.NewGuid().ToString(); + cctModel.IsNew = true; - private void ImportInverseData() - { - String file = GetCCTFileOpen(); - if (file != null) - { - CCT.InverseFileName = Path.GetFileName(file); - CCT.InverseData = File.ReadAllBytes(file); + cctModel.FileName = Path.GetFileName(file); + cctModel.Data = File.ReadAllBytes(file); + + CCTS.Insert(0, cctModel); + SelectedCCT = cctModel; } } private void ExportForwardData() { - String file = GetCCTFileSave(CCT.ForwardFileName); - if (file != null) - { - File.WriteAllBytes(file, CCT.ForwardData); - } - } - private void ExportInverseData() - { - String file = GetCCTFileSave(CCT.InverseFileName); - if (file != null) + if (SelectedCCT != null) { - File.WriteAllBytes(file, CCT.InverseData); + String file = GetCCTFileSave(SelectedCCT.FileName); + if (file != null) + { + using (_notification.PushTaskItem("Exporting CCT file...")) + { + try + { + IsFree = false; + + if (SelectedCCT.IsNew) + { + File.WriteAllBytes(file, SelectedCCT.Data); + } + else + { + var cct = _dbContext.Ccts.SingleOrDefault(x => x.Guid == SelectedCCT.Guid); + + if (cct != null) + { + File.WriteAllBytes(file, cct.Data); + } + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error exporting CCT file."); + _notification.ShowError($"An error occurred while trying to export the CCT file.\n{ex.Message}"); + } + finally + { + IsFree = true; + } + } + } } } @@ -517,6 +571,25 @@ namespace Tango.MachineStudio.ColorLab.ViewModels #endregion #region Liquid Volumes + private async void OnSelectedCCTChanged() + { + if (SelectedCCT != null && !SelectedCCT.IsNew) + { + using (_notification.PushTaskItem("Loading CCT data...")) + { + IsFree = false; + + var cct = await _dbContext.Ccts.SingleOrDefaultAsync(x => x.Guid == SelectedCCT.Guid); + + if (cct != null) + { + SelectedCCT.Data = cct.Data; + } + + IsFree = true; + } + } + } private void OnSelectedMachineChanged() { @@ -571,12 +644,12 @@ namespace Tango.MachineStudio.ColorLab.ViewModels input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; input.DeltaChroma = DeltaChroma; input.DeltaL = DeltaL; - input.ForwardData = ByteString.CopyFrom(CCT.ForwardData); + input.ForwardData = ByteString.CopyFrom(SelectedCCT.Data); input.InputCoordinates = new InputCoordinates(); - input.ThreadL = 92.1815; //SelectedRML.MediaColor.L; - input.ThreadA = 2.2555; //SelectedRML.MediaColor.A; - input.ThreadB = -10.9325; //SelectedRML.MediaColor.B; + input.ThreadL = SelectedRML.WhitePointL; + input.ThreadA = SelectedRML.WhitePointA; + input.ThreadB = SelectedRML.WhitePointB; foreach (var vm in LiquidsCalibrationData) { @@ -604,14 +677,29 @@ namespace Tango.MachineStudio.ColorLab.ViewModels }); } - var output = TangoColorConverter.GetSuggestions(input); + IColorConverter converter = new DefaultColorConverter(); - TargetColor = new RgbVM() + var output = converter.Convert(input); + + if (SourceColor.IsLab) + { + TargetColor = new RgbVM() + { + IsLab = true, + L = output.SingleCoordinates.L, + A = output.SingleCoordinates.A, + B = output.SingleCoordinates.B, + }; + } + else { - Red = output.SingleCoordinates.Red, - Green = output.SingleCoordinates.Green, - Blue = output.SingleCoordinates.Blue, - }; + TargetColor = new RgbVM() + { + Red = output.SingleCoordinates.Red, + Green = output.SingleCoordinates.Green, + Blue = output.SingleCoordinates.Blue, + }; + } } catch (Exception ex) { @@ -624,7 +712,7 @@ namespace Tango.MachineStudio.ColorLab.ViewModels #region RML - private async void InvalidateLiquidFactorsCalibrationData() + public async void InvalidateLiquidFactorsCalibrationData() { if (SelectedRML != null && SelectedMachine != null) { @@ -641,12 +729,33 @@ namespace Tango.MachineStudio.ColorLab.ViewModels _dbContext.Adapter.GetConfiguration(x => x.Guid == SelectedMachine.ConfigurationGuid); } - _selectedRML = new RmlBuilder(_dbContext) + var builder = new RmlBuilder(_dbContext) .Set(_selectedRML.Guid) .WithActiveParametersGroup() .WithCAT(SelectedMachine.Guid) - .WithCCT() - .WithLiquidFactors().Build(); + .WithLiquidFactors(); + + if (IsHosted) + { + builder.WithCCT(); + } + + _selectedRML = builder.Build(); + + if (IsHosted) + { + if(SelectedRML.Cct != null){ + + SelectedCCT = new CctModel() + { + Data = SelectedRML.Cct.Data + }; + } + } + else + { + SelectedCCT = CCTS.SingleOrDefault(x => x.Guid == SelectedRML.CctGuid); + } LiquidVolumes = SelectedMachine.Configuration.GetSupportedIdsPacks(_selectedRML).Select(x => new LiquidVolumeVM() { @@ -690,16 +799,6 @@ namespace Tango.MachineStudio.ColorLab.ViewModels } } - _isNewCCT = false; - CCT = SelectedRML.Ccts.FirstOrDefault(); - - if (CCT == null) - { - CCT = new Cct(); - CCT.Rml = SelectedRML; - _isNewCCT = true; - } - var settings = SettingsManager.Default.GetOrCreate<ColorLabModuleSettings>(); settings.LastMachineSerialNumber = SelectedMachine.SerialNumber; settings.LastRmlGuid = SelectedRML.Guid; @@ -755,11 +854,6 @@ namespace Tango.MachineStudio.ColorLab.ViewModels public async Task SaveChanges() { - if (_isNewCCT) - { - _dbContext.Ccts.Add(CCT); - } - foreach (var calDataVM in LiquidsCalibrationData) { var cat = calDataVM.IdsPack.LiquidType.Cats.FirstOrDefault(x => x.Machine == SelectedMachine && x.Rml == SelectedRML); @@ -782,6 +876,23 @@ namespace Tango.MachineStudio.ColorLab.ViewModels cat.PutCalibrationData(calData); } + if (SelectedCCT != null && !IsHosted) + { + if (SelectedCCT.IsNew) + { + Cct cct = new Cct(); + cct.Guid = SelectedCCT.Guid; + cct.FileName = SelectedCCT.FileName; + cct.Data = SelectedCCT.Data; + SelectedRML.Cct = cct; + SelectedCCT.IsNew = false; + } + else + { + SelectedRML.CctGuid = SelectedCCT.Guid; + } + } + await _dbContext.SaveChangesAsync(); InvalidateLiquidFactorsCalibrationData(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/CalibrationDataView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/CalibrationDataView.xaml index 3c9723b30..022b0db44 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/CalibrationDataView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/CalibrationDataView.xaml @@ -34,31 +34,32 @@ <StackPanel DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" Margin="0 0 5 0"> <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Import from excel" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=local:CalibrationDataView},Path=DataContext.ImportExcelCommand}" CommandParameter="{Binding}"> - <materialDesign:PackIcon Kind="Download" Foreground="Black" /> + <materialDesign:PackIcon Kind="Download" Foreground="{StaticResource BlackForegroundBrush}" /> </Button> <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Export to excel" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=local:CalibrationDataView},Path=DataContext.ExportExcelCommand}" CommandParameter="{Binding}"> - <materialDesign:PackIcon Kind="Upload" Foreground="Black" /> + <materialDesign:PackIcon Kind="Upload" Foreground="{StaticResource BlackForegroundBrush}" /> </Button> </StackPanel> <Border Padding="2" Margin="5" CornerRadius="3"> <Border.Background> <SolidColorBrush Opacity="0.4" Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> </Border.Background> - <TextBlock Text="{Binding LiquidType.Name}" HorizontalAlignment="Center" Foreground="Black"></TextBlock> + <TextBlock Text="{Binding LiquidType.Name}" HorizontalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock> </Border> </StackPanel> <Grid Margin="0 0 0 5"> - <DataGrid Background="#BBFFFFFF" AlternatingRowBackground="#CCE1E1E1" BorderThickness="1" BorderBrush="#202020" Margin="5 0" ItemsSource="{Binding CalibrationPoints}" CanUserResizeColumns="False" CanUserReorderColumns="False" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" CanUserSortColumns="False"> + <DataGrid Background="{StaticResource TransparentBackgroundBrush400}" AlternatingRowBackground="{StaticResource Transparent200}" BorderThickness="1" BorderBrush="{StaticResource DarkGrayBrush}" Margin="5 0" ItemsSource="{Binding CalibrationPoints}" CanUserResizeColumns="False" CanUserReorderColumns="False" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" CanUserSortColumns="False"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> <Setter Property="HorizontalContentAlignment" Value="Left"></Setter> <Setter Property="FlowDirection" Value="RightToLeft"></Setter> + <Setter Property="Foreground" Value="{StaticResource BlackForegroundBrush}"></Setter> </Style> </DataGrid.CellStyle> <DataGrid.Columns> - <DataGridTextColumn Header="#" Binding="{Binding Index}" Width="Auto" IsReadOnly="True" Foreground="DimGray" FontSize="11" /> + <DataGridTextColumn Header="#" Binding="{Binding Index}" Width="Auto" IsReadOnly="True" Foreground="{StaticResource DimGrayBrush}" FontSize="11" /> <mahapps:DataGridNumericUpDownColumn Header="X" Binding="{Binding X}" Minimum="0" Maximum="10000" HideUpDownButtons="True" Width="1*"/> <mahapps:DataGridNumericUpDownColumn Header="Y" Binding="{Binding Y}" Minimum="0" Maximum="10000" HideUpDownButtons="True" Width="1*" /> </DataGrid.Columns> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml index 7a2aba71e..37f5f70be 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml @@ -6,7 +6,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" - xmlns:colorConversion="clr-namespace:Tango.BL.ColorConversion;assembly=Tango.BL" + xmlns:colorConversion="clr-namespace:Tango.ColorConversion;assembly=Tango.ColorConversion" xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" @@ -50,7 +50,7 @@ <Grid IsEnabled="{Binding IsFree}"> <Grid.Style> <Style TargetType="Grid"> - <Setter Property="Background" Value="#B1FFFFFF"></Setter> + <Setter Property="Background" Value="{StaticResource TransparentBackgroundBrush400}"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding IsHosted}" Value="True"> <Setter Property="Background" Value="Transparent"></Setter> @@ -71,12 +71,12 @@ <StackPanel> <StackPanel Visibility="{Binding IsHosted,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <TextBlock Margin="40 20" FontSize="30" FontWeight="SemiBold" FontStyle="Italic">TARGET MACHINE</TextBlock> - <ComboBox ItemsSource="{Binding Machines}" FontSize="20" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.Hint="Serial Number" Margin="40 0 40 0"> + <ComboBox ItemsSource="{Binding Machines}" FontSize="20" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.Hint="Serial Number" Margin="40 0 40 0" Background="Transparent" Style="{StaticResource TransparentComboBoxStyle}"> <ComboBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"></TextBlock> - <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock> + <TextBlock FontSize="11" Text="{Binding Name}" Foreground="{StaticResource GrayBrush}"></TextBlock> </StackPanel> </DataTemplate> </ComboBox.ItemTemplate> @@ -86,12 +86,13 @@ <commonControls:MachineView Width="500" Margin="0 40 0 0" DataContext="{Binding SelectedMachine}" /> <StackPanel Margin="40 40"> <TextBlock FontSize="16">MEDIA</TextBlock> - <ComboBox ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" FontSize="16" IsEnabled="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}"> + <ComboBox ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" FontSize="16" IsEnabled="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Background="Transparent" Style="{StaticResource TransparentComboBoxStyle}" > + <ComboBox.ItemTemplate> <DataTemplate> <StackPanel> - <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic"></TextBlock> - <TextBlock FontSize="11" Text="{Binding Manufacturer}" Foreground="Gray"></TextBlock> + <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock> + <TextBlock FontSize="11" Text="{Binding Manufacturer}" Foreground="{StaticResource GrayBrush}"></TextBlock> </StackPanel> </DataTemplate> </ComboBox.ItemTemplate> @@ -108,9 +109,9 @@ <ItemsControl.ItemTemplate> <DataTemplate DataType="{x:Type observables:LiquidTypesRml}"> <StackPanel Margin="0 0 10 0"> - <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="DimGray" Text="{Binding LiquidType.Name}"></TextBlock> + <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="{StaticResource Hexagon.ForegroundBrush}" Text="{Binding LiquidType.Name}"></TextBlock> <Grid Width="58" Height="48" Margin="0 5 0 0"> - <shapes:Hexagon StrokeThickness="1" Stroke="Gray"> + <shapes:Hexagon StrokeThickness="1" Stroke="{StaticResource GrayBrush}"> <shapes:Hexagon.Fill> <LinearGradientBrush Opacity="0.7" > <GradientStop Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"/> @@ -119,7 +120,7 @@ </shapes:Hexagon.Fill> </shapes:Hexagon> - <TextBox Style="{x:Null}" Background="Transparent" Foreground="Black" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic"></TextBox> + <TextBox Style="{x:Null}" Background="Transparent" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic" Foreground="{StaticResource Hexagon.ForegroundBrush}"/> </Grid> </StackPanel> </DataTemplate> @@ -141,14 +142,13 @@ <Grid> <Grid Margin="10 10 10 0" Height="135" Visibility="{Binding IsHosted,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <StackPanel HorizontalAlignment="Left" Margin="20 0 0 0"> - <TextBlock Margin="0 0 0 0" FontSize="20" TextAlignment="Left">COLOR ADJUSTMENT DATA</TextBlock> + <TextBlock Margin="0 0 0 0" FontSize="20" TextAlignment="Left">COLOR CONVERSION TABLE (CCT)</TextBlock> <Grid> <StackPanel Orientation="Horizontal" Margin="0 5 0 0"> <materialDesign:PackIcon Kind="ArrowLeftBoldHexagonOutline" VerticalAlignment="Center" Width="40" Height="40" /> <Image Source="../Images/data-table.png" Height="80" Opacity="0.8"></Image> <StackPanel VerticalAlignment="Center" Width="300" Margin="10 0 0 0"> - - <TextBox IsReadOnly="False" Margin="0 5 0 0" Text="{Binding CCT.ForwardFileName}" HorizontalContentAlignment="Center"></TextBox> + <ComboBox materialDesign:HintAssist.Hint="No CCT Defined" Margin="0 5 0 0" HorizontalContentAlignment="Center" ItemsSource="{Binding CCTS}" SelectedItem="{Binding SelectedCCT}" DisplayMemberPath="FileName" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Right"> <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportForwardDataCommand}"> <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> @@ -169,7 +169,7 @@ </StackPanel> </Grid> - <Rectangle VerticalAlignment="Bottom" Stroke="Silver" Visibility="{Binding IsHosted,Converter={StaticResource BooleanToVisibilityInverseConverter}}"></Rectangle> + <Rectangle VerticalAlignment="Bottom" Stroke="{StaticResource borderBrush}" Visibility="{Binding IsHosted,Converter={StaticResource BooleanToVisibilityInverseConverter}}"></Rectangle> </Grid> <Grid Grid.Row="1" Margin="0 40 0 0" HorizontalAlignment="Center"> @@ -187,6 +187,11 @@ <RowDefinition Height="30" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> + <Grid.Resources> + <Style TargetType="TextBlock" > + <Setter Property="Foreground" Value="{StaticResource JobFieldForeground}"/> + </Style> + </Grid.Resources> <Grid Grid.Row="1"> @@ -198,8 +203,8 @@ <StackPanel VerticalAlignment="Center"> <StackPanel Height="20"> <StackPanel Orientation="Horizontal" Margin="0 0 0 5" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> - <materialDesign:PackIcon Kind="Alert" Foreground="#FF6D6D" /> - <TextBlock Margin="5 0 0 0" Foreground="#FF6D6D">Color is out of gamut</TextBlock> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Color is out of gamut</TextBlock> </StackPanel> </StackPanel> <Border BorderThickness="1" BorderBrush="#545454" Margin="0" Padding="2 2 2 0"> @@ -265,8 +270,8 @@ </Grid> <TextBlock FontStyle="Italic" HorizontalAlignment="Center">SOURCE / INVERSE</TextBlock> - <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="2" Margin="00 0 0 0">SUGGESTIONS</TextBlock> - <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="4">LIQUID VOLUMES</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="2" Margin="0 0 0 0">SUGGESTIONS</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="4" Margin="-80 0 0 0">LIQUID VOLUMES</TextBlock> <Image Source="../Images/arrow-long-right.png" Grid.Column="1" Grid.Row="1" Width="120" Stretch="Fill" Height="30" Opacity="0.8" Margin="20 0 20 0"></Image> @@ -294,7 +299,7 @@ <hive:HexList.ItemTemplate> <DataTemplate> - <TextBlock Foreground="White"> + <TextBlock Foreground="{StaticResource WhiteTextBrush}"> <Run Text="{Binding Row}"></Run><Run>,</Run> <Run Text="{Binding Column}"/> </TextBlock> @@ -302,7 +307,7 @@ </hive:HexList.ItemTemplate> </hive:HexList> - <TextBlock FontSize="40" Foreground="#FF5F5F" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="2" Grid.Row="1" Text="NO INPUT"> + <TextBlock FontSize="40" Foreground="{StaticResource RedBrush100}" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="2" Grid.Row="1" Text="NO INPUT"> <TextBlock.Style> <Style TargetType="TextBlock"> <Setter Property="Visibility" Value="Collapsed"></Setter> @@ -318,6 +323,71 @@ <Image Source="../Images/arrow-long-right.png" Grid.Column="3" Grid.Row="1" Width="120" Stretch="Fill" Height="30" Opacity="0.8" Margin="20 0 20 0"></Image> <Grid Grid.Column="4" Grid.Row="1" IsHitTestVisible="False"> + <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -20 0 0"> + <StackPanel Orientation="Horizontal" Height="60"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding SelectedSuggestion.Coordinates.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding SelectedSuggestion.Coordinates.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding SelectedSuggestion.Coordinates.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + </StackPanel> + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420" > <ItemsControl.ItemsPanel> <ItemsPanelTemplate> @@ -354,8 +424,8 @@ <StackPanel Grid.Column="4" Grid.Row="3"> <StackPanel Height="25" Margin="25 0 0 0"> <StackPanel Orientation="Horizontal" Margin="0 0 0 0" Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> - <materialDesign:PackIcon Kind="Alert" Foreground="#FF6D6D" /> - <TextBlock Margin="5 0 0 0" Foreground="#FF6D6D">Liquid volumes exceeds the maximum range</TextBlock> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Liquid volumes exceeds the maximum range</TextBlock> </StackPanel> </StackPanel> @@ -388,12 +458,12 @@ <Image Source="../Images/arrow-long-Left.png" Grid.Column="2" Grid.Row="3" Width="140" Stretch="Fill" Height="30" Opacity="0.8"></Image> - <Border BorderBrush="Silver" Grid.Row="3"> + <Border BorderBrush="{StaticResource borderBrush}" Grid.Row="3"> <Grid> <DockPanel Width="80" HorizontalAlignment="Left"> <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">COMPOSITE</TextBlock> <Grid> - <Ellipse Height="70" Margin="0 5 0 0" Stroke="#202020"> + <Ellipse Height="70" Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> <Ellipse.Fill> <SolidColorBrush Color="{Binding TargetColor.Color}"></SolidColorBrush> </Ellipse.Fill> @@ -402,41 +472,69 @@ </Grid> </DockPanel> - <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Height="60"> - <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> - <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + <StackPanel HorizontalAlignment="Right"> + <StackPanel Orientation="Horizontal" Height="60"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> - <Grid> - <Rectangle Margin="0 5 0 0" Stroke="#202020"> - <Rectangle.Fill> - <SolidColorBrush Color="Red" Opacity="{Binding TargetColor.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> - </Rectangle.Fill> - </Rectangle> - <TextBlock Text="{Binding TargetColor.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> - </Grid> - </DockPanel> - <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> - <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> - <Grid> - <Rectangle Margin="0 5 0 0" Stroke="#202020"> - <Rectangle.Fill> - <SolidColorBrush Color="Green" Opacity="{Binding TargetColor.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> - </Rectangle.Fill> - </Rectangle> - <TextBlock Text="{Binding TargetColor.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> - </Grid> - </DockPanel> - <DockPanel Width="50" HorizontalAlignment="Left"> - <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> - <Grid> - <Rectangle Margin="0 5 0 0" Stroke="#202020"> - <Rectangle.Fill> - <SolidColorBrush Color="Blue" Opacity="{Binding TargetColor.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> - </Rectangle.Fill> - </Rectangle> - <TextBlock Text="{Binding TargetColor.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> - </Grid> - </DockPanel> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding TargetColor.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding TargetColor.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding TargetColor.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> </StackPanel> </Grid> </Border> @@ -444,7 +542,7 @@ </Grid> <Grid Grid.Row="2" Margin="0 20 0 0"> - <Rectangle VerticalAlignment="Top" Stroke="Silver"></Rectangle> + <Rectangle VerticalAlignment="Top" Stroke="{StaticResource borderBrush}"></Rectangle> <DockPanel> <Grid DockPanel.Dock="Top"> <TextBlock FontSize="20" Margin="0 20 0 0" TextAlignment="Center">CALIBRATION DATA</TextBlock> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs index 58ffddbb0..090d54036 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CctsViewVM.cs @@ -30,8 +30,8 @@ namespace Tango.MachineStudio.DB.ViewModels { try { - EditEntity.InverseData = File.ReadAllBytes(file); - EditEntity.InverseFileName = Path.GetFileName(file); + //EditEntity.InverseData = File.ReadAllBytes(file); + //EditEntity.InverseFileName = Path.GetFileName(file); } catch (Exception ex) { @@ -47,8 +47,8 @@ namespace Tango.MachineStudio.DB.ViewModels { try { - EditEntity.ForwardData = File.ReadAllBytes(file); - EditEntity.ForwardFileName = Path.GetFileName(file); + //EditEntity.ForwardData = File.ReadAllBytes(file); + //EditEntity.ForwardFileName = Path.GetFileName(file); } catch (Exception ex) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index fc762d77d..83be6c3b4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -17,6 +17,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations.Schema; using Tango.BL; using Tango.Core.DI; +using Tango.Core.ExtensionMethods; namespace Tango.MachineStudio.DB.ViewModels { @@ -150,7 +151,8 @@ namespace Tango.MachineStudio.DB.ViewModels { try { - await SelectedEntity.DeleteAsync(Adapter.Context); + SelectedEntity.Detach(Adapter.Context); + await Adapter.Context.SaveChangesAsync(); } catch (Exception ex) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml index e338f3c0f..402740f82 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.AddressesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.AddressesViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.AddressesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml index 704f5f5e2..bc1e948b0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationDisplayPanelVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ApplicationDisplayPanelVersionsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationDisplayPanelVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml index a216f4a1f..8fb4976c7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationFirmwareVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ApplicationFirmwareVersionsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationFirmwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml index f53c182c3..fdbcdabc4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationOsVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ApplicationOsVersionsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ApplicationOsVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml index d17f79c8d..b77c31aed 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CartridgeTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.CartridgeTypesViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.CartridgeTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml index 6eb693780..1a4cf673a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml @@ -9,7 +9,7 @@ xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CatsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.CatsViewVM}"> <UserControl.Resources> <converters:ByteArrayToFileSizeConverter x:Key="ByteArrayToFileSizeConverter"></converters:ByteArrayToFileSizeConverter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml index 09962447c..6b80b94fe 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CctsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.CctsViewVM}"> <UserControl.Resources> <converters:ByteArrayToFileSizeConverter x:Key="ByteArrayToFileSizeConverter"></converters:ByteArrayToFileSizeConverter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml index 819dbd1c7..45bb2e776 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ConfigurationsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ConfigurationsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ConfigurationsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml index e05808d83..e54a72a4c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ContactsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ContactsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.ContactsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml index 040ac5799..12bc16f1e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.DispenserTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.DispenserTypesViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.DispenserTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml index 219230d32..0ff1f8a6b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.EmbeddedFirmwareVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.EmbeddedFirmwareVersionsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.EmbeddedFirmwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml index f46b5894e..2a22bf929 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.FiberShapesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.FiberShapesViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.FiberShapesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml index bec19add1..28b7a7b1b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.FiberSynthsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.FiberSynthsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.FiberSynthsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareDancerTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareDancerTypesView.xaml index 93859e74d..c4b8026c6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareDancerTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareDancerTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.HardwareDancerTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.HardwareDancerTypesViewVM}"> <UserControl.Resources> <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" /> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareMotorTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareMotorTypesView.xaml index 49f7c9232..52af91e8a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareMotorTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareMotorTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.HardwareMotorTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.HardwareMotorTypesViewVM}"> <UserControl.Resources> <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" /> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwarePidControlTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwarePidControlTypesView.xaml index 16ae138dc..01f9a444c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwarePidControlTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwarePidControlTypesView.xaml @@ -9,7 +9,7 @@ xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" d:DataContext="{d:DesignInstance Type=observables:HardwarePidControlType, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.HardwarePidControlTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" d:DataContext="{d:DesignInstance Type=observables:HardwarePidControlType, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.HardwarePidControlTypesViewVM}"> <UserControl.Resources> <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" /> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml index 4a60ffcaa..ea6f97171 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.HardwareVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.HardwareVersionsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.HardwareVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml index 81c9124f3..cc9889d6e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.IdsPackFormulasViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.IdsPackFormulasViewVM}"> <UserControl.Resources> <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" /> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml index 03ab1d7d4..2ba826a12 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.IdsPacksViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.IdsPacksViewVM}"> <UserControl.Resources> <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml index 41d719dad..d25f4eace 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.LinearMassDensityUnitsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.LinearMassDensityUnitsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.LinearMassDensityUnitsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml index 11f781e5b..2bfa395c8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml @@ -8,7 +8,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.LiquidTypesRmlViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.LiquidTypesRmlViewVM}"> <Grid> <controls:DbTableView> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml index 4da0a8b59..90040469e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml @@ -9,7 +9,7 @@ xmlns:localConverters="clr-namespace:Tango.MachineStudio.DB.Converters" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.LiquidTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.LiquidTypesViewVM}"> <UserControl.Resources> <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml index be917634a..370171855 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MachineVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MachineVersionsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MachineVersionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml index c6febd63c..90b24af9a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MachinesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MachinesViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MachinesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml index 08f144710..36d441b0e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MediaConditionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MediaConditionsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MediaConditionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml index 7530cf9df..7eae23499 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MediaMaterialsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MediaMaterialsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MediaMaterialsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml index ee4903f69..ab1c844ea 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MediaPurposesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MediaPurposesViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MediaPurposesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MidTankTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MidTankTypesView.xaml index a808b8438..ba027b8ba 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MidTankTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MidTankTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MidTankTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MidTankTypesViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MidTankTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/OrganizationsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/OrganizationsView.xaml index ff5e7df4a..4ec9f43c9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/OrganizationsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/OrganizationsView.xaml @@ -8,7 +8,7 @@ xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.OrganizationsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.OrganizationsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.OrganizationsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml index 9455fd519..ad8815eeb 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.PermissionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.PermissionsViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.PermissionsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml index 0eee2aa77..68f641e44 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml @@ -9,7 +9,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ProcessParametersTablesGroupsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ProcessParametersTablesGroupsViewVM}"> <UserControl.Resources> <sharedConverters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter"></sharedConverters:BooleanToYesNoConverter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml index 0e20ce5af..dedf23a54 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml @@ -9,7 +9,7 @@ xmlns:localConverters="clr-namespace:Tango.MachineStudio.DB.Converters" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ProcessParametersTablesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ProcessParametersTablesViewVM}"> <UserControl.Resources> <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter"></converters:BooleanToYesNoConverter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml index 8cd51ccac..bffe4e3c1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml @@ -8,7 +8,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.RmlsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.RmlsViewVM}"> <UserControl.Resources> <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter"></converters:BooleanToYesNoConverter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml index 858cfd37b..77da90df7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml @@ -7,7 +7,7 @@ xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters" xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.RolesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.RolesViewVM}"> <UserControl.Resources> <converters:RolesPermissionsToStringConverter x:Key="RolesPermissionsToStringConverter"></converters:RolesPermissionsToStringConverter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml index 4ed13cb11..438e80e03 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.SpoolTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.SpoolTypesViewVM}"> <Grid> <controls:DbTableView> <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.SpoolTypesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml index ad3814185..6d4cf4d23 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml @@ -8,7 +8,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.UsersViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.UsersViewVM}"> <UserControl.Resources> <converters:UsersRolesToStringConverter x:Key="UsersRolesToStringConverter"></converters:UsersRolesToStringConverter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml index 1ef3c1769..de4acd68f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml @@ -14,7 +14,7 @@ xmlns:global="clr-namespace:Tango.MachineStudio.DataCapture" xmlns:local="clr-namespace:Tango.MachineStudio.DataCapture.Views" mc:Ignorable="d" - d:DesignHeight="1080" d:DesignWidth="1920" Background="White" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="1080" d:DesignWidth="1920" Background="{StaticResource MainWindow.Background}" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> <UserControl.Resources> <converters:StringEllipsisConverter x:Key="StringEllipsisConverter" /> @@ -36,10 +36,10 @@ <Grid DockPanel.Dock="Top"> <StackPanel Orientation="Horizontal" Margin="0 0 0 10"> <Image Source="../Images/recordings.png" Width="42"></Image> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">RECORDINGS</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="{StaticResource DimGrayBrush}" FontSize="16" FontWeight="SemiBold">RECORDINGS</TextBlock> </StackPanel> - <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeDashArray="5 5 5 5"></Rectangle> + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeDashArray="5 5 5 5"></Rectangle> </Grid> <Grid Margin="0 10 0 0"> @@ -48,7 +48,7 @@ <DataTemplate> <Grid HorizontalAlignment="Stretch"> <DockPanel> - <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Width="24" Height="24" Foreground="#FF6F6F" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveRecordingCommand}" CommandParameter="{Binding}"> + <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Width="24" Height="24" Foreground="{StaticResource RedBrush100}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveRecordingCommand}" CommandParameter="{Binding}"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> </Button> @@ -69,7 +69,7 @@ </Grid> </DockPanel> - <Rectangle HorizontalAlignment="Right" VerticalAlignment="Stretch" Stroke="Gainsboro" StrokeDashArray="5 5 5 5" Margin="0 50 0 50"></Rectangle> + <Rectangle HorizontalAlignment="Right" VerticalAlignment="Stretch" Stroke="{StaticResource BorderBrushGainsboro}" StrokeDashArray="5 5 5 5" Margin="0 50 0 50"></Rectangle> </Grid> <Grid Grid.Column="1" Margin="10"> @@ -177,7 +177,7 @@ </ItemsControl> </DockPanel> - <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeDashArray="5 5 5 5"></Rectangle> + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeDashArray="5 5 5 5"></Rectangle> </Grid> <Grid Grid.Row="1"> @@ -212,12 +212,12 @@ <Button Command="{Binding MediaSeekForwardCommand}" Margin="20 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="60" Height="60" Background="Transparent"> <materialDesign:PackIcon Width="40" Height="40" Kind="FastForward" Foreground="{StaticResource AccentColorBrush}" /> </Button> - <Button Command="{Binding MediaRecordingCommand}" Margin="20 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Foreground="#FF7A7A" BorderBrush="#FF8585" Padding="0" Width="50" Height="50" Background="Transparent" ToolTip="Start Recording"> + <Button Command="{Binding MediaRecordingCommand}" Margin="20 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Foreground="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush400}" Padding="0" Width="50" Height="50" Background="Transparent" ToolTip="Start Recording"> <materialDesign:PackIcon Width="30" Height="30" Kind="Record" /> </Button> </StackPanel> <Grid> - <Label Margin="0 0 15 0" VerticalAlignment="Center" HorizontalAlignment="Right" Foreground="#FF8585" FontSize="40" FontFamily="{StaticResource digital-7}"> + <Label Margin="0 0 15 0" VerticalAlignment="Center" HorizontalAlignment="Right" Foreground="{StaticResource RedBrush400}" FontSize="40" FontFamily="{StaticResource digital-7}"> <Label.Style> <Style TargetType="Label"> <Setter Property="Opacity" Value="1"></Setter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs index 2099b12d9..3d0ee2461 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs @@ -34,6 +34,16 @@ namespace Tango.MachineStudio.Developer /// </summary> public int GradientResolutionCM { get; set; } + private bool _usePreferredLiquidVolumeIndex; + /// <summary> + /// Gets or sets a value indicating whether to use the preferred liquid volume index. + /// </summary> + public bool UsePreferredLiquidVolumeIndex + { + get { return _usePreferredLiquidVolumeIndex; } + set { _usePreferredLiquidVolumeIndex = value; RaisePropertyChangedAuto(); } + } + public DeveloperModuleSettings() { ProcessParametersIndices = new List<ParameterIndex>(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index cd00557b1..6e55b6d14 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -208,6 +208,10 @@ <Project>{40085232-aced-4cbe-945b-90ba8153c151}</Project> <Name>Tango.BrushPicker</Name> </ProjectReference> + <ProjectReference Include="..\..\..\Tango.ColorConversion\Tango.ColorConversion.csproj"> + <Project>{b4fe6485-4161-4b36-bc08-67e0b53d01b7}</Project> + <Name>Tango.ColorConversion</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Tango.ColorPicker\Tango.ColorPicker.csproj"> <Project>{a2f5af44-29ff-45d6-9d25-ecda5cce88b5}</Project> <Name>Tango.ColorPicker</Name> @@ -357,7 +361,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 3f28c2cff..ac5354a74 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -38,7 +38,6 @@ using System.Threading; using Tango.SharedUI.Helpers; using Tango.Core.DI; using Tango.MachineStudio.Common; -using Tango.BL.ColorConversion; using Tango.MachineStudio.Logging.ViewModels; using Tango.MachineStudio.Logging.Views; using Tango.AutoComplete.Editors; @@ -47,6 +46,8 @@ using System.Runtime.ExceptionServices; using Tango.BL.Builders; using Tango.MachineStudio.Common.Navigation; using System.Diagnostics; +using Tango.Core.ExtensionMethods; +using Tango.ColorConversion; namespace Tango.MachineStudio.Developer.ViewModels { @@ -80,6 +81,7 @@ namespace Tango.MachineStudio.Developer.ViewModels private bool _disable_gamut_check; private bool _rml_has_no_cct; private TaskItem _preparingTaskItem; + private IColorConverter _converter; #region Properties @@ -713,6 +715,8 @@ namespace Tango.MachineStudio.Developer.ViewModels /// <param name="notificationProvider">The notification provider.</param> public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, INavigationManager navigationManager, IAuthenticationProvider authentication, IEventLogger eventLogger, ISpeechProvider speech) { + _converter = new DefaultColorConverter(); + CanWork = true; EnableColorConversion = true; @@ -835,7 +839,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { try { - var output = TangoColorConverter.GetSuggestions(stop); + var output = _converter.Convert(stop); stop.Red = output.SingleCoordinates.Red; stop.Green = output.SingleCoordinates.Green; @@ -849,7 +853,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { try { - stop.IsOutOfGamut = TangoColorConverter.IsOutOfGamut(stop); + stop.IsOutOfGamut = _converter.IsOutOfGamut(stop); stop.OutOfGamutChecked = true; } catch { } @@ -870,7 +874,7 @@ namespace Tango.MachineStudio.Developer.ViewModels _hiveOpened = true; try { - HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(TangoColorConverter.GetSuggestions(SelectedBrushStop)); + HiveSuggestions = _converter.Convert(SelectedBrushStop).CreateHiveSuggestions(); } catch (Exception ex) { @@ -911,7 +915,7 @@ namespace Tango.MachineStudio.Developer.ViewModels if (!_color_changed_from_hive && _hiveOpened) { SelectedBrushStop.Corrected = false; - HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(TangoColorConverter.GetSuggestions(SelectedBrushStop)); + HiveSuggestions = _converter.Convert(SelectedBrushStop).CreateHiveSuggestions(); } } @@ -1233,8 +1237,8 @@ namespace Tango.MachineStudio.Developer.ViewModels { LogManager.Log(String.Format("BrushStop {0} Dropped on BrushStop {1}", dragged.StopIndex, dropped.StopIndex)); - dragged.SetStopIndex(dropped.StopIndex); - dropped.SetStopIndex(dropped.StopIndex + 1); + dragged.SetStopIndexNoRaise(dropped.StopIndex); + dropped.SetStopIndexNoRaise(dropped.StopIndex + 1); ArrangeBrushStopsIndices(); } @@ -1533,9 +1537,9 @@ namespace Tango.MachineStudio.Developer.ViewModels { LogManager.Log("Invalidating liquid factors, process parameters and process group history..."); - _selectedRML = new RmlBuilder(_activeJobDbContext).Set(SelectedRML).WithAllParametersGroup().WithCAT(SelectedMachine.Guid).WithCCT().WithLiquidFactors().Build(); + _selectedRML = new RmlBuilder(_activeJobDbContext).Set(SelectedRML.Guid).WithAllParametersGroup().WithCAT(SelectedMachine.Guid).WithCCT().WithLiquidFactors().Build(); - if (_selectedRML.Ccts.Count == 0) + if (_selectedRML.Cct == null) { InvokeUI(() => { @@ -1988,7 +1992,7 @@ namespace Tango.MachineStudio.Developer.ViewModels foreach (var stop in SelectedSegment.BrushStops.OrderBy(x => x.StopIndex)) { - stop.SetStopIndex(index++); + stop.SetStopIndexNoRaise(index++); } if (SelectedSegment.BrushStops.Count > 1) @@ -2024,8 +2028,8 @@ namespace Tango.MachineStudio.Developer.ViewModels _notification.ShowInfo("A job must contain at least one segment."); return; } - ActiveJob.Segments.Remove(x); - x.DefferedDelete(_activeJobDbContext); + + x.Delete(_activeJobDbContext); }); ArrangeSegmentsIndices(); @@ -2075,8 +2079,7 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log(String.Format("Removing {0} jobs...", SelectedJobs.Count)); SelectedJobs.ToList().ForEach(x => { - SelectedMachine.Jobs.Remove(x); - x.DefferedDelete(_machineDbContext); + x.Delete(_machineDbContext); }); using (_notification.PushTaskItem("Removing selected jobs...")) @@ -2163,7 +2166,6 @@ namespace Tango.MachineStudio.Developer.ViewModels return; } SelectedSegment.BrushStops.Remove(x); - x.DefferedDelete(_activeJobDbContext); }); ArrangeBrushStopsIndices(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 8a5ec94fa..861a639d3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -7,7 +7,7 @@ xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:brushPicker="clr-namespace:Tango.BrushPicker;assembly=Tango.BrushPicker" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" - xmlns:colorConversion="clr-namespace:Tango.BL.ColorConversion;assembly=Tango.BL" + xmlns:colorConversion="clr-namespace:Tango.ColorConversion;assembly=Tango.ColorConversion" xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive" xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common" xmlns:sys="clr-namespace:System;assembly=mscorlib" @@ -28,7 +28,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" - d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" x:Name="control"> <UserControl.Resources> @@ -85,7 +85,7 @@ </ObjectDataProvider> - <SolidColorBrush x:Key="SideBarBackground" Color="White"> + <SolidColorBrush x:Key="SideBarBackground" Color="{Binding Path=Color, Source={StaticResource SideBarBackgroundBrush}}"> </SolidColorBrush> @@ -126,18 +126,12 @@ </Style> <Style TargetType="Border" x:Key="JobFieldBorder"> - <Setter Property="BorderBrush" Value="#A5A4A4"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource LightGrayBrush}"></Setter> <Setter Property="BorderThickness" Value="0 0 1 1"></Setter> <Setter Property="CornerRadius" Value="100 10 100 0"></Setter> <Setter Property="Padding" Value="10 5 10 5"></Setter> <Setter Property="Margin" Value="0 0 10 0"></Setter> - <Setter Property="Background"> - <Setter.Value> - <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> - <GradientStop Color="#00E6E6E6"/> - <GradientStop Color="#DEDEDE" Offset="1"/> - </LinearGradientBrush> - </Setter.Value> + <Setter Property="Background" Value="{StaticResource borderBackground}"> </Setter> </Style> @@ -167,7 +161,7 @@ </StackPanel> </ToggleButton> <Popup x:Name="Popup" MouseDown="Popup_MouseDown" PopupAnimation="Fade" StaysOpen="False" PlacementTarget="{Binding ElementName=PopupButton}" Placement="Bottom" AllowsTransparency="True"> - <Border Background="#E6FFFFFF" CornerRadius="5" Margin="10"> + <Border Background="{StaticResource WhiteBrush}" CornerRadius="5" Margin="10"> <Border.Effect> <DropShadowEffect ShadowDepth="0" BlurRadius="10" /> </Border.Effect> @@ -194,7 +188,7 @@ <Setter Property="BorderThickness" Value="1"></Setter> <Setter Property="ToolTip"> <Setter.Value> - <ToolTip Background="White"> + <ToolTip Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}"> <ItemsControl ItemsSource="{Binding Coordinates.OutputLiquids}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> @@ -203,7 +197,7 @@ </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> - <TextBlock TextAlignment="Center" Foreground="#202020" Margin="10 0"> + <TextBlock TextAlignment="Center" Foreground="{StaticResource DarkGrayBrush200}" Margin="10 0"> <Run Text="{Binding LiquidType}"></Run> <LineBreak/> <Run Text="{Binding Volume,StringFormat=0}"></Run> @@ -249,7 +243,17 @@ <DataTemplate x:Key="Volume_Template"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <StackPanel VerticalAlignment="Center"> - <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center"> + <ItemsControl VerticalAlignment="Center"> + <ItemsControl.Style> + <Style TargetType="ItemsControl"> + <Setter Property="ItemsSource" Value="{Binding LiquidVolumes}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Settings.UsePreferredLiquidVolumeIndex}" Value="True"> + <Setter Property="ItemsSource" Value="{Binding LiquidVolumesOrdered}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ItemsControl.Style> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> @@ -284,8 +288,8 @@ </ItemsControl> <StackPanel Orientation="Horizontal" Margin="30 10 0 0" Height="16" Visibility="{Binding IsLiquidVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> - <materialDesign:PackIcon Kind="Alert" Foreground="#FFAC3C" /> - <TextBlock Margin="5 0 0 0" Foreground="#FFAC3C">Liquid volumes exceeds the maximum range for color conversion!</TextBlock> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource OrangeBrush}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource OrangeBrush}">Liquid volumes exceeds the maximum range for color conversion!</TextBlock> </StackPanel> </StackPanel> @@ -300,7 +304,7 @@ <Run>)</Run> </TextBlock> - <Border Margin="60 0 0 0" DataContext="{Binding LiquidVolumes,Converter={StaticResource LiquidVolumesToLubricantLiquidVolume}}" BorderBrush="#E6E6E6" BorderThickness="1 0 0 0"> + <Border Margin="60 0 0 0" DataContext="{Binding LiquidVolumes,Converter={StaticResource LiquidVolumesToLubricantLiquidVolume}}" BorderBrush="{StaticResource WhiteBrush100}" BorderThickness="1 0 0 0"> <Border.Style> <Style TargetType="Border"> <Setter Property="Visibility" Value="Collapsed"></Setter> @@ -315,7 +319,7 @@ <ContentControl.Foreground> <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> </ContentControl.Foreground> - <mahapps:NumericUpDown Foreground="#515151" ScrollViewer.HorizontalScrollBarVisibility="Disabled" FontSize="20" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown Foreground="{StaticResource GrayBrush250}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" FontSize="20" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> </mahapps:NumericUpDown.Resources> @@ -328,7 +332,7 @@ <DataTemplate x:Key="RGB_Template"> <StackPanel> <StackPanel Orientation="Horizontal"> - <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF6F6F" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl Style="{StaticResource numberBorder}" Foreground="{StaticResource RedBrush200}" Width="60" Height="60" Margin="10 0 0 0"> <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> @@ -336,7 +340,7 @@ </mahapps:NumericUpDown> </ContentControl> - <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl Style="{StaticResource numberBorder}" Foreground="{StaticResource GreenBrush400}" Width="60" Height="60" Margin="10 0 0 0"> <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> @@ -344,7 +348,7 @@ </mahapps:NumericUpDown> </ContentControl> - <ContentControl Style="{StaticResource numberBorder}" Foreground="#3C7EF4" BorderThickness="1" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl Style="{StaticResource numberBorder}" Foreground="{StaticResource DarkBlueBrush}" BorderThickness="1" Width="60" Height="60" Margin="10 0 0 0"> <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> @@ -356,8 +360,8 @@ </StackPanel> <StackPanel Orientation="Horizontal" Margin="30 10 0 0" Height="16" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> - <materialDesign:PackIcon Kind="Alert" Foreground="#FF6D6D" /> - <TextBlock Margin="5 0 0 0" Foreground="#FF6D6D">Color is out of gamut!</TextBlock> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush200}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush200}">Color is out of gamut!</TextBlock> </StackPanel> </StackPanel> </DataTemplate> @@ -372,7 +376,7 @@ </mahapps:NumericUpDown> </ContentControl> - <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF8A8A" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl Style="{StaticResource numberBorder}" Foreground="{StaticResource RedBrush400}" Width="60" Height="60" Margin="10 0 0 0"> <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> @@ -380,7 +384,7 @@ </mahapps:NumericUpDown> </ContentControl> - <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl Style="{StaticResource numberBorder}" Foreground="{StaticResource GreenBrush400}" Width="60" Height="60" Margin="10 0 0 0"> <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> @@ -418,7 +422,7 @@ </mahapps:NumericUpDown> </ContentControl> - <ContentControl Style="{StaticResource numberBorder}" Foreground="Black" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl Style="{StaticResource numberBorder}" Foreground="{StaticResource BlackForegroundBrush}" Width="60" Height="60" Margin="10 0 0 0"> <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Black,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> <mahapps:NumericUpDown.Resources> <Style TargetType="TextBox"/> @@ -446,7 +450,7 @@ <ColumnDefinition Width="1*" /> </Grid.ColumnDefinitions> - <Grid Background="#96FFFFFF"> + <Grid Background="{StaticResource TransparentBackgroundBrush}"> <Grid.Style> <Style TargetType="Grid"> <Setter Property="Width" Value="304"></Setter> @@ -478,19 +482,19 @@ <DockPanel> <Border DockPanel.Dock="Bottom" Margin="10"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> - <Button Command="{Binding DuplicateSegmentCommand}" Margin="0 0 4 0" Background="#FF9A6A" BorderBrush="#FF9A6A" Height="42" Padding="10" ToolTip="Duplicate Segment"> + <Button Command="{Binding DuplicateSegmentCommand}" Margin="0 0 4 0" Background="{StaticResource OrangeBrush300}" BorderBrush="{StaticResource OrangeBrush300}" Height="42" Padding="10" ToolTip="Duplicate Segment"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="ContentCopy" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock VerticalAlignment="Center">Duplicate</TextBlock> </StackPanel> </Button> - <Button Command="{Binding RemoveSegmentCommand}" Margin="0 0 4 0" Background="#FF6A6A" BorderBrush="#FF6A6A" Height="42" Padding="10" ToolTip="Remove Segment"> + <Button Command="{Binding RemoveSegmentCommand}" Margin="0 0 4 0" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Height="42" Padding="10" ToolTip="Remove Segment"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock VerticalAlignment="Center">Remove</TextBlock> </StackPanel> </Button> - <Button AutomationProperties.AutomationId="{x:Static automation:Developer.AddSegmentButton}" Command="{Binding AddSegmentCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10" ToolTip="Add Segment"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.AddSegmentButton}" Command="{Binding AddSegmentCommand}" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Height="42" Padding="10" ToolTip="Add Segment"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock VerticalAlignment="Center">New</TextBlock> @@ -514,25 +518,14 @@ </Polygon.Effect> <Polygon.Style> <Style TargetType="Polygon"> - <Setter Property="Stroke" Value="Black"></Setter> - <Setter Property="Fill"> - <Setter.Value> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="#00EEEEEE" Offset="0" /> - <GradientStop Color="#FFB5B5B5" Offset="1" /> - </LinearGradientBrush> - </Setter.Value> + <Setter Property="Stroke" Value="{StaticResource BlackForegroundBrush}"></Setter> + <Setter Property="Fill" Value="{StaticResource SegmentGradientBrush}"> </Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True"> - <Setter Property="Stroke" Value="Black"></Setter> - <Setter Property="Fill"> - <Setter.Value> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="White" Offset="0" /> - <GradientStop Color="{StaticResource AccentColor}" Offset="2" /> - </LinearGradientBrush> - </Setter.Value> + <Setter Property="Stroke" Value="{StaticResource BlackForegroundBrush}"></Setter> + <Setter Property="Fill" Value="{StaticResource SelectedSegmentGradientBrush}"> + </Setter> </DataTrigger> </Style.Triggers> @@ -554,12 +547,12 @@ </Grid.ColumnDefinitions> <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> - <TextBlock FontWeight="SemiBold">#</TextBlock> - <TextBlock FontWeight="SemiBold" Margin="5 0 0 0" Text="{Binding SegmentIndex}"></TextBlock> + <TextBlock FontWeight="SemiBold" Foreground="{StaticResource DarkGrayBrush}">#</TextBlock> + <TextBlock FontWeight="SemiBold" Margin="5 0 0 0" Text="{Binding SegmentIndex}" Foreground="{StaticResource DarkGrayBrush}"></TextBlock> </StackPanel> - <TextBox Grid.Column="1" CaretBrush="Transparent" Cursor="Arrow" VerticalAlignment="Center" Width="200" HorizontalContentAlignment="Center" Style="{x:Null}" BorderThickness="0" Background="Transparent" Text="{Binding Name}"></TextBox> + <TextBox Grid.Column="1" CaretBrush="Transparent" Cursor="Arrow" VerticalAlignment="Center" Width="200" HorizontalContentAlignment="Center" Style="{x:Null}" BorderThickness="0" Background="Transparent" Text="{Binding Name}" Foreground="{StaticResource DarkGrayBrush}"></TextBox> </Grid> </Grid> @@ -571,16 +564,16 @@ <Rectangle HorizontalAlignment="Right" StrokeThickness="1" Width="3" Margin="0 0 0 0"> <Rectangle.Fill> <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="#ECECEC" /> - <GradientStop Offset="0.5" Color="Black" /> - <GradientStop Offset="1.1" Color="Black" /> + <GradientStop Offset="0" Color="{Binding Source={StaticResource WhiteBrush100}, Path=Color}" /> + <GradientStop Offset="0.5" Color="{Binding Source={StaticResource BlackForegroundBrush}, Path=Color}" /> + <GradientStop Offset="1.1" Color="{Binding Source={StaticResource BlackForegroundBrush}, Path=Color}" /> </LinearGradientBrush> </Rectangle.Fill> <Rectangle.Stroke> <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="White" /> - <GradientStop Offset="0.5" Color="White" /> - <GradientStop Offset="1" Color="White" /> + <GradientStop Offset="0" Color="{Binding Source={StaticResource BorderBrushGainsboro}, Path=Color}" /> + <GradientStop Offset="0.5" Color="{Binding Source={StaticResource BorderBrushGainsboro}, Path=Color}" /> + <GradientStop Offset="1" Color="{Binding Source={StaticResource BorderBrushGainsboro}, Path=Color}" /> </LinearGradientBrush> </Rectangle.Stroke> </Rectangle> @@ -591,7 +584,12 @@ <RowDefinition Height="Auto" /> <RowDefinition/> </Grid.RowDefinitions> - + <Grid.Resources> + <Style TargetType="TextBlock"> + <Setter Property="Foreground" + Value="{StaticResource JobFieldForeground}" /> + </Style> + </Grid.Resources> <Grid> <StackPanel> <Grid> @@ -613,7 +611,7 @@ <Image Source="../Images/name.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock> </StackPanel> - <TextBox Margin="0 3 0 0" Width="100" HorizontalAlignment="Left" Text="{Binding ActiveJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox> + <TextBox Margin="0 3 0 0" Width="100" HorizontalAlignment="Left" Text="{Binding ActiveJob.Name,UpdateSourceTrigger=PropertyChanged}" Foreground="{StaticResource JobFieldForeground}"></TextBox> </StackPanel> </Border> @@ -623,7 +621,7 @@ <Image Source="../Images/wind.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock> </StackPanel> - <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding WindingMethods}" SelectedItem="{Binding ActiveJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox> + <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding WindingMethods}" SelectedItem="{Binding ActiveJob.WindingMethod}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> </StackPanel> </Border> @@ -633,20 +631,20 @@ <Image Source="../Images/thread.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Spool</TextBlock> </StackPanel> - <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding SpoolTypes}" SelectedItem="{Binding ActiveJob.SpoolType}" > + <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding SpoolTypes}" SelectedItem="{Binding ActiveJob.SpoolType}" Style="{StaticResource TransparentComboBoxStyle}" > <ComboBox.ToolTip> <TextBlock> <Run Text="{Binding ActiveJob.SpoolType.Name}"></Run> - <Run FontSize="9" Foreground="#D9D9D9" Text="{Binding ActiveJob.SpoolType.Length,Mode=OneWay}"></Run> - <Run FontSize="9" Foreground="#DEDEDE" Text="m"></Run> + <Run FontSize="9" Foreground="{StaticResource LightGrayBrush200}" Text="{Binding ActiveJob.SpoolType.Length,Mode=OneWay}"></Run> + <Run FontSize="9" Foreground="{StaticResource LightGrayBrush200}" Text="m"></Run> </TextBlock> </ComboBox.ToolTip> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock TextTrimming="CharacterEllipsis"> <Run Text="{Binding Name}"></Run> - <Run FontSize="9" Foreground="Gray" Text="{Binding Length,Mode=OneWay}"></Run> - <Run FontSize="9" Foreground="Gray" Text="m"></Run> + <Run FontSize="9" Foreground="{StaticResource GrayBrush}" Text="{Binding Length,Mode=OneWay}"></Run> + <Run FontSize="9" Foreground="{StaticResource GrayBrush}" Text="m"></Run> </TextBlock> </DataTemplate> </ComboBox.ItemTemplate> @@ -662,7 +660,7 @@ </StackPanel> <DockPanel LastChildFill="True"> <ToggleButton Margin="10 0 25 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding ActiveJob.EnableInterSegment}"></ToggleButton> - <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" Width="70" HorizontalAlignment="Left" StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding ActiveJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" Width="70" HorizontalAlignment="Left" StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding ActiveJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="{StaticResource DimGrayBrush}" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> </DockPanel> </StackPanel> </Border> @@ -685,7 +683,7 @@ <Image Source="../Images/repeat.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Units</TextBlock> </StackPanel> - <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" Width="70" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" Margin="0 5 0 0" HideUpDownButtons="True" Minimum="1" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.NumberOfUnits,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" Width="70" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" Margin="0 5 0 0" HideUpDownButtons="True" Minimum="1" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="{StaticResource DimGrayBrush}" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.NumberOfUnits,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> </Border> @@ -696,7 +694,7 @@ <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Description</TextBlock> </StackPanel> - <Border BorderThickness="0" BorderBrush="Silver" CornerRadius="5" Margin="0 0 5 5"> + <Border BorderThickness="0" BorderBrush="{StaticResource borderBrush}" CornerRadius="5" Margin="0 0 5 5"> <TextBox Padding="5 0 0 0" FontStyle="Italic" Background="Transparent" Style="{x:Null}" BorderThickness="0" Margin="5" Height="40" Text="{Binding ActiveJob.Description}" VerticalAlignment="Stretch" materialDesign:HintAssist.Hint="Enter description" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox> </Border> </StackPanel> @@ -708,13 +706,13 @@ <Grid HorizontalAlignment="Right" Margin="0 0 10 0"> <StackPanel Orientation="Horizontal"> - <Button AutomationProperties.AutomationId="{x:Static automation:Developer.ToJobsButton}" Height="70" Width="100" Margin="0 0 10 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding DiscardJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.ToJobsButton}" Height="70" Width="100" Margin="0 0 10 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="{StaticResource DarkGrayBrush}" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding DiscardJobCommand}"> <StackPanel> <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="KeyboardBackspace" /> <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">TO JOBS</TextBlock> </StackPanel> </Button> - <Button AutomationProperties.AutomationId="{x:Static automation:Developer.SaveJobButton}" Height="70" Width="100" Margin="0 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.SaveJobButton}" Height="70" Width="100" Margin="0 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="{StaticResource DarkGrayBrush}" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobCommand}"> <StackPanel> <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="ContentSave" /> <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">SAVE JOB</TextBlock> @@ -743,7 +741,7 @@ <Image Source="../Images/ruler.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Segment Length</TextBlock> </StackPanel> - <mahapps:NumericUpDown x:Name="numSegmentLength" FontSize="{StaticResource NumbersFontSize}" HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> + <mahapps:NumericUpDown x:Name="numSegmentLength" FontSize="{StaticResource NumbersFontSize}" HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="{StaticResource DimGrayBrush}" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> <mahapps:NumericUpDown.Resources> <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> </mahapps:NumericUpDown.Resources> @@ -755,7 +753,7 @@ <StackPanel> <TextBlock>MEDIA</TextBlock> <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <ComboBox Width="250" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}"> + <ComboBox Width="250" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" Style="{StaticResource TransparentComboBoxStyle}"> <ComboBox.ItemTemplate> <DataTemplate> <StackPanel> @@ -785,16 +783,16 @@ </StackPanel> - <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal" Margin="0 40 40 0"> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 40 180 0"> <materialDesign:PackIcon Kind="ChevronLeft" Width="24" Height="24" /> - <TextBlock Margin="10 -2 10 0" VerticalAlignment="Center"><Run>SUPPORTED MEDIA LIQUID</Run> <Run FontSize="10" Foreground="DimGray">( Max Nanolitter/CM )</Run></TextBlock> + <TextBlock Margin="0 -2 0 0" VerticalAlignment="Center"><Run>SUPPORTED MEDIA LIQUID</Run> <Run FontSize="10" Foreground="{StaticResource DimGrayBrush}">( Max Nanolitter/CM )</Run></TextBlock> <materialDesign:PackIcon Kind="ChevronRight" Width="24" Height="24" /> </StackPanel> - <Grid HorizontalAlignment="Right" Margin="0 0 0 0" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}"> + <Grid HorizontalAlignment="Right" Margin="0 0 0 0"> <StackPanel HorizontalAlignment="Right" Margin="0 0 0 0"> <StackPanel Margin="0 10 0 0" Orientation="Horizontal" VerticalAlignment="Center"> - <ItemsControl ItemsSource="{Binding LiquidTypesRmls}"> + <ItemsControl ItemsSource="{Binding LiquidTypesRmls}" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <WrapPanel IsItemsHost="True"></WrapPanel> @@ -803,7 +801,7 @@ <ItemsControl.ItemTemplate> <DataTemplate DataType="{x:Type observables:LiquidTypesRml}"> <StackPanel Margin="0 0 10 0"> - <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="DimGray" Text="{Binding LiquidType.Name}"></TextBlock> + <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="{StaticResource DimGrayBrush}" Text="{Binding LiquidType.Name}"></TextBlock> <Grid Width="58" Height="48" Margin="0 5 0 0"> <shapes:Hexagon StrokeThickness="1" Stroke="Gray"> <shapes:Hexagon.Fill> @@ -814,19 +812,27 @@ </shapes:Hexagon.Fill> </shapes:Hexagon> - <TextBox Style="{x:Null}" Background="Transparent" Foreground="Black" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic"></TextBox> + <TextBox Style="{x:Null}" Background="Transparent" Foreground="{StaticResource Hexagon.ForegroundBrush}" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic"></TextBox> </Grid> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> - <Button Command="{Binding SaveLiquidFactorsCommand}" HorizontalAlignment="Right" Margin="0 20 0 0" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Harddisk"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0">SAVE FACTORS</TextBlock> + <StackPanel Margin="0 20 0 0"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 0 0 5" ToolTip="Sort the liquid volumes by their liquid type preferred index"> + <Viewbox Width="25"> + <ToggleButton IsChecked="{Binding Settings.UsePreferredLiquidVolumeIndex}" /> + </Viewbox> + <TextBlock Margin="5 0 0 0" FontSize="10">Use Preferred Index</TextBlock> </StackPanel> - </Button> + <Button Command="{Binding SaveLiquidFactorsCommand}" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Harddisk"></materialDesign:PackIcon> + <TextBlock Margin="10 0 0 0" Foreground="{StaticResource CheckmarkFill}">SAVE FACTORS</TextBlock> + </StackPanel> + </Button> + </StackPanel> </StackPanel> </StackPanel> </Grid> @@ -835,22 +841,22 @@ <Border DockPanel.Dock="Bottom" Margin="10"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> - <Button Command="{Binding DuplicateBrushStopCommand}" Margin="0 0 4 0" Background="#FF9A6A" BorderBrush="#FF9A6A" Height="42" Padding="10"> + <Button Command="{Binding DuplicateBrushStopCommand}" Margin="0 0 4 0" Background="{StaticResource OrangeBrush300}" BorderBrush="{StaticResource OrangeBrush300}" Height="42" Padding="10"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="ContentCopy" Width="24" Height="24"></materialDesign:PackIcon> - <TextBlock VerticalAlignment="Center">Duplicate</TextBlock> + <TextBlock VerticalAlignment="Center" Foreground="{StaticResource AccentSelectedColorBrush}">Duplicate</TextBlock> </StackPanel> </Button> - <Button Command="{Binding RemoveBrushStopCommand}" Margin="0 0 4 0" Background="#FF6A6A" BorderBrush="#FF6A6A" Height="42" Padding="10"> + <Button Command="{Binding RemoveBrushStopCommand}" Margin="0 0 4 0" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Height="42" Padding="10"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="24" Height="24"></materialDesign:PackIcon> - <TextBlock VerticalAlignment="Center">Remove</TextBlock> + <TextBlock VerticalAlignment="Center" Foreground="{StaticResource AccentSelectedColorBrush}">Remove</TextBlock> </StackPanel> </Button> - <Button AutomationProperties.AutomationId="{x:Static automation:Developer.AddBrushStopButton}" Command="{Binding AddBrushStopCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.AddBrushStopButton}" Command="{Binding AddBrushStopCommand}" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Height="42" Padding="10"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon> - <TextBlock VerticalAlignment="Center">New</TextBlock> + <TextBlock VerticalAlignment="Center" Foreground="{StaticResource AccentSelectedColorBrush}">New</TextBlock> </StackPanel> </Button> </StackPanel> @@ -861,15 +867,15 @@ <Grid DockPanel.Dock="Top"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <Image Source="../Images/color-palette.png" Width="42"></Image> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">SEGMENT BRUSH</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="{StaticResource DimGrayBrush}" FontSize="16" FontWeight="SemiBold">SEGMENT BRUSH</TextBlock> </StackPanel> <DockPanel> <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 0 0 0"> - <TextBlock VerticalAlignment="Center" Foreground="DimGray">Generate Gradient</TextBlock> + <TextBlock VerticalAlignment="Center" Foreground="{StaticResource DimGrayBrush}">Generate Gradient</TextBlock> <ToggleButton Margin="10 0 0 0" IsChecked="{Binding Settings.EnableGradientGeneration,Mode=TwoWay}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Foreground="DimGray">Resolution:</TextBlock> - <mahapps:NumericUpDown HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontSize="14" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N0} cm" Margin="5 1 0 0" Minimum="10" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Settings.GradientResolutionCM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Foreground="{StaticResource DimGrayBrush}">Resolution:</TextBlock> + <mahapps:NumericUpDown HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontSize="14" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N0} cm" Margin="5 1 0 0" Minimum="10" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" BorderBrush="{StaticResource DimGrayBrush}" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Settings.GradientResolutionCM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> <mahapps:NumericUpDown.Resources> <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> </mahapps:NumericUpDown.Resources> @@ -883,10 +889,30 @@ </DockPanel> </Grid> <Grid Margin="0 10 10 0"> - <controls:MultiSelectListBox AutomationProperties.AutomationId="{x:Static automation:Developer.BrushStopsListBox}" SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding BrushStopsCollectionView}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch"> + <controls:MultiSelectListBox x:Name="listStops" AutomationProperties.AutomationId="{x:Static automation:Developer.BrushStopsListBox}" SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding BrushStopsCollectionView}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch"> + <ListBox.Template> + <ControlTemplate TargetType="{x:Type ListBox}"> + <Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" Padding="1"> + <Grid> + <ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false"> + <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> + </ScrollViewer> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Background" TargetName="Bd" Value="Transparent" /> + </Trigger> + <Trigger Property="IsGrouping" Value="true"> + <Setter Property="ScrollViewer.CanContentScroll" Value="false" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </ListBox.Template> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}"> - + <EventSetter Event="PreviewMouseDown" Handler="OnBrushStopMouseDown"></EventSetter> </Style> </ListBox.ItemContainerStyle> <ItemsControl.ItemTemplate> @@ -896,8 +922,8 @@ <Border BorderThickness="1" CornerRadius="5" Padding="10" dragAndDrop:DragAndDropService.Drop="OnBrushStopBorderDrop"> <Border.Style> <Style TargetType="Border" BasedOn="{StaticResource brushStopBorder}"> - <Setter Property="BorderBrush" Value="#B5B5B5"></Setter> - <Setter Property="Background" Value="#70FFFFFF"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource LightGrayBrush100}"></Setter> + <Setter Property="Background" Value="{StaticResource TransparentBackgroundBrush600}"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True"> <Setter Property="BorderBrush" Value="Gainsboro"></Setter> @@ -944,7 +970,7 @@ <ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name" Width="100" HorizontalAlignment="Left"> <ComboBox.ItemContainerStyle> <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> - <Setter Property="Background" Value="#ECECEC"></Setter> + <Setter Property="Background" Value="{StaticResource WhiteBrush100}"></Setter> </Style> </ComboBox.ItemContainerStyle> </ComboBox> @@ -964,9 +990,9 @@ </Style> </StackPanel.Style> <TextBlock Width="180" TextAlignment="Center" HorizontalAlignment="Center" FontSize="16"> - <Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:" Foreground="#5E5E5E"></Run> - <Run FontFamily="{StaticResource digital-7}" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}"></Run> - <Run FontSize="12" Foreground="Gray" Text="{Binding OffsetMeters,Mode=OneWay,StringFormat={} ( {0:F1}m )}"></Run> + <Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:" Foreground="{StaticResource GrayBrush250}"></Run> + <Run FontFamily="{StaticResource digital-7}" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}" Foreground="{StaticResource BlackForegroundBrush}"></Run> + <Run FontSize="12" Foreground="{StaticResource GrayBrush250}" Text="{Binding OffsetMeters,Mode=OneWay,StringFormat={} ( {0:F1}m )}"></Run> </TextBlock> <Slider ValueChanged="Offset_Slider_ValueChanged" Style="{StaticResource GradientOffsetSlider}" SmallChange="0.1" IsSnapToTickEnabled="True" TickFrequency="0.1" Margin="0 20 0 0" HorizontalAlignment="Center" Width="300" Value="{Binding OffsetPercent}" IsEnabled="{Binding IsMiddle}" Minimum="0" Maximum="100"> <Slider.Foreground> @@ -1030,7 +1056,17 @@ <DataTrigger Binding="{Binding ElementName=toggleExpand,Path=IsChecked}" Value="True"> <Setter Property="Content"> <Setter.Value> - <DataGrid ItemsSource="{Binding LiquidVolumes}" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" Background="Transparent" SelectionUnit="FullRow"> + <DataGrid AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" Background="Transparent" SelectionUnit="FullRow"> + <DataGrid.Style> + <Style TargetType="DataGrid" BasedOn="{StaticResource {x:Type DataGrid}}"> + <Setter Property="ItemsSource" Value="{Binding LiquidVolumes}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Source={x:Reference control},Path=DataContext.Settings.UsePreferredLiquidVolumeIndex}" Value="True"> + <Setter Property="ItemsSource" Value="{Binding LiquidVolumesOrdered}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </DataGrid.Style> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> @@ -1042,7 +1078,7 @@ <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Grid x:Name="t0"> - <Polygon x:Name="t1" Points="0,0 15,0 0,15 0,0" Margin="-15 -11 0 0"> + <Polygon x:Name="t1" Points="0,0 15,0 0,15 0,0" Margin="-15 -9 0 0"> <Polygon.Fill> <SolidColorBrush x:Name="t2" Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter},FallbackValue={StaticResource dummyColor}}" /> </Polygon.Fill> @@ -1064,7 +1100,7 @@ <DataTemplate> <TextBlock VerticalAlignment="Center"> <Run Text="{Binding NanoliterPerStep,Mode=OneWay,StringFormat='0.00'}"></Run> - <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + <Run Text="(nl)" FontSize="9" Foreground="{StaticResource GrayBrush250}"></Run> </TextBlock> </DataTemplate> </DataGridTemplateColumn.CellTemplate> @@ -1075,7 +1111,7 @@ <ComboBox ItemsSource="{Binding Source={StaticResource dispenserDivisions}}" SelectedItem="{Binding DispenserStepDivision,UpdateSourceTrigger=PropertyChanged}" BorderThickness="0"> <ComboBox.ItemContainerStyle> <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> - <Setter Property="Background" Value="#ECECEC"></Setter> + <Setter Property="Background" Value="{StaticResource WhiteBrush100}"></Setter> </Style> </ComboBox.ItemContainerStyle> <ComboBox.ItemTemplate> @@ -1092,7 +1128,7 @@ <DataTemplate> <TextBlock VerticalAlignment="Center"> <Run Text="{Binding LiquidMaxNanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run> - <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + <Run Text="(nl)" FontSize="9" Foreground="{StaticResource GrayBrush250}"></Run> </TextBlock> </DataTemplate> </DataGridTemplateColumn.CellTemplate> @@ -1102,7 +1138,7 @@ <DataTemplate> <TextBlock VerticalAlignment="Center"> <Run Text="{Binding Volume}"></Run> - <Run Text="%" Foreground="Gray"></Run> + <Run Text="%" Foreground="{StaticResource GrayBrush250}"></Run> </TextBlock> </DataTemplate> </DataGridTemplateColumn.CellTemplate> @@ -1121,7 +1157,7 @@ <DataTemplate> <TextBlock VerticalAlignment="Center"> <Run Text="{Binding NanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run> - <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + <Run Text="(nl)" FontSize="9" Foreground="{StaticResource GrayBrush250}"></Run> </TextBlock> </DataTemplate> </DataGridTemplateColumn.CellTemplate> @@ -1131,7 +1167,7 @@ <DataTemplate> <TextBlock VerticalAlignment="Center"> <Run Text="{Binding NanoliterPerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> - <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + <Run Text="(nl)" FontSize="9" Foreground="{StaticResource GrayBrush250}"></Run> </TextBlock> </DataTemplate> </DataGridTemplateColumn.CellTemplate> @@ -1146,7 +1182,7 @@ <Setter.Value> <TextBlock> <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> - <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run> + <Run Text="(pulse)" FontSize="9" Foreground="{StaticResource GrayBrush250}"></Run> </TextBlock> </Setter.Value> </Setter> @@ -1159,7 +1195,7 @@ <Setter.Value> <TextBlock> <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> - <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run> + <Run Text="(pulse)" FontSize="9" Foreground="{StaticResource GrayBrush250}"></Run> </TextBlock> </Setter.Value> </Setter> @@ -1214,8 +1250,8 @@ <DockPanel> <Grid DockPanel.Dock="Left" VerticalAlignment="Center" Margin="20 15 0 0"> <TextBlock FontSize="16" Margin="0 0 0 0"> - <Run FontWeight="Bold">ESTIMATED DURATION:</Run> - <Run Foreground="Black" FontSize="22" FontStyle="Italic" FontFamily="{StaticResource digital-7}" Text="{Binding EstimatedDuration,StringFormat=hh\\:mm\\:ss,TargetNullValue='00:00:00'}"></Run> + <Run FontWeight="Bold" Foreground="{StaticResource BlackForegroundBrush}">ESTIMATED DURATION:</Run> + <Run Foreground="{StaticResource BlackForegroundBrush}" FontSize="22" FontStyle="Italic" FontFamily="{StaticResource digital-7}" Text="{Binding EstimatedDuration,StringFormat=hh\\:mm\\:ss,TargetNullValue='00:00:00'}"></Run> </TextBlock> </Grid> @@ -1224,17 +1260,17 @@ <Button Height="60" Width="280" Command="{Binding StartJobCommand}" Click="OnJobStartClick"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon VerticalAlignment="Center" Width="32" Height="32" Kind="ClockFast" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="18">START JOB</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="18" Foreground="{StaticResource WhiteTextBrush}">START JOB</TextBlock> </StackPanel> </Button> <Button Height="60" Width="60" Margin="-60 0 0 0" Padding="0" Command="{Binding StartJobAndRecordCommand}" Click="OnJobStartClick" ToolTip="Start Job and Record"> - <materialDesign:PackIcon VerticalAlignment="Center" Width="38" Height="38" Kind="Record" Foreground="#FF6D6D" /> + <materialDesign:PackIcon VerticalAlignment="Center" Width="38" Height="38" Kind="Record" Foreground="{StaticResource RedBrush200}" /> </Button> </StackPanel> <Button Command="{Binding ToRunningJobCommand}" Width="280" Height="60" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon VerticalAlignment="Center" Width="32" Height="32" Kind="AlertCircle" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="18">VIEW RUNNING JOB</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="18" Foreground="{StaticResource WhiteTextBrush}">VIEW RUNNING JOB</TextBlock> </StackPanel> </Button> </Grid> @@ -1270,11 +1306,11 @@ </Rectangle> <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center"> - <TextBlock FontSize="12" HorizontalAlignment="Right" Foreground="Black"> + <TextBlock FontSize="12" HorizontalAlignment="Right" Foreground="{StaticResource BlackForegroundBrush}"> <Run Text="{Binding Length,Mode=OneWay,StringFormat=N2}"></Run> - <Run Foreground="Gray" FontSize="10" Text="m"></Run> + <Run Foreground="{StaticResource GrayBrush250}" FontSize="10" Text="m"></Run> </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="8" Height="8" Foreground="DimGray"> + <materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="8" Height="8" Foreground="{StaticResource DimGrayBrush}"> <materialDesign:PackIcon.RenderTransform> <RotateTransform Angle="180" /> </materialDesign:PackIcon.RenderTransform> @@ -1286,28 +1322,28 @@ </ItemsControl> <StackPanel Margin="-30 -5 0 0" HorizontalAlignment="Left"> - <TextBlock FontSize="12" Foreground="Black"> + <TextBlock FontSize="12" Foreground="{StaticResource BlackForegroundBrush}"> <Run Text="0"></Run> - <Run Foreground="Gray" FontSize="10" Text="m"></Run> + <Run Foreground="{StaticResource GrayBrush250}" FontSize="10" Text="m"></Run> </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="16" Height="16" Foreground="DimGray"> + <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="16" Height="16" Foreground="{StaticResource DimGrayBrush}"> </materialDesign:PackIcon> </StackPanel> <StackPanel Margin="0 -5 -20 0" HorizontalAlignment="Right"> - <TextBlock FontSize="12" Foreground="Black"> + <TextBlock FontSize="12" Foreground="{StaticResource BlackForegroundBrush}"> <Run Text="{Binding ActiveJob.Length,Mode=OneWay,StringFormat=N2}"></Run> <Run Foreground="Gray" FontSize="10" Text="m"></Run> <Run>x</Run> <Run Text="{Binding ActiveJob.NumberOfUnits}"></Run> </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="16" Height="16" Foreground="DimGray"> + <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="16" Height="16" Foreground="{StaticResource DimGrayBrush}"> </materialDesign:PackIcon> </StackPanel> - <Border BorderBrush="Gainsboro" BorderThickness="1" VerticalAlignment="Bottom" Height="20" Margin="40 0 50 0"> + <Border BorderBrush="{StaticResource BorderBrushGainsboro}" BorderThickness="1" VerticalAlignment="Bottom" Height="20" Margin="40 0 50 0"> </Border> </Grid> @@ -1321,7 +1357,7 @@ </Grid> <Grid> - <Grid Background="#B9FFFFFF"> + <Grid Background="{StaticResource TransparentBackgroundBrush100}"> <Grid.Style> <Style TargetType="Grid"> <Setter Property="Width" Value="520"></Setter> @@ -1362,7 +1398,7 @@ <ComboBox Margin="0 10 0 0" ItemsSource="{Binding GroupsHistory}" SelectedItem="{Binding SelectedGroupHistory}"> <ComboBox.ItemContainerStyle> <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> - <Setter Property="Background" Value="#E6FFFFFF"></Setter> + <Setter Property="Background" Value="{StaticResource TransparentBackgroundBrush200}"></Setter> <Setter Property="Padding" Value="5"></Setter> </Style> </ComboBox.ItemContainerStyle> @@ -1374,14 +1410,14 @@ <Style TargetType="TextBlock"> <Style.Triggers> <DataTrigger Binding="{Binding Active}" Value="True"> - <Setter Property="Foreground" Value="#FF5F5F"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"></Setter> <Setter Property="FontStyle" Value="Italic"></Setter> </DataTrigger> </Style.Triggers> </Style> </TextBlock.Style> </TextBlock> - <TextBlock Text="{Binding SaveDate}" Margin="10 0 0 0" FontStyle="Italic" Foreground="Gray" VerticalAlignment="Center"></TextBlock> + <TextBlock Text="{Binding SaveDate}" Margin="10 0 0 0" FontStyle="Italic" Foreground="{StaticResource GrayBrush250}" VerticalAlignment="Center"></TextBlock> </StackPanel> </DataTemplate> </ComboBox.ItemTemplate> @@ -1405,13 +1441,13 @@ <Border Padding="5" CornerRadius="5" BorderThickness="1" Margin="5"> <Border.Style> <Style TargetType="Border"> - <Setter Property="BorderBrush" Value="Silver"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource borderBrush}"></Setter> <Setter Property="Opacity" Value="0.5"></Setter> <Setter Property="Background" Value="Transparent"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True"> <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter> - <Setter Property="Background" Value="#D4FFFFFF"></Setter> + <Setter Property="Background" Value="{StaticResource TransparentBackgroundBrush300}"></Setter> <Setter Property="Opacity" Value="1"></Setter> </DataTrigger> </Style.Triggers> @@ -1420,12 +1456,12 @@ <Grid> <StackPanel> <DockPanel> - <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox> + <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}" Foreground="{StaticResource MainWindow.Foreground}"></TextBox> <WrapPanel Orientation="Vertical" Margin="0 5 0 0"> <WrapPanel.Resources> <Style TargetType="TextBlock"> <Setter Property="FontSize" Value="10"></Setter> - <Setter Property="Foreground" Value="#7A7A7A"></Setter> + <Setter Property="Foreground" Value="{StaticResource GrayBrush50}"></Setter> <Setter Property="Margin" Value="0 5 0 5"></Setter> <Setter Property="MinWidth" Value="80"></Setter> </Style> @@ -1443,7 +1479,7 @@ <Border> <Border.Style> <Style TargetType="Border"> - <Setter Property="BorderBrush" Value="Gainsboro"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource BorderBrushGainsboro}"></Setter> <Setter Property="BorderThickness" Value="1"></Setter> <Setter Property="Padding" Value="2"></Setter> <Setter Property="Margin" Value="4"></Setter> @@ -1473,8 +1509,8 @@ <Grid Background="Transparent" Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessParameterDropped" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=editors:ParameterizedEditor},Path=DraggingSurface}"> <ContentControl> <StackPanel> - <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11"></TextBlock> - <mahapps:NumericUpDown FontSize="20" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Center" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock> + <mahapps:NumericUpDown FontSize="20" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Center" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}" Foreground="{StaticResource MainWindow.Foreground}"></mahapps:NumericUpDown> </StackPanel> </ContentControl> </Grid> @@ -1486,7 +1522,7 @@ <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}"> <TextBlock Text="Active" FontWeight="Bold" FontStyle="Italic" FontSize="13" VerticalAlignment="Center"></TextBlock> - <materialDesign:PackIcon Foreground="#90E990" Kind="CheckboxBlankCircle" VerticalAlignment="Center" Margin="5 0 0 0"> + <materialDesign:PackIcon Foreground="{StaticResource GreenBrush400}" Kind="CheckboxBlankCircle" VerticalAlignment="Center" Margin="5 0 0 0"> <materialDesign:PackIcon.Style> <Style TargetType="materialDesign:PackIcon"> <Setter Property="Opacity" Value="0"></Setter> @@ -1525,7 +1561,7 @@ </ListBox> <StackPanel Margin="10 20" VerticalAlignment="Bottom" Orientation="Horizontal" HorizontalAlignment="Right"> - <Button Height="40" Width="105" Command="{Binding ResetProcessParametersCommand}" Background="Transparent" BorderBrush="#202020" Foreground="#202020" Margin="0 2 10 0" ToolTip="Resets the current process parameters in the embedded device"> + <Button Height="40" Width="105" Command="{Binding ResetProcessParametersCommand}" Background="Transparent" BorderBrush="{StaticResource DarkGrayBrush200}" Foreground="{StaticResource DarkGrayBrush200}" Margin="0 2 10 0" ToolTip="Resets the current process parameters in the embedded device"> <TextBlock TextWrapping="Wrap" TextAlignment="Center"> TEMP OFF </TextBlock> @@ -1561,7 +1597,7 @@ </Style.Triggers> </Style> </Grid.Style> - <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE & MEDIA</TextBlock> + <TextBlock Foreground="{StaticResource RedBrush400}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE & MEDIA</TextBlock> </Grid> </Grid> </Expander> @@ -1571,14 +1607,14 @@ </StackPanel> </ScrollViewer> - <Rectangle HorizontalAlignment="Right" Stroke="#383838" VerticalAlignment="Top" Height="427"></Rectangle> - <Rectangle HorizontalAlignment="Right" Stroke="#383838" VerticalAlignment="Bottom" Height="428"></Rectangle> + <Rectangle HorizontalAlignment="Right" Stroke="{StaticResource GrayBrush280}" VerticalAlignment="Top" Height="427"></Rectangle> + <Rectangle HorizontalAlignment="Right" Stroke="{StaticResource GrayBrush280}" VerticalAlignment="Bottom" Height="428"></Rectangle> </Grid> <Button Background="Transparent" Command="{Binding ToggleSideBarCommand}" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Center" Height="200" Width="50" Margin="0 0 -50 0"> - <Border Background="#F1F1F1" CornerRadius="0 10 10 0" BorderThickness="0 1 1 1" BorderBrush="#383838"> + <Border Background="{StaticResource WhiteBrush100}" CornerRadius="0 10 10 0" BorderThickness="0 1 1 1" BorderBrush="{StaticResource GrayBrush280}"> <Grid> - <TextBlock Foreground="#FF7272" Text="PROCESS PARAMETERS" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center"> + <TextBlock Foreground="{StaticResource RedBrush300}" Text="PROCESS PARAMETERS" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center"> <TextBlock.LayoutTransform> <RotateTransform Angle="270"></RotateTransform> </TextBlock.LayoutTransform> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs index f3af53352..18dc795bd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs @@ -312,5 +312,10 @@ namespace Tango.MachineStudio.Developer.Views _vm.OnBrushStopFieldValueChanged(stop); } } + + private void OnBrushStopMouseDown(object sender, MouseButtonEventArgs e) + { + listStops.SelectedItem = (sender as ListBoxItem).DataContext; + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml index ab97d7858..70d5b6180 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml @@ -35,12 +35,12 @@ <ColumnDefinition Width="1*"/> </Grid.ColumnDefinitions> - <Grid Background="#B1FFFFFF"> + <Grid Background="{StaticResource TransparentBackgroundBrush400}"> <StackPanel> <TextBlock Margin="40 20" FontSize="30" FontWeight="SemiBold" FontStyle="Italic">TARGET MACHINE</TextBlock> <DockPanel Margin="40 0 40 0" IsEnabled="{Binding CanWork}"> - <Button Command="{Binding ReloadMachinesCommand}" DockPanel.Dock="Right" ToolTip="Reload" Foreground="#404040" Margin="20 0 0 0" Padding="0" Width="40" Height="Auto" Style="{StaticResource MaterialDesignFlatButton}"> + <Button Command="{Binding ReloadMachinesCommand}" DockPanel.Dock="Right" ToolTip="Reload" Foreground="{StaticResource GrayBrush280}" Margin="20 0 0 0" Padding="0" Width="40" Height="Auto" Style="{StaticResource MaterialDesignFlatButton}"> <materialDesign:PackIcon Kind="Refresh" Width="24" Height="24" /> </Button> <autoComplete:AutoCompleteTextBox Provider="{Binding MachinesProvider}" LoadingContent="Loading..." FontSize="20" SelectedItem="{Binding SelectedMachine,Mode=TwoWay}" materialDesign:HintAssist.Hint="Serial Number" DisplayMember="SerialNumber"> @@ -55,12 +55,6 @@ </autoComplete:AutoCompleteTextBox> </DockPanel> <designer:MachineView Width="600" IsHitTestVisible="False" Margin="0 40 0 0" DataContext="{Binding SelectedMachine}" /> - <Button Command="{Binding EditMachineCommand}" HorizontalAlignment="Right" Margin="0 10 20 20" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0">EDIT</TextBlock> - </StackPanel> - </Button> </StackPanel> </Grid> @@ -100,19 +94,19 @@ <Grid DockPanel.Dock="Bottom" Margin="0 20 0 0"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="20 0 0 0"> - <Button AutomationProperties.AutomationId="{x:Static automation:Developer.DeleteJobButton}" Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.DeleteJobButton}" Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveJobCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> - <Button AutomationProperties.AutomationId="{x:Static automation:Developer.DuplicateJobButton}" Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF995A" BorderBrush="#FF995A" Command="{Binding DuplicateJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.DuplicateJobButton}" Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource OrangeBrush300}" BorderBrush="{StaticResource OrangeBrush300}" Command="{Binding DuplicateJobCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="ContentCopy" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DUPLICATE</TextBlock> </StackPanel> </Button> - <Button AutomationProperties.AutomationId="{x:Static automation:Developer.NewJobButton}" Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.NewJobButton}" Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddJobCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">NEW JOB</TextBlock> @@ -266,7 +260,7 @@ </Grid> </DockPanel> - <Button Command="{Binding ImportEmbroideryFileCommand}" Margin="20 0 0 -100" Foreground="Black" FontSize="16" VerticalAlignment="Bottom" HorizontalAlignment="Left" Style="{StaticResource emptyButton}" Cursor="Hand"> + <Button Command="{Binding ImportEmbroideryFileCommand}" Margin="20 0 0 -100" Foreground="{StaticResource BlackForegroundBrush}" FontSize="16" VerticalAlignment="Bottom" HorizontalAlignment="Left" Style="{StaticResource emptyButton}" Cursor="Hand"> <StackPanel Orientation="Horizontal"> <Image Source="../Images/sewing-machine.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" TextDecorations="Underline">Import Embroidery File</TextBlock> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 6289f009b..08ba5b699 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -43,7 +43,7 @@ <converters:MathOperatorConverter x:Key="MathOperatorConverter" /> - <SolidColorBrush x:Key="SideBarBackground" Color="White"> + <SolidColorBrush x:Key="SideBarBackground" Color="{Binding Path=Color, Source={StaticResource SideBarBackgroundBrush}}"> </SolidColorBrush> @@ -65,7 +65,7 @@ </Grid.RowDefinitions> <StackPanel> - <Grid Background="#202020" TextElement.Foreground="Silver"> + <Grid Background="#1B1B1B" TextElement.Foreground="Silver"> <Grid.Style> <Style TargetType="Grid"> <Setter Property="LayoutTransform"> @@ -93,13 +93,13 @@ </Style.Triggers> </Style> </Grid.Style> - <Border BorderBrush="#404040" BorderThickness="0 0 0 1" Padding="20"> + <Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0 0 0 1" Padding="20"> <Grid> <DockPanel> <Grid DockPanel.Dock="Left" MinWidth="190" VerticalAlignment="Center" Margin="0 0 0 0"> <StackPanel Orientation="Vertical" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"> - <ProgressBar Foreground="#FF6464" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" /> - <TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" FontStyle="Italic" FontWeight="DemiBold" Foreground="#FF6464" TextWrapping="Wrap"> + <ProgressBar Foreground="{StaticResource RedBrush300}" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" /> + <TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" FontStyle="Italic" FontWeight="DemiBold" Foreground="{StaticResource RedBrush300}" TextWrapping="Wrap"> <Run Text="Running '"></Run> <Run Text="{Binding RunningJob.Name}"></Run> <Run Text="'..."></Run> @@ -108,9 +108,9 @@ </Grid> <StackPanel DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 20 0 0"> <StackPanel Orientation="Horizontal"> - <TextBlock VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Margin="0 0 40 0" Foreground="#FF6464" Width="100" Text="{Binding RunningJobStatus.RemainingTime,StringFormat=hh\\:mm\\:ss}"></TextBlock> + <TextBlock VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Margin="0 0 40 0" Foreground="{StaticResource RedBrush300}" Width="100" Text="{Binding RunningJobStatus.RemainingTime,StringFormat=hh\\:mm\\:ss}"></TextBlock> - <Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="#FF6464" BorderBrush="#FF6464"> + <Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="Stop" /> <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">STOP</TextBlock> @@ -120,7 +120,7 @@ </StackPanel> <Grid> <Grid> - <Border Margin="0 10 0 0" VerticalAlignment="Bottom" Width="1200" BorderBrush="#404040" BorderThickness="0" ClipToBounds="False"> + <Border Margin="0 10 0 0" VerticalAlignment="Bottom" Width="1200" BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0" ClipToBounds="False"> <Grid ClipToBounds="False" > <ItemsControl ClipToBounds="False" x:Name="runningJobBrushList" ItemsSource="{Binding RunningJobStatus.CurrentUnitSegments}" Margin="0 0 60 0"> @@ -135,7 +135,7 @@ <Grid.ToolTip> <ToolTip Background="White" Padding="0" Visibility="{Binding IsInterSegment,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> - <Border BorderThickness="1" BorderBrush="#202020" CornerRadius="3" Padding="5"> + <Border BorderThickness="1" BorderBrush="{StaticResource DarkGrayBrush}" CornerRadius="3" Padding="5"> <StackPanel Background="White"> <ItemsControl ItemsSource="{Binding BrushStops[0].LiquidVolumes}" VerticalAlignment="Center"> <ItemsControl.ItemsPanel> @@ -149,7 +149,7 @@ <ContentControl.Foreground> <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> </ContentControl.Foreground> - <TextBlock Foreground="#202020" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Volume,StringFormat=0.00}"></TextBlock> + <TextBlock Foreground="{StaticResource DarkGrayBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Volume,StringFormat=0.00}"></TextBlock> </ContentControl> </DataTemplate> </ItemsControl.ItemTemplate> @@ -200,7 +200,7 @@ <ComboBox ItemsSource="{Binding Source={StaticResource dispenserDivisions}}" SelectedItem="{Binding DispenserStepDivision,UpdateSourceTrigger=PropertyChanged}" BorderThickness="0"> <ComboBox.ItemContainerStyle> <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> - <Setter Property="Background" Value="#ECECEC"></Setter> + <Setter Property="Background" Value="{StaticResource WhiteBrush100}"></Setter> </Style> </ComboBox.ItemContainerStyle> <ComboBox.ItemTemplate> @@ -339,7 +339,7 @@ <DataTrigger Binding="{Binding Started}" Value="True"> <Setter Property="Content"> <Setter.Value> - <TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="#FF6464" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock> + <TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="{StaticResource RedBrush300}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock> </Setter.Value> </Setter> </DataTrigger> @@ -378,14 +378,14 @@ <Run Text="{Binding RunningJobStatus.CurrentUnitTotalProgress,Mode=OneWay,StringFormat=N2}"></Run> <Run FontSize="13" Text="m"></Run> <Run></Run> - <Run Foreground="#FF6464">x</Run><Run Foreground="#FF6464" FontSize="16" FontWeight="SemiBold" Text="{Binding RunningJobStatus.RemainingUnits}"></Run> + <Run Foreground="{StaticResource RedBrush300}">x</Run><Run Foreground="{StaticResource RedBrush300}" FontSize="16" FontWeight="SemiBold" Text="{Binding RunningJobStatus.RemainingUnits}"></Run> </TextBlock> <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="20" Height="20"> </materialDesign:PackIcon> </StackPanel> - <Border BorderBrush="#404040" BorderThickness="1" VerticalAlignment="Center" Height="30" Margin="0 11 60 0"> + <Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="1" VerticalAlignment="Center" Height="30" Margin="0 11 60 0"> </Border> @@ -398,8 +398,8 @@ <Binding ElementName="jobProgressCanvas" Path="ActualWidth" /> </MultiBinding> </Canvas.Left> - <materialDesign:PackIcon Kind="MapMarker" Foreground="#FF6464" Width="35" Height="35" Margin="-17 0 0 0" /> - <TextBlock Margin="-11 -23 0 0" FontSize="16" Foreground="#FF6464" VerticalAlignment="Top" Height="18" Text="{Binding RunningJobStatus.Progress,StringFormat=0.0}"></TextBlock> + <materialDesign:PackIcon Kind="MapMarker" Foreground="{StaticResource RedBrush300}" Width="35" Height="35" Margin="-17 0 0 0" /> + <TextBlock Margin="-11 -23 0 0" FontSize="16" Foreground="{StaticResource RedBrush300}" VerticalAlignment="Top" Height="18" Text="{Binding RunningJobStatus.Progress,StringFormat=0.0}"></TextBlock> </Grid> </Canvas> </Grid> @@ -408,7 +408,7 @@ </Grid> </DockPanel> - <TextBlock Visibility="{Binding RunningJobStatus.IsFinalizing,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="-170 0 0 0" Background="#202020" FontSize="14" Height="30" Foreground="#FF6D6D">Finalizing...</TextBlock> + <TextBlock Visibility="{Binding RunningJobStatus.IsFinalizing,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="-170 0 0 0" Background="{StaticResource DarkGrayBrush}" FontSize="14" Height="30" Foreground="{StaticResource RedBrush100}">Finalizing...</TextBlock> </Grid> </Border> @@ -444,7 +444,7 @@ </Style> </Grid.Style> - <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> + <Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0 1 0 1" Padding="5"> <DockPanel> <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> <materialDesign:PackIcon Kind="Check" Width="32" Height="32" VerticalAlignment="Center" /> @@ -454,7 +454,7 @@ <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> <Button Height="20" Padding="0" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> + <materialDesign:PackIcon Foreground="{StaticResource DarkGrayBrush}" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> </StackPanel> </Button> </StackPanel> @@ -495,7 +495,7 @@ </Style> </Grid.Style> - <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> + <Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0 1 0 1" Padding="5"> <DockPanel> <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" /> @@ -512,7 +512,7 @@ <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> + <materialDesign:PackIcon Foreground="{StaticResource DarkGrayBrush}" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> </StackPanel> </Button> </StackPanel> @@ -553,7 +553,7 @@ </Style> </Grid.Style> - <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> + <Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0 1 0 1" Padding="5"> <DockPanel> <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" /> @@ -563,7 +563,7 @@ <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> + <materialDesign:PackIcon Foreground="{StaticResource DarkGrayBrush}" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> </StackPanel> </Button> </StackPanel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml index d0f0c2af6..e7f16146b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml @@ -84,7 +84,7 @@ </DataTrigger> <DataTrigger Binding="{Binding Completed}" Value="True"> <Setter Property="Kind" Value="CheckCircle"></Setter> - <Setter Property="Foreground" Value="#29B31D"></Setter> + <Setter Property="Foreground" Value="{StaticResource GreenBrush100}"></Setter> </DataTrigger> </Style.Triggers> </Style> @@ -110,7 +110,7 @@ </DockPanel> </Grid> - <GridSplitter Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Height="5" Background="Black" /> + <GridSplitter Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Height="5" Background="{StaticResource BlackForegroundBrush}" /> <Grid Grid.Row="2" Margin="0 40 0 0"> <DockPanel> <StackPanel Margin="0 0 0 0" Orientation="Horizontal" DockPanel.Dock="Top"> @@ -174,11 +174,11 @@ </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Warning"> <Setter Property="Kind" Value="Alert"></Setter> - <Setter Property="Foreground" Value="#FFA300"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Error"> <Setter Property="Kind" Value="AlertOctagon"></Setter> - <Setter Property="Foreground" Value="#FF5C5C"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Critical"> <Setter Property="Kind" Value="BellPlus"></Setter> @@ -220,7 +220,7 @@ <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> - <Border BorderBrush="Gray" BorderThickness="1 0 0 0" Background="White"> + <Border BorderBrush="Gray" BorderThickness="1 0 0 0" Background="{StaticResource WhiteBrush}"> <Grid> <ScrollViewer Padding="20" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"> <controls:JobOutlineControl HorizontalAlignment="Left" DataContext="{Binding JobHandler.JobTicket}" VirtualizingStackPanel.IsVirtualizing="True"/> @@ -237,7 +237,7 @@ </ContentControl> - <Border VerticalAlignment="Center" HorizontalAlignment="Left" Background="White" Width="30" Height="120" CornerRadius="10 0 0 10" Margin="-28 0 0 0" BorderBrush="Gray" BorderThickness="1 1 0 1"> + <Border VerticalAlignment="Center" HorizontalAlignment="Left" Background="{StaticResource WhiteBrush}" Width="30" Height="120" CornerRadius="10 0 0 10" Margin="-28 0 0 0" BorderBrush="Gray" BorderThickness="1 1 0 1"> <ToggleButton x:Name="toggleOutline" BorderThickness="0" Cursor="Hand" Background="Transparent"> <ToggleButton.Style> <Style TargetType="ToggleButton"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareCompareResult.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareCompareResult.cs new file mode 100644 index 000000000..6021f309e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareCompareResult.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.MachineStudio.HardwareDesigner.Comparison +{ + public class HardwareCompareResult + { + public SynchronizedObservableCollection<HardwareComponentCollectionCompareResult> Collections { get; set; } + public bool HasDifferences + { + get + { + return Collections.Any(item => item.HasDifferences); + } + } + + public HardwareCompareResult() + { + Collections = new SynchronizedObservableCollection<HardwareComponentCollectionCompareResult>(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCollectionCompareResult.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCollectionCompareResult.cs new file mode 100644 index 000000000..c3c370f7a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCollectionCompareResult.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.MachineStudio.HardwareDesigner.Comparison +{ + public class HardwareComponentCollectionCompareResult + { + public String CollectionName { get; set; } + + public SynchronizedObservableCollection<HardwareComponentCompareResult> Components { get; set; } + + public bool HasDifferences + { + get + { + return Components.Any(item => item.HasDifferences); + } + } + + public HardwareComponentCollectionCompareResult() + { + Components = new SynchronizedObservableCollection<HardwareComponentCompareResult>(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCompareResult.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCompareResult.cs new file mode 100644 index 000000000..447984a5f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentCompareResult.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.MachineStudio.HardwareDesigner.Comparison +{ + public class HardwareComponentCompareResult + { + public String ComponentName { get; set; } + + public bool HasComponent1 { get; set; } + + public bool HasComponent2 { get; set; } + + public SynchronizedObservableCollection<HardwareComponentPropertyResult> Properties { get; set; } + + public bool HasDifferences + { + get + { + return Properties.Any(item => item.IsDifferent); + } + } + + public HardwareComponentCompareResult() + { + Properties = new SynchronizedObservableCollection<HardwareComponentPropertyResult>(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentPropertyResult.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentPropertyResult.cs new file mode 100644 index 000000000..d57413af1 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Comparison/HardwareComponentPropertyResult.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.HardwareDesigner.Comparison +{ + public class HardwareComponentPropertyResult + { + public String PropertyName { get; set; } + public String Value1 { get; set; } + public String Value2 { get; set; } + + public bool IsDifferent + { + get { return Value1 != Value2; } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Report/ReportModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Report/ReportModel.cs new file mode 100644 index 000000000..8f644ceee --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Report/ReportModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.HardwareDesigner.Report +{ + public class ReportModel + { + public String Collection { get; set; } + public String Component { get; set; } + public String Property { get; set; } + public String HW_1 { get; set; } + public String HW_2 { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj index 09c8c5880..0e7663abc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj @@ -69,12 +69,25 @@ <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> + <Compile Include="Comparison\HardwareCompareResult.cs" /> + <Compile Include="Comparison\HardwareComponentCollectionCompareResult.cs" /> + <Compile Include="Comparison\HardwareComponentCompareResult.cs" /> + <Compile Include="Comparison\HardwareComponentPropertyResult.cs" /> + <Compile Include="Report\ReportModel.cs" /> <Compile Include="ViewModelLocator.cs" /> + <Compile Include="ViewModels\ComparisonWizardViewVM.cs" /> + <Compile Include="Views\ComparisonWizardView.xaml.cs"> + <DependentUpon>ComparisonWizardView.xaml</DependentUpon> + </Compile> <Compile Include="ViewModels\MainViewVM.cs" /> <Compile Include="Views\MainView.xaml.cs"> <DependentUpon>MainView.xaml</DependentUpon> </Compile> <Compile Include="HardwareDesignerModule.cs" /> + <Page Include="Views\ComparisonWizardView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\MainView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -114,6 +127,10 @@ <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="..\..\..\Tango.DragAndDrop\Tango.DragAndDrop.csproj"> <Project>{b112d89a-a106-41ae-a0c1-4abc84c477f5}</Project> <Name>Tango.DragAndDrop</Name> @@ -172,6 +189,7 @@ <ItemGroup> <Resource Include="Images\blower.png" /> </ItemGroup> + <ItemGroup /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/ComparisonWizardViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/ComparisonWizardViewVM.cs new file mode 100644 index 000000000..628613fea --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/ComparisonWizardViewVM.cs @@ -0,0 +1,403 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Builders; +using Tango.BL.Entities; +using Tango.BL.Enumerations; +using Tango.Core.Commands; +using Tango.CSV; +using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.HardwareDesigner.Comparison; +using Tango.MachineStudio.HardwareDesigner.Report; +using Tango.SharedUI; + +namespace Tango.MachineStudio.HardwareDesigner.ViewModels +{ + public class ComparisonWizardViewVM : DialogViewVM + { + private INotificationProvider _notification; + #region Properties + + private ObservableCollection<HardwareVersion> _hardwareVersions; + public ObservableCollection<HardwareVersion> HardwareVersions + { + get { return _hardwareVersions; } + set { _hardwareVersions = value; RaisePropertyChangedAuto(); } + } + + private HardwareVersion _selectedVersion1; + public HardwareVersion SelectedVersion1 + { + get { return _selectedVersion1; } + set + { + if (value != null && (_selectedVersion1 == null || _selectedVersion1.Guid != value.Guid)) + { + _selectedVersion1 = value; + RaisePropertyChangedAuto(); + OnSelectedVersionChanged(); + } + } + } + + private HardwareVersion _selectedVersion2; + public HardwareVersion SelectedVersion2 + { + get { return _selectedVersion2; } + set + { + if (value != null && (_selectedVersion2 == null || _selectedVersion2.Guid != value.Guid)) + { + _selectedVersion2 = value; + RaisePropertyChangedAuto(); + OnSelectedVersionChanged(); + } + + } + } + + private bool _isShowDifference; + public bool IsShowDifference + { + get { return _isShowDifference; } + set + { + _isShowDifference = value; + RaisePropertyChangedAuto(); + } + } + + private HardwareCompareResult _result; + public HardwareCompareResult Result + { + get + { + return _result; + } + set + { + _result = value; + RaisePropertyChangedAuto(); + InvalidateRelayCommands(); + } + } + + private bool _isRunning; + public bool IsRunning + { + get { return _isRunning; } + set { _isRunning = value; RaisePropertyChangedAuto(); } + } + + #endregion properties + + #region Command + + public RelayCommand GenerateReportCommand { get; set; } + + #endregion + + + #region Constructors + + public ComparisonWizardViewVM(IEnumerable<HardwareVersion> availableVersions, HardwareVersion selectedVersion, INotificationProvider notification) + { + HardwareVersions = new ObservableCollection<HardwareVersion>(availableVersions); + _selectedVersion1 = selectedVersion; + + _isShowDifference = false; + IsRunning = false; + IsShowDifference = true; + _notification = notification; + + GenerateReportCommand = new RelayCommand(GenerateReport, () => Result != null); + } + + #endregion + + #region Report + + private void GenerateReport() + { + _notification.ShowError($"Error generating HW version comparison report.\n"); + + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Title = "Save Report"; + dlg.Filter = "CSV Files|*.csv"; + dlg.FileName = $"hw_compare_report__{SelectedVersion1.Name}__vs__{SelectedVersion2.Name}"; + dlg.DefaultExt = ".csv"; + if (dlg.ShowDialog().Value) + { + try + { + CsvFile<ReportModel> csvFile = new CsvFile<ReportModel>(new CsvDestination(dlg.FileName), new CsvDefinition() + { + Columns = new List<String>() + { + "Collection", + "Component", + "Property", + SelectedVersion1.Name, + SelectedVersion2.Name, + }, + }); + + foreach (var collection in Result.Collections.Where(x => x.HasDifferences || !IsShowDifference)) + { + ReportModel model_collection = new ReportModel(); + model_collection.Collection = collection.CollectionName; + csvFile.Append(model_collection); + foreach (var component in collection.Components.Where(x => x.HasDifferences || !IsShowDifference)) + { + ReportModel model_component = new ReportModel(); + + model_component.Component = component.ComponentName; + csvFile.Append(model_component); + foreach (var prop in component.Properties.Where(x => x.IsDifferent || !IsShowDifference)) + { + ReportModel model = new ReportModel(); + model.Property = prop.PropertyName; + model.HW_1 = prop.Value1; + model.HW_2 = prop.Value2; + csvFile.Append(model); + } + } + } + + csvFile.Dispose(); + _notification.ShowInfo("Report generated successfully."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error generating HW version comparison report."); + _notification.ShowError($"Error generating HW version comparison report.\n{ex.Message}"); + } + } + } + + #endregion + + private async void OnSelectedVersionChanged() + { + if (SelectedVersion1 != null && SelectedVersion2 != null) + { + IsRunning = true; + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var h1 = await new HardwareVersionBuilder(db).Set(SelectedVersion1.Guid).WithHardwareComponents().BuildAsync(); + var h2 = await new HardwareVersionBuilder(db).Set(SelectedVersion2.Guid).WithHardwareComponents().BuildAsync(); + + await Task.Factory.StartNew(() => + { + Result = CompareHardwareVersions(h1, h2); + IsRunning = false; + }); + } + } + } + + #region Compare Versions + + private HardwareCompareResult CompareHardwareVersions(HardwareVersion h1, HardwareVersion h2) + { + _result = new HardwareCompareResult(); + _result.Collections.Add(CompareMotorsCollection(h1, h2)); + _result.Collections.Add(CompareDancerCollection(h1, h2)); + _result.Collections.Add(ComparePidControlsCollection(h1, h2)); + _result.Collections.Add(CompareWindersCollection(h1, h2)); + _result.Collections.Add(CompareSpeedSensorsCollection(h1, h2)); + _result.Collections.Add(CompareBlowersCollection(h1, h2)); + _result.Collections.Add(CompareBreakSensorCollection(h1, h2)); + + + return _result; + } + private HardwareComponentCollectionCompareResult CompareMotorsCollection(HardwareVersion h1, HardwareVersion h2) + { + HardwareComponentCollectionCompareResult collection = new HardwareComponentCollectionCompareResult() + { + CollectionName = "MOTORS" + }; + foreach (var motorTypeCode in Enum.GetValues(typeof(HardwareMotorTypes)).Cast<HardwareMotorTypes>()) + { + var motor1 = h1.HardwareMotors.SingleOrDefault(x => x.HardwareMotorType.Code == motorTypeCode.ToInt32()); + var motor2 = h2.HardwareMotors.SingleOrDefault(x => x.HardwareMotorType.Code == motorTypeCode.ToInt32()); + + var componentResult = CompareComponents( + motorTypeCode.ToDescription(), + GetComponentProperties(typeof(HardwareMotorBase)), + motor1, + motor2); + + collection.Components.Add(componentResult); + } + return collection; + } + private HardwareComponentCollectionCompareResult CompareDancerCollection(HardwareVersion h1, HardwareVersion h2) + { + HardwareComponentCollectionCompareResult collection = new HardwareComponentCollectionCompareResult() + { + CollectionName = "DANCERS" + }; + foreach (var dancerTypeCode in Enum.GetValues(typeof(HardwareDancerTypes)).Cast<HardwareDancerTypes>()) + { + var motor1 = h1.HardwareDancers.SingleOrDefault(x => x.HardwareDancerType.Code == dancerTypeCode.ToInt32()); + var motor2 = h2.HardwareDancers.SingleOrDefault(x => x.HardwareDancerType.Code == dancerTypeCode.ToInt32()); + + var componentResult = CompareComponents( + dancerTypeCode.ToDescription(), + GetComponentProperties(typeof(HardwareDancerBase)), + motor1, + motor2); + + collection.Components.Add(componentResult); + } + return collection; + } + private HardwareComponentCollectionCompareResult ComparePidControlsCollection(HardwareVersion h1, HardwareVersion h2) + { + HardwareComponentCollectionCompareResult collection = new HardwareComponentCollectionCompareResult() + { + CollectionName = "PID CONTROLS" + }; + foreach (var pidControlsTypeCode in Enum.GetValues(typeof(HardwarePidControlTypes)).Cast<HardwarePidControlTypes>()) + { + var motor1 = h1.HardwarePidControls.SingleOrDefault(x => x.HardwarePidControlType.Code == pidControlsTypeCode.ToInt32()); + var motor2 = h2.HardwarePidControls.SingleOrDefault(x => x.HardwarePidControlType.Code == pidControlsTypeCode.ToInt32()); + + var componentResult = CompareComponents( + pidControlsTypeCode.ToDescription(), + GetComponentProperties(typeof(HardwarePidControlBase)), + motor1, + motor2); + + collection.Components.Add(componentResult); + } + return collection; + } + private HardwareComponentCollectionCompareResult CompareWindersCollection(HardwareVersion h1, HardwareVersion h2) + { + HardwareComponentCollectionCompareResult collection = new HardwareComponentCollectionCompareResult() + { + CollectionName = "WINDERS" + }; + foreach (var WinderTypeCode in Enum.GetValues(typeof(HardwareWinderTypes)).Cast<HardwareWinderTypes>()) + { + var motor1 = h1.HardwareWinders.SingleOrDefault(x => x.HardwareWinderType.Code == WinderTypeCode.ToInt32()); + var motor2 = h2.HardwareWinders.SingleOrDefault(x => x.HardwareWinderType.Code == WinderTypeCode.ToInt32()); + + var componentResult = CompareComponents( + WinderTypeCode.ToDescription(), + GetComponentProperties(typeof(HardwareWinderBase)), + motor1, + motor2); + + collection.Components.Add(componentResult); + } + return collection; + } + private HardwareComponentCollectionCompareResult CompareSpeedSensorsCollection(HardwareVersion h1, HardwareVersion h2) + { + HardwareComponentCollectionCompareResult collection = new HardwareComponentCollectionCompareResult() + { + CollectionName = "SPEED SENSORS" + }; + foreach (var speedSewnsorsTypeCode in Enum.GetValues(typeof(HardwareSpeedSensorTypes)).Cast<HardwareSpeedSensorTypes>()) + { + var motor1 = h1.HardwareSpeedSensors.SingleOrDefault(x => x.HardwareSpeedSensorType.Code == speedSewnsorsTypeCode.ToInt32()); + var motor2 = h2.HardwareSpeedSensors.SingleOrDefault(x => x.HardwareSpeedSensorType.Code == speedSewnsorsTypeCode.ToInt32()); + + var componentResult = CompareComponents( + speedSewnsorsTypeCode.ToDescription(), + GetComponentProperties(typeof(HardwareSpeedSensorBase)), + motor1, + motor2); + + collection.Components.Add(componentResult); + } + return collection; + } + private HardwareComponentCollectionCompareResult CompareBlowersCollection(HardwareVersion h1, HardwareVersion h2) + { + HardwareComponentCollectionCompareResult collection = new HardwareComponentCollectionCompareResult() + { + CollectionName = "BLOWERS" + }; + foreach (var blowersTypeCode in Enum.GetValues(typeof(HardwareBlowerTypes)).Cast<HardwareBlowerTypes>()) + { + var motor1 = h1.HardwareBlowers.SingleOrDefault(x => x.HardwareBlowerType.Code == blowersTypeCode.ToInt32()); + var motor2 = h2.HardwareBlowers.SingleOrDefault(x => x.HardwareBlowerType.Code == blowersTypeCode.ToInt32()); + + var componentResult = CompareComponents( + blowersTypeCode.ToDescription(), + GetComponentProperties(typeof(HardwareBlowerBase)), + motor1, + motor2); + + collection.Components.Add(componentResult); + } + return collection; + } + private HardwareComponentCollectionCompareResult CompareBreakSensorCollection(HardwareVersion h1, HardwareVersion h2) + { + HardwareComponentCollectionCompareResult collection = new HardwareComponentCollectionCompareResult() + { + CollectionName = "BREAK SENSOR" + }; + foreach (var breakSewnsorsTypeCode in Enum.GetValues(typeof(HardwareBreakSensorTypes)).Cast<HardwareBreakSensorTypes>()) + { + var motor1 = h1.HardwareBreakSensors.SingleOrDefault(x => x.HardwareBreakSensorType.Code == breakSewnsorsTypeCode.ToInt32()); + var motor2 = h2.HardwareBreakSensors.SingleOrDefault(x => x.HardwareBreakSensorType.Code == breakSewnsorsTypeCode.ToInt32()); + + var componentResult = CompareComponents( + breakSewnsorsTypeCode.ToDescription(), + GetComponentProperties(typeof(HardwareBreakSensorBase)), + motor1, + motor2); + + collection.Components.Add(componentResult); + } + return collection; + } + + private HardwareComponentCompareResult CompareComponents(String name, List<PropertyInfo> properties, Object component1, Object component2) + { + HardwareComponentCompareResult result = new HardwareComponentCompareResult(); + result.ComponentName = name; + result.HasComponent1 = component1 != null; + result.HasComponent2 = component2 != null; + + foreach (var prop in properties) + { + var hProp = new HardwareComponentPropertyResult(); + hProp.PropertyName = prop.Name; + hProp.Value1 = component1 != null ? (prop.GetValue(component1) == null ? "" : prop.GetValue(component1).ToString()) : null; + hProp.Value2 = component2 != null ? (prop.GetValue(component2) == null ? "" : prop.GetValue(component2).ToString()) : null; + + result.Properties.Add(hProp); + } + + return result; + } + private List<PropertyInfo> GetComponentProperties(Type componentType) + { + List<String> exclude = new List<string>() + { + "Guid", + "ID", + "LastUpdated", + "Parameters", + }; + + return componentType.GetProperties(BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public).Where(x => !x.PropertyType.IsClass && !exclude.Contains(x.Name)).ToList(); + } + + #endregion + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs index 73ba02435..918eb02d4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs @@ -12,6 +12,8 @@ using Tango.BL; using Tango.SharedUI.Components; using System.Runtime.CompilerServices; using Tango.MachineStudio.Common; +using Tango.Core.ExtensionMethods; +using Tango.MachineStudio.HardwareDesigner.Views; namespace Tango.MachineStudio.HardwareDesigner.ViewModels { @@ -85,7 +87,7 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels return name; } } - + private ObservableCollection<HardwareVersion> _hardwareVersions; public ObservableCollection<HardwareVersion> HardwareVersions { @@ -103,6 +105,8 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels public RelayCommand CopyParametersCommand { get; set; } + public RelayCommand OpenComparisonWizardCommand { get; set; } + public MainViewVM(INotificationProvider notification) { _notification = notification; @@ -117,6 +121,8 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels CopyParametersCommand = new RelayCommand(CopyParameters, (x) => SelectedVersion != null && IsFree); CloneCommand = new RelayCommand(CloneCurrentVersion, () => SelectedVersion != null && IsFree); + + OpenComparisonWizardCommand = new RelayCommand(OpenComparisonWizard); } public override void OnApplicationReady() @@ -427,6 +433,12 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels } } + private void OpenComparisonWizard() + { + ComparisonWizardViewVM vm = new ComparisonWizardViewVM(HardwareVersions, SelectedVersion, _notification); + _notification.ShowModalDialog<ComparisonWizardViewVM, ComparisonWizardView>(vm, (x) => { }, () => { }); + } + protected override void RaisePropertyChangedAuto([CallerMemberName] string caller = null) { base.RaisePropertyChangedAuto(caller); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/ComparisonWizardView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/ComparisonWizardView.xaml new file mode 100644 index 000000000..d8a125e02 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/ComparisonWizardView.xaml @@ -0,0 +1,330 @@ +<UserControl x:Class="Tango.MachineStudio.HardwareDesigner.Views.ComparisonWizardView" + 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.MachineStudio.HardwareDesigner.ViewModels" + mc:Ignorable="d" + d:DesignHeight="800" d:DesignWidth="800" Height="700" Width="1100" Foreground="{StaticResource Dialog.Foreground}" Background="{StaticResource Dialog.Background}"> + <UserControl.Resources> + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/> + <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" /> + <Style TargetType="TextBlock" x:Key="DifferenceTextBoxStyle"> + <Style.Triggers> + <DataTrigger Binding="{Binding IsDifferent}" Value="True" > + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"/> + </DataTrigger> + </Style.Triggers> + </Style> + <Style TargetType="TextBlock" x:Key="CollectionHasDifferenceTextBox"> + <Style.Triggers> + <DataTrigger Binding="{Binding HasDifferences}" Value="True" > + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"/> + </DataTrigger> + </Style.Triggers> + </Style> + <Style TargetType="ItemsControl" > + <Setter Property="FontSize" Value="14"></Setter> + <Setter Property="FontWeight" Value="Normal"></Setter> + </Style> + </UserControl.Resources> + <Grid> + <Grid Margin="10"> + <Grid.RowDefinitions> + <RowDefinition Height="40"></RowDefinition> + <RowDefinition Height="40"></RowDefinition> + <RowDefinition Height="*" MinHeight="200"></RowDefinition> + <RowDefinition Height="Auto"></RowDefinition> + </Grid.RowDefinitions> + <UniformGrid Columns="3" Grid.Row="0" > + <ComboBox Margin="10 0 0 0" HorizontalAlignment="Left" IsEnabled="{Binding IsFree}" ItemsSource="{Binding HardwareVersions}" SelectedItem="{Binding SelectedVersion1}" Width="300" FontSize="16" FontWeight="Bold" materialDesign:HintAssist.Hint="Hardware Version 1"> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding Name}"></Run> <Run></Run> <Run Foreground="{StaticResource Dialog.Foreground}" FontSize="14">v</Run><Run Foreground="{StaticResource Dialog.Foreground}" FontSize="14" Text="{Binding Version}"></Run></TextBlock> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + + <TextBlock Text="Comparison Wizard" Foreground="{StaticResource LightGrayBrush}" FontStyle="Italic" FontWeight="Bold" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock> + + <ComboBox IsEnabled="{Binding IsFree}" ItemsSource="{Binding HardwareVersions}" SelectedItem="{Binding SelectedVersion2}" Width="300" FontSize="16" FontWeight="Bold" materialDesign:HintAssist.Hint="Hardware Version 2"> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock><Run Text="{Binding Name}"></Run> <Run></Run> <Run Foreground="{StaticResource Dialog.Foreground}" FontSize="14">v</Run><Run Foreground="{StaticResource Dialog.Foreground}" FontSize="14" Text="{Binding Version}"></Run></TextBlock> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + </UniformGrid> + <StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center" Margin="10 0 0 0" HorizontalAlignment="Left"> + <CheckBox Name="cbShowOnlyDifference" IsChecked="{Binding IsShowDifference}" VerticalAlignment="Center"></CheckBox> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="Show Only Differences" FontSize="16" FontWeight="Normal"></TextBlock> + </StackPanel> + <Grid Grid.Row="2"> + <ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0 0 0 0" > + <Grid > + <ItemsControl Margin="0, 0, 0, 0" Name="lvDataBinding" ItemsSource="{Binding Result.Collections}" HorizontalContentAlignment="Stretch" + VerticalContentAlignment="Top" > + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical"> + <TextBlock Margin="0,10,0,5" Text="{Binding CollectionName}" FontSize="22" FontWeight="SemiBold" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource CollectionHasDifferenceTextBox}"/> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="500*"/> + <ColumnDefinition Width="500*"/> + </Grid.ColumnDefinitions> + <Border Name="LeftB" Grid.Column="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> + <materialDesign:Card Margin="5,10,5,0" Padding="20 10"> + <StackPanel Orientation="Vertical"> + <ItemsControl Margin="10,0,0,0" Name="ComponentListLeft" ItemsSource="{Binding Components}" HorizontalContentAlignment="Stretch"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical"> + <TextBlock Margin="0,5,0,5" Text="{Binding ComponentName}" FontWeight="SemiBold" FontSize="18" Style="{StaticResource CollectionHasDifferenceTextBox}"/> + <Grid> + <ItemsControl Grid.Row="1" Margin="10" Name="PropertyListL" ItemsSource="{Binding Properties}" HorizontalContentAlignment="Stretch"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="8*" /> + <ColumnDefinition Width="2*"/> + </Grid.ColumnDefinitions> + <TextBlock Text="{Binding PropertyName}" FontWeight="Normal" Grid.Column="0" Style="{StaticResource DifferenceTextBoxStyle}"/> + <TextBlock Text="{Binding Value1}" Grid.Column="1" Style="{StaticResource DifferenceTextBoxStyle}"/> + </Grid> + <DataTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding ElementName=cbShowOnlyDifference, Path=IsChecked}" Value="True" /> + <Condition Binding="{Binding IsDifferent}" Value="False" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Collapsed" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + <ItemsControl.Style> + <Style TargetType="ItemsControl"> + <Setter Property="Visibility" Value="Visible" /> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding HasComponent1}" Value="False" /> + <Condition Binding="{Binding HasComponent2}" Value="True" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Hidden" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </ItemsControl.Style> + </ItemsControl> + <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent" Height="{Binding ActualHeight, ElementName=PropertyListL}"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Visibility" Value="Collapsed" /> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding HasComponent1}" Value="False" /> + <Condition Binding="{Binding HasComponent2}" Value="True" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Visible" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <TextBlock Text="None" Foreground="{StaticResource RedBrush100}" FontWeight="SemiBold" HorizontalAlignment="Center" FontSize="16" VerticalAlignment="Center"/> + </Border> + </Grid> + </StackPanel> + <DataTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding HasComponent1}" Value="False" /> + <Condition Binding="{Binding HasComponent2}" Value="False" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Collapsed" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding ElementName=cbShowOnlyDifference, Path=IsChecked}" Value="True" /> + <Condition Binding="{Binding HasDifferences}" Value="False" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Collapsed" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </materialDesign:Card> + </Border> + <Border Name="RightB" Grid.Column="1" Margin="10,0,0,0"> + <materialDesign:Card Margin="5,10,5,0" Padding="20 10"> + <StackPanel Orientation="Vertical"> + <ItemsControl Margin="10,0,0,0" Name="ComponentListRight" ItemsSource="{Binding Components}" HorizontalContentAlignment="Stretch"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical"> + <TextBlock Margin="0,5,0,5" FontSize="18" Text="{Binding ComponentName}" FontWeight="SemiBold" Style="{StaticResource CollectionHasDifferenceTextBox}"/> + <Grid> + <ItemsControl Grid.Row="1" Margin="10" Name="PropertyListR" ItemsSource="{Binding Properties}" HorizontalContentAlignment="Stretch"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="8*" /> + <ColumnDefinition Width="2*"/> + </Grid.ColumnDefinitions> + <TextBlock Text="{Binding PropertyName}" FontWeight="Normal" Grid.Column="0" Style="{StaticResource DifferenceTextBoxStyle}"/> + <TextBlock Text="{Binding Value2}" Grid.Column="1" Style="{StaticResource DifferenceTextBoxStyle}"/> + </Grid> + <DataTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding ElementName=cbShowOnlyDifference, Path=IsChecked}" Value="True" /> + <Condition Binding="{Binding IsDifferent}" Value="False" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Collapsed" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + <ItemsControl.Style> + <Style TargetType="ItemsControl"> + <Setter Property="Visibility" Value="Visible" /> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding HasComponent2}" Value="False" /> + <Condition Binding="{Binding HasComponent1}" Value="True" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Hidden" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </ItemsControl.Style> + </ItemsControl> + <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent" Height="{Binding ActualHeight, ElementName=PropertyListR}"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Visibility" Value="Collapsed" /> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding HasComponent2}" Value="False" /> + <Condition Binding="{Binding HasComponent1}" Value="True" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Visible" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <TextBlock Text="None" FontWeight="SemiBold" HorizontalAlignment="Center" FontSize="16" VerticalAlignment="Center" Foreground="{StaticResource RedBrush100}"/> + </Border> + </Grid> + </StackPanel> + <DataTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding HasComponent1}" Value="False" /> + <Condition Binding="{Binding HasComponent2}" Value="False" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Collapsed" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding ElementName=cbShowOnlyDifference, Path=IsChecked}" Value="True" /> + <Condition Binding="{Binding HasDifferences}" Value="False" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Collapsed" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </materialDesign:Card> + </Border> + </Grid> + </StackPanel> + <DataTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding ElementName=cbShowOnlyDifference, Path=IsChecked}" Value="True" /> + <Condition Binding="{Binding HasDifferences}" Value="False" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.Setters> + <Setter Property="Visibility" Value="Collapsed" /> + </MultiDataTrigger.Setters> + </MultiDataTrigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </Grid> + </ScrollViewer> + + </Grid> + <Grid Grid.Row="3" Margin="0,30,0,0"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> + + <Button Height="40" Command="{Binding GenerateReportCommand}" Margin="0,0,20,0"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="FileExcel" Width="24" Height="24" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">GENERATE REPORT</TextBlock> + </StackPanel> + </Button> + + <Button Width="140" Height="40" Command="{Binding OKCommand}">CLOSE</Button> + </StackPanel> + </Grid> + + </Grid> + <Border CornerRadius="5" HorizontalAlignment="Center" VerticalAlignment="Center" Background="{StaticResource Transparent200}" Width="700" Height="350"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Visibility" Value="Hidden"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Result}" Value="{x:Null}"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" Foreground="Gray">Select two hardware versions to display a comparison report</TextBlock> + </Border> + <Grid HorizontalAlignment="Stretch" Margin="10" VerticalAlignment="Stretch" Visibility="{Binding IsRunning,Converter={StaticResource BooleanToVisibilityConverter}}" + Background="{StaticResource TransparentBackgroundBrush500}"> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"> + <mahapps:ProgressRing Foreground="#007ACC" Width="80" Height="80"></mahapps:ProgressRing> + <TextBlock Text="Loading..." FontStyle="Italic" Margin="10 0 0 0" FontSize="30" VerticalAlignment="Center" Foreground="{StaticResource HomePageForeground}"></TextBlock> + </StackPanel> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/ComparisonWizardView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/ComparisonWizardView.xaml.cs new file mode 100644 index 000000000..f3cc7519a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/ComparisonWizardView.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.MachineStudio.HardwareDesigner.Views +{ + /// <summary> + /// Interaction logic for ComparisonWizardView.xaml + /// </summary> + public partial class ComparisonWizardView : UserControl + { + public ComparisonWizardView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml index 121e6e45c..86cc089e5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml @@ -60,11 +60,18 @@ <ComboBox IsEnabled="{Binding IsFree}" ItemsSource="{Binding HardwareVersions}" SelectedItem="{Binding SelectedVersion}" Width="300" FontSize="16" FontWeight="Bold" Margin="5 0 0 0" materialDesign:HintAssist.Hint="Hardware Version"> <ComboBox.ItemTemplate> <DataTemplate> - <TextBlock><Run Text="{Binding Name}"></Run> <Run></Run> <Run Foreground="Gray" FontSize="14">v</Run><Run Foreground="Gray" FontSize="14" Text="{Binding Version}"></Run></TextBlock> + <TextBlock><Run Text="{Binding Name}"></Run> <Run></Run> <Run Foreground="{StaticResource MainWindow.Foreground}" FontSize="14">v</Run><Run Foreground="{StaticResource MainWindow.Foreground}" FontSize="14" Text="{Binding Version}"></Run></TextBlock> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> + </StackPanel> + <Button Margin="100,10,0,0" Cursor="Hand" Height="40" FontSize="12" ToolTip="Open Comparison Wizard" Command="{Binding OpenComparisonWizardCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Width="24" Height="24" Kind="Compare"/> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="16">Comparison Wizard</TextBlock> + </StackPanel> + </Button> </StackPanel> </Grid> @@ -356,28 +363,28 @@ <ScrollViewer IsEnabled="{Binding IsFree}" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Margin="0 90 0 10"> <Grid> <StackPanel> - <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource MaterialDesignBackground}" Padding="20 10"> - <StackPanel> - <TextBlock Text="HARDWARE VERSION" Foreground="Gray" FontWeight="Bold" FontStyle="Italic" FontSize="16"></TextBlock> + <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource WhiteBackgroundBrush}" Padding="20 10"> + <StackPanel > + <TextBlock Text="HARDWARE VERSION" Foreground="{StaticResource GrayBrush}" FontWeight="Bold" FontStyle="Italic" FontSize="16"></TextBlock> - <TextBlock Margin="0 10 0 0" FontSize="10" Foreground="Gray">Name</TextBlock> + <TextBlock Margin="0 10 0 0" FontSize="10" Foreground="{StaticResource GrayBrush}">Name</TextBlock> <TextBox Text="{Binding CurrentVersion.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox> - <TextBlock Margin="0 20 0 0" FontSize="10" Foreground="Gray">Version</TextBlock> - <mahApps:NumericUpDown Minimum="0" BorderThickness="0 0 0 1" HorizontalContentAlignment="Left" Maximum="1000" HasDecimals="True" Value="{Binding CurrentVersion.Version}" /> + <TextBlock Margin="0 20 0 0" FontSize="10" Foreground="{StaticResource GrayBrush}">Version</TextBlock> + <mahApps:NumericUpDown Minimum="0" BorderThickness="0 0 0 1" HorizontalContentAlignment="Left" Maximum="1000" HasDecimals="True" Value="{Binding CurrentVersion.Version}" Foreground="{StaticResource GrayBrush}"/> </StackPanel> </materialDesign:Card> - <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource MaterialDesignBackground}"> - <StackPanel> + <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource WhiteBackgroundBrush}"> + <StackPanel > <Grid> - <Expander HorizontalAlignment="Stretch" IsExpanded="True"> + <Expander HorizontalAlignment="Stretch" IsExpanded="True" Background="{DynamicResource Card.Background}"> <Expander.Header> - <TextBlock FontSize="18" Foreground="#595959" FontWeight="Bold" FontStyle="Italic"> + <TextBlock FontSize="18" Foreground="{StaticResource MainWindow.Foreground}" FontWeight="Bold" FontStyle="Italic"> <Run Text="{Binding SelectedHardwareObjectTypeName,Mode=OneWay}"></Run> </TextBlock> </Expander.Header> - <StackPanel> + <StackPanel > <editors:ParameterizedEditor ParameterizedObject="{Binding SelectedHardwareObject}" Padding="10"> <editors:ParameterizedEditor.ItemsPanel> <ItemsPanelTemplate> @@ -388,7 +395,7 @@ <DataTemplate> <DockPanel> <mahApps:NumericUpDown DockPanel.Dock="Right" Background="Transparent" BorderThickness="0 0 0 0" Value="{Binding Value,UpdateSourceTrigger=PropertyChanged}" HasDecimals="True" HorizontalContentAlignment="Center" Width="100" /> - <TextBlock Text="{Binding Name}" VerticalAlignment="Center"></TextBlock> + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock> </DockPanel> </DataTemplate> </editors:ParameterizedEditor.DoubleTemplate> @@ -396,15 +403,15 @@ <DataTemplate> <DockPanel> <mahApps:NumericUpDown DockPanel.Dock="Right" Background="Transparent" BorderThickness="0 0 0 0" Value="{Binding Value,Converter={StaticResource DoubleToIntConverter},UpdateSourceTrigger=PropertyChanged}" HasDecimals="False" HorizontalContentAlignment="Center" Width="100" /> - <TextBlock Text="{Binding Name}" VerticalAlignment="Center"></TextBlock> + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock> </DockPanel> </DataTemplate> </editors:ParameterizedEditor.Int32Template> <editors:ParameterizedEditor.BooleanTemplate> <DataTemplate> <DockPanel Margin="0 5 0 0"> - <ToggleButton DockPanel.Dock="Right" Width="100" IsChecked="{Binding Value}" HorizontalAlignment="Right" /> - <TextBlock Text="{Binding Name}" VerticalAlignment="Center"></TextBlock> + <ToggleButton DockPanel.Dock="Right" Width="100" IsChecked="{Binding Value}" HorizontalAlignment="Right" Foreground="{StaticResource MainWindow.Foreground}"/> + <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock> </DockPanel> </DataTemplate> </editors:ParameterizedEditor.BooleanTemplate> @@ -420,7 +427,7 @@ <Grid Grid.Row="1" Margin="10 0 10 10"> <UniformGrid Rows="1"> - <Button Height="Auto" Grid.Column="1" Command="{Binding DeleteCommand}" Margin="2" Background="#FF8A8A" BorderBrush="#FF8A8A"> + <Button Height="Auto" Grid.Column="1" Command="{Binding DeleteCommand}" Margin="2" Background="{StaticResource RedBrush400}" BorderBrush="{StaticResource RedBrush400}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Width="20" Height="20" VerticalAlignment="Center" Kind="Delete"></materialDesign:PackIcon> <TextBlock FontSize="14" Margin="10 0 0 0" VerticalAlignment="Center">DEL</TextBlock> @@ -432,7 +439,7 @@ <TextBlock FontSize="14" Margin="10 0 0 0" VerticalAlignment="Center">NEW</TextBlock> </StackPanel> </Button> - <Button Height="Auto" Grid.Column="1" Command="{Binding CloneCommand}" Margin="2" Background="#FF9A6A" BorderBrush="#FF9A6A"> + <Button Height="Auto" Grid.Column="1" Command="{Binding CloneCommand}" Margin="2" Background="{StaticResource OrangeBrush300}" BorderBrush="{StaticResource OrangeBrush300}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Width="20" Height="20" VerticalAlignment="Center" Kind="ContentCopy"></materialDesign:PackIcon> <TextBlock FontSize="14" Margin="10 0 0 0" VerticalAlignment="Center">CLONE</TextBlock> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs index 7136b22ea..7890d055b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; +using Tango.Core.ExtensionMethods; using Tango.Logging; using Tango.PMR.Common; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_wuxohuiz_wpftmp.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_wuxohuiz_wpftmp.csproj new file mode 100644 index 000000000..e1d05fb78 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_wuxohuiz_wpftmp.csproj @@ -0,0 +1,276 @@ +<?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>{1674F726-0E66-414F-B9FD-C6F20D7F07C7}</ProjectGuid> + <OutputType>library</OutputType> + <RootNamespace>Tango.MachineStudio.Logging</RootNamespace> + <AssemblyName>Tango.MachineStudio.Logging</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\..\Build\Machine Studio\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\Machine Studio\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + </ItemGroup> + <ItemGroup> + <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> + <Link>GlobalVersionInfo.cs</Link> + </Compile> + <Compile Include="ControlledObservableCollection.cs" /> + <Compile Include="Controls\TimelineScrollViewer.cs" /> + <Compile Include="Controls\TimeRuler.cs" /> + <Compile Include="Converters\DateIsInListToBooleanConverter.cs" /> + <Compile Include="Converters\EventsToTimeRulerTicksConverter.cs" /> + <Compile Include="Converters\LogItemToMessageConverter.cs" /> + <Compile Include="Converters\MachineEventToXConverter.cs" /> + <Compile Include="Converters\SecondsToWidthConverter.cs" /> + <Compile Include="Converters\StringToFirstLineConverter.cs" /> + <Compile Include="Converters\TimeSpanToXConverter.cs" /> + <Compile Include="Helpers\TimelineHelper.cs" /> + <Compile Include="LoggingModule.cs" /> + <Compile Include="Navigation\LoggingNavigationManager.cs" /> + <Compile Include="Navigation\LoggingNavigationView.cs" /> + <Compile Include="ViewModelLocator.cs" /> + <Compile Include="ViewModels\EmbeddedLogsViewVM.cs" /> + <Compile Include="ViewModels\ApplicationLogsViewVM.cs" /> + <Compile Include="ViewModels\EventDetailsViewVM.cs" /> + <Compile Include="ViewModels\HomeViewVM.cs" /> + <Compile Include="ViewModels\EventsViewVM.cs" /> + <Compile Include="ViewModels\LogDetailsViewVM.cs" /> + <Compile Include="ViewModels\TimelineEventGroup.cs" /> + <Compile Include="ViewModels\TimelineViewVM.cs" /> + <Compile Include="Views\EmbeddedLogDetailsView.xaml.cs"> + <DependentUpon>EmbeddedLogDetailsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\EmbeddedLogsView.xaml.cs"> + <DependentUpon>EmbeddedLogsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\ApplicationLogDetailsView.xaml.cs"> + <DependentUpon>ApplicationLogDetailsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\EventDetailsView.xaml.cs"> + <DependentUpon>EventDetailsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\ApplicationLogsView.xaml.cs"> + <DependentUpon>ApplicationLogsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\EventsView.xaml.cs"> + <DependentUpon>EventsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\HomeView.xaml.cs"> + <DependentUpon>HomeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\MainView.xaml.cs"> + <DependentUpon>MainView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\TimelineView.xaml.cs"> + <DependentUpon>TimelineView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\TimelineWrapperView.xaml.cs"> + <DependentUpon>TimelineWrapperView.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> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\SideChains\Tango.AutoComplete\Tango.AutoComplete.csproj"> + <Project>{bb2abb74-ba58-4812-83aa-ec8171f42df4}</Project> + <Name>Tango.AutoComplete</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj"> + <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> + <Name>Tango.BL</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Integration\Tango.Integration.csproj"> + <Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project> + <Name>Tango.Integration</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Logging\Tango.Logging.csproj"> + <Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project> + <Name>Tango.Logging</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.PMR\Tango.PMR.csproj"> + <Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project> + <Name>Tango.PMR</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Settings\Tango.Settings.csproj"> + <Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project> + <Name>Tango.Settings</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.SharedUI\Tango.SharedUI.csproj"> + <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project> + <Name>Tango.SharedUI</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Transport\Tango.Transport.csproj"> + <Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project> + <Name>Tango.Transport</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.MachineStudio.Common\Tango.MachineStudio.Common.csproj"> + <Project>{cb0b0aa2-bb24-4bca-a720-45e397684e12}</Project> + <Name>Tango.MachineStudio.Common</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + </ItemGroup> + <ItemGroup> + </ItemGroup> + <ItemGroup> + </ItemGroup> + <ItemGroup> + </ItemGroup> + <ItemGroup> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <ProjectExtensions> + <VisualStudio> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + </VisualStudio> + </ProjectExtensions> + <ItemGroup> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\packages\MaterialDesignThemes.2.3.1.953\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:\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:\TFS\Software\Visual_Studio\packages\Expression.Blend.Sdk.1.0.2\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:\TFS\Software\Visual_Studio\SideChains\Tango.AutoComplete\bin\Debug\Tango.AutoComplete.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\Build\Core\Debug\Tango.BL.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\Build\Core\Debug\Tango.Core.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\Build\Core\Debug\Tango.Integration.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\Build\Core\Debug\Tango.Logging.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\Build\Machine Studio\Debug\Tango.MachineStudio.Common.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\Build\Core\Debug\Tango.PMR.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\Build\Core\Debug\Tango.Settings.dll" /> + <ReferencePath Include="C:\TFS\Software\Visual_Studio\Build\Core\Debug\Tango.SharedUI.dll" /> + <ReferencePath Include="C:\TFS\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" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Collections.Concurrent.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Collections.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ComponentModel.Annotations.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ComponentModel.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ComponentModel.EventBasedAsync.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Diagnostics.Contracts.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Diagnostics.Debug.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Diagnostics.Tools.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Diagnostics.Tracing.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Dynamic.Runtime.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Globalization.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.IO.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Linq.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Linq.Expressions.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Linq.Parallel.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Linq.Queryable.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Net.NetworkInformation.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Net.Primitives.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Net.Requests.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Net.WebHeaderCollection.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ObjectModel.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Reflection.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Reflection.Emit.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Reflection.Emit.ILGeneration.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Reflection.Emit.Lightweight.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Reflection.Extensions.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Reflection.Primitives.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Resources.ResourceManager.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.Extensions.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.Handles.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.InteropServices.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.InteropServices.WindowsRuntime.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.Numerics.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.Serialization.Json.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.Serialization.Primitives.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.Serialization.Xml.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Security.Principal.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.Duplex.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.Http.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.NetTcp.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.Primitives.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.Security.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Text.Encoding.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Text.Encoding.Extensions.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Text.RegularExpressions.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Threading.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Threading.Tasks.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Threading.Tasks.Parallel.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Threading.Timer.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Xml.ReaderWriter.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Xml.XDocument.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Xml.XmlSerializer.dll" /> + </ItemGroup> + <ItemGroup> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\EmbeddedLogDetailsView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\EmbeddedLogsView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\ApplicationLogDetailsView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\EventDetailsView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\ApplicationLogsView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\EventsView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\HomeView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\MainView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\TimelineView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\TimelineWrapperView.g.cs" /> + <Compile Include="C:\TFS\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\GeneratedInternalTypeHelper.g.cs" /> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml index c7ebcaf02..27d5b900a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml @@ -11,7 +11,7 @@ xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.MachineStudio.Logging.Views" mc:Ignorable="d" - Height="500" Width="800" Background="White" d:DataContext="{d:DesignInstance Type=vm:LogDetailsViewVM, IsDesignTimeCreatable=False}"> + Height="500" Width="800" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:LogDetailsViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> <UserControl.Resources> <converters:DateTimeUTCToStringConverter x:Key="DateTimeUTCToStringConverter" /> @@ -34,15 +34,15 @@ <Style.Triggers> <DataTrigger Binding="{Binding Log.Category}" Value="Info"> <Setter Property="Kind" Value="Information"></Setter> - <Setter Property="Foreground" Value="DimGray"></Setter> + <Setter Property="Foreground" Value="{StaticResource DimGrayBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Log.Category}" Value="Warning"> <Setter Property="Kind" Value="Alert"></Setter> - <Setter Property="Foreground" Value="#FFA300"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Log.Category}" Value="Error"> <Setter Property="Kind" Value="AlertOctagon"></Setter> - <Setter Property="Foreground" Value="#FF5C5C"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Log.Category}" Value="Critical"> <Setter Property="Kind" Value="BellPlus"></Setter> @@ -72,7 +72,7 @@ </controls:TableGrid> </Grid> - <Border Padding="5" BorderThickness="1" BorderBrush="Gainsboro"> + <Border Padding="5" BorderThickness="1" BorderBrush="{StaticResource BorderBrushGainsboro}"> <TextBox BorderThickness="0" Text="{Binding Log,Converter={StaticResource LogItemToMessageConverter}}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Background="Transparent" /> </Border> </DockPanel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml index e61dc99ba..4c291d0df 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml @@ -50,25 +50,19 @@ <RowDefinition Height="1*"/> </Grid.RowDefinitions> - <Border Background="#F1F1F1"> + <Border Background="{StaticResource WhiteBrush100}"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Grid> <StackPanel Orientation="Horizontal"> - <Button Margin="10 0 0 0" Height="50" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" Command="{Binding NavigateToHomeCommand}" HorizontalContentAlignment="Left"> + <Button Margin="10 0 0 0" Height="50" Style="{StaticResource MaterialDesignFlatButton}" Foreground="{StaticResource DarkGrayBrush}" Command="{Binding NavigateToHomeCommand}" HorizontalContentAlignment="Left"> <StackPanel Orientation="Horizontal" > <materialDesign:PackIcon Kind="ArrowLeftBold" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">BACK</TextBlock> </StackPanel> </Button> - <Border Margin="10" Padding="5" BorderBrush="DimGray" BorderThickness="1"> - <Border.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="White"/> - <GradientStop Color="#FFEAEAEA" Offset="1"/> - </LinearGradientBrush> - </Border.Background> + <Border Margin="10" Padding="5" BorderBrush="DimGray" BorderThickness="1" Background="{StaticResource Logging.Background}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Calendar" Width="24" Height="24" VerticalAlignment="Bottom" Margin="0 0 0 5" /> <DatePicker x:Name="datePicker" DisplayDateStart="{Binding MinDate}" DisplayDateEnd="{Binding MaxDate}" CalendarStyle="{StaticResource HighlightDatePickerStyle}" SelectedDate="{Binding SelectedDate}" materialDesign:HintAssist.Hint="Pick Date" Margin="10 0 0 5" Width="200" VerticalAlignment="Bottom" FontSize="16"> @@ -78,7 +72,7 @@ </StackPanel> </Border> - <Button Style="{StaticResource MaterialDesignFlatButton}" IsEnabled="{Binding IsRealTime}" Command="{Binding ToggleRealTimePaused}" Padding="0" Height="50" Width="50" Foreground="#202020" ToolTip="Pause/Resume Real-Time"> + <Button Style="{StaticResource MaterialDesignFlatButton}" IsEnabled="{Binding IsRealTime}" Command="{Binding ToggleRealTimePaused}" Padding="0" Height="50" Width="50" Foreground="{StaticResource DarkGrayBrush}" ToolTip="Pause/Resume Real-Time"> <materialDesign:PackIcon Width="50" Height="50"> <materialDesign:PackIcon.Style> <Style TargetType="materialDesign:PackIcon"> @@ -130,7 +124,7 @@ </Grid> </Border> - <Grid Grid.Row="1" Background="#B3FFFFFF"> + <Grid Grid.Row="1" Background="{StaticResource TransparentBackgroundBrush400}"> <Grid Margin="10"> <Grid.ColumnDefinitions> @@ -200,11 +194,11 @@ </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Warning"> <Setter Property="Kind" Value="Alert"></Setter> - <Setter Property="Foreground" Value="#FFA300"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Error"> <Setter Property="Kind" Value="AlertOctagon"></Setter> - <Setter Property="Foreground" Value="#FF5C5C"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Critical"> <Setter Property="Kind" Value="BellPlus"></Setter> @@ -212,7 +206,7 @@ </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Debug"> <Setter Property="Kind" Value="Bug"></Setter> - <Setter Property="Foreground" Value="#303030"></Setter> + <Setter Property="Foreground" Value="{StaticResource GrayBrush300}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding CallerMethodName}" Value="OnStartup"> <Setter Property="Kind" Value="ClockFast"></Setter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml index 6511f035f..e79fd0ad2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml @@ -10,7 +10,7 @@ xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.MachineStudio.Logging.Views" mc:Ignorable="d" - Height="500" Width="800" Background="White" d:DataContext="{d:DesignInstance Type=vm:LogDetailsViewVM, IsDesignTimeCreatable=False}"> + Height="500" Width="800" Background="{StaticResource MainWindow.Background}" d:DataContext="{d:DesignInstance Type=vm:LogDetailsViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> <UserControl.Resources> <converters:DateTimeUTCToStringConverter x:Key="DateTimeUTCToStringConverter" /> @@ -36,11 +36,11 @@ </DataTrigger> <DataTrigger Binding="{Binding Log.Category}" Value="Warning"> <Setter Property="Kind" Value="Alert"></Setter> - <Setter Property="Foreground" Value="#FFA300"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Log.Category}" Value="Error"> <Setter Property="Kind" Value="AlertOctagon"></Setter> - <Setter Property="Foreground" Value="#FF5C5C"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Log.Category}" Value="Critical"> <Setter Property="Kind" Value="BellPlus"></Setter> @@ -72,7 +72,7 @@ </controls:TableGrid> </Grid> - <Border Padding="5" BorderThickness="1" BorderBrush="Gainsboro"> + <Border Padding="5" BorderThickness="1" BorderBrush="{StaticResource BorderBrushGainsboro}"> <TextBox BorderThickness="0" Text="{Binding Log.Message}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Background="Transparent" /> </Border> </DockPanel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml index 4573c8451..7ec4177bd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml @@ -50,25 +50,19 @@ <RowDefinition Height="1*"/> </Grid.RowDefinitions> - <Border Background="#F1F1F1"> + <Border Background="{StaticResource WhiteBrush100}"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Grid> <StackPanel Orientation="Horizontal"> - <Button Margin="10 0 0 0" Height="50" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" Command="{Binding NavigateToHomeCommand}" HorizontalContentAlignment="Left"> + <Button Margin="10 0 0 0" Height="50" Style="{StaticResource MaterialDesignFlatButton}" Foreground="{StaticResource DarkGrayBrush}" Command="{Binding NavigateToHomeCommand}" HorizontalContentAlignment="Left"> <StackPanel Orientation="Horizontal" > <materialDesign:PackIcon Kind="ArrowLeftBold" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">BACK</TextBlock> </StackPanel> </Button> - <Border Margin="10" Padding="5" BorderBrush="DimGray" BorderThickness="1"> - <Border.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="White"/> - <GradientStop Color="#FFEAEAEA" Offset="1"/> - </LinearGradientBrush> - </Border.Background> + <Border Margin="10" Padding="5" BorderBrush="DimGray" BorderThickness="1" Background="{StaticResource Logging.Background}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Calendar" Width="24" Height="24" VerticalAlignment="Bottom" Margin="0 0 0 5" /> <DatePicker x:Name="datePicker" DisplayDateStart="{Binding MinDate}" DisplayDateEnd="{Binding MaxDate}" CalendarStyle="{StaticResource HighlightDatePickerStyle}" SelectedDate="{Binding SelectedDate}" materialDesign:HintAssist.Hint="Pick Date" Margin="10 0 0 5" Width="200" VerticalAlignment="Bottom" FontSize="16"> @@ -78,7 +72,7 @@ </StackPanel> </Border> - <Button Style="{StaticResource MaterialDesignFlatButton}" Command="{Binding ToggleRealTimePaused}" Padding="0" Height="50" Width="50" Foreground="#202020" ToolTip="Pause/Resume Real-Time"> + <Button Style="{StaticResource MaterialDesignFlatButton}" Command="{Binding ToggleRealTimePaused}" Padding="0" Height="50" Width="50" Foreground="{StaticResource DarkGrayBrush}" ToolTip="Pause/Resume Real-Time"> <materialDesign:PackIcon Width="50" Height="50"> <materialDesign:PackIcon.Style> <Style TargetType="materialDesign:PackIcon"> @@ -103,7 +97,7 @@ </Grid> </Border> - <Grid Grid.Row="1" Background="#B3FFFFFF"> + <Grid Grid.Row="1" Background="{StaticResource TransparentBackgroundBrush400}"> <Grid Margin="10"> <Grid.ColumnDefinitions> @@ -170,11 +164,11 @@ </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Warning"> <Setter Property="Kind" Value="Alert"></Setter> - <Setter Property="Foreground" Value="#FFA300"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Error"> <Setter Property="Kind" Value="AlertOctagon"></Setter> - <Setter Property="Foreground" Value="#FF5C5C"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Critical"> <Setter Property="Kind" Value="BellPlus"></Setter> @@ -182,7 +176,7 @@ </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Debug"> <Setter Property="Kind" Value="Bug"></Setter> - <Setter Property="Foreground" Value="#303030"></Setter> + <Setter Property="Foreground" Value="{StaticResource GrayBrush300}"></Setter> </DataTrigger> <!--<DataTrigger Binding="{Binding CallerMethodName}" Value="OnStartup"> <Setter Property="Kind" Value="ClockFast"></Setter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventDetailsView.xaml index 389b18776..4031c9ce3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventDetailsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventDetailsView.xaml @@ -10,7 +10,7 @@ xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.MachineStudio.Logging.Views" mc:Ignorable="d" - Height="500" Width="800" Background="White" d:DataContext="{d:DesignInstance Type=vm:EventDetailsViewVM, IsDesignTimeCreatable=False}"> + Height="500" Width="800" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:EventDetailsViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> <UserControl.Resources> <converters:DateTimeUTCToStringConverter x:Key="DateTimeUTCToStringConverter" /> @@ -32,15 +32,15 @@ <Style.Triggers> <DataTrigger Binding="{Binding Event.Category}" Value="Info"> <Setter Property="Kind" Value="Information"></Setter> - <Setter Property="Foreground" Value="DimGray"></Setter> + <Setter Property="Foreground" Value="{StaticResource DimGrayBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Event.Category}" Value="Warning"> <Setter Property="Kind" Value="Alert"></Setter> - <Setter Property="Foreground" Value="#FFA300"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Event.Category}" Value="Error"> <Setter Property="Kind" Value="AlertOctagon"></Setter> - <Setter Property="Foreground" Value="#FF5C5C"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Event.Category}" Value="Critical"> <Setter Property="Kind" Value="BellPlus"></Setter> @@ -79,7 +79,7 @@ </controls:TableGrid> </UniformGrid> - <Border Padding="5" BorderThickness="1" BorderBrush="Gainsboro"> + <Border Padding="5" BorderThickness="1" BorderBrush="{StaticResource BorderBrushGainsboro}"> <TextBox BorderThickness="0" Text="{Binding Event.Description}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Background="Transparent" /> </Border> </DockPanel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml index 632495103..5be54a721 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventsView.xaml @@ -50,36 +50,31 @@ <RowDefinition Height="1*"/> </Grid.RowDefinitions> - <Border Background="#F1F1F1"> + <Border Background="{StaticResource WhiteBrush100}"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Grid> <StackPanel Orientation="Horizontal"> - <Button Margin="10 0 0 0" Height="50" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" Command="{Binding NavigateToHomeCommand}" HorizontalContentAlignment="Left"> + <Button Margin="10 0 0 0" Height="50" Style="{StaticResource MaterialDesignFlatButton}" Foreground="{StaticResource DarkGrayBrush}" Command="{Binding NavigateToHomeCommand}" HorizontalContentAlignment="Left"> <StackPanel Orientation="Horizontal" > <materialDesign:PackIcon Kind="ArrowLeftBold" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">BACK</TextBlock> </StackPanel> </Button> - - <Border Margin="10" Padding="5" BorderBrush="DimGray" BorderThickness="1"> - <Border.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="White"/> - <GradientStop Color="#FFEAEAEA" Offset="1"/> - </LinearGradientBrush> - </Border.Background> + + <Border Margin="10" Padding="5" BorderBrush="DimGray" BorderThickness="1" Background="{StaticResource Logging.Background}"> <StackPanel Orientation="Horizontal"> <Image Source="../Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant"></Image> <StackPanel Orientation="Horizontal" Width="300" Margin="20 0 0 5" VerticalAlignment="Bottom"> <materialDesign:PackIcon Kind="BarcodeScan" VerticalAlignment="Center" Width="24" Height="24" /> - <autoComplete:AutoCompleteTextBox HorizontalContentAlignment="Stretch" Width="300" Margin="10 0 0 0" FontSize="16" Provider="{StaticResource MachinesProvider}" SelectedItem="{Binding SelectedMachine,Mode=TwoWay}" materialDesign:HintAssist.Hint="Serial Number / Name" DisplayMember="SerialNumber"> + <autoComplete:AutoCompleteTextBox HorizontalContentAlignment="Stretch" Width="300" Margin="10 0 0 0" FontSize="16" Provider="{StaticResource MachinesProvider}" SelectedItem="{Binding SelectedMachine,Mode=TwoWay}" materialDesign:HintAssist.Hint="Serial Number / Name" DisplayMember="SerialNumber" + Foreground="{StaticResource MainWindow.Foreground}"> <autoComplete:AutoCompleteTextBox.ItemTemplate> <DataTemplate> - <Border Padding="5"> + <Border Padding="5" > <DockPanel LastChildFill="False" Width="250"> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Left" > <Image Source="/Images/machine-trans.png" Width="24" RenderOptions.BitmapScalingMode="Fant" /> <TextBlock Margin="10 0 0 0" FontWeight="SemiBold" Text="{Binding SerialNumber}" VerticalAlignment="Center"></TextBlock> </StackPanel> @@ -92,13 +87,7 @@ </StackPanel> </StackPanel> </Border> - <Border Margin="10" Padding="5" BorderBrush="DimGray" BorderThickness="1"> - <Border.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="White"/> - <GradientStop Color="#FFEAEAEA" Offset="1"/> - </LinearGradientBrush> - </Border.Background> + <Border Margin="10" Padding="5" BorderBrush="DimGray" BorderThickness="1" Background="{StaticResource Logging.Background}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Calendar" Width="24" Height="24" VerticalAlignment="Bottom" Margin="0 0 0 5" /> <DatePicker x:Name="datePicker" DisplayDateStart="{Binding MinDate}" DisplayDateEnd="{Binding MaxDate}" CalendarStyle="{StaticResource HighlightDatePickerStyle}" SelectedDate="{Binding SelectedDate}" materialDesign:HintAssist.Hint="Pick Date" Margin="10 0 0 5" Width="200" VerticalAlignment="Bottom" FontSize="16"> @@ -111,7 +100,7 @@ </Grid> </Border> - <Grid Grid.Row="1" Background="#B3FFFFFF"> + <Grid Grid.Row="1" Background="{StaticResource TransparentBackgroundBrush400}"> <Grid Margin="10"> <Grid.ColumnDefinitions> @@ -178,11 +167,11 @@ </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Warning"> <Setter Property="Kind" Value="Alert"></Setter> - <Setter Property="Foreground" Value="#FFA300"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Error"> <Setter Property="Kind" Value="AlertOctagon"></Setter> - <Setter Property="Foreground" Value="#FF5C5C"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Category}" Value="Critical"> <Setter Property="Kind" Value="BellPlus"></Setter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/HomeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/HomeView.xaml index b41351064..1059a06a7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/HomeView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/HomeView.xaml @@ -13,22 +13,14 @@ <UserControl.Resources> <Style TargetType="Border" x:Key="LogBorder"> <Setter Property="Padding" Value="50"></Setter> - <Setter Property="Background"> - <Setter.Value> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="#35FFFFFF"/> - <GradientStop Color="White" Offset="1"/> - - </LinearGradientBrush> - </Setter.Value> - </Setter> + <Setter Property="Background" Value="{DynamicResource LogBorder.Background}"/> <Setter Property="CornerRadius" Value="20"></Setter> <Setter Property="Width" Value="450"></Setter> <Setter Property="Height" Value="400"></Setter> - <Setter Property="TextElement.Foreground" Value="#202020"></Setter> + <Setter Property="TextElement.Foreground" Value="{DynamicResource DarkGrayBrush}"></Setter> <Setter Property="TextElement.FontSize" Value="25"></Setter> <Setter Property="BorderThickness" Value="1"></Setter> - <Setter Property="BorderBrush" Value="#D6D6D6"></Setter> + <Setter Property="BorderBrush" Value="{DynamicResource LightGrayBrush200}"></Setter> <Setter Property="Cursor" Value="Hand"></Setter> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml index 664f2489c..9eb099a9e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/TimelineView.xaml @@ -13,7 +13,7 @@ xmlns:localControls="clr-namespace:Tango.MachineStudio.Logging.Controls" xmlns:local="clr-namespace:Tango.MachineStudio.Logging.Views" mc:Ignorable="d" - d:DesignHeight="1080" d:DesignWidth="1920" Background="White" d:DataContext="{d:DesignInstance Type=vm:TimelineViewVM, IsDesignTimeCreatable=False}" MouseWheel="UserControl_MouseWheel"> + d:DesignHeight="1080" d:DesignWidth="1920" Background="{StaticResource MainWindow.Background}" d:DataContext="{d:DesignInstance Type=vm:TimelineViewVM, IsDesignTimeCreatable=False}" MouseWheel="UserControl_MouseWheel"> <UserControl.Resources> <localConverters:TimeSpanToXConverter x:Key="TimeSpanToXConverter" /> @@ -33,7 +33,7 @@ </LinearGradientBrush> <LinearGradientBrush x:Key="errorBrush" StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="#FFFF6A6A"/> + <GradientStop Color="{StaticResource RedBrush100}"/> <GradientStop Color="#FFD9D9" Offset="1"/> </LinearGradientBrush> @@ -50,7 +50,7 @@ <Grid> <Grid> - <Grid Grid.Row="1"> + <!--<Grid Grid.Row="1">--> <Grid.RowDefinitions> <RowDefinition Height="30"/> <RowDefinition Height="1*"/> @@ -61,129 +61,129 @@ </Grid.ColumnDefinitions> <Grid Grid.Column="1" ClipToBounds="True"> - <localControls:TimeRuler HorizontalAlignment="Left" FontSize="14" HorizontalOffset="{Binding ElementName=scrollViewer,Path=HorizontalOffset}" Background="White" BorderBrush="{StaticResource AccentColorBrush}" BorderThickness="1" Foreground="{StaticResource AccentColorBrush}" Height="30" x:Name="ruler" Width="{Binding RelativeSource={RelativeSource AncestorType=Grid},Path=ActualWidth}" RenderWidth="{Binding RelativeSource={RelativeSource AncestorType=Grid},Path=ActualWidth}" Zoom="{Binding TimelineScaleFactor}"></localControls:TimeRuler> + <localControls:TimeRuler HorizontalAlignment="Left" FontSize="14" HorizontalOffset="{Binding ElementName=scrollViewer,Path=HorizontalOffset}" Background="{StaticResource MainWindow.Background}" BorderBrush="{StaticResource AccentColorBrush}" BorderThickness="1" Foreground="{StaticResource AccentColorBrush}" Height="30" x:Name="ruler" Width="{Binding RelativeSource={RelativeSource AncestorType=Grid},Path=ActualWidth}" RenderWidth="{Binding RelativeSource={RelativeSource AncestorType=Grid},Path=ActualWidth}" Zoom="{Binding TimelineScaleFactor}"></localControls:TimeRuler> </Grid> - <Grid Background="White"> + <Grid Background="{StaticResource MainWindow.Background}"> </Grid> - <ScrollViewer x:Name="scroll_channels" Grid.Column="0" Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> - <ItemsControl ItemsSource="{Binding TimelineEventGroups}" Margin="0 0 0 0" Background="#FCFCFC" VerticalAlignment="Top"> + <ScrollViewer x:Name="scroll_channels" Grid.Column="0" Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> + <ItemsControl ItemsSource="{Binding TimelineEventGroups}" Margin="0 0 0 0" Background="#FCFCFC" VerticalAlignment="Top"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type vm:TimelineEventGroup}"> + <Border BorderThickness="1 0.5 1 0.5" BorderBrush="{StaticResource AccentColorBrush}" Margin="2 0 0 0" Padding="5" Height="{Binding Height,Mode=OneWay}"> + <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22" TextWrapping="Wrap" TextAlignment="Center" FontWeight="SemiBold" Foreground="{StaticResource AccentColorBrush}"></TextBlock> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + + <localControls:TimelineScrollViewer x:Name="scrollViewer" Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" ScrollChanged="scrollViewer_ScrollChanged"> + <Grid HorizontalAlignment="Left"> + <ItemsControl ItemsSource="{Binding TimelineEventGroups}" HorizontalAlignment="Left" MinWidth="{Binding RelativeSource={RelativeSource AncestorType=localControls:TimelineScrollViewer},Path=ActualWidth}"> + <ItemsControl.Width> + <MultiBinding Converter="{StaticResource TimeSpanToXConverter}" ConverterParameter="300"> + <Binding Path="TimelineMaxTime" /> + <Binding Path="TimelineScaleFactor" /> + </MultiBinding> + </ItemsControl.Width> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> - <StackPanel /> + <UniformGrid Columns="1" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate DataType="{x:Type vm:TimelineEventGroup}"> - <Border BorderThickness="1 0.5 1 0.5" BorderBrush="{StaticResource AccentColorBrush}" Margin="2 0 0 0" Padding="5" Height="{Binding Height,Mode=OneWay}"> - <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22" TextWrapping="Wrap" TextAlignment="Center" FontWeight="SemiBold" Foreground="{StaticResource AccentColorBrush}"></TextBlock> + <Border BorderThickness="0 0 0 1" BorderBrush="#98DEFF" Margin="0 0 0 0"> + <ItemsControl ItemsSource="{Binding Events}" SizeChanged="ItemsControl_SizeChanged"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type entities:MachinesEvent}"> + <Canvas Margin="0 0 0 0" MinHeight="20"> + <Grid Height="{Binding RelativeSource={RelativeSource AncestorType=Canvas},Path=ActualHeight}"> + <Canvas.Left> + <MultiBinding Converter="{StaticResource MachineEventToXConverter}"> + <Binding Path="." /> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.TimelineEventGroups" /> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.TimelineScaleFactor" /> + </MultiBinding> + </Canvas.Left> + <Border BorderBrush="#4E4E4E" BorderThickness="1" Padding="2" MinWidth="50" Cursor="Hand"> + <i:Interaction.Triggers> + <i:EventTrigger EventName="PreviewMouseUp"> + <i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.EventSelectedCommand}" CommandParameter="{Binding}" /> + </i:EventTrigger> + </i:Interaction.Triggers> + <Border.Style> + <Style TargetType="Border"> + <Style.Triggers> + <DataTrigger Binding="{Binding Category}" Value="Info"> + <Setter Property="Background" Value="{StaticResource infoBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Category}" Value="Warning"> + <Setter Property="Background" Value="{StaticResource warningBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Category}" Value="Error"> + <Setter Property="Background" Value="{StaticResource errorBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Category}" Value="Crtitical"> + <Setter Property="Background" Value="{StaticResource criticalBrush}"></Setter> + </DataTrigger> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Opacity" Value="0.7"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </Border.Style> + <StackPanel Orientation="Horizontal"> + <TextBlock FontWeight="SemiBold" Text="{Binding EventType.Name}" Height="14" FontSize="11"></TextBlock> + <TextBlock Margin="10 0 0 0" Text="{Binding Description,Converter={StaticResource StringToFirstLineConverter}}" Height="14" FontSize="11"></TextBlock> + </StackPanel> + </Border> + </Grid> + </Canvas> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> </Border> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> - </ScrollViewer> - <localControls:TimelineScrollViewer x:Name="scrollViewer" Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" ScrollChanged="scrollViewer_ScrollChanged"> - <Grid HorizontalAlignment="Left"> - <ItemsControl ItemsSource="{Binding TimelineEventGroups}" HorizontalAlignment="Left" MinWidth="{Binding RelativeSource={RelativeSource AncestorType=localControls:TimelineScrollViewer},Path=ActualWidth}"> - <ItemsControl.Width> - <MultiBinding Converter="{StaticResource TimeSpanToXConverter}" ConverterParameter="300"> - <Binding Path="TimelineMaxTime" /> + <Canvas Visibility="{Binding EnableTimeMarker,Converter={StaticResource BooleanToVisibilityConverter}}" MinWidth="{Binding RelativeSource={RelativeSource AncestorType=localControls:TimelineScrollViewer},Path=ActualWidth}" ClipToBounds="False" IsHitTestVisible="False"> + <Grid Height="{Binding RelativeSource={RelativeSource AncestorType=Canvas},Path=ActualHeight}" ClipToBounds="False"> + <Canvas.Left> + <MultiBinding Converter="{StaticResource TimeSpanToXConverter}"> + <Binding Path="CurrentPosition" /> <Binding Path="TimelineScaleFactor" /> </MultiBinding> - </ItemsControl.Width> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid Columns="1" /> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type vm:TimelineEventGroup}"> - <Border BorderThickness="0 0 0 1" BorderBrush="#98DEFF" Margin="0 0 0 0"> - <ItemsControl ItemsSource="{Binding Events}" SizeChanged="ItemsControl_SizeChanged"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel IsItemsHost="True"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type entities:MachinesEvent}"> - <Canvas Margin="0 0 0 0" MinHeight="20"> - <Grid Height="{Binding RelativeSource={RelativeSource AncestorType=Canvas},Path=ActualHeight}"> - <Canvas.Left> - <MultiBinding Converter="{StaticResource MachineEventToXConverter}"> - <Binding Path="." /> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.TimelineEventGroups" /> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.TimelineScaleFactor" /> - </MultiBinding> - </Canvas.Left> - <Border BorderBrush="#4E4E4E" BorderThickness="1" Padding="2" MinWidth="50" Cursor="Hand"> - <i:Interaction.Triggers> - <i:EventTrigger EventName="PreviewMouseUp"> - <i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.EventSelectedCommand}" CommandParameter="{Binding}" /> - </i:EventTrigger> - </i:Interaction.Triggers> - <Border.Style> - <Style TargetType="Border"> - <Style.Triggers> - <DataTrigger Binding="{Binding Category}" Value="Info"> - <Setter Property="Background" Value="{StaticResource infoBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Category}" Value="Warning"> - <Setter Property="Background" Value="{StaticResource warningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Category}" Value="Error"> - <Setter Property="Background" Value="{StaticResource errorBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Category}" Value="Crtitical"> - <Setter Property="Background" Value="{StaticResource criticalBrush}"></Setter> - </DataTrigger> - <Trigger Property="IsMouseOver" Value="True"> - <Setter Property="Opacity" Value="0.7"></Setter> - </Trigger> - </Style.Triggers> - </Style> - </Border.Style> - <StackPanel Orientation="Horizontal"> - <TextBlock FontWeight="SemiBold" Text="{Binding EventType.Name}" Height="14" FontSize="11"></TextBlock> - <TextBlock Margin="10 0 0 0" Text="{Binding Description,Converter={StaticResource StringToFirstLineConverter}}" Height="14" FontSize="11"></TextBlock> - </StackPanel> - </Border> - </Grid> - </Canvas> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </Border> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - - <Canvas Visibility="{Binding EnableTimeMarker,Converter={StaticResource BooleanToVisibilityConverter}}" MinWidth="{Binding RelativeSource={RelativeSource AncestorType=localControls:TimelineScrollViewer},Path=ActualWidth}" ClipToBounds="False" IsHitTestVisible="False"> - <Grid Height="{Binding RelativeSource={RelativeSource AncestorType=Canvas},Path=ActualHeight}" ClipToBounds="False"> - <Canvas.Left> - <MultiBinding Converter="{StaticResource TimeSpanToXConverter}"> - <Binding Path="CurrentPosition" /> - <Binding Path="TimelineScaleFactor" /> - </MultiBinding> - </Canvas.Left> + </Canvas.Left> - <Rectangle Stroke="DodgerBlue" StrokeThickness="1" HorizontalAlignment="Left" VerticalAlignment="Stretch" /> - <Polygon Fill="DodgerBlue" Points="0,0 16,0 8,15 0,0" Margin="-8 -5 0 0" VerticalAlignment="Top" /> - </Grid> - </Canvas> - </Grid> - </localControls:TimelineScrollViewer> + <Rectangle Stroke="DodgerBlue" StrokeThickness="1" HorizontalAlignment="Left" VerticalAlignment="Stretch" /> + <Polygon Fill="DodgerBlue" Points="0,0 16,0 8,15 0,0" Margin="-8 -5 0 0" VerticalAlignment="Top" /> + </Grid> + </Canvas> + </Grid> + </localControls:TimelineScrollViewer> - <Border Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="20" Padding="10" Background="#7ECECECE" CornerRadius="5"> + <Border Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="20" Padding="10" Background="#7ECECECE" CornerRadius="5"> <Grid> <materialDesign:PackIcon Kind="MagnifyPlus" Margin="0 -35 0 0" Width="20" Height="20" Foreground="Gray" /> <Slider Minimum="0.5" Maximum="100" Value="{Binding TimelineScaleFactor}" Orientation="Vertical" Height="120"/> </Grid> </Border> </Grid> - </Grid> + <!--</Grid>--> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index 15033e295..935cfe5ee 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -239,6 +239,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels public void DropIdsPack(IdsPack idsPack1, IdsPack idsPack2) { ActiveMachine.Configuration.IdsPacks.Swap(idsPack1, idsPack2); + ColorLabVM.InvalidateLiquidFactorsCalibrationData(); } /// <summary> @@ -333,6 +334,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { idsPack.LiquidType = liquidType; idsPack.LiquidTypeGuid = liquidType.Guid; + ColorLabVM.InvalidateLiquidFactorsCalibrationData(); } /// <summary> @@ -358,6 +360,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { ActiveMachineAdapter.Context.IdsPacks.Remove(SelectedIds); SelectedIds = null; + ColorLabVM.InvalidateLiquidFactorsCalibrationData(); } /// <summary> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml index 97eceaa7d..b13ffb87b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml @@ -109,7 +109,7 @@ </Border> </Grid> - <TextBlock Canvas.Left="532" FontStyle="Italic" Foreground="Gray" Canvas.Top="-22">Hardware Version</TextBlock> + <TextBlock Canvas.Left="532" FontStyle="Italic" Foreground="{StaticResource GrayBrush}" Canvas.Top="-22">Hardware Version</TextBlock> <Grid Width="97" Height="90" Canvas.Left="431" Canvas.Top="-13"> <Rectangle Stroke="Gray" VerticalAlignment="Top" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> <Rectangle Stroke="Gray" HorizontalAlignment="Left" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> @@ -284,7 +284,7 @@ <Grid Width="61" IsHitTestVisible="True" SnapsToDevicePixels="True" ClipToBounds="True" Height="42" Canvas.Left="85" Canvas.Top="385"> <StackPanel Orientation="Horizontal"> <Image Source="../Images/embedded.png" Width="10" VerticalAlignment="Center" Margin="1" RenderOptions.BitmapScalingMode="Fant"></Image> - <TextBlock VerticalAlignment="Center" Padding="1" Foreground="Gainsboro" IsHitTestVisible="False" FontSize="5" TextAlignment="Center" TextWrapping="Wrap" Height="15" Margin="0,6,0,0" Width="47"><Run Text="{Binding ActiveMachine.Configuration.EmbeddedFirmwareVersion.Name}"/><Run Text=" "/><Run Text="{Binding ActiveMachine.Configuration.EmbeddedFirmwareVersion.Version}"/></TextBlock> + <TextBlock VerticalAlignment="Center" Padding="1" Foreground="{StaticResource BorderBrushGainsboro}" IsHitTestVisible="False" FontSize="5" TextAlignment="Center" TextWrapping="Wrap" Height="15" Margin="0,6,0,0" Width="47"><Run Text="{Binding ActiveMachine.Configuration.EmbeddedFirmwareVersion.Name}"/><Run Text=" "/><Run Text="{Binding ActiveMachine.Configuration.EmbeddedFirmwareVersion.Version}"/></TextBlock> </StackPanel> </Grid> @@ -337,7 +337,7 @@ <StackPanel> <Image Source="../Images/tablet.png" Width="10" Margin="2" RenderOptions.BitmapScalingMode="Fant"></Image> - <TextBlock Padding="2 0 2 0" Foreground="Gainsboro" IsHitTestVisible="False" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> + <TextBlock Padding="2 0 2 0" Foreground="{StaticResource BorderBrushGainsboro}" IsHitTestVisible="False" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> <Run Text="{Binding ActiveMachine.Configuration.ApplicationDisplayPanelVersion.Name}"></Run> <Run Text="{Binding ActiveMachine.Configuration.ApplicationDisplayPanelVersion.Version}"></Run> </TextBlock> @@ -346,7 +346,7 @@ <StackPanel Grid.Row="1" > <Image Source="../Images/application-firmware.png" Width="10" Margin="2" RenderOptions.BitmapScalingMode="Fant"></Image> - <TextBlock Padding="2 0 2 0" IsHitTestVisible="False" Foreground="Gainsboro" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> + <TextBlock Padding="2 0 2 0" IsHitTestVisible="False" Foreground="{StaticResource BorderBrushGainsboro}" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> <Run Text="{Binding ActiveMachine.Configuration.ApplicationFirmwareVersion.Name}"></Run> <Run Text="{Binding ActiveMachine.Configuration.ApplicationFirmwareVersion.Version}"></Run> </TextBlock> @@ -354,7 +354,7 @@ <StackPanel Grid.Row="2" > <Image Source="../Images/android.png" Width="10" Margin="2" RenderOptions.BitmapScalingMode="Fant"></Image> - <TextBlock Padding="2 0 2 0" IsHitTestVisible="False" Foreground="Gainsboro" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> + <TextBlock Padding="2 0 2 0" IsHitTestVisible="False" Foreground="{StaticResource BorderBrushGainsboro}" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> <Run Text="{Binding ActiveMachine.Configuration.ApplicationOsVersion.Name}"></Run> <Run Text="{Binding ActiveMachine.Configuration.ApplicationOsVersion.Version}"></Run> </TextBlock> @@ -367,9 +367,9 @@ <Grid> - <TextBlock Margin="10" FontStyle="Italic" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Gray" FontSize="16">IDS PACKS</TextBlock> + <TextBlock Margin="10" FontStyle="Italic" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="{StaticResource GrayBrush}" FontSize="16">IDS PACKS</TextBlock> <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> - <ItemsControl ItemsSource="{Binding ActiveMachine.Configuration.IdsPacks}" FontSize="10" Foreground="DimGray" Margin="10 30 10 10"> + <ItemsControl ItemsSource="{Binding ActiveMachine.Configuration.IdsPacks}" FontSize="10" Foreground="{StaticResource DimGrayBrush}" Margin="10 30 10 10"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel> @@ -404,7 +404,7 @@ </ItemsControl> </ScrollViewer> - <Rectangle HorizontalAlignment="Right" Margin="0 20 0 20" Stroke="Gainsboro" StrokeThickness="1" StrokeDashArray="5 5 5 5"></Rectangle> + <Rectangle HorizontalAlignment="Right" Margin="0 20 0 20" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1" StrokeDashArray="5 5 5 5"></Rectangle> </Grid> </Grid> @@ -442,7 +442,7 @@ </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -465,11 +465,11 @@ <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/tank.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run Text="{Binding Name}"></Run></TextBlock> </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -495,7 +495,7 @@ </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -517,8 +517,8 @@ <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/liquid.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run Text="{Binding Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> <Rectangle Height="5" Width="170"> <Rectangle.Fill> <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> @@ -527,7 +527,7 @@ </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -549,11 +549,11 @@ <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/formula.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run Text="{Binding Name}"></Run></TextBlock> </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -575,12 +575,12 @@ <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/tablet.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run Text="{Binding Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -602,12 +602,12 @@ <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/android.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run Text="{Binding Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -629,12 +629,12 @@ <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/application-firmware.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run Text="{Binding Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -656,12 +656,12 @@ <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/embedded.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run Text="{Binding Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -683,12 +683,12 @@ <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/hardware.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> - <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run Text="{Binding Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="{StaticResource DimGrayBrush}"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> </StackPanel> </StackPanel> - <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="{StaticResource BorderBrushGainsboro}" StrokeThickness="1"></Rectangle> </Grid> </DataTemplate> </ListBox.ItemTemplate> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml index ce60ebf02..7acb4c806 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml @@ -15,7 +15,7 @@ <Grid DockPanel.Dock="Top"> <StackPanel Orientation="Horizontal"> <Button Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Command="{Binding BackToMachinesCommand}"> - <materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="#202020" ToolTip="Back to RML list" /> + <materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="{StaticResource DarkGrayBrush}" ToolTip="Back to RML list" /> </Button> <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="34" Text="{Binding ActiveMachine.Name}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml index eb3eea5ab..62c38a1e6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml @@ -27,8 +27,8 @@ <local:MachineView DataContext="{Binding ActiveMachine}" IsHitTestVisible="False" /> - <Border Grid.Column="1" Margin="100 70" CornerRadius="5" Background="#68F6F6F6" Padding="10" BorderBrush="Silver" BorderThickness="1"> - <Grid TextElement.Foreground="#3E3E3E"> + <Border Grid.Column="1" Margin="100 70" CornerRadius="5" Background="{StaticResource TransparentBackgroundBrush600}" Padding="10" BorderBrush="{StaticResource borderBrush}" BorderThickness="1"> + <Grid TextElement.Foreground="{StaticResource GrayBrush280}"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="Auto" /> @@ -42,30 +42,33 @@ <TextBox Text="{Binding ActiveMachine.Name}"></TextBox> <TextBlock FontWeight="SemiBold">Machine Version</TextBlock> - <ComboBox Background="#F4F4F4" ItemsSource="{Binding ActiveMachineAdapter.MachineVersions}" SelectedItem="{Binding ActiveMachine.MachineVersion}" DisplayMemberPath="Name"></ComboBox> + <ComboBox Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.MachineVersions}" SelectedItem="{Binding ActiveMachine.MachineVersion}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> <TextBlock FontWeight="SemiBold">Organization</TextBlock> - <ComboBox Background="#F4F4F4" ItemsSource="{Binding ActiveMachineAdapter.Organizations}" SelectedItem="{Binding ActiveMachine.Organization}" DisplayMemberPath="Name"></ComboBox> + <ComboBox Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.Organizations}" SelectedItem="{Binding ActiveMachine.Organization}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> <TextBlock FontWeight="SemiBold">Default RML</TextBlock> - <ComboBox Background="#F4F4F4" ItemsSource="{Binding ActiveMachineAdapter.Rmls}" SelectedItem="{Binding ActiveMachine.DefaultRml}" DisplayMemberPath="Name"></ComboBox> + <ComboBox Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.Rmls}" SelectedItem="{Binding ActiveMachine.DefaultRml}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> <TextBlock FontWeight="SemiBold">Loaded RML</TextBlock> - <ComboBox Background="#F4F4F4" ItemsSource="{Binding ActiveMachineAdapter.Rmls}" SelectedValue="{Binding ActiveMachine.LoadedRmlGuid}" SelectedValuePath="Guid" DisplayMemberPath="Name"></ComboBox> + <ComboBox Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.Rmls}" SelectedValue="{Binding ActiveMachine.LoadedRmlGuid}" SelectedValuePath="Guid" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> <TextBlock FontWeight="SemiBold">Default Color Space</TextBlock> - <ComboBox Background="#F4F4F4" ItemsSource="{Binding ActiveMachineAdapter.ColorSpaces}" SelectedItem="{Binding ActiveMachine.DefaultColorSpace}" DisplayMemberPath="Name"></ComboBox> + <ComboBox Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.ColorSpaces}" SelectedItem="{Binding ActiveMachine.DefaultColorSpace}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> <TextBlock FontWeight="SemiBold">Default Segment Length</TextBlock> <mahapps:NumericUpDown HideUpDownButtons="True" BorderThickness="0 0 0 1" Background="Transparent" Minimum="0" Maximum="1000" Value="{Binding ActiveMachine.DefaultSegmentLength}" HasDecimals="False"></mahapps:NumericUpDown> <TextBlock FontWeight="SemiBold">Default Spool Type</TextBlock> - <ComboBox ItemsSource="{Binding ActiveMachineAdapter.SpoolTypes}" SelectedItem="{Binding ActiveMachine.DefaultSpoolType}" DisplayMemberPath="Name"></ComboBox> + <ComboBox Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.SpoolTypes}" SelectedItem="{Binding ActiveMachine.DefaultSpoolType}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> <TextBlock FontWeight="SemiBold">OS Key</TextBlock> <TextBox Text="{Binding ActiveMachine.OsKey}"></TextBox> + + <TextBlock FontWeight="SemiBold">Device COM Port</TextBlock> + <TextBox Text="{Binding ActiveMachine.DeviceComPort}"></TextBox> </controls:TableGrid> - <Rectangle Grid.Column="1" StrokeThickness="1" Stroke="Silver" HorizontalAlignment="Center" Margin="50 50" /> + <Rectangle Grid.Column="1" StrokeThickness="1" Stroke="{StaticResource borderBrush}" HorizontalAlignment="Center" Margin="50 50" /> <controls:TableGrid RowHeight="50" Margin="10" Grid.Column="2"> <TextBlock FontWeight="SemiBold">Auto Login</TextBlock> <ToggleButton HorizontalAlignment="Left" IsChecked="{Binding ActiveMachine.AutoLogin}"></ToggleButton> @@ -90,6 +93,12 @@ <TextBlock FontWeight="SemiBold">Is Demo Machine</TextBlock> <ToggleButton HorizontalAlignment="Left" IsChecked="{Binding ActiveMachine.IsDemo}"></ToggleButton> + + <TextBlock FontWeight="SemiBold">Suspend Version Update</TextBlock> + <ToggleButton HorizontalAlignment="Left" IsChecked="{Binding ActiveMachine.SuspendVersionUpdate}"></ToggleButton> + + <TextBlock FontWeight="SemiBold">Update Schema on Update</TextBlock> + <ToggleButton HorizontalAlignment="Left" IsChecked="{Binding ActiveMachine.PerformSchemaUpdateOnDataUpdate}"></ToggleButton> </controls:TableGrid> </Grid> </Border> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml index f6c39a6cd..b04720647 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml @@ -9,7 +9,7 @@ xmlns:providers="clr-namespace:Tango.MachineStudio.MachineDesigner.AutoComplete" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views" - mc:Ignorable="d" Width="530" Height="239" Background="White"> + mc:Ignorable="d" Width="530" Height="239" Background="{StaticResource Dialog.Background}" Foreground="{StaticResource Dialog.Foreground}"> <UserControl.Resources> <providers:MachineVersionsProvider x:Key="VersionsProvider"></providers:MachineVersionsProvider> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml index faa6b1086..466e6f458 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml @@ -31,19 +31,19 @@ </Grid> <Grid DockPanel.Dock="Bottom" IsEnabled="{Binding IsFree}"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0"> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveMachineCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveMachineCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FFA65F" BorderBrush="#FFA65F" Command="{Binding CloneMachineCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource OrangeBrush300}" BorderBrush="{StaticResource OrangeBrush200}" Command="{Binding CloneMachineCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="ContentCopy" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">CLONE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddMachineCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddMachineCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">NEW MACHINE</TextBlock> @@ -60,7 +60,7 @@ </StackPanel> </Grid> <Grid IsEnabled="{Binding IsFree}"> - <controls:DoubleClickDataGrid Style="{StaticResource {x:Type DataGrid}}" DoubleClickCommand="{Binding EditMachineCommand}" Margin="0 0 0 10" SelectionMode="Single" SelectionUnit="FullRow" BorderBrush="Silver" IsReadOnly="True" BorderThickness="1" Background="#93FFFFFF" AlternatingRowBackground="#C9F6F6F6" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding MachinesAdapter.Machines}" SelectedItem="{Binding SelectedMachine}"> + <controls:DoubleClickDataGrid Style="{StaticResource {x:Type DataGrid}}" DoubleClickCommand="{Binding EditMachineCommand}" Margin="0 0 0 10" SelectionMode="Single" SelectionUnit="FullRow" BorderBrush="{StaticResource borderBrush}" IsReadOnly="True" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding MachinesAdapter.Machines}" SelectedItem="{Binding SelectedMachine}"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/SpoolsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/SpoolsView.xaml index d04389ae7..3663f72f8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/SpoolsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/SpoolsView.xaml @@ -28,13 +28,13 @@ <DockPanel Grid.Column="1" Margin="50 100"> <Grid DockPanel.Dock="Bottom"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 0 0"> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveSpoolCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveSpoolCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 0 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddSpoolCommand}"> + <Button Margin="0 0 0 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddSpoolCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">NEW SPOOL</TextBlock> @@ -46,7 +46,7 @@ </StackPanel> </Grid> <Grid> - <DataGrid Margin="0 0 0 10" SelectionUnit="FullRow" BorderBrush="Silver" BorderThickness="1" Background="#93FFFFFF" AlternatingRowBackground="#C9F6F6F6" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding ActiveMachine.Spools}" SelectedItem="{Binding SelectedSpool}"> + <DataGrid Margin="0 0 0 10" SelectionUnit="FullRow" BorderBrush="{StaticResource borderBrush }" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding ActiveMachine.Spools}" SelectedItem="{Binding SelectedSpool}"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/arrow-long-down.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/arrow-long-down.png Binary files differnew file mode 100644 index 000000000..e3a862399 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/arrow-long-down.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/arrow-long-left.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/arrow-long-left.png Binary files differnew file mode 100644 index 000000000..5845204d2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/arrow-long-left.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/arrow-long-right.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/arrow-long-right.png Binary files differnew file mode 100644 index 000000000..6c089d44e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/arrow-long-right.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/data-table.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/data-table.png Binary files differnew file mode 100644 index 000000000..0d5e5eaa6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/data-table.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/CctModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/CctModel.cs new file mode 100644 index 000000000..9079b8fc6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/CctModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.RML.Models +{ + public class CctModel + { + public String Guid { get; set; } + public String FileName { get; set; } + public bool IsNew { get; set; } + public byte[] Data { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj index b1c8f580d..6741a1dff 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj @@ -73,6 +73,7 @@ <Link>GlobalVersionInfo.cs</Link> </Compile> <Compile Include="Contracts\IMainView.cs" /> + <Compile Include="Models\CctModel.cs" /> <Compile Include="RMLModule.cs" /> <Compile Include="Properties\AssemblyInfo.cs"> <SubType>Code</SubType> @@ -89,13 +90,28 @@ </Compile> <Compile Include="ViewModelLocator.cs" /> <Compile Include="ViewModels\AddLiquidFactorViewVM.cs" /> + <Compile Include="ViewModels\CalibrationDataPointVM.cs" /> + <Compile Include="ViewModels\CalibrationDataViewVM.cs" /> + <Compile Include="ViewModels\CalibrationDataVM.cs" /> + <Compile Include="ViewModels\ColorConversionViewVM.cs" /> + <Compile Include="ViewModels\LiquidVolumeVM.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> + <Compile Include="ViewModels\RgbVM.cs" /> <Compile Include="Views\AddLiquidFactorView.xaml.cs"> <DependentUpon>AddLiquidFactorView.xaml</DependentUpon> </Compile> + <Compile Include="Views\CalibrationDataView.xaml.cs"> + <DependentUpon>CalibrationDataView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\ColorConversionView.xaml.cs"> + <DependentUpon>ColorConversionView.xaml</DependentUpon> + </Compile> <Compile Include="Views\MainView.xaml.cs"> <DependentUpon>MainView.xaml</DependentUpon> </Compile> + <Compile Include="Views\ProcessParametersView.xaml.cs"> + <DependentUpon>ProcessParametersView.xaml</DependentUpon> + </Compile> <Compile Include="Views\RmlsView.xaml.cs"> <DependentUpon>RmlsView.xaml</DependentUpon> </Compile> @@ -114,10 +130,22 @@ </None> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\..\SideChains\ColorMine\ColorMine.csproj"> + <Project>{37e4ceab-b54b-451f-b535-04cf7da9c459}</Project> + <Name>ColorMine</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj"> <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> <Name>Tango.BL</Name> </ProjectReference> + <ProjectReference Include="..\..\..\Tango.BrushPicker\Tango.BrushPicker.csproj"> + <Project>{40085232-aced-4cbe-945b-90ba8153c151}</Project> + <Name>Tango.BrushPicker</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Tango.ColorConversion\Tango.ColorConversion.csproj"> + <Project>{b4fe6485-4161-4b36-bc08-67e0b53d01b7}</Project> + <Name>Tango.ColorConversion</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj"> <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> <Name>Tango.Core</Name> @@ -134,6 +162,10 @@ <Project>{b112d89a-a106-41ae-a0c1-4abc84c477f5}</Project> <Name>Tango.DragAndDrop</Name> </ProjectReference> + <ProjectReference Include="..\..\..\Tango.Hive\Tango.Hive.csproj"> + <Project>{942134ac-6ea2-4500-8f22-0f739b70a05f}</Project> + <Name>Tango.Hive</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Tango.Logging\Tango.Logging.csproj"> <Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project> <Name>Tango.Logging</Name> @@ -154,10 +186,6 @@ <Project>{cb0b0aa2-bb24-4bca-a720-45e397684e12}</Project> <Name>Tango.MachineStudio.Common</Name> </ProjectReference> - <ProjectReference Include="..\Tango.MachineStudio.ColorLab\Tango.MachineStudio.ColorLab.csproj"> - <Project>{4d183aca-552b-4135-ae81-7c5a8e5fc3b1}</Project> - <Name>Tango.MachineStudio.ColorLab</Name> - </ProjectReference> </ItemGroup> <ItemGroup> <Resource Include="Images\rml-module.jpg" /> @@ -167,10 +195,22 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Views\CalibrationDataView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\ColorConversionView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\MainView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Views\ProcessParametersView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\RmlsView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -186,6 +226,16 @@ <ItemGroup> <Resource Include="Images\thread_128px.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\data-table.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\arrow-long-down.png" /> + <Resource Include="Images\arrow-long-left.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\arrow-long-right.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/CalibrationDataPointVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/CalibrationDataPointVM.cs new file mode 100644 index 000000000..4ad06c7ed --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/CalibrationDataPointVM.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; +using Tango.PMR.ColorLab; +using Tango.SharedUI; + +namespace Tango.MachineStudio.RML.ViewModels +{ + public class CalibrationDataPointVM : ExtendedObject + { + private double _x; + + public double X + { + get { return _x; } + set { _x = value; RaisePropertyChangedAuto(); } + } + + private double _y; + + public double Y + { + get { return _y; } + set { _y = value; RaisePropertyChangedAuto(); } + } + + private int _index; + + public int Index + { + get { return _index; } + set { _index = value; RaisePropertyChangedAuto(); } + } + + + public CalibrationDataPointVM() + { + + } + + public CalibrationDataPointVM(double x, double y) + { + X = x; + Y = y; + } + + public CalibrationDataPointVM(CalibrationPoint calibrationPoint) : this(calibrationPoint.X, calibrationPoint.Y) + { + + } + + public CalibrationPoint ToPMR() + { + return new CalibrationPoint() + { + X = X, + Y = Y, + }; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/CalibrationDataVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/CalibrationDataVM.cs new file mode 100644 index 000000000..403494a8e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/CalibrationDataVM.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core; +using Tango.SharedUI; + +namespace Tango.MachineStudio.RML.ViewModels +{ + public class CalibrationDataVM : ExtendedObject + { + private LiquidType _liquidType; + + public LiquidType LiquidType + { + get { return _liquidType; } + set { _liquidType = value; RaisePropertyChangedAuto(); } + } + + private IdsPack _idsPack; + + public IdsPack IdsPack + { + get { return _idsPack; } + set { _idsPack = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection<CalibrationDataPointVM> _calibrationPoints; + + public ObservableCollection<CalibrationDataPointVM> CalibrationPoints + { + get { return _calibrationPoints; } + set { _calibrationPoints = value; RaisePropertyChangedAuto(); OnCalibrationPointsChanged(); } + } + + private void OnCalibrationPointsChanged() + { + if (CalibrationPoints != null) + { + CalibrationPoints.CollectionChanged -= CalibrationPoints_CollectionChanged; + CalibrationPoints.CollectionChanged += CalibrationPoints_CollectionChanged; + + SetIndices(); + } + } + + private void CalibrationPoints_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + { + SetIndices(); + } + + private void SetIndices() + { + if (CalibrationPoints != null) + { + int index = 1; + foreach (var p in CalibrationPoints) + { + p.Index = index++; + } + } + } + + private CalibrationDataVM() + { + CalibrationPoints = new ObservableCollection<CalibrationDataPointVM>(); + } + + public CalibrationDataVM(IdsPack pack) : this() + { + IdsPack = pack; + LiquidType = pack.LiquidType; + } + + public CalibrationDataVM(LiquidType liquidType) : this() + { + LiquidType = liquidType; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/CalibrationDataViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/CalibrationDataViewVM.cs new file mode 100644 index 000000000..b34ef83bc --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/CalibrationDataViewVM.cs @@ -0,0 +1,110 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Calibration; +using Tango.Core.Commands; +using Tango.MachineStudio.Common; +using Tango.MachineStudio.Common.Notifications; +using Tango.SharedUI; + +namespace Tango.MachineStudio.RML.ViewModels +{ + public class CalibrationDataViewVM : ViewModel + { + private INotificationProvider _notification; + + private ObservableCollection<CalibrationDataVM> _liquidsCalibrationData; + /// <summary> + /// Gets or sets the liquids calibration data. + /// </summary> + public ObservableCollection<CalibrationDataVM> LiquidsCalibrationData + { + get { return _liquidsCalibrationData; } + set { _liquidsCalibrationData = value; RaisePropertyChangedAuto(); } + } + + /// <summary> + /// Gets or sets the import excel command. + /// </summary> + public RelayCommand<CalibrationDataVM> ImportExcelCommand { get; set; } + + /// <summary> + /// Gets or sets the export excel command. + /// </summary> + public RelayCommand<CalibrationDataVM> ExportExcelCommand { get; set; } + + /// <summary> + /// Initializes a new instance of the <see cref="CalibrationDataViewVM"/> class. + /// </summary> + public CalibrationDataViewVM(INotificationProvider notificationProvider) + { + _notification = notificationProvider; + + LiquidsCalibrationData = new ObservableCollection<CalibrationDataVM>(); + + ImportExcelCommand = new RelayCommand<CalibrationDataVM>(ImportExcel); + ExportExcelCommand = new RelayCommand<CalibrationDataVM>(ExportExcel); + } + + /// <summary> + /// Initializes a new instance of the <see cref="CalibrationDataViewVM"/> class. + /// </summary> + /// <param name="liquidsCalibrationData">The liquids calibration data.</param> + public CalibrationDataViewVM(INotificationProvider notificationProvider, ObservableCollection<CalibrationDataVM> liquidsCalibrationData) : this(notificationProvider) + { + LiquidsCalibrationData = liquidsCalibrationData; + } + + private void ImportExcel(CalibrationDataVM vm) + { + OpenFileDialog dlg = new OpenFileDialog(); + + try + { + dlg.Title = $"Import excel calibration file for {vm.LiquidType.Name}"; + dlg.Filter = "Excel Files|*.xlsx"; + if (dlg.ShowDialog().Value) + { + vm.CalibrationPoints.Clear(); + var points = CalibrationHelper.ImportCalibrationDataFromExcel(dlg.FileName); + + foreach (var p in points) + { + vm.CalibrationPoints.Add(new CalibrationDataPointVM(p)); + } + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error importing excel file " + dlg.FileName); + _notification.ShowError("An error occurred while trying to import the selected excel file. Please check the file format if valid and is available to read."); + } + } + + private void ExportExcel(CalibrationDataVM vm) + { + SaveFileDialog dlg = new SaveFileDialog(); + try + { + dlg.Title = $"Export excel calibration file for {vm.LiquidType.Name}"; + dlg.Filter = "Excel Files|*.xlsx"; + dlg.DefaultExt = ".xlsx"; + dlg.FileName = $"CData_{vm.LiquidType.Name}_v{vm.LiquidType.Version}.xlsx"; + if (dlg.ShowDialog().Value) + { + var points = vm.CalibrationPoints.Select(x => x.ToPMR()).ToList(); + CalibrationHelper.ExportCalibrationDataToExcel(points, dlg.FileName); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error exporting excel file " + dlg.FileName); + _notification.ShowError("An error occurred while trying to export the calibration data."); + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs new file mode 100644 index 000000000..2624c9b7d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs @@ -0,0 +1,396 @@ +using Google.Protobuf; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Data.Entity; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using Tango.BL; +using Tango.BL.Entities; +using Tango.BL.Enumerations; +using Tango.ColorConversion; +using Tango.MachineStudio.Common; +using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.RML.Models; +using Tango.PMR.ColorLab; +using Tango.SharedUI; + +namespace Tango.MachineStudio.RML.ViewModels +{ + public class ColorConversionViewVM: ViewModel + { + #region properties + + private INotificationProvider _notification; + private bool _prevent_inverse_conversion; + + private bool _isVolumesOutOfRange; + /// <summary> + /// Gets or sets a value indicating whether the liquid volumes are out of range. + /// </summary> + public bool IsVolumesOutOfRange + { + get { return _isVolumesOutOfRange; } + set + { + if (_isVolumesOutOfRange != value) + { + _isVolumesOutOfRange = value; + RaisePropertyChangedAuto(); + } + } + } + + private bool _isOutOfGamut; + /// <summary> + /// Gets or sets a value indicating whether the source color is out of gamut. + /// </summary> + public bool IsOutOfGamut + { + get { return _isOutOfGamut; } + set { _isOutOfGamut = value; RaisePropertyChangedAuto(); } + } + + private Rml _rml; + public Rml RML + { + get { return _rml; } + set { _rml = value; RaisePropertyChangedAuto(); } + } + + private List<ColorConversionSuggestion> _hiveSuggestions; + /// <summary> + /// Gets or sets the hive suggestions. + /// </summary> + public List<ColorConversionSuggestion> HiveSuggestions + { + get { return _hiveSuggestions; } + set { _hiveSuggestions = value; RaisePropertyChangedAuto(); } + } + + private ColorConversionSuggestion _selectedSuggestion; + /// <summary> + /// Gets or sets the selected suggestion. + /// </summary> + public ColorConversionSuggestion SelectedSuggestion + { + get { return _selectedSuggestion; } + set { _selectedSuggestion = value; RaisePropertyChangedAuto(); OnSelectedSuggestionChanged(); } + } + + private ObservableCollection<LiquidTypesRml> _liquidTypesRmls; + /// <summary> + /// Gets or sets the liquid types RMLS. + /// </summary> + public ObservableCollection<LiquidTypesRml> LiquidTypesRmls + { + get { return _liquidTypesRmls; } + set { _liquidTypesRmls = value; RaisePropertyChangedAuto(); OnLiquidTypesRmlsChanged(); } + } + + private void OnLiquidTypesRmlsChanged() + { + if (LiquidTypesRmls != null) + { + LiquidTypesRmls.CollectionChanged += LiquidTypesRmls_CollectionChanged; + InvalidateLiquidVolumes(); + } + } + + private void LiquidTypesRmls_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + { + InvalidateLiquidVolumes(); + } + + private void InvalidateLiquidVolumes() + { + LiquidVolumes = LiquidTypesRmls.Where(x => x.LiquidType.HasPigment).Select(x => new LiquidVolumeVM() + { + Color = x.LiquidType.Color, + Name = x.LiquidType.Name, + LiquidType = x.LiquidType, + }).ToObservableCollection(); + } + + private ObservableCollection<LiquidVolumeVM> _liquidVolumes; + /// <summary> + /// Gets or sets the liquid volumes. + /// </summary> + public ObservableCollection<LiquidVolumeVM> LiquidVolumes + { + get { return _liquidVolumes; } + set { _liquidVolumes = value; RaisePropertyChangedAuto(); OnLiquidsVolumesChanged(); } + } + + private ObservableCollection<CalibrationDataVM> _liquidsCalibrationData; + /// <summary> + /// Gets or sets the liquids calibration data. + /// </summary> + public ObservableCollection<CalibrationDataVM> LiquidsCalibrationData + { + get { return _liquidsCalibrationData; } + set { _liquidsCalibrationData = value; RaisePropertyChangedAuto(); } + } + + private CctModel _cct; + public CctModel CCT + { + get { return _cct; } + set + { + _cct = value; + RaisePropertyChangedAuto(); + InvalidateRelayCommands(); + } + } + + private RgbVM _sourceColor; + /// <summary> + /// Gets or sets the color of the source. + /// </summary> + public RgbVM SourceColor + { + get { return _sourceColor; } + set { _sourceColor = value; RaisePropertyChangedAuto(); } + } + + private RgbVM _targetColor; + /// <summary> + /// Gets or sets the color of the target. + /// </summary> + /// <value> + /// The color of the target. + /// </value> + public RgbVM TargetColor + { + get { return _targetColor; } + set { _targetColor = value; RaisePropertyChangedAuto(); } + } + + #endregion + + public ColorConversionViewVM(INotificationProvider notification) + { + _notification = notification; + + // CCT = new Cct(); + + SourceColor = new RgbVM(); + SourceColor.ColorChanged += SourceColor_ColorChanged; + } + + private void OnLiquidsVolumesChanged() + { + LiquidVolumes.EnableCrossThreadOperations(); + LiquidVolumes.ToList().ForEach(x => x.VolumeChanged += (s, e) => OnLiquidVolumeChanged()); + } + + private void SourceColor_ColorChanged(object sender, Color e) + { + GetHiveSuggestions(); + } + + private void GetHiveSuggestions() + { + Task.Factory.StartNew(() => + { + try + { + if (RML == null || LiquidsCalibrationData == null || CCT == null || CCT.Data == null) return; + + ConversionInput input = new ConversionInput(); + input.ColorSpace = SourceColor.IsLab ? PMR.ColorLab.ColorSpace.Lab : PMR.ColorLab.ColorSpace.Rgb; + //input.DeltaChroma = DeltaChroma; + //input.DeltaL = DeltaL; + input.ForwardData = ByteString.CopyFrom(CCT.Data); + + input.InputCoordinates = new InputCoordinates(); + input.InputCoordinates.Red = (int)SourceColor.Red; + input.InputCoordinates.Green = (int)SourceColor.Green; + input.InputCoordinates.Blue = (int)SourceColor.Blue; + + input.InputCoordinates.L = SourceColor.L; + input.InputCoordinates.A = SourceColor.A; + input.InputCoordinates.B = SourceColor.B; + + input.ThreadL = RML.WhitePointL; + input.ThreadA = RML.WhitePointA; + input.ThreadB = RML.WhitePointB; + + //Validate calibration data + foreach (var vm in LiquidsCalibrationData.Where(x => x.LiquidType.HasPigment)) + { + if (vm.CalibrationPoints.Count == 0) + { + InvokeUI(() => + { + _notification.ShowError($"No calibration data for liquid '{vm.LiquidType.Name}'. Could not convert source color."); + }); + return; + } + else if (!(vm.CalibrationPoints.First().X == 0 && vm.CalibrationPoints.First().Y == 0 && vm.CalibrationPoints.Last().X == 100 && vm.CalibrationPoints.Last().Y == 100)) + { + InvokeUI(() => + { + _notification.ShowError($"Invalid calibration data for liquid '{vm.LiquidType.Name}'. Could not convert source color."); + }); + return; + } + } + + foreach (var vm in LiquidsCalibrationData) + { + InputLiquid inputLiquid = new InputLiquid(); + + + CalibrationData calData = new CalibrationData(); + calData.LiquidType = (PMR.ColorLab.LiquidType)vm.LiquidType.Code; + calData.CalibrationPoints.AddRange(vm.CalibrationPoints.Select(x => new CalibrationPoint() { X = x.X, Y = x.Y })); + + inputLiquid.CalibrationData = calData; + + inputLiquid.LiquidType = (PMR.ColorLab.LiquidType)vm.LiquidType.Code; + inputLiquid.MaxNanoliterPerCentimeter = LiquidTypesRmls.SingleOrDefault(x => x.LiquidType.Code == vm.LiquidType.Code).MaxNlPerCm; + + input.InputCoordinates.InputLiquids.Add(inputLiquid); + } + + foreach (var process in RML.GetActiveProcessGroup().ProcessParametersTables) + { + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = process.MinInkUptake, + MaxInkUptake = process.MaxInkUptake, + }); + } + + IColorConverter converter = new DefaultColorConverter(); + + var output = converter.Convert(input); + + IsOutOfGamut = output.OutOfGamut; + + HiveSuggestions = output.CreateHiveSuggestions(); + } + catch (Exception ex) + { + LogManager.Log(ex, "An error occurred while trying to convert from source color to Volume."); + + InvokeUI(() => + { + _notification.ShowError($"An error occurred while trying to convert from source color to Volume.\n" + ex.Message); + }); + } + }); + } + + private void OnSelectedSuggestionChanged() + { + if (SelectedSuggestion != null) + { + _prevent_inverse_conversion = true; + + var coords = SelectedSuggestion.Coordinates; + + foreach (var liquid in coords.OutputLiquids) + { + var liquidVolume = LiquidVolumes.SingleOrDefault(x => x.LiquidType.Code == liquid.LiquidType.ToInt32()); + + if (liquidVolume != null) + { + liquidVolume.Volume = liquid.Volume; + } + } + + _prevent_inverse_conversion = false; + + OnLiquidVolumeChanged(); + } + } + + private void OnLiquidVolumeChanged() + { + try + { + if (LiquidsCalibrationData == null || _prevent_inverse_conversion) return; + + //TODO: This is temporary because of out of range volumes. + if (LiquidVolumes.Where(x => x.LiquidType.HasPigment).Sum(x => x.Volume) > 200) + { + IsVolumesOutOfRange = true; + return; + } + else + { + IsVolumesOutOfRange = false; + } + + ConversionInput input = new ConversionInput(); + input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; + input.ForwardData = ByteString.CopyFrom(CCT.Data); + + input.InputCoordinates = new InputCoordinates(); + input.ThreadL = RML.WhitePointL; + input.ThreadA = RML.WhitePointA; + input.ThreadB = RML.WhitePointB; + + foreach (var vm in LiquidsCalibrationData.Where(x => x.LiquidType.HasPigment)) + { + InputLiquid inputLiquid = new InputLiquid(); + + CalibrationData calData = new CalibrationData(); + calData.LiquidType = (PMR.ColorLab.LiquidType)vm.LiquidType.Code; + calData.CalibrationPoints.AddRange(vm.CalibrationPoints.Select(x => new CalibrationPoint() { X = x.X, Y = x.Y })); + + inputLiquid.CalibrationData = calData; + + inputLiquid.LiquidType = (PMR.ColorLab.LiquidType)vm.LiquidType.Code; + inputLiquid.MaxNanoliterPerCentimeter = LiquidTypesRmls.SingleOrDefault(x => x.LiquidType.Code == vm.LiquidType.Code).MaxNlPerCm; + inputLiquid.Volume = LiquidVolumes.SingleOrDefault(x => x.LiquidType == vm.LiquidType).Volume; + + input.InputCoordinates.InputLiquids.Add(inputLiquid); + } + + foreach (var process in RML.ProcessParametersTablesGroups.Single().ProcessParametersTables) + { + input.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = process.MinInkUptake, + MaxInkUptake = process.MaxInkUptake, + }); + } + + IColorConverter converter = new DefaultColorConverter(); + + var output = converter.Convert(input); + + if (SourceColor.IsLab) + { + TargetColor = new RgbVM() + { + IsLab = true, + L = output.SingleCoordinates.L, + A = output.SingleCoordinates.A, + B = output.SingleCoordinates.B, + }; + } + else + { + TargetColor = new RgbVM() + { + Red = output.SingleCoordinates.Red, + Green = output.SingleCoordinates.Green, + Blue = output.SingleCoordinates.Blue, + }; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error in inversed color conversion!"); + _notification.ShowError("An error occurred while trying to convert from Volume to RGB.\n" + ex.Message); + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/LiquidVolumeVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/LiquidVolumeVM.cs new file mode 100644 index 000000000..7399d62af --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/LiquidVolumeVM.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core; +using Tango.SharedUI; + +namespace Tango.MachineStudio.RML.ViewModels +{ + public class LiquidVolumeVM : ExtendedObject + { + public event EventHandler<double> VolumeChanged; + + private String _name; + + public String Name + { + get { return _name; } + set { _name = value; RaisePropertyChangedAuto(); } + } + + private double _volume; + + public double Volume + { + get { return _volume; } + set + { + _volume = value; RaisePropertyChangedAuto(); + VolumeChanged?.Invoke(this, _volume); + } + } + + private int _color; + + public int Color + { + get { return _color; } + set { _color = value; RaisePropertyChangedAuto(); } + } + + private LiquidType _liquidType; + public LiquidType LiquidType + { + get { return _liquidType; } + set { _liquidType = value; RaisePropertyChangedAuto(); } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index ebcfe72fd..361608ef6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -12,12 +13,13 @@ using Tango.BL.Builders; using Tango.BL.Calibration; using Tango.BL.Entities; using Tango.Core.Commands; -using Tango.MachineStudio.ColorLab.ViewModels; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.RML.Contracts; +using Tango.MachineStudio.RML.Models; using Tango.MachineStudio.RML.Views; using Tango.PMR.ColorLab; +using System.Data.Entity; namespace Tango.MachineStudio.RML.ViewModels { @@ -119,6 +121,26 @@ namespace Tango.MachineStudio.RML.ViewModels set { _activeProcessParametersTableView = value; RaisePropertyChangedAuto(); } } + private ObservableCollection<CctModel> _ccts; + public ObservableCollection<CctModel> CCTS + { + get { return _ccts; } + set { _ccts = value; RaisePropertyChangedAuto(); } + } + + private CctModel _selectedCCT; + public CctModel SelectedCCT + { + get { return _selectedCCT; } + set { _selectedCCT = value; RaisePropertyChangedAuto(); OnSelectedCCTChanged(); InvalidateRelayCommands(); } + } + + private ColorConversionViewVM _colorConversionViewVM; + public ColorConversionViewVM ColorConversionViewVM + { + get { return _colorConversionViewVM; } + set { _colorConversionViewVM = value; RaisePropertyChangedAuto(); } + } /// <summary> /// Gets or sets the manage RML command. @@ -135,6 +157,10 @@ namespace Tango.MachineStudio.RML.ViewModels /// </summary> public RelayCommand RemoveRmlCommand { get; set; } + public RelayCommand ImportForwardDataCommand { get; set; } + + public RelayCommand ExportForwardDataCommand { get; set; } + public RelayCommand AddProcessParametersTableCommand { get; set; } public RelayCommand<ProcessParametersTable> RemoveProcessParametersTableCommand { get; set; } @@ -165,6 +191,10 @@ namespace Tango.MachineStudio.RML.ViewModels RemoveLiquidFactorCommand = new RelayCommand<LiquidTypesRml>(RemoveLiquidFactor, () => IsFree); CreateCalibrationDataExcelTemplateCommand = new RelayCommand(CreateCalibrationDataExcelTemplate); SaveCommand = new RelayCommand(Save, () => IsFree); + + ImportForwardDataCommand = new RelayCommand(ImportCCTData, () => ActiveRML != null && IsFree); + + ExportForwardDataCommand = new RelayCommand(ExportCCTData, () => ActiveRML != null && SelectedCCT != null && IsFree); } public override void OnApplicationReady() @@ -193,14 +223,30 @@ namespace Tango.MachineStudio.RML.ViewModels _active_context = ObservablesContext.CreateDefault(); + CCTS = _active_context.Ccts + .Select(x => new CctModel() + { + Guid = x.Guid, + FileName = x.FileName, + + }).ToObservableCollection(); + + CCTS.Where(x => String.IsNullOrWhiteSpace(x.FileName)).ToList().ForEach(x => x.FileName = x.Guid); + LoadRmlProperties(); ActiveRML = await new RmlBuilder(_active_context) .Set(guid) .WithActiveParametersGroup() .WithLiquidFactors() + .WithCCT() .BuildAsync(); + if (ActiveRML.Cct != null) + { + SelectedCCT = CCTS.SingleOrDefault(x => x.Guid == ActiveRML.Cct.Guid); + } + if (ActiveRML.ProcessParametersTablesGroups.ToList().Count == 0) { if (!_notification.ShowQuestion("Could not find any process group for the selected RML. Would you like to create one?")) @@ -248,13 +294,43 @@ namespace Tango.MachineStudio.RML.ViewModels CalibrationDataViewVM.LiquidsCalibrationData.Add(catVM); } + ColorConversionViewVM = new ColorConversionViewVM(_notification) + { + RML = ActiveRML, + CCT = SelectedCCT, + LiquidsCalibrationData = CalibrationDataViewVM.LiquidsCalibrationData, + LiquidTypesRmls = LiquidTypesRmls, + }; View.NavigateTo(RmlNavigationView.RmlView); + InvalidateRelayCommands(); + IsFree = true; } } + private async void OnSelectedCCTChanged() + { + if (SelectedCCT != null && !SelectedCCT.IsNew) + { + using (_notification.PushTaskItem("Loading CCT data...")) + { + IsFree = false; + + var cct = await _active_context.Ccts.SingleOrDefaultAsync(x => x.Guid == SelectedCCT.Guid); + + if (cct != null) + { + SelectedCCT.Data = cct.Data; + ColorConversionViewVM.CCT = SelectedCCT; + } + + IsFree = true; + } + } + } + private void LoadRmlProperties() { Materials = _active_context.MediaMaterials.ToObservableCollection(); @@ -472,6 +548,23 @@ namespace Tango.MachineStudio.RML.ViewModels ActiveRML.LastUpdated = DateTime.UtcNow; + if (SelectedCCT != null) + { + if (SelectedCCT.IsNew) + { + Cct cct = new Cct(); + cct.Guid = SelectedCCT.Guid; + cct.FileName = SelectedCCT.FileName; + cct.Data = SelectedCCT.Data; + ActiveRML.Cct = cct; + SelectedCCT.IsNew = false; + } + else + { + ActiveRML.CctGuid = SelectedCCT.Guid; + } + } + await _active_context.SaveChangesAsync(); } } @@ -491,5 +584,97 @@ namespace Tango.MachineStudio.RML.ViewModels View.NavigateTo(RmlNavigationView.RmlsView); LoadRmls(); } + + #region Import / Export Color Conversion Data + + private void ImportCCTData() + { + String file = GetCCTFileOpen(); + if (file != null) + { + CctModel cctModel = new CctModel(); + cctModel.Guid = Guid.NewGuid().ToString(); + cctModel.IsNew = true; + + cctModel.FileName = Path.GetFileName(file); + cctModel.Data = File.ReadAllBytes(file); + + CCTS.Insert(0, cctModel); + SelectedCCT = cctModel; + + ColorConversionViewVM.CCT = SelectedCCT; + } + } + + private void ExportCCTData() + { + if (SelectedCCT != null) + { + String file = GetCCTFileSave(ActiveRML.Cct.FileName); + if (file != null) + { + using (_notification.PushTaskItem("Exporting CCT file...")) + { + try + { + IsFree = false; + + if (SelectedCCT.IsNew) + { + File.WriteAllBytes(file, SelectedCCT.Data); + } + else + { + var cct = _active_context.Ccts.SingleOrDefault(x => x.Guid == SelectedCCT.Guid); + + if (cct != null) + { + File.WriteAllBytes(file, cct.Data); + } + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error exporting CCT file."); + _notification.ShowError($"An error occurred while trying to export the CCT file.\n{ex.Message}"); + } + finally + { + IsFree = true; + } + } + } + } + } + + private String GetCCTFileOpen() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Title = "Select color adjustment file"; + dlg.Filter = "Color Conversion Table|*.cct"; + if (dlg.ShowDialogCenter()) + { + return dlg.FileName; + } + + return null; + } + + private String GetCCTFileSave(String fileName) + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Title = "Select color adjustment file"; + dlg.Filter = "Color Conversion Table|*.cct"; + dlg.FileName = fileName; + dlg.DefaultExt = ".cct"; + if (dlg.ShowDialogCenter()) + { + return dlg.FileName; + } + + return null; + } + + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs new file mode 100644 index 000000000..e64592aae --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/RgbVM.cs @@ -0,0 +1,148 @@ +using ColorMine.ColorSpaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using System.Windows.Threading; +using Tango.Core; +using Tango.SharedUI; + +namespace Tango.MachineStudio.RML.ViewModels +{ + public class RgbVM : ExtendedObject + { + private DispatcherTimer _color_change_timer; + + public event EventHandler<Color> ColorChanged; + + public RgbVM() + { + _color_change_timer = new DispatcherTimer(); + _color_change_timer.Interval = TimeSpan.FromMilliseconds(30); + _color_change_timer.Tick += _color_change_timer_Tick; + _color_change_timer.Stop(); + + Color = Colors.DimGray; + } + + private void _color_change_timer_Tick(object sender, EventArgs e) + { + _color_change_timer.Stop(); + ColorChanged?.Invoke(this, Color); + } + + private double _red; + public double Red + { + get { return _red; } + set { _red = value; SynchronizeColor(); RaisePropertyChangedAuto(); } + } + + private double _green; + public double Green + { + get { return _green; } + set { _green = value; SynchronizeColor(); RaisePropertyChangedAuto(); } + } + + private double _blue; + public double Blue + { + get { return _blue; } + set { _blue = value; SynchronizeColor(); RaisePropertyChangedAuto(); } + } + + private double _l; + public double L + { + get { return _l; } + set { _l = value; SynchronizeColor(); RaisePropertyChangedAuto(); } + } + + private double _a; + public double A + { + get { return _a; } + set { _a = value; SynchronizeColor(); RaisePropertyChangedAuto(); } + } + + private double _b; + public double B + { + get { return _b; } + set { _b = value; SynchronizeColor(); RaisePropertyChangedAuto(); } + } + + private Color _color; + public Color Color + { + get { return _color; } + set { _color = value; RaisePropertyChanged(nameof(Color)); SynchronizeComponents(); } + } + + private bool _isLab; + public bool IsLab + { + get { return _isLab; } + set { _isLab = value; RaisePropertyChangedAuto(); } + } + + + private void SynchronizeColor() + { + _color_change_timer.Stop(); + + if (!IsLab) + { + Rgb rgb = new Rgb(Red, Green, Blue); + Lab lab = rgb.To<Lab>(); + _l = lab.L; + _a = lab.A; + _b = lab.B; + } + else + { + Lab lab = new Lab(L, A, B); + Rgb rgb = lab.To<Rgb>(); + _red = rgb.R; + _green = rgb.G; + _blue = rgb.B; + } + + _color = Color.FromRgb((byte)Red, (byte)Green, (byte)Blue); + RaisePropertyChanged(nameof(Color)); + + _color_change_timer.Start(); + } + + private void SynchronizeComponents() + { + _color_change_timer.Stop(); + + _red = Color.R; + _green = Color.G; + _blue = Color.B; + + if (IsLab) + { + Rgb rgb = new Rgb(Red, Green, Blue); + Lab lab = rgb.To<Lab>(); + _l = lab.L; + _a = lab.A; + _b = lab.B; + } + + RaisePropertyChanged(nameof(Red)); + RaisePropertyChanged(nameof(Green)); + RaisePropertyChanged(nameof(Blue)); + RaisePropertyChanged(nameof(L)); + RaisePropertyChanged(nameof(A)); + RaisePropertyChanged(nameof(B)); + RaisePropertyChanged(nameof(Color)); + + _color_change_timer.Start(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml index 6d9b68edb..426a56f51 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml @@ -27,7 +27,7 @@ <Grid> <StackPanel VerticalAlignment="Top" Margin="0 30 0 0"> <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Kind="Plus" VerticalAlignment="Top" Width="50" Height="50" Foreground="#08B008" /> + <materialDesign:PackIcon Kind="Plus" VerticalAlignment="Top" Width="50" Height="50" Foreground="{StaticResource GreenBrush100}" /> <TextBlock Padding="0 10 0 0" TextWrapping="Wrap" Margin="10 0 0 0" VerticalAlignment="Top" FontSize="14" Text="ADD LIQUID FACTOR" Width="400"></TextBlock> </StackPanel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml new file mode 100644 index 000000000..54e96017c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml @@ -0,0 +1,72 @@ +<UserControl x:Class="Tango.MachineStudio.RML.Views.CalibrationDataView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.MachineStudio.RML.Views" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:CalibrationDataViewVM, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + <converters:ColorComponentToOpacityConverter x:Key="ColorComponentToOpacityConverter" /> + <converters:ColorToComponentsConverter x:Key="ColorToComponentsConverter" /> + </UserControl.Resources> + + <Grid> + <ItemsControl DockPanel.Dock="Top" ItemsSource="{Binding LiquidsCalibrationData}" IsEnabled="{Binding IsFree}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Rows="1" /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel Width="240"> + + <StackPanel DockPanel.Dock="Top"> + + <StackPanel DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" Margin="0 0 5 0"> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Import from excel" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=local:CalibrationDataView},Path=DataContext.ImportExcelCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="Download" Foreground="{StaticResource BlackForegroundBrush}" /> + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Export to excel" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=local:CalibrationDataView},Path=DataContext.ExportExcelCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="Upload" Foreground="{StaticResource BlackForegroundBrush}" /> + </Button> + </StackPanel> + <Border Padding="2" Margin="5" CornerRadius="3"> + <Border.Background> + <SolidColorBrush Opacity="0.4" Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Border.Background> + <TextBlock Text="{Binding LiquidType.Name}" HorizontalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock> + </Border> + </StackPanel> + + <Grid Margin="0 0 0 5"> + <DataGrid Background="{StaticResource TransparentBackgroundBrush400}" AlternatingRowBackground="{StaticResource Transparent200}" BorderThickness="1" BorderBrush="{StaticResource DarkGrayBrush}" Margin="5 0" ItemsSource="{Binding CalibrationPoints}" CanUserResizeColumns="False" CanUserReorderColumns="False" AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True" CanUserSortColumns="False"> + <DataGrid.CellStyle> + <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="HorizontalContentAlignment" Value="Left"></Setter> + <Setter Property="FlowDirection" Value="RightToLeft"></Setter> + <Setter Property="Foreground" Value="{StaticResource BlackForegroundBrush}"></Setter> + </Style> + </DataGrid.CellStyle> + <DataGrid.Columns> + <DataGridTextColumn Header="#" Binding="{Binding Index}" Width="Auto" IsReadOnly="True" Foreground="{StaticResource DimGrayBrush}" FontSize="11" /> + <mahapps:DataGridNumericUpDownColumn Header="X" Binding="{Binding X}" Minimum="0" Maximum="10000" HideUpDownButtons="True" Width="1*"/> + <mahapps:DataGridNumericUpDownColumn Header="Y" Binding="{Binding Y}" Minimum="0" Maximum="10000" HideUpDownButtons="True" Width="1*" /> + </DataGrid.Columns> + </DataGrid> + </Grid> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.xaml.cs new file mode 100644 index 000000000..e23e343a4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/CalibrationDataView.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.MachineStudio.RML.Views +{ + /// <summary> + /// Interaction logic for CalibrationDataView.xaml + /// </summary> + public partial class CalibrationDataView : UserControl + { + public CalibrationDataView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml new file mode 100644 index 000000000..ed27c1760 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml @@ -0,0 +1,772 @@ +<UserControl x:Class="Tango.MachineStudio.RML.Views.ColorConversionView" + 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.MachineStudio.RML.Views" + xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels" + xmlns:global="clr-namespace:Tango.MachineStudio.RML" + xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:brushPicker="clr-namespace:Tango.BrushPicker;assembly=Tango.BrushPicker" + xmlns:colorConversion="clr-namespace:Tango.ColorConversion;assembly=Tango.ColorConversion" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + <converters:ColorComponentToOpacityConverter x:Key="ColorComponentToOpacityConverter" /> + <converters:ColorToComponentsConverter x:Key="ColorToComponentsConverter" /> + <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter" /> + <converters:ObjectToObjectTypeConverter x:Key="ObjectToObjectTypeConverter" /> + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + <converters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> + <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" /> + </UserControl.Resources> + <Grid> + <DockPanel> + <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> + <Border.Effect> + <DropShadowEffect Opacity="0.4" /> + </Border.Effect> + <Grid> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">COLOR CONVERSION</TextBlock> + </Grid> + </Border> + <Grid DockPanel.Dock="Top" x:Name="ColorCalibrationGrid" Margin="80,20,20,20"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="250" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="1*" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="20" /> + <RowDefinition/> + <RowDefinition Height="30" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid.Resources> + <Style TargetType="TextBlock" > + <Setter Property="Foreground" Value="{StaticResource JobFieldForeground}"/> + </Style> + </Grid.Resources> + + <Grid Grid.Row="1"> + + <StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-60 35 0 0"> + <RadioButton IsChecked="{Binding SourceColor.IsLab,Converter={StaticResource BooleanInverseConverter}}">RGB</RadioButton> + <RadioButton Margin="0 10 0 0" IsChecked="{Binding SourceColor.IsLab}">LAB</RadioButton> + </StackPanel> + + <StackPanel VerticalAlignment="Center"> + <StackPanel Height="20"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 5" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Color is out of gamut</TextBlock> + </StackPanel> + </StackPanel> + <Border BorderThickness="1" BorderBrush="#545454" Margin="0" Padding="2 2 2 0"> + <brushPicker:BrushPicker x:Name="picker" Color="{Binding SourceColor.Color,Mode=TwoWay}" Background="Transparent" BorderThickness="0" Height="150" BrushTypeVisibility="Collapsed"></brushPicker:BrushPicker> + </Border> + + <Grid> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="R" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Red}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Red,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="G" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Green}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Green,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="B" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Blue}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Blue,Mode=TwoWay}"></Slider> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + + <Style.Triggers> + <DataTrigger Binding="{Binding SourceColor.IsLab}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="L" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="100" Width="30" Value="{Binding SourceColor.L}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="0" Maximum="100" Value="{Binding SourceColor.L,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="A" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="-128" Maximum="128" Width="30" Value="{Binding SourceColor.A}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="-128" Maximum="128" Value="{Binding SourceColor.A,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="B" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="-128" Maximum="128" Width="30" Value="{Binding SourceColor.B}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="-128" Maximum="128" Value="{Binding SourceColor.B,Mode=TwoWay}"></Slider> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </Grid> + </StackPanel> + </Grid> + + <TextBlock FontStyle="Italic" HorizontalAlignment="Center">SOURCE / INVERSE</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="2" Margin="0 0 0 0">SUGGESTIONS</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="4" Margin="-80 0 0 0">LIQUID VOLUMES</TextBlock> + + <Image Source="../Images/arrow-long-right.png" Grid.Column="1" Grid.Row="1" Width="120" Stretch="Fill" Height="30" Opacity="0.8" Margin="20 0 20 0"></Image> + + <hive:HexList Width="220" Height="270" UseHexItemHasContainer="True" Grid.Column="2" Grid.Row="1" RowCount="6" ColumnCount="5" ItemsSource="{Binding HiveSuggestions}" SelectedItem="{Binding SelectedSuggestion,Mode=TwoWay}"> + <hive:HexList.ItemContainerStyle> + <Style TargetType="hive:HexItem" BasedOn="{StaticResource {x:Type hive:HexItem}}"> + <Setter Property="Background" Value="{Binding Brush}"></Setter> + <Setter Property="Grid.Column" Value="0"></Setter> + <Setter Property="Grid.Row" Value="0"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=DataContext,Converter={StaticResource ObjectToObjectTypeConverter}}" Value="{x:Type colorConversion:ColorConversionSuggestion}"> + <Setter Property="Grid.Column" Value="{Binding Column}"></Setter> + <Setter Property="Grid.Row" Value="{Binding Row}"></Setter> + <Setter Property="Background" Value="{Binding Brush}"></Setter> + </DataTrigger> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="BorderThickness" Value="2"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </hive:HexList.ItemContainerStyle> + + <hive:HexList.ItemTemplate> + <DataTemplate> + <TextBlock Foreground="{StaticResource WhiteTextBrush}"> + <Run Text="{Binding Row}"></Run><Run>,</Run> + <Run Text="{Binding Column}"/> + </TextBlock> + </DataTemplate> + </hive:HexList.ItemTemplate> + </hive:HexList> + + <TextBlock FontSize="40" Foreground="{StaticResource RedBrush100}" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="2" Grid.Row="1" Text="NO INPUT"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding HiveSuggestions.Count}" Value="0"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + + <Image Source="../Images/arrow-long-right.png" Grid.Column="3" Grid.Row="1" Width="120" Stretch="Fill" Height="30" Opacity="0.8" Margin="20 0 20 0"></Image> + + <Grid Grid.Column="4" Grid.Row="1" IsHitTestVisible="False"> + <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -20 0 0"> + <StackPanel Orientation="Horizontal" Height="60"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding SelectedSuggestion.Coordinates.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding SelectedSuggestion.Coordinates.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding SelectedSuggestion.Coordinates.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420" > + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <!--<mahapps:NumericUpDown.Resources> + <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> + </mahapps:NumericUpDown.Resources>--> + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <Image Source="../Images/arrow-long-down.png" Grid.Column="1" Grid.Row="1" Margin="0 0 10 -170" Height="70" Width="40" Opacity="0.8" Stretch="Fill" HorizontalAlignment="Right" ></Image> + + <TextBlock FontSize="14" FontWeight="SemiBold" FontStyle="Italic" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 15"> + <Run>GAMUT REGION:</Run> + <Run Text="{Binding SelectedSuggestion.ProcessParametersTableIndex,Mode=OneWay}"></Run> + </TextBlock> + </Grid> + + + <StackPanel Grid.Column="4" Grid.Row="3"> + <StackPanel Height="25" Margin="25 0 0 0"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 0" Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Liquid volumes exceeds the maximum range</TextBlock> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420" IsEnabled="{Binding IsFree}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <!--<mahapps:NumericUpDown.Resources> + <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> + </mahapps:NumericUpDown.Resources>--> + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + + + <Image Source="../Images/arrow-long-Left.png" Grid.Column="2" Grid.Row="3" Width="140" Stretch="Fill" Height="30" Opacity="0.8"></Image> + + <Border BorderBrush="{StaticResource borderBrush}" Grid.Row="3"> + <Grid> + <DockPanel Width="80" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">COMPOSITE</TextBlock> + <Grid> + <Ellipse Height="70" Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Ellipse.Fill> + <SolidColorBrush Color="{Binding TargetColor.Color}"></SolidColorBrush> + </Ellipse.Fill> + </Ellipse> + <materialDesign:PackIcon Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}" Kind="Alert" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Width="24" Height="24" /> + </Grid> + </DockPanel> + + <StackPanel HorizontalAlignment="Right"> + <StackPanel Orientation="Horizontal" Height="60"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding TargetColor.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding TargetColor.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding TargetColor.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + </StackPanel> + </Grid> + </Border> + </Grid> + + <!--<Grid Margin="80,20,20,20" DockPanel.Dock="Top" x:Name="ColorCalibrationGrid"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="250" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="1*" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="20" /> + <RowDefinition /> + <RowDefinition Height="30" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid.Resources> + <Style TargetType="TextBlock" > + <Setter Property="Foreground" Value="{StaticResource JobFieldForeground}"/> + </Style> + </Grid.Resources> + + <Grid Grid.Row="1"> + + <StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-70 15 0 0"> + <RadioButton IsChecked="{Binding SourceColor.IsLab,Converter={StaticResource BooleanInverseConverter}}">RGB</RadioButton> + <RadioButton Margin="0 10 0 0" IsChecked="{Binding SourceColor.IsLab}">LAB</RadioButton> + </StackPanel> + + <StackPanel VerticalAlignment="Center"> + <StackPanel Height="20"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 5" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Color is out of gamut</TextBlock> + </StackPanel> + </StackPanel> + <Border BorderThickness="1" BorderBrush="#545454" Margin="0" Padding="2 2 2 0"> + <brushPicker:BrushPicker x:Name="picker" Color="{Binding SourceColor.Color,Mode=TwoWay}" Background="Transparent" BorderThickness="0" Height="150" BrushTypeVisibility="Collapsed"></brushPicker:BrushPicker> + </Border> + + <Grid> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="R" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Red}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Red,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="G" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Green}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Green,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="B" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="255" Width="30" Value="{Binding SourceColor.Blue}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding SourceColor.Blue,Mode=TwoWay}"></Slider> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + + <Style.Triggers> + <DataTrigger Binding="{Binding SourceColor.IsLab}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="L" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="0" Maximum="100" Width="30" Value="{Binding SourceColor.L}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="0" Maximum="100" Value="{Binding SourceColor.L,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="A" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="-128" Maximum="128" Width="30" Value="{Binding SourceColor.A}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="-128" Maximum="128" Value="{Binding SourceColor.A,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel Margin="0 10 0 0"> + <TextBlock DockPanel.Dock="Left" Text="B" VerticalAlignment="Center" /> + <mahapps:NumericUpDown DockPanel.Dock="Right" HideUpDownButtons="True" StringFormat="0.00" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Center" Minimum="-128" Maximum="128" Width="30" Value="{Binding SourceColor.B}"></mahapps:NumericUpDown> + <Slider Margin="10 0" IsSnapToTickEnabled="True" TickFrequency="1" Minimum="-128" Maximum="128" Value="{Binding SourceColor.B,Mode=TwoWay}"></Slider> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </Grid> + </StackPanel> + </Grid> + + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="0">SOURCE / INVERSE</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="2" Margin="0 0 0 0">SUGGESTIONS</TextBlock> + <TextBlock FontStyle="Italic" HorizontalAlignment="Center" Grid.Column="4" Margin="-80 0 0 0">LIQUID VOLUMES</TextBlock> + + <Image Source="../Images/arrow-long-right.png" Grid.Column="1" Grid.Row="1" Width="100" Stretch="Fill" Height="30" Opacity="0.8" Margin="10 0 20 0"></Image> + + <hive:HexList Width="220" Height="270" UseHexItemHasContainer="True" Grid.Column="2" Grid.Row="1" RowCount="6" ColumnCount="5" ItemsSource="{Binding HiveSuggestions}" SelectedItem="{Binding SelectedSuggestion,Mode=TwoWay}"> + <hive:HexList.ItemContainerStyle> + <Style TargetType="hive:HexItem" BasedOn="{StaticResource {x:Type hive:HexItem}}"> + <Setter Property="Background" Value="{Binding Brush}"></Setter> + <Setter Property="Grid.Column" Value="0"></Setter> + <Setter Property="Grid.Row" Value="0"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=DataContext,Converter={StaticResource ObjectToObjectTypeConverter}}" Value="{x:Type colorConversion:ColorConversionSuggestion}"> + <Setter Property="Grid.Column" Value="{Binding Column}"></Setter> + <Setter Property="Grid.Row" Value="{Binding Row}"></Setter> + <Setter Property="Background" Value="{Binding Brush}"></Setter> + </DataTrigger> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="BorderThickness" Value="2"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </hive:HexList.ItemContainerStyle> + + <hive:HexList.ItemTemplate> + <DataTemplate> + <TextBlock Foreground="{StaticResource WhiteTextBrush}"> + <Run Text="{Binding Row}"></Run><Run>,</Run> + <Run Text="{Binding Column}"/> + </TextBlock> + </DataTemplate> + </hive:HexList.ItemTemplate> + </hive:HexList> + + <TextBlock FontSize="40" Foreground="{StaticResource RedBrush100}" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="2" Grid.Row="1" Text="NO INPUT"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding HiveSuggestions.Count}" Value="0"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + + <Image Source="../Images/arrow-long-right.png" Grid.Column="3" Grid.Row="1" Width="100" Stretch="Fill" Height="30" Opacity="0.8" Margin="10 0 20 0"></Image> + + <Grid Grid.Column="4" Grid.Row="1" IsHitTestVisible="False"> + <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 0 0 0"> + <StackPanel Orientation="Horizontal" Height="50"> + <DockPanel Width="40" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding SelectedSuggestion.Coordinates.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="40" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding SelectedSuggestion.Coordinates.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="40" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding SelectedSuggestion.Coordinates.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="40" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="40" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="40" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="#202020"/> + <TextBlock Text="{Binding SelectedSuggestion.Coordinates.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="320" > + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <Image Source="../Images/arrow-long-down.png" Grid.Column="1" Grid.Row="1" Margin="0 0 10 -170" Height="70" Width="40" Opacity="0.8" Stretch="Fill" HorizontalAlignment="Right" ></Image> + + <TextBlock FontSize="14" FontWeight="SemiBold" FontStyle="Italic" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 15"> + <Run>GAMUT REGION:</Run> + <Run Text="{Binding SelectedSuggestion.ProcessParametersTableIndex,Mode=OneWay}"></Run> + </TextBlock> + </Grid> + + + <StackPanel Grid.Column="4" Grid.Row="3"> + <StackPanel Height="25" Margin="25 0 0 0"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 0" Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource RedBrush100}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource RedBrush100}">Liquid volumes exceeds the maximum range</TextBlock> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420" IsEnabled="{Binding IsFree}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + + + <Image Source="../Images/arrow-long-Left.png" Grid.Column="2" Grid.Row="3" Width="120" Stretch="Fill" Height="30" Opacity="0.8"></Image> + + <Border BorderBrush="{StaticResource borderBrush}" Grid.Row="3"> + <Grid> + <DockPanel Width="80" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">COMPOSITE</TextBlock> + <Grid> + <Ellipse Height="70" Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Ellipse.Fill> + <SolidColorBrush Color="{Binding TargetColor.Color}"></SolidColorBrush> + </Ellipse.Fill> + </Ellipse> + <materialDesign:PackIcon Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}" Kind="Alert" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Width="24" Height="24" /> + </Grid> + </DockPanel> + + <StackPanel HorizontalAlignment="Right"> + <StackPanel Orientation="Horizontal" Height="60"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">R</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Red" Opacity="{Binding TargetColor.Red,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Red}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">G</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Green" Opacity="{Binding TargetColor.Green,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Green}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"> + <Rectangle.Fill> + <SolidColorBrush Color="Blue" Opacity="{Binding TargetColor.Blue,Converter={StaticResource ColorComponentToOpacityConverter}}" /> + </Rectangle.Fill> + </Rectangle> + <TextBlock Text="{Binding TargetColor.Blue}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + <StackPanel Orientation="Horizontal" Height="40" Margin="0 5 0 0"> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">L</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.L,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left" Margin="0 0 5 0"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">A</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.A,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + <DockPanel Width="50" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">B</TextBlock> + + <Grid> + <Rectangle Margin="0 5 0 0" Stroke="{StaticResource DarkGrayBrush}"/> + <TextBlock Text="{Binding TargetColor.B,StringFormat='0.00'}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource BlackForegroundBrush}"></TextBlock> + </Grid> + </DockPanel> + </StackPanel> + </StackPanel> + </Grid> + </Border> + </Grid>--> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.xaml.cs new file mode 100644 index 000000000..8b6955269 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ColorConversionView.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.MachineStudio.RML.Views +{ + /// <summary> + /// Interaction logic for ColorConversionView.xaml + /// </summary> + public partial class ColorConversionView : UserControl + { + public ColorConversionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml new file mode 100644 index 000000000..b85fd2c12 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml @@ -0,0 +1,155 @@ +<UserControl x:Class="Tango.MachineStudio.RML.Views.ProcessParametersView" + 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.MachineStudio.RML" + xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" + xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels" + xmlns:local="clr-namespace:Tango.MachineStudio.RML.Views" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + + <UserControl.Resources> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + </UserControl.Resources> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="416*"/> + <RowDefinition Height="120"/> + </Grid.RowDefinitions> + <Grid Grid.Row="0"> + <DockPanel> + <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> + <Border.Effect> + <DropShadowEffect Opacity="0.4" /> + </Border.Effect> + <Grid> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">ACTIVE PROCESS GROUP</TextBlock> + <Button ToolTip="Add new table" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Width="30" HorizontalAlignment="Right" Padding="0" Command="{Binding AddProcessParametersTableCommand}"> + <materialDesign:PackIcon Kind="Plus" Foreground="#0AC30A" Width="24" Height="24" /> + </Button> + </Grid> + </Border> + <Grid> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 20"> + <ItemsControl ItemsSource="{Binding ActiveProcessParametersTableView}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel> + <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" VerticalAlignment="Bottom" ToolTip="Remove table" Width="30" Margin="10 0 0 10" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveProcessParametersTableCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="Delete" Width="24" Height="24" Foreground="#FF7D7D" /> + </Button> + + <Grid Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessTableDropped"> + <Border Padding="5" BorderThickness="1" Margin="20 5 0 5" BorderBrush="{StaticResource DarkGrayBrush}" Background="{StaticResource TransparentBackgroundBrush100}"> + <Grid> + <DockPanel Width="300"> + <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox> + + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="5"> + <editors:ParameterizedEditor ParameterizedObject="{Binding}"> + <editors:ParameterizedEditor.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel IsItemsHost="True" /> + </ItemsPanelTemplate> + </editors:ParameterizedEditor.ItemsPanel> + <editors:ParameterizedEditor.DoubleTemplate> + <DataTemplate> + <DockPanel> + <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11"></TextBlock> + <mahapps:NumericUpDown HorizontalAlignment="Right" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Right" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> + </DockPanel> + </DataTemplate> + </editors:ParameterizedEditor.DoubleTemplate> + </editors:ParameterizedEditor> + </ScrollViewer> + </DockPanel> + </Grid> + </Border> + + <dragAndDrop:DragThumb Background="Transparent" Cursor="SizeAll" ToolTip="Drag and drop" Margin="0 3 -1 0" HorizontalAlignment="Right" VerticalAlignment="Top"> + <materialDesign:PackIcon HorizontalAlignment="Right" VerticalAlignment="Top" IsHitTestVisible="False" Kind="Drag" Width="32" Height="32" Background="Transparent" /> + </dragAndDrop:DragThumb> + </Grid> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + + <dragAndDrop:DraggingSurface x:Name="draggingSurface" ClipToBounds="True" /> + </Grid> + </DockPanel> + </Grid> + <Grid Grid.Row="1"> + <DockPanel> + <Grid> + <Grid Margin="0 0 0 0"> + <DockPanel> + <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> + <Border.Effect> + <DropShadowEffect Opacity="0.4" /> + </Border.Effect> + <Grid> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">LIQUID FACTORS</TextBlock> + + <Button ToolTip="Add new liquid factor" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Width="30" Padding="0" Command="{Binding AddLiquidFactorCommand}"> + <materialDesign:PackIcon Kind="Plus" Foreground="#0AC30A" Width="24" Height="24" /> + </Button> + </Grid> + </Border> + <ScrollViewer x:Name="liquidsFactorsScrollViewer" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden" Margin="15 0 20 0"> + <ItemsControl Width="{Binding WidthLilquidFactors, RelativeSource={RelativeSource AncestorType=UserControl}}" ItemsSource="{Binding LiquidTypesRmls}" Margin="0 10 0 0"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid IsItemsHost="True" Rows="1"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type observables:LiquidTypesRml}"> + <Grid Margin="20 0 20 0" MaxWidth="230"> + + <Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove liquid factor" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveLiquidFactorCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="Delete" Foreground="#FF7D7D" /> + </Button> + + <StackPanel Margin="0 0 10 0"> + <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="{StaticResource MainWindow.Foreground}" Text="{Binding LiquidType.Name}"></TextBlock> + <Grid Width="58" Height="48" Margin="0 5 0 0"> + <shapes:Hexagon StrokeThickness="1" Stroke="Gray"> + <shapes:Hexagon.Fill> + <LinearGradientBrush Opacity="0.7" > + <GradientStop Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"/> + <GradientStop Color="White" Offset="1"/> + </LinearGradientBrush> + </shapes:Hexagon.Fill> + </shapes:Hexagon> + + <TextBox Style="{x:Null}" Background="Transparent" Foreground="{StaticResource Hexagon.ForegroundBrush}" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontStyle="Italic"></TextBox> + </Grid> + </StackPanel> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + </DockPanel> + </Grid> + </Grid> + </DockPanel> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs new file mode 100644 index 000000000..a6d03ca0e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs @@ -0,0 +1,59 @@ +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; +using Tango.MachineStudio.RML.ViewModels; +using Tango.BL.Entities; +using Tango.DragAndDrop; + +namespace Tango.MachineStudio.RML.Views +{ + /// <summary> + /// Interaction logic for ProcessParametersView.xaml + /// </summary> + public partial class ProcessParametersView : UserControl + { + private MainViewVM _vm; + public DraggingSurface DraggingSurface + { + get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); } + set { SetValue(DraggingSurfaceProperty, value); } + } + public static readonly DependencyProperty DraggingSurfaceProperty = + DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(ProcessParametersView), new PropertyMetadata(null)); + + public double WidthLilquidFactors + { + get { return (double )GetValue(WidthLilquidFactorsProperty); } + set { SetValue(WidthLilquidFactorsProperty, value); } + } + + // Using a DependencyProperty as the backing store for WidthLilquidFactors. This enables animation, styling, binding, etc... + public static readonly DependencyProperty WidthLilquidFactorsProperty = + DependencyProperty.Register("WidthLilquidFactors", typeof(double ), typeof(ProcessParametersView), new PropertyMetadata(null)); + + + public ProcessParametersView() + { + InitializeComponent(); + DraggingSurface = draggingSurface; + Loaded += (_, __) => { _vm = DataContext as MainViewVM; }; + } + private void OnProcessTableDropped(object sender, DropEventArgs e) + { + ProcessParametersTable dragged = e.Draggable.DataContext as ProcessParametersTable; + ProcessParametersTable dropped = e.Droppable.DataContext as ProcessParametersTable; + _vm.OnProcessParametersTableDropped(dragged, dropped); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index 8f2c5d187..628b9e402 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -9,7 +9,6 @@ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" - xmlns:colorLabViews="clr-namespace:Tango.MachineStudio.ColorLab.Views;assembly=Tango.MachineStudio.ColorLab" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" @@ -27,7 +26,7 @@ <Grid DockPanel.Dock="Top"> <StackPanel Orientation="Horizontal"> <Button Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Command="{Binding BackToRmlsCommand}"> - <materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="#202020" ToolTip="Back to RML list" /> + <materialDesign:PackIcon Kind="ArrowLeft" Width="50" Height="50" Foreground="{StaticResource DarkGrayBrush200}" ToolTip="Back to RML list" /> </Button> <TextBlock Text="{Binding ActiveRML.Name}" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="34"></TextBlock> </StackPanel> @@ -67,9 +66,9 @@ <TextBlock Text="White Point:" ></TextBlock> <UniformGrid Columns="3"> - <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" HideUpDownButtons="True" Value="{Binding ActiveRML.WhitePointL}" HorizontalContentAlignment="Left" /> - <mahapps:NumericUpDown HasDecimals="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" HideUpDownButtons="True" Value="{Binding ActiveRML.WhitePointA}" HorizontalContentAlignment="Left" /> - <mahapps:NumericUpDown HasDecimals="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" HideUpDownButtons="True" Value="{Binding ActiveRML.WhitePointB}" HorizontalContentAlignment="Left" /> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" HideUpDownButtons="True" Value="{Binding ActiveRML.WhitePointL}" HorizontalContentAlignment="Left" BorderBrush="{StaticResource MainWindow.Foreground}" Foreground="{StaticResource MainWindow.Foreground}"/> + <mahapps:NumericUpDown HasDecimals="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" HideUpDownButtons="True" Value="{Binding ActiveRML.WhitePointA}" HorizontalContentAlignment="Left" BorderBrush="{StaticResource MainWindow.Foreground}" Foreground="{StaticResource MainWindow.Foreground}"/> + <mahapps:NumericUpDown HasDecimals="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" HideUpDownButtons="True" Value="{Binding ActiveRML.WhitePointB}" HorizontalContentAlignment="Left" BorderBrush="{StaticResource MainWindow.Foreground}" Foreground="{StaticResource MainWindow.Foreground}"/> </UniformGrid> <TextBlock Text="Purpose:" ></TextBlock> @@ -126,168 +125,94 @@ <Grid Grid.Column="2"> <Grid.RowDefinitions> - <RowDefinition Height="416*"/> - <RowDefinition Height="490"/> + <RowDefinition Height="536*"/> + <RowDefinition Height="370"/> </Grid.RowDefinitions> - - <Grid> - <DockPanel> - <Border DockPanel.Dock="Top" Background="#E9FFFFFF" Margin="20 0" Padding="5" CornerRadius="5"> - <Border.Effect> - <DropShadowEffect Opacity="0.4" /> - </Border.Effect> - <Grid> - <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">ACTIVE PROCESS GROUP</TextBlock> - <Button ToolTip="Add new table" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" Width="30" HorizontalAlignment="Right" Padding="0" Command="{Binding AddProcessParametersTableCommand}"> - <materialDesign:PackIcon Kind="Plus" Foreground="#0AC30A" Width="24" Height="24" /> - </Button> - </Grid> - </Border> - <Grid> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 20"> - <ItemsControl ItemsSource="{Binding ActiveProcessParametersTableView}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" /> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <DockPanel> - <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" VerticalAlignment="Bottom" ToolTip="Remove table" Width="30" Margin="10 0 0 10" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveProcessParametersTableCommand}" CommandParameter="{Binding}"> - <materialDesign:PackIcon Kind="Delete" Width="24" Height="24" Foreground="#FF7D7D" /> - </Button> - - <Grid Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessTableDropped"> - <Border Padding="5" BorderThickness="1" Margin="20 5 0 5" BorderBrush="#101010" Background="#B9FFFFFF"> - <Grid> - <DockPanel Width="300"> - <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox> - - <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="5"> - <editors:ParameterizedEditor ParameterizedObject="{Binding}"> - <editors:ParameterizedEditor.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel IsItemsHost="True" /> - </ItemsPanelTemplate> - </editors:ParameterizedEditor.ItemsPanel> - <editors:ParameterizedEditor.DoubleTemplate> - <DataTemplate> - <DockPanel> - <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11"></TextBlock> - <mahapps:NumericUpDown HorizontalAlignment="Right" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Right" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> - </DockPanel> - </DataTemplate> - </editors:ParameterizedEditor.DoubleTemplate> - </editors:ParameterizedEditor> - </ScrollViewer> - </DockPanel> - </Grid> - </Border> - - <dragAndDrop:DragThumb Background="Transparent" Cursor="SizeAll" ToolTip="Drag and drop" Margin="0 3 -1 0" HorizontalAlignment="Right" VerticalAlignment="Top"> - <materialDesign:PackIcon HorizontalAlignment="Right" VerticalAlignment="Top" IsHitTestVisible="False" Kind="Drag" Width="32" Height="32" Background="Transparent" /> - </dragAndDrop:DragThumb> - </Grid> - </DockPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </StackPanel> - - <dragAndDrop:DraggingSurface x:Name="draggingSurface" ClipToBounds="True" /> - </Grid> - </DockPanel> - </Grid> - - - <Grid Grid.Row="1"> - - <DockPanel> - + <Grid Grid.Row="0" IsEnabled="{Binding IsFree}"> + <TabControl Background="Transparent" Margin="0,-70,0,0" x:Name="processTabControl" Padding="0 25 0 0"> + <TabControl.Resources> + <Style TargetType="TabPanel"> + <Setter Property="HorizontalAlignment" Value="Center"/> + </Style> + <Style TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}"> + <Setter Property="Padding" Value="20,2"></Setter> + </Style> + </TabControl.Resources> + <TabItem Header="PROCESS PARAMETERS" Margin="-100 0 0 0 "> + <local:ProcessParametersView x:Name="processParametersView" WidthLilquidFactors="{Binding ElementName=calibrationDataView,Path=ActualWidth}"/> + </TabItem> + <TabItem Header="COLOR CONVERSION" Margin="-100 0 0 0 "> <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="120"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> - <Grid Margin="0 0 0 0"> - <DockPanel> - <Border DockPanel.Dock="Top" Background="#E9FFFFFF" Margin="20 0" Padding="5" CornerRadius="5"> - <Border.Effect> - <DropShadowEffect Opacity="0.4" /> - </Border.Effect> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"></ColumnDefinition> + <ColumnDefinition Width="260"></ColumnDefinition> + </Grid.ColumnDefinitions> + <local:ColorConversionView x:Name="colorConversionView" Margin="0 0 0 0" Grid.Column="0" DataContext="{Binding ColorConversionViewVM}"/> + <DockPanel Grid.Column="1"> + <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="16 0" Padding="5" CornerRadius="5"> + <Border.Effect> + <DropShadowEffect Opacity="0.4" /> + </Border.Effect> + <Grid> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">CCT</TextBlock> + </Grid> + </Border> + <Grid DockPanel.Dock="Top" Background="#35B5B5B5" Margin="20 0"> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <Grid> - <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">LIQUID FACTORS</TextBlock> - - <Button ToolTip="Add new liquid factor" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Width="30" Padding="0" Command="{Binding AddLiquidFactorCommand}"> - <materialDesign:PackIcon Kind="Plus" Foreground="#0AC30A" Width="24" Height="24" /> - </Button> - </Grid> - </Border> - - <ScrollViewer x:Name="liquidsFactorsScrollViewer" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden" Margin="15 0 20 0"> - <ItemsControl Width="{Binding ElementName=calibrationDataView,Path=ActualWidth}" ItemsSource="{Binding LiquidTypesRmls}" Margin="0 10 0 0"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid IsItemsHost="True" Rows="1"></UniformGrid> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type observables:LiquidTypesRml}"> - <Grid Margin="20 0 20 0" MaxWidth="230"> + <StackPanel Orientation="Vertical" HorizontalAlignment="Left"> + <Image Source="../Images/data-table.png" Height="80" Opacity="0.8" ></Image> + <StackPanel VerticalAlignment="Center" Width="200" Margin="5 20 5 10"> - <Button HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove liquid factor" Width="30" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveLiquidFactorCommand}" CommandParameter="{Binding}"> - <materialDesign:PackIcon Kind="Delete" Foreground="#FF7D7D" /> - </Button> - - <StackPanel Margin="0 0 10 0"> - <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="DimGray" Text="{Binding LiquidType.Name}"></TextBlock> - <Grid Width="58" Height="48" Margin="0 5 0 0"> - <shapes:Hexagon StrokeThickness="1" Stroke="Gray"> - <shapes:Hexagon.Fill> - <LinearGradientBrush Opacity="0.7" > - <GradientStop Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"/> - <GradientStop Color="White" Offset="1"/> - </LinearGradientBrush> - </shapes:Hexagon.Fill> - </shapes:Hexagon> - - <TextBox Style="{x:Null}" Background="Transparent" Foreground="Black" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontStyle="Italic"></TextBox> - </Grid> - </StackPanel> - </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </ScrollViewer> - </DockPanel> - </Grid> - - <Grid Grid.Row="2"> - <DockPanel> - - <Border DockPanel.Dock="Top" Background="#E9FFFFFF" Margin="20 0" Padding="5" CornerRadius="5"> - <Border.Effect> - <DropShadowEffect Opacity="0.4" /> - </Border.Effect> - <Grid> - <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">CALIBRATION DATA</TextBlock> - <Button ToolTip="Create excel file template" FontSize="11" Foreground="#202020" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Padding="0" Command="{Binding CreateCalibrationDataExcelTemplateCommand}" Margin="0 0 5 0"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Kind="FileExcel" Foreground="DimGray" Width="16" Height="26" /> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0">Create Empty Excel Template</TextBlock> + <ComboBox materialDesign:HintAssist.Hint="No CCT Defined" Margin="0 5 0 0" HorizontalContentAlignment="Center" ItemsSource="{Binding CCTS}" SelectedItem="{Binding SelectedCCT}" DisplayMemberPath="FileName" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> + <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Right"> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportForwardDataCommand}"> + <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> + <materialDesign:PackIcon Kind="Upload" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">IMPORT</TextBlock> + </StackPanel> + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ExportForwardDataCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Download" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">EXPORT</TextBlock> + </StackPanel> + </Button> + </UniformGrid> + </StackPanel> </StackPanel> - </Button> </Grid> - </Border> - - <ScrollViewer x:Name="calibrationDataScrollViewer" ScrollChanged="calibrationDataScrollViewer_ScrollChanged" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" Margin="15 0 20 0"> - <colorLabViews:CalibrationDataView x:Name="calibrationDataView" Margin="0 10 0 0" DataContext="{Binding CalibrationDataViewVM}" /> - </ScrollViewer> + </StackPanel> + </Grid> </DockPanel> - </Grid> </Grid> - </DockPanel> + <!--<local:ColorConversionView x:Name="colorConversionView" />--> + </TabItem> + </TabControl> + </Grid> + <Grid Grid.Row="1"> + <Grid > + <DockPanel> + <Border DockPanel.Dock="Top" Background="{StaticResource TransparentBackgroundBrush200}" Margin="20 0" Padding="5" CornerRadius="5"> + <Border.Effect> + <DropShadowEffect Opacity="0.4" /> + </Border.Effect> + <Grid> + <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">CALIBRATION DATA</TextBlock> + <Button ToolTip="Create excel file template" FontSize="11" Foreground="{StaticResource DarkGrayBrush200}" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Padding="0" Command="{Binding CreateCalibrationDataExcelTemplateCommand}" Margin="0 0 5 0"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="FileExcel" Foreground="{StaticResource DimGrayBrush}" Width="16" Height="26" /> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0">Create Empty Excel Template</TextBlock> + </StackPanel> + </Button> + </Grid> + </Border> + + <ScrollViewer x:Name="calibrationDataScrollViewer" ScrollChanged="calibrationDataScrollViewer_ScrollChanged" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" Margin="15 0 20 0"> + <local:CalibrationDataView x:Name="calibrationDataView" Margin="0 10 0 0" DataContext="{Binding CalibrationDataViewVM}" /> + </ScrollViewer> + </DockPanel> + </Grid> </Grid> </Grid> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs index 2a5d317c6..aa4803bd0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs @@ -25,32 +25,18 @@ namespace Tango.MachineStudio.RML.Views { private MainViewVM _vm; - public DraggingSurface DraggingSurface - { - get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); } - set { SetValue(DraggingSurfaceProperty, value); } - } - public static readonly DependencyProperty DraggingSurfaceProperty = - DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(RmlView), new PropertyMetadata(null)); - - public RmlView() { InitializeComponent(); - DraggingSurface = draggingSurface; Loaded += (_, __) => { _vm = DataContext as MainViewVM; }; } - private void OnProcessTableDropped(object sender, DropEventArgs e) - { - ProcessParametersTable dragged = e.Draggable.DataContext as ProcessParametersTable; - ProcessParametersTable dropped = e.Droppable.DataContext as ProcessParametersTable; - _vm.OnProcessParametersTableDropped(dragged, dropped); - } - private void calibrationDataScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e) { - liquidsFactorsScrollViewer.ScrollToHorizontalOffset(e.HorizontalOffset); + if(processParametersView.IsVisible) + { + processParametersView.liquidsFactorsScrollViewer.ScrollToHorizontalOffset(e.HorizontalOffset); + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml index 06a28c1e4..ec1e1a78a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml @@ -25,13 +25,13 @@ </Grid> <Grid DockPanel.Dock="Bottom"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0"> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveRmlCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveRmlCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddRmlCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddRmlCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">NEW RML</TextBlock> @@ -48,7 +48,7 @@ </StackPanel> </Grid> <Grid> - <DataGrid Margin="0 0 0 10" BorderBrush="Silver" IsReadOnly="True" BorderThickness="1" Background="#93FFFFFF" AlternatingRowBackground="#C9F6F6F6" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}"> + <DataGrid Margin="0 0 0 10" BorderBrush="Silver" IsReadOnly="True" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> @@ -83,7 +83,7 @@ </shapes:Hexagon.Fill> </shapes:Hexagon> - <TextBlock FontSize="8" Width="40" TextTrimming="CharacterEllipsis" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Background="Transparent" Foreground="Black" Text="{Binding LiquidType.Name}" FontStyle="Italic"></TextBlock> + <TextBlock FontSize="8" Width="40" TextTrimming="CharacterEllipsis" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Background="Transparent" Foreground="{StaticResource Hexagon.ForegroundBrush}" Text="{Binding LiquidType.Name}" FontStyle="Italic"></TextBlock> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/MainView.xaml index 69708f517..55804c7b3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/MainView.xaml @@ -30,19 +30,22 @@ </StackPanel> <UniformGrid Columns="3" Margin="50 20 50 50" Rows="2" Grid.Row="1"> - <Border BorderBrush="#181818" Padding="5" BorderThickness="1" CornerRadius="5" Margin="10"> + <Border BorderBrush="{StaticResource Statistics.BorderBrush}" Padding="5" BorderThickness="1" CornerRadius="5" Margin="10"> <DockPanel> <TextBlock DockPanel.Dock="Top" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" Padding="10" Text="{Binding TimelineJobStatusSeries.Title}"></TextBlock> <lvc:CartesianChart Series="{Binding TimelineJobStatusSeries.SeriesCollection}" LegendLocation="Bottom" SeriesColors="{Binding TimelineJobStatusSeries.SeriesColors}"> + <lvc:CartesianChart.DataTooltip> + <lvc:DefaultTooltip BulletSize="20" Background="{StaticResource TransparentBackgroundBrush450}" Foreground="{StaticResource Dialog.Foreground}"/> + </lvc:CartesianChart.DataTooltip> <lvc:CartesianChart.AxisX> - <lvc:Axis Title="{Binding TimelineJobStatusSeries.LabelsTitle}" Labels="{Binding TimelineJobStatusSeries.Labels}" Foreground="#202020"> + <lvc:Axis Title="{Binding TimelineJobStatusSeries.LabelsTitle}" Labels="{Binding TimelineJobStatusSeries.Labels}" Foreground="{StaticResource DarkGrayBrush200}"> <lvc:Axis.Separator> <lvc:Separator Stroke="#A5A5A5" /> </lvc:Axis.Separator> </lvc:Axis> </lvc:CartesianChart.AxisX> <lvc:CartesianChart.AxisY> - <lvc:Axis Title="{Binding TimelineJobStatusSeries.ChartTitle}" MinValue="0" Foreground="#202020" > + <lvc:Axis Title="{Binding TimelineJobStatusSeries.ChartTitle}" MinValue="0" Foreground="{StaticResource DarkGrayBrush200}" > <lvc:Axis.Separator> <lvc:Separator Stroke="#B0B0B0" /> </lvc:Axis.Separator> @@ -52,11 +55,17 @@ </DockPanel> </Border> - <Border BorderBrush="#181818" Padding="5" BorderThickness="1" CornerRadius="5" Margin="10"> + <Border BorderBrush="{StaticResource Statistics.BorderBrush}" Padding="5" BorderThickness="1" CornerRadius="5" Margin="10"> <DockPanel> <TextBlock DockPanel.Dock="Top" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" Padding="10" Text="{Binding PieJobFailedReasons.Title}"></TextBlock> <UniformGrid Columns="2"> - <lvc:PieChart DataHover="PieChart_DataHover" Series="{Binding PieJobFailedReasons.SeriesCollection}" LegendLocation="None" SeriesColors="{Binding PieJobFailedReasons.SeriesColors}"> + <lvc:PieChart DataHover="PieChart_DataHover" Series="{Binding PieJobFailedReasons.SeriesCollection}" LegendLocation="None" SeriesColors="{Binding PieJobFailedReasons.SeriesColors}" Background="Transparent"> + <lvc:PieChart.Resources> + <Style TargetType="lvc:PieSeries"> + <Setter Property="Stroke" Value="#99F9F9F9"></Setter> + <Setter Property="StrokeThickness" Value="2"/> + </Style> + </lvc:PieChart.Resources> <lvc:PieChart.DataTooltip> <tooltips:PieChartTooltipControl Visibility="Hidden" /> </lvc:PieChart.DataTooltip> @@ -67,24 +76,32 @@ </DockPanel> </Border> - <Border BorderBrush="#181818" Padding="5" BorderThickness="1" CornerRadius="5" Margin="10"> + <Border BorderBrush="{StaticResource Statistics.BorderBrush}" Padding="5" BorderThickness="1" CornerRadius="5" Margin="10"> <DockPanel> <TextBlock DockPanel.Dock="Top" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" Padding="10" Text="{Binding PrintPerWeekSeries.Title}"></TextBlock> - <lvc:CartesianChart Series="{Binding PrintPerWeekSeries.SeriesCollection}" LegendLocation="Bottom" SeriesColors="{Binding PrintPerWeekSeries.SeriesColors}"> + <lvc:CartesianChart Series="{Binding PrintPerWeekSeries.SeriesCollection}" LegendLocation="Bottom" SeriesColors="{Binding PrintPerWeekSeries.SeriesColors}" > + <lvc:CartesianChart.Resources> + <Style TargetType="lvc:ColumnSeries"> + <Setter Property="Foreground" Value="{StaticResource DarkGrayBrush200}"></Setter> + </Style> + </lvc:CartesianChart.Resources> <lvc:CartesianChart.AxisX> - <lvc:Axis Title="{Binding PrintPerWeekSeries.LabelsTitle}" Labels="{Binding PrintPerWeekSeries.Labels}" Foreground="#202020"> + <lvc:Axis Title="{Binding PrintPerWeekSeries.LabelsTitle}" Labels="{Binding PrintPerWeekSeries.Labels}" Foreground="{StaticResource DarkGrayBrush200}"> <lvc:Axis.Separator> <lvc:Separator Stroke="#A5A5A5" /> </lvc:Axis.Separator> </lvc:Axis> </lvc:CartesianChart.AxisX> <lvc:CartesianChart.AxisY> - <lvc:Axis Title="{Binding PrintPerWeekSeries.ChartTitle}" MinValue="0" Foreground="#202020" > + <lvc:Axis Title="{Binding PrintPerWeekSeries.ChartTitle}" MinValue="0" Foreground="{StaticResource DarkGrayBrush200}" > <lvc:Axis.Separator> - <lvc:Separator Stroke="#B0B0B0" /> + <lvc:Separator Stroke="#6F6F6F" /> </lvc:Axis.Separator> </lvc:Axis> </lvc:CartesianChart.AxisY> + <lvc:CartesianChart.DataTooltip> + <lvc:DefaultTooltip BulletSize="20" Background="{StaticResource TransparentBackgroundBrush450}" Foreground="{StaticResource Dialog.Foreground}"/> + </lvc:CartesianChart.DataTooltip> </lvc:CartesianChart> </DockPanel> </Border> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml index 840e18523..fd34c0c6f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Storage/Views/MainView.xaml @@ -22,72 +22,72 @@ <Grid> <DockPanel> - <Border Background="#ECECEC" Margin="20" Width="350" CornerRadius="5" IsEnabled="{Binding IsFree}"> + <Border Background="{StaticResource WhiteBrush100}" Margin="20" Width="350" CornerRadius="5" IsEnabled="{Binding IsFree}"> <Border.Effect> <DropShadowEffect ShadowDepth="0" BlurRadius="10" Color="Gray" /> </Border.Effect> <DockPanel> <TextBlock HorizontalAlignment="Left" DockPanel.Dock="Top" Margin="30 55 20 20" FontSize="30" FontStyle="Italic" Foreground="{StaticResource AccentColorBrush}" FontWeight="Bold">ACTIONS</TextBlock> <StackPanel Margin="0 40 0 0"> - <Button Command="{Binding CreateFolderCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding CreateFolderCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> - <materialDesign:PackIcon Kind="FolderPlus" Foreground="#E79F20" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="FolderPlus" Foreground="{StaticResource OrangeBrush250}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">CREATE FOLDER</TextBlock> </DockPanel> </Button> - <Button Command="{Binding DeleteFolderCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding DeleteFolderCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> - <materialDesign:PackIcon Kind="FolderRemove" Foreground="#E14141" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="FolderRemove" Foreground="{StaticResource RedBrush500}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">DELETE FOLDER</TextBlock> </DockPanel> </Button> <Separator/> - <Button Command="{Binding UploadFileCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding UploadFileCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> - <materialDesign:PackIcon Kind="Upload" Foreground="#E97E28" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="Upload" Foreground="{StaticResource OrangeBrush250}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">UPLOAD FILE</TextBlock> </DockPanel> </Button> - <Button Command="{Binding DownloadFileCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding DownloadFileCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> - <materialDesign:PackIcon Kind="Download" Foreground="#2DD42D" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="Download" Foreground="{StaticResource GreenDownloadFileBrush}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">DOWNLOAD FILE</TextBlock> </DockPanel> </Button> <Separator/> - <Button Command="{Binding DeleteFileCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding DeleteFileCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> - <materialDesign:PackIcon Kind="Delete" Foreground="#E14141" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="Delete" Foreground="{StaticResource RedBrush500}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">DELETE FILE</TextBlock> </DockPanel> </Button> <Separator/> - <Button Command="{Binding UploadVersionCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding UploadVersionCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> - <materialDesign:PackIcon Kind="BriefcaseUpload" Foreground="#833CEC" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="BriefcaseUpload" Foreground="{StaticResource LilacBrush}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">UPGRADE VERSION</TextBlock> </DockPanel> </Button> - <Button Command="{Binding ValidateVersionCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding ValidateVersionCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> - <materialDesign:PackIcon Kind="CheckAll" Foreground="#682EBE" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="CheckAll" Foreground="{StaticResource LilacBrush100}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">VALIDATE VERSION</TextBlock> </DockPanel> </Button> - <Button Command="{Binding ActivateVersionCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding ActivateVersionCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> - <materialDesign:PackIcon Kind="Flash" Foreground="#532990" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="Flash" Foreground="{StaticResource LilacBrush200}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">ACTIVATE VERSION</TextBlock> </DockPanel> </Button> - <Button Command="{Binding GenerateTfpCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding GenerateTfpCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> - <materialDesign:PackIcon Kind="Chip" Foreground="#532990" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="Chip" Foreground="{StaticResource LilacBrush200}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">GENERATE TFP FILE</TextBlock> </DockPanel> </Button> <Separator/> - <Button Command="{Binding RefreshCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="#363636" HorizontalContentAlignment="Left"> + <Button Command="{Binding RefreshCommand}" Margin="0 5 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="20 10" Height="Auto" Foreground="{StaticResource GrayBrush310}" HorizontalContentAlignment="Left"> <DockPanel> <materialDesign:PackIcon Kind="Refresh" Foreground="{StaticResource AccentColorBrush}" Width="32" Height="32" /> <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="18">REFRESH</TextBlock> @@ -99,7 +99,7 @@ <Grid> <DockPanel> - <Border DockPanel.Dock="Top" Background="#ECECEC" Margin="20" Height="150" CornerRadius="5" Padding="20 0"> + <Border DockPanel.Dock="Top" Background="{StaticResource WhiteBrush100}" Margin="20" Height="150" CornerRadius="5" Padding="20 0"> <Border.Effect> <DropShadowEffect ShadowDepth="0" BlurRadius="10" Color="Gray" /> </Border.Effect> @@ -156,7 +156,7 @@ <RowDefinition Height="5" /> <RowDefinition Height="40*" MinHeight="150" /> </Grid.RowDefinitions> - <Border Background="#8BFFFFFF" CornerRadius="5" Padding="20"> + <Border Background="{StaticResource TransparentBackgroundBrush500}" CornerRadius="5" Padding="20"> <DataGrid x:Name="gridStorageItems" IsEnabled="{Binding IsFree}" MouseDoubleClick="DataGrid_MouseDoubleClick" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserSortColumns="True" IsReadOnly="True" Background="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding StorageManager.CurrentFolder.Items}" SelectedItem="{Binding SelectedStorageItem}"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> @@ -207,7 +207,7 @@ <GridSplitter Grid.Row="1" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" Background="Gray" Margin="5 0" /> - <Border Background="#8BFFFFFF" CornerRadius="5" Padding="20" Grid.Row="3"> + <Border Background="{StaticResource TransparentBackgroundBrush500}" CornerRadius="5" Padding="20" Grid.Row="3"> <DockPanel> <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontStyle="Italic" Foreground="{StaticResource AccentColorBrush}" FontWeight="Bold">FILE TRANSFERS</TextBlock> <DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" IsReadOnly="True" Background="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding FileHandlers}"> @@ -226,11 +226,11 @@ <materialDesign:PackIcon.Style> <Style TargetType="materialDesign:PackIcon"> <Setter Property="Kind" Value="Download"></Setter> - <Setter Property="Foreground" Value="#20BB20"></Setter> + <Setter Property="Foreground" Value="{StaticResource GreenBrush450}"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding Type}" Value="Upload"> <Setter Property="Kind" Value="Upload"></Setter> - <Setter Property="Foreground" Value="#E76311"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeUploadBrush}"></Setter> </DataTrigger> </Style.Triggers> </Style> @@ -252,13 +252,13 @@ <ProgressBar Height="15" Margin="0 0 30 0" VerticalAlignment="Center" Maximum="{Binding Handler.Total,Mode=OneWay}" Value="{Binding Handler.Current,Mode=OneWay}"> <ProgressBar.Style> <Style TargetType="ProgressBar"> - <Setter Property="Foreground" Value="#2FD42F"></Setter> + <Setter Property="Foreground" Value="{StaticResource GreenUploadBrush}"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding Handler.Status}" Value="Canceled"> - <Setter Property="Foreground" Value="#EF832B"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeCanceledBrush}"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Handler.Status}" Value="Failed"> - <Setter Property="Foreground" Value="#E11A1A"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush500}"></Setter> </DataTrigger> </Style.Triggers> </Style> @@ -290,7 +290,7 @@ <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> - <Button Command="{Binding Source={x:Reference control},Path=DataContext.CancelFileHandlerCommand}" CommandParameter="{Binding}" Margin="5" Background="#FF6A6A" BorderBrush="#FF6A6A">CANCEL</Button> + <Button Command="{Binding Source={x:Reference control},Path=DataContext.CancelFileHandlerCommand}" CommandParameter="{Binding}" Margin="5" Background="{StaticResource RedBrush100}" BorderBrush="{StaticResource RedBrush100}">CANCEL</Button> </DataTemplate> </Setter.Value> </Setter> @@ -303,7 +303,7 @@ <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> - <Button Command="{Binding Source={x:Reference control},Path=DataContext.OpenFileHandlerCommand}" CommandParameter="{Binding}" Margin="5" Background="#2CC62C" BorderBrush="#2CC62C">OPEN</Button> + <Button Command="{Binding Source={x:Reference control},Path=DataContext.OpenFileHandlerCommand}" CommandParameter="{Binding}" Margin="5" Background="{StaticResource GreenOpenFileBrush}" BorderBrush="{StaticResource GreenOpenFileBrush}">OPEN</Button> </DataTemplate> </Setter.Value> </Setter> @@ -318,7 +318,7 @@ <DataGridTemplateColumn Width="60"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> - <Button Foreground="#FF5A5A" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Width="24" Height="24" Command="{Binding Source={x:Reference control},Path=DataContext.RemoveFileHandlerCommand}" CommandParameter="{Binding}" Margin="5"> + <Button Foreground="{StaticResource RedBrush100}" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Width="24" Height="24" Command="{Binding Source={x:Reference control},Path=DataContext.RemoveFileHandlerCommand}" CommandParameter="{Binding}" Margin="5"> <materialDesign:PackIcon Kind="Close" Width="24" Height="24" /> </Button> </DataTemplate> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml index bac93bff3..a8daa4540 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml @@ -9,7 +9,7 @@ xmlns:local="clr-namespace:Tango.MachineStudio.Stubs.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="#202020" Foreground="Gainsboro" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource DarkGrayBrush}" Foreground="{StaticResource BorderBrushGainsboro}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> <UserControl.Resources> <ResourceDictionary> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml index 228424e80..524dd79c5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml @@ -56,7 +56,7 @@ </i:Interaction.Triggers> </visuals:AnalogSwitch> - <Border Background="#202020" Margin="8" CornerRadius="3" Padding="5" Grid.Column="1"> + <Border Background="{StaticResource DarkGrayBrush}" Margin="8" CornerRadius="3" Padding="5" Grid.Column="1"> <Grid> <mahapps:NumericUpDown Style="{x:Null}" InterceptMouseWheel="True" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Right" HideUpDownButtons="True" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" HasDecimals="True" Minimum="0" Maximum="10000" Padding="0" Value="{Binding HardwareBlower.Voltage,FallbackValue='0.0',Mode=TwoWay}" VerticalAlignment="Center" FontSize="44" FontFamily="{StaticResource digital-7}" Foreground="#FFD400" Margin="0 0 16 0"> <mahapps:NumericUpDown.Resources> @@ -72,7 +72,7 @@ <Button Style="{x:Null}" Grid.Column="2" Margin="8" Cursor="Hand" Command="{Binding SetCommand}"> <Button.Template> <ControlTemplate TargetType="Button"> - <Grid Background="#404040"> + <Grid Background="{StaticResource GrayBrush280}"> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Gainsboro" FontSize="16" FontWeight="SemiBold">SET</TextBlock> </Grid> <ControlTemplate.Triggers> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml index 2686d57d9..27530ab10 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml @@ -86,7 +86,7 @@ <RowDefinition Height="70*"/> <RowDefinition Height="90*"/> </Grid.RowDefinitions> - <Border Background="#202020" Margin="0 3 0 0" CornerRadius="3" Padding="5"> + <Border Background="{StaticResource DarkGrayBrush}" Margin="0 3 0 0" CornerRadius="3" Padding="5"> <Grid> <TextBlock Text="{Binding EffectiveValue,StringFormat=0.0,FallbackValue='0.0'}" Foreground="#FF6F78" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="44" FontFamily="{StaticResource digital-7}" Margin="0 0 12 0"> @@ -95,7 +95,7 @@ </Grid> </Border> - <Border Background="#202020" Grid.Row="1" Margin="0 10 0 0" CornerRadius="3" Padding="5"> + <Border Background="{StaticResource DarkGrayBrush}" Grid.Row="1" Margin="0 10 0 0" CornerRadius="3" Padding="5"> <Grid> <mahapps:NumericUpDown Style="{x:Null}" InterceptMouseWheel="True" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Right" HideUpDownButtons="True" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" StringFormat="0.0" HasDecimals="True" Minimum="{Binding ElementName=fader,Path=Minimum}" Maximum="{Binding ElementName=fader,Path=Maximum}" Padding="0" Value="{Binding Value,Mode=TwoWay,StringFormat=0.0,FallbackValue=0.0}" VerticalAlignment="Center" FontSize="44" FontFamily="{StaticResource digital-7}" Foreground="#FFD400" Margin="0 0 12 0"> <mahapps:NumericUpDown.Resources> @@ -111,7 +111,7 @@ <Button Style="{x:Null}" Grid.Row="2" VerticalAlignment="Bottom" Height="60" Cursor="Hand" Command="{Binding SetCommand}"> <Button.Template> <ControlTemplate TargetType="Button"> - <Grid Background="#404040"> + <Grid Background="{StaticResource GrayBrush280}"> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Gainsboro" FontSize="16" FontWeight="SemiBold">SET</TextBlock> </Grid> <ControlTemplate.Triggers> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml index 96f966d20..90e18d43e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml @@ -23,7 +23,7 @@ <Grid x:Key="gridHoming"> <DockPanel> <Button Click="OnHomingStopped" DockPanel.Dock="Right" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" VerticalAlignment="Center" Margin="0 0 5 0" ToolTip="Stop Homing"> - <materialDesign:PackIcon Kind="Stop" Foreground="#FF5F5F" HorizontalAlignment="Center" VerticalAlignment="Center" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="Stop" Foreground="{StaticResource RedBrush100}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="32" Height="32" /> </Button> <ProgressBar Foreground="DimGray" BorderBrush="DimGray" Maximum="{Binding HomingMaximumProgress}" Value="{Binding HomingProgress}" VerticalAlignment="Center" Height="10" Margin="5 0 5 0" Background="Transparent"></ProgressBar> </DockPanel> @@ -102,7 +102,7 @@ </Grid.ColumnDefinitions> <Image Source="../Images/dispenser-line.png" Grid.ColumnSpan="2" Stretch="Fill"></Image> - <Path RenderTransformOrigin="0.5,0.5" Margin="10 80 40 10" HorizontalAlignment="Left" VerticalAlignment="Bottom" StrokeThickness="1" Stroke="#202020" Stretch="Uniform" Data="M728.4 312.2l-198.1-63.4c-0.5-5.9-1.6-11.6-3.4-17c8.4-2.8 17-5.9 25.7-9.2c78.8-29.7 124.3-63 135-98.8 c7.2-23.8-0.5-47.5-22.6-70.3c-17.5-18-56.2-44.9-57.8-46c-6.2-4.3-14.7-2.8-19.1 3.3L465.5 180.8c-3.2-0.4-6.4-0.6-9.6-0.6 c-2.2 0-4.5 0.1-6.7 0.3c-0.5-62.6-8.3-142.4-41.1-178.6c-12.7-14.1-28.3-21.2-46.1-21.2c0 0 0 0 0 0c-12.3 0-25.6 3.5-39.7 10.4 c-17.4 8.6-43.8 27.5-55.6 36.2c-3.5 2.6-5.7 4.2-6.1 4.5c-3.7 2.8-5.6 7.2-5.4 11.6c0.1 2.6 1 5.3 2.7 7.5l128.9 175.8 c-1.4 3.5-2.6 7.1-3.4 10.8c-42.1-13.7-94.9-27.4-138.4-27.4c-34.2 0-59.1 8.6-73.8 25.7c-13 15-17.7 35.8-14 61.7 c3.6 24.8 19.1 69.3 19.7 71.2c2 5.7 7.3 9.3 13 9.3c1.4 0 2.9-0.2 4.3-0.7L404 308.3c2.3 2.3 4.8 4.4 7.4 6.3 c-7.3 10-14.8 20.7-22.3 32c-46.3 70.4-63.5 124-51.1 159.3c8.2 23.5 28.3 38.2 59.6 43.6c16.2 2.8 41.8 3.4 60.4 3.4 c8.1 0 13.5-0.1 13.5-0.1c7.5-0.2 13.5-6.3 13.5-13.9L484 323.8c4.1-1.7 8.1-3.7 11.8-6.1c6.1 8.3 12.6 16.9 19.5 25.6 c52.2 65.4 97.5 98.6 134.8 98.6c17.6 0 42.4-7.5 61.3-43.3c11.7-22.2 25.4-67.3 25.9-69.2C739.5 322.2 735.5 314.5 728.4 312.2z M455.9 293c-21.1 0-38.3-17.1-38.3-38.3s17.1-38.3 38.3-38.3c21.1 0 38.3 17.1 38.3 38.3C494.2 275.9 477 293 455.9 293z"> + <Path RenderTransformOrigin="0.5,0.5" Margin="10 80 40 10" HorizontalAlignment="Left" VerticalAlignment="Bottom" StrokeThickness="1" Stroke="{StaticResource DarkGrayBrush}" Stretch="Uniform" Data="M728.4 312.2l-198.1-63.4c-0.5-5.9-1.6-11.6-3.4-17c8.4-2.8 17-5.9 25.7-9.2c78.8-29.7 124.3-63 135-98.8 c7.2-23.8-0.5-47.5-22.6-70.3c-17.5-18-56.2-44.9-57.8-46c-6.2-4.3-14.7-2.8-19.1 3.3L465.5 180.8c-3.2-0.4-6.4-0.6-9.6-0.6 c-2.2 0-4.5 0.1-6.7 0.3c-0.5-62.6-8.3-142.4-41.1-178.6c-12.7-14.1-28.3-21.2-46.1-21.2c0 0 0 0 0 0c-12.3 0-25.6 3.5-39.7 10.4 c-17.4 8.6-43.8 27.5-55.6 36.2c-3.5 2.6-5.7 4.2-6.1 4.5c-3.7 2.8-5.6 7.2-5.4 11.6c0.1 2.6 1 5.3 2.7 7.5l128.9 175.8 c-1.4 3.5-2.6 7.1-3.4 10.8c-42.1-13.7-94.9-27.4-138.4-27.4c-34.2 0-59.1 8.6-73.8 25.7c-13 15-17.7 35.8-14 61.7 c3.6 24.8 19.1 69.3 19.7 71.2c2 5.7 7.3 9.3 13 9.3c1.4 0 2.9-0.2 4.3-0.7L404 308.3c2.3 2.3 4.8 4.4 7.4 6.3 c-7.3 10-14.8 20.7-22.3 32c-46.3 70.4-63.5 124-51.1 159.3c8.2 23.5 28.3 38.2 59.6 43.6c16.2 2.8 41.8 3.4 60.4 3.4 c8.1 0 13.5-0.1 13.5-0.1c7.5-0.2 13.5-6.3 13.5-13.9L484 323.8c4.1-1.7 8.1-3.7 11.8-6.1c6.1 8.3 12.6 16.9 19.5 25.6 c52.2 65.4 97.5 98.6 134.8 98.6c17.6 0 42.4-7.5 61.3-43.3c11.7-22.2 25.4-67.3 25.9-69.2C739.5 322.2 735.5 314.5 728.4 312.2z M455.9 293c-21.1 0-38.3-17.1-38.3-38.3s17.1-38.3 38.3-38.3c21.1 0 38.3 17.1 38.3 38.3C494.2 275.9 477 293 455.9 293z"> <Path.Fill> <LinearGradientBrush> <GradientStop Color="Black"/> @@ -170,10 +170,10 @@ </Grid> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -65 0"> - <Border Background="#202020" CornerRadius="3" Padding="3"> - <mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="#FF8585" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown> + <Border Background="{StaticResource DarkGrayBrush}" CornerRadius="3" Padding="3"> + <mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="{StaticResource RedBrush400}" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown> </Border> - <visuals:Knob Width="50" Height="50" TicksHighlightBrush="#FF8585" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" /> + <visuals:Knob Width="50" Height="50" TicksHighlightBrush="{StaticResource RedBrush400}" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" /> </StackPanel> <!--Content--> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml index 4b7e2ea2c..190b4d3c8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml @@ -48,7 +48,7 @@ </Grid> <Grid Grid.Row="1"> - <Border Background="#202020" Margin="0 3 0 0" CornerRadius="3" Padding="5"> + <Border Background="{StaticResource DarkGrayBrush}" Margin="0 3 0 0" CornerRadius="3" Padding="5"> <Grid> <TextBlock Text="{Binding HeaterState.CurrentValue,StringFormat=0.00,FallbackValue='0.00'}" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="80" FontFamily="{StaticResource digital-7}" Margin="0 0 12 0"> <TextBlock.Style> @@ -75,7 +75,7 @@ <Image Source="../Images/temperature.png" Margin="0 10 20 10" RenderOptions.BitmapScalingMode="Fant"></Image> - <Border Background="#202020" Margin="0 3 0 0" CornerRadius="3" Padding="5" Grid.Column="1"> + <Border Background="{StaticResource DarkGrayBrush}" Margin="0 3 0 0" CornerRadius="3" Padding="5" Grid.Column="1"> <Grid> <mahapps:NumericUpDown x:Name="txtSetPoint" InterceptMouseWheel="True" IsHitTestVisible="{Binding IsEditing}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Right" HideUpDownButtons="True" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" HasDecimals="True" Minimum="0" Maximum="400" Padding="0" Value="{Binding SetPoint,FallbackValue='0.0',Mode=TwoWay}" VerticalAlignment="Center" FontSize="44" FontFamily="{StaticResource digital-7}" Foreground="#FFD400" Margin="0 0 12 0"> <mahapps:NumericUpDown.Resources> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml index 76a6a16a7..5165e9819 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml @@ -43,9 +43,9 @@ <!--Content--> <Grid> - <Border Padding="10" BorderThickness="1" BorderBrush="#202020" Background="#88FFFFFF" CornerRadius="5"> + <Border Padding="10" BorderThickness="1" BorderBrush="{StaticResource DarkGrayBrush}" Background="#88FFFFFF" CornerRadius="5"> <DockPanel> - <TextBox Foreground="#202020" FontSize="14" DockPanel.Dock="Top" Text="{Binding Job.Name}"></TextBox> + <TextBox Foreground="{StaticResource DarkGrayBrush}" FontSize="14" DockPanel.Dock="Top" Text="{Binding Job.Name}"></TextBox> <ItemsControl Margin="0 10 0 0" DockPanel.Dock="Top" ItemsSource="{Binding BrushStop.LiquidVolumes}" VerticalAlignment="Center"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> @@ -74,7 +74,7 @@ <ProgressBar Margin="0 0 10 0" VerticalAlignment="Bottom" Height="10" Minimum="0" Maximum="{Binding RunningJobStatus.TotalProgress}" Value="{Binding RunningJobStatus.Progress}"></ProgressBar> - <TextBlock HorizontalAlignment="Right" VerticalAlignment="Top" Foreground="#202020" FontSize="14" Margin="0 0 10 0"> + <TextBlock HorizontalAlignment="Right" VerticalAlignment="Top" Foreground="{StaticResource DarkGrayBrush}" FontSize="14" Margin="0 0 10 0"> <Run Text="{Binding RunningJobStatus.Progress,StringFormat=0.0}"></Run><Run Foreground="DodgerBlue" FontWeight="Bold">/</Run><Run Text="{Binding RunningJobStatus.TotalProgress,StringFormat=0.0}"></Run> <Run Foreground="Gray">m</Run> <Run></Run> @@ -135,7 +135,7 @@ <ComboBox ItemsSource="{Binding Source={StaticResource dispenserDivisions}}" SelectedItem="{Binding DispenserStepDivision,UpdateSourceTrigger=PropertyChanged}"> <ComboBox.ItemContainerStyle> <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> - <Setter Property="Background" Value="#ECECEC"></Setter> + <Setter Property="Background" Value="{StaticResource WhiteBrush100}"></Setter> </Style> </ComboBox.ItemContainerStyle> <ComboBox.ItemTemplate> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorRecorderElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorRecorderElementEditor.xaml index 65f25f131..645f98331 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorRecorderElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorRecorderElementEditor.xaml @@ -38,7 +38,7 @@ <RowDefinition Height="27"/> </Grid.RowDefinitions> - <TextBlock Text="CSV RECORDER" Foreground="#FF8585" FontFamily="{StaticResource digital-7}" FontSize="18" VerticalAlignment="Center" Margin="0,6,0,3" Height="18"></TextBlock> + <TextBlock Text="CSV RECORDER" Foreground="{StaticResource RedBrush400}" FontFamily="{StaticResource digital-7}" FontSize="18" VerticalAlignment="Center" Margin="0,6,0,3" Height="18"></TextBlock> <DockPanel Grid.Row="1"> <Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml index ecfea2f28..7c3728d1e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml @@ -24,7 +24,7 @@ <Grid x:Key="gridHoming"> <DockPanel> <Button Click="OnHomingStopped" DockPanel.Dock="Right" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" VerticalAlignment="Center" Margin="0 0 5 0" ToolTip="Stop Homing"> - <materialDesign:PackIcon Kind="Stop" Foreground="#FF5F5F" HorizontalAlignment="Center" VerticalAlignment="Center" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="Stop" Foreground="{StaticResource RedBrush100}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="32" Height="32" /> </Button> <ProgressBar Foreground="DimGray" BorderBrush="DimGray" Maximum="{Binding HomingMaximumProgress}" BorderThickness="1" Value="{Binding HomingProgress}" VerticalAlignment="Center" Height="10" Margin="5 0 5 0" Background="Transparent"> @@ -86,9 +86,9 @@ </Grid.RowDefinitions> <Grid Grid.Column="1"> - <Border BorderThickness="1" BorderBrush="#303030" CornerRadius="10" Background="#252525"> + <Border BorderThickness="1" BorderBrush="{StaticResource GrayBrush300}" CornerRadius="10" Background="#252525"> <Grid Margin="20"> - <Path RenderTransformOrigin="0.5,0.5" StrokeThickness="1" Stroke="#202020" Stretch="Uniform" Margin="10" Data="M500.633 211.454l-58.729-14.443c-3.53-11.133-8.071-21.929-13.55-32.256c8.818-14.678 27.349-45.571 27.349-45.571 c3.545-5.903 2.607-13.462-2.256-18.325l-42.422-42.422c-4.863-4.878-12.407-5.815-18.325-2.256L347.055 83.53 c-10.269-5.435-21.006-9.932-32.065-13.433l-14.443-58.729C298.876 4.688 292.885 0 286 0h-60 c-6.885 0-12.891 4.688-14.546 11.367c0 0-10.005 40.99-14.429 58.715c-11.792 3.735-23.188 8.584-34.043 14.502l-47.329-28.403 c-5.918-3.516-13.447-2.607-18.325 2.256l-42.422 42.422c-4.863 4.863-5.801 12.422-2.256 18.325l29.268 48.882 c-4.717 9.302-8.672 18.984-11.821 28.901l-58.729 14.487C4.688 213.124 0 219.115 0 226v60c0 6.885 4.688 12.891 11.367 14.546 l58.744 14.443c3.56 11.294 8.188 22.266 13.799 32.798l-26.191 43.652c-3.545 5.903-2.607 13.462 2.256 18.325l42.422 42.422 c4.849 4.849 12.407 5.771 18.325 2.256c0 0 29.37-17.607 43.755-26.221c10.415 5.552 21.313 10.137 32.549 13.696l14.429 58.715 C213.109 507.313 219.115 512 226 512h60c6.885 0 12.876-4.688 14.546-11.367l14.429-58.715 c11.558-3.662 22.69-8.394 33.281-14.136c14.78 8.862 44.443 26.66 44.443 26.66c5.903 3.53 13.462 2.622 18.325-2.256 l42.422-42.422c4.863-4.863 5.801-12.422 2.256-18.325l-26.968-44.927c5.317-10.093 9.727-20.654 13.169-31.523l58.729-14.443 C507.313 298.876 512 292.885 512 286v-60C512 219.115 507.313 213.124 500.633 211.454z M256 361c-57.891 0-105-47.109-105-105 s47.109-105 105-105s105 47.109 105 105S313.891 361 256 361z"> + <Path RenderTransformOrigin="0.5,0.5" StrokeThickness="1" Stroke="{StaticResource DarkGrayBrush}" Stretch="Uniform" Margin="10" Data="M500.633 211.454l-58.729-14.443c-3.53-11.133-8.071-21.929-13.55-32.256c8.818-14.678 27.349-45.571 27.349-45.571 c3.545-5.903 2.607-13.462-2.256-18.325l-42.422-42.422c-4.863-4.878-12.407-5.815-18.325-2.256L347.055 83.53 c-10.269-5.435-21.006-9.932-32.065-13.433l-14.443-58.729C298.876 4.688 292.885 0 286 0h-60 c-6.885 0-12.891 4.688-14.546 11.367c0 0-10.005 40.99-14.429 58.715c-11.792 3.735-23.188 8.584-34.043 14.502l-47.329-28.403 c-5.918-3.516-13.447-2.607-18.325 2.256l-42.422 42.422c-4.863 4.863-5.801 12.422-2.256 18.325l29.268 48.882 c-4.717 9.302-8.672 18.984-11.821 28.901l-58.729 14.487C4.688 213.124 0 219.115 0 226v60c0 6.885 4.688 12.891 11.367 14.546 l58.744 14.443c3.56 11.294 8.188 22.266 13.799 32.798l-26.191 43.652c-3.545 5.903-2.607 13.462 2.256 18.325l42.422 42.422 c4.849 4.849 12.407 5.771 18.325 2.256c0 0 29.37-17.607 43.755-26.221c10.415 5.552 21.313 10.137 32.549 13.696l14.429 58.715 C213.109 507.313 219.115 512 226 512h60c6.885 0 12.876-4.688 14.546-11.367l14.429-58.715 c11.558-3.662 22.69-8.394 33.281-14.136c14.78 8.862 44.443 26.66 44.443 26.66c5.903 3.53 13.462 2.622 18.325-2.256 l42.422-42.422c4.863-4.863 5.801-12.422 2.256-18.325l-26.968-44.927c5.317-10.093 9.727-20.654 13.169-31.523l58.729-14.443 C507.313 298.876 512 292.885 512 286v-60C512 219.115 507.313 213.124 500.633 211.454z M256 361c-57.891 0-105-47.109-105-105 s47.109-105 105-105s105 47.109 105 105S313.891 361 256 361z"> <Path.Fill> <LinearGradientBrush> <GradientStop Color="Black"/> @@ -154,10 +154,10 @@ </Viewbox> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -65 5"> - <Border Background="#202020" CornerRadius="3" Padding="3"> - <mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="#FF8585" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown> + <Border Background="{StaticResource DarkGrayBrush}" CornerRadius="3" Padding="3"> + <mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="{StaticResource RedBrush400}" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown> </Border> - <visuals:Knob Width="50" Height="50" TicksHighlightBrush="#FF8585" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" /> + <visuals:Knob Width="50" Height="50" TicksHighlightBrush="{StaticResource RedBrush400}" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" /> </StackPanel> <!--Content--> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml index ac07f1390..a209270e7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml @@ -24,7 +24,7 @@ <Grid x:Key="gridHoming"> <DockPanel> <Button Click="OnHomingStopped" DockPanel.Dock="Right" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" VerticalAlignment="Center" Margin="0 0 5 0" ToolTip="Stop Homing"> - <materialDesign:PackIcon Kind="Stop" Foreground="#FF5F5F" HorizontalAlignment="Center" VerticalAlignment="Center" Width="32" Height="32" /> + <materialDesign:PackIcon Kind="Stop" Foreground="{StaticResource RedBrush100}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="32" Height="32" /> </Button> <ProgressBar Foreground="DimGray" BorderBrush="DimGray" Maximum="{Binding HomingMaximumProgress}" BorderThickness="1" Value="{Binding HomingProgress}" VerticalAlignment="Center" Height="10" Margin="5 0 5 0" Background="Transparent"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml index f057521e0..3c4373097 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml @@ -38,7 +38,7 @@ <SolidColorBrush Color="{Binding Color}"></SolidColorBrush> </Border.BorderBrush> <DockPanel> - <TextBox DockPanel.Dock="Top" FontSize="12" Foreground="#202020" Text="{Binding ProcessParameters.Name}"></TextBox> + <TextBox DockPanel.Dock="Top" FontSize="12" Foreground="{StaticResource DarkGrayBrush}" Text="{Binding ProcessParameters.Name}"></TextBox> <Button DockPanel.Dock="Bottom" Margin="0 10 0 0" Height="40" Command="{Binding PushParametersCommand}"> <StackPanel Orientation="Horizontal"> <TextBlock Margin="0 0 10 0">PUSH PARAMETERS</TextBlock> @@ -57,7 +57,7 @@ <Grid Margin="0 2" Focusable="False" Background="Transparent" Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessParametersDropped" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=editors:ParameterizedEditor},Path=DraggingSurface}"> <ContentControl Focusable="False"> <DockPanel Focusable="False"> - <TextBlock Focusable="False" Width="150" FontSize="12" Foreground="#202020" DockPanel.Dock="Left" IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}"></TextBlock> + <TextBlock Focusable="False" Width="150" FontSize="12" Foreground="{StaticResource DarkGrayBrush}" DockPanel.Dock="Left" IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}"></TextBlock> <mahapps:NumericUpDown FontSize="14" Minimum="0" Margin="0 0 5 0" HorizontalContentAlignment="Left" HideUpDownButtons="True" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}" Background="#6EFFFFFF"></mahapps:NumericUpDown> </DockPanel> </ContentControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml index 3a7c7d53d..ac440ad64 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml @@ -24,7 +24,7 @@ <Grid x:Key="gridDefault"> <Viewbox Stretch="Fill"> - <materialDesign:PackIcon Kind="Home" Margin="25 0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="#202020" /> + <materialDesign:PackIcon Kind="Home" Margin="25 0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="{StaticResource DarkGrayBrush}" /> </Viewbox> <Button Click="OnHomingStarted" Style="{StaticResource emptyButton}" Background="Transparent" BorderThickness="0"></Button> @@ -45,7 +45,7 @@ </Grid.ColumnDefinitions> <Grid Grid.Column="0"> - <Border BorderThickness="1" BorderBrush="#303030" CornerRadius="10" Background="#252525"> + <Border BorderThickness="1" BorderBrush="{StaticResource GrayBrush300}" CornerRadius="10" Background="#252525"> <Grid> <Image x:Name="image" Margin="5" RenderTransformOrigin="0.5,0.5" gif:ImageBehavior.AnimatedSource="../Images/thread-motion.gif" RenderOptions.BitmapScalingMode="Fant" gif:ImageBehavior.AutoStart="False" gif:ImageBehavior.AnimateInDesignMode="True" gif:ImageBehavior.RepeatBehavior="Forever"> @@ -68,10 +68,10 @@ </Viewbox> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -65 5"> - <Border Background="#202020" CornerRadius="3" Padding="3"> - <mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="#FF8585" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown> + <Border Background="{StaticResource DarkGrayBrush}" CornerRadius="3" Padding="3"> + <mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="{StaticResource RedBrush400}" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown> </Border> - <visuals:Knob Width="50" Height="50" TicksHighlightBrush="#FF8585" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" /> + <visuals:Knob Width="50" Height="50" TicksHighlightBrush="{StaticResource RedBrush400}" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" /> </StackPanel> <!--Content--> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml index 2304469e0..59b9fa2af 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml @@ -46,7 +46,7 @@ <Button Margin="8" Cursor="Hand" Command="{Binding SetCommand}" CommandParameter="{Binding TechValve.State1}"> <Button.Style> <Style TargetType="Button"> - <Setter Property="Background" Value="#404040"></Setter> + <Setter Property="Background" Value="{StaticResource GrayBrush280}"></Setter> <Setter Property="IsEnabled" Value="True"></Setter> </Style> </Button.Style> @@ -80,7 +80,7 @@ </Button.Template> </Button> - <Border Background="#202020" Margin="8" CornerRadius="3" Padding="5" Grid.Column="1"> + <Border Background="{StaticResource DarkGrayBrush}" Margin="8" CornerRadius="3" Padding="5" Grid.Column="1"> <StackPanel> <TextBlock FontFamily="{StaticResource digital-7}" Text="Valve Controller" FontSize="13" Foreground="#E94A4A" HorizontalAlignment="Center"></TextBlock> <Image Source="../Images/valve.png" RenderOptions.BitmapScalingMode="Fant" Margin="10" Stretch="Uniform" Height="36" /> @@ -90,7 +90,7 @@ <Button Margin="8" Cursor="Hand" Grid.Column="2" Command="{Binding SetCommand}" CommandParameter="{Binding TechValve.State2}"> <Button.Style> <Style TargetType="Button"> - <Setter Property="Background" Value="#404040"></Setter> + <Setter Property="Background" Value="{StaticResource GrayBrush280}"></Setter> <Setter Property="IsEnabled" Value="True"></Setter> </Style> </Button.Style> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml index b6bfefd8c..1936a90d2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml @@ -52,7 +52,7 @@ <controls:TableGrid RowHeight="40"> <TextBlock>Length</TextBlock> - <mahApps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="1" Maximum="1000" Value="{Binding Segment.Length}"></mahApps:NumericUpDown> + <mahApps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="Gray" Margin="0 5 0 0" Minimum="1" Maximum="1000" Value="{Binding Segment.Length}"></mahApps:NumericUpDown> <TextBlock>Winding Method</TextBlock> <ComboBox ItemsSource="{Binding Adapter.WindingMethods}" SelectedValue="{Binding Job.WindingMethod}" DisplayMemberPath="Name"></ComboBox> @@ -64,10 +64,10 @@ <ToggleButton IsChecked="{Binding Job.EnableInterSegment}" HorizontalAlignment="Right" /> <TextBlock>Inter Segment Length</TextBlock> - <mahApps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="1" Maximum="1000" Value="{Binding Job.InterSegmentLength}"></mahApps:NumericUpDown> + <mahApps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="Gray" Margin="0 5 0 0" Minimum="1" Maximum="1000" Value="{Binding Job.InterSegmentLength}"></mahApps:NumericUpDown> <TextBlock>Number of Units</TextBlock> - <mahApps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="1" Maximum="1000" Value="{Binding Job.NumberOfUnits}"></mahApps:NumericUpDown> + <mahApps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="Gray" Margin="0 5 0 0" Minimum="1" Maximum="1000" Value="{Binding Job.NumberOfUnits}"></mahApps:NumericUpDown> <TextBlock>Enable Lubrication</TextBlock> <ToggleButton IsChecked="{Binding Job.EnableLubrication}" HorizontalAlignment="Right" /> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml index f12306523..82052f02f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml @@ -49,11 +49,11 @@ <UniformGrid Columns="2" Margin="0 5 0 0" IsEnabled="{Binding UseMinMax}"> <StackPanel Margin="0 0 5 0"> <TextBlock>Minimum</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="-1000000" Maximum="1000000" Value="{Binding Min,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="Gray" Margin="0 5 0 0" Minimum="-1000000" Maximum="1000000" Value="{Binding Min,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> <StackPanel Margin="5 0 0 0"> <TextBlock>Maximum</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="{Binding Min}" Maximum="1000000" Value="{Binding Max,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="Gray" Margin="0 5 0 0" Minimum="{Binding Min}" Maximum="1000000" Value="{Binding Max,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> </UniformGrid> <Button Margin="0 10 0 0" Command="{Binding ResetMinMaxToDefaultCommand}" Style="{StaticResource MaterialDesignFlatButton}">Set To Default</Button> @@ -71,7 +71,7 @@ <DockPanel> <Button HorizontalAlignment="Left" ToolTip="Record this graph data. When stopped, the data will be saved to a csv file." Command="{Binding ToggleRecordingCommand}"> <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Record" Foreground="#FF6D6D"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Record" Foreground="{StaticResource RedBrush100}"> <materialDesign:PackIcon.Style> <Style TargetType="materialDesign:PackIcon"> <Setter Property="Opacity" Value="1"></Setter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml index 8179dccc9..037ae0693 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml @@ -49,11 +49,11 @@ <UniformGrid Columns="2" Margin="0 5 0 0" IsEnabled="{Binding UseMinMax}"> <StackPanel Margin="0 0 5 0"> <TextBlock>Minimum</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="-1000000" Maximum="1000000" Value="{Binding Min,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="-1000000" Maximum="1000000" Value="{Binding Min,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> <StackPanel Margin="5 0 0 0"> <TextBlock>Maximum</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="{Binding Min}" Maximum="1000000" Value="{Binding Max,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown HasDecimals="True" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="{Binding Min}" Maximum="1000000" Value="{Binding Max,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> </UniformGrid> <Button Margin="0 10 0 0" Command="{Binding ResetMinMaxToDefaultCommand}" Style="{StaticResource MaterialDesignFlatButton}">Set To Default</Button> @@ -71,7 +71,7 @@ <DockPanel> <Button HorizontalAlignment="Left" ToolTip="Record this graph data. When stopped, the data will be saved to a csv file." Command="{Binding ToggleRecordingCommand}"> <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Record" Foreground="#FF6D6D"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Record" Foreground="{StaticResource RedBrush100}"> <materialDesign:PackIcon.Style> <Style TargetType="materialDesign:PackIcon"> <Setter Property="Opacity" Value="1"></Setter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Resources/GraphEx.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Resources/GraphEx.xaml index 85cccc2dd..e41fa1095 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Resources/GraphEx.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Resources/GraphEx.xaml @@ -14,22 +14,23 @@ <sys:Double x:Key="MiniFontSize">12</sys:Double> <sys:Double x:Key="TinyFontSize">9</sys:Double> - <!--Colors--> - <Color x:Key="borderColor">Silver</Color> + <!-- moved to COMMON --> + <!-- Colors--> + <!--<Color x:Key="borderColor">Silver</Color> <Color x:Key="graphGridLinesColor">#FFE9E9E9</Color> <Color x:Key="graphsMarkerColor">Gray</Color> <Color x:Key="materialColor">#03A9F4</Color> - <!--Brushes--> + --><!--Brushes--><!-- <SolidColorBrush x:Key="borderBrush" Color="{StaticResource borderColor}"></SolidColorBrush> <SolidColorBrush x:Key="graphGridLinesBrush" Color="{StaticResource graphGridLinesColor}"></SolidColorBrush> <SolidColorBrush x:Key="BlackBrush" Color="#545454"></SolidColorBrush> <SolidColorBrush x:Key="graphGridLinesLightBrush" Color="{StaticResource graphGridLinesColor}"></SolidColorBrush> - <SolidColorBrush x:Key="graphGridLinesDarkBrush" Color="#FF2E2E2E"></SolidColorBrush> + <SolidColorBrush x:Key="graphGridLinesDarkBrush" Color="#FF2E2E2E"></SolidColorBrush>--> - <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphBackgroundLight"> + <!--<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphBackgroundLight"> <GradientStop Color="White"/> <GradientStop Color="#FFE9E9E9" Offset="1"/> </LinearGradientBrush> @@ -42,9 +43,9 @@ <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphBackground"> <GradientStop Color="White"/> <GradientStop Color="#FFE9E9E9" Offset="1"/> - </LinearGradientBrush> + </LinearGradientBrush>--> - <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphLabelBackground" Opacity="0.7"> + <!--<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphLabelBackground" Opacity="0.7"> <GradientStop Color="White"/> <GradientStop Color="#FFD9D9D9" Offset="1"/> </LinearGradientBrush> @@ -54,7 +55,7 @@ <GradientStop Color="#FFBDBDBD" Offset="1"/> </LinearGradientBrush> - <SolidColorBrush Color="#FFF1F1F1" x:Key="topBarBackgroundBrush"></SolidColorBrush> + <SolidColorBrush Color="{DynamicResource WhiteBrush100}" x:Key="topBarBackgroundBrush"></SolidColorBrush>--> <!--Navigation Link Button--> <Style x:Key="LinkButton" TargetType="Button"> @@ -67,7 +68,7 @@ </ControlTemplate> </Setter.Value> </Setter> - <Setter Property="Foreground" Value="{StaticResource BlackBrush}" /> + <Setter Property="Foreground" Value="{StaticResource BlackForegroundBrush}" /> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Opacity" Value="0.5"></Setter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs index 4aedf8bc7..5e6bffa82 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs @@ -9,6 +9,7 @@ using System.Xml.Serialization; using Tango.BL; using Tango.BL.Entities; using Tango.Core.Commands; +using Tango.Core.ExtensionMethods; using Tango.SharedUI.Helpers; namespace Tango.MachineStudio.Technician.TechItems diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index ab5d2ebb1..8eb792f0d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -38,6 +38,7 @@ using RealTimeGraphX; using RealTimeGraphX.DataPoints; using Tango.MachineStudio.Technician.Views; using RealTimeGraphX.WPF; +using Tango.Core.ExtensionMethods; namespace Tango.MachineStudio.Technician.ViewModels { @@ -868,7 +869,8 @@ namespace Tango.MachineStudio.Technician.ViewModels else if (item is ValveItem) { (item as ValveItem).TechValve = Adapter.TechValves.FirstOrDefault(x => x.Guid == item.ItemGuid); - CreateElement<ValveElementEditor>(item); + var editor = CreateElement<ValveElementEditor>(item); + InitTechValveItem(editor.ValveItem); } else if (item is MeterItem) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml index b0d6b23fb..5eb72e65b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml @@ -20,13 +20,13 @@ </StackPanel> <StackPanel DockPanel.Dock="Top" VerticalAlignment="Top" Margin="0 30 0 0"> <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Kind="Table" VerticalAlignment="Top" Width="50" Height="50" Foreground="#202020" /> + <materialDesign:PackIcon Kind="Table" VerticalAlignment="Top" Width="50" Height="50" Foreground="{StaticResource DarkGrayBrush}" /> <TextBlock Padding="0 10 0 0" TextWrapping="Wrap" Margin="10 0 0 0" VerticalAlignment="Top" FontSize="14" Text="IMPORT PROJECT TABS" Width="400"></TextBlock> </StackPanel> </StackPanel> <Grid Margin="60 20 30 20"> - <Border BorderThickness="1" BorderBrush="Gainsboro" Padding="5" CornerRadius="5"> + <Border BorderThickness="1" BorderBrush="{StaticResource BorderBrushGainsboro}" Padding="5" CornerRadius="5"> <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> <ItemsControl ItemsSource="{Binding Tabs}"> <ItemsControl.ItemTemplate> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml index 8820fcd4d..63d22d365 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml @@ -53,13 +53,13 @@ EditorWidth="1920" EditorHeight="1080" FontSize="10" - Background="#7EFFFFFF" - EditorBackground="#70FFFFFF" + Background="{StaticResource TransparentBackgroundBrush450}" + EditorBackground="{StaticResource TransparentBackgroundBrush600}" RulerBackground="Transparent" - Foreground="#1EA9FF" - SelectionFillBrush="#338D8D8D" - SelectionStrokeBrush="#1EA9FF" - BorderBrush="#1EA9FF" + Foreground="{StaticResource BlueSelectionStrokBrush}" + SelectionFillBrush="{StaticResource SelectionFillBrush}" + SelectionStrokeBrush="{StaticResource BlueSelectionStrokBrush}" + BorderBrush="{StaticResource BlueSelectionStrokBrush}" BorderThickness="1"> <editors:ElementsEditor.Style> @@ -77,40 +77,40 @@ <ContextMenu DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}"> <MenuItem Header="Cut (Ctrl+X)" Command="{Binding CutCommand}" MinWidth="210"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Cut" Width="16" /> + <fa:ImageAwesome Icon="Cut" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Copy (Ctrl+C)" Command="{Binding CopyCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Copy" Width="16" /> + <fa:ImageAwesome Icon="Copy" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> - <MenuItem Header="Paste (Ctrl+V)" Command="{Binding PasteCommand}"> + <MenuItem Header="Paste (Ctrl+V)" Command="{Binding PasteCommand}" > <MenuItem.Icon> - <fa:ImageAwesome Icon="Paste" Width="16" /> + <fa:ImageAwesome Icon="Paste" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Undo (Ctrl+Z)" Command="{Binding UndoCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Undo" Width="16" /> + <fa:ImageAwesome Icon="Undo" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Redo (Ctrl+Y)" Command="{Binding RedoCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="RotateRight" Width="16"></fa:ImageAwesome> + <fa:ImageAwesome Icon="RotateRight" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Delete (DELETE)" Command="{Binding DeleteCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Recycle" Width="16" /> + <fa:ImageAwesome Icon="Recycle" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Select All (Ctrl+A)" Command="{Binding SelectAllCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Th" Width="16" /> + <fa:ImageAwesome Icon="Th" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> </ContextMenu> @@ -136,109 +136,109 @@ <RowDefinition Height="1*"/> </Grid.RowDefinitions> - <Menu Padding="5" Background="#C6ECECEC" Visibility="{Binding HideMenu,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <Menu Padding="5" Background="{StaticResource WhiteBrush100}" Visibility="{Binding HideMenu,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <MenuItem Header="File"> <MenuItem Command="{Binding NewProjectCommand}" MinWidth="180" Header="New" VerticalContentAlignment="Center"> <MenuItem.Icon> - <fa:ImageAwesome Icon="File" Width="16" /> + <fa:ImageAwesome Icon="File" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Command="{Binding OpenProjectCommand}" MinWidth="180" Header="Open" VerticalContentAlignment="Center"> <MenuItem.Icon> - <fa:ImageAwesome Icon="FolderOpen" Width="16" /> + <fa:ImageAwesome Icon="FolderOpen" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem MinWidth="180" Header="Import" VerticalContentAlignment="Center"> <MenuItem.Icon> - <fa:ImageAwesome Icon="ArrowRight" Width="16" /> + <fa:ImageAwesome Icon="ArrowRight" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> <MenuItem Header="Import Project Tabs" VerticalContentAlignment="Center" Command="{Binding ImportProjectTabsCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Table" Width="16" /> + <fa:ImageAwesome Icon="Table" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> </MenuItem> <Separator/> <MenuItem Header="Save" Command="{Binding SaveProjectCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Save" Width="16" /> + <fa:ImageAwesome Icon="Save" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Save as" Command="{Binding SaveAsProjectCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Save" Width="16" /> + <fa:ImageAwesome Icon="Save" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> </MenuItem> <MenuItem Header="Edit"> <MenuItem Header="Cut (Ctrl+X)" Command="{Binding SelectedTab.Editor.CutCommand}" MinWidth="210"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Cut" Width="16" /> + <fa:ImageAwesome Icon="Cut" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Copy (Ctrl+C)" Command="{Binding SelectedTab.Editor.CopyCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Copy" Width="16" /> + <fa:ImageAwesome Icon="Copy" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Paste (Ctrl+V)" Command="{Binding SelectedTab.Editor.PasteCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Paste" Width="16" /> + <fa:ImageAwesome Icon="Paste" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Undo (Ctrl+Z)" Command="{Binding SelectedTab.Editor.UndoCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Undo" Width="16" /> + <fa:ImageAwesome Icon="Undo" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Redo (Ctrl+Y)" Command="{Binding SelectedTab.Editor.RedoCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="RotateRight" Width="16"></fa:ImageAwesome> + <fa:ImageAwesome Icon="RotateRight" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Delete (DELETE)" Command="{Binding SelectedTab.Editor.DeleteCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Recycle" Width="16" /> + <fa:ImageAwesome Icon="Recycle" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Select All (Ctrl+A)" Command="{Binding SelectedTab.Editor.SelectAllCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Th" Width="16" /> + <fa:ImageAwesome Icon="Th" Width="16" Foreground="{StaticResource MainWindow.Foreground}" /> </MenuItem.Icon> </MenuItem> </MenuItem> <MenuItem Header="View"> <MenuItem Header="Zoom In" Command="{Binding SelectedTab.Editor.ZoomCommand}" CommandParameter="0.1"> <MenuItem.Icon> - <fa:ImageAwesome Icon="SearchPlus" Width="16" /> + <fa:ImageAwesome Icon="SearchPlus" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Zoom Out" Command="{Binding SelectedTab.Editor.ZoomCommand}" CommandParameter="-0.1"> <MenuItem.Icon> - <fa:ImageAwesome Icon="SearchMinus" Width="16" /> + <fa:ImageAwesome Icon="SearchMinus" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Reset Zoom" Command="{Binding SelectedTab.Editor.ResetZoomCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Search" Width="16" /> + <fa:ImageAwesome Icon="Search" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> </MenuItem> <MenuItem Header="Tools"> <MenuItem Header="Upload partial hardware configuration" Command="{Binding UploadPartialHardwareConfigurationCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Upload" Width="16" /> + <fa:ImageAwesome Icon="Upload" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Reset all graphs" Command="{Binding ResetGraphsCommand}"> <MenuItem.Icon> - <fa:ImageAwesome Icon="Refresh" Width="16" /> + <fa:ImageAwesome Icon="Refresh" Width="16" Foreground="{StaticResource MainWindow.Foreground}" /> </MenuItem.Icon> </MenuItem> </MenuItem> @@ -265,8 +265,8 @@ <Setter Property="BorderThickness" Value="1"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> - <Setter Property="Background" Value="White"></Setter> - <Setter Property="BorderBrush" Value="#FF7575"></Setter> + <Setter Property="Background" Value="{StaticResource WhiteBackgroundBrush}"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource RedBrush300}"></Setter> <Setter Property="BorderThickness" Value="2"></Setter> </DataTrigger> </Style.Triggers> @@ -327,8 +327,8 @@ <Setter Property="BorderThickness" Value="1"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> - <Setter Property="Background" Value="White"></Setter> - <Setter Property="BorderBrush" Value="#FF7575"></Setter> + <Setter Property="Background" Value="{StaticResource WhiteBackgroundBrush}"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource RedBrush300}"></Setter> <Setter Property="BorderThickness" Value="2"></Setter> <DataTrigger.EnterActions> <BeginStoryboard> @@ -398,12 +398,12 @@ </Border.ContextMenu> <Border.Style> <Style TargetType="Border"> - <Setter Property="Background" Value="#CBCBCB"></Setter> - <Setter Property="TextElement.Foreground" Value="#202020"></Setter> + <Setter Property="Background" Value="{StaticResource LightGrayBrush150}"></Setter> + <Setter Property="TextElement.Foreground" Value="{StaticResource DarkGrayBrush}"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding IsSelected}" Value="True"> <Setter Property="Background" Value="{StaticResource AccentColorBrush}"></Setter> - <Setter Property="TextElement.Foreground" Value="White"></Setter> + <Setter Property="TextElement.Foreground" Value="{StaticResource WhiteTextBrush}"></Setter> </DataTrigger> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Opacity" Value="0.8"></Setter> @@ -416,10 +416,10 @@ <materialDesign:PackIcon Kind="Close"> <materialDesign:PackIcon.Style> <Style TargetType="materialDesign:PackIcon"> - <Setter Property="Foreground" Value="#202020"></Setter> + <Setter Property="Foreground" Value="{StaticResource DarkGrayBrush}"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding IsSelected}" Value="True"> - <Setter Property="Foreground" Value="White"></Setter> + <Setter Property="Foreground" Value="{StaticResource WhiteTextBrush}"></Setter> </DataTrigger> </Style.Triggers> </Style> @@ -464,11 +464,11 @@ <UniformGrid Columns="2" Margin="0 5 0 0"> <StackPanel Margin="0 0 5 0"> <TextBlock>Left</TextBlock> - <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="0" Maximum="{Binding SelectedTab.Editor.EditorWidth}" Value="{Binding SelectedTab.Editor.SelectedElement.Left}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="0" Maximum="{Binding SelectedTab.Editor.EditorWidth}" Value="{Binding SelectedTab.Editor.SelectedElement.Left}"></mahapps:NumericUpDown> </StackPanel> <StackPanel Margin="5 0 0 0"> <TextBlock>Top</TextBlock> - <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="0" Maximum="{Binding SelectedTab.Editor.EditorHeight}" Value="{Binding SelectedTab.Editor.SelectedElement.Top}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="0" Maximum="{Binding SelectedTab.Editor.EditorHeight}" Value="{Binding SelectedTab.Editor.SelectedElement.Top}"></mahapps:NumericUpDown> </StackPanel> </UniformGrid> @@ -476,11 +476,11 @@ <UniformGrid Columns="2" Margin="0 20 0 0"> <StackPanel Margin="0 0 5 0"> <TextBlock>Width</TextBlock> - <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="10" Maximum="{Binding SelectedTab.Editor.EditorWidth}" Value="{Binding SelectedTab.Editor.SelectedElement.Width}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="10" Maximum="{Binding SelectedTab.Editor.EditorWidth}" Value="{Binding SelectedTab.Editor.SelectedElement.Width}"></mahapps:NumericUpDown> </StackPanel> <StackPanel Margin="5 0 0 0"> <TextBlock>Height</TextBlock> - <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Margin="0 5 0 0" Minimum="10" Maximum="{Binding SelectedTab.Editor.EditorHeight}" Value="{Binding SelectedTab.Editor.SelectedElement.Height}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="10" Maximum="{Binding SelectedTab.Editor.EditorHeight}" Value="{Binding SelectedTab.Editor.SelectedElement.Height}"></mahapps:NumericUpDown> </StackPanel> </UniformGrid> @@ -491,7 +491,7 @@ <ColumnDefinition Width="20*"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBlock VerticalAlignment="Center" Margin="0 0 10 0" HorizontalAlignment="Left">Angle</TextBlock> - <mahapps:NumericUpDown Grid.Column="1" HorizontalContentAlignment="Center" BorderBrush="Gainsboro" Foreground="Gray" Maximum="360" Minimum="-360" HasDecimals="False" Margin="0 5 0 0" Value="{Binding SelectedTab.Editor.SelectedElement.Angle}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown Grid.Column="1" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Maximum="360" Minimum="-360" HasDecimals="False" Margin="0 5 0 0" Value="{Binding SelectedTab.Editor.SelectedElement.Angle}"></mahapps:NumericUpDown> </Grid> </StackPanel> </GroupBox> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs index 735b1e75c..a46d5f456 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs @@ -226,7 +226,7 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels foreach (var userRole in ManagedUser.UsersRoles.Where(x => x.Role == role).ToList()) { - userRole.DefferedDelete(_userContext); + _userContext.UsersRoles.Remove(userRole); } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml index 64b05769a..d5a5d41d7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml @@ -28,7 +28,7 @@ <ColumnDefinition Width="1*"/> </Grid.ColumnDefinitions> - <Border Background="#A6FFFFFF" BorderBrush="Gray" BorderThickness="0 0 1 0"> + <Border Background="{StaticResource TransparentBackgroundBrush420}" BorderBrush="{StaticResource GrayBrush}" BorderThickness="0 0 1 0"> <Grid Margin="10 20 10 10"> <StackPanel HorizontalAlignment="Center"> @@ -39,7 +39,7 @@ <TextBlock FontSize="14" FontWeight="SemiBold">ADDRESS</TextBlock> - <Border BorderBrush="Gray" BorderThickness="1" Width="300" HorizontalAlignment="Left" Padding="5" Margin="0 10 0 0" Background="#A9FFFFFF" Height="300"> + <Border BorderBrush="Gray" BorderThickness="1" Width="300" HorizontalAlignment="Left" Padding="5" Margin="0 10 0 0" Background="{StaticResource TransparentBackgroundBrush420}" Height="300"> <DockPanel> <DockPanel DockPanel.Dock="Top"> <materialDesign:PackIcon Kind="Magnify" DockPanel.Dock="Left" Width="24" Height="24" /> @@ -51,7 +51,7 @@ <TextBlock FontSize="14" FontWeight="SemiBold" Margin="0 40 0 0">CONTACT</TextBlock> - <Border BorderBrush="Gray" BorderThickness="1" Width="300" HorizontalAlignment="Left" Padding="5" Margin="0 10 0 0" Background="#A9FFFFFF" Height="250"> + <Border BorderBrush="Gray" BorderThickness="1" Width="300" HorizontalAlignment="Left" Padding="5" Margin="0 10 0 0" Background="{StaticResource TransparentBackgroundBrush420}" Height="250"> <local:ContactView DataContext="{Binding ManagedOrganization.Contact}" /> </Border> @@ -84,13 +84,13 @@ </Grid> <Grid DockPanel.Dock="Bottom"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0"> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveUserCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveUserCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddUserCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddUserCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">NEW USER</TextBlock> @@ -107,7 +107,7 @@ </StackPanel> </Grid> <Grid> - <DataGrid Margin="0 0 0 10" ItemsSource="{Binding ManagedOrganization.Users}" SelectedItem="{Binding SelectedUser}" d:DataContext="{d:DesignInstance Type=entities:User, IsDesignTimeCreatable=False}" BorderBrush="Silver" BorderThickness="1" Background="#93FFFFFF" AlternatingRowBackground="#C9F6F6F6" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True"> + <DataGrid Margin="0 0 0 10" ItemsSource="{Binding ManagedOrganization.Users}" SelectedItem="{Binding SelectedUser}" d:DataContext="{d:DesignInstance Type=entities:User, IsDesignTimeCreatable=False}" BorderBrush="{StaticResource borderBrush}" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.xaml index 16dd36360..814e60d93 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationSelectionView.xaml @@ -23,13 +23,13 @@ </Grid> <Grid DockPanel.Dock="Bottom"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 0 0 0"> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveOrganizationCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}" Command="{Binding RemoveOrganizationCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddOrganizationCommand}"> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddOrganizationCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">NEW ORGANIZATION</TextBlock> @@ -46,7 +46,7 @@ </StackPanel> </Grid> <Grid> - <DataGrid Margin="0 0 0 10" BorderBrush="Silver" IsReadOnly="True" BorderThickness="1" Background="#93FFFFFF" AlternatingRowBackground="#C9F6F6F6" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Organizations}" SelectedItem="{Binding SelectedOrganization}"> + <DataGrid Margin="0 0 0 10" BorderBrush="{StaticResource borderBrush}" IsReadOnly="True" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Organizations}" SelectedItem="{Binding SelectedOrganization}"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml index ccb38b198..bb003f525 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/UserManagementView.xaml @@ -47,19 +47,19 @@ <StackPanel Orientation="Horizontal" Margin="0 20 0 0" HorizontalAlignment="Right"> <StackPanel> <TextBlock FontSize="16" FontWeight="SemiBold">LOGIN</TextBlock> - <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="15 5" Height="150" Background="#8EFFFFFF"> + <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="15 5" Height="150" Background="{StaticResource TransparentBackgroundBrush500}"> <local:UserView FontSize="10" DataContext="{Binding ManagedUser}" /> </Border> </StackPanel> <StackPanel Margin="10 0 0 0"> <TextBlock FontSize="16" FontWeight="SemiBold">CONTACT</TextBlock> - <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="15 5" Height="250" Background="#8EFFFFFF"> + <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="15 5" Height="250" Background="{StaticResource TransparentBackgroundBrush500}"> <local:ContactView FontSize="10" DataContext="{Binding ManagedUser.Contact}" /> </Border> </StackPanel> <StackPanel Margin="10 0 0 0"> <TextBlock FontSize="16" FontWeight="SemiBold">ADDRESS</TextBlock> - <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="15 5" Height="300" Background="#8EFFFFFF"> + <Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="15 5" Height="300" Background="{StaticResource TransparentBackgroundBrush500}"> <DockPanel> <DockPanel DockPanel.Dock="Top"> <materialDesign:PackIcon Kind="Magnify" DockPanel.Dock="Left" Width="24" Height="24" /> @@ -84,9 +84,9 @@ <Grid> <DockPanel Margin="0 20 0 0"> <TextBlock DockPanel.Dock="Top" FontSize="16" FontWeight="SemiBold">ROLES</TextBlock> - <Grid Margin="0 5 0 0" Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnDropRole" Background="#7BFFFFFF"> + <Grid Margin="0 5 0 0" Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnDropRole" Background="{StaticResource TransparentBackgroundBrush420}"> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Silver" FontSize="20">DRAG & DROP ROLES</TextBlock> - <Border BorderBrush="Gray" BorderThickness="1" Padding="10"> + <Border BorderBrush="{StaticResource borderBrush}" BorderThickness="1" Padding="10"> <ListBox ItemsSource="{Binding ManagedUserRoles}" ItemContainerStyle="{StaticResource basicListBoxItem}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> <ItemsPanelTemplate> @@ -97,7 +97,7 @@ <DataTemplate DataType="{x:Type entities:Role}"> <Grid> <Grid.ToolTip> - <StackPanel> + <StackPanel Background="Transparent"> <TextBlock Text="{Binding Description}" FontSize="10" Margin="0 0 0 10"></TextBlock> <ItemsControl ItemsSource="{Binding RolesPermissions}"> <ItemsControl.ItemTemplate> @@ -113,10 +113,10 @@ </ItemsControl> </StackPanel> </Grid.ToolTip> - <Border Margin="5" CornerRadius="5" Width="100" Height="100" BorderThickness="1" Padding="2"> + <Border Margin="5" CornerRadius="5" Width="100" Height="100" BorderThickness="1" Padding="2" Background="{StaticResource UserRoles.Background}"> <Border.Style> <Style TargetType="Border"> - <Setter Property="BorderBrush" Value="Silver"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource borderBrush}"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter> @@ -124,12 +124,6 @@ </Style.Triggers> </Style> </Border.Style> - <Border.Background> - <LinearGradientBrush> - <GradientStop Color="White"/> - <GradientStop Color="#FFD6D6D6" Offset="1"/> - </LinearGradientBrush> - </Border.Background> <Grid> <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> <Image Source="../Images/roles.png" Width="32" RenderOptions.BitmapScalingMode="Fant"></Image> @@ -149,7 +143,7 @@ </Style.Triggers> </Style> </Button.Style> - <materialDesign:PackIcon Kind="Delete" Foreground="#FF5C5C" Width="16" Height="16" /> + <materialDesign:PackIcon Kind="Delete" Foreground="{StaticResource RedBrush100}" Width="16" Height="16" /> </Button> </Grid> </DataTemplate> @@ -162,7 +156,7 @@ </DockPanel> </Grid> - <Grid Grid.Column="1" Background="White"> + <Grid Grid.Column="1" Background="{StaticResource WhiteBackgroundBrush}"> <DockPanel Margin="10"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> <Image Source="../Images/roles.png" Width="70" RenderOptions.BitmapScalingMode="Fant"></Image> @@ -175,14 +169,18 @@ <DataTemplate> <Grid Background="Transparent" IsHitTestVisible="True" Style="{StaticResource draggableGrid}" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"> <Grid.ToolTip> - <StackPanel> + <StackPanel Background="Transparent"> <TextBlock Text="{Binding Description}" FontSize="10" Margin="0 0 0 10"></TextBlock> <ItemsControl ItemsSource="{Binding RolesPermissions}"> <ItemsControl.ItemTemplate> <DataTemplate> - <StackPanel Orientation="Horizontal"> + <StackPanel Orientation="Horizontal" + Background="Transparent"> <materialDesign:PackIcon Kind="Security" Width="12" /> - <TextBlock Margin="5 0 0 0" FontSize="10" Text="{Binding Permission.Name}"></TextBlock> + <TextBlock Margin="5 0 0 0" + FontSize="10" + Text="{Binding Permission.Name}" + ></TextBlock> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> @@ -190,13 +188,7 @@ </StackPanel> </Grid.ToolTip> <DockPanel> - <Border DockPanel.Dock="Left" Width="100" Height="100" IsHitTestVisible="False" BorderBrush="Silver" BorderThickness="1" CornerRadius="5" Margin="5" Padding="2"> - <Border.Background> - <LinearGradientBrush> - <GradientStop Color="White"/> - <GradientStop Color="#FFD6D6D6" Offset="1"/> - </LinearGradientBrush> - </Border.Background> + <Border DockPanel.Dock="Left" Width="100" Height="100" IsHitTestVisible="False" BorderBrush="{StaticResource borderBrush}" BorderThickness="1" CornerRadius="5" Margin="5" Padding="2" Background="{StaticResource UserRoles.Background}"> <Grid> <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> <Image Source="../Images/roles.png" Width="32" RenderOptions.BitmapScalingMode="Fant"></Image> @@ -205,8 +197,11 @@ </Grid> </Border> - <Grid MaxHeight="85" HorizontalAlignment="Left" Margin="20 0 0 0"> - <ItemsControl ItemsSource="{Binding RolesPermissions}"> + <Grid MaxHeight="85" + HorizontalAlignment="Left" + Margin="20 0 0 0" + Width="200"> + <ItemsControl ItemsSource="{Binding RolesPermissions}" Foreground="{StaticResource MainWindow.Foreground}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> @@ -217,13 +212,7 @@ </ItemsControl.ItemTemplate> </ItemsControl> - <Grid> - <Grid.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop/> - <GradientStop Color="White" Offset="1"/> - </LinearGradientBrush> - </Grid.Background> + <Grid Background="{StaticResource UserRoles.GridBackground}"> </Grid> </Grid> </DockPanel> |
