diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-04 21:28:54 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-04 21:28:54 +0300 |
| commit | a78e489a56f09eb6a0a3ffa557e602ee8c7e67a2 (patch) | |
| tree | 60e56ad07660e911c69daef3fa93a53417e131ab /Software/Visual_Studio/PPC | |
| parent | 525cb05b5ab2c7168599d01d298d187a763d6b3c (diff) | |
| parent | a42e9713125bc9675b2978031244918c11c6e956 (diff) | |
| download | Tango-a78e489a56f09eb6a0a3ffa557e602ee8c7e67a2.tar.gz Tango-a78e489a56f09eb6a0a3ffa557e602ee8c7e67a2.zip | |
Merge
Diffstat (limited to 'Software/Visual_Studio/PPC')
8 files changed, 62 insertions, 56 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 fa78430bd..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 @@ -432,7 +432,7 @@ namespace Tango.PPC.Jobs.ViewModels { await Task.Delay(200); } - var selectedRmlGuid = Settings.DefaultRmlGuid; + var selectedRmlGuid = Settings.DefaultRmlGuid ?? _rmls.First().Guid; Job job = new Job(); job.LastUpdated = DateTime.UtcNow; job.JobSource = JobSource.Local; @@ -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) { @@ -715,9 +715,9 @@ namespace Tango.PPC.Jobs.ViewModels using (ObservablesContext db = ObservablesContext.CreateDefault()) { _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(); - _rmls = (await new RmlsCollectionBuilder(db).SetAll().WithSpools().BuildAsync()).OrderBy(x => x.FinalName).ToObservableCollection(); - _spoolTypes = db.SpoolTypes.ToObservableCollection(); + _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 = 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/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 56e42453f..1a7c11764 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyVersion("2.0.1.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainEurekaView.xaml index 9bd5df3e8..1646cf6dd 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainEurekaView.xaml @@ -29,29 +29,23 @@ </i:Interaction.Triggers> <Grid> + <touch:TouchPanelEurekaNoKeyboard> - <controls:NavigationControl TransitionAlwaysFades="True" KeepElementsAttached="False" UseDefferedRendering="True" TransitionType="Zoom" x:Name="NavigationControl" x:FieldModifier="public"> - <local:LoadingView></local:LoadingView> - <local:LoadingErrorView></local:LoadingErrorView> - <local:NoPermissionsView></local:NoPermissionsView> - <local:LoginView></local:LoginView> - <local:LayoutEurekaView controls:NavigationControl.NavigationName="LayoutView"></local:LayoutEurekaView> - <local:ExternalBridgeView></local:ExternalBridgeView> - <local:MachineSetupView></local:MachineSetupView> - <local:MachineUpdateView></local:MachineUpdateView> - <local:RestartingSystemView></local:RestartingSystemView> - <local:EmergencyView></local:EmergencyView> - <local:RestartingView></local:RestartingView> - </controls:NavigationControl> + <controls:NavigationControl TransitionAlwaysFades="True" KeepElementsAttached="False" UseDefferedRendering="True" TransitionType="Zoom" x:Name="NavigationControl" x:FieldModifier="public"> + <local:LoadingView></local:LoadingView> + <local:LoadingErrorView></local:LoadingErrorView> + <local:NoPermissionsView></local:NoPermissionsView> + <local:LoginView></local:LoginView> + <local:LayoutEurekaView controls:NavigationControl.NavigationName="LayoutView"></local:LayoutEurekaView> + <local:ExternalBridgeView></local:ExternalBridgeView> + <local:MachineSetupView></local:MachineSetupView> + <local:MachineUpdateView></local:MachineUpdateView> + <local:RestartingSystemView></local:RestartingSystemView> + <local:EmergencyView></local:EmergencyView> + <local:RestartingView></local:RestartingView> + </controls:NavigationControl> - </Grid> - - <Grid Visibility="{Binding IsScreenSaverOn,Converter={StaticResource BooleanToVisibilityConverter}}" Background="Black"> - <i:Interaction.Triggers> - <i:EventTrigger EventName="PreviewMouseUp"> - <i:InvokeCommandAction Command="{Binding ScreenSaverExitCommand}" /> - </i:EventTrigger> - </i:Interaction.Triggers> + </touch:TouchPanelEurekaNoKeyboard> </Grid> </Grid> </UserControl> 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> |
