RavenMarkerControlImpl.mesa
Copyright (C) Xerox Corporation 1984, 1985, 1986. All rights reserved.
Last edited by Jacks 23-Apr-86 16:35:13
Tim Diebert: December 2, 1986 4:07:02 pm PST
Ruseli Binsol: November 21, 1986 1:28:36 pm PST
<<This module is part of a multi-module monitor, the root of which is MarkerControlImpl.>>
DIRECTORY
BasicTime USING [GMT, Now, Period, Update],
IO,
MarkerControl USING [ClientProcs, ClientProcsHandle, EngineSpecific, MarkerStatus, RavenBuildVariant],
MarkerControlImpl,
MarkerControlInternal,
PaperHandling USING [BannerMode, PaperFeed, PaperStacking, PrintOrder, RavenRegistration, TwoPaperSizes],
PaperTypes USING [PaperSize],
PrintingState USING [Type],
PrintingTypes USING [Option, RavenBuild],
PrintQueue USING [Empty, nilQueueObjectHandle, ObjectStatus, QueueObjectHandle, QueueStage, Requeue],
Process USING [Detach, Pause, Priority, priorityBackground, SecondsToTicks, SetPriority, SetTimeout],
PSAsyncMsg USING [PutString],
RavenConsole USING [BlankDisplay, L2, L4, UpdateDisplay],
RavenCounter USING [ForceOut],
RavenEngine USING [DeclarePaperSupply, DozeOff, GetStatus, GetPrintingState, Job, JobHandle, SetJob, SetPrintingState, SetRegistration, WaitStatus, WaitPrintingState, WakeUp],
RavenMarkerControl,
RavenStatus USING [Type],
Rope USING [ROPE, ToRefText];
RavenMarkerControlImpl:
CEDAR
MONITOR
LOCKS root
IMPORTS
root: MarkerControlImpl, BasicTime, --DecomposerControl, -- IO, MarkerControlInternal, PrintQueue, Process, PSAsyncMsg, RavenConsole, RavenCounter, RavenEngine, Rope
EXPORTS RavenMarkerControl
SHARES MarkerControlImpl = BEGIN
ROPE: TYPE ~ Rope.ROPE;
JobStatus: TYPE = {normal, paused, canceled, errorL2};
RavenState:
TYPE =
RECORD [
jobStatus: JobStatus ← normal,
job: RavenEngine.JobHandle ← NIL,
lastEngineStatus: RavenStatus.Type ← fuserUnderTemperature,
allowedTraySwitch: BOOLEAN ← FALSE, -- allow one paper-tray-empty
banner: PaperHandling.BannerMode ← oncePerJob,
media: PaperHandling.TwoPaperSizes ← [letter, letter],
feeding: PaperHandling.PaperFeed ← fromBottomOrTop,
stacking: PaperHandling.PaperStacking ← aligned,
engineBuild: PrintingTypes.RavenBuild ← b1,
postedL2Status: BOOLEAN ← FALSE,
postedL4Status: BOOLEAN ← FALSE];
RavenClientProcsHandle: TYPE = REF raven MarkerControl.ClientProcs;
engineProblemEvent: CONDITION;
updateRavenLog: CONDITION;
engineStatusChange: CONDITION;
jobStateChange: CONDITION;
ravenState: REF RavenState ← NIL;
ravenClientProcs: RavenClientProcsHandle ← NIL;
lastActivityTimeStamp: BasicTime.GMT ← BasicTime.Now[]; --The time the last job completed marking.
********************************
PUBLIC PROCS:
********************************
Startup:
PUBLIC
INTERNAL
PROCEDURE [priority: Process.Priority]
RETURNS [MarkerControl.ClientProcsHandle] =
TRUSTED
BEGIN
Process.SetTimeout[@engineProblemEvent, Process.SecondsToTicks[2700]];-- 45 minute timeout
ravenState ← NEW[RavenState ← []];
ravenState.job ← NEW[RavenEngine.Job ← [document: NIL]];
ravenClientProcs ←
NEW[
raven MarkerControl.ClientProcs ← [
start: MarkerControlInternal.Start, stop: MarkerControlInternal.Stop,
stopped: MarkerControlInternal.Stopped, pause: MarkerControlInternal.Pause,
resume: MarkerControlInternal.Resume, status: Status,
waitStatusChange: WaitStatusChange,
setPrintOrder: MarkerControlInternal.SetPrintOrder,
modifyTraceLevel: MarkerControlInternal.ModifyTraceLevel,
engineSpecific: raven[
setEngineBuild: SetRavenEngineBuild, setFeeding: SetFeeding,
setPaper: SetPaper, setBanner: SetBanner,
setRegistration: SetRegistration, setStacking: SetStacking,
dozeoffEngine: DozeoffRavenEngine, wakeupEngine: WakeupRavenEngine]
]];
ravenState.lastEngineStatus ← RavenEngine.GetStatus[];
Process.Detach[FORK StatusChangeWatcher[]];
Process.Detach[FORK StatusWatcher[]];
Process.Detach[FORK RavenLogUpdater[]];
Process.Detach[FORK StatusReader[]];
IF ravenState.lastEngineStatus
IN [aboutToDozeOff..fuserUnderTemperature]
THEN
RavenEngine.WakeUp[];
Process.Detach[FORK MarkingControl[priority]];
RavenCounter.ForceOut[]; -- to start the logging; fixes AR 12573
RETURN[ravenClientProcs]
END; -- Startup
Status:
PUBLIC
PROCEDURE
RETURNS [MarkerControl.MarkerStatus] =
BEGIN
SELECT ravenState.engineBuild
FROM
b2TraySensing =>
BEGIN
ravenVariant: MarkerControl.RavenBuildVariant ← [b2TraySensing[[letter, letter]]]; --NOTE: paper size is hard coded!!!
RETURN [
[
activity: root.state.activity,
engineFault: root.state.engineProblem,
engine: [raven[
raven: ravenState.lastEngineStatus,
ravenVar: ravenVariant]]
]];
END;
b0 =>
RETURN [
[
activity: root.state.activity,
engineFault: root.state.engineProblem,
engine: [raven[
raven: ravenState.lastEngineStatus,
ravenVar: [b0[]]]]
]];
b1 =>
RETURN [
[
activity: root.state.activity,
engineFault: root.state.engineProblem,
engine: [raven[
raven: ravenState.lastEngineStatus,
ravenVar: [b1[]]]]
]];
b2XSISModified =>
RETURN [
[
activity: root.state.activity,
engineFault: root.state.engineProblem,
engine: [raven[
raven: ravenState.lastEngineStatus,
ravenVar: [b2XSISModified[]]]]
]];
ENDCASE =>
RETURN [
[
activity: root.state.activity,
engineFault: root.state.engineProblem,
engine: [raven[
raven: ravenState.lastEngineStatus,
ravenVar: [b2[]]]]
]];
END; --Status
********************************
PRIVATE PROCS:
********************************
SetBanner:
PROCEDURE [banner: PaperHandling.BannerMode] =
BEGIN ravenState.banner ← banner;
END; --SetBanner
SetFeeding:
PROCEDURE [feeding: PaperHandling.PaperFeed] =
BEGIN ravenState.feeding ← feeding;
END; --SetFeeding
SetPaper:
PROCEDURE [paperSupply: PaperHandling.TwoPaperSizes] =
BEGIN
CallModifyPaper:
ENTRY
PROC =
BEGIN ENABLE UNWIND => NULL; ModifyPaperSupply[paperSupply]; END;
IF
NOT root.state.idle
THEN TRUSTED {Process.Detach[FORK SetPaperWhenIdle[paperSupply]]}
ELSE CallModifyPaper[];
END; --SetPaper
SetRavenEngineBuild:
PROCEDURE [engineBuild: PrintingTypes.RavenBuild] =
BEGIN ravenState.engineBuild ← engineBuild;
END; --SetRavenEngineBuild
SetRegistration:
PROCEDURE [registration: PaperHandling.RavenRegistration] =
TRUSTED
BEGIN
CallModifyRegistration:
ENTRY
PROC =
TRUSTED
BEGIN
ENABLE
UNWIND =>
NULL;
ModifyRegistration[registration];
END;
IF
NOT root.state.idle
THEN Process.Detach[FORK SetRegistrationWhenIdle[registration]]
ELSE CallModifyRegistration[];
END; --SetRegistration
SetStacking:
ENTRY
PROCEDURE [stacking: PaperHandling.PaperStacking] =
BEGIN ENABLE UNWIND => NULL; ravenState.stacking ← stacking;
END; --SetStacking
WaitStatusChange:
ENTRY
PROCEDURE
RETURNS [MarkerControl.MarkerStatus] =
BEGIN
ENABLE UNWIND => NULL;
WAIT engineStatusChange;
ravenState.lastEngineStatus ← RavenEngine.GetStatus[];
RETURN[Status[]];
END; --WaitStatusChange
DozeoffRavenEngine:
PROCEDURE =
BEGIN
IF ravenState.engineBuild >= b2 THEN RavenEngine.DozeOff[]; -- fixes AR 10938
END; --DozeoffRavenEngine
WakeupRavenEngine:
PROCEDURE =
BEGIN RavenEngine.WakeUp[];
END; --WakeupRavenEngine
SetPaperWhenIdle:
ENTRY
PROCEDURE [paperSupply: PaperHandling.TwoPaperSizes] =
BEGIN
ENABLE UNWIND => NULL; -- FORKed by SetPaper
UNTIL root.state.idle DO WAIT root.event; ENDLOOP;
ModifyPaperSupply[paperSupply];
END; --SetPaperWhenIdle
ModifyPaperSupply:
INTERNAL
PROCEDURE [paperSupply: PaperHandling.TwoPaperSizes] =
BEGIN
ravenState.media ← paperSupply;
RavenEngine.DeclarePaperSupply[paperSupply];
END; --ModifyPaperSupply
SetRegistrationWhenIdle:
ENTRY
PROCEDURE [registration: PaperHandling.RavenRegistration] =
BEGIN
ENABLE UNWIND => NULL; -- FORKed by SetRegistration
UNTIL root.state.idle DO WAIT root.event; ENDLOOP;
ModifyRegistration[registration];
END; --SetRegistrationWhenIdle
ModifyRegistration:
INTERNAL
PROCEDURE [registration: PaperHandling.RavenRegistration] =
BEGIN
UNTIL root.state.idle DO WAIT root.event; ENDLOOP;
RavenEngine.SetRegistration[registration];
END; --ModifyRegistration
UpdateRavenLog:
ENTRY
PROCEDURE =
INLINE
BEGIN ENABLE UNWIND => NULL; NOTIFY updateRavenLog; END; --UpdateRavenLog
RavenLogUpdater:
ENTRY
PROCEDURE =
TRUSTED
BEGIN
ENABLE UNWIND => NULL;
Process.SetTimeout[@updateRavenLog, Process.SecondsToTicks[60 * 30 --ý hour-- ]];
Process.SetPriority[Process.priorityBackground];
DO
-- forever
WAIT updateRavenLog;
IF NOT root.state.idle THEN LOOP;
IF root.state.trace = verbose THEN PSAsyncMsg.PutString["Marker RavenCounter.ForceOut"];
RavenCounter.ForceOut[];
ENDLOOP;
END; --RavenLogUpdater
NotifyStatusChange:
ENTRY
PROCEDURE [status: RavenStatus.Type] =
BEGIN
ENABLE UNWIND => NULL;
ravenState.lastEngineStatus ← status;
BROADCAST engineStatusChange;
END; --NotifyStatusChange
StatusChangeWatcher:
ENTRY
PROCEDURE =
BEGIN
-- updates the Raven display if necessary
ENABLE UNWIND => NULL;
engineStatus: RavenStatus.Type;
DO
-- forever
engineStatus ← RavenEngine.GetStatus[];
SELECT engineStatus
FROM
imageFault =>
BEGIN
root.state.engineProblem ← TRUE;
NOTIFY engineProblemEvent;
Stop everything when an imaging error is detected...
root.state.stopStatus ← restart;
root.control.stop ← TRUE;
root.control.start ← root.control.pause ← root.control.resume ← root.control.pausing ← root.control.resuming ← root.control.resumeWhenAppropriate ← FALSE;
ravenState.jobStatus ← errorL2;
RavenConsole.UpdateDisplay[RavenConsole.L2];
ravenState.postedL2Status ← TRUE;
RavenEngine.SetPrintingState[completed];
END;
offLine =>
BEGIN
root.state.engineProblem ← TRUE;
NOTIFY engineProblemEvent;
IF root.state.activity = marking
THEN BEGIN
IF root.state.tpJob
THEN RavenEngine.SetPrintingState[completed] -- abort it
ELSE BEGIN
root.state.activity ← markingButInterruptable;
root.control.pause ← TRUE;
IF root.state.trace = verbose
THEN
PSAsyncMsg.PutString["Marker.Pause Internal"];
BROADCAST root.event;
END;
END;
END;
aboutToDozeOff =>
IF ravenState.engineBuild < b2 THEN ravenState.engineBuild ← b2;
tonerLow => NULL;
okay =>
BEGIN
IF ravenState.postedL2Status
OR ravenState.postedL4Status
THEN BEGIN
RavenConsole.BlankDisplay[]; -- get rid of the L4 display
ravenState.postedL2Status ← FALSE;
ravenState.postedL4Status ← FALSE;
END;
IF root.state.activity = markingButInterruptable
THEN
root.state.activity ← marking;
root.state.engineProblem ← FALSE;
IF root.state.activity = paused
OR root.control.pause
THEN BEGIN
root.control.resume ← TRUE;
IF root.state.trace = verbose
THEN
PSAsyncMsg.PutString["Marker.Resume Internal"];
BROADCAST root.event;
END;
END;
ENDCASE =>
BEGIN
root.state.engineProblem ← TRUE;
NOTIFY engineProblemEvent;
IF engineStatus = commandStatusFault
THEN BEGIN
RavenConsole.UpdateDisplay[RavenConsole.L4]; -- probably useless
ravenState.postedL4Status ← TRUE; -- so we remember to clear display
END;
IF root.state.activity = marking
THEN BEGIN
IF engineStatus = preRegistrationFault
-- allow tray switchover--
AND ravenState.feeding = fromBottomOrTop
AND ravenState.media.size1 = ravenState.media.size2
AND NOT ravenState.allowedTraySwitch
THEN ravenState.allowedTraySwitch ← TRUE
ELSE BEGIN
root.state.activity ← markingButInterruptable;
root.control.pause ← TRUE;
IF root.state.trace = verbose
THEN
PSAsyncMsg.PutString["Marker.Pause Internal"];
BROADCAST root.event;
END;
END;
END;
ravenState.lastEngineStatus ← engineStatus;
WAIT engineStatusChange;
ENDLOOP;
END; --StatusChangeWatcher
StatusWatcher:
PROCEDURE =
BEGIN
-- Forked process
status: RavenStatus.Type;
DO
-- forever
status ← RavenEngine.WaitStatus[];
IF status # ravenState.lastEngineStatus
OR status = imageFault
THEN
TRUSTED
BEGIN
--must process every image fault so printing gets stopped
Process.Detach[FORK NotifyStatusChange[status]]; -- avoid Monitor locks
IF root.state.trace # none THEN PSAsyncMsg.PutString["Raven Status Change"];
END;
ENDLOOP;
END; --StatusWatcher
StatusReader:
ENTRY
PROCEDURE =
BEGIN
-- Forked process
ENABLE UNWIND => NULL;
DO
UNTIL root.state.engineProblem DO WAIT engineProblemEvent; ENDLOOP;
RavenEngine.WakeUp; -- when there is a problem, wake it up every 45 min.
WAIT engineProblemEvent;
ENDLOOP;
END; -- StatusReader
MarkingControl:
ENTRY
PROCEDURE [priority: Process.Priority] =
BEGIN
ENABLE UNWIND => NULL;
Process.SetPriority[priority];
DO
--forever
SELECT
TRUE
FROM
root.control.tpQueueEntry
AND root.state.idle =>
BEGIN
-- over-rides root.state.stopped
root.state.tpJob ← TRUE;
IF
NOT MarkDocument[tpDecomposed]
THEN
BEGIN root.control.tpQueueEntry ← FALSE; LOOP; END;
END;
root.control.stop =>
SELECT
TRUE
FROM
root.state.stopped => NULL;
NOT root.state.idle
AND
NOT ravenState.jobStatus = canceled
AND
NOT ravenState.jobStatus = errorL2 =>
BEGIN
root.control.start ← root.control.pause ← root.control.resume ←
root.control.pausing ← root.control.resuming ←
root.control.resumeWhenAppropriate ← FALSE;
ravenState.jobStatus ← canceled;
RavenEngine.SetPrintingState[completed];
END;
root.state.idle => BEGIN root.state.stopped ← TRUE; NOTIFY root.stopped; END;
ENDCASE;
root.control.start =>
BEGIN
root.control.start ← root.state.stopped ← root.control.pause ←
root.control.resume ← root.control.pausing ← root.control.resuming ←
root.control.resumeWhenAppropriate ← FALSE; -- so we don't keep looking here
LOOP; -- make another pass
END;
root.control.pause =>
BEGIN
IF root.state.activity
IN [marking..markingButInterruptable]
THEN
TRUSTED
BEGIN
waitJobState: PROCESS RETURNS [PrintingState.Type];
engineState: PrintingState.Type;
RavenEngine.SetPrintingState[stopped];
waitJobState ← FORK WaitJobState[started, FALSE]; -- avoid MLs
WAIT jobStateChange;
engineState ← JOIN waitJobState;
IF engineState = stopped THEN root.state.activity ← paused;
root.control.resumeWhenAppropriate ← FALSE;
IF root.state.trace = verbose THEN PSAsyncMsg.PutString["Marking Paused"];
END;
NOTIFY root.paused;
root.control.pause ← FALSE;
END;
root.control.resume
OR root.control.resumeWhenAppropriate =>
BEGIN
root.control.resumeWhenAppropriate ← FALSE;
IF root.state.activity = paused
AND RavenEngine.GetPrintingState[] = stopped
AND root.state.clientPause = 0
THEN BEGIN
IF RavenEngine.GetStatus[] = okay
THEN
TRUSTED
BEGIN
waitJobState: PROCESS RETURNS [PrintingState.Type];
engineState: PrintingState.Type;
RavenEngine.SetPrintingState[started];
waitJobState ← FORK WaitJobState[stopped, FALSE]; -- avoid MLs
WAIT jobStateChange;
engineState ← JOIN waitJobState;
IF engineState = started THEN root.state.activity ← marking;
IF root.state.trace = verbose
THEN
PSAsyncMsg.PutString["Marking Resumed"];
END
ELSE
BEGIN
root.control.resumeWhenAppropriate ← TRUE;
IF root.state.trace = verbose
THEN
PSAsyncMsg.PutString["Marker.ResumeWhenAppropriate"];
END;
END;
root.control.resume ← FALSE;
END;
NOT root.state.idle => NULL; -- so we don't start multiple markers
root.control.jobQueueEntry =>
BEGIN
IF
NOT MarkDocument[decomposed]
THEN
BEGIN root.control.jobQueueEntry ← FALSE; LOOP; END;
END;
ENDCASE;
WAIT root.event;
ENDLOOP;
END; --MarkingControl
WaitJobState:
PROCEDURE [targetState: PrintingState.Type, targetEqual:
BOOLEAN]
RETURNS [pState: PrintingState.Type] =
BEGIN
-- FORKed to avoid MLs
NotifyJobStateChange: ENTRY PROC = BEGIN NOTIFY jobStateChange; END;
pState ← RavenEngine.WaitPrintingState[targetState, targetEqual];
NotifyJobStateChange[];
END; --WaitJobState
MarkDocument:
INTERNAL
PROCEDURE [fromQ: PrintQueue.QueueStage,
qOH: PrintQueue.QueueObjectHandle ← PrintQueue.nilQueueObjectHandle]
RETURNS [okay:
BOOLEAN] =
TRUSTED
BEGIN
root.state.qOH ← PrintQueue.Requeue[qOH: qOH, fromQueue: fromQ, toQueue: marking];
IF root.state.qOH = PrintQueue.nilQueueObjectHandle THEN RETURN[FALSE];
root.state.idle ← FALSE;
root.state.activity ← marking;
Process.Detach[FORK DoMarking];
IF root.state.trace # none
THEN BEGIN
PSAsyncMsg.PutString[Rope.ToRefText[IO.PutFR["Marking File \"%g\"; Copy Count: %g", IO.text[root.state.qOH.fileName], IO.card[root.state.qOH.numberCopies]]]];
END;
RETURN[TRUE];
END; -- MarkDocument
DoMarking:
PROCEDURE =
BEGIN
secondsToWait: LONG INTEGER ← 0;
decomposedDocument: Decompose.Handle ← LOOPHOLE[root.state.qOH.printObjectHandle];
qOHpaperSize: PaperTypes.PaperSize ← root.state.qOH.paper.knownSize;
root.state.qOH.currentStatus ← marking;
ravenState.jobStatus ← normal;
IF ravenState.lastEngineStatus
IN [aboutToDozeOff..fuserUnderTemperature]
THEN
RavenEngine.WakeUp[];
Initialize and set job record:
ravenState.job.document ← decomposedDocument.docTransferH;
ravenState.job.copyCount ← root.state.qOH.numberCopies;
ravenState.job.banner ←
SELECT
TRUE
FROM
root.state.tpJob => suppressed,
root.state.qOH.bannerOnly => oncePerJob,
ENDCASE => ravenState.banner;
ravenState.job.printOrder ← root.state.printOrder;
ravenState.job.paperFeed ←
IF ravenState.media.size1 # ravenState.media.size2
THEN
SELECT
TRUE
FROM
qOHpaperSize = ravenState.media.size1 => fromBottom,
qOHpaperSize = ravenState.media.size2 => fromTop,
ENDCASE => ravenState.feeding
ELSE ravenState.feeding;
ravenState.job.paperStacking ← ravenState.stacking;
RavenEngine.SetJob[ravenState.job];
IF root.state.waitBetweenJobs
THEN
BEGIN
<<The client may specify a number of seconds to wait between jobs. Usually this is done to allow spooling when spooling while marking is disabled and decomposing while marking is enabled. With such a set up, spool time is limited.>>
secondsToWait ←
--last activity time plus wait time minus current time
BasicTime.Period[
from: BasicTime.Update[lastActivityTimeStamp, root.state.betweenJobWaitTime],
to: BasicTime.Now[]];
IF secondsToWait > 0
THEN
BEGIN
IF root.state.trace = verbose
THEN
BEGIN
PSAsyncMsg.PutString[Rope.ToRefText[IO.PutFR["Wait %g seconds to allow spooling", IO.card[secondsToWait]]]];
END;
Process.Pause[Process.SecondsToTicks[CARDINAL[secondsToWait]]]; --Wait a few seconds to allow spooling
END;
END;
root.state.starting[];
root.state.startMarkDate ← BasicTime.Now[];
Check here for copyCount = 0 and don't pass those jobs to engine level...
IF ravenState.job.copyCount > 0
THEN
BEGIN
RavenEngine.SetPrintingState[started];
[] ← RavenEngine.WaitPrintingState[started, TRUE];
[] ← RavenEngine.WaitPrintingState[completed, TRUE]; -- returns when done
END;
root.state.finished[];
lastActivityTimeStamp ← BasicTime.Now[];
Queue[
SELECT ravenState.jobStatus
FROM
normal => printed,
errorL2 => restart,
ENDCASE => root.state.stopStatus];
MarkerControlInternal.SetActivity[available];
UpdateRavenLog[];
END; -- DoMarking
Queue:
ENTRY
PROCEDURE [status: PrintQueue.ObjectStatus] =
BEGIN
ENABLE UNWIND => NULL;
nsDone: ROPE ← "Done Marking \"%g\"; seconds = %g";
nsFail: ROPE ← "Mark Failure on \"%g\"; seconds = %g";
p: CARD ← BasicTime.Period[from: lastActivityTimeStamp, to: root.state.startMarkDate];
IF p >= 0 THEN root.state.qOH.markTime ← p;
root.state.qOH.currentStatus ← status;
ravenState.allowedTraySwitch ← FALSE;
SELECT
TRUE
FROM
status = printed
OR root.state.tpJob
--any tp failure-- =>
BEGIN
IF root.state.trace # none
THEN
PSAsyncMsg.PutString[Rope.ToRefText[IO.PutFR[nsDone, IO.text[root.state.qOH.fileName], IO.card[root.state.qOH.markTime]]]];
[] ← PrintQueue.Requeue[qOH: root.state.qOH, fromQueue: marking, toQueue: marked];
END;
status = restart =>
BEGIN
-- requeue document
<<NOTE: Currently restart documents are requeued to the spooled queue. In the future we may with to save the decompose object and requeue them to the decomposed queue. (Currently, the Stop Printing command requeues all decomposed documents to the spooled queue.)>>
IF root.state.trace # none
THEN
PSAsyncMsg.PutString[Rope.ToRefText[IO.PutFR[nsDone, IO.text[root.state.qOH.fileName], IO.card[root.state.qOH.markTime]]]];
IF root.state.qOH.printObjectHandle #
NIL
THEN
BEGIN
Must free decompose handle before requeuing doc.
DecomposerControl.FreeDecomposeObject[root.state.qOH.uid];
root.state.qOH.printObjectHandle ← NIL;
END;
[] ← PrintQueue.Requeue[qOH: root.state.qOH, fromQueue: marking,
toQueue: spooledNormal, position: front];
IF ravenState.jobStatus = errorL2
THEN
TRUSTED
BEGIN
Process.Detach[FORK root.state.engineFailure[]];
END;
END;
ravenState.jobStatus = canceled =>
BEGIN
IF root.state.trace # none
THEN
PSAsyncMsg.PutString[Rope.ToRefText[IO.PutFR[nsDone, IO.text[root.state.qOH.fileName], IO.card[root.state.qOH.markTime]]]];
[] ← PrintQueue.Requeue [qOH: root.state.qOH, fromQueue: marking, toQueue: aborted];
IF root.state.canceledWhileMarking #
NIL
THEN
root.state.canceledWhileMarking [root.state.qOH.fileName, status];
END;
ENDCASE =>
BEGIN
IF root.state.trace # none
THEN
PSAsyncMsg.PutString[Rope.ToRefText[IO.PutFR[nsFail, IO.text[root.state.qOH.fileName], IO.card[root.state.qOH.markTime]]]];
[] ← PrintQueue.Requeue[qOH: root.state.qOH, fromQueue: marking, toQueue: errors];
END;
ravenState.job.lastPage ← LAST[CARDINAL]; -- was modified by RavenEngine??
root.state.tpJob ← FALSE;
root.control.jobQueueEntry ← NOT PrintQueue.Empty[decomposed];
root.control.tpQueueEntry ← NOT PrintQueue.Empty[tpDecomposed];
BROADCAST root.event; -- in case there's something to do
END; --Queue
END. --RavenMarkerControlImpl
LOG when - who - what
3-Feb-84 18:09:17 - Jacks - Created (split off from MarkerControlImpl).
8-Mar-84 8:10:23 - Jacks - state.clientPause changed from BOOLEAN to CARDINAL; implemented requeuing of canceled docs.
5-Apr-84 0:14:49 - Strickberger - Merged code for commandStatusFault in StatusChangeWatcher into the ENDCASE with the other engine problems.
10-Apr-84 22:36:29 - Strickberger - Added code to clear the L4 display the next time RavenEngine.GetStatus returns okay.
24-Apr-84 21:40:48 - Okamoto - Stored markTime of QueueObject and displayed marking time in trace output.
16-Jul-84 16:35:31 - Jacks - Added "root.state.clientPause = 0" check to root.control.resume arm of MarkingControl and removed it from okay arm of StatusChangeWatcher.
17-Jul-84 14:44:15 - Jacks - Added trace code.
10-Aug-84 13:47:32 - Jacks - Added a wait between jobs to allow spooling.
Changes after Print Service 8.0:
30-Aug-84 13:02:13 - Jacks - New Decompose.bcd: transferH became docTransferH.
18-Sep-84 13:01:05 - Jacks - Updated to 9.0 interfaces.
8-Nov-84 16:50:27 - Jacks - Updated to second round of 9.0 interface changes; changed Stop parm from queue to status.
4-Feb-85 13:38:34 - Jacks - Moved SetActivity[available] after Queue[] at end of DoMarking.
18-Jun-85 14:02:30 - Jacks - Added copyright notice; updated to
PS Euclid interfaces.
6-Aug-85 9:14:37 - Jacks - Updated to 10.0 DecomposerControl.FreeDecomposeObject.
23-Sep-85 15:24:31 - Jacks - Only pause between jobs if client requests it.
4-Oct-85 9:34:17 - Jacks - Set printObjectHandle to NIL after calling DecomposerControl.FreeDecomposeObject; AppendLongDecimal sCopies in MarkDocument to avoid bounds fault.
1-Nov-85 11:06:42 - Jacks - Check for 0 copyCount in DoMarking.
23-Apr-86 16:35:09 - Jacks - Rewrote handling of imageFault status: now requeue doc and stop printing internally; requeue restart docs to FRONT of spooled queue.