aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-07 15:39:12 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-07 15:39:12 +0200
commitbd3cb640be12621ac37253e8a8c627ae40692e4d (patch)
treecddc36bc95b966f48e1b7387fed1955504d3975b /Software/Visual_Studio/PPC/Modules
parent7a1f9f14cc50001366be0efefc25fd5af403d02e (diff)
downloadTango-bd3cb640be12621ac37253e8a8c627ae40692e4d.tar.gz
Tango-bd3cb640be12621ac37253e8a8c627ae40692e4d.zip
Some fixes and improvements for PPC & Machine Studio.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj8
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs21
2 files changed, 29 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj
index f38fe9162..fa7583e85 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj
@@ -129,6 +129,10 @@
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.Integration\Tango.Integration.csproj">
+ <Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project>
+ <Name>Tango.Integration</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\..\Tango.Logging\Tango.Logging.csproj">
<Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project>
<Name>Tango.Logging</Name>
@@ -145,6 +149,10 @@
<Project>{fd86424c-6e84-491b-8df9-3d0f5c236a2a}</Project>
<Name>Tango.Touch</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.Transport\Tango.Transport.csproj">
+ <Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project>
+ <Name>Tango.Transport</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\Tango.PPC.Common\Tango.PPC.Common.csproj">
<Project>{0be74eee-22cb-4dba-b896-793b9e1a3ac0}</Project>
<Name>Tango.PPC.Common</Name>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs
index ed35a9b2d..9ee24ad38 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs
@@ -12,6 +12,7 @@ using Tango.PPC.Common.Notifications;
using Tango.PPC.Common.Notifications.NotificationItems;
using Tango.PPC.Events.Enumerations;
using System.Data.Entity;
+using Tango.Integration.Operation;
namespace Tango.PPC.Events.ViewModels
{
@@ -98,6 +99,26 @@ namespace Tango.PPC.Events.ViewModels
var last_week = DateTime.UtcNow.AddDays(-7);
HistoryEvents = (await db.MachinesEvents.Where(x => x.MachineGuid == MachineProvider.Machine.Guid && x.DateTime > last_week).Include(x => x.EventType).Where(x => (EventTypeNotificationTimes)x.EventType.EventNotificationTime != EventTypeNotificationTimes.None).ToListAsync()).OrderByDescending(x => x.DateTime).ToObservableCollection();
}
+
+ MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged;
+ }
+
+ private void MachineOperator_StatusChanged(object sender, MachineStatuses status)
+ {
+ if (status == MachineStatuses.Disconnected)
+ {
+ foreach (var notification in _notifications.ToList())
+ {
+ NotificationProvider.PopNotification(notification.Value);
+ }
+
+ _notifications.Clear();
+
+ InvokeUI(() =>
+ {
+ CurrentEvents.Clear();
+ });
+ }
}
private void EventLogger_EventReceived(object sender, MachinesEvent ev)