aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Emulations
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-05-23 10:42:21 +0300
committerRoy <Roy.mail.net@gmail.com>2023-05-23 10:42:21 +0300
commit304735006580cb2f6728bedeb3393dbefc2e14f5 (patch)
tree8650d4baeb0b4db1f68b0fae3a0a8ddb7e66bdc0 /Software/Visual_Studio/Tango.Emulations
parent79cc4b56962ca4a508be501f7f2fb42938a3a073 (diff)
parentb981d43669a2cdcd9f7971e897ded9f1422f5b31 (diff)
downloadTango-304735006580cb2f6728bedeb3393dbefc2e14f5.tar.gz
Tango-304735006580cb2f6728bedeb3393dbefc2e14f5.zip
Merge branch 'eureka' of https://twinetfs.visualstudio.com/Tango/_git/Tango into eureka
Diffstat (limited to 'Software/Visual_Studio/Tango.Emulations')
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs25
1 files changed, 15 insertions, 10 deletions
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<int, IDSPackLevel> dispenserindexToPacklevel = new Dictionary<int, IDSPackLevel>();
+ 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;