aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-05-26 17:03:25 +0300
committerAvi Levkovich <avi@twine-s.com>2020-05-26 17:03:25 +0300
commitfd326204404ee0932ea465efcdd41e21fd7f2b49 (patch)
treeffb38ac74dc86490a8581539cba7094452cb6ed6 /Software/Visual_Studio/PPC/Tango.PPC.Common
parentf0fc1abe6628c903d2e58dcd1b1a88ef43d45057 (diff)
parent7102ed21905bc52c6aee506e919992ce1f98f641 (diff)
downloadTango-fd326204404ee0932ea465efcdd41e21fd7f2b49.tar.gz
Tango-fd326204404ee0932ea465efcdd41e21fd7f2b49.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarItem.cs10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarPriority.cs15
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs23
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj3
8 files changed, 51 insertions, 21 deletions
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 9fe6d24bd..84190d373 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
@@ -100,10 +100,11 @@ namespace Tango.PPC.Common.Connection
MachineOperator = new MachineOperator();
MachineOperator.StatusChanged += MachineOperator_StatusChanged;
MachineOperator.EnableEventsNotification = true;
- MachineOperator.EnableJobResume = true;
+ MachineOperator.EnableJobResume = false;
MachineOperator.UseKeepAlive = true;
MachineOperator.EnableMachineStatusUpdates = true;
MachineOperator.EnableDiagnostics = true;
+ MachineOperator.EnablePowerUpSequence = true;
MachineOperator.EnableEmbeddedDebugging = settings.EnableEmbeddedDebugLogs;
MachineOperator.EnableAutomaticThreadLoading = settings.EnableAutomaticThreadLoading;
MachineOperator.JobRunsLogger.JobSource = BL.Enumerations.JobSource.Local;
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 ae77c26d0..29bffb945 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
@@ -973,7 +973,7 @@ namespace Tango.PPC.Common.MachineUpdate
if (!_machineProvider.MachineOperator.CanPrint)
{
- throw LogManager.Log(new InvalidOperationException($"Could not perform an update while the machine is in {_machineProvider.MachineOperator} status."));
+ throw LogManager.Log(new InvalidOperationException($"Could not perform an update while the machine is in {_machineProvider.MachineOperator.Status} status."));
}
UpdateProgress("Updating Database", "Initializing...");
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarItem.cs
index 1c47d2a97..fdd66a56b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarItem.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarItem.cs
@@ -13,6 +13,16 @@ namespace Tango.PPC.Common.Notifications
/// </summary>
public abstract class AppBarItem : ItemBase
{
+ private AppBarPriority _priority;
+ public AppBarPriority Priority
+ {
+ get { return _priority; }
+ set { _priority = value; RaisePropertyChangedAuto(); }
+ }
+ public AppBarItem()
+ {
+ Priority = AppBarPriority.Normal;
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarPriority.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarPriority.cs
new file mode 100644
index 000000000..bd8547f5d
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarPriority.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.PPC.Common.Notifications
+{
+ public enum AppBarPriority
+ {
+ Low,
+ Normal,
+ High
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
index 4a0627d70..950b8d23f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
@@ -34,14 +34,14 @@ namespace Tango.PPC.Common.Notifications
ObservableCollection<TaskBarItem> TaskBarItems { get; }
/// <summary>
- /// Gets the current application bar item.
+ /// Gets the application bar items.
/// </summary>
- AppBarItem CurrentAppBarItem { get; }
+ ObservableCollection<AppBarItem> AppBarItems { get; }
/// <summary>
- /// Gets a value indicating whether this instance has application bar item.
+ /// Gets a value indicating whether this instance has any application bar items.
/// </summary>
- bool HasAppBarItem { get; }
+ bool HasAppBarItems { get; }
/// <summary>
/// Gets a value indicating whether this instance has notification items.
@@ -182,7 +182,7 @@ namespace Tango.PPC.Common.Notifications
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
- AppBarItem PushAppBarItem<T>() where T : AppBarItem;
+ T PushAppBarItem<T>() where T : AppBarItem;
/// <summary>
/// Pops the application bar item.
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs
index 46315e4b8..5f097d303 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs
@@ -21,7 +21,7 @@ namespace Tango.PPC.Common.Storage
public class DefaultStorageProvider : ExtendedObject, IStorageProvider
{
private Thread _scanThread;
- private Dictionary<String, Action<ExplorerFileItem>> _fileHandlers;
+ private Dictionary<String, Action<List<ExplorerFileItem>>> _fileHandlers;
/// <summary>
/// Occurs when a new storage drive has been inserted.
@@ -58,7 +58,7 @@ namespace Tango.PPC.Common.Storage
/// </summary>
public DefaultStorageProvider(IPPCApplicationManager applicationManager)
{
- _fileHandlers = new Dictionary<string, Action<ExplorerFileItem>>();
+ _fileHandlers = new Dictionary<string, Action<List<ExplorerFileItem>>>();
var drives = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Removable).ToList();
if (drives.Count > 0)
@@ -86,7 +86,7 @@ namespace Tango.PPC.Common.Storage
/// <param name="extension">The file extension.</param>
/// <param name="handler">The handler.</param>
/// <exception cref="System.InvalidOperationException">Cannot register multiple file handlers for the same extension.</exception>
- public void RegisterFileHandler(string extension, Action<ExplorerFileItem> handler)
+ public void RegisterFileHandler(string extension, Action<List<ExplorerFileItem>> handler)
{
if (_fileHandlers.ContainsKey(extension))
{
@@ -99,7 +99,7 @@ namespace Tango.PPC.Common.Storage
/// Unregisters the file handler.
/// </summary>
/// <param name="handler">The handler.</param>
- public void UnregisterFileHandler(Action<ExplorerFileItem> handler)
+ public void UnregisterFileHandler(Action<List<ExplorerFileItem>> handler)
{
var h = _fileHandlers.SingleOrDefault(x => x.Value == handler);
@@ -112,14 +112,17 @@ namespace Tango.PPC.Common.Storage
/// <summary>
/// Submits a file selection.
/// </summary>
- /// <param name="fileItem">The file item.</param>
- public void SubmitFileSelection(ExplorerFileItem fileItem)
+ /// <param name="fileItems">The file item.</param>
+ public void SubmitFileSelection(List<ExplorerFileItem> fileItems)
{
- String extension = Path.GetExtension(fileItem.Path);
-
- if (_fileHandlers.ContainsKey(extension))
+ if (fileItems != null && fileItems.Count > 0)
{
- _fileHandlers[extension].Invoke(fileItem);
+ String extension = Path.GetExtension(fileItems.First().Path);
+
+ if (_fileHandlers.ContainsKey(extension))
+ {
+ _fileHandlers[extension].Invoke(fileItems);
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs
index 902021002..2a9cf4e90 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs
@@ -38,18 +38,18 @@ namespace Tango.PPC.Common.Storage
/// </summary>
/// <param name="extension">The file extension.</param>
/// <param name="handler">The handler.</param>
- void RegisterFileHandler(String extension, Action<ExplorerFileItem> handler);
+ void RegisterFileHandler(String extension, Action<List<ExplorerFileItem>> handler);
/// <summary>
/// Unregisters the file handler.
/// </summary>
/// <param name="handler">The handler.</param>
- void UnregisterFileHandler(Action<ExplorerFileItem> handler);
+ void UnregisterFileHandler(Action<List<ExplorerFileItem>> handler);
/// <summary>
/// Submits a file selection.
/// </summary>
/// <param name="fileItem">The file item.</param>
- void SubmitFileSelection(ExplorerFileItem fileItem);
+ void SubmitFileSelection(List<ExplorerFileItem> fileItems);
}
}
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 9bdba2c63..14c1a54ff 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
@@ -168,6 +168,7 @@
<Compile Include="MachineSetup\MachineSetupManager.cs" />
<Compile Include="MachineSetup\MachineSetupProgress.cs" />
<Compile Include="MachineSetup\MachineSetupResult.cs" />
+ <Compile Include="Notifications\AppBarPriority.cs" />
<Compile Include="Performance\DefaultPerformanceService.cs" />
<Compile Include="Performance\IPerformanceService.cs" />
<Compile Include="RemoteDesktop\DefaultRemoteDesktopService.cs" />
@@ -462,7 +463,7 @@
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file