aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-04-27 13:38:39 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-04-27 13:38:39 +0300
commit17ab19a3bf8d06b210bc6dc8d3af735a15b26df7 (patch)
tree441025f1fb5dfb57d64e0eb7cf1c052f41c20de9 /Software/Visual_Studio/PPC/Tango.PPC.UI
parent98b4de2ceaecb091e12145921dcb7989f839cf10 (diff)
parentaeb2abf154a5e53189aaae24a71542a56eb1f278 (diff)
downloadTango-17ab19a3bf8d06b210bc6dc8d3af735a15b26df7.tar.gz
Tango-17ab19a3bf8d06b210bc6dc8d3af735a15b26df7.zip
Merge branch 'eureka_ppc' of https://twinetfs.visualstudio.com/Tango/_git/Tango into eureka_ppc
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Build/DefaultBuildProvider.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Helpers/DpiHelper.cs36
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Icon.icobin0 -> 141840 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs40
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Manifests/eureka.xml76
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj21
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml2
9 files changed, 173 insertions, 16 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Build/DefaultBuildProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Build/DefaultBuildProvider.cs
index 8f200191b..36bb64103 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Build/DefaultBuildProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Build/DefaultBuildProvider.cs
@@ -17,12 +17,18 @@ namespace Tango.PPC.UI.Build
get { return BuildType == BuildType.Eureka; }
}
+ public string BuildName => BuildType == BuildType.Eureka ? "Eureka" : "Tango - PPC";
+
public DefaultBuildProvider()
{
+
if (App.StartupArgs != null && App.StartupArgs.Contains("eureka_build"))
{
BuildType = BuildType.Eureka;
}
+#if Eureka
+ BuildType = BuildType.Eureka;
+#endif
}
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Helpers/DpiHelper.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Helpers/DpiHelper.cs
new file mode 100644
index 000000000..0d0ac9f1e
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Helpers/DpiHelper.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.PPC.UI.Helpers
+{
+ public static class DpiHelper
+ {
+ private enum ProcessDPIAwareness
+ {
+ ProcessDPIUnaware = 0,
+ ProcessSystemDPIAware = 1,
+ ProcessPerMonitorDPIAware = 2
+ }
+
+ [DllImport("shcore.dll")]
+ private static extern int SetProcessDpiAwareness(ProcessDPIAwareness value);
+
+ public static void SetDpiAwareness()
+ {
+ try
+ {
+ if (Environment.OSVersion.Version.Major >= 6)
+ {
+ SetProcessDpiAwareness(ProcessDPIAwareness.ProcessPerMonitorDPIAware);
+ }
+ }
+ catch (EntryPointNotFoundException)//this exception occures if OS does not implement this API, just ignore it.
+ {
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Icon.ico b/Software/Visual_Studio/PPC/Tango.PPC.UI/Icon.ico
new file mode 100644
index 000000000..069f03569
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Icon.ico
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
index b7f6c40ae..db154f464 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
@@ -21,6 +21,7 @@ using Tango.Core.DI;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Build;
using Tango.PPC.UI.Build;
+using Tango.PPC.UI.Helpers;
using Tango.Touch.Helpers;
namespace Tango.PPC.UI
@@ -60,6 +61,8 @@ namespace Tango.PPC.UI
private void InitEureka()
{
+ Title = "Eureka";
+
Viewbox viewBox = new Viewbox();
viewBox.Stretch = Stretch.Uniform;
this.Content = viewBox;
@@ -68,17 +71,32 @@ namespace Tango.PPC.UI
var screens = System.Windows.Forms.Screen.AllScreens;
var touch_screen = screens.Last();
- WindowStyle = WindowStyle.SingleBorderWindow;
- ResizeMode = ResizeMode.CanResize;
- Width = 1280;
- Height = 720;
- WindowStartupLocation = WindowStartupLocation.CenterScreen;
- WindowState = WindowState.Normal;
- Topmost = false; // sure?
- //Left = touch_screen.Bounds.Left;
- //Top = touch_screen.Bounds.Top;
- //Width = touch_screen.Bounds.Width;
- //Height = touch_screen.Bounds.Height;
+
+ bool hasTouch = TouchHelper.IsTouchEnabled();
+
+ if (!hasTouch)
+ {
+ WindowStyle = WindowStyle.SingleBorderWindow;
+ ResizeMode = ResizeMode.CanResize;
+ Width = 1280;
+ Height = 720;
+ WindowStartupLocation = WindowStartupLocation.CenterScreen;
+ WindowState = WindowState.Normal;
+ Topmost = false; // sure?
+ }
+ else
+ {
+ WindowState = WindowState.Normal;
+ WindowStyle = WindowStyle.None;
+ ResizeMode = ResizeMode.NoResize;
+ Left = screens.Length == 2 ? screens[0].Bounds.Width : 0;
+ Top = 0;
+ Width = 1920;
+ Height = 1080;
+ WindowStartupLocation = WindowStartupLocation.Manual;
+ Topmost = false; // sure?
+ }
+
//App.Current.Resources["TangoPanelMaskColor"] = App.Current.Resources["TangoPanelMaskColorLight"];
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Manifests/eureka.xml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Manifests/eureka.xml
new file mode 100644
index 000000000..efc5f8179
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Manifests/eureka.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+ <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+ <!-- UAC Manifest Options
+ If you want to change the Windows User Account Control level replace the
+ requestedExecutionLevel node with one of the following.
+
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
+
+ Specifying requestedExecutionLevel element will disable file and registry virtualization.
+ Remove this element if your application requires this virtualization for backwards
+ compatibility.
+ -->
+ <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- A list of the Windows versions that this application has been tested on
+ and is designed to work with. Uncomment the appropriate elements
+ and Windows will automatically select the most compatible environment. -->
+
+ <!-- Windows Vista -->
+ <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
+
+ <!-- Windows 7 -->
+ <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
+
+ <!-- Windows 8 -->
+ <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
+
+ <!-- Windows 8.1 -->
+ <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
+
+ <!-- Windows 10 -->
+ <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
+
+ </application>
+ </compatibility>
+
+ <!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
+ DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
+ to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
+ also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
+ <!--
+ <application xmlns="urn:schemas-microsoft-com:asm.v3">
+ <windowsSettings>
+ <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+ </windowsSettings>
+ </application>
+ -->
+
+ <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
+ <!--
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="*"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+ </dependency>
+ -->
+
+</assembly>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
index 7a5c51646..00fd8c0e0 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -256,7 +256,7 @@ namespace Tango.PPC.UI.PPCApplication
//Start watchdog
_watchdogServer = new WatchDogServer(Application.Current.Dispatcher);
-#if !DEBUG
+#if (!DEBUG && !Eureka)
if (settings.EnableWatchDog)
{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
index 7266a0d10..ea6532b3d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
@@ -50,9 +50,21 @@
<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>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
+ <PropertyGroup>
+ <ApplicationIcon>Icon.ico</ApplicationIcon>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll</HintPath>
@@ -205,6 +217,7 @@
</Compile>
<Compile Include="Dialogs\FirmwareUpgradeFromFileViewVM.cs" />
<Compile Include="Dialogs\UpdateFromFileViewVM.cs" />
+ <Compile Include="Helpers\DpiHelper.cs" />
<Compile Include="InternalModule.cs" />
<Compile Include="Modules\DefaultPPCModuleLoader.cs" />
<Compile Include="Navigation\DefaultNavigationManager.cs" />
@@ -570,6 +583,8 @@
<Resource Include="Images\Job Issues\Machine outline.png" />
<Resource Include="Images\Menu\restart_t.png" />
<Resource Include="Images\Menu\Power_image.png" />
+ <Resource Include="Manifests\eureka.xml" />
+ <Resource Include="Icon.ico" />
<Content Include="Manifests\release.xml" />
<Content Include="Manifests\debug.xml" />
<None Include="firmware_package.tfp">
@@ -868,8 +883,11 @@ RD /S /Q "$(TargetDir)ProtoCompilers\"
RD /S /Q "$(TargetDir)Packages\ProtoCompilers\"
if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)x86\"
if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)x64\"
+if $(ConfigurationName) == Eureka RD /S /Q "$(TargetDir)x86\"
+if $(ConfigurationName) == Eureka RD /S /Q "$(TargetDir)x64\"
if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)lib\"
+if $(ConfigurationName) == Eureka RD /S /Q "$(TargetDir)lib\"
copy /Y "$(SolutionDir)Referenced Assemblies\mscoree.dll" "$(TargetDir)"
copy /Y "$(SolutionDir)Referenced Assemblies\msvcp140d.dll" "$(TargetDir)"
@@ -879,10 +897,13 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)"
copy /Y "$(SolutionDir)Referenced Assemblies\Microsoft.WITDataStore32.dll" "$(TargetDir)"
if $(ConfigurationName) == Release del "$(TargetDir)firmware_package.tfp"
+if $(ConfigurationName) == Eureka del "$(TargetDir)firmware_package.tfp"
if $(ConfigurationName) == Release del *.xml
+if $(ConfigurationName) == Eureka del *.xml
if $(ConfigurationName) == Release del WebRtc.NET.pdb
+if $(ConfigurationName) == Eureka del WebRtc.NET.pdb
if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)"
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml
index d827205f8..a2d0d5930 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutEurekaView.xaml
@@ -204,8 +204,8 @@
</Grid>
</Grid>
- <Grid Background="Gainsboro" Grid.Column="2" Width="1260" Height="1280">
- <Viewbox >
+ <Grid Background="Gainsboro" Grid.Column="2">
+ <Viewbox>
<local:MachineStatusView />
</Viewbox>
</Grid>
@@ -213,7 +213,7 @@
<Grid Grid.Column="1" Background="{StaticResource TangoPrimaryBackgroundBrush}">
<Grid>
<!--<Viewbox>-->
- <touch:TouchPanelEureka Width="800" Height="1280"
+ <touch:TouchPanelEureka Margin="0 -40 0 0" Width="900" Height="1445"
HasMessageBox="{Binding NotificationProvider.HasMessageBox}"
CurrentMessageBox="{Binding NotificationProvider.CurrentMessageBox}"
HasDialog="{Binding NotificationProvider.HasDialog}"
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
index 234af2312..f667593a7 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
@@ -164,7 +164,7 @@
</DataTemplate>
</UserControl.Resources>
- <Grid Width="1260" Height="1280">
+ <Grid Width="1246" Height="1400">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32"></ColumnDefinition>
<ColumnDefinition Width="1*"></ColumnDefinition>