diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common')
40 files changed, 771 insertions, 114 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Authentication/IAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Authentication/IAuthenticationProvider.cs index 74969fd27..2929ea405 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Authentication/IAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Authentication/IAuthenticationProvider.cs @@ -29,7 +29,7 @@ namespace Tango.MachineStudio.Common.Authentication /// <param name="email">The email.</param> /// <param name="password">The password.</param> /// <returns></returns> - AuthenticationLoginResult Login(String email, String password, bool bypassVersionCheck = false); + AuthenticationLoginResult Login(String email, String password, LoginMethod method, bool bypassVersionCheck = false, Action<String> logAction = null); /// <summary> /// Logs-out the current logged-in user. diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs index 11d156292..89b8920d9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs @@ -18,6 +18,7 @@ using Tango.MachineStudio.Common.StudioApplication; using Tango.PMR.Diagnostics; using Tango.Integration.Operation; using Tango.Core.ExtensionMethods; +using Tango.Transport; namespace Tango.MachineStudio.Common.EventLogging { @@ -28,6 +29,7 @@ namespace Tango.MachineStudio.Common.EventLogging public class DefaultEventLogger : ExtendedObject, IEventLogger { private ObservablesContext _db; + private static object _lockInit = new object(); private Thread _logThread; private ConcurrentQueue<MachinesEvent> _events; private IStudioApplicationManager _application; @@ -46,6 +48,15 @@ namespace Tango.MachineStudio.Common.EventLogging #endregion + #region Properties + + /// <summary> + /// Gets or sets a value indicating whether to save the incoming events to database. + /// </summary> + public bool SaveToDB { get; set; } + + #endregion + #region Constructors /// <summary> @@ -57,6 +68,8 @@ namespace Tango.MachineStudio.Common.EventLogging { _hostName = Environment.MachineName; + SaveToDB = true; + _events = new ConcurrentQueue<MachinesEvent>(); _pendingEvents = new List<MachinesEvent>(); @@ -77,24 +90,27 @@ namespace Tango.MachineStudio.Common.EventLogging private void Init() { - if (!_isInitialized) + lock (_lockInit) { - try + if (!_isInitialized) { - _db = ObservablesContext.CreateDefault(); + try + { + _db = ObservablesContext.CreateDefault(); + + _db.EventTypes.ToList(); - _db.EventTypes.ToList(); + foreach (var type in _db.EventTypes) + { + _eventTypesGuids.Add((EventTypes)type.Code, type); + } - foreach (var type in _db.EventTypes) + _isInitialized = true; + } + catch { - _eventTypesGuids.Add((EventTypes)type.Code, type); + _isInitialized = false; } - - _isInitialized = true; - } - catch - { - _isInitialized = false; } } } @@ -127,6 +143,8 @@ namespace Tango.MachineStudio.Common.EventLogging machine.RequestSent += Machine_RequestSent; machine.RequestFailed += Machine_RequestFailed; machine.ResponseReceived += Machine_ResponseReceived; + + SaveToDB = !(machine is IExternalBridgeSecureClient); } } @@ -137,7 +155,7 @@ namespace Tango.MachineStudio.Common.EventLogging /// <param name="message">The message.</param> private void Machine_RequestSent(object sender, IMessage message) { - Log(EventTypes.REQUEST_SENT, String.Format("Sending request '{0}'...{1}{2}", message.GetType().Name, Environment.NewLine, message.ToJsonString())); + //Log(EventTypes.REQUEST_SENT, String.Format("Sending request '{0}'...{1}{2}", message.GetType().Name, Environment.NewLine, message.ToJsonString())); } /// <summary> @@ -147,7 +165,7 @@ namespace Tango.MachineStudio.Common.EventLogging /// <param name="e">The <see cref="RequestFailedEventArgs"/> instance containing the event data.</param> private void Machine_RequestFailed(object sender, RequestFailedEventArgs e) { - Log(EventTypes.REQUEST_FAILED, String.Format("Request failed '{0}'...{1}{2}{1}{3}", e.Message.GetType().Name, Environment.NewLine, e.Message.ToJsonString(), e.Exception.ToString())); + //Log(EventTypes.REQUEST_FAILED, String.Format("Request failed '{0}'...{1}{2}{1}{3}", e.Message.GetType().Name, Environment.NewLine, e.Message.ToJsonString(), e.Exception.ToString())); } /// <summary> @@ -157,7 +175,7 @@ namespace Tango.MachineStudio.Common.EventLogging /// <param name="message">The message.</param> private void Machine_ResponseReceived(object sender, IMessage message) { - Log(EventTypes.RESPONSE_RECEIVED, String.Format("Response received '{0}'...{1}{2}", message.GetType().Name, Environment.NewLine, message.ToJsonString())); + //Log(EventTypes.RESPONSE_RECEIVED, String.Format("Response received '{0}'...{1}{2}", message.GetType().Name, Environment.NewLine, message.ToJsonString())); } /// <summary> @@ -180,10 +198,10 @@ namespace Tango.MachineStudio.Common.EventLogging /// <param name="events">The events.</param> private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable<MachinesEvent> events) { - foreach (var ev in events) - { - Log(String.Format("Event '{0}' resolved.", ev.EventType.Name)); - } + //foreach (var ev in events) + //{ + // Log(String.Format("Event '{0}' resolved.", ev.EventType.Name)); + //} } #endregion @@ -196,6 +214,8 @@ namespace Tango.MachineStudio.Common.EventLogging /// <param name="machineEvent">The machine event.</param> public void Log(MachinesEvent machineEvent) { + Init(); + machineEvent.HostName = _hostName; machineEvent.EventType = _eventTypesGuids[machineEvent.Type]; @@ -243,7 +263,7 @@ namespace Tango.MachineStudio.Common.EventLogging machineEvent.EventType = _eventTypesGuids[eventType]; machineEvent.EventTypeGuid = machineEvent.EventType.Guid; - if (write_to_db) + if (write_to_db && SaveToDB) { Log(machineEvent); } @@ -307,6 +327,11 @@ namespace Tango.MachineStudio.Common.EventLogging /// </summary> public void FlushAll() { + if (!SaveToDB) + { + return; + } + bool _saveChanges = false; while (_events.Count > 0) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs index ceb399d24..44916ec21 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/IEventLogger.cs @@ -20,6 +20,11 @@ namespace Tango.MachineStudio.Common.EventLogging event EventHandler<MachinesEvent> NewLog; /// <summary> + /// Gets or sets a value indicating whether to save the incoming events to database. + /// </summary> + bool SaveToDB { get; set; } + + /// <summary> /// Logs the specified machine event. /// </summary> /// <param name="machineEvent">The machine event.</param> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Black.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Black.otf Binary files differnew file mode 100644 index 000000000..0341d05db --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Black.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-BlackIt.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-BlackIt.otf Binary files differnew file mode 100644 index 000000000..e0823abdf --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-BlackIt.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Bold.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Bold.otf Binary files differnew file mode 100644 index 000000000..2b9144e5c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Bold.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-BoldIt.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-BoldIt.otf Binary files differnew file mode 100644 index 000000000..f21ed044d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-BoldIt.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Demi.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Demi.otf Binary files differnew file mode 100644 index 000000000..ada716012 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Demi.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-DemiIt.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-DemiIt.otf Binary files differnew file mode 100644 index 000000000..ab9a133a5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-DemiIt.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Heavy.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Heavy.otf Binary files differnew file mode 100644 index 000000000..b3630c982 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Heavy.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-HeavyIt.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-HeavyIt.otf Binary files differnew file mode 100644 index 000000000..e47f75546 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-HeavyIt.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-It.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-It.otf Binary files differnew file mode 100644 index 000000000..6f9b5fa49 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-It.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Light.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Light.otf Binary files differnew file mode 100644 index 000000000..27af39094 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Light.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-LightIt.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-LightIt.otf Binary files differnew file mode 100644 index 000000000..89085eeca --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-LightIt.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Medium.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Medium.otf Binary files differnew file mode 100644 index 000000000..04b2a8853 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Medium.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-MediumIt.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-MediumIt.otf Binary files differnew file mode 100644 index 000000000..91996979e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-MediumIt.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Regular.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Regular.otf Binary files differnew file mode 100644 index 000000000..2703ba3f3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Regular.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Thin.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Thin.otf Binary files differnew file mode 100644 index 000000000..666c69931 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-Thin.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-ThinIt.otf b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-ThinIt.otf Binary files differnew file mode 100644 index 000000000..b039daffe --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Fonts/Flexo-ThinIt.otf diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Images/machine_new.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Images/machine_new.png Binary files differnew file mode 100644 index 000000000..116e1e9c7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Images/machine_new.png diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Images/machine_new_small.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Images/machine_new_small.png Binary files differnew file mode 100644 index 000000000..378879ce1 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Images/machine_new_small.png diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index c307a8e33..25dfc2dc8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -8,8 +8,10 @@ using System.Windows; using Tango.BL; using Tango.Integration.Operation; using Tango.Logging; +using Tango.MachineStudio.Common.Web; using Tango.PMR.Printing; using Tango.Settings; +using Tango.Transport.Adapters; using Tango.Web; namespace Tango.MachineStudio.Common @@ -40,6 +42,11 @@ namespace Tango.MachineStudio.Common public String LastLoginPassword { get; set; } /// <summary> + /// Gets or sets the last login method. + /// </summary> + public LoginMethod LastLoginMethod { get; set; } + + /// <summary> /// Gets or sets a value indicating whether to save the user credentials. /// </summary> public bool RememberMe { get; set; } @@ -50,11 +57,6 @@ namespace Tango.MachineStudio.Common public String LastVirtualMachineSerialNumber { get; set; } /// <summary> - /// Gets or sets the logging categories. - /// </summary> - public List<LogCategory> LoggingCategories { get; set; } - - /// <summary> /// Gets or sets the last bounds. /// </summary> public Rect LastBounds { get; set; } @@ -135,6 +137,26 @@ namespace Tango.MachineStudio.Common public TimeSpan ExternalBridgeRequestTimeout { get; set; } /// <summary> + /// Gets or sets the external bridge continuous request timeout. + /// </summary> + public TimeSpan ExternalBridgeContinuousRequestTimeout { get; set; } + + /// <summary> + /// Gets or sets the external bridge SignalR hub. + /// </summary> + public String ExternalBridgeSignalRHub { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to enable external bridge scanning via SignalR. + /// </summary> + public bool EnableExternalBridgeSignalR { get; set; } + + /// <summary> + /// Gets or sets the TCP transport adapter write mode. + /// </summary> + public TcpTransportAdapterWriteMode TcpTransportAdapterWriteMode { get; set; } + + /// <summary> /// Gets the machine service address. /// </summary> public String MachineServiceAddress @@ -162,7 +184,6 @@ namespace Tango.MachineStudio.Common public MachineStudioSettings() { LastBounds = new Rect(); - LoggingCategories = new List<LogCategory>(); DefaultIssueReportTags = new List<string>(); StudioModulesBounds = new List<StudioModuleBounds>(); Environment = WorkingEnvironment.Remote; @@ -173,6 +194,10 @@ namespace Tango.MachineStudio.Common Theme = MachineStudioTheme.Light; JobUnitsMethod = JobUnitsMethods.Operator; ExternalBridgeRequestTimeout = TimeSpan.FromSeconds(5); + ExternalBridgeContinuousRequestTimeout = TimeSpan.FromSeconds(5); + ExternalBridgeSignalRHub = "ExternalBridgeHub"; + EnableExternalBridgeSignalR = true; + TcpTransportAdapterWriteMode = TcpTransportAdapterWriteMode.Interval; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/MachineStudioPublisher.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/MachineStudioPublisher.cs index 92326f26f..eeafa513f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/MachineStudioPublisher.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/MachineStudioPublisher.cs @@ -12,6 +12,7 @@ using Tango.AdvancedInstaller; using Tango.Core; using Tango.Core.Cryptography; using Tango.Core.Helpers; +using Tango.Git; using Tango.MachineStudio.Common.Web; using Tango.Transport.Web; using Tango.Web; @@ -255,6 +256,55 @@ namespace Tango.MachineStudio.Common.Publish throw new InvalidOperationException("The remote version does not seems to have been updated."); } + if (Options.CreateTag) + { + String repoPath = Path.GetFullPath("../../../../../"); + String tagVersion = System.Version.Parse(GetLocalVersion()).ToString(3); + String tagName = $"Machine_Studio_v{tagVersion}"; + + using (GitRepositoryManager git = new GitRepositoryManager(repoPath, Options.Email, Options.PersonalAccessToken)) + { + OnPublishProgress(0, 100, "Checking repository changes..."); + int changes = git.GetChanges().Count; + if (changes > 0) + { + if (Options.AutoCommitAndPush) + { + OnPublishProgress(0, 100, "Committing repository changes..."); + git.Commit(tagName); + } + else + { + throw new InvalidOperationException($"There are {changes} uncommitted changes on the repository. Please commit and push all changes before creating the Tag"); + } + } + + OnPublishProgress(0, 100, "Checking outgoing commits..."); + int commits = git.GetOutgoingCommits().Count; + if (commits > 0) + { + if (Options.AutoCommitAndPush) + { + OnPublishProgress(0, 100, "Pushing repository changes..."); + git.Sync(); + } + else + { + throw new InvalidOperationException($"There are {commits} outgoing commits on the repository. Please push all commits before creating the Tag"); + } + } + + git.Progress += (x, e) => + { + OnPublishProgress(e.Progress.Value, e.Progress.Maximum, $"Pushing Tag '{tagName}'..."); + }; + + OnPublishProgress(0, 100, $"Creating Tag '{tagName}'..."); + + git.CreatePushTag(tagName, Options.Comments, "Roy Ben Shabat"); + } + } + OnPublishProgress(0, 0, "Version published successfully."); } catch (Exception ex) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/PublishOptions.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/PublishOptions.cs index c5db355b1..c0983eb8b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/PublishOptions.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Publish/PublishOptions.cs @@ -81,6 +81,27 @@ namespace Tango.MachineStudio.Common.Publish set { _installerOutputFolder = value; RaisePropertyChangedAuto(); } } + private String _personalAccessToken; + public String PersonalAccessToken + { + get { return _personalAccessToken; } + set { _personalAccessToken = value; RaisePropertyChangedAuto(); } + } + + private bool _createTag; + public bool CreateTag + { + get { return _createTag; } + set { _createTag = value; RaisePropertyChangedAuto(); } + } + + private bool _autoCommitAndSync; + public bool AutoCommitAndPush + { + get { return _autoCommitAndSync; } + set { _autoCommitAndSync = value; RaisePropertyChangedAuto(); } + } + public PublishOptions() { BasePath = AppDomain.CurrentDomain.BaseDirectory + "..\\"; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml index 177a4fe75..d8e2017ec 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -4,12 +4,13 @@ xmlns:editors="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Tango.MachineStudio.Common.Resources" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"> <ResourceDictionary.MergedDictionaries> - + <!--WPF Extended Toolkit--> <!--<ResourceDictionary Source="pack://application:,,,/Xceed.Wpf.Toolkit;component/Themes/Generic/Brushes.xaml"/> <ResourceDictionary Source="pack://application:,,,/Xceed.Wpf.Toolkit;component/Themes/Generic/Buttons.xaml"/> @@ -28,7 +29,9 @@ <!--<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml"> </ResourceDictionary> - --><!--Material Design--><!-- + --> + <!--Material Design--> + <!-- <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml"> </ResourceDictionary>--> <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml"> @@ -63,6 +66,13 @@ <!--Fonts--> <ResourceDictionary> <FontFamily x:Key="digital-7">../Fonts/#digital-7</FontFamily> + <FontFamily x:Key="flexo">../Fonts/#flexo</FontFamily> + </ResourceDictionary> + + <!--Images--> + <ResourceDictionary> + <BitmapImage x:Key="MachineBig" UriSource="../Images/machine_new.png"></BitmapImage> + <BitmapImage x:Key="MachineSmall" UriSource="../Images/machine_new_small.png"></BitmapImage> </ResourceDictionary> <!--Styles--> @@ -526,23 +536,19 @@ </Setter.Value> </Setter> </Style> - + <ControlTemplate x:Key="TransparentPopupContentDownTemplate" TargetType="ContentControl"> <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter=32}" Margin="6" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="*" /> </Grid.RowDefinitions> - <Border Background="Transparent" - BorderBrush="{DynamicResource MaterialDesignShadowBrush}" - BorderThickness="1" - CornerRadius="2"> + <Border Background="Transparent" BorderBrush="{DynamicResource MaterialDesignShadowBrush}" BorderThickness="1" CornerRadius="2"> <Border.Effect> <BlurEffect Radius="6"/> </Border.Effect> </Border> - <Grid Margin="1" - SnapsToDevicePixels="True"> + <Grid Margin="1" SnapsToDevicePixels="True"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> @@ -561,29 +567,18 @@ <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> - <Border Grid.Column="0" - Width="{StaticResource PopupLeftRightMargin}" - Background="{DynamicResource ComboBox.Floating.Background}" - /> - <Grid Grid.Column="1" - Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type materialDesign:ComboBoxPopup}}, Path=VisiblePlacementWidth}" - Height="{Binding ElementName=templateRoot, Path=ActualHeight}"/> - <Border Grid.Column="2" - MinWidth="{StaticResource PopupLeftRightMargin}" - Background="{DynamicResource ComboBox.Floating.Background}" - /> + <Border Grid.Column="0" Width="{StaticResource PopupLeftRightMargin}" Background="{DynamicResource ComboBox.Floating.Background}" /> + <Grid Grid.Column="1" + Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type materialDesign:ComboBoxPopup}}, Path=VisiblePlacementWidth}" + Height="0"/> + <Border Grid.Column="2" MinWidth="{StaticResource PopupLeftRightMargin}" Background="{DynamicResource ComboBox.Floating.Background}"/> </Grid> - <Border Grid.Row="2" - Background="{DynamicResource ComboBox.Floating.Background}" - Height="{StaticResource PopupContentPresenterExtend}"/> + <Border Grid.Row="2" Background="{DynamicResource ComboBox.Floating.Background}" Height="0"/> <ContentPresenter Grid.Row="3"/> - <Border Grid.Row="4" - CornerRadius="0 0 2 2" - Height="{StaticResource PopupTopBottomMargin}" - Background="{DynamicResource ComboBox.Floating.Background}" /> + <Border Grid.Row="4" CornerRadius="0 0 2 2" Height="{StaticResource PopupTopBottomMargin}" Background="{DynamicResource ComboBox.Floating.Background}" /> </Grid> </Grid> </ControlTemplate> @@ -650,7 +645,7 @@ Visibility="{Binding Path=(materialDesign:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"/> <materialDesign:ComboBoxPopup x:Name="PART_Popup" - + AllowsTransparency="true" Focusable="False" HorizontalOffset="-11.5" @@ -660,9 +655,9 @@ UseLayoutRounding="True" Placement="Custom" PopupAnimation="Fade" - VerticalOffset="0" + VerticalOffset="-10" DefaultVerticalOffset="5" - DownVerticalOffset="-15.5" + DownVerticalOffset="{Binding ElementName=templateRoot, Path=ActualHeight}" UpVerticalOffset="15" ClassicMode="{Binding Path=(materialDesign:ComboBoxAssist.ClassicMode), RelativeSource={RelativeSource TemplatedParent}}" UpContentTemplate="{StaticResource PopupContentUpTemplate}" @@ -683,7 +678,7 @@ <Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignComboBoxItemStyle}" /> </Trigger> <Trigger SourceName="PART_Popup" Property="IsOpen" Value="True"> - <Setter Property="Background" TargetName="templateRoot" Value="{DynamicResource ComboBox.Floating.Background}" /> + <Setter Property="Background" TargetName="templateRoot" Value="Transparent" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="templateRoot" Property="Opacity" Value="0.56"/> @@ -774,6 +769,101 @@ </Setter.Value> </Setter> </Style> + + <Style TargetType="{x:Type controls:SearchComboBox}" BasedOn="{StaticResource MaterialDesignComboBox}"> + <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Once"></Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type controls:SearchComboBox}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <Grid Background="Transparent"> + <DockPanel> + <Grid VerticalAlignment="Center" Margin="15 10 10 10" DockPanel.Dock="Right" Width="10" Height="10"> + <Path Stretch="Uniform" Data="M7,10L12,15L17,10H7Z" Fill="{StaticResource BlackBrush}"> + + </Path> + </Grid> + <ContentControl Focusable="False" FocusVisualStyle="{x:Null}" Content="{TemplateBinding SelectedItem}" ContentTemplate="{TemplateBinding ItemTemplate}"> + + </ContentControl> + </DockPanel> + <ToggleButton x:Name="btnToggle" Focusable="False" FocusVisualStyle="{x:Null}" KeyboardNavigation.DirectionalNavigation="Once" Opacity="0" Style="{x:Null}" IsChecked="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=IsOpened,Mode=TwoWay}"> + + </ToggleButton> + + <Popup StaysOpen="False" MinWidth="{Binding ElementName=btnToggle,Path=ActualWidth}" PlacementTarget="{Binding ElementName=btnToggle}" Placement="Bottom" IsOpen="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=IsOpened,Mode=TwoWay}" MaxHeight="{TemplateBinding MaxDropDownHeight}" AllowsTransparency="True"> + <Border Margin="5" Background="{StaticResource WhiteBrush}" CornerRadius="3" Padding="5" MinWidth="{Binding ElementName=btnToggle,Path=ActualWidth}"> + <Border.Effect> + <DropShadowEffect ShadowDepth="0" /> + </Border.Effect> + <DockPanel> + <TextBox x:Name="txt" KeyboardNavigation.DirectionalNavigation="Once" DockPanel.Dock="Top" Margin="10" Padding="0 5" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=SearchFilter,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox> + <ListBox x:Name="list" FocusVisualStyle="{x:Null}" ItemsSource="{TemplateBinding ListItemsSource}" ItemTemplate="{TemplateBinding ItemTemplate}"> + + </ListBox> + </DockPanel> + </Border> + </Popup> + </Grid> + + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="CheckBoxListBoxItem" TargetType="{x:Type ListBoxItem}"> + <Setter Property="SnapsToDevicePixels" Value="true" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ListBoxItem"> + <CheckBox Margin="5,2" IsChecked="{TemplateBinding IsSelected}" x:Name="CheckBoxItem" + Command="{Binding RelativeSource={RelativeSource AncestorType=controls:AllSelectedCheckboxList}, Path=ClickCheckBoxCommand}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"> + <ContentPresenter /> + </CheckBox> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="AllSelectedCheckBoxListStyle" TargetType="{x:Type controls:AllSelectedCheckboxList}" BasedOn="{StaticResource MaterialDesignListBox}"> + <!--<Setter Property="OverridesDefaultStyle" Value="true" />--> + <Setter Property="SnapsToDevicePixels" Value="true" /> + <Setter Property="SelectionMode" Value="Multiple"/> + <Setter Property="ItemContainerStyle" Value="{StaticResource CheckBoxListBoxItem}"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type controls:AllSelectedCheckboxList}"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> + <DockPanel> + <CheckBox x:Name="SelectAllCheckBox" DockPanel.Dock="Top" VerticalAlignment="Center" IsChecked="{Binding AllSelected, Mode=TwoWay,RelativeSource={RelativeSource AncestorType=controls:AllSelectedCheckboxList}}" Margin="5"> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="SelectAll" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}"></TextBlock> + </CheckBox> + <ScrollViewer DockPanel.Dock="Bottom" Focusable="false" Padding="{TemplateBinding Padding}"> + <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + </ScrollViewer> + </DockPanel> + </Border> + <ControlTemplate.Triggers> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsGrouping" Value="true"/> + <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> + </MultiTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="Window"> + <Setter Property="FontFamily" Value="{StaticResource flexo}"></Setter> + </Style> </ResourceDictionary> </ResourceDictionary.MergedDictionaries> 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 3e54a327b..fabe3e02f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs @@ -21,6 +21,11 @@ namespace Tango.MachineStudio.Common.StudioApplication event EventHandler ApplicationReady; /// <summary> + /// Occurs when the connected machine session has been lost and an automatic reconnection with the last machine is required. + /// </summary> + event EventHandler ReconnectionRequired; + + /// <summary> /// Occurs when the connected machine property has changed. /// </summary> event EventHandler<IExternalBridgeClient> ConnectedMachineChanged; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 7c0851d01..a14bb4e2a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -59,6 +59,9 @@ <HintPath>..\..\Referenced Assemblies\SMO\Microsoft.SqlServer.AzureStorageEnum.dll</HintPath> </Reference> <Reference Include="Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> + <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> @@ -83,6 +86,9 @@ <Reference Include="PresentationFramework" /> </ItemGroup> <ItemGroup> + <Compile Include="..\..\PPC\Tango.PPC.Common\Publish\PublishInfo.cs"> + <Link>Tup\PublishInfo.cs</Link> + </Compile> <Compile Include="..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> @@ -95,6 +101,11 @@ <Compile Include="Converters\UserRoleToVisibilityConverter.cs" /> <Compile Include="MachineStudioTheme.cs" /> <Compile Include="Resources\SharedResourceDictionary.cs" /> + <Compile Include="Tup\TupFileBuilder.cs" /> + <Compile Include="Tup\TupFileBuilderProgressEventArgs.cs" /> + <Compile Include="Web\DownloadLatestPPCVersionRequest.cs" /> + <Compile Include="Web\DownloadLatestPPCVersionResponse.cs" /> + <Compile Include="Web\LoginMethod.cs" /> <Compile Include="Web\LoginRequest.cs" /> <Compile Include="Web\LoginResponse.cs" /> <Compile Include="AutoComplete\MachinesProvider.cs" /> @@ -117,6 +128,22 @@ <Compile Include="ExtensionMethods\CommonDialogExtensions.cs" /> <Compile Include="ExtensionMethods\TangoIOCExtensions.cs" /> <Compile Include="FirmwareUpgrade\IFirmwareUpgrader.cs" /> + <Resource Include="Fonts\Flexo-Black.otf" /> + <Resource Include="Fonts\Flexo-BlackIt.otf" /> + <Resource Include="Fonts\Flexo-Bold.otf" /> + <Resource Include="Fonts\Flexo-BoldIt.otf" /> + <Resource Include="Fonts\Flexo-Demi.otf" /> + <Resource Include="Fonts\Flexo-DemiIt.otf" /> + <Resource Include="Fonts\Flexo-Heavy.otf" /> + <Resource Include="Fonts\Flexo-HeavyIt.otf" /> + <Resource Include="Fonts\Flexo-It.otf" /> + <Resource Include="Fonts\Flexo-Light.otf" /> + <Resource Include="Fonts\Flexo-LightIt.otf" /> + <Resource Include="Fonts\Flexo-Medium.otf" /> + <Resource Include="Fonts\Flexo-MediumIt.otf" /> + <Resource Include="Fonts\Flexo-Regular.otf" /> + <Resource Include="Fonts\Flexo-Thin.otf" /> + <Resource Include="Fonts\Flexo-ThinIt.otf" /> <None Include="Helpers\GraphsHelper.cs" /> <Compile Include="IStudioViewModel.cs" /> <Compile Include="MachineStudioSettings.cs" /> @@ -271,6 +298,10 @@ <Project>{de2f2b86-025b-4f26-83a4-38bd48224ed5}</Project> <Name>Tango.Editors</Name> </ProjectReference> + <ProjectReference Include="..\..\Tango.Git\Tango.Git.csproj"> + <Project>{99081c0e-065c-4d68-bf60-f82330cca02d}</Project> + <Name>Tango.Git</Name> + </ProjectReference> <ProjectReference Include="..\..\Tango.Integration\Tango.Integration.csproj"> <Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project> <Name>Tango.Integration</Name> @@ -291,6 +322,10 @@ <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project> <Name>Tango.SharedUI</Name> </ProjectReference> + <ProjectReference Include="..\..\Tango.SQLExaminer\Tango.SQLExaminer.csproj"> + <Project>{e1e66ed9-597d-45fa-8048-de90a6930484}</Project> + <Name>Tango.SQLExaminer</Name> + </ProjectReference> <ProjectReference Include="..\..\Tango.Transport\Tango.Transport.csproj"> <Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project> <Name>Tango.Transport</Name> @@ -387,10 +422,20 @@ <ItemGroup> <Resource Include="Images\ti-tm4c129x.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\machine_new.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\machine_new_small.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> + <PropertyGroup> + <PreBuildEvent> + </PreBuildEvent> + </PropertyGroup> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml index 8dd4efc32..d9819e5ce 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml @@ -171,6 +171,7 @@ <Color x:Key="graphGridLinesColor">#5C5C5C</Color> <Color x:Key="graphsMarkerColor">#5C5C5C</Color> <Color x:Key="materialColor">#FF03A9F4</Color> + <Color x:Key="whiteColor">#181818</Color> <!--Brushes--> <SolidColorBrush x:Key="borderBrush" Color="{StaticResource borderColor}"></SolidColorBrush> @@ -269,6 +270,10 @@ <GradientStop Color="#FEBDBDBD" Offset="0" /> <GradientStop Color="#004E4E4E" Offset="0.9" /> </LinearGradientBrush> + <LinearGradientBrush x:Key="infoBrush" StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Color="Black"/> + <GradientStop Color="#3C3C3C" Offset="1"/> + </LinearGradientBrush> <Style x:Key="{x:Type ToolTip}" TargetType="ToolTip"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml index 0f5727e5b..95d55d63e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml @@ -9,20 +9,20 @@ <ResourceDictionary> <system:Double x:Key = "HomeImageOpacity">1</system:Double> <SolidColorBrush x:Key="OrangeBrush" Color="#FFA300"/> - <SolidColorBrush x:Key="OrangeBrush200" Color="#FFA65F"/> - <SolidColorBrush x:Key="OrangeBrush250" Color="#E79F20"/> + <SolidColorBrush x:Key="OrangeBrush200" Color="#FFA65F"/> + <SolidColorBrush x:Key="OrangeBrush250" Color="#E79F20"/> <SolidColorBrush x:Key="OrangeCanceledBrush" Color="#EF832B"/> <!--Background for all duplicate buttons--> <SolidColorBrush x:Key="OrangeBrush300" Color="#FF9A6A"/> - <SolidColorBrush x:Key="OrangeBrush400" Color="#F38B76"/> + <SolidColorBrush x:Key="OrangeBrush400" Color="#F38B76"/> - <SolidColorBrush x:Key="RedBrush100" Color="#FF5151"/> + <SolidColorBrush x:Key="RedBrush100" Color="#FF5151"/> <SolidColorBrush x:Key="RedBrush200" Color="#FF6F6F"/> <!--Background for all remove/delete buttons--> <SolidColorBrush x:Key="RedBrush300" Color="#FF7272"/> - <SolidColorBrush x:Key="RedBrush400" Color="#FF8585"/> - <SolidColorBrush x:Key="RedBrush500" Color="#E14141"/> - <SolidColorBrush x:Key="OrangeUploadBrush" Color="#E76311"/> + <SolidColorBrush x:Key="RedBrush400" Color="#FF8585"/> + <SolidColorBrush x:Key="RedBrush500" Color="#E14141"/> + <SolidColorBrush x:Key="OrangeUploadBrush" Color="#E76311"/> <SolidColorBrush x:Key="GreenBrush" Color="#04CB04"/> @@ -40,72 +40,72 @@ <SolidColorBrush x:Key="DarkBlueBrush" Color="#3C7EF4"/> - <SolidColorBrush x:Key="DodgerBlueBrush" Color="DodgerBlue"/> - <SolidColorBrush x:Key="BlueBrush100" Color="#03A9F4" /> - <SolidColorBrush x:Key="BlueBrush" Color="#64B8EC"/> - <SolidColorBrush x:Key="BlueSelectionStrokBrush" Color="#1EA9FF"/> + <SolidColorBrush x:Key="DodgerBlueBrush" Color="DodgerBlue"/> + <SolidColorBrush x:Key="BlueBrush100" Color="#03A9F4" /> + <SolidColorBrush x:Key="BlueBrush" Color="#64B8EC"/> + <SolidColorBrush x:Key="BlueSelectionStrokBrush" Color="#1EA9FF"/> - <SolidColorBrush x:Key="LilacBrush" Color="#833CEC"/> - <SolidColorBrush x:Key="LilacBrush100" Color="#682EBE"/> - <SolidColorBrush x:Key="LilacBrush200" Color="#532990"/> + <SolidColorBrush x:Key="LilacBrush" Color="#833CEC"/> + <SolidColorBrush x:Key="LilacBrush100" Color="#682EBE"/> + <SolidColorBrush x:Key="LilacBrush200" Color="#532990"/> - <SolidColorBrush x:Key="WhiteTextBrush" Color="White"/> - <SolidColorBrush x:Key="WhiteBackgroundBrush" Color="White"/> - <SolidColorBrush x:Key="WhiteBrush" Color="#E6FFFFFF"/> - <SolidColorBrush x:Key="WhiteBrush50" Color="#FFF1F1F1"/> - - <SolidColorBrush x:Key="WhiteBrush100" Color="#ECECEC"/> - <SolidColorBrush x:Key="LightGrayBrush" Color="#A5A4A4"/> - <SolidColorBrush x:Key="LightGrayBrush100" Color="#BBBBBB"/> - <SolidColorBrush x:Key="LightGrayBrush150" Color="#CBCBCB"/> - <SolidColorBrush x:Key="LightGrayBrush200" Color="#D9D9D9"/> + <SolidColorBrush x:Key="WhiteTextBrush" Color="White"/> + <SolidColorBrush x:Key="WhiteBackgroundBrush" Color="White"/> + <SolidColorBrush x:Key="WhiteBrush" Color="#E6FFFFFF"/> + <SolidColorBrush x:Key="WhiteBrush50" Color="#FFF1F1F1"/> + + <SolidColorBrush x:Key="WhiteBrush100" Color="#ECECEC"/> + <SolidColorBrush x:Key="LightGrayBrush" Color="#A5A4A4"/> + <SolidColorBrush x:Key="LightGrayBrush100" Color="#BBBBBB"/> + <SolidColorBrush x:Key="LightGrayBrush150" Color="#CBCBCB"/> + <SolidColorBrush x:Key="LightGrayBrush200" Color="#D9D9D9"/> <!-- used for regular text color --> - <SolidColorBrush x:Key="BlackForegroundBrush" Color="black"/> - <SolidColorBrush x:Key="DarkGrayBrush" Color="#1B1B1B"/> - <SolidColorBrush x:Key="DarkGrayBrush100" Color="#101010"/> - <SolidColorBrush x:Key="DarkGrayBrush200" Color="#202020"/> - <SolidColorBrush x:Key="GrayBrush300" Color="#303030"/> + <SolidColorBrush x:Key="BlackForegroundBrush" Color="black"/> + <SolidColorBrush x:Key="DarkGrayBrush" Color="#1B1B1B"/> + <SolidColorBrush x:Key="DarkGrayBrush100" Color="#101010"/> + <SolidColorBrush x:Key="DarkGrayBrush200" Color="#202020"/> + <SolidColorBrush x:Key="GrayBrush300" Color="#303030"/> <!--used for Foreground Storage--> - <SolidColorBrush x:Key="GrayBrush310" Color="#363636"/> - <SolidColorBrush x:Key="GrayBrush280" Color="#3E3E3E"/> - <SolidColorBrush x:Key="GrayBrush290" Color="#404040"/> - <!-- used for text color--> - <SolidColorBrush x:Key="GrayBrush250" Color="#5E5E5E"/> - <SolidColorBrush x:Key="GrayBrush200" Color="#616161"/> - <SolidColorBrush x:Key="GrayBrush50" Color="#7A7A7A"/> - <SolidColorBrush x:Key="GrayBrush" Color="Gray"/> - <SolidColorBrush x:Key="DimGrayBrush" Color="DimGray"/> + <SolidColorBrush x:Key="GrayBrush310" Color="#363636"/> + <SolidColorBrush x:Key="GrayBrush280" Color="#3E3E3E"/> + <SolidColorBrush x:Key="GrayBrush290" Color="#404040"/> + <!-- used for text color--> + <SolidColorBrush x:Key="GrayBrush250" Color="#5E5E5E"/> + <SolidColorBrush x:Key="GrayBrush200" Color="#616161"/> + <SolidColorBrush x:Key="GrayBrush50" Color="#7A7A7A"/> + <SolidColorBrush x:Key="GrayBrush" Color="Gray"/> + <SolidColorBrush x:Key="DimGrayBrush" Color="DimGray"/> <SolidColorBrush x:Key="SideBarBackgroundBrush" Color="white" /> <SolidColorBrush x:Key="JobFieldForeground" Color="#FF494949"/> <SolidColorBrush x:Key="HomePageForeground" Color="#FF494949"/> <!--used for border brush--> <SolidColorBrush x:Key="BorderBrushGainsboro" Color="Gainsboro"/> - + <LinearGradientBrush x:Key="BlueGradientBrush" StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="#03A9F4"/> - <GradientStop Color="#0081BB" Offset="1"/> - </LinearGradientBrush> + <GradientStop Color="#03A9F4"/> + <GradientStop Color="#0081BB" Offset="1"/> + </LinearGradientBrush> - <SolidColorBrush x:Key="TransparentBackgroundBrush" Color="#96FFFFFF"/> - <SolidColorBrush x:Key="TransparentBackgroundBrush100" Color="#B9FFFFFF"/> - <SolidColorBrush x:Key="TransparentBackgroundBrush200" Color="#E6FFFFFF"/> - <SolidColorBrush x:Key="TransparentBackgroundBrush300" Color="#D4FFFFFF"/> - <SolidColorBrush x:Key="Transparent200" Color="#C9F6F6F6"/> - <!--MachineJobSelectionView Grid Background--> - <SolidColorBrush x:Key="TransparentBackgroundBrush400" Color="#B1FFFFFF"/> + <SolidColorBrush x:Key="TransparentBackgroundBrush" Color="#96FFFFFF"/> + <SolidColorBrush x:Key="TransparentBackgroundBrush100" Color="#B9FFFFFF"/> + <SolidColorBrush x:Key="TransparentBackgroundBrush200" Color="#E6FFFFFF"/> + <SolidColorBrush x:Key="TransparentBackgroundBrush300" Color="#D4FFFFFF"/> + <SolidColorBrush x:Key="Transparent200" Color="#C9F6F6F6"/> + <!--MachineJobSelectionView Grid Background--> + <SolidColorBrush x:Key="TransparentBackgroundBrush400" Color="#B1FFFFFF"/> <SolidColorBrush x:Key="TransparentBackgroundBrush420" Color="#A6FFFFFF"/> - - <!--Storage.Views.MainView--> + + <!--Storage.Views.MainView--> <SolidColorBrush x:Key="TransparentBackgroundBrush500" Color="#8BFFFFFF"/> <!--MachineTechView--> - <SolidColorBrush x:Key="TransparentBackgroundBrush450" Color="#7EFFFFFF"/> - <SolidColorBrush x:Key="TransparentBackgroundBrush600" Color="#70FFFFFF"/> - <SolidColorBrush x:Key="SelectionFillBrush" Color="#338D8D8D"/> + <SolidColorBrush x:Key="TransparentBackgroundBrush450" Color="#7EFFFFFF"/> + <SolidColorBrush x:Key="TransparentBackgroundBrush600" Color="#70FFFFFF"/> + <SolidColorBrush x:Key="SelectionFillBrush" Color="#338D8D8D"/> <!--Dispenser background--> <SolidColorBrush x:Key="TransparentBackgroundBrush700" Color="#68F6F6F6"/> @@ -154,6 +154,7 @@ <Color x:Key="graphGridLinesColor">#FF464646</Color> <Color x:Key="graphsMarkerColor">Gray</Color> <Color x:Key="materialColor">#FF03A9F4</Color> + <Color x:Key="whiteColor">White</Color> <!--Brushes--> <SolidColorBrush x:Key="borderBrush" Color="{StaticResource borderColor}"></SolidColorBrush> <SolidColorBrush x:Key="graphGridLinesBrush" Color="{StaticResource graphGridLinesColor}"></SolidColorBrush> @@ -161,7 +162,7 @@ <SolidColorBrush x:Key="graphGridLinesLightBrush" Color="{StaticResource graphGridLinesColor}"></SolidColorBrush> <SolidColorBrush x:Key="graphGridLinesDarkBrush" Color="#FF2E2E2E"></SolidColorBrush> <SolidColorBrush x:Key="MaterialDesignFlatButtonClick" Color="#FFDEDEDE"></SolidColorBrush> - + <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphBackgroundLight"> <GradientStop Color="White"/> <GradientStop Color="#FFE9E9E9" Offset="1"/> @@ -215,6 +216,10 @@ <GradientStop Color="#00EEEEEE" Offset="0" /> <GradientStop Color="#FFB5B5B5" Offset="1" /> </LinearGradientBrush> + <LinearGradientBrush x:Key="infoBrush" StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Color="White"/> + <GradientStop Color="#FFBFBFBF" Offset="1"/> + </LinearGradientBrush> </ResourceDictionary> -</ResourceDictionary.MergedDictionaries> + </ResourceDictionary.MergedDictionaries> </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tup/TupFileBuilder.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tup/TupFileBuilder.cs new file mode 100644 index 000000000..fad6ce949 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tup/TupFileBuilder.cs @@ -0,0 +1,288 @@ +using Ionic.Zip; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Tango.BL; +using Tango.Core; +using Tango.Core.DB; +using Tango.Core.DI; +using Tango.MachineStudio.Common.Web; +using Tango.SQLExaminer; +using Tango.Transport.Web; +using Tango.Core.ExtensionMethods; +using Tango.PPC.Common.Publish; +using Tango.Settings; +using Tango.Core.Components; +using System.Text.RegularExpressions; + +namespace Tango.MachineStudio.Common.Tup +{ + public class TupFileBuilder : ExtendedObject + { + public event EventHandler<TupFileBuilderProgressEventArgs> Progress; + + public Task Build(String serialNumber, String filePath) + { + return Task.Factory.StartNew(() => + { + String tempDbName = "Tango_TUP"; + var tempPackageFolder = TemporaryManager.CreateFolder(); + String tempBackupFolder = "C:\\MachineStudioTUP"; + String tempBackupFile = Path.Combine(tempBackupFolder, tempDbName + ".bak"); + var tempZipFile = TemporaryManager.CreateImaginaryFile(); + DbManager dbManager = null; + + LogManager.Log("Generating tup file..."); + LogManager.Log($"Tup file: '{filePath}.'"); + LogManager.Log($"Temporary db name: '{tempDbName}'."); + LogManager.Log($"Temporary package folder: '{tempPackageFolder}'."); + LogManager.Log($"Temporary db backup folder: '{tempBackupFolder}'."); + LogManager.Log($"Temporary db backup file: '{tempBackupFile}'."); + LogManager.Log($"Temporary zip file: '{tempZipFile}'."); + + try + { + LogManager.Log("Initializing..."); + + OnProgress("Initializing..."); + + Core.DataSource localDataSource = new Core.DataSource() + { + Address = "localhost\\SQLEXPRESS", + IntegratedSecurity = true, + Type = DataSourceType.SQLServer, + Catalog = null, + }; + + try + { + LogManager.Log($"Trying to connect via SQLEXPRESS:\n{localDataSource.ToJsonString()}"); + dbManager = DbManager.FromDataSource(localDataSource); + } + catch (Exception ex) + { + try + { + LogManager.Log(ex, "Could not connect using SQLEXPRESS. Trying local DB..."); + + CmdCommand command = new CmdCommand("sqllocaldb", "start \"MSSQLLocalDB\""); + var result = command.Run().Result; + + command = new CmdCommand("sqllocaldb", "info \"MSSQLLocalDB\""); + result = command.Run().Result; + + String pattern = "np:.+"; + Regex reg = new Regex(pattern); + var match = reg.Match(result.StandardOutput); + String address = match.ToString(); + if (address.Contains("np:")) + { + localDataSource.Address = address; + address = address.Trim().Replace("\r", ""); + } + else + { + throw new ArgumentException("Could not parse LocalDB address string."); + } + + LogManager.Log($"Trying to connect via LocalDB:\n{localDataSource.ToJsonString()}"); + dbManager = DbManager.FromDataSource(localDataSource); + } + catch (Exception x) + { + LogManager.Log(x, "Could not find any database service for this operation."); + throw x; + } + } + + + + OnProgress("Downloading latest PPC version..."); + + LogManager.Log("Connecting to machine service..."); + MachineStudioWebClient client = TangoIOC.Default.GetInstance<MachineStudioWebClient>(); + + LogManager.Log("Requesting latest PPC version from machine service..."); + var response = client.DownloadLatestPPCVersion(new DownloadLatestPPCVersionRequest() { SerialNumber = serialNumber }).Result; + + LogManager.Log($"Machine service response:\n{response.ToJsonString()}"); + + var remoteDataSource = response.DataSource; + + using (AutoFileDownloader downloader = new AutoFileDownloader(response.BlobAddress, response.CdnAddress, tempZipFile)) + { + downloader.Progress += (x, e) => + { + OnProgress($"Downloading latest PPC version '{response.Version}'...", false, e.Current, e.Total); + }; + + downloader.ResolveMode().GetAwaiter().GetResult(); + + LogManager.Log($"Downloading latest PPC version from: '{downloader.Address}'"); + + downloader.Download().Wait(); + } + + LogManager.Log("Extracting PPC version package..."); + + OnProgress("Extracting PPC package..."); + + using (ZipFile zip = new ZipFile(tempZipFile)) + { + int currentEntry = 0; + + zip.ExtractProgress += (x, args) => + { + if (args.EventType == ZipProgressEventType.Extracting_AfterExtractEntry) + { + OnProgress("Extracting PPC package...", false, currentEntry++, zip.Entries.Count); + } + }; + + zip.ExtractAll(tempPackageFolder); + } + + OnProgress("Extracting version information..."); + LogManager.Log("Extracting publish information..."); + PublishInfo publishInfo = PublishInfo.FromJson(File.ReadAllText(Path.Combine(tempPackageFolder, "version.json"))); + LogManager.Log($"Publish Information:\n{publishInfo}"); + + LogManager.Log("Modifying publish information to custom tup file..."); + publishInfo.IsMachineTupPackage = true; + publishInfo.MachineSerialNumber = serialNumber; + publishInfo.MachineDeploymentSlot = SettingsManager.Default.GetOrCreate<MachineStudioSettings>().DeploymentSlot; + + OnProgress("Creating temporary database..."); + + LogManager.Log($"Creating temporary db backup directory '{tempBackupFolder}'"); + + Directory.CreateDirectory(tempBackupFolder); + + LogManager.Log($"Creating new database: '{tempDbName}'"); + + //Create temp db + dbManager.Create(tempDbName, Path.Combine(tempBackupFolder, tempDbName + ".mdf")); + + OnProgress("Generating database snapshot..."); + + LogManager.Log("Starting database synchronization..."); + + Thread.Sleep(2000); + + localDataSource.Catalog = tempDbName; + + ExaminerSequenceConfigurationRunner runner = new ExaminerSequenceConfigurationRunner( + Path.Combine(tempPackageFolder, "Provision Scripts", "config.xml"), + Path.Combine(tempPackageFolder, "Provision Scripts"), + remoteDataSource, + localDataSource, + serialNumber); + + runner.ScriptExecuting += (x, item) => + { + LogManager.Log($"Executing script '{item.FileName}'..."); + OnProgress($"{item.Name}..."); + }; + + runner.Log += (x, log) => + { + LogManager.Log(log); + }; + + runner.Run().GetAwaiter().GetResult(); + + OnProgress("Generating database snapshot..."); + + if (File.Exists(tempBackupFile)) + { + LogManager.Log($"Deleting file '{tempBackupFile}'"); + File.Delete(tempBackupFile); + } + + LogManager.Log($"Generating backup for '{tempDbName}' to '{tempBackupFile}'..."); + + dbManager.Backup(tempDbName, tempBackupFile); + + OnProgress("Injecting database snapshot to PPC package..."); + + using (ZipFile zip = new ZipFile(tempZipFile)) + { + LogManager.Log($"Injecting file '{tempBackupFile}' to original package at '{tempZipFile}'..."); + zip.AddFile(tempBackupFile, "/"); + + LogManager.Log($"Injecting modified publish information..."); + zip.UpdateEntry("version.json", publishInfo.ToJson()); + + zip.Save(); + } + + LogManager.Log($"Copying '{tempZipFile}' to '{filePath}'..."); + + File.Copy(tempZipFile, filePath, true); + + OnProgress("Completed", false, 100, 100); + + LogManager.Log("TUP file generation completed successfully."); + } + catch (Exception ex) + { + LogManager.Log(ex, "TUP file generation failed."); + OnProgress("Failed", false, 0, 100); + throw ex; + } + finally + { + LogManager.Log($"Removing '{tempZipFile}'."); + tempZipFile.Delete(); + LogManager.Log($"Removing '{tempPackageFolder}'."); + tempPackageFolder.Delete(); + + try + { + LogManager.Log($"Removing database '{tempDbName}'."); + dbManager.SetOffline(tempDbName); + dbManager.SetOnline(tempDbName); + dbManager.Delete(tempDbName); + dbManager.Dispose(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error removing temp database '{tempDbName}'."); + } + + try + { + LogManager.Log($"Removing '{tempBackupFolder}'."); + Directory.Delete(tempBackupFolder, true); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error removing folder '{tempBackupFolder}'."); + } + } + }); + } + + public async Task<String> GetLatestPPCVersion(String serialNumber) + { + MachineStudioWebClient client = TangoIOC.Default.GetInstance<MachineStudioWebClient>(); + var response = await client.DownloadLatestPPCVersion(new DownloadLatestPPCVersionRequest() { SerialNumber = serialNumber }); + return response.Version; + } + + private void OnProgress(String message, bool isIntermediate = true, double progress = 0, double total = 100) + { + Progress?.Invoke(this, new TupFileBuilderProgressEventArgs() + { + Message = message, + IsIntermediate = isIntermediate, + Progress = progress, + Total = total, + }); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tup/TupFileBuilderProgressEventArgs.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tup/TupFileBuilderProgressEventArgs.cs new file mode 100644 index 000000000..ada69dd40 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tup/TupFileBuilderProgressEventArgs.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.Tup +{ + public class TupFileBuilderProgressEventArgs + { + public double Progress { get; set; } + public double Total { get; set; } + public bool IsIntermediate { get; set; } + public String Message { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesResponse.cs index 51608e6c4..b78047c85 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesResponse.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/CheckForUpdatesResponse.cs @@ -17,5 +17,7 @@ namespace Tango.MachineStudio.Common.Web public String Comments { get; set; } public String BlobAddress { get; set; } + + public String CdnAddress { get; set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestPPCVersionRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestPPCVersionRequest.cs new file mode 100644 index 000000000..24d465e69 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestPPCVersionRequest.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Transport.Web; + +namespace Tango.MachineStudio.Common.Web +{ + public class DownloadLatestPPCVersionRequest : WebRequestMessage + { + public String SerialNumber { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestPPCVersionResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestPPCVersionResponse.cs new file mode 100644 index 000000000..2cc6b731a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestPPCVersionResponse.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; +using Tango.Transport.Web; + +namespace Tango.MachineStudio.Common.Web +{ + public class DownloadLatestPPCVersionResponse : WebResponseMessage + { + public String Version { get; set; } + + public String BlobAddress { get; set; } + + public String CdnAddress { get; set; } + + public DataSource DataSource { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionResponse.cs index 3209b9a2f..60251d455 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionResponse.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/DownloadLatestVersionResponse.cs @@ -12,5 +12,7 @@ namespace Tango.MachineStudio.Common.Web public String Version { get; set; } public String BlobAddress { get; set; } + + public String CdnAddress { get; set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginMethod.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginMethod.cs new file mode 100644 index 000000000..83f1c0850 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginMethod.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.MachineStudio.Common.Web +{ + public enum LoginMethod + { + [Description("Active Directory")] + ActiveDirectory, + [Description("Standard User")] + StandardUser, + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginRequest.cs index 577f5e208..1727a2c6e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginRequest.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginRequest.cs @@ -12,5 +12,6 @@ namespace Tango.MachineStudio.Common.Web public String Version { get; set; } public String Email { get; set; } public String Password { get; set; } + public LoginMethod Method { get; set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginResponse.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginResponse.cs index 4ae22fa93..3515c32d1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginResponse.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/LoginResponse.cs @@ -14,5 +14,6 @@ namespace Tango.MachineStudio.Common.Web public DataSource DataSource { get; set; } public bool VersionChangeRequired { get; set; } public String RequiredVersion { get; set; } + public bool PasswordChangeRequired { get; set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs index 131f89515..72eb4acaa 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Web/MachineStudioWebClientBase.cs @@ -41,6 +41,15 @@ namespace Tango.MachineStudio.Common.Web } /// <summary> + /// Initializes a new instance of the <see cref="MachineStudioWebClientBase"/> class. + /// </summary> + /// <param name="cloned">Other instance.</param> + public MachineStudioWebClientBase(MachineStudioWebClientBase cloned) : base(cloned) + { + + } + + /// <summary> /// Executes the CheckForUpdates action and returns Tango.MachineStudio.Common.Web.CheckForUpdatesResponse. /// </summary> /// <returns></returns> @@ -94,5 +103,14 @@ namespace Tango.MachineStudio.Common.Web return Post<Tango.MachineStudio.Common.Web.RefreshTokenRequest, Tango.MachineStudio.Common.Web.RefreshTokenResponse>("RefreshToken", request); } + /// <summary> + /// Executes the DownloadLatestPPCVersion action and returns Tango.MachineStudio.Common.Web.DownloadLatestPPCVersionResponse. + /// </summary> + /// <returns></returns> + public Task<Tango.MachineStudio.Common.Web.DownloadLatestPPCVersionResponse> DownloadLatestPPCVersion(Tango.MachineStudio.Common.Web.DownloadLatestPPCVersionRequest request) + { + return Post<Tango.MachineStudio.Common.Web.DownloadLatestPPCVersionRequest, Tango.MachineStudio.Common.Web.DownloadLatestPPCVersionResponse>("DownloadLatestPPCVersion", request); + } + } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config index f871776f5..6fd5091a8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config @@ -9,4 +9,5 @@ <package id="MahApps.Metro" version="1.5.0" targetFramework="net46" /> <package id="MaterialDesignColors" version="1.1.2" targetFramework="net46" /> <package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" /> + <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" /> </packages>
\ No newline at end of file |
