aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE
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/FSE
parent7f3f3d55b9b3dfc66d0bbb2f778298e1e9b224b4 (diff)
downloadTango-b597a69f85fec4f5b5a1aca65228fc840911d314.tar.gz
Tango-b597a69f85fec4f5b5a1aca65228fc840911d314.zip
IMplemented dynamic mid tank capacity on TwineX4 & FSE.
Diffstat (limited to 'Software/Visual_Studio/FSE')
-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
3 files changed, 5 insertions, 4 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>