diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-05 19:24:36 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-05 19:24:36 +0300 |
| commit | 466b54210bc5066e6e29107d6c8f996f360b1426 (patch) | |
| tree | 287625244cc1a16b59ecce589eb7b506df4c9363 /Software | |
| parent | 2800ef294e92c6181c47ecf5bd556fcb25dc62ce (diff) | |
| download | Tango-466b54210bc5066e6e29107d6c8f996f360b1426.tar.gz Tango-466b54210bc5066e6e29107d6c8f996f360b1426.zip | |
Done some work on color catalog.
Removed manipulation enabled from everywhere!
Implemented "DelayCommand for TouchButton"..
Diffstat (limited to 'Software')
14 files changed, 93 insertions, 32 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 8d94608cb..6b3e124d2 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex 05e2d088a..63cda9afe 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt index 5ae51fc02..a8100d53a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt @@ -1 +1 @@ -Thu 07/05/2018 16:44:59.08 +Thu 07/05/2018 18:36:01.68 diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogViewer.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogViewer.xaml index b698c4fad..de1bbea0b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogViewer.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/TwineCatalogViewer.xaml @@ -22,6 +22,6 @@ </touch:TouchNavigationLinks> </Grid> - <controls:TwineCatalogControl Grid.Row="1" DataContext="{Binding RelativeSource={RelativeSource AncestorType=local:TwineCatalogViewer},Path=Catalog}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=local:TwineCatalogViewer},Path=SelectedItem,Mode=TwoWay}" /> + <controls:TwineCatalogControl x:Name="catalogControl" Grid.Row="1" DataContext="{Binding RelativeSource={RelativeSource AncestorType=local:TwineCatalogViewer},Path=Catalog}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=local:TwineCatalogViewer},Path=SelectedItem,Mode=TwoWay}" /> </Grid> </UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml index 69fb329a7..1c11512bb 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionView.xaml @@ -21,7 +21,7 @@ <Grid> <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoMessageBoxTitleFontSize}" Foreground="{StaticResource TangoErrorBrush}">Color is out of range</TextBlock> - <touch:TouchIconButton Command="{Binding CloseCommand}" HorizontalAlignment="Right" Icon="Close" CornerRadius="50" Foreground="{StaticResource TangoDarkForegroundBrush}" Padding="25" /> + <touch:TouchIconButton Command="{Binding CloseCommand}" HorizontalAlignment="Right" Icon="Close" CornerRadius="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" Foreground="{StaticResource TangoDarkForegroundBrush}" Padding="22" /> </Grid> <StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center"> 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 50ea04272..bb8e31723 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 @@ -21,6 +21,7 @@ using Tango.BL.Catalogs; using System.Runtime.InteropServices; using System.Threading; using Tango.BL.ColorConversion; +using Tango.SharedUI.Helpers; namespace Tango.PPC.Jobs.ViewModels { @@ -404,27 +405,38 @@ namespace Tango.PPC.Jobs.ViewModels /// Handles the job selected message. /// </summary> /// <param name="message">The message.</param> - private void HandleJobSelectedMessage(JobSelectedMessage message) + private async void HandleJobSelectedMessage(JobSelectedMessage message) { - if (_db != null) + await Task.Factory.StartNew(() => { - _db.Dispose(); - } + if (_db != null) + { + _db.Dispose(); + } + + _db = ObservablesContext.CreateDefault(); + Job = _db.Jobs.SingleOrDefault(x => x.Guid == message.Job.Guid); + var machine = Job.Machine; + + while (machine == null) + { + Thread.Sleep(10); + UIHelper.DoEvents(); + } - _db = ObservablesContext.CreateDefault(); - Job = _db.Jobs.SingleOrDefault(x => x.Guid == message.Job.Guid); - Rmls = _db.Rmls.ToList(); - ColorSpaces = _db.ColorSpaces.ToList(); - SpoolTypes = _db.SpoolTypes.ToList(); - Customers = _db.Customers.Where(x => x.OrganizationGuid == Job.Machine.Organization.Guid).ToList(); + Rmls = _db.Rmls.ToList(); + ColorSpaces = _db.ColorSpaces.ToList(); + SpoolTypes = _db.SpoolTypes.ToList(); + Customers = _db.Customers.Where(x => x.OrganizationGuid == machine.OrganizationGuid).ToList(); + + if (!_check_gamut_thread.IsAlive) + { + _check_gamut_thread.Start(); + } + }); SegmentsCollectionView = CollectionViewSource.GetDefaultView(Job.Segments); SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Segment.SegmentIndex), ListSortDirection.Ascending)); - - if (!_check_gamut_thread.IsAlive) - { - _check_gamut_thread.Start(); - } } #endregion 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 396eb1461..699744d5a 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 @@ -200,10 +200,11 @@ namespace Tango.PPC.Jobs.ViewModels /// Selects the job. /// </summary> /// <param name="job">The job.</param> - public void SelectJob(Job job) + public async void SelectJob(Job job) { + await Task.Delay(300); + await NavigationManager.NavigateTo<JobsModule>(nameof(JobSummeryView)); RaiseMessage(new JobSelectedMessage() { Job = job }); - NavigationManager.NavigateTo<JobsModule>(nameof(JobSummeryView)); } /// <summary> @@ -228,7 +229,7 @@ namespace Tango.PPC.Jobs.ViewModels InvokeUI(() => { - Jobs = _db.Jobs.Where(x => x.Machine.Guid == ApplicationManager.Machine.Guid).ToObservableCollection(); + Jobs = jobs.Where(x => x.Machine.Guid == ApplicationManager.Machine.Guid).ToObservableCollection(); JobsCollectionView = CollectionViewSource.GetDefaultView(Jobs); JobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); FilterJobCategory(FilterCategory); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml index 66db7bc10..baf971430 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml @@ -16,11 +16,11 @@ <ColumnDefinition Width="100"/> </Grid.ColumnDefinitions> - <touch:TouchListBox ItemsSource="{Binding Groups}" x:Name="list" DisableRipple="True" ScrollBarVisibility="Collapsed" SelectionMode="None"> + <touch:TouchListBox ItemsSource="{Binding Groups}" x:Name="list" x:FieldModifier="public" DisableRipple="True" ScrollBarVisibility="Collapsed" SelectionMode="None"> <touch:TouchListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="0 0 10 0"> - <TextBlock HorizontalAlignment="Center" Text="{Binding Name}"></TextBlock> + <TextBlock HorizontalAlignment="Center" Text="{Binding Name}" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock> <touch:TouchStaticListBox ItemsSource="{Binding Items}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SelectedItem,Mode=TwoWay}" Margin="0 20 0 40"> <touch:TouchStaticListBox.ItemsPanel> <ItemsPanelTemplate> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs index 024f47f58..f2a90a454 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs @@ -13,6 +13,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Tango.BL.Catalogs; +using Tango.Touch.Controls; namespace Tango.PPC.Common.Controls { @@ -39,14 +40,25 @@ namespace Tango.PPC.Common.Controls InitializeComponent(); Loaded += TwineCatalogControl_Loaded; - DataContextChanged += (x, y) => { _catalog = DataContext as Catalog; }; + DataContextChanged += (x, y) => + { + _catalog = DataContext as Catalog; + + if (list.ScrollViewer != null && _catalog != null) + { + list.ScrollViewer.ScrollToTop(); + _preventChange = true; + slider.Value = _catalog.Groups.Count; + _preventChange = false; + } + }; } private void ScrollViewer_Scrolling(object sender, Touch.Controls.DoubleValueChangedEventArgs e) { if (!_preventChange) { - if (e.Value > _lastScrollPosition + 10 || e.Value < _lastScrollPosition - 10) + if (e.Value > _lastScrollPosition + 60 || e.Value < _lastScrollPosition - 60) { var group = list.ScrollViewer.GetMostVisibleElementDataContext<CatalogGroup>(); @@ -56,9 +68,9 @@ namespace Tango.PPC.Common.Controls slider.Value = slider.Maximum - _catalog.Groups.IndexOf(group); _preventChange = false; } - } - _lastScrollPosition = e.Value; + _lastScrollPosition = e.Value; + } } } @@ -89,7 +101,7 @@ namespace Tango.PPC.Common.Controls } } - if (_catalog != null) + if (_catalog != null && _catalog.Groups.Count > _catalog.Groups.Count - 1 - (int)e.NewValue && _catalog.Groups.Count - 1 - (int)e.NewValue > -1) { slider.Foreground = new SolidColorBrush(_catalog.Groups.ElementAt(_catalog.Groups.Count - 1 - (int)e.NewValue).Color); } @@ -106,5 +118,11 @@ namespace Tango.PPC.Common.Controls _preventChange = false; } } + + public TouchListBox TouchListBox + { + get { return list; } + } + } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml index b6f6f4432..3347a20d6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoginView.xaml @@ -21,7 +21,7 @@ <touch:TouchCheckBox Margin="0 30 0 0">Keep me logged in.</touch:TouchCheckBox> - <touch:TouchButton Height="60" Margin="0 30 0 0" CornerRadius="3" IsDefault="True" Command="{Binding LoginCommand}">LOGIN</touch:TouchButton> + <touch:TouchButton Height="60" Margin="0 30 0 0" CornerRadius="3" IsDefault="True" DelayCommand="{Binding LoginCommand}" DelayCommandDuration="00:00:0.5">LOGIN</touch:TouchButton> <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Forgot password?</TextBlock> </StackPanel> diff --git a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs index 26a89911e..586071363 100644 --- a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs +++ b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs @@ -574,7 +574,7 @@ namespace Tango.DragAndDrop element.RegisterForPreviewMouseOrTouchDown(Draggable_PreviewMouseDown); element.RegisterForMouseOrTouchMove(Draggable_MouseMove); element.PreviewMouseUp += Draggable_PreviewMouseUp; - element.IsManipulationEnabled = true; + //element.IsManipulationEnabled = true; //element.AddHandler(FrameworkElement.PreviewMouseDownEvent, (MouseButtonEventHandler)Draggable_PreviewMouseDown, true); //element.AddHandler(FrameworkElement.MouseMoveEvent, (MouseEventHandler)Draggable_MouseMove, true); diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.cs index 15f92bb97..ddf4c61a1 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.cs @@ -78,6 +78,21 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty RippleBrushProperty = DependencyProperty.Register("RippleBrush", typeof(Brush), typeof(TouchButton), new PropertyMetadata(new SolidColorBrush(Colors.White) { Opacity = 0.5 })); + public ICommand DelayCommand + { + get { return (ICommand)GetValue(DelayCommandProperty); } + set { SetValue(DelayCommandProperty, value); } + } + public static readonly DependencyProperty DelayCommandProperty = + DependencyProperty.Register("DelayCommand", typeof(ICommand), typeof(TouchButton), new PropertyMetadata(null)); + + public Duration DelayCommandDuration + { + get { return (Duration)GetValue(DelayCommandDurationProperty); } + set { SetValue(DelayCommandDurationProperty, value); } + } + public static readonly DependencyProperty DelayCommandDurationProperty = + DependencyProperty.Register("DelayCommandDuration", typeof(Duration), typeof(TouchButton), new PropertyMetadata(new Duration(TimeSpan.FromSeconds(0.5)))); #endregion @@ -86,6 +101,21 @@ namespace Tango.Touch.Controls } + protected override void OnClick() + { + base.OnClick(); + PerformDelayCommand(); + } + + private async void PerformDelayCommand() + { + if (DelayCommand != null) + { + await Task.Delay(DelayCommandDuration.TimeSpan); + DelayCommand.Execute(CommandParameter); + } + } + static TouchButton() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchButton), new FrameworkPropertyMetadata(typeof(TouchButton))); diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchComboBox.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchComboBox.xaml index 273cc2639..5ea529c70 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchComboBox.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchComboBox.xaml @@ -23,7 +23,7 @@ <Setter Property="MinPopupHeight" Value="400"></Setter> <Setter Property="MinPopupWidth" Value="500"></Setter> <Setter Property="Title" Value="Select a value"></Setter> - <Setter Property="IsManipulationEnabled" Value="True"></Setter> + <!--<Setter Property="IsManipulationEnabled" Value="True"></Setter>--> <Setter Property="ItemTemplate"> <Setter.Value> <DataTemplate> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs index 9a2ca465f..d2a935fe1 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs @@ -99,7 +99,7 @@ namespace Tango.Touch.Controls border_notifications = GetTemplateChild("PART_BorderNotifications") as Border; grid_container = GetTemplateChild("PART_Grid_Container") as Grid; - border_notifications.IsManipulationEnabled = true; + //border_notifications.IsManipulationEnabled = true; border_notifications.RegisterForPreviewMouseOrTouchDown(GridNotificationMouseDown); border_notifications.RegisterForMouseOrTouchMove(GridNotificationMouseMove); border_notifications.RegisterForPreviewMouseOrTouchUp(GridNotificationMouseUp); |
