From 18cfb42f3c2137c36d21a82b4209ba4c9e01f863 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 27 May 2019 10:33:12 +0300 Subject: MERGE --- .../Converters/JobsCategoryToOpacityConverter.cs | 27 + .../Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj | 4 +- .../Tango.PPC.Jobs/ViewContracts/IJobsView.cs | 14 + .../Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 65 +- .../PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 1170 ++++++++++---------- .../PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml | 24 +- .../Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs | 26 +- 7 files changed, 706 insertions(+), 624 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobsCategoryToOpacityConverter.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobsView.cs (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobsCategoryToOpacityConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobsCategoryToOpacityConverter.cs new file mode 100644 index 000000000..0eaad280a --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobsCategoryToOpacityConverter.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using static Tango.PPC.Jobs.ViewModels.JobsViewVM; + +namespace Tango.PPC.Jobs.Converters +{ + public class JobsCategoryToOpacityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + JobsCategory selected = (JobsCategory)Enum.Parse(typeof(JobsCategory), parameter.ToString()); + JobsCategory category = (JobsCategory)value; + + return category.Equals(selected) ? 1 : 0; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 bbfef32fd..55983118d 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 @@ -170,6 +170,7 @@ + @@ -231,6 +232,7 @@ Settings.settings True + @@ -449,7 +451,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobsView.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobsView.cs new file mode 100644 index 000000000..7a8907c36 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobsView.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; + +namespace Tango.PPC.Jobs.ViewContracts +{ + public interface IJobsView : IPPCView + { + void ScrollToTop(); + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index c89db820d..9862a4afb 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -33,6 +33,8 @@ using System.Windows.Media; using Tango.PMR.TCC; using Tango.Pulse; using System.Windows.Media.Imaging; +using Tango.Touch.Components; +using Tango.PPC.Jobs.ViewContracts; namespace Tango.PPC.Jobs.ViewModels { @@ -40,7 +42,7 @@ namespace Tango.PPC.Jobs.ViewModels /// Represents the jobs list view model. /// /// - public class JobsViewVM : PPCViewModel + public class JobsViewVM : PPCViewModel { private ObservablesContext _db; //Holds the db context for the job list. @@ -132,7 +134,6 @@ namespace Tango.PPC.Jobs.ViewModels _selectedCategoryIndex = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(SelectedCategory)); - Filter = null; } } @@ -162,6 +163,14 @@ namespace Tango.PPC.Jobs.ViewModels set { _filter = value; RaisePropertyChangedAuto(); OnFilterChanged(); } } + private ICollectionFilter _collectionFilter; + public ICollectionFilter CollectionFilter + { + get { return _collectionFilter; } + set { _collectionFilter = value; RaisePropertyChangedAuto(); } + } + + #endregion #region Commands @@ -231,6 +240,28 @@ namespace Tango.PPC.Jobs.ViewModels RegisterForMessage(HandleJobRemovedMessage); RegisterForMessage(HandleJobSavedMessage); RegisterForMessage((x) => Filter = null); + + CollectionFilter = new DefaultCollectionFilter(); + CollectionFilter.RegisterFilter(item => + { + var job = item as Job; + + if (job != null) + { + if (String.IsNullOrEmpty(Filter)) + { + return true; + } + else + { + return (job.Name.ToLower().StartsWith(Filter) || (job.Customer != null && job.Customer.Name.ToLower().StartsWith(Filter))); + } + } + else + { + return true; + } + }); } #endregion @@ -326,15 +357,7 @@ namespace Tango.PPC.Jobs.ViewModels DraftJobsCollectionView.Filter = new Predicate(x => { var job = x as Job; - - if (String.IsNullOrWhiteSpace(Filter)) - { - return job.JobStatus == JobStatuses.Draft; - } - else - { - return job.JobStatus == JobStatuses.Draft && (job.Name.ToLower().StartsWith(Filter) || (job.Customer != null && job.Customer.Name.ToLower().StartsWith(Filter))); - } + return job.JobStatus == JobStatuses.Draft; }); @@ -343,15 +366,7 @@ namespace Tango.PPC.Jobs.ViewModels HistoryJobsCollectionView.Filter = new Predicate(x => { var job = x as Job; - - if (String.IsNullOrWhiteSpace(Filter)) - { - return job.JobStatus != JobStatuses.Draft; - } - else - { - return job.JobStatus != JobStatuses.Draft && (job.Name.ToLower().StartsWith(Filter) || (job.Customer != null && job.Customer.Name.ToLower().StartsWith(Filter))); - } + return job.JobStatus != JobStatuses.Draft; }); IsLoadingJobs = false; @@ -611,14 +626,8 @@ namespace Tango.PPC.Jobs.ViewModels { if (DraftJobsCollectionView != null && HistoryJobsCollectionView != null) { - if (SelectedCategory == JobsCategory.Draft) - { - DraftJobsCollectionView.Refresh(); - } - else if (SelectedCategory == JobsCategory.History) - { - HistoryJobsCollectionView.Refresh(); - } + CollectionFilter.RaiseFilterChanged(); + View.ScrollToTop(); } } 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 9448665d0..3e2b6b864 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 @@ -179,129 +179,169 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + Segment # - - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + - + + - + - - - + + + + + + + + ADD COLOR - - - + + + - - - - - - - - - - - - - - - - - - - ADD COLOR - - - - - - + + @@ -425,67 +427,69 @@ - - - - - Job Details - - + + + + + + Job Details + + , - - - + + + - - + + - Job name: - + Job name: + - Customer: - + Customer: + - Thread type: - + Thread type: + - Comment: - + Comment: + - - + + - - - - - - - - + + + + + + + + - + - + - + - + - + - + - + - - - - + + + + + @@ -612,75 +616,79 @@ - - - - - Embroidery File - + + + + + + Embroidery File + - - - + + + - - Export the attached embroidery file to storage. - EXPORT FILE - - + + Export the attached embroidery file to storage. + EXPORT FILE + + + - - + + - - - - - Job Summary - + + + + + + Job Summary + - - - - + + + + - + - - + + - - - - - + + + + + (+%) - - + + - - + + - + - + - % + % - - - + + + + - - + + Additional Tools @@ -708,286 +716,202 @@ --> - - - - - Sample Dye - - + + + + + + Sample Dye + + - - - - - - - - - - START - - - - - - - - - - - How to continue? + + + + + + + + + + + + START + + + + - - - - - - DONE - - + + + + + + How to continue? + + + + + + + DONE + + - The sample is approved - + The sample is approved + - - - - - REPEAT - - + + + + + REPEAT + + - Dye more samples - - + Dye more samples + + - - - - + + + + - - - - - - + + + + + + Sample Approved: - - - - - ANOTHER SAMPLE - - - - - - + + + + + ANOTHER SAMPLE + + + + + + + + + + + + + + + + - - - - - - - - - + + - - - + + + You can use the color fine tuning tool to adjust the colors. - + + - - + + + + + + + + + Color Fine Tuning + + - - - - - Color Fine Tuning - - - - - - - - - - - - - - - - - - + - - Reset + + + + + + + + + + + + + + + + + 2 + + How to continue - - - - - REPEAT - - + + + + + + DONE + + - Some color need more fine tuning - - - - - - + All colors are approved + - - - - - - + + + + + REPEAT + + + + Some color need more fine tuning + + + + + + + + + + + + + Colors Approved: - - - - - REPEAT FINE TUNING - - - - - - - - - - - - - + + + + + REPEAT FINE TUNING + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml index 475437cf3..5b9c234f0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml @@ -2,6 +2,7 @@ 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:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.PPC.Jobs.Views" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" @@ -32,6 +33,7 @@ + @@ -172,7 +174,7 @@ - + @@ -212,28 +214,28 @@ - + - + - + - + @@ -284,7 +286,7 @@ - + @@ -312,35 +314,35 @@ - + - + - + - + - + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs index d8ef4056c..ceac18e38 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs @@ -12,29 +12,45 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.DI; +using Tango.PPC.Jobs.ViewContracts; namespace Tango.PPC.Jobs.Views { /// /// Interaction logic for JobsView.xaml /// - public partial class JobsView : UserControl + public partial class JobsView : UserControl, IJobsView { public JobsView() { InitializeComponent(); + TangoIOC.Default.Register(this); } - private async void TouchNavigationLinks_SelectionChanged(object sender, SelectionChangedEventArgs e) + private void TouchNavigationLinks_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (dataGridJobs != null) { - await Task.Delay(200); + //await Task.Delay(200); - dataGridJobs.LayoutRows(false); + //dataGridJobs.LayoutRows(false); + //dataGridJobs.ScrollViewer.ScrollToTop(); + + //dataGridJobsHistory.LayoutRows(false); + //dataGridJobsHistory.ScrollViewer.ScrollToTop(); + } + } + + public void ScrollToTop() + { + if (dataGridJobs != null && dataGridJobs.ScrollViewer != null) + { dataGridJobs.ScrollViewer.ScrollToTop(); + } - dataGridJobsHistory.LayoutRows(false); + if (dataGridJobsHistory != null && dataGridJobsHistory.ScrollViewer != null) + { dataGridJobsHistory.ScrollViewer.ScrollToTop(); } } -- cgit v1.3.1 From a34089adc9e46e75d68a46f12fe41746a3970490 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 27 May 2019 13:39:04 +0300 Subject: Fixed a bug with storage error on USB disconnect. Replaced all FastTextBlock on JobView. --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes .../PPC Installer-cache/cacheIndex.txt | Bin 52 -> 52 bytes .../Advanced Installer Projects/PPC Installer.aip | 6 +++--- .../PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 22 ++++++++++----------- .../Tango.PPC.Storage/ViewModels/MainViewVM.cs | 1 + .../PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../TEMP/Tango.Graphics2D/MainWindow.xaml | 14 ++++++------- 9 files changed, 24 insertions(+), 23 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index 2eb11afb0..f3e51cf4a 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index daa46ddae..a1660af1f 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt index a603ff06b..6d87e9201 100644 Binary files a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt and b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip index 2b29263f5..ef999f972 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip @@ -18,10 +18,10 @@ - + - + @@ -423,7 +423,7 @@ - + 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 3e2b6b864..136644f5c 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 @@ -56,7 +56,7 @@ - + @@ -122,7 +122,7 @@ - Color code: + Color code: - + @@ -311,19 +311,19 @@ - + - + - - - - - + + @@ -394,7 +394,7 @@ - ADD COLOR + ADD COLOR diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs index 06cd0661d..23d471138 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs @@ -135,6 +135,7 @@ namespace Tango.PPC.Storage.ViewModels { if (IsVisible) { + _allow_exit = true; await NotificationProvider.ShowError("Storage device disconnected."); await NavigationManager.NavigateBack(); CurrentPath = null; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 5e3394ad6..3814fae20 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("1.0.30.0")] +[assembly: AssemblyVersion("1.0.31.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index efc5f8179..d72e75011 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + diff --git a/Software/Visual_Studio/TEMP/Tango.Graphics2D/MainWindow.xaml b/Software/Visual_Studio/TEMP/Tango.Graphics2D/MainWindow.xaml index 2ba887459..569469239 100644 --- a/Software/Visual_Studio/TEMP/Tango.Graphics2D/MainWindow.xaml +++ b/Software/Visual_Studio/TEMP/Tango.Graphics2D/MainWindow.xaml @@ -11,22 +11,22 @@ - + - + -- cgit v1.3.1