aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-16 13:47:20 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-16 13:47:20 +0300
commitfdfa740288568dba27877a5ef5c817be323cfbb0 (patch)
tree933ee1cb2769d43c982596f50ff8b7ec791f3be7 /Software/Visual_Studio
parentd376387fa28a2091a21e2fc7193812d1f8a40ef2 (diff)
downloadTango-fdfa740288568dba27877a5ef5c817be323cfbb0.tar.gz
Tango-fdfa740288568dba27877a5ef5c817be323cfbb0.zip
Working on PPC.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs18
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs15
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml71
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/INavigationManager.cs18
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs13
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml13
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs31
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml9
-rw-r--r--Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs23
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs12
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs9
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs5
-rw-r--r--Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs66
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs61
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs8
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml2
-rw-r--r--Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml1
18 files changed, 305 insertions, 72 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt
index d9710b5fc..53eb632e9 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt
@@ -1 +1 @@
-Sun 07/15/2018 18:18:51.73
+Mon 07/16/2018 10:23:46.28
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
index c9e48c03f..92c9b4b94 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
@@ -506,7 +506,7 @@ namespace Tango.PPC.Jobs.ViewModels
/// </summary>
public async override void OnNavigatedTo()
{
- if (_job_to_load == null) return;
+ if (_job_to_load == null || (_job_to_load != null && Job != null && _job_to_load.Guid == Job.Guid)) return;
NotificationProvider.SetGlobalBusyMessage("Loading job details...");
@@ -552,13 +552,15 @@ namespace Tango.PPC.Jobs.ViewModels
if (!_can_navigate_back)
{
- result = await NotificationProvider.ShowQuestion("Are you sure you want to exit this job?");
- }
-
- if (result)
- {
- Job = null;
- SegmentsCollectionView = null;
+ if (await NotificationProvider.ShowQuestion("Are you sure you want to exit this job?"))
+ {
+ Job = null;
+ SegmentsCollectionView = null;
+ }
+ else
+ {
+ result = false;
+ }
}
return result;
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs
index 53fe73bd5..5b49aedf1 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs
@@ -15,15 +15,24 @@ namespace Tango.PPC.Jobs.ViewModels
public override void OnApplicationStarted()
{
MachineProvider.MachineOperator.PrintingCompleted += MachineOperator_PrintingCompleted;
+ MachineProvider.MachineOperator.PrintingFailed += MachineOperator_PrintingFailed;
}
- private void MachineOperator_PrintingCompleted(object sender, Integration.Operation.PrintingEventArgs e)
+ private void MachineOperator_PrintingFailed(object sender, Integration.Operation.PrintingFailedEventArgs e)
{
- NotificationProvider.PushNotification(new MessageNotificationItem("Job completed successfully.", MessageNotificationItem.MessageNotificationItemTypes.Success, () =>
+ NotificationProvider.PushNotification(new MessageNotificationItem(String.Format("Job failed. ({0})", e.Exception.Message), MessageNotificationItem.MessageNotificationItemTypes.Error, () =>
{
-
NavigationManager.NavigateWithObject<JobsModule, JobView, Job>(e.Job);
+ NavigationManager.ClearHistoryExcept<JobsView>();
+ }));
+ }
+ private void MachineOperator_PrintingCompleted(object sender, Integration.Operation.PrintingEventArgs e)
+ {
+ NotificationProvider.PushNotification(new MessageNotificationItem("Job completed successfully.", MessageNotificationItem.MessageNotificationItemTypes.Success, () =>
+ {
+ NavigationManager.NavigateWithObject<JobsModule, JobView, Job>(e.Job);
+ NavigationManager.ClearHistoryExcept<JobsView>();
}));
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml
index e707b3550..56fbcd9a7 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobProgressView.xaml
@@ -21,7 +21,24 @@
<TextBlock FontSize="{StaticResource TangoHeaderFontSize}" HorizontalAlignment="Center" Text="{Binding Job.Name,FallbackValue='Job Name'}"></TextBlock>
<Grid Margin="0 80 0 0">
- <touch:TouchRingProgress Width="364" Height="364" Maximum="{Binding RunningJobStatus.TotalProgress}" Value="{Binding RunningJobStatus.Progress}" RingThickness="10" />
+ <touch:TouchRingProgress Width="364" Height="364" Maximum="{Binding RunningJobStatus.TotalProgress}" Value="{Binding RunningJobStatus.Progress}" RingThickness="10">
+ <touch:TouchRingProgress.Style>
+ <Style TargetType="touch:TouchRingProgress">
+ <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RunningJobStatus.IsCompleted}" Value="True">
+ <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding RunningJobStatus.IsCanceled}" Value="True">
+ <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding RunningJobStatus.IsFailed}" Value="True">
+ <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </touch:TouchRingProgress.Style>
+ </touch:TouchRingProgress>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
@@ -60,8 +77,52 @@
</MultiBinding>
</Canvas.Left>
<StackPanel Margin="-50 0 0 0">
- <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">now dying</TextBlock>
- <touch:TouchIcon Margin="0 8 0 0" HorizontalAlignment="Center" Icon="Water" Angle="180" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="40" Height="40" />
+ <ContentControl>
+ <ContentControl.Style>
+ <Style TargetType="ContentControl">
+ <Setter Property="Content">
+ <Setter.Value>
+ <StackPanel>
+ <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">now dying</TextBlock>
+ <touch:TouchIcon Margin="0 8 0 0" HorizontalAlignment="Center" Icon="Water" Angle="180" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="40" Height="40" />
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RunningJobStatus.IsCanceled}" Value="True">
+ <Setter Property="Content">
+ <Setter.Value>
+ <StackPanel>
+ <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">job canceled</TextBlock>
+ <touch:TouchIcon Margin="0 8 0 0" HorizontalAlignment="Center" Icon="Alert" Foreground="{StaticResource TangoWarningBrush}" Width="40" Height="40" />
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding RunningJobStatus.IsFailed}" Value="True">
+ <Setter Property="Content">
+ <Setter.Value>
+ <StackPanel>
+ <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">job failed</TextBlock>
+ <touch:TouchIcon Margin="0 8 0 0" HorizontalAlignment="Center" Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="40" Height="40" />
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding RunningJobStatus.IsCompleted}" Value="True">
+ <Setter Property="Content">
+ <Setter.Value>
+ <StackPanel>
+ <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">job completed</TextBlock>
+ <touch:TouchIcon Margin="0 8 0 0" HorizontalAlignment="Center" Icon="Check" Foreground="{StaticResource TangoSuccessBrush}" Width="40" Height="40" />
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </ContentControl.Style>
+ </ContentControl>
</StackPanel>
</StackPanel>
</Canvas>
@@ -75,6 +136,10 @@
</Grid>
</StackPanel>
</Grid>
+
+ <touch:TouchButton Margin="0 100 0 0" Style="{StaticResource TangoLinkButton}" Height="60" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding RunningJobStatus.IsCompleted,Converter={StaticResource BooleanToVisibilityConverter}}">
+ Go to job
+ </touch:TouchButton>
</StackPanel>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/INavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/INavigationManager.cs
index 249a917de..94a2e8d35 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/INavigationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Navigation/INavigationManager.cs
@@ -12,9 +12,17 @@ namespace Tango.PPC.Common.Navigation
/// </summary>
public interface INavigationManager
{
+ /// <summary>
+ /// Gets the current module.
+ /// </summary>
IPPCModule CurrentModule { get; }
/// <summary>
+ /// Gets the current view model.
+ /// </summary>
+ PPCViewModel CurrentVM { get; }
+
+ /// <summary>
/// Gets a value indicating whether the navigation system is able to navigate to the previous view.
/// </summary>
bool CanNavigateBack { get; }
@@ -86,5 +94,15 @@ namespace Tango.PPC.Common.Navigation
/// <returns></returns>
Task<bool> NavigateWithObject<TModule, TView, TPass>(TPass obj, bool pushToHistory = true)
where TModule : IPPCModule;
+
+ /// <summary>
+ /// Clears the navigation back history.
+ /// </summary>
+ void ClearHistory();
+
+ /// <summary>
+ /// Clears the navigation back history except the specified view type.
+ /// </summary>
+ void ClearHistoryExcept<T>();
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs
index 2f74024f3..1fdf0c729 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs
@@ -14,6 +14,19 @@ namespace Tango.PPC.Common.Notifications
/// </summary>
public abstract class NotificationItem : ItemBase
{
+ private bool _isExpanded;
+ /// <summary>
+ /// Gets or sets a value indicating whether the notification panel is expanded.
+ /// </summary>
+ public bool IsExpanded
+ {
+ get { return _isExpanded; }
+ set { _isExpanded = value; RaisePropertyChangedAuto(); }
+ }
+
+ /// <summary>
+ /// Called when the item has been pressed.
+ /// </summary>
protected override void OnPreesed()
{
base.OnPreesed();
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml
index b049dc108..fa26bce83 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml
@@ -49,7 +49,18 @@
</Style>
</touch:TouchIcon.Style>
</touch:TouchIcon>
- <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Text="{Binding Message}"></TextBlock>
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Text="{Binding Message}" TextTrimming="CharacterEllipsis">
+ <TextBlock.Style>
+ <Style TargetType="TextBlock">
+ <Setter Property="TextWrapping" Value="NoWrap"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsExpanded}" Value="True">
+ <Setter Property="TextWrapping" Value="Wrap"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
</DockPanel>
</ContentControl>
</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
index 47450a68e..f06bd88de 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
@@ -34,6 +34,14 @@ namespace Tango.PPC.UI.Navigation
private Stack<String> _navigationHistory;
+ /// <summary>
+ /// Gets the current view model.
+ /// </summary>
+ public PPCViewModel CurrentVM
+ {
+ get { return _currentVM as PPCViewModel; }
+ }
+
private IPPCModule _currentModule;
/// <summary>
/// Gets or sets the current module.
@@ -339,5 +347,28 @@ namespace Tango.PPC.UI.Navigation
return false;
}
}
+
+ /// <summary>
+ /// Clears the navigation back history.
+ /// </summary>
+ public void ClearHistory()
+ {
+ _navigationHistory.Clear();
+ RaisePropertyChanged(nameof(CanNavigateBack));
+ }
+
+ public void ClearHistoryExcept<T>()
+ {
+ var history_list = _navigationHistory.ToList();
+ history_list = history_list.Where(x => x.Contains(typeof(T).Name)).Distinct().ToList();
+ _navigationHistory.Clear();
+
+ foreach (var item in history_list)
+ {
+ _navigationHistory.Push(item);
+ }
+
+ RaisePropertyChanged(nameof(CanNavigateBack));
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
index f333ea2e8..1ce18bff1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
@@ -23,15 +23,16 @@
CurrentMessageBox="{Binding NotificationProvider.CurrentMessageBox}"
HasNotifications="{Binding NotificationProvider.HasNotificationItems}"
Notifications="{Binding NotificationProvider.NotificationItems}"
+ ItemExpandedPropertyPath="IsExpanded"
HasDialog="{Binding NotificationProvider.HasDialog}"
CurrentDialog="{Binding NotificationProvider.CurrentDialog}">
<touch:TouchPanel.NotificationTemplate>
<DataTemplate>
<touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="0" Command="{Binding PressedCommand}">
- <Grid>
- <ContentControl Content="{Binding Converter={StaticResource NotificationItemConverter}}" />
- <touch:TouchIconButton Background="Transparent" Padding="20" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="60" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="White" />
- </Grid>
+ <DockPanel>
+ <touch:TouchIconButton DockPanel.Dock="Right" Background="Transparent" Padding="20" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="60" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="White" />
+ <ContentControl Content="{Binding Converter={StaticResource NotificationItemConverter}}"/>
+ </DockPanel>
</touch:TouchButton>
</DataTemplate>
</touch:TouchPanel.NotificationTemplate>
diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs
index 135727735..9c5bc78e1 100644
--- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs
+++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs
@@ -143,4 +143,27 @@ public static class ObjectExtensions
return obj.ToString();
}
}
+
+ /// <summary>
+ /// Sets the property value by the specified path (e.g DateTime.Date.Days).
+ /// </summary>
+ /// <param name="obj">The object.</param>
+ /// <param name="propertyPath">The property path.</param>
+ /// <returns></returns>
+ public static void SetPropertyValueByPath(this object obj, String propertyPath, object value)
+ {
+ if (propertyPath != null)
+ {
+ if (propertyPath.Contains('.'))
+ {
+ string[] Split = propertyPath.Split('.');
+ string RemainingProperty = propertyPath.Substring(propertyPath.IndexOf('.') + 1);
+ SetPropertyValueByPath(obj.GetType().GetProperty(Split[0]).GetValue(obj, null), RemainingProperty, value);
+ }
+ else
+ {
+ obj.GetType().GetProperty(propertyPath).SetValue(obj, value);
+ }
+ }
+ }
}
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
index bdbfacca5..b9198d2e9 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
@@ -154,6 +154,9 @@ namespace Tango.Integration.Operation
/// <param name="ex">The ex.</param>
internal void RaiseFailed(Exception ex)
{
+ Status.IsFailed = true;
+ StatusChanged?.Invoke(this, Status);
+ RaisePropertyChanged(nameof(Status));
Failed?.Invoke(this, ex);
Stopped?.Invoke(this, new EventArgs());
}
@@ -163,6 +166,9 @@ namespace Tango.Integration.Operation
/// </summary>
internal void RaiseCompleted()
{
+ Status.IsCompleted = true;
+ StatusChanged?.Invoke(this, Status);
+ RaisePropertyChanged(nameof(Status));
Completed?.Invoke(this, new EventArgs());
Stopped?.Invoke(this, new EventArgs());
}
@@ -172,10 +178,13 @@ namespace Tango.Integration.Operation
/// </summary>
internal void RaiseCanceled()
{
+ Status.IsCanceled = true;
+ StatusChanged?.Invoke(this, Status);
+ RaisePropertyChanged(nameof(Status));
Canceled?.Invoke(this, new EventArgs());
Stopped?.Invoke(this, new EventArgs());
}
-
+
#endregion
#region Private Methods
@@ -279,7 +288,6 @@ namespace Tango.Integration.Operation
/// </summary>
public void Cancel()
{
- Status.Progress = 0;
_cancelAction();
}
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index fd37ca8c0..d7851544c 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -65,7 +65,7 @@ namespace Tango.Integration.Operation
{
DeviceInformation = new DeviceInformation();
MachineEventsStateProvider = new DefaultMachineEventsStateProvider();
- EnableEmbeddedDebugging = true;
+ EnableEmbeddedDebugging = false;
LogEmbeddedDebuggingToFile = true;
}
@@ -155,6 +155,7 @@ namespace Tango.Integration.Operation
OnMachineStatusChanged(value);
RaisePropertyChanged(nameof(IsPrinting));
RaisePropertyChanged(nameof(CanPrint));
+ LogManager.Log("Machine operator status changed: " + _status);
}
}
@@ -343,7 +344,7 @@ namespace Tango.Integration.Operation
LogRequestSent(request);
}
- else
+ else if (_diagnosticsSent)
{
_diagnosticsSent = false;
@@ -407,7 +408,7 @@ namespace Tango.Integration.Operation
LogRequestSent(request);
}
- else
+ else if (_debugSent)
{
_debugSent = false;
@@ -793,7 +794,7 @@ namespace Tango.Integration.Operation
{
if (!handler.IsCanceled)
{
- Status = MachineStatuses.Error;
+ Status = MachineStatuses.ReadyToDye;
PrintingFailed?.Invoke(this, new PrintingFailedEventArgs(handler, originalJob, ex));
handler.RaiseFailed(ex);
LogRequestFailed(request, ex);
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs b/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs
index f9ce1d4ae..c690f27ea 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/RunningJobStatus.cs
@@ -67,6 +67,11 @@ namespace Tango.Integration.Operation
public bool IsCompleted { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether this instance is failed.
+ /// </summary>
+ public bool IsFailed { get; set; }
+
+ /// <summary>
/// Gets or sets the message.
/// </summary>
public String Message { get; set; }
diff --git a/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs
index a00e17320..e14e338b8 100644
--- a/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs
+++ b/Software/Visual_Studio/Tango.PMR/Diagnostics/DiagnosticsMonitors.cs
@@ -139,7 +139,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(10);
private readonly pbc::RepeatedField<double> dancer1Angle_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dancer 1 (Min = 0, Max = 255, PPF = 10)
+ ///Dancer 1 (Min = 0, Max = 16384, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dancer1Angle {
@@ -152,7 +152,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(18);
private readonly pbc::RepeatedField<double> dancer2Angle_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dancer 2 (Min = 0, Max = 1200, PPF = 1)
+ ///Dancer 2 (Min = 0, Max = 16384, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dancer2Angle {
@@ -165,7 +165,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(26);
private readonly pbc::RepeatedField<double> dancer3Angle_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dancer 3 (Min = 0, Max = 1200, PPF = 1)
+ ///Dancer 3 (Min = 0, Max = 16384, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dancer3Angle {
@@ -178,7 +178,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(34);
private readonly pbc::RepeatedField<double> feederMotorFrequency_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Feeder Motor (Min = 0, Max = 100, PPF = 1)
+ ///Feeder Motor (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> FeederMotorFrequency {
@@ -191,7 +191,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(42);
private readonly pbc::RepeatedField<double> dryerMotor_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dryer Motor (Min = 0, Max = 100, PPF = 1)
+ ///Dryer Motor (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> DryerMotor {
@@ -204,7 +204,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(50);
private readonly pbc::RepeatedField<double> pollerMotor_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Poller Motor (Min = 0, Max = 100, PPF = 1)
+ ///Poller Motor (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> PollerMotor {
@@ -217,7 +217,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(58);
private readonly pbc::RepeatedField<double> winderMotor_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Winder Motor (Min = 0, Max = 100, PPF = 1)
+ ///Winder Motor (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> WinderMotor {
@@ -230,7 +230,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(66);
private readonly pbc::RepeatedField<double> screwMotor_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Screw Motor (Min = 0, Max = 100, PPF = 1)
+ ///Screw Motor (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> ScrewMotor {
@@ -243,7 +243,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(74);
private readonly pbc::RepeatedField<double> threadSpeed_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Thread Speed (Min = 0, Max = 100, PPF = 1)
+ ///Thread Speed (Min = 0, Max = 100, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> ThreadSpeed {
@@ -256,7 +256,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(82);
private readonly pbc::RepeatedField<double> mixerTemperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Mixer (Min = 0, Max = 100, PPF = 1)
+ ///Mixer (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> MixerTemperature {
@@ -269,7 +269,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(90);
private readonly pbc::RepeatedField<double> headZone1Temperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Head Zone 1 (Min = 0, Max = 100, PPF = 1)
+ ///Head Zone 1 (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> HeadZone1Temperature {
@@ -282,7 +282,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(98);
private readonly pbc::RepeatedField<double> headZone2Temperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Head Zone 2 (Min = 0, Max = 100, PPF = 1)
+ ///Head Zone 2 (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> HeadZone2Temperature {
@@ -295,7 +295,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(106);
private readonly pbc::RepeatedField<double> headZone3Temperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Head Zone 3 (Min = 0, Max = 100, PPF = 1)
+ ///Head Zone 3 (Min = 0, Max = 100, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> HeadZone3Temperature {
@@ -321,7 +321,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(122);
private readonly pbc::RepeatedField<double> feederTension_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Feeder Tension (Min = 0, Max = 100, PPF = 1)
+ ///Feeder Tension (Min = 0, Max = 100, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> FeederTension {
@@ -334,7 +334,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(130);
private readonly pbc::RepeatedField<double> pullerTension_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Puller Tension (Min = 0, Max = 100, PPF = 1)
+ ///Puller Tension (Min = 0, Max = 100, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> PullerTension {
@@ -347,7 +347,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(138);
private readonly pbc::RepeatedField<double> dryerZone1Temperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dryer Zone 1 (Min = 0, Max = 100, PPF = 1)
+ ///Dryer Zone 1 (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> DryerZone1Temperature {
@@ -360,7 +360,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(146);
private readonly pbc::RepeatedField<double> dryerZone2Temperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dryer Zone 2 (Min = 0, Max = 100, PPF = 1)
+ ///Dryer Zone 2 (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> DryerZone2Temperature {
@@ -373,7 +373,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(154);
private readonly pbc::RepeatedField<double> dryerZone3Temperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dryer Zone 3 (Min = 0, Max = 100, PPF = 1)
+ ///Dryer Zone 3 (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> DryerZone3Temperature {
@@ -386,7 +386,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(162);
private readonly pbc::RepeatedField<double> dryerAirFlow_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dryer Air Flow (Min = 0, Max = 100, PPF = 1)
+ ///Dryer Air Flow (Min = 0, Max = 100, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> DryerAirFlow {
@@ -399,7 +399,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(170);
private readonly pbc::RepeatedField<double> winderTension_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Winder Tension (Min = 0, Max = 100, PPF = 1)
+ ///Winder Tension (Min = 0, Max = 100, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> WinderTension {
@@ -412,7 +412,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForMessage(178, global::Tango.PMR.Diagnostics.DoubleArray.Parser);
private readonly pbc::RepeatedField<global::Tango.PMR.Diagnostics.DoubleArray> dispensersMotorsFrequency_ = new pbc::RepeatedField<global::Tango.PMR.Diagnostics.DoubleArray>();
/// <summary>
- ///Dispensers Motors (Min = 0, Max = 1080, PPF = 10) Channel Count = 8
+ ///Dispensers Motors (Min = 0, Max = 100000, PPF = 10) Channel Count = 8
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tango.PMR.Diagnostics.DoubleArray> DispensersMotorsFrequency {
@@ -490,7 +490,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(226);
private readonly pbc::RepeatedField<double> chillerTemperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Chiller Temperature (Min = 0, Max = 100, PPF = 1)
+ ///Chiller Temperature (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> ChillerTemperature {
@@ -503,7 +503,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(234);
private readonly pbc::RepeatedField<double> dispenser1MotorFrequency_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dispenser 1 Motor Frequency (Min = 0, Max = 1080, PPF = 10)
+ ///Dispenser 1 Motor Frequency (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dispenser1MotorFrequency {
@@ -516,7 +516,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(242);
private readonly pbc::RepeatedField<double> dispenser2MotorFrequency_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dispenser 2 Motor Frequency (Min = 0, Max = 1080, PPF = 10)
+ ///Dispenser 2 Motor Frequency (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dispenser2MotorFrequency {
@@ -529,7 +529,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(250);
private readonly pbc::RepeatedField<double> dispenser3MotorFrequency_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dispenser 3 Motor Frequency (Min = 0, Max = 1080, PPF = 10)
+ ///Dispenser 3 Motor Frequency (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dispenser3MotorFrequency {
@@ -542,7 +542,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(258);
private readonly pbc::RepeatedField<double> dispenser4MotorFrequency_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dispenser 4 Motor Frequency (Min = 0, Max = 1080, PPF = 10)
+ ///Dispenser 4 Motor Frequency (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dispenser4MotorFrequency {
@@ -555,7 +555,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(266);
private readonly pbc::RepeatedField<double> dispenser5MotorFrequency_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dispenser 5 Motor Frequency (Min = 0, Max = 1080, PPF = 10)
+ ///Dispenser 5 Motor Frequency (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dispenser5MotorFrequency {
@@ -568,7 +568,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(274);
private readonly pbc::RepeatedField<double> dispenser6MotorFrequency_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dispenser 6 Motor Frequency (Min = 0, Max = 1080, PPF = 10)
+ ///Dispenser 6 Motor Frequency (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dispenser6MotorFrequency {
@@ -581,7 +581,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(282);
private readonly pbc::RepeatedField<double> dispenser7MotorFrequency_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dispenser 7 Motor Frequency (Min = 0, Max = 1080, PPF = 10)
+ ///Dispenser 7 Motor Frequency (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dispenser7MotorFrequency {
@@ -594,7 +594,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(290);
private readonly pbc::RepeatedField<double> dispenser8MotorFrequency_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Dispenser 8 Motor Frequency (Min = 0, Max = 1080, PPF = 10)
+ ///Dispenser 8 Motor Frequency (Min = 0, Max = 100000, PPF = 100)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> Dispenser8MotorFrequency {
@@ -607,7 +607,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(298);
private readonly pbc::RepeatedField<double> headZone4Temperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Head Zone 4 (Min = 0, Max = 100, PPF = 1)
+ ///Head Zone 4 (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> HeadZone4Temperature {
@@ -620,7 +620,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(306);
private readonly pbc::RepeatedField<double> headZone5Temperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Head Zone 5 (Min = 0, Max = 100, PPF = 1)
+ ///Head Zone 5 (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> HeadZone5Temperature {
@@ -633,7 +633,7 @@ namespace Tango.PMR.Diagnostics {
= pb::FieldCodec.ForDouble(314);
private readonly pbc::RepeatedField<double> headZone6Temperature_ = new pbc::RepeatedField<double>();
/// <summary>
- ///Head Zone 6 (Min = 0, Max = 100, PPF = 1)
+ ///Head Zone 6 (Min = 0, Max = 300, PPF = 10)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> HeadZone6Temperature {
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs
index d2a935fe1..b58158fd0 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs
@@ -15,6 +15,7 @@ using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using System.Windows.Threading;
using Tango.Core.EventArguments;
namespace Tango.Touch.Controls
@@ -27,6 +28,9 @@ namespace Tango.Touch.Controls
private Point _downLocation;
private TouchDevice _touchDevice;
private double _last_manipulation_delta;
+ private DateTime _last_delta_measure_time;
+ private double _last_mouse_y;
+
private Border border_notifications;
private Grid grid_container;
@@ -36,6 +40,14 @@ namespace Tango.Touch.Controls
DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchNotificationBar), new FrameworkPropertyMetadata(typeof(TouchNotificationBar)));
}
+ public String ItemExpandedPropertyPath
+ {
+ get { return (String)GetValue(ItemExpandedPropertyPathProperty); }
+ set { SetValue(ItemExpandedPropertyPathProperty, value); }
+ }
+ public static readonly DependencyProperty ItemExpandedPropertyPathProperty =
+ DependencyProperty.Register("ItemExpandedPropertyPath", typeof(String), typeof(TouchNotificationBar), new PropertyMetadata(null));
+
public double MinNotificationHeight
{
get { return (double)GetValue(MinNotificationHeightProperty); }
@@ -104,19 +116,9 @@ namespace Tango.Touch.Controls
border_notifications.RegisterForMouseOrTouchMove(GridNotificationMouseMove);
border_notifications.RegisterForPreviewMouseOrTouchUp(GridNotificationMouseUp);
- border_notifications.ManipulationDelta += Border_notifications_ManipulationDelta;
-
border_notifications.SizeChanged += Border_notifications_SizeChanged;
}
- private void Border_notifications_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
- {
- if (e.DeltaManipulation.Translation.Y != 0)
- {
- _last_manipulation_delta = e.DeltaManipulation.Translation.Y;
- }
- }
-
private void Border_notifications_SizeChanged(object sender, SizeChangedEventArgs e)
{
double maxPadding = 150;
@@ -155,6 +157,14 @@ namespace Tango.Touch.Controls
border_notifications.MaxHeight = this.ActualHeight;
ani.To = this.ActualHeight;
border_notifications.BeginAnimation(Grid.HeightProperty, ani);
+
+ if (ItemExpandedPropertyPath != null)
+ {
+ foreach (var item in Notifications)
+ {
+ item.SetPropertyValueByPath(ItemExpandedPropertyPath, true);
+ }
+ }
}
private void CloseNotifications()
@@ -180,6 +190,14 @@ namespace Tango.Touch.Controls
tAni.Duration = TimeSpan.FromSeconds(0.3);
tAni.To = new Thickness(0);
border_notifications.BeginAnimation(Border.BorderThicknessProperty, tAni);
+
+ if (ItemExpandedPropertyPath != null)
+ {
+ foreach (var item in Notifications)
+ {
+ item.SetPropertyValueByPath(ItemExpandedPropertyPath, false);
+ }
+ }
}
private void GridNotificationMouseUp(object sender, MouseOrTouchEventArgs e)
@@ -203,11 +221,11 @@ namespace Tango.Touch.Controls
DoubleAnimation ani = new DoubleAnimation();
ani.Duration = TimeSpan.FromSeconds(0.2);
- if (e.GetPosition(this).Y > ActualHeight / 2 || _last_manipulation_delta > 20)
+ if ((e.GetPosition(this).Y > ActualHeight / 2 && _last_manipulation_delta > 0) || _last_manipulation_delta > 20)
{
OpenNotifications();
}
- else if (e.GetPosition(this).Y < ActualHeight / 2 || _last_manipulation_delta < 20)
+ else if ((e.GetPosition(this).Y < ActualHeight / 2 && _last_manipulation_delta < 0) || _last_manipulation_delta < 20)
{
CloseNotifications();
}
@@ -225,6 +243,22 @@ namespace Tango.Touch.Controls
if (_isMoving)
{
+ DateTime curTime = DateTime.Now;
+
+ if (curTime > _last_delta_measure_time.AddMilliseconds(10))
+ {
+ _last_delta_measure_time = curTime;
+
+ double delta = e.Location.Y - _last_mouse_y;
+
+ if (delta != 0)
+ {
+ _last_manipulation_delta = delta;
+ }
+
+ _last_mouse_y = e.Location.Y;
+ }
+
if (e.TouchDevice != null)
{
border_notifications.CaptureTouch(e.TouchDevice);
@@ -255,6 +289,9 @@ namespace Tango.Touch.Controls
{
_mouseDownLocation = new Point(e.Location.X, border_notifications.MaxHeight - e.Location.Y);
_downLocation = e.Location;
+ _last_mouse_y = _downLocation.Y;
+ _last_delta_measure_time = DateTime.Now;
+ _last_manipulation_delta = 0;
_isMouseDown = true;
}
}
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs
index ad09349c3..756dc3cac 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs
@@ -162,6 +162,14 @@ namespace Tango.Touch.Controls
public static readonly DependencyProperty NotificationTemplateProperty =
DependencyProperty.Register("NotificationTemplate", typeof(DataTemplate), typeof(TouchPanel), new PropertyMetadata(null));
+ public String ItemExpandedPropertyPath
+ {
+ get { return (String)GetValue(ItemExpandedPropertyPathProperty); }
+ set { SetValue(ItemExpandedPropertyPathProperty, value); }
+ }
+ public static readonly DependencyProperty ItemExpandedPropertyPathProperty =
+ DependencyProperty.Register("ItemExpandedPropertyPath", typeof(String), typeof(TouchPanel), new PropertyMetadata(null));
+
#region Attached Properties
#region Prevent Focus Steal
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml
index dffca3511..f3cd31f7d 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml
@@ -38,7 +38,7 @@
<Grid>
<!--Notification Bar-->
- <local:TouchNotificationBar NotificationTemplate="{TemplateBinding NotificationTemplate}" MinNotificationHeight="{TemplateBinding MinNotificationHeight}" HasNotifications="{TemplateBinding HasNotifications}" Notifications="{TemplateBinding Notifications}">
+ <local:TouchNotificationBar NotificationTemplate="{TemplateBinding NotificationTemplate}" MinNotificationHeight="{TemplateBinding MinNotificationHeight}" HasNotifications="{TemplateBinding HasNotifications}" Notifications="{TemplateBinding Notifications}" ItemExpandedPropertyPath="{TemplateBinding ItemExpandedPropertyPath}">
<Grid>
<!--Content-->
<ContentPresenter Content="{TemplateBinding Content}" />
diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
index 7dad89c17..898d30cf7 100644
--- a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
@@ -29,6 +29,7 @@
<Style x:Key="TangoLinkButton" TargetType="{x:Type controls:TouchButton}">
<Setter Property="Background" Value="Transparent"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
<Setter Property="CornerRadius" Value="20"></Setter>
<Setter Property="BorderThickness" Value="0"></Setter>
<Setter Property="EnableDropShadow" Value="False"></Setter>