aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels
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.UI/ViewModels
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.UI/ViewModels')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs12
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs42
2 files changed, 50 insertions, 4 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
index 965584767..54a92aa5c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
@@ -408,8 +408,12 @@ namespace Tango.PPC.UI.ViewModels
#region Handle USB Update
- private async void HandleSoftwareUpdatePackageLoaded(ExplorerFileItem fileItem)
+ private async void HandleSoftwareUpdatePackageLoaded(List<ExplorerFileItem> fileItems)
{
+ var fileItem = fileItems.FirstOrDefault();
+
+ if (fileItem == null) return;
+
PublishInfo packageFile = null;
LogManager.Log("TUP file loaded from storage...");
@@ -456,8 +460,12 @@ namespace Tango.PPC.UI.ViewModels
}
}
- private async void HandleFirmwareUpgradeLoaded(ExplorerFileItem fileItem)
+ private async void HandleFirmwareUpgradeLoaded(List<ExplorerFileItem> fileItems)
{
+ var fileItem = fileItems.FirstOrDefault();
+
+ if (fileItem == null) return;
+
LogManager.Log("TFP file loaded from storage...");
VersionPackageDescriptor packageInfo;
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 b53a54682..e84fd81a1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
@@ -21,6 +21,7 @@ using Tango.PPC.Common.WatchDog;
using Tango.PPC.UI.Dialogs;
using Tango.SharedUI;
using System.Data.Entity;
+using Tango.PPC.UI.AppBarItems;
namespace Tango.PPC.UI.ViewModels
{
@@ -33,6 +34,7 @@ namespace Tango.PPC.UI.ViewModels
private DispatcherTimer _date_timer;
private bool _isPowerUpDialogShown;
private bool _isThreadLoadingShown;
+ private PowerUpAppBarItem _powerUpAppBar;
private DateTime _currentDateTime;
/// <summary>
@@ -64,11 +66,47 @@ namespace Tango.PPC.UI.ViewModels
{
base.OnApplicationReady();
MachineProvider.MachineOperator.CartridgeValidationRequestReceived += MachineOperator_CartridgeValidationRequestReceived;
- MachineProvider.MachineOperator.PowerUpStarted += MachineOperator_PowerUpStarted;
+ MachineProvider.MachineOperator.FirmwareStarted += MachineOperator_FirmwareStarted;
MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged;
MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired += MachineOperator_ThreadLoadingConfirmationRequired;
+
+ MachineProvider.MachineOperator.PowerUpStarted += MachineOperator_PowerUpStarted;
+ MachineProvider.MachineOperator.PowerUpProgress += MachineOperator_PowerUpProgress;
+ MachineProvider.MachineOperator.PowerUpEnded += MachineOperator_PowerUpEnded;
+ }
+
+ #region Power Up
+
+ private void MachineOperator_PowerUpEnded(object sender, EventArgs e)
+ {
+ _powerUpAppBar?.Close();
+ _powerUpAppBar = null;
+ }
+
+ private void MachineOperator_PowerUpProgress(object sender, PMR.Power.StartPowerUpResponse status)
+ {
+ if (_powerUpAppBar != null)
+ {
+ _powerUpAppBar.Status = status;
+ }
}
+ private void MachineOperator_PowerUpStarted(object sender, PMR.Power.StartPowerUpResponse e)
+ {
+ InvokeUI(() =>
+ {
+ if (_powerUpAppBar != null)
+ {
+ _powerUpAppBar.Close();
+ }
+
+ _powerUpAppBar = NotificationProvider.PushAppBarItem<PowerUpAppBarItem>();
+ _powerUpAppBar.Priority = AppBarPriority.Low;
+ });
+ }
+
+ #endregion
+
#region Event Handlers
/// <summary>
@@ -101,7 +139,7 @@ namespace Tango.PPC.UI.ViewModels
});
}
- private async void MachineOperator_PowerUpStarted(object sender, EventArgs e)
+ private async void MachineOperator_FirmwareStarted(object sender, EventArgs e)
{
if (_isPowerUpDialogShown)
{