aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-05-11 20:23:33 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-05-11 20:23:33 +0300
commitb597a69f85fec4f5b5a1aca65228fc840911d314 (patch)
tree0a4e622292c48e788ce9c008bccaa0834c898db4 /Software/Visual_Studio
parent7f3f3d55b9b3dfc66d0bbb2f778298e1e9b224b4 (diff)
downloadTango-b597a69f85fec4f5b5a1aca65228fc840911d314.tar.gz
Tango-b597a69f85fec4f5b5a1aca65228fc840911d314.zip
IMplemented dynamic mid tank capacity on TwineX4 & FSE.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs6
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs2
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml1
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs36
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs87
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml70
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs2
9 files changed, 169 insertions, 42 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs
index 88a90484d..f96725816 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs
@@ -16,9 +16,9 @@ namespace Tango.FSE.UI.Converters
try
{
double parentActualHeight = (double)values[0];
- double midTankLevel = Math.Min((double)values[1], MachineOperator.MAX_MIDTANK_LITERS);
- //var test = (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight);
- return (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight);
+ double max = (double)values[2];
+ double midTankLevel = Math.Min((double)values[1], max);
+ return (parentActualHeight - (midTankLevel / max) * parentActualHeight);
}
catch
{
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs
index d8165d8aa..730055872 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs
@@ -142,7 +142,7 @@ namespace Tango.FSE.UI.Tiles.MidTankLevels
{
MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel()
{
- Max = MachineOperator.MAX_MIDTANK_LITERS,
+ Max = x.MidTankType.LiterCapacity,
IDSPack = x,
}).ToList();
}
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml
index 7465f41c0..5e4f8ed9a 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml
@@ -58,6 +58,7 @@
<MultiBinding Converter="{StaticResource MidTankLevelToElementHeightConverter}">
<Binding ElementName="pathBorder" Path="ActualHeight" />
<Binding Path="Level" />
+ <Binding Path="Max" />
</MultiBinding>
</Setter.Value>
</Setter>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs
index 93af310ba..c656db8c0 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs
@@ -29,6 +29,42 @@ namespace Tango.PPC.Maintenance.Models
{
get { return Level <= MachineOperator.EMPTY_MIDTANK_LITERS; }
}
+
+ private bool _bJerricanPresent;
+
+ public bool JerricanPresent
+ {
+ get { return _bJerricanPresent; }
+ set {
+ _bJerricanPresent = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+
+ private bool _fillingTimeoutError;
+
+ public bool FillingTimeoutError
+ {
+ get { return _fillingTimeoutError; }
+ set { _fillingTimeoutError = value; RaisePropertyChangedAuto(); }
+ }
+
+ private bool _midTankEmpty;
+
+ public bool MidTankEmpty
+ {
+ get { return _midTankEmpty; }
+ set { _midTankEmpty = value; RaisePropertyChangedAuto();}
+ }
+
+ private bool _midTankRefillPumpActive;
+
+ public bool MidTankRefillPumpActive
+ {
+ get { return _midTankRefillPumpActive; }
+ set { _midTankRefillPumpActive = value; RaisePropertyChangedAuto(); }
+ }
+
public IdsPack IDSPack { get; set; }
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs
index b82ed2b52..2f0e73e2f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs
@@ -17,9 +17,10 @@ namespace Tango.PPC.UI.Converters
{
double actualHeight = (double)values[0];
double actualWidth = (double)values[1];
- double midTankLevel = Math.Min((double)values[2], MachineOperator.MAX_MIDTANK_LITERS);
+ double maxLiters = (double)values[3];
+ double midTankLevel = Math.Min((double)values[2], maxLiters);
- var offset = (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * actualHeight;
+ var offset = (midTankLevel / maxLiters) * actualHeight;
return new System.Windows.Rect(1, offset, actualWidth, actualHeight);
}
catch
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
index 6d77ebcb9..1f4040460 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
@@ -9,6 +9,7 @@ using Tango.Core.Commands;
using Tango.Core.DI;
using Tango.Integration.Operation;
using Tango.PMR.Diagnostics;
+using Tango.PMR.MachineStatus;
using Tango.PPC.Common;
using Tango.PPC.Common.Diagnostics;
using Tango.PPC.Jobs;
@@ -16,6 +17,9 @@ using Tango.PPC.Jobs.NavigationObjects;
using Tango.PPC.Jobs.Views;
using Tango.PPC.Maintenance.Models;
using Tango.PPC.UI.Models;
+using System.Timers;
+using System.Windows.Threading;
+using System.Diagnostics;
namespace Tango.PPC.UI.ViewModels
{
@@ -26,6 +30,9 @@ namespace Tango.PPC.UI.ViewModels
[TangoInject]
public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; }
+ private DispatcherTimer _ink_timer;
+ private Stopwatch _stopwatch;
+
private JobHandler _handler;
@@ -190,6 +197,15 @@ namespace Tango.PPC.UI.ViewModels
public MachineOverviewModel OverviewModel { get; set; }
+ private TimeSpan _timer;
+
+ public TimeSpan FullInkTimer
+ {
+ get { return _timer; }
+ set { _timer = value; RaisePropertyChangedAuto();}
+ }
+
+
#endregion
#region Commands
@@ -216,6 +232,10 @@ namespace Tango.PPC.UI.ViewModels
public MachineStatusViewVM()
{
+ _ink_timer = new DispatcherTimer();
+ _ink_timer.Interval = TimeSpan.FromSeconds(1);
+ _ink_timer.Tick += _ink_timer_Tick;
+
StopCommand = new RelayCommand(StopJob, () => CanStopped());
AbortCommand = new RelayCommand(AbortJob, () => CanStopped());
GoToJobCommand = new RelayCommand(GoToJob);
@@ -237,11 +257,76 @@ namespace Tango.PPC.UI.ViewModels
MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel()
{
- Max = MachineOperator.MAX_MIDTANK_LITERS,
+ Max = x.MidTankType.LiterCapacity,
IDSPack = x,
}).OrderBy(y => y.IDSPack.LiquidType.Code).ToList();
+ // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged;
+ MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged;
}
+ #region Events
+
+ private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status)
+ {
+ UpdateMidTankLevels(status);
+ }
+ private void UpdateMidTankLevels(MachineStatus status)
+ {
+ if (!IsJobStatusViewEnable)
+ {
+ foreach (var item in status.IDSPacksLevels)
+ {
+ var model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index);
+
+ if (model != null)
+ {
+ model.Level = item.MidTankLevel;
+ model.JerricanPresent = item.JerricanPresent;
+ model.FillingTimeoutError = item.FillingTimeoutError;
+ model.MidTankEmpty = item.MidTankEmpty;
+ model.MidTankRefillPumpActive = item.MidTankRefillPumpActive;
+ if (model.FillingTimeoutError)
+ {
+ //StartInkTimer()
+ }
+ }
+ }
+ }
+ }
+ private void StartInkTimer()
+ {
+ _stopwatch = Stopwatch.StartNew();
+ _ink_timer.Start();
+ }
+
+ private void StopInkTimer()
+ {
+ if (_stopwatch.IsRunning)
+ {
+ _stopwatch.Stop();
+ _ink_timer.Stop();
+ }
+ }
+
+ private void _ink_timer_Tick(object sender, EventArgs e)
+ {
+ FullInkTimer = _stopwatch.Elapsed;
+ }
+ private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e)
+ {
+ //foreach (var cartridge in e.Status.CartridgesStatuses.Where(x => x.Cartridge.Slot != CartridgeSlot.Ink))
+ //{
+ // var wasteState = WasteStates.SingleOrDefault(x => x.Slot == cartridge.Cartridge.Slot);
+
+ // if (wasteState != null)
+ // {
+ // wasteState.State = cartridge.State;
+ // }
+ //}
+ }
+
+ #endregion
+
#region printing
public override void OnApplicationStarted()
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
index 6edc90844..998ab7db4 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
@@ -120,48 +120,52 @@
</UniformGrid>
</DataTemplate>
- <PathGeometry x:Key="InkContainerPath" Figures="M16.000001,0.5 C24.560414,0.5 31.500001,6.9918714 31.500001,15 31.500001,15.500508 31.472893,15.995093 31.419976,16.48254 L31.417605,16.5 31.500001,16.5 31.500001,71 31.500001,71.5 31.486487,71.5 31.479832,71.74617 C31.064694,79.407524 24.292901,85.5 16.000001,85.5 7.7070995,85.5 0.9353075,79.407524 0.52016807,71.74617 L0.51351446,71.5 0.5,71.5 0.5,71 0.5,16.5 0.58239609,16.5 0.58002502,16.48254 C0.52710831,15.995093 0.50000054,15.500508 0.5,15 0.50000054,6.9918714 7.4395867,0.5 16.000001,0.5 z"/>
+ <PathGeometry x:Key="InkContainerPath" Figures="M16.000001,0.5 C24.560414,0.5 31.500001,6.9918714 31.500001,15 31.500001,15.500508 31.472893,15.995093 31.419976,16.48254 L31.417605,16.5 31.500001,16.5 31.500001,71 31.500001,71.5 31.486487,71.5 31.479832,71.74617 C31.064694,79.407524 24.292901,85.5 16.000001,85.5 7.7070995,85.5 0.9353075,79.407524 0.52016807,71.74617 L0.51351446,71.5 0.5,71.5 0.5,71 0.5,16.5 0.58239609,16.5 0.58002502,16.48254 C0.52710831,15.995093 0.50000054,15.500508 0.5,15 0.50000054,6.9918714 7.4395867,0.5 16.000001,0.5 z"/>
<DataTemplate x:Key="LiquidBox">
<DockPanel>
<TextBlock DockPanel.Dock="Bottom" Text="{Binding IDSPack.LiquidType.ShortName}" HorizontalAlignment="Center" Margin="0 8 0 0"></TextBlock>
- <Grid>
- <Grid ClipToBounds="True" HorizontalAlignment="Center">
- <Path Fill="{Binding Path=IDSPack.LiquidType, Converter={StaticResource LiquidTypeToBrushConverter}}">
+ <Grid>
+ <Grid ClipToBounds="True" HorizontalAlignment="Center">
+ <Path Fill="{Binding Path=IDSPack.LiquidType, Converter={StaticResource LiquidTypeToBrushConverter}}" StrokeThickness="1.5" >
<Path.Resources>
<sys:Double x:Key="RectWidth">30</sys:Double>
<sys:Double x:Key="RectHeight">88</sys:Double>
</Path.Resources>
- <Path.Data>
- <CombinedGeometry GeometryCombineMode="Intersect">
- <CombinedGeometry.Geometry1>
- <StaticResource ResourceKey="InkContainerPath"/>
- </CombinedGeometry.Geometry1>
- <CombinedGeometry.Geometry2>
- <!--Rect="1,30 30,88"-->
- <RectangleGeometry >
+ <Path.Data>
+ <CombinedGeometry GeometryCombineMode="Intersect">
+ <CombinedGeometry.Geometry1>
+ <StaticResource ResourceKey="InkContainerPath"/>
+ </CombinedGeometry.Geometry1>
+ <CombinedGeometry.Geometry2>
+ <!--Rect="1,30 30,88"-->
+ <RectangleGeometry >
<RectangleGeometry.Rect>
<MultiBinding Converter="{StaticResource MidTankLevelToElementRectConverter}">
<Binding Source="{StaticResource RectHeight}"/>
<Binding Source="{StaticResource RectWidth}"/>
<Binding Path="Level" />
+ <Binding Path="IDSPack.MidTankType.LiterCapacity" />
</MultiBinding>
</RectangleGeometry.Rect>
</RectangleGeometry>
</CombinedGeometry.Geometry2>
- </CombinedGeometry>
- </Path.Data>
-
+ </CombinedGeometry>
+ </Path.Data>
+
</Path>
- <Path Stroke="Black" Fill="Transparent" StrokeThickness="1" Data="{StaticResource InkContainerPath}">
-
+ <Path Stroke="{StaticResource TangoTextWatermarkBrush}" Fill="Transparent" StrokeThickness="1" Data="{StaticResource InkContainerPath}">
+
</Path>
- </Grid>
+ </Grid>
<UniformGrid Rows="4" Columns="1" Margin="0 15 0 15" HorizontalAlignment="Center">
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
</UniformGrid>
+ <Image Source="../Images/Overview Icons/error.png" Stretch="Fill" VerticalAlignment="Top" Width="24" Height="24" Margin="0 4 0 0" Visibility="Visible"/>
+ <Image Source="../Images/Overview Icons/Warning.png" Stretch="Fill" VerticalAlignment="Top" Width="24" Height="24" Visibility="Collapsed"/>
+ <Image Source="../Images/Overview Icons/UpdateInk.png" Stretch="Fill" VerticalAlignment="Top" Width="24" Height="24" Visibility="Collapsed"/>
</Grid>
</DockPanel>
</DataTemplate>
@@ -196,13 +200,13 @@
</CombinedGeometry>
</Path.Data>
</Path>
- <Path Stroke="Black" Fill="Transparent" StrokeThickness="1" Data="{StaticResource InkContainerPath}"/>
+ <Path Stroke="{StaticResource TangoTextWatermarkBrush}" Fill="Transparent" StrokeThickness="1" Data="{StaticResource InkContainerPath}"/>
</Grid>
<UniformGrid Rows="4" Columns="1" Margin="0 15 0 15" HorizontalAlignment="Center">
- <Rectangle Stroke="Black" Width="10" Height="2" ></Rectangle>
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
+ <Rectangle Stroke="{StaticResource TangoTextWatermarkBrush}" Width="10" Height="2" ></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
</UniformGrid>
</Grid>
</DockPanel>
@@ -238,13 +242,13 @@
</CombinedGeometry>
</Path.Data>
</Path>
- <Path Stroke="Black" Fill="Transparent" StrokeThickness="1" Data="{StaticResource InkContainerPath}"/>
+ <Path Stroke="{StaticResource TangoTextWatermarkBrush}" Fill="Transparent" StrokeThickness="1" Data="{StaticResource InkContainerPath}"/>
</Grid>
<UniformGrid Rows="4" Columns="1" Margin="0 15 0 15" HorizontalAlignment="Center">
- <Rectangle Stroke="Black" Width="10" Height="2" ></Rectangle>
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
- <Rectangle Width="10" Height="2" Stroke="Black"></Rectangle>
+ <Rectangle Stroke="{StaticResource TangoTextWatermarkBrush}" Width="10" Height="2" ></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
+ <Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
</UniformGrid>
</Grid>
</DockPanel>
@@ -880,7 +884,7 @@
<SolidColorBrush Color="{Binding DryerZone3.Color}"/>
</TextBlock.Foreground>
</TextBlock>
- <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 10" FontSize="{StaticResource TangoComboBoxItemFontSize}" >&#186;C</TextBlock>
+ <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 20" FontSize="{StaticResource TangoComboBoxItemFontSize}" >&#186;C</TextBlock>
</Grid>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Dryer Zone 3</TextBlock>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index d72e75011..efc5f8179 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/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
index ac5e69425..8f8a04005 100644
--- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
+++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
@@ -166,7 +166,7 @@ namespace Tango.Emulations.Emulators
{
Index = i,
DispenserLevel = 130000000,
- MidTankLevel = 2500,
+ MidTankLevel = 2.5,
});
}