DIRECTORY BansheeEngine USING [Initialize], BansheeMarkerControl USING [Startup, Status], BasicTime USING [GMT, nullGMT], MarkerControl USING [CancelProc, ClientProcsHandle, EngineFailureProc, FinishedMarkingProc, MarkerStatus, ReadyToMarkProc, TraceLevel, WaitChoice], MarkerControlInternal, MarkerInit USING [MarkerInitParams], PaperHandling USING [PrintOrder], PrintingTypes USING [Option], PrintQueue USING [nilQueueObjectHandle, ObjectStatus, QueueObjectHandle, QueueWatcher], Process USING [Priority, priorityForeground, SecondsToTicks, SetTimeout], PSActivity USING [Marker], PSAsyncMsg USING [Proc, PutString], RavenConsole USING [BlankDisplay], RavenEngine USING [Initialize], RavenMarkerControl USING [Startup, Status]; MarkerControlImpl: CEDAR MONITOR IMPORTS BansheeEngine, BansheeMarkerControl, --D1Console, D1Engine, D1MarkerControl, FaxEngine, FaxMarkerControl, FX3500Console, FX3500Engine, FX3500MarkerControl, -- PrintQueue, Process, PSAsyncMsg, RavenConsole, RavenEngine, RavenMarkerControl EXPORTS MarkerInit, MarkerControlInternal = BEGIN Control: TYPE = RECORD [ start, stop: BOOLEAN _ FALSE, pause, resume, pausing, resuming: BOOLEAN _ FALSE, resumeWhenAppropriate: BOOLEAN _ FALSE, -- for delayed resumption jobQueueEntry: BOOLEAN _ FALSE, tpQueueEntry: BOOLEAN _ FALSE, faxRetry: BOOLEAN _ FALSE ]; State: TYPE = RECORD [ stopped: BOOLEAN _ TRUE, idle: BOOLEAN _ TRUE, engineProblem: BOOLEAN _ FALSE, activity: PSActivity.Marker _ available, tpJob: BOOLEAN _ FALSE, --current doc is a test pattern clientPause: CARDINAL _ 0, --number of times clients have called to pause marking qOH: PrintQueue.QueueObjectHandle _ PrintQueue.nilQueueObjectHandle, trace: MarkerControl.TraceLevel _ none, printOrder: PaperHandling.PrintOrder _ lastPageOutFirst, printErrorRetry: CARDINAL _ 0, stopStatus: PrintQueue.ObjectStatus _ canceledInMarker, --specified in Stop call starting: MarkerControl.ReadyToMarkProc _ NIL, finished: MarkerControl.FinishedMarkingProc _ NIL, waitBetweenJobs: BOOLEAN _ FALSE, betweenJobWaitTime: CARDINAL _ 0, engineFailure: MarkerControl.EngineFailureProc _ NIL, canceledWhileMarking: MarkerControl.CancelProc _ NIL, putAsyncMsgFromKey: PSAsyncMsg.Proc _ NIL, startMarkDate: BasicTime.GMT _ BasicTime.nullGMT -- time started marking ]; printErrorRetryLimit: CARDINAL = 2; event: CONDITION; stopped: CONDITION; paused: CONDITION; control: Control; state: REF State _ NIL; procsHandle: MarkerControl.ClientProcsHandle _ NIL; engineType: PrintingTypes.Option _ unknown; Init: PUBLIC ENTRY PROCEDURE [priority: Process.Priority _ Process.priorityForeground, putAsyncMsgFromKey: PSAsyncMsg.Proc, deviceParams: MarkerInit.MarkerInitParams] RETURNS [MarkerControl.ClientProcsHandle] = -- exported thru MarkerInit BEGIN ENABLE UNWIND => NULL; TRUSTED {Process.SetTimeout[@event, Process.SecondsToTicks[1]]}; state _ NEW[State _ [ starting: deviceParams.readyToMark, finished: deviceParams.finishedMarking, waitBetweenJobs: deviceParams.waitBetweenJobs, betweenJobWaitTime: deviceParams.betweenJobWaitTime, engineFailure: deviceParams.engineFailure, putAsyncMsgFromKey: putAsyncMsgFromKey]]; WITH dP: deviceParams SELECT FROM bansheeDl => BEGIN engineType _ bansheeDl; BansheeEngine.Initialize[dP.bufferSize, dP.enableUnlimitedPrinting]; procsHandle _ BansheeMarkerControl.Startup[priority]; END; raven => BEGIN engineType _ raven; RavenEngine.Initialize[dP.bufferSize, dP.enableUnlimitedPrinting]; procsHandle _ RavenMarkerControl.Startup[priority]; END; ENDCASE; PrintQueue.QueueWatcher[proc: JobQueueEntry, queueStage: decomposed]; PrintQueue.QueueWatcher[proc: TPQueueEntry, queueStage: tpDecomposed]; RETURN[procsHandle]; END; --Init JobQueueEntry: ENTRY PROCEDURE = -- called by PrintQueue BEGIN ENABLE UNWIND => NULL; control.jobQueueEntry _ TRUE; BROADCAST event; IF state.trace = verbose THEN PSAsyncMsg.PutString["Marker JobQueueEntry"]; END; --JobQueueEntry TPQueueEntry: ENTRY PROCEDURE = -- called by PrintQueue for TestPatterns BEGIN ENABLE UNWIND => NULL; control.tpQueueEntry _ TRUE; BROADCAST event; IF state.trace = verbose THEN PSAsyncMsg.PutString["Marker TPQueueEntry"]; END; --TPQueueEntry Start: PUBLIC ENTRY PROCEDURE = BEGIN ENABLE UNWIND => NULL; control.stop _ FALSE; control.start _ TRUE; BROADCAST event; IF state.printErrorRetry # 0 THEN BEGIN SELECT engineType FROM raven => RavenConsole.BlankDisplay[]; --to remove L2 or L4 ENDCASE; state.printErrorRetry _ 0 END; END; --Start Stop: PUBLIC ENTRY PROCEDURE [status: PrintQueue.ObjectStatus, canceledWhileMarking: MarkerControl.CancelProc _ NIL] = BEGIN ENABLE UNWIND => NULL; state.stopStatus _ status; state.canceledWhileMarking _ canceledWhileMarking; control.stop _ TRUE; BROADCAST event; END; --Stop Stopped: PUBLIC PROCEDURE [wither: MarkerControl.WaitChoice _ dontWait] RETURNS [BOOLEAN] = BEGIN WaitTillStopped: ENTRY PROC = BEGIN ENABLE UNWIND => NULL; UNTIL state.stopped DO WAIT stopped; ENDLOOP; END; --WaitTillStopped IF wither = wait THEN WaitTillStopped[]; RETURN[state.stopped]; END; --Stopped Pause: PUBLIC PROCEDURE RETURNS [MarkerControl.MarkerStatus] = BEGIN WaitTillPaused: ENTRY PROC = BEGIN ENABLE UNWIND => NULL; IF state.activity = paused AND NOT control.resume THEN BEGIN control.resumeWhenAppropriate _ FALSE; state.clientPause _ state.clientPause + 1; IF state.trace = verbose THEN PSAsyncMsg.PutString["Marker Already Paused"]; RETURN; END; control.pause _ TRUE; IF state.trace = verbose THEN PSAsyncMsg.PutString["Marker.Pause by Client"]; BROADCAST event; UNTIL state.activity = paused OR state.activity = available DO WAIT paused; ENDLOOP; IF state.activity = paused THEN state.clientPause _ state.clientPause + 1; END; --WaitTillPaused IF state.activity = markingButInterruptable OR state.activity = paused THEN WaitTillPaused[]; RETURN[SELECT engineType FROM bansheeDl => BansheeMarkerControl.Status[], ENDCASE => RavenMarkerControl.Status[] --raven ]; END; --Pause Resume: PUBLIC ENTRY PROCEDURE = BEGIN IF state.clientPause > 0 THEN state.clientPause _ state.clientPause - 1; --clientPause should always be greater than zero at this point if the client calls Resume only once for every time he calls Pause. IF state.activity = paused THEN BEGIN control.resume _ TRUE; IF state.trace = verbose THEN PSAsyncMsg.PutString["Marker.Resume by Client"]; BROADCAST event; END ELSE IF state.trace # none THEN --Unfortunately this error msg does get displayed sometimes. PSAsyncMsg.PutString["Marker Implementation Error: Resume called and state.activity # paused."]; END; --Resume SetPrintOrder: PUBLIC ENTRY PROCEDURE [printOrder: PaperHandling.PrintOrder] = BEGIN ENABLE UNWIND => NULL; state.printOrder _ printOrder; END; --SetPrintOrder ModifyTraceLevel: PUBLIC ENTRY PROCEDURE [trace: MarkerControl.TraceLevel] = BEGIN ENABLE UNWIND => NULL; state.trace _ trace; END; --ModifyTraceLevel SetActivity: PUBLIC ENTRY PROCEDURE [activity: PSActivity.Marker] = BEGIN ENABLE UNWIND => NULL; state.activity _ activity; IF activity = available THEN state.idle _ TRUE ELSE state.idle _ FALSE; END; --SetActivity END. -- MarkerControlImpl LOG ****EARLIER LOG ENTRIES DELETED. See archived version from 8.0. 17-Aug-84 13:58:40 - Jacks - Removed all aps phototypesetter stuff. 20-Sep-84 10:09:27 - Jacks - Updated to new MarkerControl interface for 9.0; added code for banshee and fax295. 4-Oct-84 14:39:02 - Jacks - Reduced timeout on event from 5 minutes to 45 seconds to try and help problem of delayed resumes. 16-Oct-84 14:50:17 - Jacks - Reduced timeout on event from 45 to 1 sec. 8-Nov-84 16:22:27 - Jacks - Made use to StatusTypes interface. 17-Jun-85 15:52:08 - Jacks - Added copyright notice; updated to PS Euclid interfaces. 19-Jun-85 15:56:31 - Jacks - Activity renamed to PSActivity. 27-Jun-85 10:11:29 - Jacks - Added code for the D1. 17-Jul-85 10:18:24 - Jacks - New PSAsyncMsg interface. 31-Jul-85 15:43:30 - Jacks - Removed reenteringRepairMode parm from RavenEngine.Init. 23-Sep-85 15:14:52 - Jacks - enableUnlimitedPrinting added to BansheeEngine and RavenEngine init parms; waitBetweenJobs and betweenJobWaitTime added to state. 3-Oct-85 9:55:41 - Jacks - Implementation error msg in Resume now only displays if tracing is set. HMarkerControlImpl.mesa Copyright (C) Xerox Corporation 1984, 1985, 1986. All rights reserved. Last edited by Jacks: 3-Oct-85 9:56:09 Tim Diebert: December 2, 1986 3:51:10 pm PST <> D1Console USING [BlankDisplay], D1Engine USING [Initialize], D1MarkerControl USING [Startup, Status], FaxEngine USING [Initialize], FaxMarkerControl USING [Startup, Status], FX3500Console USING [BlankDisplay], FX3500Engine USING [Initialize], FX3500MarkerControl USING [Startup, Status], ========= ******** ========== d1 => BEGIN engineType _ d1; D1Engine.Initialize[dP.bufferSize, dP.reenteringRepairMode]; procsHandle _ D1MarkerControl.Startup[priority]; END; fax295 => BEGIN engineType _ fax295; FaxEngine.Initialize[]; procsHandle _ FaxMarkerControl.Startup[priority]; END; fax495 => BEGIN engineType _ fax495; FaxEngine.Initialize[]; procsHandle _ FaxMarkerControl.Startup[priority]; END; fx3500 => BEGIN engineType _ fx3500; FX3500Engine.Initialize[dP.bufferSize, dP.reenteringRepairMode]; procsHandle _ FX3500MarkerControl.Startup[priority]; END; ************************************** Exported by MarkerControlInternal: ************************************** d1 => D1Console.BlankDisplay[]; --to remove F2 or F4 fx3500 => FX3500Console.BlankDisplay[]; --to remove F2 or F4 d1 => D1MarkerControl.Status[], fax295 => FaxMarkerControl.Status[], fax495 => FaxMarkerControl.Status[], fx3500 => FX3500MarkerControl.Status[], Κ „˜codešœ™KšœF™FKšœ(™(K™,—K˜K™ΎK˜šΟk ˜ Kšœœ˜!Kšœœ˜-Kšœ œœ ˜Kšœ œ™Kšœ œ™Kšœœ™(Kšœ œ™Kšœœ™)Kšœœ™#Kšœ œ™ Kšœœ™,Kšœœ€˜“K˜Kšœ œ˜$Kšœœ˜!Kšœœ ˜Kšœ œG˜WKšœœ<˜IKšœ œ ˜Kšœ œ˜#Kšœ œ˜"Kšœ œ˜Kšœœ˜+—K˜šΟnœœ˜ š˜Kšœ%ΟcyœO˜ν—Kšœ$˜+Kš˜K˜šœ œœ˜Kšœ œœ˜Kšœ"œœ˜2KšœœœŸ˜BKšœœœ˜Kšœœœ˜Kšœ œ˜K˜——˜šœœœ˜Kšœ œœ˜Kšœœœ˜Kšœœœ˜K˜(KšœœœŸ˜8Kšœ œŸ6˜RK˜DK˜'K˜8Kšœœ˜Kšœ8Ÿ˜PKšœ*œ˜.Kšœ.œ˜2Kšœœœ˜!Kšœœ˜!Kšœ1œ˜6Kšœ1œ˜5Kšœ&œ˜*KšœœŸ˜IK˜——˜Kšœœ˜#—˜Kšœ œ˜Kšœ  œ˜Kšœ œ˜—˜K˜Kšœœ œ˜Kšœ/œ˜3K˜+K˜—K˜Kšœ™˜š žœœœ œŠœ%Ÿ˜ξKšœœœœ˜Kšœ9˜@šœœ ˜Kšœ#˜#K˜'K˜.K˜4K˜*K˜)—šœœ˜!šœ ˜K˜K˜DK˜5Kšœ˜—šœ™ K™K™—Kšœ@œ˜UK˜