diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-11-13 05:12:21 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-11-13 05:12:21 +0200 |
| commit | 331266b13685e16520ae5baa8a7aff50789c31df (patch) | |
| tree | e41c95c155aecccd43cac6498e4bd70a3e227f5a /Software/Visual_Studio/MachineStudio/Modules | |
| parent | 46978af63f2f683eefb0cadb87c1ce7540b0038d (diff) | |
| download | Tango-331266b13685e16520ae5baa8a7aff50789c31df.tar.gz Tango-331266b13685e16520ae5baa8a7aff50789c31df.zip | |
Inks Extension Support.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
8 files changed, 368 insertions, 14 deletions
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 a32fa58df..073f79a97 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 @@ -233,7 +233,22 @@ namespace Tango.MachineStudio.Developer.ViewModels public List<LiquidTypesRml> LiquidTypesRmls { get { return _liquidTypesRmls; } - set { _liquidTypesRmls = value; RaisePropertyChangedAuto(); } + set { _liquidTypesRmls = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(LiquidTypesRmlsOrdered)); } + } + + public List<LiquidTypesRml> LiquidTypesRmlsOrdered + { + get + { + if (Settings.UsePreferredLiquidVolumeIndex) + { + return LiquidTypesRmls.OrderBy(x => x.LiquidType.PreferredIndex).ToList(); + } + else + { + return LiquidTypesRmls; + } + } } private ProcessParametersTablesGroup _rmlProcessParametersTablesGroup; @@ -841,6 +856,14 @@ namespace Tango.MachineStudio.Developer.ViewModels { Settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>(); + Settings.PropertyChanged += (x, e) => + { + if (e.PropertyName == nameof(Settings.UsePreferredLiquidVolumeIndex)) + { + RaisePropertyChanged(nameof(LiquidTypesRmlsOrdered)); + } + }; + AutoProcessSelection = Settings.AutoProcessSelection; SelectedJobs = new ObservableCollection<Job>(); 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 4217d9712..c9842d494 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 @@ -793,7 +793,7 @@ </StackPanel> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="60 40 250 0" Visibility="{Binding IsSideBarOpened,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="60 25 350 0" Visibility="{Binding IsSideBarOpened,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <materialDesign:PackIcon Kind="ChevronLeft" Width="24" Height="24" /> <TextBlock Margin="0 -2 0 0" VerticalAlignment="Center"><Run>MEDIA LIQUIDS</Run> <Run FontSize="10" Foreground="{StaticResource DimGrayBrush}">( Max Nanolitter/CM )</Run></TextBlock> <materialDesign:PackIcon Kind="ChevronRight" Width="24" Height="24" /> @@ -802,7 +802,7 @@ <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}" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}"> + <ItemsControl ItemsSource="{Binding LiquidTypesRmlsOrdered}" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <WrapPanel IsItemsHost="True"></WrapPanel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_dfcch3km_wpftmp.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_dfcch3km_wpftmp.csproj new file mode 100644 index 000000000..81201d169 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_dfcch3km_wpftmp.csproj @@ -0,0 +1,224 @@ +<?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_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + </VisualStudio> + </ProjectExtensions> + <ItemGroup> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\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:\DATA\Development\Tango\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:\DATA\Development\Tango\Software\Visual_Studio\SideChains\Tango.AutoComplete\bin\Debug\Tango.AutoComplete.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.BL.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Core.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Integration.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Logging.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Machine Studio\Debug\Tango.MachineStudio.Common.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.PMR.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Settings.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.SharedUI.dll" /> + <ReferencePath Include="C:\DATA\Development\Tango\Software\Visual_Studio\Build\Core\Debug\Tango.Transport.dll" /> + <ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\WindowsBase.dll" /> + </ItemGroup> + <ItemGroup> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\App.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\EmbeddedLogDetailsView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\EmbeddedLogsView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\ApplicationLogDetailsView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\EventDetailsView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\ApplicationLogsView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\EventsView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\HomeView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\MainView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\TimelineView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\Software\Visual_Studio\MachineStudio\Modules\Tango.MachineStudio.Logging\obj\Debug\Views\TimelineWrapperView.g.cs" /> + <Compile Include="C:\DATA\Development\Tango\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.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index ddc0d91a3..8d539769c 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 @@ -261,6 +261,8 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels public RelayCommand MakePrototypeCommand { get; set; } public RelayCommand UpgradeToGen2Command { get; set; } + + public RelayCommand CreateDispenserCommand { get; set; } #endregion #region Constructors @@ -301,6 +303,8 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels TupViewVM = new TupViewVM(_notification); UpgradeToGen2Command = new RelayCommand(UpgradeToGEN2); + + CreateDispenserCommand = new RelayCommand(CreateDispenser); } #endregion @@ -318,7 +322,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { Task.Factory.StartNew(() => { - ActiveMachineAdapter.Dispensers = ActiveMachineAdapter.Context.Dispensers.Where(x => x.SerialNumber.ToLower().StartsWith(DispensersFilter.ToLower())).OrderBy(x => x.SerialNumber).ToSynchronizedObservableCollection(); + ActiveMachineAdapter.Dispensers = ActiveMachineAdapter.Context.Dispensers.Where(x => x.SerialNumber.ToLower().StartsWith(DispensersFilter.ToLower())).OrderBy(x => x.SerialNumber).ToSynchronizedObservableCollection().OrderByAlphaNumeric(x => x.SerialNumber).ToSynchronizedObservableCollection(); }); }); } @@ -394,6 +398,18 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels /// <param name="idsPack">The ids pack.</param> public void DropDispenser(Dispenser dispenser, IdsPack idsPack) { + if (ActiveMachine.Configuration.IdsPacks.Any(x => x.DispenserGuid == dispenser.Guid)) + { + _notification.ShowError("The selected dispenser is already installed on this machine."); + return; + } + + if (ActiveMachineAdapter.Context.IdsPacks.Any(x => x.DispenserGuid == dispenser.Guid)) + { + _notification.ShowError("The selected dispenser is already installed on another machine."); + return; + } + idsPack.Dispenser = dispenser; idsPack.DispenserGuid = dispenser.Guid; } @@ -966,6 +982,32 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels } } + private async void CreateDispenser() + { + String serialNumber = _notification.ShowTextInput("Please enter new serial number", "Serial Number", ActiveMachine.SerialNumber + "_D" + (ActiveMachine.Configuration.IdsPacks.Where(x => x.Dispenser != null).Count() + 1).ToString()); + if (serialNumber.IsNullOrWhiteSpace()) return; + + if (ActiveMachineAdapter.Context.Dispensers.Any(x => x.SerialNumber == serialNumber)) + { + _notification.ShowError($"Dispenser '{serialNumber}' already exists. Please enter a different serial number."); + return; + } + + using (_notification.PushTaskItem("Creating new dispenser...")) + { + using (var db = ObservablesContext.CreateDefault()) + { + Dispenser dispenser = new Dispenser(); + dispenser.SerialNumber = serialNumber; + dispenser.DispenserTypeGuid = ActiveMachineAdapter.Context.DispenserTypes.First(x => x.Code == (int)DispenserTypes.StandardDispenser).Guid; + dispenser.NlPerPulse = 2.34; + db.Dispensers.Add(dispenser); + await db.SaveChangesAsync(); + DispensersFilter = serialNumber; + } + } + } + #endregion private void CloneMachine() 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 9b99c9ec5..5278d1780 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 @@ -446,6 +446,7 @@ </DataTemplate> </ListBox.ItemTemplate> </ListBox> + <Button Margin="40 10" Command="{Binding CreateDispenserCommand}" Width="160" Height="35">CREATE DISPENSER</Button> </StackPanel> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> 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 index ca3c3e322..be7dc3a67 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs @@ -248,6 +248,12 @@ namespace Tango.MachineStudio.RML.ViewModels input.UseLubricantTransform = RML.UseLubricantTransform; input.VMax = RML.VMax; + input.SetPredictionType(RML.PredictionType); + input.SetPredictionMethod(RML.PredictionMethod); + input.CMYKVHueThreshhold = RML.CmykvHueThreshold; + input.CMYKVK = RML.KNearestK; + input.SimpleRGBPreviewFactor = RML.SimpleRgbPreviewFactor; + //Validate calibration data foreach (var vm in LiquidsCalibrationData.Where(x => x.LiquidType.HasPigment)) { @@ -387,6 +393,12 @@ namespace Tango.MachineStudio.RML.ViewModels input.UseLubricantTransform = RML.UseLubricantTransform; input.VMax = RML.VMax; + input.SetPredictionType(RML.PredictionType); + input.SetPredictionMethod(RML.PredictionMethod); + input.CMYKVHueThreshhold = RML.CmykvHueThreshold; + input.CMYKVK = RML.KNearestK; + input.SimpleRGBPreviewFactor = RML.SimpleRgbPreviewFactor; + foreach (var vm in LiquidsCalibrationData.Where(x => x.LiquidType.HasPigment)) { InputLiquid inputLiquid = new InputLiquid(); 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 e3c128cb7..db0d7e2aa 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 @@ -348,9 +348,33 @@ namespace Tango.MachineStudio.RML.ViewModels BatchConversionCommand = new RelayCommand(BatchConversion); } - public override void OnApplicationReady() + public override async void OnApplicationReady() { + using (_notification.PushTaskItem("Loading color measurements...")) + { + using (var db = ObservablesContext.CreateDefault()) + { + var measurements = await db.ColorMeasurements.ToListAsync(); + List<PMR.ColorLab.ColorMeasurement> pmrMeasurements = new List<PMR.ColorLab.ColorMeasurement>(); + foreach (var m in measurements) + { + pmrMeasurements.Add(new PMR.ColorLab.ColorMeasurement() + { + C = m.C, + M = m.M, + Y = m.Y, + K = m.K, + V = m.V, + L = m.L, + A = m.A, + B = m.B, + }); + } + + DefaultColorConverter.SetMeasurements(pmrMeasurements); + } + } } private async Task LoadRmls() 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 8730355cc..cdacbae60 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 @@ -23,13 +23,14 @@ <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter"/> <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter"/> + <converters:EnumToVisibilityConverter x:Key="EnumToVisibilityConverter" /> <ObjectDataProvider x:Key="Plies" ObjectType="{x:Type sys:Enum}" MethodName="GetValues"> <ObjectDataProvider.MethodParameters> <x:Type TypeName="enumerations:Plies"/> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> - + </UserControl.Resources> <Grid Margin="20"> @@ -105,7 +106,7 @@ <TextBlock Text="Condition:" ></TextBlock> <ComboBox ItemsSource="{Binding Conditions}" SelectedItem="{Binding ActiveRML.MediaCondition,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox>--> - + <TextBlock Text="Linear Density:" ></TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="9999" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.FiberSize,Mode=TwoWay}" FontSize="16"></mahapps:NumericUpDown> @@ -124,7 +125,7 @@ <TextBlock Text="Count (den):" ></TextBlock> <TextBlock Text="{Binding ActiveRML.DencityCount}" Foreground="Blue" ></TextBlock> - + <!--<TextBlock Text="Fiber Shape:" ></TextBlock> <ComboBox ItemsSource="{Binding FiberShapes}" SelectedItem="{Binding ActiveRML.FiberShape,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox>--> @@ -139,7 +140,7 @@ <!--<TextBlock Text="Plies Per Thread:" ></TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.PliesPerThread,Mode=TwoWay}"></mahapps:NumericUpDown>--> - + <!--<TextBlock Text="Tensile Strength:" ></TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.TensileStrength,Mode=TwoWay}"></mahapps:NumericUpDown> @@ -224,11 +225,12 @@ </Grid> </Border> <Grid DockPanel.Dock="Top" Background="#35B5B5B5" Margin="20 0"> - <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> + <ScrollViewer HorizontalScrollBarVisibility="Disabled"> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <Grid> <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"> + <Image Source="../Images/data-table.png" Height="20" Opacity="0.8" ></Image> + <StackPanel VerticalAlignment="Center" Margin="5 20 5 10"> <StackPanel> <StackPanel> @@ -286,7 +288,7 @@ </StackPanel> </StackPanel> - <TextBlock Margin="0 40 0 0" Text="Color Conversion Version:" HorizontalAlignment="Center"></TextBlock> + <TextBlock Margin="0 20 0 0" Text="Color Conversion Version:" HorizontalAlignment="Center"></TextBlock> <mahapps:NumericUpDown Minimum="1" Maximum="6" Value="{Binding ActiveRML.ColorConversionVersion}" HorizontalContentAlignment="Center" Background="Transparent" BorderBrush="{StaticResource DimGrayBrush}" HasDecimals="False" Margin="0 5 0 0" /> <CheckBox ToolTip="Use the color conversion engine to generate gradients" IsChecked="{Binding ActiveRML.UseColorLibGradients}" HorizontalAlignment="Left" Margin="0 20 0 0">Enable Gradient Generation</CheckBox> @@ -297,10 +299,36 @@ <TextBlock VerticalAlignment="Center" Text="V-Max:" ></TextBlock> <mahapps:NumericUpDown Minimum="1" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" HorizontalAlignment="Right" Width="100" Value="{Binding ActiveRML.VMax,Mode=TwoWay}"></mahapps:NumericUpDown> </DockPanel> - </StackPanel> + + <Separator Margin="0 40 0 0" Foreground="Cyan" Background="Violet" Height="2" /> + <TextBlock Margin="0 10 0 0" Text="CMYKV Prediction Type" FontSize="10"></TextBlock> + <ComboBox Margin="0 5 0 0" Style="{StaticResource TransparentComboBoxStyle}" ItemsSource="{Binding Source={x:Type enumerations:CMYKVPredictionTypes},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding ActiveRML.PredictionType}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></ComboBox> + + <StackPanel Visibility="{Binding ActiveRML.PredictionType,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Predict_CMYKV,Predict_RGB,PredictAll'}"> + <TextBlock Margin="0 20 0 0" Text="CMYKV Prediction Method" FontSize="10"></TextBlock> + <ComboBox Margin="0 5 0 0" Style="{StaticResource TransparentComboBoxStyle}" ItemsSource="{Binding Source={x:Type enumerations:CMYKVPredictionMethods},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding ActiveRML.PredictionMethod}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></ComboBox> + + <StackPanel Margin="0 20 0 0" Visibility="{Binding ActiveRML.PredictionMethod,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='KNearestNeighbors'}"> + <TextBlock FontSize="10" Text="K-Value:"></TextBlock> + <mahapps:NumericUpDown Minimum="5" Maximum="1000" Value="{Binding ActiveRML.KNearestK}" HorizontalContentAlignment="Center" Background="Transparent" BorderBrush="{StaticResource DimGrayBrush}" HasDecimals="False" Margin="0 5 0 0" /> + </StackPanel> + + <TextBlock FontSize="10" Margin="0 20 0 0" Text="Hue Threshold:"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="360" Value="{Binding ActiveRML.CmykvHueThreshold}" HorizontalContentAlignment="Center" Background="Transparent" BorderBrush="{StaticResource DimGrayBrush}" HasDecimals="True" Margin="0 5 0 0" /> + </StackPanel> + + <StackPanel Visibility="{Binding ActiveRML.PredictionType,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='SimpleRGBPreview'}"> + <TextBlock FontSize="10" Margin="0 20 0 0"> + <Run>Blending Factor:</Run> + <Run Text="{Binding ActiveRML.SimpleRgbPreviewFactor,StringFormat=N2,Mode=OneWay}"></Run> + </TextBlock> + <Slider Minimum="0.1" Maximum="1" Value="{Binding ActiveRML.SimpleRgbPreviewFactor}" Margin="0 5 0 0" SmallChange="0.01" /> + </StackPanel> + </StackPanel> </StackPanel> </Grid> </StackPanel> + </ScrollViewer> </Grid> </DockPanel> </Grid> |
