From 67e50ef4b6714bc1f79e639d031a22a4a4b0ec8b Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 7 May 2023 14:16:32 +0300 Subject: Fixed issue with dryer buffer length on eureka. --- .../StudioApplication/DefaultStudioApplicationManager.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index feed9e193..78230b8a0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -395,6 +395,9 @@ namespace Tango.MachineStudio.UI.StudioApplication throw new NullReferenceException($"The specified machine '{connectedMachine.SerialNumber}' could not be found on the database."); } + //Adjust Dryer Buffer Length Mode + ProcessParametersTable.DryerBufferMode = Machine.Type; + connectedMachine.SetMachine(Machine); ConnectedMachine = connectedMachine; var settings = SettingsManager.Default.GetOrCreate(); -- cgit v1.3.1 From f1d5de87c0335b5c954eceef94c8c7f72278d7df Mon Sep 17 00:00:00 2001 From: Roy Date: Mon, 8 May 2023 17:11:38 +0300 Subject: Added Machine Type to TFS Lib & MS. --- .../Tango.MachineStudio.Common/MachineStudioSettings.cs | 3 +++ .../DefaultStudioApplicationManager.cs | 1 + .../TFS/TeamFoundationServiceExtendedClient.cs | 5 ++++- .../Tango.MachineStudio.UI/Views/ReportIssueView.xaml | 9 +++++++-- Software/Visual_Studio/Tango.TFS/MachineType.cs | 17 +++++++++++++++++ Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj | 3 ++- .../Tango.TFS/TeamFoundationServiceClient.cs | 13 +++++++++++++ Software/Visual_Studio/Tango.TFS/WorkItem.cs | 7 +++++++ 8 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 Software/Visual_Studio/Tango.TFS/MachineType.cs (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index 25dfc2dc8..6ae71d50d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -9,6 +9,7 @@ using Tango.BL; using Tango.Integration.Operation; using Tango.Logging; using Tango.MachineStudio.Common.Web; +using Tango.PMR.Common; using Tango.PMR.Printing; using Tango.Settings; using Tango.Transport.Adapters; @@ -178,6 +179,8 @@ namespace Tango.MachineStudio.Common /// public MachineStudioTheme Theme { get; set; } + public int LastConnectedMachineType { get; set; } + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index 78230b8a0..2efe4c719 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -402,6 +402,7 @@ namespace Tango.MachineStudio.UI.StudioApplication ConnectedMachine = connectedMachine; var settings = SettingsManager.Default.GetOrCreate(); ConnectedMachine.JobUploadStrategy = settings.JobUploadStrategy; + settings.LastConnectedMachineType = Machine.MachineType; } else { 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 b716ed1fb..7a0a9414c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs @@ -152,6 +152,8 @@ namespace Tango.MachineStudio.UI.TFS throw LogManager.Default.Log(new AuthenticationException($"User '{user_email}' is not part of the Tango VSTS team. Please contact your administrator.")); } + var settings = SettingsManager.Default.GetOrCreate(); + item.CreatedBy = currentUser; item.ChangedBy = currentUser; item.AuthorizedAs = currentUser; @@ -161,7 +163,8 @@ namespace Tango.MachineStudio.UI.TFS item.Severity = Severity.Medium; item.State = State.New; item.Type = WorkItemType.Bug; - item.Environment = SettingsManager.Default.GetOrCreate().DeploymentSlot.ToDescription(); + item.Environment = settings.DeploymentSlot.ToDescription(); + item.MachineType = (MachineType)settings.LastConnectedMachineType; foreach (var window in Application.Current.Windows.OfType().Where(x => !String.IsNullOrWhiteSpace(x.Title))) { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml index aac712f59..3eeb5f901 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml @@ -12,7 +12,7 @@ xmlns:tfs="clr-namespace:Tango.TFS;assembly=Tango.TFS" xmlns:tfss="clr-namespace:Tango.MachineStudio.UI.TFS" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" - mc:Ignorable="d" Width="530" Height="660" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ReportIssueViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> + mc:Ignorable="d" Width="530" Height="700" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ReportIssueViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -43,6 +43,11 @@ + + + + + @@ -83,7 +88,7 @@ Tags (highlight selected tags) - + diff --git a/Software/Visual_Studio/Tango.TFS/MachineType.cs b/Software/Visual_Studio/Tango.TFS/MachineType.cs new file mode 100644 index 000000000..044155b2b --- /dev/null +++ b/Software/Visual_Studio/Tango.TFS/MachineType.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.TFS +{ + public enum MachineType + { + [Description("TS 1800")] + TS1800 = 0, + [Description("Twine X4")] + TwineX4 = 1, + } +} diff --git a/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj b/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj index 3e3e6f6fd..271491a7e 100644 --- a/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj +++ b/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj @@ -207,6 +207,7 @@ + @@ -266,7 +267,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs b/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs index 750c5fa58..379dcac2e 100644 --- a/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs +++ b/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs @@ -40,6 +40,7 @@ namespace Tango.TFS public const String MACHINE_SN = "Custom.MachineSN"; public const String ENVIRONMENT = "Custom.Environment"; public const String LOGGED_IN_USER = "Custom.LoggedInUser"; + public const String MACHINE_TYPE = "Custom.MachineType"; } #endregion @@ -428,6 +429,13 @@ namespace Tango.TFS }); } + patchDocument.Add(new JsonPatchOperation + { + Operation = Operation.Add, + Path = GetExtensionFieldNameForWrite(ExtensionFields.MACHINE_TYPE), + Value = workItem.MachineType.ToDescription(), + }); + var resultWorkItem = witClient.CreateWorkItemAsync(patchDocument, project.Name, workItem.Type.ToString(), bypassRules: true).Result; workItem.ID = resultWorkItem.Id.Value; @@ -944,6 +952,11 @@ namespace Tango.TFS workItem.Environment = TryGetField(item.Fields, ExtensionFields.ENVIRONMENT).ToString(); } + if (item.Fields.ContainsKey(ExtensionFields.MACHINE_TYPE)) + { + workItem.MachineType = ParseEnumByDescription(item.Fields[ExtensionFields.MACHINE_TYPE].ToString()); + } + workItem.Comment = TryGetField(item.Fields, GetFieldNameForRead(CoreField.History)).ToString(); return workItem; diff --git a/Software/Visual_Studio/Tango.TFS/WorkItem.cs b/Software/Visual_Studio/Tango.TFS/WorkItem.cs index 35c2f8669..552a64161 100644 --- a/Software/Visual_Studio/Tango.TFS/WorkItem.cs +++ b/Software/Visual_Studio/Tango.TFS/WorkItem.cs @@ -80,6 +80,13 @@ namespace Tango.TFS set { _priority = value; RaisePropertyChangedAuto(); } } + private MachineType _machineType; + public MachineType MachineType + { + get { return _machineType; } + set { _machineType = value; RaisePropertyChangedAuto(); } + } + private String _stepsToReproduce; public String StepsToReproduce { -- cgit v1.3.1