diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-01-27 08:54:39 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-01-27 08:54:39 +0200 |
| commit | e204e6ac5d04114778b5b836a3e3707e819ad349 (patch) | |
| tree | 0eb03bfd253cf6f26c72b2f4ccb08b9e03369b5a /Software/Visual_Studio/PPC/Modules | |
| parent | 558c9c58a8be65c2a8430a21de857b335efee491 (diff) | |
| download | Tango-e204e6ac5d04114778b5b836a3e3707e819ad349.tar.gz Tango-e204e6ac5d04114778b5b836a3e3707e819ad349.zip | |
X1 Closure.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
8 files changed, 201 insertions, 119 deletions
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 90ca8ed0c..d3958b678 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 @@ -512,7 +512,7 @@ namespace Tango.PPC.Jobs.ViewModels job.Name = "untitled"; job.NumberOfHeads = 1; - if(BuildProvider.IsEureka) + if(BuildProvider.MachineType == MachineTypes.Eureka) { job.NumberOfUnits = 4; //job.NumberOfHeads = 4; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/LengthWithSpoolsConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/LengthWithSpoolsConverter.cs index 60f94b8aa..a7de6c481 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/LengthWithSpoolsConverter.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Converters/LengthWithSpoolsConverter.cs @@ -6,20 +6,28 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Data; +using Tango.PPC.Common.Build; namespace Tango.PPC.Jobs.Converters { public class LengthWithSpoolsConverter : IMultiValueConverter { + private static IBuildProvider _buildProvider; + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { try { + if (_buildProvider == null) + { + _buildProvider = Core.DI.TangoIOC.Default.GetInstance<IBuildProvider>(); + } + double length = System.Convert.ToDouble(values[0]); bool isEureka = System.Convert.ToBoolean(values[1]); double spools = System.Convert.ToDouble(values[2]); - if (isEureka) + if (_buildProvider.MachineType == BL.Enumerations.MachineTypes.Eureka) return length * spools; else return length; } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs index ca24f4bcf..edfa065d1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/JobModel.cs @@ -10,12 +10,16 @@ using Tango.BL.Enumerations; using Tango.ColorConversion; using Tango.Core; using Tango.Core.DI; +using Tango.PPC.Common.Build; using Tango.PPC.Common.Notifications; namespace Tango.PPC.Jobs.Models { public class JobModel : ExtendedObject { + [TangoInject] + public IBuildProvider BuildProvider { get; set; } + private bool _preventChange; #region Properties @@ -28,7 +32,7 @@ namespace Tango.PPC.Jobs.Models public Job Job { get; set; } protected String _name; - + public String Name { get @@ -81,11 +85,11 @@ namespace Tango.PPC.Jobs.Models { if (Segments != null) { - if((EnableInterSegment && IsAllSegmentsPerSpool)) - return GroupingSegments.Count > 0 ? (GroupingSegments.Sum(x => x.LengthWithInterSegment) ) : 0; + if ((EnableInterSegment && IsAllSegmentsPerSpool)) + return GroupingSegments.Count > 0 ? (GroupingSegments.Sum(x => x.LengthWithInterSegment)) : 0; return GroupingSegments.Sum(x => x.FullLength); //return Segments.Sum(x => x.LengthWithInterSegment); - // return Segments.Sum(x => x.LengthWithFactor) + ((EnableInterSegment && IsAllSegmentsPerSpool) ? (InterSegmentLength * (Segments.Count > 0 ? Segments.Count - 1 : Segments.Count)) : 0); + // return Segments.Sum(x => x.LengthWithFactor) + ((EnableInterSegment && IsAllSegmentsPerSpool) ? (InterSegmentLength * (Segments.Count > 0 ? Segments.Count - 1 : Segments.Count)) : 0); } else { @@ -135,10 +139,27 @@ namespace Tango.PPC.Jobs.Models RaisePropertyChangedAuto(); OnUpdateLengthhWeight(); RaisePropertyChanged(nameof(GetEstimatedDuration)); + RaisePropertyChanged(nameof(SpoolCopies)); } } } - + + public double SpoolCopies + { + get + { + if (BuildProvider.MachineType == MachineTypes.Eureka) + { + return NumberOfUnits; + } + else + { + return (double)NumberOfUnits / (double)NumberSpools; + } + } + + } + protected Double _intersegmentlength; /// <summary> @@ -181,16 +202,23 @@ namespace Tango.PPC.Jobs.Models get { //JsonConvert.SerializeObject(this,Formatting.Indented); - _lastLength = GetLength(); - var l = _lastLength * Math.Max(NumberOfUnits, 1); - - if (EnableInterSegment && NumberOfUnits > 1) + + if (BuildProvider.MachineType == MachineTypes.Eureka) { - l += ((NumberOfUnits - 1) * InterSegmentLength); - } + var l = _lastLength * Math.Max(NumberOfUnits, 1); - return l; + if (EnableInterSegment && NumberOfUnits > 1) + { + l += ((NumberOfUnits - 1) * InterSegmentLength); + } + + return l; + } + else + { + return (_lastLength * Copies) / (double)_numberSpools; + } } } @@ -199,12 +227,19 @@ namespace Tango.PPC.Jobs.Models { get { - if(NumberSpools >= 4) + if (BuildProvider.MachineType == MachineTypes.Eureka) + { + if (NumberSpools >= 4) + { + return LengthIncludingNumberOfUnits * NumberSpools; + } + + return LengthIncludingNumberOfUnits; + } + else { - return LengthIncludingNumberOfUnits * NumberSpools; + return _lastLength * Copies; } - - return LengthIncludingNumberOfUnits; } } @@ -227,7 +262,7 @@ namespace Tango.PPC.Jobs.Models { _rml = value; RaisePropertyChangedAuto(); - RaisePropertyChanged( nameof(GetEstimatedDuration)); + RaisePropertyChanged(nameof(GetEstimatedDuration)); RaisePropertyChanged(nameof(GramPerLength)); OnUpdateLengthhWeight(); } @@ -268,7 +303,7 @@ namespace Tango.PPC.Jobs.Models /// </summary> [JsonIgnore] public List<ColorSpace> ColorSpacesList { get; set; } - + protected Customer _customer; /// <summary> @@ -342,7 +377,8 @@ namespace Tango.PPC.Jobs.Models public string SpoolTypeName { get { return _spoolTypeName; } - set { + set + { _spoolTypeName = value; RaisePropertyChangedAuto(); } @@ -351,7 +387,7 @@ namespace Tango.PPC.Jobs.Models public string SpoolGuid { - get { return SpoolType.Guid; } + get { return SpoolType.Guid; } } private int _numberSpools; @@ -359,8 +395,9 @@ namespace Tango.PPC.Jobs.Models public int NumberSpools { get { return _numberSpools; } - set { - if(_numberSpools != value) + set + { + if (_numberSpools != value) { _numberSpools = value; RaisePropertyChangedAuto(); @@ -383,20 +420,28 @@ namespace Tango.PPC.Jobs.Models { if (_copies != value) { - if (NumberSpools>=4) + if (BuildProvider.MachineType == MachineTypes.Eureka) { - if(value < NumberSpools) - _copies = NumberSpools; - else + if (NumberSpools >= 4) { - int coeff = (int)(value + NumberSpools - 1) / NumberSpools; - _copies = coeff * NumberSpools; + if (value < NumberSpools) + _copies = NumberSpools; + else + { + int coeff = (int)(value + NumberSpools - 1) / NumberSpools; + _copies = coeff * NumberSpools; + } + NumberOfUnits = (int)_copies / NumberSpools; + OnUpdateLengthhWeight(); } - NumberOfUnits = (int)_copies / NumberSpools; - OnUpdateLengthhWeight(); + else + _copies = value; } else + { _copies = value; + NumberOfUnits = value; + } RaisePropertyChangedAuto(); } } @@ -424,8 +469,8 @@ namespace Tango.PPC.Jobs.Models } } } - public JobTypes JobType { get; set; } - + public JobTypes JobType { get; set; } + protected SynchronizedObservableCollection<SegmentModel> _segments; /// <summary> @@ -467,7 +512,7 @@ namespace Tango.PPC.Jobs.Models { _segmentsGroups = value; RaisePropertyChangedAuto(); - + } } } @@ -490,14 +535,14 @@ namespace Tango.PPC.Jobs.Models } } } - + private ObservableCollection<SegmentModel> _effectiveSegments; [JsonIgnore] public ObservableCollection<SegmentModel> EffectiveSegments { get { - return _effectiveSegments; + return _effectiveSegments; } } @@ -538,7 +583,8 @@ namespace Tango.PPC.Jobs.Models [JsonIgnore] public bool HasSelectedItems { - get { + get + { return GroupingSegments.Any(x => x.IsSelected); } } @@ -548,13 +594,13 @@ namespace Tango.PPC.Jobs.Models { get { - var items = GroupingSegments.Where(x=> x.IsSelected).ToList(); - - foreach(var item in items) + var items = GroupingSegments.Where(x => x.IsSelected).ToList(); + + foreach (var item in items) { - if(item is SegmentModel seg) + if (item is SegmentModel seg) { - if(seg.IsGradient) + if (seg.IsGradient) return true; } else if (item is SegmentsGroupModel group) @@ -568,7 +614,7 @@ namespace Tango.PPC.Jobs.Models } } } - return false ; + return false; } } @@ -602,9 +648,9 @@ namespace Tango.PPC.Jobs.Models } } - + ProcessParametersTable _processParametersTable; - [JsonIgnore] + [JsonIgnore] public ProcessParametersTable ProcessParametersTable { get @@ -622,9 +668,9 @@ namespace Tango.PPC.Jobs.Models } } - private void InitializeProcessParameters() + private void InitializeProcessParameters() { - _processParametersTable = GetRecommendedProcessParameters(); + _processParametersTable = GetRecommendedProcessParameters(); } [JsonIgnore] @@ -635,7 +681,7 @@ namespace Tango.PPC.Jobs.Models if (Rml == null || Rml.GetActiveProcessGroup().ProcessParametersTables == null) return TimeSpan.Zero; var processParameters = ProcessParametersTable; - if(processParameters == null) + if (processParameters == null) processParameters = Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault(); if (processParameters.DyeingSpeed != 0) @@ -673,7 +719,7 @@ namespace Tango.PPC.Jobs.Models } } - + [JsonIgnore] @@ -684,12 +730,12 @@ namespace Tango.PPC.Jobs.Models { get { - if(Rml != null) + if (Rml != null) return Rml.GetGramPer1000mLength; return 0d; } } - + [JsonIgnore] public double WeightIncludingNumberOfUnits { @@ -703,7 +749,7 @@ namespace Tango.PPC.Jobs.Models return weight; } } - + [JsonIgnore] public double WeightIncludingNumberOfUnitsAndSpools { @@ -724,6 +770,7 @@ namespace Tango.PPC.Jobs.Models public JobModel(List<ColorSpace> list, bool isEureka) { + TangoIOC.Default.Inject(this); ColorSpacesList = list; _segments = new SynchronizedObservableCollection<SegmentModel>(); _segmentsGroups = new SynchronizedObservableCollection<SegmentsGroupModel>(); @@ -753,7 +800,7 @@ namespace Tango.PPC.Jobs.Models { LoadGroupingSegments(); } - + /// <summary> /// Loads the grouping segments. /// </summary> @@ -765,7 +812,7 @@ namespace Tango.PPC.Jobs.Models //segmentsWithGroups.AddRange(Segments.Where(x => x.SegmentsGroupModel == null)); //segmentsWithGroups.AddRange(SegmentsGroups); OrderedSegmentsWithGroups.ForEach(x => _groupingSegments.Add(x)); - + if (_groupingSegments.Count > 0) _groupingSegments.Last().IsLast = true; RaisePropertyChanged(nameof(GroupingSegments)); @@ -810,7 +857,7 @@ namespace Tango.PPC.Jobs.Models /// <returns></returns> public SegmentModel CreateInterSegment(double length) { - SegmentModel segment = new SegmentModel() + SegmentModel segment = new SegmentModel() { IsInterSegment = true, Length = length, @@ -833,7 +880,7 @@ namespace Tango.PPC.Jobs.Models /// <param name="length">The length.</param> /// <param name="segmentIndex">Index of the segment.</param> /// <returns></returns> - public SegmentModel AddNewSegment( double length, Int32 segmentIndex) + public SegmentModel AddNewSegment(double length, Int32 segmentIndex) { SegmentModel segment = new SegmentModel(); segment.Name = "Standard Segment"; @@ -842,57 +889,57 @@ namespace Tango.PPC.Jobs.Models segment.Job = this; segment.EnableInterSegment = InterSegmentLength > 0; - + Segments.Add(segment); if (segmentIndex < GroupingSegments.Count()) { - GroupingSegments.Insert(segmentIndex , segment); + GroupingSegments.Insert(segmentIndex, segment); } else GroupingSegments.Add(segment); ArrangeSegmentsIndixes(); - + return segment; } protected ProcessParametersTable GetRecommendedProcessParameters() { - try + try + { + IColorConverter _converter = new DefaultColorConverter(); + bool useLightInks = true; + if (OrderedSegmentsWithGroups.Count > 1 && !EnableInterSegment) + useLightInks = false; + List<BrushStop> stops = new List<BrushStop>(); + foreach (var segment in OrderedSegmentsWithGroups) { - IColorConverter _converter = new DefaultColorConverter(); - bool useLightInks = true; - if (OrderedSegmentsWithGroups.Count > 1 && !EnableInterSegment) - useLightInks = false; - List<BrushStop> stops = new List<BrushStop>(); - foreach (var segment in OrderedSegmentsWithGroups) + if (segment is SegmentModel innerSegment) { - if (segment is SegmentModel innerSegment) + foreach (var stop in innerSegment.BrushStops.OrderBy(x => x.StopIndex).ToList()) { - foreach (var stop in innerSegment.BrushStops.OrderBy(x => x.StopIndex).ToList()) - { - BrushStop bs = stop.CreateBrushStop(); - stops.Add(bs); - } + BrushStop bs = stop.CreateBrushStop(); + stops.Add(bs); } - else if (segment is SegmentsGroupModel group) + } + else if (segment is SegmentsGroupModel group) + { + foreach (var segm_group in group.Segments.OrderBy(x => x.SegmentIndex)) { - foreach (var segm_group in group.Segments.OrderBy(x => x.SegmentIndex)) + foreach (var stop in segm_group.BrushStops.OrderBy(x => x.StopIndex).ToList()) { - foreach (var stop in segm_group.BrushStops.OrderBy(x => x.StopIndex).ToList()) - { - BrushStop bs = stop.CreateBrushStop(); - stops.Add(bs); - } + BrushStop bs = stop.CreateBrushStop(); + stops.Add(bs); } } } - return _converter.GetRecommendedProcessParameters(Rml, Machine, stops, Rml.GetActiveProcessGroup(), useLightInks); - } - catch (Exception ex) - { - LogManager.Log(ex, "Error calculating recommended process parameters."); - return null; } + return _converter.GetRecommendedProcessParameters(Rml, Machine, stops, Rml.GetActiveProcessGroup(), useLightInks); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error calculating recommended process parameters."); + return null; + } } #endregion @@ -900,7 +947,7 @@ namespace Tango.PPC.Jobs.Models private void OnEnableInterSegmentChanged() { - if(EnableInterSegment == false && InterSegmentLength > 0) + if (EnableInterSegment == false && InterSegmentLength > 0) { _intersegmentlength = 0; RaisePropertyChanged(nameof(InterSegmentLength)); @@ -942,14 +989,14 @@ namespace Tango.PPC.Jobs.Models // effectiveSegments.Add(segments[i].Clone()); //} //else - effectiveSegments.Add(segments[i]); + effectiveSegments.Add(segments[i]); if (EnableInterSegment && !(repeats == (segmentsGroup.Repeats - 1) && i == (segments.Count - 1))) { effectiveSegments.Add(CreateInterSegment(InterSegmentLength)); } } } - if (EnableInterSegment && segmentsGroup.SegmentIndex != max ) + if (EnableInterSegment && segmentsGroup.SegmentIndex != max) { effectiveSegments.Add(CreateInterSegment(InterSegmentLength)); } @@ -1000,11 +1047,11 @@ namespace Tango.PPC.Jobs.Models segment.PropertyChanged -= Segment_PropertyChanged; segment.PropertyChanged += Segment_PropertyChanged; } - + OnLengthChanged(); //UpdateEffectiveSegments(); } - + /// <summary> /// Handles the PropertyChanged event of all job segments. /// </summary> @@ -1024,14 +1071,14 @@ namespace Tango.PPC.Jobs.Models OnLengthChanged(); UpdateEffectiveSegments(); } - else if(e.PropertyName == nameof(SegmentModel.IsSelected)) + else if (e.PropertyName == nameof(SegmentModel.IsSelected)) { if (_preventChange) return; - if(Segments.ToList().TrueForAll(x => x.IsSelected)) + if (Segments.ToList().TrueForAll(x => x.IsSelected)) { _selectAllSegments = true; } - else + else { _selectAllSegments = false; } @@ -1039,7 +1086,7 @@ namespace Tango.PPC.Jobs.Models UpdateSelectedButtons(); } } - + private void SegmentsGroup_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { foreach (var group in GroupingSegments.ToList()) @@ -1098,7 +1145,7 @@ namespace Tango.PPC.Jobs.Models { var maxRep = (maxLength == 0 ? 999 : (maxLength / Length)); - if(!IsEureka) + if (!IsEureka) await TangoIOC.Default.GetInstance<INotificationProvider>().ShowError($"You have reached the maximum length for this job {maxLength}."); //if(NumberOfUnits > 1 && NumberOfUnits > maxRep) @@ -1106,12 +1153,12 @@ namespace Tango.PPC.Jobs.Models // NumberOfUnits = (int)maxRep; //} } - + OnUpdateLengthhWeight(); RaisePropertyChanged(nameof(Length)); } - RaisePropertyChanged(nameof(GetEstimatedDuration)); + RaisePropertyChanged(nameof(GetEstimatedDuration)); } private void OnUpdateLengthhWeight() @@ -1124,7 +1171,7 @@ namespace Tango.PPC.Jobs.Models private void OnSelectAllChanged() { - if (Segments != null ) + if (Segments != null) { _preventChange = true; GroupingSegments.ToList().ForEach(x => x.IsSelected = SelectAllSegments); @@ -1143,21 +1190,28 @@ namespace Tango.PPC.Jobs.Models } _enableintersegment = InterSegmentLength > 0; _preventChange = false; - + OnLengthChanged(); UpdateEffectiveSegments(); } - + private void OnNumberOfSpoolsChanged() { - if(NumberSpools >= 4) + if (BuildProvider.MachineType == MachineTypes.Eureka) { - int coeff = (int)(Copies + NumberSpools -1) / NumberSpools; - _copies = coeff * NumberSpools; - RaisePropertyChanged(nameof(Copies)); + if (NumberSpools >= 4) + { + int coeff = (int)(Copies + NumberSpools - 1) / NumberSpools; + _copies = coeff * NumberSpools; + RaisePropertyChanged(nameof(Copies)); + } + } + else + { + RaisePropertyChanged(nameof(SpoolCopies)); } } - + #endregion #region collapsed mode actions diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index ee3cece33..81ce7f959 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs @@ -74,6 +74,15 @@ namespace Tango.PPC.Jobs.ViewModels #region Properties + public int CopiesStep + { + get + { + return BuildProvider.MachineType == MachineTypes.Eureka ? 4 : 1; + } + } + + private Job _job; /// <summary> /// Gets or sets the selected job. @@ -548,7 +557,7 @@ namespace Tango.PPC.Jobs.ViewModels RaisePropertyChanged(nameof(SelectedRML)); await LoadRML(_selectedRML); - if (BuildProvider.IsEureka && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count <= 1) + if (BuildProvider.MachineType.IsXMachine() && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count <= 1) { IsBasicMode = true; } @@ -615,7 +624,7 @@ namespace Tango.PPC.Jobs.ViewModels PPCSpoolType = _spoolTypes.FirstOrDefault(x => x.Type == BL.Enumerations.SpoolTypes.FlatSpool); } - var jobModel = new JobModel(ColorSpaces, BuildProvider.IsEureka) + var jobModel = new JobModel(ColorSpaces, BuildProvider.MachineType == MachineTypes.Eureka) { Name = Job.Name, Guid = Job.Guid, @@ -634,8 +643,8 @@ namespace Tango.PPC.Jobs.ViewModels JobType = Job.JobType, InterSegmentLength = Job.InterSegmentLength, EnableInterSegment = Job.EnableInterSegment, - NumberSpools = (BuildProvider.IsEureka ? Job.NumberOfSpools : 1), - Copies = (BuildProvider.IsEureka ? Job.NumberOfUnits * Job.NumberOfSpools : Job.NumberOfUnits) + NumberSpools = Job.NumberOfSpools, + Copies = (BuildProvider.MachineType == MachineTypes.Eureka ? Job.NumberOfUnits * Job.NumberOfSpools : Job.NumberOfUnits) }; Dictionary<string, SegmentsGroupModel> guidToGroup = new Dictionary<string, SegmentsGroupModel>(); if (Job.Version < 2) @@ -785,7 +794,7 @@ namespace Tango.PPC.Jobs.ViewModels RaisePropertyChanged(nameof(CanEdit)); DropResumeCommand.RaiseCanExecuteChanged(); - if (!BuildProvider.IsEureka) + if (!BuildProvider.MachineType.IsXMachine()) { await NavigationManager.NavigateTo<JobsV2Module>(nameof(JobProgressView)); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs index 8f886e073..67a4cf972 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs @@ -350,7 +350,7 @@ namespace Tango.PPC.Jobs.ViewModels RaiseMessage(new JobSelectedMessage() { Job = job, Context = _db }); - if (BuildProvider.IsEureka) + if (BuildProvider.MachineType.IsXMachine()) { await NavigationManager.NavigateTo<JobsV2Module>(nameof(JobEurekaView)); } @@ -474,7 +474,14 @@ namespace Tango.PPC.Jobs.ViewModels job.Name = "Unnamed"; job.EnableInterSegment = false; job.InterSegmentLength = 0; - job.NumberOfSpools = 4; + if (BuildProvider.MachineType == MachineTypes.Eureka) + { + job.NumberOfSpools = 4; + } + else + { + job.NumberOfSpools = 1; + } job.NumberOfUnits = 1; } else @@ -1053,7 +1060,11 @@ namespace Tango.PPC.Jobs.ViewModels { job.EnableInterSegment = false; job.InterSegmentLength = 0; - job.NumberOfSpools = 4; + + if (BuildProvider.MachineType == MachineTypes.Eureka) + { + job.NumberOfSpools = 4; + } job.NumberOfUnits = 1; } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index 980c38082..b14b7f155 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -872,13 +872,13 @@ <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"> <TextBlock HorizontalAlignment="Left" Margin="20 10 0 0" Text="Divided By Spools" FontSize="{StaticResource TangoButtonFontSize}" Width="Auto"/> <Border Margin="20 0 0 0" BorderThickness="1" Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Width="120" DockPanel.Dock="Right"> - <touch:TouchNumericTextBox BorderBrush="Transparent" Margin="0 0 0 0" HasDecimalPoint="False" Minimum="4" Step="4" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.NumberSpools}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox> + <touch:TouchNumericTextBox BorderBrush="Transparent" Margin="0 0 0 0" HasDecimalPoint="False" Minimum="{Binding CopiesStep,Mode=OneWay}" Step="{Binding CopiesStep,Mode=OneWay}" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.NumberSpools}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox> </Border> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" Text="Copies" FontSize="{StaticResource TangoButtonFontSize}" Width="145"/> <Border Margin="20 0 0 0" BorderThickness="1" Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Width="120"> - <touch:TouchNumericTextBox BorderBrush="Transparent" HasDecimalPoint="False" Minimum="4" Maximum="1000000" Step="4" Margin="0 0 0 0" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.Copies}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox> + <touch:TouchNumericTextBox BorderBrush="Transparent" HasDecimalPoint="False" Minimum="{Binding CopiesStep,Mode=OneWay}" Maximum="1000000" Step="{Binding CopiesStep,Mode=OneWay}" Margin="0 0 0 0" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.Copies}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox> </Border> </StackPanel> @@ -1294,7 +1294,7 @@ </TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}"> <Run Text="Copies:" FontWeight="Normal"></Run> - <Run Text="{Binding JobModel.NumberOfUnits}" FontWeight="Bold"/> + <Run Text="{Binding JobModel.SpoolCopies,Mode=OneWay}" FontWeight="Bold"/> </TextBlock> <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <Run Text="Total:" FontWeight="Normal"></Run> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml.cs index 38f3bb346..d97e9cd61 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml.cs @@ -41,7 +41,7 @@ namespace Tango.PPC.Jobs.Views _vm = DataContext as JobViewVM; }; - if (TangoIOC.Default.GetInstance<IBuildProvider>().IsEureka) + if (TangoIOC.Default.GetInstance<IBuildProvider>().MachineType.IsXMachine()) { TangoIOC.Default.Register<IJobView>(this); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml.cs index 1780e654e..702596c61 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobView.xaml.cs @@ -41,7 +41,7 @@ namespace Tango.PPC.Jobs.Views _vm = DataContext as JobViewVM; }; - if (!TangoIOC.Default.GetInstance<IBuildProvider>().IsEureka) + if (!TangoIOC.Default.GetInstance<IBuildProvider>().MachineType.IsXMachine()) { TangoIOC.Default.Register<IJobView>(this); } |
