aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-05-02 17:24:55 +0300
committerRoy <Roy.mail.net@gmail.com>2023-05-02 17:24:55 +0300
commita42e9713125bc9675b2978031244918c11c6e956 (patch)
tree1cc11cd6bdd284e1884b3c4d420bd6a0fb3d865a /Software/Visual_Studio/PPC
parentbcec28b0d2d80d26513b0415519f26d83f25c51c (diff)
downloadTango-a42e9713125bc9675b2978031244918c11c6e956.tar.gz
Tango-a42e9713125bc9675b2978031244918c11c6e956.zip
Eureka Added more baud rates + some bug fixes.
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs4
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs27
-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
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
6 files changed, 43 insertions, 31 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
index fd93b6108..0e4ec8fa4 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
@@ -442,7 +442,7 @@ namespace Tango.PPC.Jobs.ViewModels
job.CreationDate = DateTime.UtcNow;
job.JobStatus = JobStatuses.Draft;
- var selectedSpoolTypeGuid = Settings.SpoolTypeGuid;
+ var selectedSpoolTypeGuid = Settings.SpoolTypeGuid ?? _spoolTypes.First().Guid;
if (BuildProvider.IsEureka)
{
@@ -717,7 +717,7 @@ namespace Tango.PPC.Jobs.ViewModels
_catalogs = await new CatalogsCollectionBuilder(db).SetAll().ForSite(MachineProvider.Machine.SiteGuid).BuildAsync();
_rmls = (await new RmlsCollectionBuilder(db).SetAll().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToObservableCollection();
//_rmls = (await new RmlsCollectionBuilder(db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToObservableCollection();
- _spoolTypes = db.SpoolTypes.ToObservableCollection();
+ _spoolTypes = await MachineProvider.Machine.GetSiteSpoolTypes(db);
}
MachineDataSynchronizer.SynchronizationEnded += MachineDataSynchronizer_SynchronizationEnded;
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
index 36d1824a0..6787136be 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
@@ -323,7 +323,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
{
Settings.SupportedJobTypes = SelectedJobTypes.SynchedSource.ToList();
Settings.SupportedColorSpaces = SelectedColorSpaces.SynchedSource.ToList();
-
+
Machine.MapPropertiesTo(MachineProvider.Machine, MappingFlags.NoReferenceTypes);
Settings.EnableHotSpot = EnableHotSpot;
@@ -502,26 +502,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
Rmls = (await new RmlsCollectionBuilder(db).SetAll().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).OrderBy(x => x.FinalName).ToObservableCollection();
-
- try
- {
- SpoolTypes = (await db.SitesSpoolTypes.Where(x => x.SiteGuid == MachineProvider.Machine.SiteGuid).Include(x => x.SpoolType).Select(x => x.SpoolType).ToListAsync()).OrderBy(x => x.LastUpdated).ToObservableCollection();
-
- if (SpoolTypes.Count == 0)
- {
- SpoolTypes = new ObservableCollection<SpoolType>();
- var standardSpool = await db.SpoolTypes.FirstOrDefaultAsync(x => x.Code == (int)BL.Enumerations.SpoolTypes.StandardSpool);
- if (standardSpool != null)
- {
- SpoolTypes.Add(standardSpool);
- }
- }
-
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error getting machine site spool types.");
- }
+ SpoolTypes = await MachineProvider.Machine.GetSiteSpoolTypes(db);
}
}
@@ -555,8 +536,8 @@ namespace Tango.PPC.MachineSettings.ViewModels
SelectedJobTypes = new SelectedObjectCollection<JobTypes>(Enum.GetValues(typeof(JobTypes)).Cast<JobTypes>().ToObservableCollection(), Settings.SupportedJobTypes.ToObservableCollection());
SelectedColorSpaces = new SelectedObjectCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x.IsUserSpace()).ToObservableCollection(), Settings.SupportedColorSpaces.ToObservableCollection());
- TabsColorSpaces = new ObservableCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x!= ColorSpaces.Volume /*&& x!= ColorSpaces.HSB*/).ToObservableCollection());
- DefaultTabColorSpace = Settings.DefaultTabColorSpace == null? ColorSpaces.CMYK : TabsColorSpaces.SingleOrDefault(x => x == Settings.DefaultTabColorSpace);
+ TabsColorSpaces = new ObservableCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x != ColorSpaces.Volume /*&& x!= ColorSpaces.HSB*/).ToObservableCollection());
+ DefaultTabColorSpace = Settings.DefaultTabColorSpace == null ? ColorSpaces.CMYK : TabsColorSpaces.SingleOrDefault(x => x == Settings.DefaultTabColorSpace);
DefaultRML = Rmls.SingleOrDefault(x => x.Guid == Settings.DefaultRmlGuid);
SelectedSpoolType = SpoolTypes.SingleOrDefault(x => x.Guid == Settings.SpoolTypeGuid);
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>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index d72e75011..efc5f8179 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
</requestedPrivileges>
</security>
</trustInfo>