From 3c76016cff1a5e5d9c2ad270a954056e77ea9ce8 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 26 Jun 2018 13:54:56 +0300 Subject: Fixed issue on numeric text input. Updated machine studio update service to accept hashed passwords.. Added Job summery to job view. --- .../MachineStudioUpdateService.svc.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs index b90a03c1d..49521fb1d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs @@ -60,8 +60,7 @@ namespace Tango.MachineStudio.UpdateService db.UsersRoles.ToList(); db.RolesPermissions.ToList(); - String hash = User.GetPasswordHash(request.Password); - var user = db.Users.SingleOrDefault(x => x.Email.ToLower() == request.Email.ToLower() && x.Password == hash); + var user = db.Users.SingleOrDefault(x => x.Email.ToLower() == request.Email.ToLower() && x.Password == request.Password); if (user != null && user.HasPermission(Permissions.RunMachineStudio) || (request.Email == "ForceUpdate")) { @@ -111,9 +110,7 @@ namespace Tango.MachineStudio.UpdateService db.UsersRoles.ToList(); db.RolesPermissions.ToList(); - String hash = User.GetPasswordHash(request.Password); - - var user = db.Users.SingleOrDefault(x => x.Email.ToLower() == request.Email.ToLower() && x.Password == hash); + var user = db.Users.SingleOrDefault(x => x.Email.ToLower() == request.Email.ToLower() && x.Password == request.Password); if (user != null && user.HasPermission(Permissions.PublishMachineStudioVersion)) { -- cgit v1.3.1 From a56ec33e5ca497d6433082c286c4cb75c965fe37 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 26 Jun 2018 16:11:36 +0300 Subject: Implemented Add solid & gradient segments. --- .../ViewModels/MainViewVM.cs | 2 +- .../Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml | 10 +---- .../Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 45 ++++++++++++++++++++-- .../PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 2 +- .../Tango.BL/EntitiesExtensions/BrushStop.cs | 34 ++++++++++------ .../Tango.Integration/Operation/MachineOperator.cs | 2 +- 6 files changed, 69 insertions(+), 26 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 106848b7a..e2bba2d1d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -1661,7 +1661,7 @@ namespace Tango.MachineStudio.Developer.ViewModels } else { - stop.StopIndex = 0; + stop.StopIndex = 1; } stop.OffsetPercent = 100; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml index 1769dd49d..c674b57fe 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml @@ -70,15 +70,7 @@ - - - - - - - - - + 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 15f438baf..3cb7c2322 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 @@ -99,6 +99,11 @@ namespace Tango.PPC.Jobs.ViewModels /// public RelayCommand AddSolidSegmentCommand { get; set; } + /// + /// Gets or sets the add gradient segment command. + /// + public RelayCommand AddGradientSegmentCommand { get; set; } + /// /// Gets or sets the add brush stop command. /// @@ -114,14 +119,16 @@ namespace Tango.PPC.Jobs.ViewModels public JobViewVM() { RegisterForMessage(HandleJobSelectedMessage); - AddSolidSegmentCommand = new RelayCommand(AddSolidSegment); CustomersAutoCompleteProvider = new AutoCompleteProvider((customer, filter) => { return customer.Name.ToLower().StartsWith(filter != null ? filter.ToLower() : String.Empty); }); + //Initialize Commands + AddSolidSegmentCommand = new RelayCommand(() => AddSolidSegment()); AddBrushStopCommand = new RelayCommand(AddBrushStop); + AddGradientSegmentCommand = new RelayCommand(() => AddGradientSegment()); } #endregion @@ -131,9 +138,37 @@ namespace Tango.PPC.Jobs.ViewModels /// /// Adds a new solid segment. /// - private void AddSolidSegment() + private Segment AddSolidSegment() { - MessageBox.Show("SOLID"); + Segment segment = new Segment(); + + if (Job.Segments.Count > 0) + { + segment.SegmentIndex = Job.Segments.Max(x => x.SegmentIndex) + 1; + } + else + { + segment.SegmentIndex = 1; + } + + segment.Length = 10; + + AddBrushStop(segment); + Job.Segments.Add(segment); + + return segment; + } + + /// + /// Adds a new gradient segment. + /// + private Segment AddGradientSegment() + { + var segment = AddSolidSegment(); + segment.BrushStops.Last().Color = Colors.Silver; + AddBrushStop(segment); + segment.BrushStops.Last().Color = Colors.DimGray; + return segment; } #endregion @@ -158,6 +193,10 @@ namespace Tango.PPC.Jobs.ViewModels stop.StopIndex = segment.BrushStops.Max(x => x.StopIndex) + 1; stop.OffsetPercent = 100; } + else + { + stop.StopIndex = 1; + } stop.Segment = segment; stop.Color = Colors.Black; 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 c033d878c..4400a7a6e 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 @@ -346,7 +346,7 @@ SOLID SEGMENT - + diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs index c565275ea..bdb308f45 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs @@ -80,15 +80,6 @@ namespace Tango.BL.Entities } } - /// - /// Gets the brush stop index within it's segment brush stops collection. - /// - [NotMapped] - public int Index - { - get { return StopIndex; } - } - /// /// Gets a value indicating whether this brush stop is the first one within its segment brush stops. /// @@ -96,7 +87,17 @@ namespace Tango.BL.Entities [JsonIgnore] public bool IsFirst { - get { return StopIndex == 0; } + get + { + if (Segment.BrushStops.Count > 0) + { + return StopIndex == Segment.BrushStops.Min(x => x.StopIndex); + } + else + { + return true; + } + } } /// @@ -106,7 +107,17 @@ namespace Tango.BL.Entities [JsonIgnore] public bool IsLast { - get { return StopIndex == Segment.BrushStops.Count - 1; } + get + { + if (Segment.BrushStops.Count > 0) + { + return StopIndex == Segment.BrushStops.Max(x => x.StopIndex); + } + else + { + return true; + } + } } /// @@ -160,6 +171,7 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(OffsetMeters)); RaisePropertyChanged(nameof(IsFirst)); RaisePropertyChanged(nameof(IsLast)); + RaisePropertyChanged(nameof(IsMiddle)); } /// diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index a75ce5e2e..f64382456 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -491,7 +491,7 @@ namespace Tango.Integration.Operation foreach (var stop in segment.BrushStops) { JobBrushStop jobStop = new JobBrushStop(); - jobStop.Index = stop.Index; + jobStop.Index = stop.StopIndex; jobStop.OffsetPercent = stop.OffsetPercent; jobStop.OffsetMeters = stop.OffsetMeters; -- cgit v1.3.1