From 8e77a83a73410f388b3a879c3082eb7bf6064657 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 17 May 2023 18:03:58 +0300 Subject: Bugs - delay progress in PPC, Overview error Related Work Items: #8408 --- .../Tango.Emulations/Emulators/MachineEmulator.cs | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'Software/Visual_Studio/Tango.Emulations') diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 8f8a04005..3543b8b3a 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -87,6 +87,7 @@ namespace Tango.Emulations.Emulators private int _jobAbortCounter; private bool _abortHeadCleaning; private String _machineStatusRequestToken; + private MachineType _machineType; #region Properties @@ -620,12 +621,12 @@ namespace Tango.Emulations.Emulators monitors.Dispenser7MotorFrequency.AddRange(dispenserFrequencies[6].Data); monitors.Dispenser8MotorFrequency.AddRange(dispenserFrequencies[7].Data); - res.HeatersStates.Add(new HeaterState() - { - CurrentValue = 50, - IsInSetPoint = false, - SetPoint = 100 - }); + //res.HeatersStates.Add(new HeaterState() + //{ + // CurrentValue = 50, + // IsInSetPoint = false, + // SetPoint = 100 + //}); res.DigitalInterfaceStates.AddRange(_digitalOutputPinsStates.Concat(_digitalInputPinsStates)); res.ComponentsStates.AddRange(_componentsStates); @@ -801,10 +802,12 @@ namespace Tango.Emulations.Emulators Stopwatch watch = new Stopwatch(); Dictionary dispenserindexToPacklevel = new Dictionary(); + double dryerLength = _machineType == MachineType.Ts1800 ? (job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS) : job.ProcessParameters.DryerBufferLength; + for (int i = 0; i < units; i++) { - while (progress < unit_length + (i == units - 1 ? (job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS) : 0) && !_cancelJob) + while (progress < unit_length + (i == units - 1 ? dryerLength : 0) && !_cancelJob) { var status = new PMR.Printing.JobStatus(); status.Progress = progress; @@ -835,7 +838,7 @@ namespace Tango.Emulations.Emulators } } - progress += Math.Min((centimeter_per_second / 1000d), (unit_length + (i == units - 1 ? (job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS) : 0)) - progress); + progress += Math.Min((centimeter_per_second / 1000d), (unit_length + (i == units - 1 ? dryerLength : 0)) - progress); double currentPosition = 0; double nextStopPosition = unit_length; @@ -935,7 +938,7 @@ namespace Tango.Emulations.Emulators { Status = new PMR.Printing.JobStatus() { - Progress = unit_length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS, + Progress = unit_length + dryerLength, } }, request.Container.Token, new TransportResponseConfig() { Completed = !_cancelJob }); @@ -961,7 +964,7 @@ namespace Tango.Emulations.Emulators { Status = new PMR.Printing.JobStatus() { - Progress = unit_length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE + ProcessParametersTable.DRYER_TO_SPOOL_LENGTH_METERS, + Progress = unit_length + dryerLength, } }, _current_job_resume_token, new TransportResponseConfig() { Completed = !_cancelJob }); @@ -1268,6 +1271,8 @@ namespace Tango.Emulations.Emulators }, request.Container.Token, new TransportResponseConfig() { ErrorCode = request.Message.Password == "1234" ? ErrorCode.None : ErrorCode.UnauthorizedConnection }); + _machineType = request.Message.MachineType; + _connectionTime = DateTime.Now; _isAfterReset = false; -- cgit v1.3.1