diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-01-27 08:54:39 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-01-27 08:54:39 +0200 |
| commit | e204e6ac5d04114778b5b836a3e3707e819ad349 (patch) | |
| tree | 0eb03bfd253cf6f26c72b2f4ccb08b9e03369b5a /Software/Visual_Studio/PPC/Tango.PPC.Common | |
| parent | 558c9c58a8be65c2a8430a21de857b335efee491 (diff) | |
| download | Tango-e204e6ac5d04114778b5b836a3e3707e819ad349.tar.gz Tango-e204e6ac5d04114778b5b836a3e3707e819ad349.zip | |
X1 Closure.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
10 files changed, 177 insertions, 11 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsX1ToBooleanConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsX1ToBooleanConverter.cs new file mode 100644 index 000000000..ae90fe55d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsX1ToBooleanConverter.cs @@ -0,0 +1,39 @@ +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 IsX1ToBooleanConverter : IValueConverter + { + private static IBuildProvider _buildProvider = null; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (_buildProvider == null) + { + _buildProvider = TangoIOC.Default.GetInstance<IBuildProvider>(); + } + + return _buildProvider.BuildType == BuildType.Eureka && _buildProvider.IsX1; + } + catch + { + return false; + } + } + + 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/IsX1ToBooleanInverseConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsX1ToBooleanInverseConverter.cs new file mode 100644 index 000000000..32243f13d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsX1ToBooleanInverseConverter.cs @@ -0,0 +1,39 @@ +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 IsX1ToBooleanInverseConverter : IValueConverter + { + private static IBuildProvider _buildProvider = null; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (_buildProvider == null) + { + _buildProvider = TangoIOC.Default.GetInstance<IBuildProvider>(); + } + + return _buildProvider.BuildType == BuildType.Eureka && !_buildProvider.IsX1; + } + catch + { + return true; + } + } + + 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/IsX1ToVisibilityConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsX1ToVisibilityConverter.cs new file mode 100644 index 000000000..a96b75a90 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsX1ToVisibilityConverter.cs @@ -0,0 +1,40 @@ +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 IsX1ToVisibilityConverter : IValueConverter + { + private static IBuildProvider _buildProvider = null; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (_buildProvider == null) + { + _buildProvider = TangoIOC.Default.GetInstance<IBuildProvider>(); + } + + return (_buildProvider.BuildType == BuildType.Eureka && _buildProvider.IsX1) ? Visibility.Visible : Visibility.Hidden; + } + catch + { + return Visibility.Hidden; + } + } + + 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/IsX1ToVisibilityInverseConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsX1ToVisibilityInverseConverter.cs new file mode 100644 index 000000000..f8a5dc1ea --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/IsX1ToVisibilityInverseConverter.cs @@ -0,0 +1,40 @@ +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 IsX1ToVisibilityInverseConverter : IValueConverter + { + private static IBuildProvider _buildProvider = null; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (_buildProvider == null) + { + _buildProvider = TangoIOC.Default.GetInstance<IBuildProvider>(); + } + + return (_buildProvider.BuildType == BuildType.Eureka && _buildProvider.IsX1) ? Visibility.Hidden : Visibility.Visible; + } + catch + { + return 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/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs index 0d64da83e..77ad07ea7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -258,7 +258,7 @@ namespace Tango.PPC.Common.MachineSetup LogManager.Log($"Sending setup request...\n{request.ToJsonString()}"); setup_response = await _client.MachineSetup(request); - if (_buildProvider.IsEureka) + if (_buildProvider.MachineType.IsXMachine()) { setup_response.SetupActivation = false; setup_response.SetupUWF = false; 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 51c78e0f0..5f8933fc6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteDesktop/DefaultRemoteDesktopService.cs @@ -115,7 +115,7 @@ namespace Tango.PPC.Common.RemoteDesktop { var mainWindow = System.Windows.Application.Current.MainWindow; - if (_buildProvider.IsEureka) + if (_buildProvider.MachineType.IsXMachine()) { _engine.CaptureRegion = new CaptureRegion() { @@ -480,7 +480,7 @@ namespace Tango.PPC.Common.RemoteDesktop } else { - _engine.EnableComparer = !_buildProvider.IsEureka; + _engine.EnableComparer = !_buildProvider.MachineType.IsXMachine(); foreach (var client in _clients.ToList().Where(x => !x.InitialPacketSent)) { @@ -502,13 +502,13 @@ namespace Tango.PPC.Common.RemoteDesktop } } - if (e.Frame.DifferenceCount > 0 || _buildProvider.IsEureka) + if (e.Frame.DifferenceCount > 0 || _buildProvider.MachineType.IsXMachine()) { RemoteDesktopPacket packet = null; Point mousePosition = new Point(System.Windows.Forms.Cursor.Position.X, System.Windows.Forms.Cursor.Position.Y); - if (!e.Frame.DifferenceAvailable || _buildProvider.IsEureka) + if (!e.Frame.DifferenceAvailable || _buildProvider.MachineType.IsXMachine()) { packet = new RemoteDesktopPacket() { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs index b42a3206c..3c892aad4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteJob/DefaultRemoteJobService.cs @@ -62,7 +62,7 @@ namespace Tango.PPC.Common.RemoteJob RemoteJobInputOutput inputOutput = new RemoteJobInputOutput(); - if (_clients.Count > 0 && _buildProvider.IsEureka) + if (_clients.Count > 0 && _buildProvider.MachineType.IsXMachine()) { inputOutput = GetCurrentJobInputOutput(); } @@ -96,7 +96,7 @@ namespace Tango.PPC.Common.RemoteJob var currentProgress = GetJobProgress(_handler); RemoteJobInputOutput inputOutput = new RemoteJobInputOutput(); - if (_clients.Count > 0 && _buildProvider.IsEureka) + if (_clients.Count > 0 && _buildProvider.MachineType.IsXMachine()) { inputOutput = GetCurrentJobInputOutput(); } @@ -162,7 +162,7 @@ namespace Tango.PPC.Common.RemoteJob { var inputOutput = new RemoteJobInputOutput(); - if (_inputOutputProvider == null && _buildProvider.IsEureka) + if (_inputOutputProvider == null && _buildProvider.MachineType.IsXMachine()) { _inputOutputProvider = TangoIOC.Default.GetInstance<IRemoteJobInputOutputProvider>(); } 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 da4e63b51..db3093b41 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -74,6 +74,10 @@ <localConverter:IsEurekaToBooleanConverter x:Key="IsEurekaToBooleanConverter" /> <localConverter:BuildTypeToVisibilityConverter x:Key="BuildTypeToVisibilityConverter" /> <localConverter:BuildTypeToVisibilityInverseConverter x:Key="BuildTypeToVisibilityInverseConverter" /> + <localConverter:IsX1ToBooleanConverter x:Key="IsX1ToBooleanConverter" /> + <localConverter:IsX1ToBooleanInverseConverter x:Key="IsX1ToBooleanInverseConverter" /> + <localConverter:IsX1ToVisibilityConverter x:Key="IsX1ToVisibilityConverter" /> + <localConverter:IsX1ToVisibilityInverseConverter x:Key="IsX1ToVisibilityInverseConverter" /> <Style TargetType="FrameworkElement"> <Setter Property="TextElement.FontFamily" Value="{StaticResource TangoFlexoFontFamily}"></Setter> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resume/DefaultJobResumeManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resume/DefaultJobResumeManager.cs index 4c4e3f169..18c899fd3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resume/DefaultJobResumeManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resume/DefaultJobResumeManager.cs @@ -29,7 +29,7 @@ namespace Tango.PPC.Common.Resume private void MachineOperator_PrintingEnded(object sender, PrintingEventArgs e) { - if (_buildProvider.IsEureka) + if (_buildProvider.MachineType.IsXMachine()) { UpdateJobResume(e); } 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 72dc58685..fc5db5a2d 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 @@ -66,7 +66,7 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'X1_Debug|AnyCPU' "> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'X1_Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> @@ -204,6 +204,10 @@ <Compile Include="Converters\HeightToOpacityConverter.cs" /> <Compile Include="Converters\BuildTypeToVisibilityInverseConverter.cs" /> <Compile Include="Converters\BuildTypeToVisibilityConverter.cs" /> + <Compile Include="Converters\IsX1ToVisibilityInverseConverter.cs" /> + <Compile Include="Converters\IsX1ToVisibilityConverter.cs" /> + <Compile Include="Converters\IsX1ToBooleanInverseConverter.cs" /> + <Compile Include="Converters\IsX1ToBooleanConverter.cs" /> <Compile Include="Converters\IsEurekaToBooleanConverter.cs" /> <Compile Include="DataStore\DefaultDataStoreService.cs" /> <Compile Include="DataStore\IDataStoreService.cs" /> @@ -668,7 +672,7 @@ </Target> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
