aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-05-01 13:06:41 +0300
committerRoy <Roy.mail.net@gmail.com>2023-05-01 13:06:41 +0300
commitfacb4fd1efd3f14ee7256dc09882b0330cc7ab7f (patch)
tree75226f2d2b1cd837a77bd691876b3faef78d48a0 /Software/Visual_Studio/PPC
parent6b3aa886b9db72881abb1f45fda7b28ab5c6ab03 (diff)
downloadTango-facb4fd1efd3f14ee7256dc09882b0330cc7ab7f.tar.gz
Tango-facb4fd1efd3f14ee7256dc09882b0330cc7ab7f.zip
Eureka adjustments.
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs13
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Build/DefaultBuildProvider.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Manifests/eureka.xml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs7
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs8
14 files changed, 75 insertions, 16 deletions
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 45fd6c1b8..a897c806c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
@@ -32,6 +32,7 @@ using Tango.SharedUI.Helpers;
using Tango.SQLExaminer;
using Tango.Transport.Web;
using System.Data.Entity;
+using Tango.PPC.Common.Build;
namespace Tango.PPC.Common.MachineSetup
{
@@ -45,6 +46,7 @@ namespace Tango.PPC.Common.MachineSetup
private IRemoteAssistanceProvider _remoteAssistance;
private IUnifiedWriteFilterManager _uwf;
private IOperationSystemManager _windows_manager;
+ private IBuildProvider _buildProvider;
private PPCWebClient _client;
private List<LogItemBase> _logs;
private bool _isUpdating;
@@ -81,12 +83,13 @@ namespace Tango.PPC.Common.MachineSetup
/// Initializes a new instance of the <see cref="MachineSetupManager"/> class.
/// </summary>
/// <param name="remoteAssistance">The remote assistance.</param>
- public MachineSetupManager(PPCWebClient ppcWebClient, IRemoteAssistanceProvider remoteAssistance, IUnifiedWriteFilterManager unifiedWriterFilterManager, IOperationSystemManager operationSystemManager)
+ public MachineSetupManager(PPCWebClient ppcWebClient, IRemoteAssistanceProvider remoteAssistance, IUnifiedWriteFilterManager unifiedWriterFilterManager, IOperationSystemManager operationSystemManager, IBuildProvider buildProvider)
{
_client = ppcWebClient;
_remoteAssistance = remoteAssistance;
_uwf = unifiedWriterFilterManager;
_windows_manager = operationSystemManager;
+ _buildProvider = buildProvider;
_logs = new List<LogItemBase>();
LogManager.NewLog += LogManager_NewLog;
@@ -235,7 +238,7 @@ namespace Tango.PPC.Common.MachineSetup
Login(serialNumber).Wait();
- String deviceName = $"Tango-{serialNumber}-{settings.DeploymentSlot.ToString()}";
+ String deviceName = $"{(_buildProvider.BuildType == BuildType.TS1800 ? "PPC" : "TwineX4")}{serialNumber}{settings.DeploymentSlot.ToString()}";
LogManager.Log($"Settings device name: '{deviceName}'...");
try
{
@@ -254,6 +257,15 @@ namespace Tango.PPC.Common.MachineSetup
{
LogManager.Log($"Sending setup request...\n{request.ToJsonString()}");
setup_response = await _client.MachineSetup(request);
+
+ if (_buildProvider.IsEureka)
+ {
+ setup_response.SetupActivation = false;
+ setup_response.SetupFirmware = false;
+ setup_response.SetupFPGA = false;
+ setup_response.SetupUWF = false;
+ setup_response.SetupRemoteAssistance = false;
+ }
}
catch (Exception ex)
{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
index c5412e591..64ca496f7 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
@@ -37,6 +37,7 @@ using Tango.BL.DTO;
using Tango.PPC.Shared.Updates;
using Tango.PPC.Shared.RemoteUpgrade;
using Tango.Core.Threading;
+using Tango.PPC.Common.Build;
namespace Tango.PPC.Common.MachineUpdate
{
@@ -45,6 +46,7 @@ namespace Tango.PPC.Common.MachineUpdate
private IPPCApplicationManager _app_manager;
private IMachineProvider _machineProvider;
private IPackageRunner _packageRunner;
+ private IBuildProvider _buildProvider;
private PPCWebClient _client;
private List<LogItemBase> _logs;
private System.Timers.Timer _checkForUpdateTimer;
@@ -101,13 +103,14 @@ namespace Tango.PPC.Common.MachineUpdate
/// Initializes a new instance of the <see cref="MachineUpdateManager"/> class.
/// </summary>
/// <param name="applicationManager">The application manager.</param>
- public MachineUpdateManager(PPCWebClient ppcWebClient, IPPCApplicationManager applicationManager, IMachineProvider machineProvider, IPackageRunner packageRunner, IPPCExternalBridgeService externalBridge)
+ public MachineUpdateManager(PPCWebClient ppcWebClient, IPPCApplicationManager applicationManager, IMachineProvider machineProvider, IPackageRunner packageRunner, IPPCExternalBridgeService externalBridge, IBuildProvider buildProvider)
{
_client = ppcWebClient;
_machineProvider = machineProvider;
_app_manager = applicationManager;
_app_manager.ApplicationReady += _app_manager_ApplicationReady;
_packageRunner = packageRunner;
+ _buildProvider = buildProvider;
_packageRunner.PackageProgress += _packageRunner_PackageProgress;
_logs = new List<LogItemBase>();
@@ -658,6 +661,12 @@ namespace Tango.PPC.Common.MachineUpdate
/// <exception cref="System.InvalidProgramException">Database tango does not exists.</exception>
public async Task<MachineUpdateResult> Update(bool setupFirmware, bool setupFPGA)
{
+ if (_buildProvider.IsEureka)
+ {
+ setupFirmware = false;
+ setupFPGA = false;
+ }
+
_updateStartDate = DateTime.UtcNow;
_logs.Clear();
@@ -702,7 +711,7 @@ namespace Tango.PPC.Common.MachineUpdate
}
}
- if (!op.CanPrint)
+ if (op.Status == MachineStatuses.Printing || op.Status == MachineStatuses.GettingReady)
{
throw LogManager.Log(new InvalidOperationException($"Could not perform an update while the machine is in {op.Status} status."));
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
index 6fb521838..c45aad51e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
@@ -350,6 +350,11 @@ namespace Tango.PPC.Common
public double FineTuningMinLimitdL { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether to force full screen mode on TwineX4.
+ /// </summary>
+ public bool ForceTouchMode { get; set; }
+
+ /// <summary>
/// Gets the machine service address.
/// </summary>
/// <returns></returns>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs
index 983868c2c..03a004e6a 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs
@@ -28,6 +28,8 @@ namespace Tango.PPC.Common.Publish
/// </summary>
public event EventHandler<PublishProgressEventArgs> PublishProgress;
+ public bool IsEureka { get; set; }
+
private PublishOptions _options;
/// <summary>
/// Gets or sets the publish options.
@@ -200,7 +202,7 @@ namespace Tango.PPC.Common.Publish
String output_folder = Options.InstallerOutputFolder;
OnPublishProgress(0, 100, $"Building installer project...");
InstallerBuilder installerBuilder = new InstallerBuilder(Options.InstallerProject);
- String installer_name = $"PPC Installer_v{Version.Parse(local_version).ToString(3) + (Options.Tag.IsNotNullOrEmpty() ? $" [{Options.Tag}]" : String.Empty)}.exe";
+ String installer_name = $"{(IsEureka ? "TwineX4" : "PPC")} Installer_v{Version.Parse(local_version).ToString(3) + (Options.Tag.IsNotNullOrEmpty() ? $" [{Options.Tag}]" : String.Empty)}.exe";
String output_file = Path.Combine(output_folder, installer_name);
installerBuilder.Build(local_version, output_file).Wait();
@@ -432,7 +434,9 @@ namespace Tango.PPC.Common.Publish
var cuf = zip.AddFile(update_config_file, update_dir);
cuf.FileName = update_dir + "\\config.xml";
- zip.AddDirectory(folder + "\\" + "Packages", "/Packages");
+ String packagesFolder = folder + "\\" + "Packages";
+ Directory.CreateDirectory(packagesFolder);
+ zip.AddDirectory(packagesFolder, "/Packages");
foreach (var file in Directory.GetFiles(folder, "*.*", SearchOption.TopDirectoryOnly))
{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml
index 5697f2027..1c730bd9f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindow.xaml
@@ -57,6 +57,7 @@
<ComboBox Margin="20 0 0 0" SelectedItem="{Binding Options.BuildConfig}" SelectedIndex="0">
<sys:String>Release</sys:String>
<sys:String>Debug</sys:String>
+ <sys:String>Eureka</sys:String>
</ComboBox>
</DockPanel>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs
index 983845673..39d8c9b18 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher.UI/MainWindowVM.cs
@@ -145,6 +145,7 @@ namespace Tango.PPC.Publisher.UI
Options = settings.Options;
_publisher = new PPCPublisher(Options);
+ _publisher.IsEureka = IsEureka;
_publisher.PublishProgress += _publisher_PublishProgress;
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 36bb64103..599447c95 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Build/DefaultBuildProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Build/DefaultBuildProvider.cs
@@ -17,7 +17,7 @@ namespace Tango.PPC.UI.Build
get { return BuildType == BuildType.Eureka; }
}
- public string BuildName => BuildType == BuildType.Eureka ? "Eureka" : "Tango - PPC";
+ public string BuildName => BuildType == BuildType.Eureka ? "Twine X4" : "PPC";
public DefaultBuildProvider()
{
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 db154f464..92c527134 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs
@@ -18,10 +18,12 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Tango.Core.DI;
+using Tango.PPC.Common;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Build;
using Tango.PPC.UI.Build;
using Tango.PPC.UI.Helpers;
+using Tango.Settings;
using Tango.Touch.Helpers;
namespace Tango.PPC.UI
@@ -61,7 +63,9 @@ namespace Tango.PPC.UI
private void InitEureka()
{
- Title = "Eureka";
+ Title = "Twine X4";
+
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
Viewbox viewBox = new Viewbox();
viewBox.Stretch = Stretch.Uniform;
@@ -72,7 +76,7 @@ namespace Tango.PPC.UI
var touch_screen = screens.Last();
- bool hasTouch = TouchHelper.IsTouchEnabled();
+ bool hasTouch = TouchHelper.IsTouchEnabled() || settings.ForceTouchMode;
if (!hasTouch)
{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Manifests/eureka.xml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Manifests/eureka.xml
index efc5f8179..d72e75011 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Manifests/eureka.xml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Manifests/eureka.xml
@@ -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>
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 00fd8c0e0..0f65f833e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -38,6 +38,7 @@ using Tango.Insights;
using System.Threading;
using System.Reflection;
using Tango.PPC.UI.ViewsContracts;
+using Tango.PPC.Common.Build;
namespace Tango.PPC.UI.PPCApplication
{
@@ -56,6 +57,7 @@ namespace Tango.PPC.UI.PPCApplication
private IPPCModuleLoader _moduleLoader;
private INotificationProvider _notificationProvider;
private IMachineDataSynchronizer _machineDataSynchronizer;
+ private IBuildProvider _buildProvider;
private WatchDogServer _watchdogServer;
private ObservablesContext _machineContext;
private ActionTimer _screenLockTimer;
@@ -202,7 +204,7 @@ namespace Tango.PPC.UI.PPCApplication
/// <summary>
/// Initializes a new instance of the <see cref="DefaultPPCApplicationManager"/> class.
/// </summary>
- public DefaultPPCApplicationManager(IMachineProvider machineProvider, IDispatcherProvider dispatcherProvider, IEventLogger eventLogger, IPPCModuleLoader moduleLoader, INotificationProvider notificationProvider, IMachineDataSynchronizer machineDataSynchronizer)
+ public DefaultPPCApplicationManager(IMachineProvider machineProvider, IDispatcherProvider dispatcherProvider, IEventLogger eventLogger, IPPCModuleLoader moduleLoader, INotificationProvider notificationProvider, IMachineDataSynchronizer machineDataSynchronizer, IBuildProvider buildProvider)
{
StartPath = AssemblyHelper.GetCurrentAssemblyFolder();
@@ -212,6 +214,7 @@ namespace Tango.PPC.UI.PPCApplication
_eventLogger = eventLogger;
_moduleLoader = moduleLoader;
_machineDataSynchronizer = machineDataSynchronizer;
+ _buildProvider = buildProvider;
if (!DesignMode)
{
@@ -290,7 +293,7 @@ namespace Tango.PPC.UI.PPCApplication
settings.ApplicationState = ApplicationStates.Ready;
settings.Save();
- if (isAfterSetup)
+ if (isAfterSetup && !_buildProvider.IsEureka)
{
SystemRestartRequired?.Invoke(this, new EventArgs());
return;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs
index cce7d277b..6d99c1ff8 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs
@@ -306,7 +306,14 @@ namespace Tango.PPC.UI.ViewModels
if (connected)
{
- await NavigateTo(MachineSetupView.TimeZoneView);
+ if (BuildProvider.IsEureka)
+ {
+ await NavigateTo(MachineSetupView.EnvironmentView);
+ }
+ else
+ {
+ await NavigateTo(MachineSetupView.TimeZoneView);
+ }
}
else
{
@@ -346,7 +353,12 @@ namespace Tango.PPC.UI.ViewModels
{
_ppcWebClient.Environment = DeploymentSlot;
}
- await _operationSystemManager.ChangeTimeZone(SelectedTimeZone);
+
+ if (!BuildProvider.IsEureka)
+ {
+ await _operationSystemManager.ChangeTimeZone(SelectedTimeZone);
+ }
+
_setup_result = await MachineSetupManager.Setup(SerialNumber);
State = MachineSetupStates.Completed;
LogManager.Log("Machine setup completed.");
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
index 50f4ed054..9b47cf390 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
@@ -328,7 +328,7 @@ namespace Tango.PPC.UI.ViewModels
{
_screenSaverTimer.Interval = TimeSpan.FromMinutes(Settings.ScreenSaverStartDuration).TotalMilliseconds;
- if (Settings.EnableScreenSaver && !MachineProvider.IsConnected)
+ if (Settings.EnableScreenSaver && !MachineProvider.IsConnected && !BuildProvider.IsEureka)
{
IsScreenSaverOn = true;
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index efc5f8179..d72e75011 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>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs
index 3a1e85373..01f96c619 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs
@@ -389,6 +389,14 @@ namespace Tango.PPC.Updater
/// </summary>
public static bool IsTouchEnabled()
{
+ const int MAXTOUCHES_INDEX = 95;
+ int maxTouches = GetSystemMetrics(MAXTOUCHES_INDEX);
+
+ if (maxTouches > 0)
+ {
+ return true;
+ }
+
foreach (TabletDevice tabletDevice in Tablet.TabletDevices)
{
if (tabletDevice.Type == TabletDeviceType.Touch && !String.IsNullOrWhiteSpace(tabletDevice.Name))