diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-25 17:27:24 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-25 17:27:24 +0300 |
| commit | 7689f77fe2f356d17a5ad59dbeb4a0fed3ca4a0d (patch) | |
| tree | de4a7897e4cd322435bab966769d98aeea324687 /Software/Visual_Studio/Tango.Emulations | |
| parent | 9e6f2a37d528a1bf50629dc7132f1e4496114aee (diff) | |
| download | Tango-7689f77fe2f356d17a5ad59dbeb4a0fed3ca4a0d.tar.gz Tango-7689f77fe2f356d17a5ad59dbeb4a0fed3ca4a0d.zip | |
Added PPC power up sequence support !
Refactored AppBarItems implementation.
Diffstat (limited to 'Software/Visual_Studio/Tango.Emulations')
| -rw-r--r-- | Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index c2be3c22b..0fe3f280d 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -425,6 +425,9 @@ namespace Tango.Emulations.Emulators case MessageType.AbortHeadCleaningRequest: HandleAbortHeadCleaningRequest(MessageFactory.ParseTangoMessageFromContainer<AbortHeadCleaningRequest>(container)); break; + case MessageType.StartPowerUpRequest: + HandleStartPowerUpRequest(MessageFactory.ParseTangoMessageFromContainer<StartPowerUpRequest>(container)); + break; } } @@ -750,7 +753,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); - + double currentPosition = 0; double nextStopPosition = unit_length; for (int seg_index = 0; seg_index < _current_job_ticket.Segments.Count(); seg_index++) @@ -836,7 +839,7 @@ namespace Tango.Emulations.Emulators { if (_current_job_resume_token == null) { - Transporter.SendResponse<JobResponse>(new JobResponse() + Transporter.SendResponse<JobResponse>(new JobResponse() { Status = new PMR.Printing.JobStatus() { @@ -847,7 +850,7 @@ namespace Tango.Emulations.Emulators } else { - Transporter.SendResponse<ResumeCurrentJobResponse>(new ResumeCurrentJobResponse() + Transporter.SendResponse<ResumeCurrentJobResponse>(new ResumeCurrentJobResponse() { Status = new PMR.Printing.JobStatus() { @@ -1582,6 +1585,38 @@ namespace Tango.Emulations.Emulators } } + private async void HandleStartPowerUpRequest(TangoMessage<StartPowerUpRequest> request) + { + await Transporter.SendResponse(new StartPowerUpResponse() { Message = "Power up started...", ProgressPercentage = 10, State = PowerUpState.BuiltInTest }, request.Container.Token); + Thread.Sleep(1000); + + await Transporter.SendResponse(new StartPowerUpResponse() { Message = "Testing dispensers...", ProgressPercentage = 20, State = PowerUpState.DispenserPressureBuildupTest }, request.Container.Token); + Thread.Sleep(1000); + + await Transporter.SendResponse(new StartPowerUpResponse() { Message = "Heating started...", ProgressPercentage = 30, State = PowerUpState.HeatingStarted }, request.Container.Token); + Thread.Sleep(1000); + + await Transporter.SendResponse(new StartPowerUpResponse() { Message = "Heating started...", ProgressPercentage = 40, State = PowerUpState.HwConfig }, request.Container.Token); + Thread.Sleep(1000); + + await Transporter.SendResponse(new StartPowerUpResponse() { Message = "Hardware configuration...", ProgressPercentage = 50, State = PowerUpState.HwConfig }, request.Container.Token); + Thread.Sleep(1000); + + await Transporter.SendResponse(new StartPowerUpResponse() { Message = "Initializing blower...", ProgressPercentage = 60, State = PowerUpState.InitialBlowerActivation }, request.Container.Token); + Thread.Sleep(1000); + + await Transporter.SendResponse(new StartPowerUpResponse() { Message = "Thread detection...", ProgressPercentage = 70, State = PowerUpState.ThreadDetection }, request.Container.Token); + Thread.Sleep(1000); + + await Transporter.SendResponse(new StartPowerUpResponse() { Message = "Waiting for cooler...", ProgressPercentage = 80, State = PowerUpState.WaitForCooler }, request.Container.Token); + Thread.Sleep(4000); + + await Transporter.SendResponse(new StartPowerUpResponse() { Message = "Ready to dye...", ProgressPercentage = 90, State = PowerUpState.MachineReadyToDye }, request.Container.Token,new TransportResponseConfig() + { + Completed = true + }); + } + #endregion #region Public Methods |
