aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-05-04 21:28:54 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-05-04 21:28:54 +0300
commita78e489a56f09eb6a0a3ffa557e602ee8c7e67a2 (patch)
tree60e56ad07660e911c69daef3fa93a53417e131ab /Software/Visual_Studio/PPC/Tango.PPC.Common
parent525cb05b5ab2c7168599d01d298d187a763d6b3c (diff)
parenta42e9713125bc9675b2978031244918c11c6e956 (diff)
downloadTango-a78e489a56f09eb6a0a3ffa557e602ee8c7e67a2.tar.gz
Tango-a78e489a56f09eb6a0a3ffa557e602ee8c7e67a2.zip
Merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs12
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj19
3 files changed, 36 insertions, 5 deletions
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 bef18e15b..a5fb92959 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
@@ -186,7 +186,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 +224,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 +233,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
@@ -393,7 +393,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);
@@ -413,7 +413,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/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
index c45aad51e..8a5c04588 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
@@ -50,6 +50,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; }
@@ -376,6 +381,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";
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 fa8aadf9a..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>