using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using Tango.Core; using Tango.FSE.BL.Connectivity; using Tango.FSE.Common.Diagnostics; using Tango.PMR.Integration; using Tango.Settings; namespace Tango.FSE.Common { public class FSESettings : SettingsBase { public enum WorkingEnvironment { Remote, Local } public class MachineConnectionSettings { public String SerialNumber { get; set; } public ExternalBridgeLoginIntent Intent { get; set; } public bool RequireSafetyLevelOperations { get; set; } public String Password { get; set; } public bool AutoReconnection { get; set; } } public class StatisticsStreamingConfiguration : ExtendedObject { private bool _enable; public bool Enable { get { return _enable; } set { _enable = value; if (!value) EnableCsvReports = false; RaisePropertyChanged(nameof(EnableCsvReports)); } } public bool EnableCsvReports { get; set; } public String CsvReportsFolder { get; set; } } /// /// Gets or sets the working environment. /// public WorkingEnvironment Environment { get; set; } /// /// Gets or sets the last login email. /// public String LastLoginEmail { get; set; } /// /// Gets or sets the last login password. /// public String LastLoginPassword { get; set; } /// /// Gets or sets the last environment identifier. /// public String LastEnvironmentID { get; set; } /// /// Gets or sets a value indicating whether to save the user credentials. /// public bool RememberMe { get; set; } /// /// Gets or sets a value indicating whether to force the application version update. /// public bool ForceVersionUpdate { get; set; } /// /// Gets or sets the last selected machine on the connection pane. /// public String LastSelectedMachine { get; set; } /// /// Gets or sets the last virtualized machine serial number. /// public String LastVirtualizedMachineSerialNumber { get; set; } /// /// Gets or sets the external bridge SignalR hub. /// public String ExternalBridgeSignalRHub { get; set; } /// /// Gets or sets a value indicating whether to enable external bridge scanning via SignalR. /// public bool EnableExternalBridgeSignalR { get; set; } /// /// Gets or sets the diagnostics throttling mode. /// public DiagnosticsThrottlingMode DiagnosticsThrottlingMode { get; set; } /// /// Gets or sets a value indicating whether to enable the machine emulator. /// public bool EnableMachineEmulator { get; set; } /// /// Gets or sets the height of the machine connection pane USB area. /// public GridLength MachineConnectionUsbHeight { get; set; } /// /// Gets or sets the height of the machine connection pane WIFI area. /// public GridLength MachineConnectionWifiHeight { get; set; } /// /// Gets or sets the height of the machine connection pane SignalR area. /// public GridLength MachineConnectionSignalRHeight { get; set; } /// /// Gets or sets the stored machine passwords. /// public List StoredMachinesConnectionSettings { get; set; } /// /// Gets or sets a value indicating whether to maximize the application after login. /// public bool WindowMaximizedOnStartup { get; set; } /// /// Gets or sets the automatic machine reconnection timeout in seconds. /// public int AutoMachineReconnectionTimeoutSeconds { get; set; } /// /// Gets or sets a value indicating whether to perform automatic software updates check. /// public bool AutoCheckForUpdates { get; set; } /// /// Gets or sets a value indicating whether to enable scale transform of the application window on small resolution screens. /// public bool EnableAdaptiveScaling { get; set; } /// /// Gets or sets the last issue report assigned to. /// public String LastReportAssignedTo { get; set; } /// /// Gets or sets the last report area. /// public String LastReportArea { get; set; } /// /// Gets or sets a value indicating whether the application has terminated unexpectedly. /// public bool TerminatedExpectedly { get; set; } /// /// Gets or sets the file association service port. /// public int FileAssociationServicePort { get; set; } /// /// Gets or sets the connectivity verification method. /// public ConnectivityVerificationMethod ConnectivityVerificationMethod { get; set; } /// /// Gets or sets a value indicating whether to force the external bridge protocol configuration event when there is an error with the request. /// public bool ForceExternalBridgeProtocolConfiguration { get; set; } /// /// Gets or sets a value indicating whether to enable hot folder for uploading jobs to the remote machine. /// public bool EnableHotFolder { get; set; } /// /// Gets or sets the hot folder path (null means default path on %appdata%). /// public String HotFolderPath { get; set; } /// /// Gets or sets the statistics streaming configuration. /// /// public StatisticsStreamingConfiguration StatisticsStreamingConfig { get; set; } /// /// Gets or sets the last type of the connected machine. /// public int LastConnectedMachineType { get; set; } /// /// Gets or sets the last job upload thread unique identifier. /// public String LastJobUploadThreadGuid { get; set; } /// /// Initializes a new instance of the class. /// public FSESettings() { Environment = WorkingEnvironment.Remote; ExternalBridgeSignalRHub = "ExternalBridgeHub"; EnableExternalBridgeSignalR = true; DiagnosticsThrottlingMode = DiagnosticsThrottlingMode.Delayed; MachineConnectionUsbHeight = new GridLength(1, GridUnitType.Star); MachineConnectionWifiHeight = new GridLength(1, GridUnitType.Star); MachineConnectionSignalRHeight = new GridLength(1, GridUnitType.Star); StoredMachinesConnectionSettings = new List(); AutoMachineReconnectionTimeoutSeconds = 10; AutoCheckForUpdates = true; EnableAdaptiveScaling = true; TerminatedExpectedly = true; FileAssociationServicePort = 1800; ConnectivityVerificationMethod = ConnectivityVerificationMethod.Windows; ForceExternalBridgeProtocolConfiguration = true; EnableHotFolder = true; StatisticsStreamingConfig = new StatisticsStreamingConfiguration(); } } }