diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-09-03 16:18:55 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-09-03 16:18:55 +0300 |
| commit | c66acc359b311ecc940f3c4e74bd9e21dc0bfd51 (patch) | |
| tree | 8869b9d48fbad776c94df401680afc43fc350e69 /Software/Visual_Studio/PPC/Tango.PPC.Common | |
| parent | 6cdea71fa07d092139697d9c67651dade37aed96 (diff) | |
| parent | b271fe1c21172ed22a34b987a2cb9457b39ce8a3 (diff) | |
| download | Tango-c66acc359b311ecc940f3c4e74bd9e21dc0bfd51.tar.gz Tango-c66acc359b311ecc940f3c4e74bd9e21dc0bfd51.zip | |
Merged Eureka Branch !!!
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
34 files changed, 283 insertions, 28 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Build/BuildType.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Build/BuildType.cs new file mode 100644 index 000000000..43b1f75ca --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Build/BuildType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.Build +{ + public enum BuildType + { + TS1800, + Eureka + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Build/IBuildProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Build/IBuildProvider.cs new file mode 100644 index 000000000..3ced1ddc2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Build/IBuildProvider.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Common.Build +{ + public interface IBuildProvider + { + BuildType BuildType { get; } + bool IsEureka { get; } + String BuildName { get; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index 2b3bc2a99..7f67a4444 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -124,6 +124,10 @@ namespace Tango.PPC.Common.Connection MachineOperator.EnableJobLiquidQuantityValidation = settings.EnableJobLiquidQuantityValidation; (MachineOperator.JobRunsLogger as BasicJobRunsLogger).CreateJobRunsFiles = true; + +#if Eureka + ProcessParametersTable.DryerBufferMode = BL.Enumerations.MachineTypes.Eureka; +#endif } private void MachineOperator_StatusChanged(object sender, MachineStatuses status) @@ -186,7 +190,7 @@ namespace Tango.PPC.Common.Connection TimeSpan timeout = TimeSpan.FromSeconds(SettingsManager.Default.GetOrCreate<PPCSettings>().MachineScanningTimeoutSeconds); LogManager.Log("Scanning for machine on available serial ports...", LogCategory.Info); - Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse> scanner = new Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse>(UsbSerialBaudRates.BR_115200); + Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse> scanner = new Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse>(settings.EmbeddedBaudRate); var response = await scanner.Scan(new ConnectRequest() { Password = "1234" }, settings.EmbeddedDeviceHint, timeout); LogManager.Log("Machine discovered on port: " + response.Adapter.Address, LogCategory.Info); @@ -224,7 +228,7 @@ namespace Tango.PPC.Common.Connection //Perform a pre-test to not overload the log file when machine is off for a long time. using (SerialPort preCheckSerialPort = new SerialPort(settings.EmbeddedComPort)) { - preCheckSerialPort.BaudRate = UsbSerialBaudRates.BR_115200.ToInt32(); + preCheckSerialPort.BaudRate = settings.EmbeddedBaudRate.ToInt32(); preCheckSerialPort.Open(); preCheckSerialPort.Close(); fileLoggingDisabled = false; @@ -233,7 +237,7 @@ namespace Tango.PPC.Common.Connection LogManager.Log($"Connecting to machine on {settings.EmbeddedComPort}...", LogCategory.Info); - UsbTransportAdapter adapter = new UsbTransportAdapter(settings.EmbeddedComPort, UsbSerialBaudRates.BR_115200); + UsbTransportAdapter adapter = new UsbTransportAdapter(settings.EmbeddedComPort, settings.EmbeddedBaudRate); MachineOperator.Adapter = adapter; MachineOperator.JobHandlingMode = JobHandlerModes.SettingUp; try @@ -261,16 +265,25 @@ namespace Tango.PPC.Common.Connection { LogManager.Log("Application in demo mode!"); - var emulator_channel_name = "emulator-" + Guid.NewGuid().ToString(); + if (settings.EmulatorMode == EmulatorMode.InMemory) + { + var emulator_channel_name = "emulator-" + Guid.NewGuid().ToString(); + LogManager.Log("Starting embedded emulator..."); + MachineEmulator emulator = new MachineEmulator(new BasicTransporter(new MemoryTransportAdapter(emulator_channel_name))); + await emulator.Start(); - LogManager.Log("Starting embedded emulator..."); - MachineEmulator emulator = new MachineEmulator(new BasicTransporter(new MemoryTransportAdapter(emulator_channel_name))); - await emulator.Start(); + LogManager.Log("Emulator started. Connecting to emulator..."); - LogManager.Log("Emulator started. Connecting to emulator..."); + MemoryTransportAdapter adapter = new MemoryTransportAdapter(emulator_channel_name); + MachineOperator.Adapter = adapter; + } + else + { + LogManager.Log("Connecting to external emulator over TCP..."); + TcpTransportAdapter adapter = new TcpTransportAdapter("127.0.0.1", 30000); + MachineOperator.Adapter = adapter; + } - MemoryTransportAdapter adapter = new MemoryTransportAdapter(emulator_channel_name); - MachineOperator.Adapter = adapter; MachineOperator.JobHandlingMode = JobHandlerModes.SettingUp; LogManager.Log("Connecting machine operator..."); await MachineOperator.Connect(); @@ -320,6 +333,8 @@ namespace Tango.PPC.Common.Connection { LogManager.Log("First machine entry found. Machine serial number is: " + Machine.SerialNumber + "."); + MachineOperator.MachineType = Machine.Type; + if (Machine.IsDemo) { LogManager.Log("Machine is in demo mode. Changing firmware upgrade mode to TFP package only."); @@ -381,6 +396,10 @@ namespace Tango.PPC.Common.Connection machineOperator.EnableJobLiquidQuantityValidation = false; machineOperator.EnablePowerUpSequence = false; +#if Eureka + machineOperator.MachineType = BL.Enumerations.MachineTypes.Eureka; +#endif + LogManager.Default.Log("Starting machine connection procedure..."); var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); @@ -391,7 +410,7 @@ namespace Tango.PPC.Common.Connection onProgress?.Invoke("Scanning for the machine..."); LogManager.Default.Log("Scanning for machine on available serial ports..."); - Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse> scanner = new Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse>(UsbSerialBaudRates.BR_115200); + Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse> scanner = new Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse>(settings.EmbeddedBaudRate); var response = await scanner.Scan(new ConnectRequest() { Password = "1234" }, timeout); onProgress?.Invoke("Machine discovered on port: " + response.Adapter.Address); @@ -411,7 +430,7 @@ namespace Tango.PPC.Common.Connection LogManager.Default.Log($"Connecting to machine on {settings.EmbeddedComPort}..."); onProgress?.Invoke($"Connecting to machine on {settings.EmbeddedComPort}..."); - UsbTransportAdapter adapter = new UsbTransportAdapter(settings.EmbeddedComPort, UsbSerialBaudRates.BR_115200); + UsbTransportAdapter adapter = new UsbTransportAdapter(settings.EmbeddedComPort, settings.EmbeddedBaudRate); machineOperator.Adapter = adapter; machineOperator.JobHandlingMode = JobHandlerModes.SettingUp; await machineOperator.Connect(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs new file mode 100644 index 000000000..a9b3ff8bc --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; +using Tango.Core.DI; +using Tango.PPC.Common.Build; + +namespace Tango.PPC.Common.Converters +{ + public class BuildTypeToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return (BuildType)value == (BuildType)Enum.Parse(typeof(BuildType), parameter.ToStringSafe()) ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs new file mode 100644 index 000000000..744d0d975 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; +using Tango.Core.DI; +using Tango.PPC.Common.Build; + +namespace Tango.PPC.Common.Converters +{ + public class BuildTypeToVisibilityInverseConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return (BuildType)value == (BuildType)Enum.Parse(typeof(BuildType), parameter.ToStringSafe()) ? Visibility.Collapsed : Visibility.Visible; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsEurekaToBooleanConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsEurekaToBooleanConverter.cs new file mode 100644 index 000000000..3596a86be --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsEurekaToBooleanConverter.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.Core.DI; +using Tango.PPC.Common.Build; + +namespace Tango.PPC.Common.Converters +{ + public class IsEurekaToBooleanConverter : IValueConverter + { + private static BuildType? _buildType = null; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (_buildType == null) + { + _buildType = TangoIOC.Default.GetInstance<IBuildProvider>().BuildType; + } + + return _buildType == BuildType.Eureka; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Black.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Black.ttf Binary files differnew file mode 100644 index 000000000..71c0f995e --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Black.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BlackItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BlackItalic.ttf Binary files differnew file mode 100644 index 000000000..7aeb58bd1 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BlackItalic.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Bold.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Bold.ttf Binary files differnew file mode 100644 index 000000000..00559eeb2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Bold.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BoldItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BoldItalic.ttf Binary files differnew file mode 100644 index 000000000..e61e8e88b --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-BoldItalic.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBold.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBold.ttf Binary files differnew file mode 100644 index 000000000..df7093608 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBold.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBoldItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBoldItalic.ttf Binary files differnew file mode 100644 index 000000000..14d2b375d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraBoldItalic.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLight.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLight.ttf Binary files differnew file mode 100644 index 000000000..e76ec69a6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLight.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLightItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLightItalic.ttf Binary files differnew file mode 100644 index 000000000..89513d946 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ExtraLightItalic.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Italic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Italic.ttf Binary files differnew file mode 100644 index 000000000..12b7b3c40 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Italic.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Light.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Light.ttf Binary files differnew file mode 100644 index 000000000..bc36bcc24 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Light.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-LightItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-LightItalic.ttf Binary files differnew file mode 100644 index 000000000..9e70be6a9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-LightItalic.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Medium.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Medium.ttf Binary files differnew file mode 100644 index 000000000..6bcdcc27f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Medium.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-MediumItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-MediumItalic.ttf Binary files differnew file mode 100644 index 000000000..be67410fd --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-MediumItalic.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Regular.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Regular.ttf Binary files differnew file mode 100644 index 000000000..9f0c71b70 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Regular.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBold.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBold.ttf Binary files differnew file mode 100644 index 000000000..74c726e32 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBold.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBoldItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBoldItalic.ttf Binary files differnew file mode 100644 index 000000000..3e6c94223 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-SemiBoldItalic.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Thin.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Thin.ttf Binary files differnew file mode 100644 index 000000000..03e736613 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-Thin.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ThinItalic.ttf b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ThinItalic.ttf Binary files differnew file mode 100644 index 000000000..e26db5dd3 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Fonts/Poppins-ThinItalic.ttf diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs index 45fd6c1b8..0d64da83e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -32,6 +32,7 @@ using Tango.SharedUI.Helpers; using Tango.SQLExaminer; using Tango.Transport.Web; using System.Data.Entity; +using Tango.PPC.Common.Build; namespace Tango.PPC.Common.MachineSetup { @@ -45,6 +46,7 @@ namespace Tango.PPC.Common.MachineSetup private IRemoteAssistanceProvider _remoteAssistance; private IUnifiedWriteFilterManager _uwf; private IOperationSystemManager _windows_manager; + private IBuildProvider _buildProvider; private PPCWebClient _client; private List<LogItemBase> _logs; private bool _isUpdating; @@ -81,12 +83,13 @@ namespace Tango.PPC.Common.MachineSetup /// Initializes a new instance of the <see cref="MachineSetupManager"/> class. /// </summary> /// <param name="remoteAssistance">The remote assistance.</param> - public MachineSetupManager(PPCWebClient ppcWebClient, IRemoteAssistanceProvider remoteAssistance, IUnifiedWriteFilterManager unifiedWriterFilterManager, IOperationSystemManager operationSystemManager) + public MachineSetupManager(PPCWebClient ppcWebClient, IRemoteAssistanceProvider remoteAssistance, IUnifiedWriteFilterManager unifiedWriterFilterManager, IOperationSystemManager operationSystemManager, IBuildProvider buildProvider) { _client = ppcWebClient; _remoteAssistance = remoteAssistance; _uwf = unifiedWriterFilterManager; _windows_manager = operationSystemManager; + _buildProvider = buildProvider; _logs = new List<LogItemBase>(); LogManager.NewLog += LogManager_NewLog; @@ -235,7 +238,7 @@ namespace Tango.PPC.Common.MachineSetup Login(serialNumber).Wait(); - String deviceName = $"Tango-{serialNumber}-{settings.DeploymentSlot.ToString()}"; + String deviceName = $"{(_buildProvider.BuildType == BuildType.TS1800 ? "PPC" : "TwineX4")}{serialNumber}{settings.DeploymentSlot.ToString()}"; LogManager.Log($"Settings device name: '{deviceName}'..."); try { @@ -254,6 +257,13 @@ namespace Tango.PPC.Common.MachineSetup { LogManager.Log($"Sending setup request...\n{request.ToJsonString()}"); setup_response = await _client.MachineSetup(request); + + if (_buildProvider.IsEureka) + { + setup_response.SetupActivation = false; + setup_response.SetupUWF = false; + setup_response.SetupRemoteAssistance = false; + } } catch (Exception ex) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index c5412e591..47ffe6f19 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -37,6 +37,7 @@ using Tango.BL.DTO; using Tango.PPC.Shared.Updates; using Tango.PPC.Shared.RemoteUpgrade; using Tango.Core.Threading; +using Tango.PPC.Common.Build; namespace Tango.PPC.Common.MachineUpdate { @@ -45,6 +46,7 @@ namespace Tango.PPC.Common.MachineUpdate private IPPCApplicationManager _app_manager; private IMachineProvider _machineProvider; private IPackageRunner _packageRunner; + private IBuildProvider _buildProvider; private PPCWebClient _client; private List<LogItemBase> _logs; private System.Timers.Timer _checkForUpdateTimer; @@ -101,13 +103,14 @@ namespace Tango.PPC.Common.MachineUpdate /// Initializes a new instance of the <see cref="MachineUpdateManager"/> class. /// </summary> /// <param name="applicationManager">The application manager.</param> - public MachineUpdateManager(PPCWebClient ppcWebClient, IPPCApplicationManager applicationManager, IMachineProvider machineProvider, IPackageRunner packageRunner, IPPCExternalBridgeService externalBridge) + public MachineUpdateManager(PPCWebClient ppcWebClient, IPPCApplicationManager applicationManager, IMachineProvider machineProvider, IPackageRunner packageRunner, IPPCExternalBridgeService externalBridge, IBuildProvider buildProvider) { _client = ppcWebClient; _machineProvider = machineProvider; _app_manager = applicationManager; _app_manager.ApplicationReady += _app_manager_ApplicationReady; _packageRunner = packageRunner; + _buildProvider = buildProvider; _packageRunner.PackageProgress += _packageRunner_PackageProgress; _logs = new List<LogItemBase>(); @@ -702,7 +705,7 @@ namespace Tango.PPC.Common.MachineUpdate } } - if (!op.CanPrint) + if (op.Status == MachineStatuses.Printing || op.Status == MachineStatuses.GettingReady) { throw LogManager.Log(new InvalidOperationException($"Could not perform an update while the machine is in {op.Status} status.")); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs index 6fb521838..acb84191b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs @@ -16,6 +16,12 @@ using Tango.Web; namespace Tango.PPC.Common { + public enum EmulatorMode + { + InMemory, + ExternalTCP, + } + /// <summary> /// Represents the main PPC settings. /// </summary> @@ -50,6 +56,11 @@ namespace Tango.PPC.Common public String EmbeddedComPort { get; set; } /// <summary> + /// Gets or sets the embedded USB serial baud rate when using USB and Eureka. + /// </summary> + public UsbSerialBaudRates EmbeddedBaudRate { get; set; } + + /// <summary> /// Gets or sets the embedded device scanning hint. /// </summary> public String EmbeddedDeviceHint { get; set; } @@ -350,6 +361,26 @@ namespace Tango.PPC.Common public double FineTuningMinLimitdL { get; set; } /// <summary> + /// Gets or sets a value indicating whether [show advanced options]. + /// </summary> + public bool ShowAdvancedOptions { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to force full screen mode on TwineX4. + /// </summary> + public bool ForceTouchMode { get; set; } + + /// <summary> + /// Gets or sets the emulator mode. + /// </summary> + public EmulatorMode EmulatorMode { get; set; } + + /// <summary> + /// Gets or sets the storage root path. + /// </summary> + public String StorageRootPath { get; set; } + + /// <summary> /// Gets the machine service address. /// </summary> /// <returns></returns> @@ -363,6 +394,7 @@ namespace Tango.PPC.Common /// </summary> public PPCSettings() { + EmulatorMode = EmulatorMode.InMemory; LubricationLevels = new List<RmlLubricationLevel>(); JobUploadStrategy = JobUploadStrategy.JobDescriptionFile; FineTuningTrialLengthMeters = 200; @@ -371,6 +403,13 @@ namespace Tango.PPC.Common GradientGenerationResolution = 40; MachineScanningTimeoutSeconds = 20; EmbeddedComPort = "COM10"; + +#if Eureka + EmbeddedBaudRate = UsbSerialBaudRates.BR_1000000; +#else + EmbeddedBaudRate = UsbSerialBaudRates.BR_115200; +#endif + EmbeddedDeviceHint = "Tango USB Serial Port"; ExternalBridgePassword = "Aa123456"; HotSpotPassword = "Aa123456"; @@ -416,6 +455,7 @@ namespace Tango.PPC.Common ScreenSaverStartDuration = 5; EnableScreenSaver = true; EnableRemoteJobUpload = true; + ShowAdvancedOptions = false; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs index cdbfa909d..b54289813 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs @@ -8,6 +8,7 @@ using Tango.Core.DI; using Tango.PPC.Common.Application; using Tango.PPC.Common.Authentication; using Tango.PPC.Common.Bit; +using Tango.PPC.Common.Build; using Tango.PPC.Common.Connection; using Tango.PPC.Common.Connectivity; using Tango.PPC.Common.EventLogging; @@ -141,6 +142,9 @@ namespace Tango.PPC.Common [TangoInject] public IRemoteJobUploadService RemoteJobUploadService { get; set; } + [TangoInject] + public IBuildProvider BuildProvider { get; set; } + private PPCSettings _settings; /// <summary> /// Gets the main PPC settings. diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/PrintingConfiguration.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/PrintingConfiguration.cs index 815936137..ff406cefd 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/PrintingConfiguration.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/PrintingConfiguration.cs @@ -8,6 +8,8 @@ namespace Tango.PPC.Common.Printing { public class PrintingConfiguration { - + public int RemainingUnits { get; set; } + public double GlobalStartPosition { get; set; } + public double FirstUnitStartPosition { get; set; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs index 983868c2c..a71bf6729 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs @@ -28,6 +28,8 @@ namespace Tango.PPC.Common.Publish /// </summary> public event EventHandler<PublishProgressEventArgs> PublishProgress; + public bool IsEureka { get; set; } + private PublishOptions _options; /// <summary> /// Gets or sets the publish options. @@ -200,7 +202,7 @@ namespace Tango.PPC.Common.Publish String output_folder = Options.InstallerOutputFolder; OnPublishProgress(0, 100, $"Building installer project..."); InstallerBuilder installerBuilder = new InstallerBuilder(Options.InstallerProject); - String installer_name = $"PPC Installer_v{Version.Parse(local_version).ToString(3) + (Options.Tag.IsNotNullOrEmpty() ? $" [{Options.Tag}]" : String.Empty)}.exe"; + String installer_name = $"{(IsEureka ? "TwineX4" : "PPC")} Installer_v{Version.Parse(local_version).ToString(3) + (Options.Tag.IsNotNullOrEmpty() ? $" [{Options.Tag}]" : String.Empty)}.exe"; String output_file = Path.Combine(output_folder, installer_name); installerBuilder.Build(local_version, output_file).Wait(); @@ -256,7 +258,7 @@ namespace Tango.PPC.Common.Publish { String repoPath = Path.GetFullPath("../../../../../"); String tagVersion = System.Version.Parse(GetLocalVersion()).ToString(3); - String tagName = $"PPC_v{tagVersion}"; + String tagName = $"{(IsEureka ? "Eureka" : "PPC")}_v{tagVersion}"; if (Options.Tag.IsNotNullOrEmpty()) { @@ -432,7 +434,9 @@ namespace Tango.PPC.Common.Publish var cuf = zip.AddFile(update_config_file, update_dir); cuf.FileName = update_dir + "\\config.xml"; - zip.AddDirectory(folder + "\\" + "Packages", "/Packages"); + String packagesFolder = folder + "\\" + "Packages"; + Directory.CreateDirectory(packagesFolder); + zip.AddDirectory(packagesFolder, "/Packages"); foreach (var file in Directory.GetFiles(folder, "*.*", SearchOption.TopDirectoryOnly)) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs index 411fd5252..51c78e0f0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs @@ -14,6 +14,7 @@ using Tango.Core.Threading; using Tango.Integration.ExternalBridge; using Tango.Logging; using Tango.PPC.Common.Application; +using Tango.PPC.Common.Build; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Common.OS; using Tango.PPC.Common.Printing; @@ -46,6 +47,7 @@ namespace Tango.PPC.Common.RemoteDesktop private bool _isMouseDown; private bool _ensureMouseDown; private ActionTimer _resetTimer; + private IBuildProvider _buildProvider; /// <summary> /// Gets or sets a value indicating whether this <see cref="IPPCService" /> is enabled. @@ -79,11 +81,12 @@ namespace Tango.PPC.Common.RemoteDesktop /// <param name="applicationManager">The application manager.</param> /// <param name="externalBridge">The external bridge.</param> /// <param name="osManager">The os manager.</param> - public DefaultRemoteDesktopService(IPPCApplicationManager applicationManager, IPPCExternalBridgeService externalBridge, IOperationSystemManager osManager, IPrintingManager printingManager) + public DefaultRemoteDesktopService(IPPCApplicationManager applicationManager, IPPCExternalBridgeService externalBridge, IOperationSystemManager osManager, IPrintingManager printingManager, IBuildProvider buildProvider) { _osManager = osManager; _appManager = applicationManager; _printingManager = printingManager; + _buildProvider = buildProvider; _jsonSettings = new JsonSerializerSettings() { @@ -110,10 +113,19 @@ namespace Tango.PPC.Common.RemoteDesktop private void ApplicationManager_ApplicationReady(object sender, EventArgs e) { - - var mainWindow = System.Windows.Application.Current.MainWindow; + if (_buildProvider.IsEureka) + { + _engine.CaptureRegion = new CaptureRegion() + { + Left = (int)mainWindow.Left, + Top = 0, + Width = 1920, + Height = 1080 + }; + } + if (mainWindow.WindowStyle != System.Windows.WindowStyle.None) { mainWindow.LocationChanged += (_, __) => @@ -325,7 +337,7 @@ namespace Tango.PPC.Common.RemoteDesktop MouseController.MouseEvent(flag); - _resetTimer.ResetReplace(() => + _resetTimer.ResetReplace(() => { _printingManager.PreventPrintingByRemoteDesktop = false; Debug.WriteLine("ALLOW PRINT"); @@ -468,7 +480,7 @@ namespace Tango.PPC.Common.RemoteDesktop } else { - _engine.EnableComparer = true; + _engine.EnableComparer = !_buildProvider.IsEureka; foreach (var client in _clients.ToList().Where(x => !x.InitialPacketSent)) { @@ -490,13 +502,13 @@ namespace Tango.PPC.Common.RemoteDesktop } } - if (e.Frame.DifferenceCount > 0) + if (e.Frame.DifferenceCount > 0 || _buildProvider.IsEureka) { RemoteDesktopPacket packet = null; Point mousePosition = new Point(System.Windows.Forms.Cursor.Position.X, System.Windows.Forms.Cursor.Position.Y); - if (!e.Frame.DifferenceAvailable) + if (!e.Frame.DifferenceAvailable || _buildProvider.IsEureka) { packet = new RemoteDesktopPacket() { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml index 356c04749..4e704751c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Fonts.xaml @@ -3,4 +3,7 @@ xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Tango.PPC.Common.Resources"> -</ResourceDictionary>
\ No newline at end of file + <FontFamily x:Key="Poppins" >pack://application:,,,/Tango.PPC.Common;Component/Fonts/#Poppins</FontFamily> + +</ResourceDictionary> +
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml index 780941f66..da4e63b51 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -71,6 +71,9 @@ <converters:IsToStringEqualToVisibilityConverter x:Key="IsToStringEqualToVisibilityConverter" /> <localConverter:EventTypeDescriptionConverter x:Key="EventTypeDescriptionConverter" /> <localConverter:EventTypeTitleConverter x:Key="EventTypeTitleConverter" /> + <localConverter:IsEurekaToBooleanConverter x:Key="IsEurekaToBooleanConverter" /> + <localConverter:BuildTypeToVisibilityConverter x:Key="BuildTypeToVisibilityConverter" /> + <localConverter:BuildTypeToVisibilityInverseConverter x:Key="BuildTypeToVisibilityInverseConverter" /> <Style TargetType="FrameworkElement"> <Setter Property="TextElement.FontFamily" Value="{StaticResource TangoFlexoFontFamily}"></Setter> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index e1f4efdcb..e598c6fe4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -47,6 +47,25 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Eureka_Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\Build\PPC\Eureka_Debug\</OutputPath> + <DefineConstants>TRACE;DEBUG;Eureka</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Eureka|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>..\..\Build\PPC\Eureka\</OutputPath> + <DefineConstants>TRACE;Eureka</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> <ItemGroup> <Reference Include="CommandLine, Version=1.9.71.2, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL"> <HintPath>..\..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath> @@ -134,6 +153,8 @@ <Compile Include="BackupRestore\RestoreResult.cs" /> <Compile Include="BackupRestore\RestoreSettings.cs" /> <Compile Include="Bit\IBitManager.cs" /> + <Compile Include="Build\BuildType.cs" /> + <Compile Include="Build\IBuildProvider.cs" /> <Compile Include="Connection\DefaultMachineProvider.cs" /> <Compile Include="Connection\IMachineProvider.cs" /> <Compile Include="Connection\MachineOperatorChangedEventArgs.cs" /> @@ -158,6 +179,9 @@ <Compile Include="Converters\EventTypeDescriptionConverter.cs" /> <Compile Include="Converters\EventTypeTitleConverter.cs" /> <Compile Include="Converters\HeightToOpacityConverter.cs" /> + <Compile Include="Converters\BuildTypeToVisibilityInverseConverter.cs" /> + <Compile Include="Converters\BuildTypeToVisibilityConverter.cs" /> + <Compile Include="Converters\IsEurekaToBooleanConverter.cs" /> <Compile Include="DataStore\DefaultDataStoreService.cs" /> <Compile Include="DataStore\IDataStoreService.cs" /> <Compile Include="ExtensionMethods\IListExtensions.cs" /> @@ -378,6 +402,24 @@ <None Include="app.config"> <SubType>Designer</SubType> </None> + <Resource Include="Fonts\Poppins-Black.ttf" /> + <Resource Include="Fonts\Poppins-BlackItalic.ttf" /> + <Resource Include="Fonts\Poppins-Bold.ttf" /> + <Resource Include="Fonts\Poppins-BoldItalic.ttf" /> + <Resource Include="Fonts\Poppins-ExtraBold.ttf" /> + <Resource Include="Fonts\Poppins-ExtraBoldItalic.ttf" /> + <Resource Include="Fonts\Poppins-ExtraLight.ttf" /> + <Resource Include="Fonts\Poppins-ExtraLightItalic.ttf" /> + <Resource Include="Fonts\Poppins-Italic.ttf" /> + <Resource Include="Fonts\Poppins-Light.ttf" /> + <Resource Include="Fonts\Poppins-LightItalic.ttf" /> + <Resource Include="Fonts\Poppins-Medium.ttf" /> + <Resource Include="Fonts\Poppins-MediumItalic.ttf" /> + <Resource Include="Fonts\Poppins-Regular.ttf" /> + <Resource Include="Fonts\Poppins-SemiBold.ttf" /> + <Resource Include="Fonts\Poppins-SemiBoldItalic.ttf" /> + <Resource Include="Fonts\Poppins-Thin.ttf" /> + <Resource Include="Fonts\Poppins-ThinItalic.ttf" /> <None Include="packages.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> |
