diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-05-05 18:40:15 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-05-05 18:40:15 +0300 |
| commit | 700a9ea9e2c9d95f0c5739c58974eafaff2ebeb9 (patch) | |
| tree | e6e6d2d1870f8115c7e740576367b97c27a75742 /Software/Visual_Studio/Tango.Integration | |
| parent | 2e752ce186fc34f5530841bdac7537ee775ed3f6 (diff) | |
| download | Tango-700a9ea9e2c9d95f0c5739c58974eafaff2ebeb9.tar.gz Tango-700a9ea9e2c9d95f0c5739c58974eafaff2ebeb9.zip | |
Support for 64 Bit Dispenser Levels.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs | 6 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 35 |
2 files changed, 25 insertions, 16 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs b/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs index 797d4f498..367345bde 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/InsufficientLiquidQuantityException.cs @@ -12,9 +12,9 @@ namespace Tango.Integration.Operation public class IDSPackLevel { public IdsPack IdsPack { get; set; } - public int Current { get; set; } - public int Required { get; set; } - public int Maximum { get; set; } + public long Current { get; set; } + public long Required { get; set; } + public long Maximum { get; set; } public bool IsValid { diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 2e885e00b..9596dc29c 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -102,7 +102,7 @@ namespace Tango.Integration.Operation private class RequiredLiquid { public IdsPack IdsPack { get; set; } - public int Quantity { get; set; } + public long Quantity { get; set; } } #endregion @@ -1030,6 +1030,14 @@ namespace Tango.Integration.Operation bool changed = (MachineStatus == null || response.Status.State != MachineStatus.State); + foreach (var idsPack in response.Status.IDSPacksLevels) + { + if (idsPack.DispenserLevel > 0 && idsPack.DispenserLevel64 == 0) + { + idsPack.DispenserLevel64 = idsPack.DispenserLevel; + } + } + MachineStatus = response.Status; MachineStatusChanged?.Invoke(this, MachineStatus); @@ -1510,6 +1518,7 @@ namespace Tango.Integration.Operation UnixTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(), SpoolType = _currentSpoolType, MachineType = (PMR.Common.MachineType)MachineType, + Supports64BitDispenserLevel = true }; try @@ -2169,7 +2178,7 @@ namespace Tango.Integration.Operation var idsLevel = new InsufficientLiquidQuantityException.IDSPackLevel() { IdsPack = idsPack, - Current = packLevel.DispenserLevel, + Current = packLevel.DispenserLevel64, Required = (int)liquidQuantities[index], Maximum = MAX_DISPENSER_NANOLITER, }; @@ -2278,7 +2287,7 @@ namespace Tango.Integration.Operation var idsLevel = new InsufficientLiquidQuantityException.IDSPackLevel() { IdsPack = idsPack, - Current = packLevel.DispenserLevel, + Current = packLevel.DispenserLevel64, Required = (int)liquidQuantities[index], Maximum = MAX_DISPENSER_NANOLITER, }; @@ -2364,16 +2373,16 @@ namespace Tango.Integration.Operation if (packLevelAfter != null && packLevelBefore != null) { - if (packLevelAfter.DispenserLevel > packLevelBefore.DispenserLevel) + if (packLevelAfter.DispenserLevel64 > packLevelBefore.DispenserLevel64) { - LogManager.Log($"Invalid '{pack.LiquidType.Name}' dispenser level calculated: {packLevelBefore.DispenserLevel} - {packLevelAfter.DispenserLevel} = {packLevelBefore.DispenserLevel - packLevelAfter.DispenserLevel}. Ignoring..."); + LogManager.Log($"Invalid '{pack.LiquidType.Name}' dispenser level calculated: {packLevelBefore.DispenserLevel64} - {packLevelAfter.DispenserLevel64} = {packLevelBefore.DispenserLevel64 - packLevelAfter.DispenserLevel64}. Ignoring..."); continue; } _lastJobLiquidQuantities.Add(new BL.ValueObjects.JobRunLiquidQuantity() { LiquidType = pack.LiquidType.Type, - Quantity = packLevelBefore.DispenserLevel - packLevelAfter.DispenserLevel, + Quantity = packLevelBefore.DispenserLevel64 - packLevelAfter.DispenserLevel64, }); } } @@ -3079,7 +3088,7 @@ namespace Tango.Integration.Operation JobPrepareDispenser prepareDispenser = new JobPrepareDispenser(); prepareDispenser.DispenserLiquidType = (DispenserLiquidType)requiredLiquid.IdsPack.LiquidType.Type; prepareDispenser.Index = requiredLiquid.IdsPack.PackIndex; - prepareDispenser.TotalNanoliter = requiredLiquid.Quantity; + prepareDispenser.TotalNanoliter = Convert.ToInt32(requiredLiquid.Quantity); prepareDispenser.Active = requiredLiquid.Quantity > 0; prepareRequest.Dispensers.Add(prepareDispenser); @@ -3254,7 +3263,7 @@ namespace Tango.Integration.Operation } double resumePreProgress = 0; - + if (config.ResumeConfig != null) { resumePreProgress = config.ResumeConfig.GlobalStartPosition - config.ResumeConfig.FirstUnitStartPosition;//- processParameters.DryerBufferLengthMeters; @@ -3268,11 +3277,11 @@ namespace Tango.Integration.Operation { if (!completed) { - if(resumePreProgress > 0 ) - { - response.Message.Status.Progress += resumePreProgress;//LogManager.Log($" MACHINE OPERATOR Added Progress = {response.Message.Status.Progress}"); - } - + if (resumePreProgress > 0) + { + response.Message.Status.Progress += resumePreProgress;//LogManager.Log($" MACHINE OPERATOR Added Progress = {response.Message.Status.Progress}"); + } + handler.RaiseStatusReceived(response.Message.Status); _last_job_status = handler.Status; |
