diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-04-18 20:48:48 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-04-18 20:48:48 +0300 |
| commit | f27893986e9fd647a69be8569ecd5d944f853869 (patch) | |
| tree | 40673893d6c8b43119633801710035b55315f7e8 | |
| parent | 8a249931cbff190c1c86a0b7bddc0b80b74370c2 (diff) | |
| download | Tango-f27893986e9fd647a69be8569ecd5d944f853869.tar.gz Tango-f27893986e9fd647a69be8569ecd5d944f853869.zip | |
Implemented machine status animations.
21 files changed, 167 insertions, 45 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobSummeryNavigationObject.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobSummeryNavigationObject.cs new file mode 100644 index 000000000..912b42683 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobSummeryNavigationObject.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; + +namespace Tango.PPC.Jobs.NavigationObjects +{ + public class JobSummeryNavigationObject + { + public ObservablesContext Context { get; set; } + public Job Job { get; set; } + } +} 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 0aac423b8..5b7e97c93 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 @@ -190,6 +190,7 @@ <Compile Include="Messages\JobSelectedMessage.cs" /> <Compile Include="Messages\NavigatedToJobsModuleMessage.cs" /> <Compile Include="NavigationObjects\JobNavigationObject.cs" /> + <Compile Include="NavigationObjects\JobSummeryNavigationObject.cs" /> <Compile Include="Properties\AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> @@ -408,7 +409,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/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs index 264f41131..3e8c6f280 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs @@ -4,12 +4,14 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; +using Tango.Core.Commands; using Tango.Integration.Operation; using Tango.PPC.Common; using Tango.PPC.Common.Navigation; using Tango.PPC.Jobs.AppBarItems; using Tango.PPC.Jobs.AppButtons; using Tango.PPC.Jobs.Dialogs; +using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; namespace Tango.PPC.Jobs.ViewModels @@ -47,10 +49,24 @@ namespace Tango.PPC.Jobs.ViewModels #endregion + #region Commands + + /// <summary> + /// Gets or sets the go to job command. + /// </summary> + /// <value> + /// The go to job command. + /// </value> + public RelayCommand GoToJobCommand { get; set; } + + #endregion + public JobProgressViewVM() { _stop_job_btn = new StopPrintingButton(); _stop_job_btn.Pressed += _stop_job_btn_Pressed; + + GoToJobCommand = new RelayCommand(GoToJob); } private void _stop_job_btn_Pressed() @@ -61,6 +77,12 @@ namespace Tango.PPC.Jobs.ViewModels } } + private void GoToJob() + { + NavigationManager.NavigateWithObject<JobsModule, JobView, JobNavigationObject>(new JobNavigationObject() { Job = _handler.Job }); + NavigationManager.ClearHistoryExcept<JobsView>(); + } + #region Override Methods /// <summary> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs index ef838f590..1a980fc4a 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs @@ -9,7 +9,9 @@ using Tango.BL.Entities; using Tango.Core.Commands; using Tango.PPC.Common; using Tango.PPC.Common.Messages; +using Tango.PPC.Common.Navigation; using Tango.PPC.Jobs.Messages; +using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; namespace Tango.PPC.Jobs.ViewModels @@ -18,7 +20,7 @@ namespace Tango.PPC.Jobs.ViewModels /// Represents the job summary view model. /// </summary> /// <seealso cref="Tango.PPC.Common.PPCViewModel" /> - public class JobSummeryViewVM : PPCViewModel + public class JobSummeryViewVM : PPCViewModel, INavigationObjectReceiver<JobSummeryNavigationObject> { private ObservablesContext _context; @@ -59,38 +61,11 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> public JobSummeryViewVM() { - RegisterForMessage<JobSelectedMessage>(HandleJobSelectedMessage); - DyeCommand = new RelayCommand(StartJob); EditCommand = new RelayCommand(EditJob); } /// <summary> - /// Handles the job selected message. - /// </summary> - /// <param name="message">The message.</param> - private async void HandleJobSelectedMessage(JobSelectedMessage message) - { - _context = message.Context; - Job = message.Job; - - Job = await new JobBuilder(_context).Set(Job.Guid) - .WithConfiguration() - .WithRML() - .WithUser() - .WithSegments() - .WithBrushStops() - .BuildAsync(); - - - try - { - EstimatedDuration = await Job.GetEstimatedDuration(); - } - catch { } - } - - /// <summary> /// Edits the job. /// </summary> private void EditJob() @@ -125,5 +100,26 @@ namespace Tango.PPC.Jobs.ViewModels { } + + public async void OnNavigatedToWithObject(JobSummeryNavigationObject obj) + { + _context = obj.Context; + Job = obj.Job; + + Job = await new JobBuilder(_context).Set(Job.Guid) + .WithConfiguration() + .WithRML() + .WithUser() + .WithSegments() + .WithBrushStops() + .BuildAsync(); + + + try + { + EstimatedDuration = await Job.GetEstimatedDuration(); + } + catch { } + } } } 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 aef6dd549..95d6bc290 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 @@ -274,7 +274,11 @@ namespace Tango.PPC.Jobs.ViewModels if (!directlyToEdit && MachineProvider.MachineOperator.Status == Integration.Operation.MachineStatuses.ReadyToDye) { - await NavigationManager.NavigateTo<JobsModule>(nameof(JobSummeryView)); + await NavigationManager.NavigateWithObject<JobsModule, JobSummeryView, JobSummeryNavigationObject>(new JobSummeryNavigationObject() + { + Context = _db, + Job = job, + }); } else { @@ -307,7 +311,7 @@ namespace Tango.PPC.Jobs.ViewModels Jobs = jobs; DraftJobsCollectionView = new ListCollectionView(Jobs); DraftJobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); - DraftJobsCollectionView.Filter = new Predicate<object>(x => + DraftJobsCollectionView.Filter = new Predicate<object>(x => { var job = x as Job; @@ -324,7 +328,7 @@ namespace Tango.PPC.Jobs.ViewModels HistoryJobsCollectionView = new ListCollectionView(Jobs); HistoryJobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); - HistoryJobsCollectionView.Filter = new Predicate<object>(x => + HistoryJobsCollectionView.Filter = new Predicate<object>(x => { var job = x as Job; @@ -427,7 +431,7 @@ namespace Tango.PPC.Jobs.ViewModels job.RmlGuid = machine.DefaultRml != null ? machine.DefaultRmlGuid : Adapter.Rmls.FirstOrDefault().Guid; job.WindingMethodGuid = Adapter.WindingMethods.FirstOrDefault().Guid; job.SpoolTypeGuid = machine.DefaultSpoolType != null ? machine.DefaultSpoolTypeGuid : Adapter.SpoolTypes.FirstOrDefault().Guid; - + if (Jobs.Count > 0) { job.JobIndex = Jobs.Max(x => x.JobIndex) + 1; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml index 0227e24f5..e44d194bd 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml @@ -210,7 +210,7 @@ </StackPanel> </Grid> - <touch:TouchButton Margin="0 100 0 0" Style="{StaticResource TangoLinkButton}" Height="60" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding RunningJobStatus.IsCompleted,Converter={StaticResource BooleanToVisibilityConverter}}"> + <touch:TouchButton Margin="0 100 0 0" Command="{Binding GoToJobCommand}" Style="{StaticResource TangoLinkButton}" Height="60" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding RunningJobStatus.IsCompleted,Converter={StaticResource BooleanToVisibilityConverter}}"> Go to job </touch:TouchButton> </StackPanel> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/Ready_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/Ready_Anim.gif Binary files differnew file mode 100644 index 000000000..11cef3b10 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/Ready_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/dyeing_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/dyeing_Anim.gif Binary files differnew file mode 100644 index 000000000..058d9a34d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/dyeing_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error_Anim.gif Binary files differnew file mode 100644 index 000000000..9bf0d84f3 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/error_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting_ready_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting_ready_Anim.gif Binary files differnew file mode 100644 index 000000000..79256816a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/getting_ready_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/machine_off_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/machine_off_Anim.gif Binary files differnew file mode 100644 index 000000000..9ca81da39 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/machine_off_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service_Anim.gif Binary files differnew file mode 100644 index 000000000..f5962c36c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/service_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutdown_icon_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutdown_icon_Anim.gif Binary files differnew file mode 100644 index 000000000..d936476b6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/shutdown_icon_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/standby_Anim.gif b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/standby_Anim.gif Binary files differnew file mode 100644 index 000000000..89491179d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/GlobalStatus/standby_Anim.gif diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 8c4cc4992..22ecff0f6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -287,6 +287,14 @@ <Resource Include="Images\Menu\power.png" /> <Resource Include="Images\Menu\update.png" /> <Resource Include="Images\technician-mode.png" /> + <Resource Include="Images\GlobalStatus\getting_ready_Anim.gif" /> + <Resource Include="Images\GlobalStatus\dyeing_Anim.gif" /> + <Resource Include="Images\GlobalStatus\error_Anim.gif" /> + <Resource Include="Images\GlobalStatus\machine_off_Anim.gif" /> + <Resource Include="Images\GlobalStatus\Ready_Anim.gif" /> + <Resource Include="Images\GlobalStatus\service_Anim.gif" /> + <Resource Include="Images\GlobalStatus\shutdown_icon_Anim.gif" /> + <Resource Include="Images\GlobalStatus\standby_Anim.gif" /> <Content Include="Manifests\release.xml" /> <Content Include="Manifests\debug.xml" /> <None Include="packages.config" /> @@ -518,7 +526,7 @@ del "$(TargetDir)firmware_package.tfp"</PostBuildEvent> </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 4079777f7..768fce222 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -214,27 +214,30 @@ <Grid DockPanel.Dock="Right" Margin="0 0 20 0"> <StackPanel Orientation="Horizontal"> <StackPanel x:Name="techPressElement" VerticalAlignment="Center" Background="Transparent"> - <Image Width="33" HorizontalAlignment="Center"> - <Image.Style> - <Style TargetType="Image"> + <touch:TouchGifAnimation Width="36" HorizontalAlignment="Center" EnableAnimation="True"> + <touch:TouchGifAnimation.Style> + <Style TargetType="touch:TouchGifAnimation"> <Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Disconnected}"> - <Setter Property="Source" Value="/Images/GlobalStatus/machine-off.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/machine_off_Anim.gif"></Setter> </DataTrigger> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Standby}"> - <Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/standby_Anim.gif"></Setter> </DataTrigger> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.ReadyToDye}"> - <Setter Property="Source" Value="/Images/GlobalStatus/ready-to-dye.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/Ready_Anim.gif"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.GettingReady}"> + <Setter Property="Source" Value="/Images/GlobalStatus/getting_ready_Anim.gif"></Setter> </DataTrigger> <DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Printing}"> - <Setter Property="Source" Value="/Images/GlobalStatus/dyeing.png"></Setter> + <Setter Property="Source" Value="/Images/GlobalStatus/dyeing_Anim.gif"></Setter> </DataTrigger> </Style.Triggers> </Style> - </Image.Style> - </Image> + </touch:TouchGifAnimation.Style> + </touch:TouchGifAnimation> <TextBlock Margin="0 10 0 0" Text="{Binding MachineProvider.MachineOperator.Status,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock> </StackPanel> diff --git a/Software/Visual_Studio/Tango.AnimatedGif/ImageBehavior.cs b/Software/Visual_Studio/Tango.AnimatedGif/ImageBehavior.cs index cc13688ff..63b951a2f 100644 --- a/Software/Visual_Studio/Tango.AnimatedGif/ImageBehavior.cs +++ b/Software/Visual_Studio/Tango.AnimatedGif/ImageBehavior.cs @@ -264,6 +264,16 @@ namespace Tango.AnimatedGif private static void SetAnimationController(DependencyObject obj, ImageAnimationController value) { obj.SetValue(AnimationControllerPropertyKey, value); + + if (value != null) + { + (value as ImageAnimationController).SpeedRatio = GetSpeedRatio(obj as Image); + + if (GetEnableAnimation(obj as Image)) + { + (value as ImageAnimationController).Play(); + } + } } private static readonly DependencyPropertyKey AnimationControllerPropertyKey = diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/FrameworkElementExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/FrameworkElementExtensions.cs index ca546922f..4371796c4 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/FrameworkElementExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/FrameworkElementExtensions.cs @@ -42,6 +42,13 @@ public static class FrameworkElementExtensions /// <param name="handler">The handler.</param> public static String RegisterForMouseOrTouchDown(this FrameworkElement element, FrameworkElement relativeTo, EventHandler<MouseOrTouchEventArgs> handler) { + var existing_container = _containers.SingleOrDefault(x => x.Element == element && x.Handler == handler); + + if (existing_container != null) + { + return existing_container.Token; + } + bool mousePressed = false; bool touchDown = false; @@ -145,6 +152,13 @@ public static class FrameworkElementExtensions /// <param name="handler">The handler.</param> public static String RegisterForMouseOrTouchUp(this FrameworkElement element, FrameworkElement relativeTo, EventHandler<MouseOrTouchEventArgs> handler) { + var existing_container = _containers.SingleOrDefault(x => x.Element == element && x.Handler == handler); + + if (existing_container != null) + { + return existing_container.Token; + } + bool mouseReleased = false; bool touchReleased = false; @@ -245,6 +259,13 @@ public static class FrameworkElementExtensions /// <param name="handler">The handler.</param> public static String RegisterForPreviewMouseOrTouchDown(this FrameworkElement element, FrameworkElement relativeTo, EventHandler<MouseOrTouchEventArgs> handler) { + var existing_container = _containers.SingleOrDefault(x => x.Element == element && x.Handler == handler); + + if (existing_container != null) + { + return existing_container.Token; + } + bool mousePressed = false; bool touchDown = false; @@ -348,6 +369,13 @@ public static class FrameworkElementExtensions /// <param name="handler">The handler.</param> public static String RegisterForPreviewMouseOrTouchUp(this FrameworkElement element, FrameworkElement relativeTo, EventHandler<MouseOrTouchEventArgs> handler) { + var existing_container = _containers.SingleOrDefault(x => x.Element == element && x.Handler == handler); + + if (existing_container != null) + { + return existing_container.Token; + } + bool mouseReleased = false; bool touchReleased = false; @@ -464,6 +492,13 @@ public static class FrameworkElementExtensions /// <param name="handler">The handler.</param> public static void RegisterForMouseOrTouchMove(this FrameworkElement element, FrameworkElement relativeTo, EventHandler<MouseOrTouchEventArgs> handler) { + var existing_container = _containers.SingleOrDefault(x => x.Element == element && x.Handler == handler); + + if (existing_container != null) + { + return; + } + bool _isTouch = false; MouseEventHandler mouseHandler = (x, e) => diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index b25afd67d..2672b2d0f 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -1356,7 +1356,7 @@ namespace Tango.Integration.Operation ThreadFactory.StartNew(async () => { - Status = MachineStatuses.Printing; + Status = MachineStatuses.GettingReady; RunningJob = originalJob; PrintingStarted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); @@ -1411,6 +1411,22 @@ namespace Tango.Integration.Operation responseLogged = true; LogResponseReceived(response.Message); } + + if (JobHandlingMode == JobHandlerModes.SettingUp) + { + if (response.Message.Status.Progress > request.JobTicket.ProcessParameters.DryerBufferLength) + { + Status = MachineStatuses.Printing; + } + } + else + { + if (response.Message.Status.Progress > 0) + { + Status = MachineStatuses.Printing; + } + } + }, (ex) => { if (!(ex is ContinuousResponseAbortedException)) diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineStatuses.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineStatuses.cs index 3a09256b1..059c1f859 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineStatuses.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineStatuses.cs @@ -15,6 +15,8 @@ namespace Tango.Integration.Operation Standby, [Description("Ready To Dye")] ReadyToDye, + [Description("Getting Ready")] + GettingReady, [Description("Dyeing")] Printing, [Description("Service")] diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchGifAnimation.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchGifAnimation.cs index 45e552a43..38a2175d8 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchGifAnimation.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchGifAnimation.cs @@ -49,6 +49,15 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty EnableAnimationProperty = DependencyProperty.Register("EnableAnimation", typeof(bool), typeof(TouchGifAnimation), new PropertyMetadata(false)); + public TouchGifAnimation() + { + Loaded += TouchGifAnimation_Loaded; + } + + private void TouchGifAnimation_Loaded(object sender, RoutedEventArgs e) + { + EnableAnimation = EnableAnimation; + } static TouchGifAnimation() { |
