From c9d3c1a7408f6f7a4814c1a8f5cf58a2d13e1694 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 3 Jul 2018 12:03:55 +0300 Subject: Machine Studio. Implemented upload hardware configuration from connected machine view. Implemented process parameters dragging through developer module settings :/ --- .../ViewModels/ConnectedMachineViewVM.cs | 19 +++++++++++++++ .../ViewModels/MainViewVM.cs | 27 ++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs index 9f84cfb53..76e138e0e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs @@ -13,6 +13,13 @@ namespace Tango.MachineStudio.UI.ViewModels { public class ConnectedMachineViewVM : DialogViewVM { + public enum ConnectedMachineVMResult + { + Cancel, + Disconnect, + UploadHardwareConfig, + } + private IStudioApplicationManager _applicationManager; public IStudioApplicationManager ApplicationManager { @@ -20,16 +27,28 @@ namespace Tango.MachineStudio.UI.ViewModels set { _applicationManager = value; RaisePropertyChangedAuto(); } } + public ConnectedMachineVMResult Result { get; set; } + public RelayCommand DisconnectCommand { get; set; } + public RelayCommand UploadHardwareConfigurationCommand { get; set; } + public ConnectedMachineViewVM(IStudioApplicationManager application) { ApplicationManager = application; DisconnectCommand = new RelayCommand(Disconnect); + UploadHardwareConfigurationCommand = new RelayCommand(UploadHardwareConfiguration); + } + + private void UploadHardwareConfiguration() + { + Result = ConnectedMachineVMResult.UploadHardwareConfig; + Accept(); } private void Disconnect() { + Result = ConnectedMachineVMResult.Disconnect; Accept(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index aa0eedefb..45ae68cc5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -502,9 +502,32 @@ namespace Tango.MachineStudio.UI.ViewModels } else { - _notificationProvider.ShowModalDialog((x) => + _notificationProvider.ShowModalDialog(async (x) => { - DisconnectFromMachine(); + if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.Disconnect) + { + DisconnectFromMachine(); + } + else if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.UploadHardwareConfig) + { + if (NotificationProvider.ShowQuestion("This will reset the machine hardware configuration to the database configuration. Are you sure?")) + { + using (NotificationProvider.PushTaskItem("Uploading hardware configuration...")) + { + try + { + var configuration = ApplicationManager.ConnectedMachine.Machine.Configuration; + await ApplicationManager.ConnectedMachine.UploadHardwareConfiguration(configuration.HardwareVersion, configuration); + NotificationProvider.ShowInfo("Hardware configuration uploaded successfully."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error upload hardware configuration."); + NotificationProvider.ShowError("Error upload hardware configuration." + Environment.NewLine + ex.Message); + } + } + } + } }); } -- cgit v1.3.1 From 0b804fd5df94b66c6be119660581ab3978d31d59 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 4 Jul 2018 11:58:10 +0300 Subject: Fixed issue with machine studio update service version sorting. Added about dialog to machine studio with version information. Fixed issue with Stubs UI installer. Stubs UI v3.1 Machine Studio v1.0.0.10 --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1572864 -> 1572864 bytes .../StudioApplication/IStudioApplicationManager.cs | 15 + .../Properties/Resources.Designer.cs | 9 + .../Properties/Resources.resx | 17 +- .../Tango.MachineStudio.UI/Resources/BuildDate.txt | 1 + .../DefaultStudioApplicationManager.cs | 37 +- .../Tango.MachineStudio.UI.csproj | 35 +- .../Tango.MachineStudio.UI/ViewModelLocator.cs | 9 + .../ViewModels/AboutViewVM.cs | 20 + .../ViewModels/MainViewVM.cs | 15 + .../Tango.MachineStudio.UI/Views/AboutView.xaml | 63 +++ .../Tango.MachineStudio.UI/Views/AboutView.xaml.cs | 28 ++ .../Tango.MachineStudio.UI/Views/MainView.xaml | 7 + .../MachineStudioUpdateService.svc.cs | 6 +- .../Tango.SharedUI/Controls/TableGrid.cs | 28 +- Software/Visual_Studio/Tango.sln | 3 + .../Tango.Stubs.Installer.vdproj | 467 +++++++++++++++++++-- .../Tango.Stubs.UI/Properties/AssemblyInfo.cs | 4 +- .../Visual_Studio/Versioning/CoreChangeLog.txt | 2 + Software/Visual_Studio/Versioning/MachineStudio.cs | 4 +- .../Versioning/MachineStudioChangeLog.txt | 7 + Software/Visual_Studio/Versioning/PPCChangeLog.txt | 13 + 23 files changed, 725 insertions(+), 65 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/AboutViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml.cs create mode 100644 Software/Visual_Studio/Versioning/CoreChangeLog.txt create mode 100644 Software/Visual_Studio/Versioning/MachineStudioChangeLog.txt create mode 100644 Software/Visual_Studio/Versioning/PPCChangeLog.txt (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index ecc1c16c7..7bea6e586 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 a7a61b46c..86e0318fa 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs index c5010cb26..00e67ff3b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs @@ -56,6 +56,21 @@ namespace Tango.MachineStudio.Common.StudioApplication /// String Version { get; } + /// + /// Gets the core libraries version. + /// + String CoreVersion { get; } + + /// + /// Gets the build date. + /// + String BuildDate { get; } + + /// + /// Gets the change log. + /// + String ChangeLog { get; } + /// /// Notify the application manager about an external opened window. /// When application exists. All registered windows will be closed. diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/Resources.Designer.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/Resources.Designer.cs index c035ee88d..5ff36aae1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/Resources.Designer.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/Resources.Designer.cs @@ -59,5 +59,14 @@ namespace Tango.MachineStudio.UI.Properties { resourceCulture = value; } } + + /// + /// Looks up a localized string similar to . + /// + internal static string BuildDate { + get { + return ResourceManager.GetString("BuildDate", resourceCulture); + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/Resources.resx b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/Resources.resx index af7dbebba..32307e87f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/Resources.resx +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/Resources.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,13 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\BuildDate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt new file mode 100644 index 000000000..c28e95490 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt @@ -0,0 +1 @@ +Wed 07/04/2018 11:49:44.08 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 48b0fdada..fdad31251 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -43,14 +43,14 @@ namespace Tango.MachineStudio.UI.StudioApplication _navigationManager = navigationManager; _openedWindows = new List(); - Task.Factory.StartNew(() => + Task.Factory.StartNew(() => { while (MainWindow.Instance == null) { Thread.Sleep(100); } - InvokeUI(() => + InvokeUI(() => { MainWindow.Instance.ContentRendered += (_, __) => { @@ -256,5 +256,38 @@ namespace Tango.MachineStudio.UI.StudioApplication window.Closed += (x, y) => { _openedWindows.Remove(window); }; } + + /// + /// Gets the core libraries version. + /// + public string CoreVersion + { + get + { + return typeof(ExtendedObject).Assembly.GetName().Version.ToString(); + } + } + + /// + /// Gets the build date. + /// + public string BuildDate + { + get + { + return Properties.Resources.BuildDate; + } + } + + /// + /// Gets the change log. + /// + public string ChangeLog + { + get + { + return EmbeddedResourceHelper.GetEmbeddedResourceText("Tango.MachineStudio.UI.ChangeLogs.MachineStudioChangeLog.txt") + Environment.NewLine + Environment.NewLine + Environment.NewLine + EmbeddedResourceHelper.GetEmbeddedResourceText("Tango.MachineStudio.UI.ChangeLogs.CoreChangeLog.txt"); + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index f21fe0919..4d581795b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -151,6 +151,11 @@ TextInputBoxWindow.xaml + + True + True + Resources.resx + @@ -163,6 +168,7 @@ + @@ -176,6 +182,9 @@ + + AboutView.xaml + ConnectedMachineView.xaml @@ -251,6 +260,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -313,20 +326,11 @@ - - True - True - Resources.resx - True Settings.settings True - - ResXFileCodeGenerator - Resources.Designer.cs - SettingsSingleFileGenerator @@ -484,9 +488,20 @@ + + ChangeLogs\CoreChangeLog.txt + + + ChangeLogs\MachineStudioChangeLog.txt + + + + ResXFileCodeGenerator + Resources.Designer.cs + @@ -494,6 +509,8 @@ if $(ConfigurationName) == Debug $(TargetDir)linkgen.exe -s "$(TargetPath)" -d "$(TargetDir)Utilities\Machine Studio.lnk" +echo %25date%25 %25time%25 > "$(ProjectDir)\Resources\BuildDate.txt" + RD /S /Q "$(TargetDir)cs\" RD /S /Q "$(TargetDir)da\" RD /S /Q "$(TargetDir)de\" diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index 931130a05..8a5ce3d8b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -87,6 +87,7 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); //Register View (Supervising Controller Pattern). //if (!ViewModelBase.IsInDesignModeStatic) @@ -167,5 +168,13 @@ namespace Tango.MachineStudio.UI return TangoIOC.Default.GetInstance(); } } + + public AboutViewVM AboutViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } } } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/AboutViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/AboutViewVM.cs new file mode 100644 index 000000000..5fe3b06b8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/AboutViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.MachineStudio.Common.StudioApplication; +using Tango.SharedUI; + +namespace Tango.MachineStudio.UI.ViewModels +{ + public class AboutViewVM : DialogViewVM + { + public IStudioApplicationManager ApplicationManager { get; set; } + + public AboutViewVM(IStudioApplicationManager applicationManager) + { + ApplicationManager = applicationManager; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index 45ae68cc5..8eaa1f360 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -159,6 +159,11 @@ namespace Tango.MachineStudio.UI.ViewModels /// public RelayCommand OpenDeveloperConsoleCommand { get; set; } + /// + /// Gets or sets the about command. + /// + public RelayCommand AboutCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; /// /// Gets or sets the authentication provider. @@ -319,6 +324,8 @@ namespace Tango.MachineStudio.UI.ViewModels OpenDeveloperConsoleCommand = new RelayCommand(OpenDeveloperConsole); TangoMessenger.Default.Register((x) => DisableCheckForUpdates = true); + + AboutCommand = new RelayCommand(ShowAboutDialog); } private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable e) @@ -683,6 +690,14 @@ namespace Tango.MachineStudio.UI.ViewModels } } + /// + /// Shows the about dialog. + /// + private void ShowAboutDialog() + { + NotificationProvider.ShowModalDialog((x) => { }); + } + private void ReportIssue() { _notificationProvider.ShowModalDialog(new ReportIssueViewVM(TFSClient.Project, TFSClient.CreateBug()), async (vm) => diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml new file mode 100644 index 000000000..2ac0df9de --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + This dialog contains information about your current version of Machine Studio. + + + + + + Machine Studio: + v + Core Libraries: + v + Build Date: + + + + + Change Log: + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml.cs new file mode 100644 index 000000000..79a7f3e2c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.UI.Views +{ + /// + /// Interaction logic for AboutView.xaml + /// + public partial class AboutView : UserControl + { + public AboutView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index 8417c70c8..e36a03ffe 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -202,6 +202,13 @@ + +