diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-20 11:40:27 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-20 11:40:27 +0300 |
| commit | 9b61ba1658c5c87766eede52f0f7aa6723f4dd1b (patch) | |
| tree | aa8062d17923661aa26b7fff465e50c6be742168 /Software/Visual_Studio | |
| parent | beca75b89f9c227ce987abdd01e01fa911dfa91d (diff) | |
| download | Tango-9b61ba1658c5c87766eede52f0f7aa6723f4dd1b.tar.gz Tango-9b61ba1658c5c87766eede52f0f7aa6723f4dd1b.zip | |
Working on liquid quantity validation.
Diffstat (limited to 'Software/Visual_Studio')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 558953ccb..0802801db 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -1272,26 +1272,27 @@ namespace Tango.Integration.Operation { Dictionary<int, double> liquidQuantities = new Dictionary<int, double>(); - int packIndex = 0; - - foreach (var item in configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex)) + foreach (var pack in configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex)) { - liquidQuantities.Add(packIndex++, 0); + liquidQuantities.Add(pack.PackIndex, 0); } for (int segmentIndex = 0; segmentIndex < ticket.Segments.Count; segmentIndex++) { var segment = ticket.Segments[segmentIndex]; + var segment_length_cm = segment.Length * 100d; + + var stop_count = segment.BrushStops.Count - (segment.BrushStops.Count == 1 ? 0 : 1); + var stop_length_centimeters = segment_length_cm / stop_count; - for (int stopIndex = 0; stopIndex < segment.BrushStops.Count; stopIndex++) + for (int stopIndex = 0; stopIndex < stop_count; stopIndex++) { var stop = segment.BrushStops[stopIndex]; - //var position = segment. - //foreach (var dispenser in stop.Dispensers) - //{ - - //} + foreach (var dispenser in stop.Dispensers) + { + liquidQuantities[dispenser.Index] += dispenser.NanoliterPerCentimeter * stop_length_centimeters; + } } } } |
