From 739fd56662cdee59f42ec8d80654babf158b9f51 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 11 Nov 2018 16:18:23 +0200 Subject: Machine Studio v3.5.63 --- .../DeveloperModuleSettings.cs | 2 ++ .../ViewModels/MainViewVM.cs | 27 +++++++++++++++++++++- .../ViewModels/MachineTechViewVM.cs | 13 ++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs index 5e0e6d838..e6d5674e1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs @@ -22,6 +22,8 @@ namespace Tango.MachineStudio.Developer public List ProcessParametersIndices { get; set; } + public String DefaultJobRmlGuid { get; set; } + public DeveloperModuleSettings() { ProcessParametersIndices = new List(); 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 79b1f1c17..f15ffb2c7 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 @@ -1773,6 +1773,10 @@ namespace Tango.MachineStudio.Developer.ViewModels SelectedMachineJob.Segments = SelectedMachineJob.Segments; }); + var settings = SettingsManager.Default.GetOrCreate(); + settings.DefaultJobRmlGuid = ActiveJob.RmlGuid; + settings.Save(); + }); } @@ -2015,16 +2019,37 @@ namespace Tango.MachineStudio.Developer.ViewModels { LogManager.Log(String.Format("Adding new job {0}...", jobName)); + var settings = SettingsManager.Default.GetOrCreate(); + Job newJob = new Job(); newJob.Name = jobName; newJob.CreationDate = DateTime.UtcNow; newJob.UserGuid = _authentication.CurrentUser.Guid; - newJob.Rml = _machineDbContext.Rmls.FirstOrDefault(); + + if (String.IsNullOrWhiteSpace(settings.DefaultJobRmlGuid)) + { + newJob.Rml = _machineDbContext.Rmls.FirstOrDefault(); + } + else + { + var rml = _machineDbContext.Rmls.SingleOrDefault(x => x.Guid == settings.DefaultJobRmlGuid); + if (rml != null) + { + newJob.Rml = rml; + } + else + { + newJob.Rml = _machineDbContext.Rmls.FirstOrDefault(); + } + } + newJob.WindingMethod = _machineDbContext.WindingMethods.FirstOrDefault(); newJob.SpoolType = _machineDbContext.SpoolTypes.FirstOrDefault(); newJob.ColorSpace = _machineDbContext.ColorSpaces.FirstOrDefault(); newJob.Machine = SelectedMachine; + + SelectedMachine.Jobs.Add(newJob); var segment = newJob.AddSolidSegment(); segment.BrushStops[0].SetAllDispensingStepDivisions(BL.Dispensing.DispenserStepDivisions.D8); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index a02e09e9a..4b362688f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -1276,10 +1276,15 @@ namespace Tango.MachineStudio.Technician.ViewModels }) .Subscribe((response) => { - item.HomingMaximumProgress = response.MaxProgress; item.HomingProgress = response.Progress; + },(ex) => + { + + item.IsHoming = false; + item.IsHomingCompleted = true; + }, () => { @@ -1372,6 +1377,12 @@ namespace Tango.MachineStudio.Technician.ViewModels item.HomingMaximumProgress = response.MaxProgress; item.HomingProgress = response.Progress; + }, (ex) => + { + + item.IsHoming = false; + item.IsHomingCompleted = true; + }, () => { -- cgit v1.3.1 From 32e58dfd83a96add18a89f40add3c3883d4ac004 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 12 Nov 2018 18:50:00 +0200 Subject: Machine Studio v3.5.64 --- .../Visual_Studio/Build/Shortcuts/Machine Studio.lnk | Bin 1532 -> 1532 bytes .../ViewModels/MainViewVM.cs | 14 ++++++++++++++ .../Tango.MachineStudio.UI/Properties/AssemblyInfo.cs | 2 +- .../TFS/TeamFoundationServiceExtendedClient.cs | 7 ++++++- 4 files changed, 21 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules') diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk index a7935df17..3b408cedd 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index de9a8de4a..5ae5c531c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -349,6 +349,20 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels #endregion + #region Public Methods + + /// + /// Sets the selected machine without any further processing. + /// + /// The machine. + public void SetSelectedMachine(Machine machine) + { + _machine = machine; + RaisePropertyChanged(nameof(Machine)); + } + + #endregion + #region Drag Drop Handlers /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index d4f5c4c48..ac17165ca 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("3.5.63.18305")] +[assembly: AssemblyVersion("3.5.64.18305")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs index 8f67a21c2..6753fec73 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs @@ -207,7 +207,12 @@ namespace Tango.MachineStudio.UI.TFS machineView.PanelColumnDefinition.Width = new GridLength(0); machineView.stackHeader.Visibility = Visibility.Collapsed; machineView.Background = System.Windows.Media.Brushes.White; - machineView.DataContext = new MachineDesigner.ViewModels.MainViewVM() { SelectedMachine = machine, Configuration = machine.Configuration }; + + + var machineDesignerVM = new MachineDesigner.ViewModels.MainViewVM(); + machineDesignerVM.SetSelectedMachine(machine); + machineDesignerVM.Configuration = machine.Configuration; + machineView.DataContext = machineDesignerVM; var configImageFile = _tempFolder.CreateImaginaryFile(); machineView.RenderToFile(configImageFile.Path, System.Drawing.Imaging.ImageFormat.Jpeg, new Size(machineView.Width, machineView.Height), 100); -- cgit v1.3.1 From 996422d12e0a40aa408757989232f0225dc29a28 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 13 Nov 2018 09:37:40 +0200 Subject: Fixed issue with CSV monitor recorder. Machine Studio v3.5.65 --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 20578304 -> 20578304 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 15400960 -> 15400960 bytes .../Build/Shortcuts/Machine Studio.lnk | Bin 1532 -> 1532 bytes .../TechItems/MonitorRecorderItem.cs | 23 +++++++++++++++++++++ .../ViewModels/MachineTechViewVM.cs | 7 ++++++- .../Properties/AssemblyInfo.cs | 2 +- .../Components/SelectedObjectCollection.cs | 3 +++ 9 files changed, 33 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index 7a00ca094..af81d06b8 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 ffb2044cf..b2589d464 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index e3cd1d1a2..7aa106704 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index a9975f8dd..fef43d7a0 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk index 3b408cedd..0f274349d 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorRecorderItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorRecorderItem.cs index e2b62092d..321d87632 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorRecorderItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MonitorRecorderItem.cs @@ -29,6 +29,8 @@ namespace Tango.MachineStudio.Technician.TechItems [XmlIgnore] public SelectedObjectCollection Monitors { get; set; } + public List SelectedMonitorsGuids { get; set; } + private bool _isRecording; /// /// Gets or sets a value indicating whether this instance is recording. @@ -75,7 +77,10 @@ namespace Tango.MachineStudio.Technician.TechItems _timer.Tick += _timer_Tick; _timer.Interval = TimeSpan.FromSeconds(1); + SelectedMonitorsGuids = new List(); + Monitors = new SelectedObjectCollection(Adapter.TechMonitors.ToObservableCollection(), new ObservableCollection()); + Monitors.SelectionChanged += Monitors_SelectionChanged; Name = "CSV Recorder"; Description = "Record multiple monitors to a CSV file"; Image = ResourceHelper.GetImageFromResources("Images/csv.png"); @@ -85,6 +90,11 @@ namespace Tango.MachineStudio.Technician.TechItems TogglePauseCommand = new RelayCommand(() => { IsPaused = !IsPaused; }); } + private void Monitors_SelectionChanged(object sender, EventArgs e) + { + SelectedMonitorsGuids = GetSelectedMonitors().Select(x => x.Guid).ToList(); + } + public MonitorRecorderItem(object dummy) : this() { @@ -127,5 +137,18 @@ namespace Tango.MachineStudio.Technician.TechItems { return Monitors.SynchedSource.ToList(); } + + public void SetSelectedMonitors(IEnumerable monitors) + { + foreach (var monitor in monitors.ToList()) + { + var item = Monitors.ToList().SingleOrDefault(x => x.Data == monitor); + + if (item != null) + { + item.IsSelected = true; + } + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index 4b362688f..85b32437b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -962,7 +962,8 @@ namespace Tango.MachineStudio.Technician.ViewModels } else if (item is MonitorRecorderItem) { - CreateElement(item); + var editor = CreateElement(item); + InitMonitorRecorderItem(editor.MonitorRecorderItem); } } @@ -1880,6 +1881,10 @@ namespace Tango.MachineStudio.Technician.ViewModels { (item as MotorGroupItem).TechMotors = ObservablesStaticCollections.Instance.HardwareMotorTypes.Where(x => (item as MotorGroupItem).ItemsGuids.Contains(x.Guid)).ToObservableCollection(); } + else if (item is MonitorRecorderItem) + { + (item as MonitorRecorderItem).SetSelectedMonitors(ObservablesStaticCollections.Instance.TechMonitors.Where(x => (item as MonitorRecorderItem).SelectedMonitorsGuids.Contains(x.Guid)).ToList()); + } AddTechItem(item); } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index ac17165ca..1bbeea6c0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("3.5.64.18305")] +[assembly: AssemblyVersion("3.5.65.18305")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs b/Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs index c9a1a6293..e09bb832e 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs @@ -10,6 +10,7 @@ namespace Tango.SharedUI.Components { public class SelectedObjectCollection : ObservableCollection> { + public event EventHandler SelectionChanged; public ObservableCollection Source { get; set; } public ObservableCollection SynchedSource { get; set; } @@ -41,6 +42,8 @@ namespace Tango.SharedUI.Components { SynchedSource.Remove(item.Data); } + + SelectionChanged?.Invoke(this, new EventArgs()); } } } -- cgit v1.3.1