diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-24 16:59:20 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-24 16:59:20 +0300 |
| commit | 3d1002b25ebc05c88336dc56ec03f627fd49d200 (patch) | |
| tree | 0a97f20cfd0acf25f354554fd1790f072b3aac8d /Software/Visual_Studio | |
| parent | 615311366218b9db2cdf5067b207743f41e95b8d (diff) | |
| download | Tango-3d1002b25ebc05c88336dc56ec03f627fd49d200.tar.gz Tango-3d1002b25ebc05c88336dc56ec03f627fd49d200.zip | |
Fixed issue with light touch scroll viewer.
Implemented PPC color fine tuning.
Diffstat (limited to 'Software/Visual_Studio')
37 files changed, 1373 insertions, 236 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteView.xaml new file mode 100644 index 000000000..cbec4afd8 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteView.xaml @@ -0,0 +1,115 @@ +<UserControl x:Class="Tango.PPC.Jobs.Dialogs.FineTuningPaletteView" + 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive" + xmlns:local="clr-namespace:Tango.PPC.Jobs.Dialogs" + mc:Ignorable="d" + d:DesignHeight="800" d:DesignWidth="600" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=local:FineTuningPaletteViewVM, IsDesignTimeCreatable=False}"> + <Grid> + <DockPanel Margin="20"> + <StackPanel DockPanel.Dock="Top"> + <TextBlock FontSize="{StaticResource TangoMessageBoxTitleFontSize}">Fine Tuning Palette</TextBlock> + <TextBlock Margin="0 30 0 0">Choose fine tuning palette:</TextBlock> + + <touch:TouchFlatListBox Margin="50 40 50 0" ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}" IsEnabled="False"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="{Binding Suggestions.Count}"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + + <ItemsControl.ItemTemplate> + <DataTemplate> + <ContentControl Width="70" Height="70" Margin="50 0"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <Ellipse Width="70" Height="70" Fill="{Binding Brush}" HorizontalAlignment="Center"> + <Ellipse.Effect> + <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="10" Direction="10" BlurRadius="15" Opacity="1" /> + </Ellipse.Effect> + </Ellipse> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <Grid> + <Ellipse Fill="{Binding Brush}" Width="60" Height="60"></Ellipse> + <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" Margin="-1" StrokeThickness="3" StrokeDashArray="2" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}"></Ellipse> + </Grid> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </DataTemplate> + </ItemsControl.ItemTemplate> + </touch:TouchFlatListBox> + + <ItemsControl Margin="0 40 0 0" ItemsSource="{Binding Suggestions}" Height="20"> + <ItemsControl.Clip> + <RectangleGeometry RadiusX="10" RadiusY="10"> + <RectangleGeometry.Rect> + <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualHeight"></Binding> + </MultiBinding> + </RectangleGeometry.Rect> + </RectangleGeometry> + </ItemsControl.Clip> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="{Binding Suggestions.Count}"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Rectangle Fill="{Binding Brush}"></Rectangle> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + </StackPanel> + + <DockPanel DockPanel.Dock="Bottom" LastChildFill="False"> + <touch:TouchButton DockPanel.Dock="Left" Command="{Binding CloseCommand}" CornerRadius="25" Style="{StaticResource TangoHollowButton}" Width="170" Height="50"> + CANCEL + </touch:TouchButton> + <touch:TouchButton DockPanel.Dock="Right" Command="{Binding OKCommand}" CornerRadius="25" Style="{StaticResource TangoHollowButton}" Width="170" Height="50"> + OK + </touch:TouchButton> + </DockPanel> + + <hive:HexList Width="340" Height="460" Margin="0 40 0 0" RowCount="6" ColumnCount="5" ItemsSource="{Binding HiveSuggestions}" SelectedItem="{Binding SelectedHiveSuggestion,Mode=TwoWay}"> + <hive:HexList.ItemContainerStyle> + <Style TargetType="ListBoxItem"> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Grid.Column" Value="{Binding Path=Column}"></Setter> + <Setter Property="Grid.Row" Value="{Binding Path=Row}"></Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ListBoxItem"> + <Grid Margin="10"> + <Ellipse Fill="{Binding Brush}"></Ellipse> + <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" Margin="-4" StrokeThickness="3" StrokeDashArray="2" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}"></Ellipse> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </hive:HexList.ItemContainerStyle> + </hive:HexList> + + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteView.xaml.cs new file mode 100644 index 000000000..258bb31fa --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteView.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.PPC.Jobs.Dialogs +{ + /// <summary> + /// Interaction logic for FineTuningPaletteView.xaml + /// </summary> + public partial class FineTuningPaletteView : UserControl + { + public FineTuningPaletteView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteViewVM.cs new file mode 100644 index 000000000..d9554575e --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteViewVM.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.ColorConversion; +using Tango.BL.Entities; +using Tango.PPC.Jobs.Models; +using Tango.SharedUI; + +namespace Tango.PPC.Jobs.Dialogs +{ + public class FineTuningPaletteViewVM : DialogViewVM + { + private Job _job; + private bool _prevent_change; + + private List<ColorConversionSuggestion> _suggestions; + public List<ColorConversionSuggestion> Suggestions + { + get { return _suggestions; } + set { _suggestions = value; RaisePropertyChangedAuto(); } + } + + private List<ColorConversionSuggestion> _hiveSuggestions; + public List<ColorConversionSuggestion> HiveSuggestions + { + get { return _hiveSuggestions; } + set { _hiveSuggestions = value; RaisePropertyChangedAuto(); } + } + + private ColorConversionSuggestion _selectedHiveSuggestion; + public ColorConversionSuggestion SelectedHiveSuggestion + { + get { return _selectedHiveSuggestion; } + set { _selectedHiveSuggestion = value; RaisePropertyChangedAuto(); OnSelectedHiveSuggestionChanged(); } + } + + private ColorConversionSuggestion _selectedSuggestion; + public ColorConversionSuggestion SelectedSuggestion + { + get { return _selectedSuggestion; } + set { _selectedSuggestion = value; RaisePropertyChangedAuto(); } + } + + public FineTuningPaletteViewVM() + { + Suggestions = new List<ColorConversionSuggestion>(); + HiveSuggestions = new List<ColorConversionSuggestion>(); + } + + private void OnSelectedHiveSuggestionChanged() + { + if (!_prevent_change) + { + Suggestions = TangoColorConverter.CreateTrippletSuggestions(TangoColorConverter.GetSuggestions(_job, SelectedHiveSuggestion.Color)); + SelectedSuggestion = Suggestions[Suggestions.Count / 2]; + } + } + + public FineTuningPaletteViewVM(FineTuneItem fineTuneItem, Job job) : this() + { + _prevent_change = true; + _job = job; + Suggestions = fineTuneItem.Suggestions; + HiveSuggestions = fineTuneItem.HiveSuggestions; + SelectedHiveSuggestion = HiveSuggestions.GetCenterSuggestion(); + SelectedSuggestion = Suggestions[Suggestions.Count / 2]; + _prevent_change = false; + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/color-fine-tuning.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/color-fine-tuning.png Binary files differnew file mode 100644 index 000000000..5b8201eef --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/color-fine-tuning.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/color-picker.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/color-picker.png Binary files differnew file mode 100644 index 000000000..e09d23190 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/color-picker.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/FineTuneItem.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/FineTuneItem.cs new file mode 100644 index 000000000..195410d2c --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/FineTuneItem.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.ColorConversion; +using Tango.BL.Entities; +using Tango.Core; +using Tango.PMR.ColorLab; + +namespace Tango.PPC.Jobs.Models +{ + public class FineTuneItem : ExtendedObject + { + public event Action SelectedChanged; + + public List<BrushStop> BrushStops { get; set; } + + private List<ColorConversionSuggestion> _suggestions; + public List<ColorConversionSuggestion> Suggestions + { + get { return _suggestions; } + set { _suggestions = value; RaisePropertyChangedAuto(); } + } + + private List<ColorConversionSuggestion> _hiveSuggestions; + public List<ColorConversionSuggestion> HiveSuggestions + { + get { return _hiveSuggestions; } + set { _hiveSuggestions = value; RaisePropertyChangedAuto(); } + } + + private bool _isSelected; + public bool IsSelected + { + get { return _isSelected; } + set { _isSelected = value; RaisePropertyChangedAuto(); SelectedChanged?.Invoke(); } + } + + private ColorConversionSuggestion _selectedSuggestion; + public ColorConversionSuggestion SelectedSuggestion + { + get { return _selectedSuggestion; } + set { _selectedSuggestion = value; RaisePropertyChangedAuto(); } + } + + private ColorConversionSuggestion _selectedHiveSuggestion; + public ColorConversionSuggestion SelectedHiveSuggestion + { + get { return _selectedHiveSuggestion; } + set { _selectedHiveSuggestion = value; RaisePropertyChangedAuto(); } + } + + public FineTuneItem() + { + Suggestions = new List<ColorConversionSuggestion>(); + BrushStops = new List<BrushStop>(); + } + + public FineTuneItem(ConversionOutput conversionOutput) : this() + { + Suggestions = TangoColorConverter.CreateTrippletSuggestions(conversionOutput); + HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(conversionOutput); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobNavigationObject.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobNavigationObject.cs index 1807f8294..30edee34a 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobNavigationObject.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobNavigationObject.cs @@ -17,5 +17,6 @@ namespace Tango.PPC.Jobs.NavigationObjects { Default, SampleDye, + FineTuning, } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index 3a7ac381d..3c63513f1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -92,6 +92,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Dialogs\FineTuningPaletteView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Dialogs\JobTypePickerView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -157,6 +161,10 @@ <DependentUpon>BasicColorCorrectionView.xaml</DependentUpon> </Compile> <Compile Include="Dialogs\BasicColorCorrectionViewVM.cs" /> + <Compile Include="Dialogs\FineTuningPaletteView.xaml.cs"> + <DependentUpon>FineTuningPaletteView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\FineTuningPaletteViewVM.cs" /> <Compile Include="Dialogs\JobTypePickerView.xaml.cs"> <DependentUpon>JobTypePickerView.xaml</DependentUpon> </Compile> @@ -166,6 +174,7 @@ <Compile Include="Messages\JobRemovedMessage.cs" /> <Compile Include="Messages\JobSavedMessage.cs" /> <Compile Include="Messages\JobSelectedMessage.cs" /> + <Compile Include="Models\FineTuneItem.cs" /> <Compile Include="NavigationObjects\JobNavigationObject.cs" /> <Compile Include="Properties\AssemblyInfo.cs"> <SubType>Code</SubType> @@ -334,6 +343,12 @@ <ItemGroup> <Folder Include="Images\NotificationItems\" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\JobView\color-fine-tuning.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\JobView\color-picker.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobView.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobView.cs index 345dced81..36630bffa 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobView.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobView.cs @@ -10,5 +10,6 @@ namespace Tango.PPC.Jobs.ViewContracts public interface IJobView : IPPCView { void DisplaySampleDye(); + void DisplayFineTuning(); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index f3e7711f9..023d91531 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -25,6 +25,8 @@ using Tango.SharedUI.Helpers; using Tango.PPC.Common.Navigation; using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.ViewContracts; +using System.Collections.ObjectModel; +using Tango.PPC.Jobs.Models; namespace Tango.PPC.Jobs.ViewModels { @@ -39,19 +41,10 @@ namespace Tango.PPC.Jobs.ViewModels private Thread _check_gamut_thread; private Job _job_to_load; private JobNavigationIntent _job_to_load_intent; + private static Dictionary<String, List<FineTuneItem>> _jobs_fine_tune_items; #region Properties - private BL.Enumerations.JobStatuses _jobStatus; - /// <summary> - /// Gets or sets the temporary job status. - /// </summary> - public BL.Enumerations.JobStatuses JobStatus - { - get { return _jobStatus; } - set { _jobStatus = value; RaisePropertyChangedAuto(); } - } - private Job _job; /// <summary> /// Gets or sets the selected job. @@ -131,6 +124,46 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> public AutoCompleteProvider<Customer> CustomersAutoCompleteProvider { get; set; } + private ObservableCollection<FineTuneItem> _fineTuneItems; + /// <summary> + /// Gets or sets the fine tune items. + /// </summary> + public ObservableCollection<FineTuneItem> FineTuneItems + { + get { return _fineTuneItems; } + set { _fineTuneItems = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection<FineTuneItem> _approvalFineTuneItems; + /// <summary> + /// Gets or sets the fine tune items. + /// </summary> + public ObservableCollection<FineTuneItem> ApprovalFineTuneItems + { + get { return _approvalFineTuneItems; } + set { _approvalFineTuneItems = value; RaisePropertyChangedAuto(); } + } + + private bool _isFineTuneExpanded; + /// <summary> + /// Gets or sets a value indicating whether the fine tuning region is expanded. + /// </summary> + public bool IsFineTuneExpanded + { + get { return _isFineTuneExpanded; } + set + { + _isFineTuneExpanded = value; + RaisePropertyChangedAuto(); + + if (_isFineTuneExpanded) + { + SyncFineTuneItemsToBrushStops(); + } + } + } + + #endregion #region Commands @@ -214,17 +247,54 @@ namespace Tango.PPC.Jobs.ViewModels /// Gets or sets another sample command. /// </summary> public RelayCommand AnotherSampleCommand { get; set; } + + /// <summary> + /// Gets or sets the invoke fine tuning palette command. + /// </summary> + public RelayCommand<FineTuneItem> InvokeFineTuningPaletteCommand { get; set; } + + /// <summary> + /// Gets or sets the reset fine tuning command. + /// </summary> + public RelayCommand ResetFineTuningCommand { get; set; } + + /// <summary> + /// Gets or sets the start fine tuning command. + /// </summary> + public RelayCommand StartFineTuningCommand { get; set; } + + /// <summary> + /// Gets or sets the approve fine tuning command. + /// </summary> + public RelayCommand ApproveFineTuningCommand { get; set; } + + /// <summary> + /// Gets or sets the repeat fine tuning command. + /// </summary> + public RelayCommand RepeatFineTuningCommand { get; set; } + #endregion #region Constructors /// <summary> + /// Initializes the <see cref="JobViewVM"/> class. + /// </summary> + static JobViewVM() + { + _jobs_fine_tune_items = new Dictionary<string, List<FineTuneItem>>(); + } + + /// <summary> /// Initializes a new instance of the <see cref="JobViewVM"/> class. /// </summary> public JobViewVM() { RegisterForMessage<JobSelectedMessage>(HandleJobSelectedMessage); + FineTuneItems = new ObservableCollection<FineTuneItem>(); + ApprovalFineTuneItems = new ObservableCollection<FineTuneItem>(); + CustomersAutoCompleteProvider = new AutoCompleteProvider<Customer>((customer, filter) => { return customer.Name.ToLower().StartsWith(filter != null ? filter.ToLower() : String.Empty); @@ -268,6 +338,11 @@ namespace Tango.PPC.Jobs.ViewModels ApproveSampleCommand = new RelayCommand(ApproveSampleDye); RepeatSampleDyeCommand = new RelayCommand(RepeatSampleDye); AnotherSampleCommand = new RelayCommand(DyeAnotherSample); + InvokeFineTuningPaletteCommand = new RelayCommand<FineTuneItem>(InvokeFineTuningPalette); + ResetFineTuningCommand = new RelayCommand(ResetFineTuning); + StartFineTuningCommand = new RelayCommand(StartFineTuning, () => FineTuneItems.Any(x => x.IsSelected)); + RepeatFineTuningCommand = new RelayCommand(RepeatFineTuning); + ApproveFineTuningCommand = new RelayCommand(ApproveFineTuning); } #endregion @@ -275,15 +350,62 @@ namespace Tango.PPC.Jobs.ViewModels #region Job Management /// <summary> - /// Saves the job. + /// Loads the job. /// </summary> - private async void SaveJob(bool displayNotification = true) + private async void LoadJob() { - if (JobStatus != BL.Enumerations.JobStatuses.Draft) + if (!(_job_to_load == null || (_job_to_load != null && Job != null && _job_to_load.Guid == Job.Guid))) + { + NotificationProvider.SetGlobalBusyMessage("Loading job details..."); + + _can_navigate_back = false; + base.OnNavigatedTo(); + + _db = ObservablesContext.CreateDefault(); + var a = _db.Jobs.ToList(); + Job = await _db.Jobs.SingleOrDefaultAsync(x => x.Guid == _job_to_load.Guid); + Job.ValidateOnPropertyChanged = true; + Rmls = await _db.Rmls.ToListAsync(); + ColorSpaces = await _db.ColorSpaces.ToListAsync(); + SpoolTypes = await _db.SpoolTypes.ToListAsync(); + Customers = await _db.Customers.Where(x => x.OrganizationGuid == MachineProvider.Machine.OrganizationGuid).ToListAsync(); + + if (!_check_gamut_thread.IsAlive) + { + _check_gamut_thread.Start(); + } + + SegmentsCollectionView = CollectionViewSource.GetDefaultView(Job.Segments); + SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Segment.SegmentIndex), ListSortDirection.Ascending)); + + InvokeUIOnIdle(() => + { + NotificationProvider.ReleaseGlobalBusyMessage(); + }); + + _job_to_load = null; + } + + if (!_jobs_fine_tune_items.ContainsKey(Job.Guid) && Job.JobFineTuningStatus == BL.Enumerations.FineTuningStatuses.PendingApproval) { - Job.JobStatus = JobStatus; + Job.JobFineTuningStatus = BL.Enumerations.FineTuningStatuses.Unspecified; } + if (Job.JobEditingState == BL.Enumerations.EditingStates.SampleDye && Job.JobSampleDyeStatus == BL.Enumerations.SampleDyeStatuses.PendingApproval) + { + View.DisplaySampleDye(); + } + else if (Job.JobEditingState == BL.Enumerations.EditingStates.FineTuning && Job.JobFineTuningStatus == BL.Enumerations.FineTuningStatuses.PendingApproval) + { + View.DisplayFineTuning(); + } + } + + /// <summary> + /// Saves the job. + /// </summary> + private async void SaveJob(bool displayNotification = true) + { if (Job.Validate(_db)) { await _db.SaveChangesAsync(); @@ -310,12 +432,18 @@ namespace Tango.PPC.Jobs.ViewModels } } + /// <summary> + /// Starts the job. + /// </summary> private void StartJob() { MachineProvider.MachineOperator.Print(Job); NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); } + /// <summary> + /// Determines whether this instance [can start job]. + /// </summary> private bool CanStartJob() { return @@ -488,7 +616,7 @@ namespace Tango.PPC.Jobs.ViewModels { Job sampleDyeJob = Job.Clone(); sampleDyeJob.Guid = Job.Guid; - sampleDyeJob.IsSample = true; + sampleDyeJob.Designation = BL.Enumerations.JobDesignations.SampleDye; sampleDyeJob.Name = Job.Name + " (sample)"; if (Job.JobType == BL.Enumerations.JobTypes.Embroidery) @@ -508,14 +636,17 @@ namespace Tango.PPC.Jobs.ViewModels SaveJob(false); var thisJob = Job; + var thisContext = _db; - MachineProvider.MachineOperator.Print(sampleDyeJob).Completed += (x, e) => + MachineProvider.MachineOperator.Print(sampleDyeJob).Completed += async (x, e) => { thisJob.JobStatus = BL.Enumerations.JobStatuses.PendingApproval; if (Job != null && Job.Guid == thisJob.Guid) { - JobStatus = BL.Enumerations.JobStatuses.PendingApproval; + thisJob.JobEditingState = BL.Enumerations.EditingStates.SampleDye; + thisJob.JobSampleDyeStatus = BL.Enumerations.SampleDyeStatuses.PendingApproval; + await thisContext.SaveChangesAsync(); } }; @@ -527,7 +658,8 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> private void RepeatSampleDye() { - JobStatus = BL.Enumerations.JobStatuses.Draft; + Job.JobEditingState = BL.Enumerations.EditingStates.Default; + Job.JobSampleDyeStatus = BL.Enumerations.SampleDyeStatuses.Unspecified; } /// <summary> @@ -535,7 +667,10 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> private void ApproveSampleDye() { - JobStatus = BL.Enumerations.JobStatuses.Approved; + Job.JobEditingState = BL.Enumerations.EditingStates.Default; + Job.JobSampleDyeStatus = BL.Enumerations.SampleDyeStatuses.Approved; + + Job.SampleDyeApproveDate = DateTime.UtcNow; SaveJob(false); } @@ -544,7 +679,130 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> private void DyeAnotherSample() { - JobStatus = BL.Enumerations.JobStatuses.Draft; + Job.JobEditingState = BL.Enumerations.EditingStates.Default; + Job.JobSampleDyeStatus = BL.Enumerations.SampleDyeStatuses.Unspecified; + } + + #endregion + + #region Fine Tuning + + /// <summary> + /// Synchronizes the fine tune items to brush stops. + /// </summary> + private void SyncFineTuneItemsToBrushStops() + { + if (Job != null) + { + if (_jobs_fine_tune_items.ContainsKey(Job.Guid)) + { + FineTuneItems = _jobs_fine_tune_items[Job.Guid].ToObservableCollection(); + } + else + { + FineTuneItems.Clear(); + + foreach (var stop in Job.Segments.SelectMany(x => x.BrushStops).DistinctBy(x => x.Color)) + { + FineTuneItem item = new FineTuneItem(TangoColorConverter.GetSuggestions(stop)); + item.BrushStops = Job.Segments.SelectMany(x => x.BrushStops).Where(x => x.Color == stop.Color).ToList(); + item.SelectedSuggestion = item.Suggestions[item.Suggestions.Count / 2]; + item.SelectedChanged += () => StartFineTuningCommand.RaiseCanExecuteChanged(); + FineTuneItems.Add(item); + } + + _jobs_fine_tune_items[Job.Guid] = FineTuneItems.ToList(); + } + + ApprovalFineTuneItems = FineTuneItems.Where(x => x.IsSelected).ToObservableCollection(); + + StartFineTuningCommand.RaiseCanExecuteChanged(); + } + } + + private async void InvokeFineTuningPalette(FineTuneItem fineTuneItem) + { + FineTuningPaletteViewVM vm = new FineTuningPaletteViewVM(fineTuneItem, Job); + await NotificationProvider.ShowDialog(vm); + + if (vm.DialogResult) + { + fineTuneItem.Suggestions = vm.Suggestions; + fineTuneItem.SelectedSuggestion = vm.SelectedSuggestion; + } + } + + private void ResetFineTuning() + { + SyncFineTuneItemsToBrushStops(); + } + + private void StartFineTuning() + { + try + { + Job fineTuneJob = Job.Clone(); + fineTuneJob.NumberOfUnits = 1; + fineTuneJob.Designation = BL.Enumerations.JobDesignations.FineTuning; + fineTuneJob.Guid = Job.Guid; + fineTuneJob.Name = Job.Name + " (fine tuning)"; + fineTuneJob.Segments.Clear(); + + foreach (var suggestion in FineTuneItems.Where(x => x.IsSelected).SelectMany(x => x.Suggestions)) + { + var segment = fineTuneJob.AddSolidSegment(suggestion.Color); + } + + _jobs_fine_tune_items[Job.Guid] = FineTuneItems.ToList(); + + var thisJob = Job; + var thisContext = _db; + + MachineProvider.MachineOperator.Print(fineTuneJob).Completed += async (x, e) => + { + thisJob.JobEditingState = BL.Enumerations.EditingStates.FineTuning; + thisJob.JobFineTuningStatus = BL.Enumerations.FineTuningStatuses.PendingApproval; + await thisContext.SaveChangesAsync(); + }; + + NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); + } + catch (Exception ex) + { + LogManager.Log(ex); + NotificationProvider.ShowError(ex.Message); + } + } + + private void ApproveFineTuning() + { + Job.JobEditingState = BL.Enumerations.EditingStates.Default; + Job.JobFineTuningStatus = BL.Enumerations.FineTuningStatuses.Approved; + + foreach (var item in ApprovalFineTuneItems) + { + foreach (var stop in item.BrushStops) + { + stop.Color = item.SelectedSuggestion.Color; + } + } + + + Job.FineTuningApproveDate = DateTime.UtcNow; + SaveJob(false); + + if (_jobs_fine_tune_items.ContainsKey(Job.Guid)) + { + _jobs_fine_tune_items.Remove(Job.Guid); + } + + SyncFineTuneItemsToBrushStops(); + } + + private void RepeatFineTuning() + { + Job.JobEditingState = BL.Enumerations.EditingStates.Default; + Job.JobFineTuningStatus = BL.Enumerations.FineTuningStatuses.Unspecified; } #endregion @@ -593,50 +851,9 @@ namespace Tango.PPC.Jobs.ViewModels /// <summary> /// Called when the navigation system has navigated to this VM view. /// </summary> - public async override void OnNavigatedTo() + public override void OnNavigatedTo() { - if (!(_job_to_load == null || (_job_to_load != null && Job != null && _job_to_load.Guid == Job.Guid))) - { - NotificationProvider.SetGlobalBusyMessage("Loading job details..."); - - _can_navigate_back = false; - base.OnNavigatedTo(); - - if (_db != null) - { - _db.Dispose(); - } - - _db = ObservablesContext.CreateDefault(); - var a = _db.Jobs.ToList(); - Job = await _db.Jobs.SingleOrDefaultAsync(x => x.Guid == _job_to_load.Guid); - Job.ValidateOnPropertyChanged = true; - Rmls = await _db.Rmls.ToListAsync(); - ColorSpaces = await _db.ColorSpaces.ToListAsync(); - SpoolTypes = await _db.SpoolTypes.ToListAsync(); - Customers = await _db.Customers.Where(x => x.OrganizationGuid == MachineProvider.Machine.OrganizationGuid).ToListAsync(); - - if (!_check_gamut_thread.IsAlive) - { - _check_gamut_thread.Start(); - } - - SegmentsCollectionView = CollectionViewSource.GetDefaultView(Job.Segments); - SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Segment.SegmentIndex), ListSortDirection.Ascending)); - - InvokeUIOnIdle(() => - { - NotificationProvider.ReleaseGlobalBusyMessage(); - }); - - _job_to_load = null; - } - - if (_job_to_load_intent == JobNavigationIntent.SampleDye) - { - JobStatus = Job.JobStatus; - View.DisplaySampleDye(); - } + LoadJob(); } /// <summary> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs index 5c66f045b..28ff1793b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs @@ -30,7 +30,7 @@ namespace Tango.PPC.Jobs.ViewModels private void MachineOperator_PrintingCompleted(object sender, Integration.Operation.PrintingEventArgs e) { - if (e.Job.IsSample) + if (e.Job.Designation == BL.Enumerations.JobDesignations.SampleDye) { NotificationProvider.PushNotification(new MessageNotificationItem("Sample completed successfully.", MessageNotificationItem.MessageNotificationItemTypes.Success, () => { @@ -38,6 +38,14 @@ namespace Tango.PPC.Jobs.ViewModels NavigationManager.ClearHistoryExcept<JobsView>(); })); } + else if (e.Job.Designation == BL.Enumerations.JobDesignations.FineTuning) + { + NotificationProvider.PushNotification(new MessageNotificationItem("Fine tuning completed successfully.", MessageNotificationItem.MessageNotificationItemTypes.Success, () => + { + NavigationManager.NavigateWithObject<JobsModule, JobView, JobNavigationObject>(new JobNavigationObject() { Job = e.Job, Intent = JobNavigationIntent.FineTuning }); + NavigationManager.ClearHistoryExcept<JobsView>(); + })); + } else { NotificationProvider.PushNotification(new MessageNotificationItem("Job completed successfully.", MessageNotificationItem.MessageNotificationItemTypes.Success, () => diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index bfd571db0..8933940b2 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -564,7 +564,7 @@ </StackPanel> </Border>--> - <touch:TouchExpander x:Name="expander_sample_dye" Margin="0 0 0 120" Padding="20 15"> + <touch:TouchExpander x:Name="expander_sample_dye" Margin="0 0 0 0" Padding="20 15"> <touch:TouchExpander.Header> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> <Image Source="../Images/JobView/sample-dye.png" Width="39" /> @@ -645,7 +645,7 @@ </Setter> <Style.Triggers> - <DataTrigger Binding="{Binding JobStatus}" Value="{x:Static enumerations:JobStatuses.PendingApproval}"> + <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}"> <Setter Property="Content"> <Setter.Value> <StackPanel> @@ -680,14 +680,14 @@ </Setter> </DataTrigger> - <DataTrigger Binding="{Binding JobStatus}" Value="{x:Static enumerations:JobStatuses.Approved}"> + <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.Approved}"> <Setter Property="Content"> <Setter.Value> <StackPanel Margin="0 40 80 40"> <DockPanel LastChildFill="False"> <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> <Run>Sample Approved:</Run> - <Run Text="{Binding Job.LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter}}"></Run> + <Run Text="{Binding Job.SampleDyeApproveDate,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=''}"></Run> </TextBlock> <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding AnotherSampleCommand}"> <StackPanel Orientation="Horizontal"> @@ -706,6 +706,238 @@ </ContentControl> </StackPanel> </touch:TouchExpander> + + <touch:TouchExpander x:Name="expander_fine_tuning" Margin="0 20 0 120" Padding="20 15" IsExpanded="{Binding IsFineTuneExpanded,Mode=TwoWay}"> + <touch:TouchExpander.Header> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> + <Image Source="../Images/JobView/color-fine-tuning.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color Fine Tuning</TextBlock> + </StackPanel> + </touch:TouchExpander.Header> + + <StackPanel Margin="60 20 0 0"> + + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <TextBlock>Select the colors you want to fine tune.</TextBlock> + + <StackPanel HorizontalAlignment="Center" Margin="0 40 0 0"> + <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Defined Colors</TextBlock> + + <ItemsControl Margin="0 40 0 0" ItemsSource="{Binding FineTuneItems}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel> + <touch:TouchCheckBox DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" Margin="0 0 20 0" /> + <touch:TouchImageButton DockPanel.Dock="Right" Image="../Images/JobView/color-picker.png" Width="80" Height="80" Padding="15" CornerRadius="100" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.InvokeFineTuningPaletteCommand}" CommandParameter="{Binding}"></touch:TouchImageButton> + <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}" IsEnabled="False"> + <touch:TouchFlatListBox.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid> + </ItemsPanelTemplate> + </touch:TouchFlatListBox.ItemsPanel> + <touch:TouchFlatListBox.ItemTemplate> + <DataTemplate> + <Ellipse Width="70" Height="70" Fill="{Binding Brush}" Margin="30 0"> + <Ellipse.Style> + <Style TargetType="Ellipse"> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> + <Setter Property="Effect"> + <Setter.Value> + <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="10" Direction="10" BlurRadius="15" Opacity="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Ellipse.Style> + </Ellipse> + </DataTemplate> + </touch:TouchFlatListBox.ItemTemplate> + </touch:TouchFlatListBox> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + + <DockPanel LastChildFill="False" Margin="0 80 0 0"> + <touch:TouchButton Command="{Binding ResetFineTuningCommand}" DockPanel.Dock="Left" Padding="40 10" Margin="-30 0 0 0" Style="{StaticResource TangoFlatButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}">Reset</touch:TouchButton> + + <touch:TouchButton Margin="0 0 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartFineTuningCommand}"> + START + </touch:TouchButton> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.PendingApproval}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Margin="0 20 0 0"> + <StackPanel Orientation="Horizontal"> + <Grid> + <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">1</TextBlock> + </Grid> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">Select the best variation for each color:</TextBlock> + </StackPanel> + + <ItemsControl Margin="65 40 120 0" ItemsSource="{Binding ApprovalFineTuneItems}" AlternationCount="1000"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel> + <TextBlock Margin="0 0 20 0" VerticalAlignment="Center"> + <Run>Color</Run> + <Run>#</Run><Run Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(ItemsControl.AlternationIndex),Mode=OneWay,Converter={StaticResource MathOperatorConverter},ConverterParameter='+1'}"></Run> + </TextBlock> + <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}"> + <touch:TouchFlatListBox.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid> + </ItemsPanelTemplate> + </touch:TouchFlatListBox.ItemsPanel> + <touch:TouchFlatListBox.ItemTemplate> + <DataTemplate> + <Ellipse Width="70" Height="70" Fill="{Binding Brush}" Margin="30 0"> + <Ellipse.Style> + <Style TargetType="Ellipse"> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> + <Setter Property="Effect"> + <Setter.Value> + <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="10" Direction="10" BlurRadius="15" Opacity="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Ellipse.Style> + </Ellipse> + </DataTemplate> + </touch:TouchFlatListBox.ItemTemplate> + </touch:TouchFlatListBox> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + <StackPanel Orientation="Horizontal" Margin="0 40 0 0"> + <Grid> + <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">2</TextBlock> + </Grid> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">How to continue</TextBlock> + </StackPanel> + + <UniformGrid Columns="2" Width="530" HorizontalAlignment="Left" Margin="0 40 0 20"> + <StackPanel HorizontalAlignment="Left"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveFineTuningCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Check"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">DONE</TextBlock> + </StackPanel> + </touch:TouchButton> + + <TextBlock Margin="0 15 0 0" TextAlignment="Center">All colors are approved</TextBlock> + </StackPanel> + + <StackPanel HorizontalAlignment="Right"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatFineTuningCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Repeat"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">REPEAT</TextBlock> + </StackPanel> + </touch:TouchButton> + + <TextBlock Margin="0 15 0 0" TextAlignment="Left" TextWrapping="Wrap" Width="170">Some color need more fine tuning</TextBlock> + </StackPanel> + </UniformGrid> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + + <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.Approved}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Margin="0 40 80 40"> + <DockPanel LastChildFill="False"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> + <Run>Colors Approved:</Run> + <Run Text="{Binding Job.FineTuningApproveDate,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=''}"></Run> + </TextBlock> + <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding RepeatFineTuningCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Plus"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">REPEAT FINE TUNING</TextBlock> + </StackPanel> + </touch:TouchButton> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </StackPanel> + </touch:TouchExpander> </StackPanel> </StackPanel> </touch:LightTouchScrollViewer> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs index 77253e286..42c765a27 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs @@ -55,5 +55,12 @@ namespace Tango.PPC.Jobs.Views await Task.Delay(500); scrollViewer.ScrollToElement(expander_sample_dye); } + + public async void DisplayFineTuning() + { + expander_fine_tuning.IsExpanded = true; + await Task.Delay(500); + scrollViewer.ScrollToElement(expander_fine_tuning); + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs index ba869957d..fc5ab2ba2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -111,7 +111,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = ResourceHelper.GetImageFromResources("Images/MessageBox Icons/information.png"), + Icon = TouchIconKind.AlertOctagon, Title = "Error", Brush = Application.Current.Resources["TangoMessageBoxErrorBrush"] as Brush, }); @@ -127,7 +127,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = ResourceHelper.GetImageFromResources("Images/MessageBox Icons/information.png"), + Icon = TouchIconKind.InfoCircleSolid, Title = "Information", Brush = Application.Current.Resources["TangoMessageBoxInfoBrush"] as Brush, }); @@ -143,7 +143,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = ResourceHelper.GetImageFromResources("Images/MessageBox Icons/information.png"), + Icon = TouchIconKind.Alert, Title = "Warning", Brush = Application.Current.Resources["TangoMessageBoxWarningBrush"] as Brush, }); @@ -159,7 +159,7 @@ namespace Tango.PPC.UI.Notifications return ShowMessageBox(new MessageBoxVM() { Message = message, - Icon = ResourceHelper.GetImageFromResources("Images/MessageBox Icons/information.png"), + Icon = TouchIconKind.QuestionCircleSolid, Title = "Confirm", HasCancel = true, Brush = Application.Current.Resources["TangoMessageBoxQuestionBrush"] as Brush, diff --git a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs b/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs index 7b8a576f5..cc97164d2 100644 --- a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs +++ b/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; +using System.Windows.Media; using Tango.BL.Entities; using Tango.PMR; using Tango.PMR.ColorLab; @@ -35,6 +36,38 @@ namespace Tango.BL.ColorConversion return output; } + public static ConversionOutput GetSuggestions(Job job, Color color) + { + ConversionInput conversionInput = new ConversionInput(); + + conversionInput.ColorSpace = PMR.ColorLab.ColorSpace.Rgb; + conversionInput.InputCoordinates = new InputCoordinates(); + + conversionInput.InputCoordinates.Red = Math.Max((int)color.R, 1); + conversionInput.InputCoordinates.Green = Math.Max((int)color.G, 1); + conversionInput.InputCoordinates.Blue = Math.Max((int)color.B, 1); + + conversionInput.ThreadL = 92.1815;//brushStop.Segment.Job.Rml.MediaColor.L; + conversionInput.ThreadA = 2.2555;//brushStop.Segment.Job.Rml.MediaColor.A; + conversionInput.ThreadB = -10.9325;//brushStop.Segment.Job.Rml.MediaColor.B; + + conversionInput.ForwardData = ByteString.CopyFrom(job.Rml.Ccts.FirstOrDefault().ForwardData); + + foreach (var ids_pack in job.Machine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex)) + { + conversionInput.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = (PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code, + MaxNanoliterPerCentimeter = ids_pack.LiquidType.LiquidTypesRmls.Single(x => x.Rml == job.Rml).MaxNlPerCm, + CalibrationData = Cat.CreateDemoCalibrationData((PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code), //ids_pack.LiquidType.Cats.Single(x => x.Rml == brushStop.Segment.Job.Rml && x.Machine == brushStop.Segment.Job.Machine).GetCalibrationData() + }); + } + + NativePMR<ConversionInput, ConversionOutput> nativePMR = new NativePMR<ConversionInput, ConversionOutput>(Convert); + ConversionOutput output = nativePMR.Invoke(conversionInput); + return output; + } + public static List<ColorConversionSuggestion> CreateHiveSuggestions(ConversionOutput conversionOutput) { List<ColorConversionSuggestion> suggestions = new List<ColorConversionSuggestion>(); diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 0adfe0b23..535266a8e 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -615,6 +615,122 @@ namespace Tango.BL.Entities } + protected Int32 _finetuningstatus; + + /// <summary> + /// 0 = Unspecified + /// 1 = PendingApproval + /// 2 = Approved + /// </summary> + + [Column("FINE_TUNING_STATUS")] + + public Int32 FineTuningStatus + { + get + { + return _finetuningstatus; + } + + set + { + _finetuningstatus = value; RaisePropertyChanged(nameof(FineTuningStatus)); + } + + } + + protected Nullable<DateTime> _finetuningapprovedate; + + /// <summary> + /// Gets or sets the job fine tuning approve date. + /// </summary> + + [Column("FINE_TUNING_APPROVE_DATE")] + + public Nullable<DateTime> FineTuningApproveDate + { + get + { + return _finetuningapprovedate; + } + + set + { + _finetuningapprovedate = value; RaisePropertyChanged(nameof(FineTuningApproveDate)); + } + + } + + protected Int32 _sampledyestatus; + + /// <summary> + /// 0 = Unspecified + /// 1 = PendingApproval + /// 2 = Approved + /// </summary> + + [Column("SAMPLE_DYE_STATUS")] + + public Int32 SampleDyeStatus + { + get + { + return _sampledyestatus; + } + + set + { + _sampledyestatus = value; RaisePropertyChanged(nameof(SampleDyeStatus)); + } + + } + + protected Nullable<DateTime> _sampledyeapprovedate; + + /// <summary> + /// Gets or sets the job sample dye approve date. + /// </summary> + + [Column("SAMPLE_DYE_APPROVE_DATE")] + + public Nullable<DateTime> SampleDyeApproveDate + { + get + { + return _sampledyeapprovedate; + } + + set + { + _sampledyeapprovedate = value; RaisePropertyChanged(nameof(SampleDyeApproveDate)); + } + + } + + protected Int32 _editingstate; + + /// <summary> + /// 0 = Default + /// 1 = SampleDye + /// 2 = FineTuning + /// </summary> + + [Column("EDITING_STATE")] + + public Int32 EditingState + { + get + { + return _editingstate; + } + + set + { + _editingstate = value; RaisePropertyChanged(nameof(EditingState)); + } + + } + protected ColorSpace _colorspace; /// <summary> diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs index 4cbaa3611..16848e212 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Job.cs @@ -41,18 +41,6 @@ namespace Tango.BL.Entities #region Properties - private bool _isSample; - /// <summary> - /// Gets or sets a value indicating whether this instance is a sample dye. - /// </summary> - [NotMapped] - [JsonIgnore] - public bool IsSample - { - get { return _isSample; } - set { _isSample = value; RaisePropertyChangedAuto(); } - } - /// <summary> /// Gets the total job segments length. /// </summary> @@ -170,6 +158,44 @@ namespace Tango.BL.Entities } } + /// <summary> + /// Gets or sets the job fine tuning status. + /// </summary> + [NotMapped] + [JsonIgnore] + public FineTuningStatuses JobFineTuningStatus + { + get { return (FineTuningStatuses)FineTuningStatus; } + set { FineTuningStatus = value.ToInt32(); RaisePropertyChangedAuto(); } + } + + /// <summary> + /// Gets or sets the job sample dye status. + /// </summary> + [NotMapped] + [JsonIgnore] + public SampleDyeStatuses JobSampleDyeStatus + { + get { return (SampleDyeStatuses)SampleDyeStatus; } + set { SampleDyeStatus = value.ToInt32(); RaisePropertyChangedAuto(); } + } + + private JobDesignations _designation; + [NotMapped] + [JsonIgnore] + public JobDesignations Designation + { + get { return _designation; } + set { _designation = value; RaisePropertyChangedAuto(); } + } + + [NotMapped] + [JsonIgnore] + public EditingStates JobEditingState + { + get { return (EditingStates)EditingState; } + set { EditingState = value.ToInt32(); RaisePropertyChangedAuto(); } + } #endregion @@ -342,6 +368,14 @@ namespace Tango.BL.Entities /// </summary> public Segment AddSolidSegment() { + return AddSolidSegment(System.Windows.Media.Colors.Black); + } + + /// <summary> + /// Adds a new solid segment. + /// </summary> + public Segment AddSolidSegment(System.Windows.Media.Color color) + { Segment segment = new Segment(); segment.Name = "Standard Segment"; @@ -358,7 +392,8 @@ namespace Tango.BL.Entities segment.Job = this; - segment.AddBrushStop(); + var stop = segment.AddBrushStop(); + stop.Color = color; Segments.Add(segment); return segment; diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/EditingStates.cs b/Software/Visual_Studio/Tango.BL/Enumerations/EditingStates.cs new file mode 100644 index 000000000..7e13ac031 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Enumerations/EditingStates.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.Enumerations +{ + public enum EditingStates + { + Default, + SampleDye, + FineTuning + } +} diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/FineTuningStatuses.cs b/Software/Visual_Studio/Tango.BL/Enumerations/FineTuningStatuses.cs new file mode 100644 index 000000000..a86e1d857 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Enumerations/FineTuningStatuses.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.Enumerations +{ + public enum FineTuningStatuses + { + Unspecified, + PendingApproval, + Approved, + } +} diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/JobDesignations.cs b/Software/Visual_Studio/Tango.BL/Enumerations/JobDesignations.cs new file mode 100644 index 000000000..838c9d3d4 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Enumerations/JobDesignations.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.Enumerations +{ + public enum JobDesignations + { + Default, + SampleDye, + FineTuning, + } +} diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/SampleDyeStatuses.cs b/Software/Visual_Studio/Tango.BL/Enumerations/SampleDyeStatuses.cs new file mode 100644 index 000000000..a87a94a25 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/Enumerations/SampleDyeStatuses.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.BL.Enumerations +{ + public enum SampleDyeStatuses + { + Unspecified, + PendingApproval, + Approved, + } +} diff --git a/Software/Visual_Studio/Tango.BL/ExtensionMethods/ColorConversionSuggestionExtensions.cs b/Software/Visual_Studio/Tango.BL/ExtensionMethods/ColorConversionSuggestionExtensions.cs new file mode 100644 index 000000000..5a8b30594 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/ExtensionMethods/ColorConversionSuggestionExtensions.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.ColorConversion; + +public static class ColorConversionSuggestionExtensions +{ + /// <summary> + /// Gets the hive center suggestion. + /// </summary> + /// <param name="suggestions">The suggestions.</param> + /// <returns></returns> + public static ColorConversionSuggestion GetCenterSuggestion(this IEnumerable<ColorConversionSuggestion> suggestions) + { + return suggestions.ElementAt(10); + } +} + diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs index a567c3778..48e0e0151 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContext.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContext.cs @@ -23,6 +23,14 @@ namespace Tango.BL { /// <summary> + /// Gets or sets the SyncConfigurations. + /// </summary> + public DbSet<SyncConfiguration> SyncConfigurations + { + get; set; + } + + /// <summary> /// Gets or sets the ActionTypes. /// </summary> public DbSet<ActionType> ActionTypes @@ -519,14 +527,6 @@ namespace Tango.BL } /// <summary> - /// Gets or sets the SyncConfigurations. - /// </summary> - public DbSet<SyncConfiguration> SyncConfigurations - { - get; set; - } - - /// <summary> /// Gets or sets the Sysdiagrams. /// </summary> public DbSet<Sysdiagram> Sysdiagrams diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs index 2df9282da..ceaa4c77c 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapterExtension.cs @@ -17,6 +17,42 @@ namespace Tango.BL public partial class ObservablesEntitiesAdapter { + private ObservableCollection<SyncConfiguration> _syncconfigurations; + /// <summary> + /// Gets or sets the SyncConfigurations. + /// </summary> + public ObservableCollection<SyncConfiguration> SyncConfigurations + { + get + { + return _syncconfigurations; + } + + set + { + _syncconfigurations = value; RaisePropertyChanged(nameof(SyncConfigurations)); + } + + } + + private ICollectionView _syncconfigurationsViewSource; + /// <summary> + /// Gets or sets the SyncConfigurations View Source. + ///</summary> + public ICollectionView SyncConfigurationsViewSource + { + get + { + return _syncconfigurationsViewSource; + } + + set + { + _syncconfigurationsViewSource = value; RaisePropertyChanged(nameof(SyncConfigurationsViewSource)); + } + + } + private ObservableCollection<ActionType> _actiontypes; /// <summary> /// Gets or sets the ActionTypes. @@ -2249,42 +2285,6 @@ namespace Tango.BL } - private ObservableCollection<SyncConfiguration> _syncconfigurations; - /// <summary> - /// Gets or sets the SyncConfigurations. - /// </summary> - public ObservableCollection<SyncConfiguration> SyncConfigurations - { - get - { - return _syncconfigurations; - } - - set - { - _syncconfigurations = value; RaisePropertyChanged(nameof(SyncConfigurations)); - } - - } - - private ICollectionView _syncconfigurationsViewSource; - /// <summary> - /// Gets or sets the SyncConfigurations View Source. - ///</summary> - public ICollectionView SyncConfigurationsViewSource - { - get - { - return _syncconfigurationsViewSource; - } - - set - { - _syncconfigurationsViewSource = value; RaisePropertyChanged(nameof(SyncConfigurationsViewSource)); - } - - } - private ObservableCollection<Sysdiagram> _sysdiagrams; /// <summary> /// Gets or sets the Sysdiagrams. @@ -2615,6 +2615,8 @@ namespace Tango.BL private void InitCollectionSources() { + SyncConfigurationsViewSource = CreateCollectionView(SyncConfigurations); + ActionTypesViewSource = CreateCollectionView(ActionTypes); AddressesViewSource = CreateCollectionView(Addresses); @@ -2739,8 +2741,6 @@ namespace Tango.BL SpoolTypesViewSource = CreateCollectionView(SpoolTypes); - SyncConfigurationsViewSource = CreateCollectionView(SyncConfigurations); - SysdiagramsViewSource = CreateCollectionView(Sysdiagrams); TechControllersViewSource = CreateCollectionView(TechControllers); diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index 42e1effb0..1553ab1f5 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -110,12 +110,14 @@ <Compile Include="Enumerations\ActionTypes.cs" /> <Compile Include="Enumerations\ColorCatalogs.cs" /> <Compile Include="Enumerations\DancerTypes.cs" /> + <Compile Include="Enumerations\EditingStates.cs" /> <Compile Include="Enumerations\EventTypes.cs" /> <Compile Include="Enumerations\EventTypesCategories.cs" /> <Compile Include="Enumerations\EventTypesGroups.cs" /> <Compile Include="EntitiesExtensions\MediaColor.cs" /> <Compile Include="Enumerations\FiberSynthes.cs" /> <Compile Include="Enumerations\FiberSynths.cs" /> + <Compile Include="Enumerations\FineTuningStatuses.cs" /> <Compile Include="Enumerations\Graphs.cs" /> <Compile Include="Enumerations\HardwareDancerTypes.cs" /> <Compile Include="Enumerations\HardwareMotorTypes.cs" /> @@ -125,12 +127,14 @@ <Compile Include="Enumerations\HtmlPages.cs" /> <Compile Include="Enumerations\Ios.cs" /> <Compile Include="Enumerations\JobCategories.cs" /> + <Compile Include="Enumerations\JobDesignations.cs" /> <Compile Include="Enumerations\JobStatuses.cs" /> <Compile Include="Enumerations\JobTypes.cs" /> <Compile Include="Enumerations\LiquidTypes.cs" /> <Compile Include="Enumerations\MotorTypes.cs" /> <Compile Include="Enumerations\PidControls.cs" /> <Compile Include="Enumerations\Rmls.cs" /> + <Compile Include="Enumerations\SampleDyeStatuses.cs" /> <Compile Include="Enumerations\SpoolsDistributions.cs" /> <Compile Include="Enumerations\SpoolTypes.cs" /> <Compile Include="Enumerations\TechControllers.cs" /> @@ -140,6 +144,7 @@ <Compile Include="Enumerations\TechMonitors.cs" /> <Compile Include="Enumerations\TechMotors.cs" /> <Compile Include="Enumerations\TechValves.cs" /> + <Compile Include="ExtensionMethods\ColorConversionSuggestionExtensions.cs" /> <Compile Include="LiquidVolume.cs" /> <Compile Include="Entities\ActionType.cs" /> <Compile Include="Entities\Address.cs" /> @@ -310,7 +315,7 @@ </Target> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs index 109e876b5..6143c4314 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs @@ -50,6 +50,11 @@ namespace Tango.DAL.Remote.DB public int SPOOLS_DISTRIBUTION { get; set; } public int NUMBER_OF_HEADS { get; set; } public int SAMPLE_UNITS_OR_METERS { get; set; } + public int FINE_TUNING_STATUS { get; set; } + public Nullable<System.DateTime> FINE_TUNING_APPROVE_DATE { get; set; } + public int SAMPLE_DYE_STATUS { get; set; } + public Nullable<System.DateTime> SAMPLE_DYE_APPROVE_DATE { get; set; } + public int EDITING_STATE { get; set; } public virtual COLOR_SPACES COLOR_SPACES { get; set; } public virtual CUSTOMER CUSTOMER { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs index dfd25069b..3bfc66745 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -25,6 +25,7 @@ namespace Tango.DAL.Remote.DB throw new UnintentionalCodeFirstException(); } + public virtual DbSet<SYNC_CONFIGURATIONS> SYNC_CONFIGURATIONS { get; set; } public virtual DbSet<ACTION_TYPES> ACTION_TYPES { get; set; } public virtual DbSet<ADDRESS> ADDRESSES { get; set; } public virtual DbSet<APPLICATION_DISPLAY_PANEL_VERSIONS> APPLICATION_DISPLAY_PANEL_VERSIONS { get; set; } @@ -87,7 +88,6 @@ namespace Tango.DAL.Remote.DB public virtual DbSet<ROLES_PERMISSIONS> ROLES_PERMISSIONS { get; set; } public virtual DbSet<SEGMENT> SEGMENTS { get; set; } public virtual DbSet<SPOOL_TYPES> SPOOL_TYPES { get; set; } - public virtual DbSet<SYNC_CONFIGURATIONS> SYNC_CONFIGURATIONS { get; set; } public virtual DbSet<sysdiagram> sysdiagrams { get; set; } public virtual DbSet<TECH_CONTROLLERS> TECH_CONTROLLERS { get; set; } public virtual DbSet<TECH_DISPENSERS> TECH_DISPENSERS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 9030a9f0b..65181d575 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -583,6 +583,11 @@ <Property Name="SPOOLS_DISTRIBUTION" Type="int" Nullable="false" /> <Property Name="NUMBER_OF_HEADS" Type="int" Nullable="false" /> <Property Name="SAMPLE_UNITS_OR_METERS" Type="int" Nullable="false" /> + <Property Name="FINE_TUNING_STATUS" Type="int" Nullable="false" /> + <Property Name="FINE_TUNING_APPROVE_DATE" Type="datetime2" Precision="3" /> + <Property Name="SAMPLE_DYE_STATUS" Type="int" Nullable="false" /> + <Property Name="SAMPLE_DYE_APPROVE_DATE" Type="datetime2" Precision="3" /> + <Property Name="EDITING_STATE" Type="int" Nullable="false" /> </EntityType> <EntityType Name="LINEAR_MASS_DENSITY_UNITS"> <Key> @@ -2365,6 +2370,7 @@ <edmx:ConceptualModels> <Schema Namespace="RemoteModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm"> <EntityContainer Name="RemoteDB" annotation:LazyLoadingEnabled="true"> + <EntitySet Name="SYNC_CONFIGURATIONS" EntityType="RemoteModel.SYNC_CONFIGURATIONS" /> <EntitySet Name="ACTION_TYPES" EntityType="RemoteModel.ACTION_TYPES" /> <EntitySet Name="ADDRESSES" EntityType="RemoteModel.ADDRESS" /> <EntitySet Name="APPLICATION_DISPLAY_PANEL_VERSIONS" EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" /> @@ -2427,7 +2433,6 @@ <EntitySet Name="ROLES_PERMISSIONS" EntityType="RemoteModel.ROLES_PERMISSIONS" /> <EntitySet Name="SEGMENTS" EntityType="RemoteModel.SEGMENT" /> <EntitySet Name="SPOOL_TYPES" EntityType="RemoteModel.SPOOL_TYPES" /> - <EntitySet Name="SYNC_CONFIGURATIONS" EntityType="RemoteModel.SYNC_CONFIGURATIONS" /> <EntitySet Name="sysdiagrams" EntityType="RemoteModel.sysdiagram" /> <EntitySet Name="TECH_CONTROLLERS" EntityType="RemoteModel.TECH_CONTROLLERS" /> <EntitySet Name="TECH_DISPENSERS" EntityType="RemoteModel.TECH_DISPENSERS" /> @@ -2741,7 +2746,15 @@ <End Role="USER" EntitySet="USERS" /> <End Role="USERS_ROLES" EntitySet="USERS_ROLES" /> </AssociationSet> - </EntityContainer> + </EntityContainer> + <EntityType Name="SYNC_CONFIGURATIONS"> + <Key> + <PropertyRef Name="ID" /> + </Key> + <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" /> + <Property Name="TABLE_NAME" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="false" /> + <Property Name="SYNC_TYPE" Type="Int32" Nullable="false" /> + </EntityType> <EntityType Name="ACTION_TYPES"> <Key> <PropertyRef Name="GUID" /> @@ -3399,6 +3412,11 @@ <Property Name="SPOOLS_DISTRIBUTION" Type="Int32" Nullable="false" /> <Property Name="NUMBER_OF_HEADS" Type="Int32" Nullable="false" /> <Property Name="SAMPLE_UNITS_OR_METERS" Type="Int32" Nullable="false" /> + <Property Name="FINE_TUNING_STATUS" Type="Int32" Nullable="false" /> + <Property Name="FINE_TUNING_APPROVE_DATE" Type="DateTime" Precision="3" /> + <Property Name="SAMPLE_DYE_STATUS" Type="Int32" Nullable="false" /> + <Property Name="SAMPLE_DYE_APPROVE_DATE" Type="DateTime" Precision="3" /> + <Property Name="EDITING_STATE" Type="Int32" Nullable="false" /> <NavigationProperty Name="COLOR_SPACES" Relationship="RemoteModel.FK_JOBS_COLOR_SPACES" FromRole="JOB" ToRole="COLOR_SPACES" /> <NavigationProperty Name="CUSTOMER" Relationship="RemoteModel.FK_JOBS_CUSTOMERS" FromRole="JOB" ToRole="CUSTOMER" /> <NavigationProperty Name="JOB_RUNS" Relationship="RemoteModel.FK_JOB_RUNS_JOBS" FromRole="JOB" ToRole="JOB_RUNS" /> @@ -3755,14 +3773,6 @@ <Property Name="ROTATIONS_PER_PASSAGE" Type="Double" Nullable="false" /> <NavigationProperty Name="JOBS" Relationship="RemoteModel.FK_JOBS_SPOOL_TYPES" FromRole="SPOOL_TYPES" ToRole="JOB" /> </EntityType> - <EntityType Name="SYNC_CONFIGURATIONS"> - <Key> - <PropertyRef Name="ID" /> - </Key> - <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" /> - <Property Name="TABLE_NAME" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="false" /> - <Property Name="SYNC_TYPE" Type="Int32" Nullable="false" /> - </EntityType> <EntityType Name="sysdiagram"> <Key> <PropertyRef Name="diagram_id" /> @@ -4877,6 +4887,15 @@ <edmx:Mappings> <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs"> <EntityContainerMapping StorageEntityContainer="RemoteModelStoreContainer" CdmEntityContainer="RemoteDB"> + <EntitySetMapping Name="SYNC_CONFIGURATIONS"> + <EntityTypeMapping TypeName="RemoteModel.SYNC_CONFIGURATIONS"> + <MappingFragment StoreEntitySet="SYNC_CONFIGURATIONS"> + <ScalarProperty Name="SYNC_TYPE" ColumnName="SYNC_TYPE" /> + <ScalarProperty Name="TABLE_NAME" ColumnName="TABLE_NAME" /> + <ScalarProperty Name="ID" ColumnName="ID" /> + </MappingFragment> + </EntityTypeMapping> + </EntitySetMapping> <EntitySetMapping Name="ACTION_TYPES"> <EntityTypeMapping TypeName="RemoteModel.ACTION_TYPES"> <MappingFragment StoreEntitySet="ACTION_TYPES"> @@ -5464,6 +5483,11 @@ <EntitySetMapping Name="JOBS"> <EntityTypeMapping TypeName="RemoteModel.JOB"> <MappingFragment StoreEntitySet="JOBS"> + <ScalarProperty Name="EDITING_STATE" ColumnName="EDITING_STATE" /> + <ScalarProperty Name="SAMPLE_DYE_APPROVE_DATE" ColumnName="SAMPLE_DYE_APPROVE_DATE" /> + <ScalarProperty Name="SAMPLE_DYE_STATUS" ColumnName="SAMPLE_DYE_STATUS" /> + <ScalarProperty Name="FINE_TUNING_APPROVE_DATE" ColumnName="FINE_TUNING_APPROVE_DATE" /> + <ScalarProperty Name="FINE_TUNING_STATUS" ColumnName="FINE_TUNING_STATUS" /> <ScalarProperty Name="SAMPLE_UNITS_OR_METERS" ColumnName="SAMPLE_UNITS_OR_METERS" /> <ScalarProperty Name="NUMBER_OF_HEADS" ColumnName="NUMBER_OF_HEADS" /> <ScalarProperty Name="SPOOLS_DISTRIBUTION" ColumnName="SPOOLS_DISTRIBUTION" /> @@ -5810,15 +5834,6 @@ </MappingFragment> </EntityTypeMapping> </EntitySetMapping> - <EntitySetMapping Name="SYNC_CONFIGURATIONS"> - <EntityTypeMapping TypeName="RemoteModel.SYNC_CONFIGURATIONS"> - <MappingFragment StoreEntitySet="SYNC_CONFIGURATIONS"> - <ScalarProperty Name="SYNC_TYPE" ColumnName="SYNC_TYPE" /> - <ScalarProperty Name="TABLE_NAME" ColumnName="TABLE_NAME" /> - <ScalarProperty Name="ID" ColumnName="ID" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping> <EntitySetMapping Name="sysdiagrams"> <EntityTypeMapping TypeName="RemoteModel.sysdiagram"> <MappingFragment StoreEntitySet="sysdiagrams"> @@ -5946,7 +5961,7 @@ </MappingFragment> </EntityTypeMapping> </EntitySetMapping> - </EntityContainerMapping> + </EntityContainerMapping> </Mapping> </edmx:Mappings> </edmx:Runtime> diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index 305fe3ebd..57c2d3fe0 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,78 +5,77 @@ <!-- Diagram content (shape and connector positions) --> <edmx:Diagrams> <Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1"> - <EntityTypeShape EntityType="RemoteModel.ACTION_TYPES" Width="1.5" PointX="6" PointY="98.25" /> - <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="43.5" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="70.25" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="57.5" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="1.5" PointY="60.5" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="1.5" PointY="76" /> - <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="12.75" PointY="14.5" /> - <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="6.75" PointY="84.75" /> - <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="5.25" PointY="19.75" /> - <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="5.25" PointY="11.375" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="10.5" PointY="20.875" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="6" PointY="23.75" /> - <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="3.75" PointY="65.125" /> - <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="47.75" /> - <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="6" PointY="46.125" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="6.75" PointY="81.375" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="67.25" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="73.125" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="6" PointY="93.375" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_ACTIONS" Width="1.5" PointX="8.25" PointY="94.25" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_CATEGORIES" Width="1.5" PointX="3.75" PointY="97.5" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_GROUPS" Width="1.5" PointX="3.75" PointY="94.375" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="18.75" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="27.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="4.5" PointY="71.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="6.75" PointY="55.875" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="6.5" PointY="77.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="8.75" PointY="61.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="1.5" PointY="53.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="3.75" PointY="58.125" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="4.5" PointY="81.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="6.75" PointY="69.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="63.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="7.5" PointY="73.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="9.75" PointY="57.75" /> - <EntityTypeShape EntityType="RemoteModel.HTML_PAGES" Width="1.5" PointX="3.75" PointY="91" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="6.75" PointY="87.625" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="9" PointY="44" /> - <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="10.5" PointY="13.25" /> - <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="8.25" PointY="12.125" /> - <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="21.625" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="3" PointY="21.875" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="16" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="8.25" PointY="39.125" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="3.75" PointY="54.25" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="6" PointY="64" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="11.25" PointY="66.125" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="8.25" PointY="51.75" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_COLORS" Width="1.5" PointX="0.75" PointY="15" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="7.875" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="10.875" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="24.625" /> - <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="6.75" PointY="7.25" /> - <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="3.75" PointY="45.625" /> - <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="9" PointY="8.375" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="31.75" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="33.25" /> - <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="12.375" /> - <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="9" PointY="28.25" /> - <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="11.25" PointY="28.375" /> - <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="10.5" PointY="16.625" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="6" PointY="49.75" /> - <EntityTypeShape EntityType="RemoteModel.SYNC_CONFIGURATIONS" Width="1.5" PointX="0.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="2.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="0.75" PointY="3.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="2.75" PointY="3.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="4.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="6.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="2.75" PointY="6.75" /> - <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="6" PointY="38.375" /> - <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="11.25" PointY="39.25" /> - <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="6" PointY="27.25" /> + <EntityTypeShape EntityType="RemoteModel.ACTION_TYPES" Width="1.5" PointX="9" PointY="55.25" /> + <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="61.5" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="51.125" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="36.5" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="1.5" PointY="39.5" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="1.5" PointY="45.25" /> + <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="15.75" PointY="16.125" /> + <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="7.75" PointY="41" /> + <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="8.25" PointY="16.375" /> + <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="5.25" PointY="16.875" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="13.5" PointY="22.5" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="9" PointY="5" /> + <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="3.75" PointY="40.25" /> + <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="57.375" /> + <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="9" PointY="11.875" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="7.75" PointY="52" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="42.375" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="48.25" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="9" PointY="58.375" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_ACTIONS" Width="1.5" PointX="11.25" PointY="59.25" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_CATEGORIES" Width="1.5" PointX="6.75" PointY="62.5" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_GROUPS" Width="1.5" PointX="6.75" PointY="56.125" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="23.5" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="29.375" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="9.5" PointY="48" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="11.75" PointY="32.125" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="4.5" PointY="5.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="6.75" PointY="31.75" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="11.5" PointY="38" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="13.75" PointY="37.375" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="1.5" PointY="6" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="3.75" PointY="32.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="32.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="1.5" PointY="66" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="3.75" PointY="36.875" /> + <EntityTypeShape EntityType="RemoteModel.HTML_PAGES" Width="1.5" PointX="6.75" PointY="59.25" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="7.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="10" PointY="25.375" /> + <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="13.5" PointY="14.875" /> + <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="11.25" PointY="13.25" /> + <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="26.5" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="3" PointY="9.5" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="12.625" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="11.25" PointY="51.625" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="3.75" PointY="54" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="6" PointY="46.5" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="8.25" PointY="44.5" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="11.25" PointY="41.75" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_COLORS" Width="1.5" PointX="0.75" PointY="12.25" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="16.875" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="9.375" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="20.625" /> + <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="7.75" PointY="20.625" /> + <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="3.75" PointY="59.625" /> + <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="12" PointY="55.875" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="24.25" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="25.75" /> + <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="14.125" /> + <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="12" PointY="46.75" /> + <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="14.25" PointY="46.875" /> + <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="13.5" PointY="18.25" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="9" PointY="31.5" /> + <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="0.75" PointY="2.375" /> + <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="2.75" PointY="2.375" /> + <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="4.75" PointY="2.375" /> + <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="11.75" PointY="2.375" /> + <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="11.75" PointY="7.375" /> + <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="5.75" PointY="9.375" /> + <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="9" PointY="35.875" /> + <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="14.25" PointY="33.75" /> + <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="9" PointY="8.75" /> <AssociationConnector Association="RemoteModel.FK_EVENTS_ACTIONS_ACTIONS" /> <AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" /> <AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" /> diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 88c753846..cddd7ed9f 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -646,16 +646,17 @@ namespace Tango.Integration.Operation { if (stop.LiquidVolumes == null) { - var suggestions = TangoColorConverter.GetSuggestions(stop); + var output = TangoColorConverter.GetSuggestions(stop); - if (suggestions.OutOfGamut) - { - throw new InvalidOperationException("Cannot print a brush stop which is out of gamut."); - } + //TODO: Restore this when Mirta conversion is working as expected. + //if (suggestions.OutOfGamut) + //{ + // throw new InvalidOperationException("Cannot print a brush stop which is out of gamut."); + //} stop.SetLiquidVolumes(job.Machine.Configuration, job.Rml, processParameters); - foreach (var outputLiquid in suggestions.SingleCoordinates.OutputLiquids) + foreach (var outputLiquid in output.SingleCoordinates.OutputLiquids) { var liquidVolume = stop.LiquidVolumes.SingleOrDefault(x => x.IdsPack.LiquidType.Code == outputLiquid.LiquidType.ToInt32()); diff --git a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs index 74b8458bf..9a996505d 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs @@ -18,6 +18,7 @@ namespace Tango.Touch.Controls { public class LightTouchScrollViewer : ContentControl { + private const double _min_scroll_delta = 20; private Border _border_viewport; private Grid _grid_content; private Point _mouse_down_location; @@ -401,6 +402,8 @@ namespace Tango.Touch.Controls /// <param name="e">The <see cref="MouseOrTouchEventArgs"/> instance containing the event data.</param> protected virtual void OnMouseTouchDown(object sender, MouseOrTouchEventArgs e) { + _current_move_delta = 0; + if (DisableScrolling) return; IsAfterScrolling = false; @@ -493,7 +496,7 @@ namespace Tango.Touch.Controls var a = _mouse_down_location.Y + _grid_content.Margin.Top; - if (IsMouseTouchDown && Math.Abs((e.Location.Y - a)) > 10) + if (IsMouseTouchDown && (Math.Abs((e.Location.Y - a)) > _min_scroll_delta) || IsScrolling) { if (!IsScrolling) { @@ -531,7 +534,10 @@ namespace Tango.Touch.Controls if (curDate >= _current_move_time.AddMilliseconds(_delta_measure_interval_milli)) { - _current_move_delta = e.Location.Y - _last_move_delta; + if (e.Location.Y - _last_move_delta != 0) + { + _current_move_delta = e.Location.Y - _last_move_delta; + } _last_move_delta = e.Location.Y; _current_move_time = curDate; } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/MessageBoxVM.cs b/Software/Visual_Studio/Tango.Touch/Controls/MessageBoxVM.cs index 15e2d0c5c..0330c3cb1 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/MessageBoxVM.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/MessageBoxVM.cs @@ -14,7 +14,7 @@ namespace Tango.Touch.Controls { public String Title { get; set; } - public BitmapSource Icon { get; set; } + public TouchIconKind Icon { get; set; } public Brush Brush { get; set; } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchFlatListBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchFlatListBox.cs new file mode 100644 index 000000000..67cea53a4 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchFlatListBox.cs @@ -0,0 +1,25 @@ +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.Touch.Controls +{ + public class TouchFlatListBox : ListBox + { + static TouchFlatListBox() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchFlatListBox), new FrameworkPropertyMetadata(typeof(TouchFlatListBox))); + } + } +} diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchFlatListBox.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchFlatListBox.xaml new file mode 100644 index 000000000..a3e52ed9f --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchFlatListBox.xaml @@ -0,0 +1,49 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Touch.Controls"> + + <Style TargetType="{x:Type local:TouchFlatListBox}" BasedOn="{StaticResource {x:Type ListBox}}"> + <Setter Property="ItemContainerStyle"> + <Setter.Value> + <Style TargetType="{x:Type ListBoxItem}"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Padding" Value="0"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ListBoxItem}"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}" Padding="0" SnapsToDevicePixels="true"> + <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsSelected" Value="true"> + <Setter Property="Background" TargetName="Bd" Value="Transparent"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsSelected" Value="true"/> + <Condition Property="Selector.IsSelectionActive" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="Bd" Value="Transparent"/> + </MultiTrigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </Setter.Value> + </Setter> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"></Setter> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="Padding" Value="0"></Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml index cb16d8008..5440166f8 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml @@ -154,7 +154,7 @@ <RowDefinition Height="70"/> </Grid.RowDefinitions> - <Image Grid.Row="0" Source="{Binding Icon}" Margin="20" /> + <local:TouchIcon Grid.Row="0" Icon="{Binding Icon}" Margin="20" Foreground="{Binding Brush}" /> <TextBlock Grid.Column="1" Text="{Binding Title,TargetNullValue=Confirm}" Foreground="{Binding Brush,TargetNullValue={StaticResource TangoPrimaryAccentBrush}}" VerticalAlignment="Center" Margin="10" Style="{StaticResource TangoMessageBoxTitle}"></TextBlock> <Rectangle Stroke="{Binding Brush}" VerticalAlignment="Bottom" Grid.ColumnSpan="2" StrokeThickness="3" /> diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj index 86b10d202..ad9917a13 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -68,6 +68,7 @@ <Compile Include="Controls\TouchCheckBox.cs" /> <Compile Include="Controls\TouchComboBox.cs" /> <Compile Include="Controls\TouchExpander.cs" /> + <Compile Include="Controls\TouchFlatListBox.cs" /> <Compile Include="Controls\TouchGifAnimation.cs" /> <Compile Include="Controls\TouchIcon.cs" /> <Compile Include="Controls\TouchIconKind.cs" /> @@ -119,6 +120,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Controls\TouchFlatListBox.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Controls\TouchGifAnimation.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -359,7 +364,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/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml index e077d1388..e8cd8b6a8 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -39,6 +39,7 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchRingProgress.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchNativeListBox.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchGifAnimation.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchFlatListBox.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchToggleButton.xaml" /> |
