RavenTestImpl.mesa
Copyright (C) Xerox Corporation 1981, 1982, 1983, 1984, 1985, 1986. All rights reserved.
Last edited by prochaska 14-May-86 19:25:11
Tim Diebert: December 2, 1986 2:26:29 pm PST
DIRECTORY
Ascii USING [BEL, ControlZ],
BasicTime USING [Now],
Convert USING [AppendCard, AppendTime],
Loader USING [BCDBuildTime],
LSEPDiagnostics USING [BuildImageSample, ImageFault, InterpretImageSample],
NSExec USING [ClientID, GetTTY, localExec, OutputHandle, PutAsyncMessage, PutMessage],
NSString USING [AppendToMesaString, CopyString, MakeString, nullString, String, StringRep, StringFromMesaString],
PaperHandling USING [PaperStacking, RavenRegLong, RavenRegShort, Registration],
PrintingState,
PrintingTypes USING [Option],
Process USING [ Abort, GetPriority, MsecToTicks, Pause, Priority, priorityForeground, SecondsToTicks, SetPriority],
PSCommand USING [ GetPrintServiceStatus, PrintFile, PrintFileOptions, PaperTray, SetRegistration],
PSExec USING [GetClientID],
PSState USING [State],
RasterLogFont USING [TransferStringSequence],
RavenBansheeMessage USING [GetNSMessage, Key],
RavenConsole USING [ BlankDisplay, Character, D1, D2, D3, D4, D5, D6, D7, D9, DC, displayAnalystLog, displayTechRepLog, DisplayCode, enterRepairMode, exitRepairMode, KeyPadCode, printAnalystLog, printTechRepLog, readRegistration, resetLog, runCommandStatusTest, runImageTest, runTestJob, setRegistration, UpdateDisplay, WaitKeyPadCode],
RavenControl USING [ EventContext, GetEngineStatus, RunTurnaroundTest, SetToCurrentEventContext, WaitEngineEvent, WaitEngineStatus],
RavenCounter USING [Get, Handle, Item, Reset],
RavenEngine USING [ --Job, SetJob, -- GetPrintingState, SetPrintingState, WaitPrintingState],
RavenTest USING [],
RefText USING [Append, AppendChar],
Rope USING [ToRefText],
StringSequence USING [Create, Delete, Handle, learSieglerStringLength],
TestPattern USING [Name, NotFound, TestPatternID],
TextInput USING [ChoiceIndex, Choices, GetChoice, GetYesNo],
ThisMachine USING [ProcessorID],
TTY USING [Handle, Rubout],
XFormat USING [CR, Handle, NSLine, NSString],
XMessage USING [Compose, StringArray];
RavenTestImpl: CEDAR PROGRAM
IMPORTS BasicTime, Convert, LSEPDiagnostics, Loader, NSExec, NSString, PSExec, PSCommand, Process, --RasterLogFont, -- RavenBansheeMessage, RavenConsole, RavenControl, RavenCounter, RavenEngine, RefText, Rope, StringSequence, TestPattern, TextInput, ThisMachine, TTY, XFormat, XMessage
EXPORTS RavenTest = BEGIN
Variables:
keyPadCode: RavenConsole.KeyPadCode;
localTTY: TTY.Handle ← NSExec.GetTTY[NSExec.localExec];
localOutput: XFormat.Handle ← NSExec.OutputHandle[NSExec.localExec];
TYPEs:
LogItem: TYPE = RECORD [counter: RavenCounter.Item, message: RavenBansheeMessage.Key];
Constants
jamList: ARRAY [0..6) OF LogItem = [
[feederFaultBottom, c4BottomFeederFault], [feederFaultTop, c4TopFeederFault], [
registrationJam, e2PostRegistrationJam], [fuserJam, e3PreExitJam], [
noExit, e4OutputTrayFullB0B1PostExitJamB2], [
outputTrayFull, f5OutputTrayFullB2]];
commandList: ARRAY [0..10) OF LogItem = [
[feedBottomAligned, feedBottomAligned], [feedBottomOffset, feedBottomOffset], [
feedTopAligned, feedTopAligned], [feedTopOffset, feedTopOffset], [
solicitStatus, solicitStatus], [solicitPaperSize, solicitPaperSize], [
display, display], [dozeOff, dozeOff], [wakeUp, wakeUp], [beep, beep]];
statusList: ARRAY [0..29) OF LogItem = [
[readyToFeed, readyToFeed], [feeding, feeding], [pageSync, pageSync], [
pageAtOutputTray, pageAtOutputTray], [fuserCold, fuserCold], [
tonerLow, tonerLow], [interlockOpen, interlockOpen], [
feedTraysNotEngaged, feedTraysNotEngaged], [
displayAcknowledge, displayAcknowledge], [aboutToDozeOff, aboutToDozeOff], [
paperSmallSmall, paperSmallSmall], [paperSmallLarge, paperSmallLarge], [
paperLargeSmall, paperLargeSmall], [paperLargeLarge, paperLargeLarge], [
key0to9, key0to9], [keyClear, keyClear], [keyTest, keyTest], [
keyOnLine, keyOnLine], [onLine, onLine], [keyOffLine, keyOffLine], [
goingOffLine, goingOffLine], [offLine, offLine], [parityError, parityError], [
illegalCharacter, illegalCharacter], [illegalSequence, illegalSequence], [
statusError, statusError], [noStatus, noStatus], [
statusOverRun, statusOverRun], [undefinedStatus, undefinedStatus]];
plateStatusList: ARRAY [0..2) OF LogItem = [
[bandOverrun, bandOverrun], [pageSyncMiss, pageSyncMiss]];
statusExtrasList: ARRAY [0..5) OF LogItem = [
[imageFault1, imageFault1], [imageFault2, imageFault2], [
imageFault3, imageFault3], [sequenceFault, sequenceFault], [
communicationFault, communicationFault]];
PUBLIC PROCEDUREs:
RunServeTestMode: PUBLIC PROCEDURE = BEGIN
ENABLE TTY.Rubout => CONTINUE;
testChoices: REF TextInput.Choices ← NEW[TextInput.Choices[6]];
testChoices.data[0] ← RavenBansheeMessage.GetNSMessage[exit];
testChoices.data[1] ← RavenBansheeMessage.GetNSMessage[commandStatusTurnaroundTest];
testChoices.data[2] ← RavenBansheeMessage.GetNSMessage[imageTest];
testChoices.data[3] ← RavenBansheeMessage.GetNSMessage[displayTechRepLog];
testChoices.data[4] ← RavenBansheeMessage.GetNSMessage[printTechRepLog];
testChoices.data[5] ← RavenBansheeMessage.GetNSMessage[resetTechRepLog];
DO
display a list of numbered test choices and get input; default is exit
SELECT TextInput.GetChoice[
tty: localTTY, prompt: RavenBansheeMessage.GetNSMessage[selectFrom],
choices: testChoices, default: 0 ! TTY.Rubout => EXIT] FROM
0 => EXIT;
1 => BEGIN -- command status turnaround test
localOutput.CR[];
UNTIL TextInput.GetYesNo[
tty: localTTY, -- continue displaying prompt until response is affirmative
prompt: RavenBansheeMessage.GetNSMessage[installTurnaroundPlug],
default: yes ! TTY.Rubout => GOTO abortTests] = yes DO ENDLOOP;
DO
localOutput.CR[];
localOutput.NSString[ -- display heading
RavenBansheeMessage.GetNSMessage[commandStatusTurnaroundTest2]];
localOutput.NSLine[
RavenBansheeMessage.GetNSMessage[
IF RavenControl.RunTurnaroundTest[] THEN working ELSE failing]];
localOutput.CR[];
IF TextInput.GetYesNo[
tty: localTTY, -- prompt for repeat test response
prompt: RavenBansheeMessage.GetNSMessage[repeatTest], default: yes !
TTY.Rubout => GOTO abortTests] = no THEN EXIT;
ENDLOOP;
localOutput.CR[];
UNTIL TextInput.GetYesNo[tty: localTTY, -- display prompt until affirmative answer is received
prompt: RavenBansheeMessage.GetNSMessage[removeTurnaroundPlug],
default: yes ! TTY.Rubout => GOTO abortTests] = yes DO ENDLOOP;
localOutput.CR[];
UNTIL TextInput.GetYesNo[tty: localTTY, -- display prompt until affirmative answer is received
prompt: RavenBansheeMessage.GetNSMessage[reconnectPrinter],
default: yes ! TTY.Rubout => GOTO abortTests] = yes DO ENDLOOP;
END;
2 => BEGIN -- image test
fault: LSEPDiagnostics.ImageFault;
localOutput.CR[];
localOutput.NSString[RavenBansheeMessage.GetNSMessage[imageTest2]];
fault ← RunImageTestInternal[];
localOutput.NSLine[RavenBansheeMessage.GetNSMessage[
SELECT fault FROM
noFault => working,
fault1 => imageTestFailingCode1,
fault2 => imageTestFailingCode2,
fault3 => imageTestFailingCode3,
fault4 => imageTestFailingCode4,
fault5 => imageTestFailingCode5,
fault6 => imageTestFailingCode6,
fault7 => imageTestFailingCode7,
fault8 => imageTestFailingCode8,
aborted => imageTestAbortedOther,
ENDCASE => imageTestAbortedTPProblem]];
localOutput.CR[];
END;
3 => BEGIN -- display tech rep log
sequence: StringSequence.Handle;
sequence ← StringSequence.Create[
sequenceLength: 68,
stringLength: StringSequence.learSieglerStringLength];
BuildTechRepLog[sequence: sequence];
FOR index: CARDINAL IN [0..sequence.length) DO
screen display loop
NSExec.PutMessage[
exec: NSExec.localExec,
string: NSString.StringFromMesaString[s: sequence[index]]];
ENDLOOP;
StringSequence.Delete[sequence: sequence];
END;
4 => BEGIN -- print tech rep log
PrintTechRepLog[];
END;
5 => BEGIN -- reset tech rep log
IF TextInput.GetYesNo[
tty: localTTY, -- prompt for repeat test response
prompt: RavenBansheeMessage.GetNSMessage[pleaseConfirm], default: no !
TTY.Rubout => GOTO abortTests] = yes THEN BEGIN
RavenCounter.Reset;
Process.Pause[Process.SecondsToTicks[1]];
END;
END;
ENDCASE;
ENDLOOP;
EXITS abortTests => NULL;
END; -- RunServeTestMode
WaitRepairModeRequest: PUBLIC PROCEDURE = BEGIN
DO
SELECT RavenConsole.WaitKeyPadCode[] FROM
RavenConsole.enterRepairMode => EXIT;
ENDCASE;
ENDLOOP;
END; -- WaitRepairModeRequest
AlternateDisplay: PROCEDURE [firstCode, secondCode: RavenConsole.DisplayCode] =
BEGIN
displays first code, then second code, then blanks display
loops until aborted
DO
RavenConsole.UpdateDisplay[firstCode];
Process.Pause[Process.MsecToTicks[750] ! ABORTED => EXIT];
RavenConsole.UpdateDisplay[secondCode];
Process.Pause[Process.SecondsToTicks[2] ! ABORTED => EXIT];
RavenConsole.BlankDisplay;
ENDLOOP;
END; -- AlternateDisplay
displayAlternating: PROCESS;
RunRepairMode: PUBLIC PROCEDURE = BEGIN
ListTechRepLog: PROCEDURE = BEGIN
displays log, pausing at end of each screen for Raven test key
psClientID: NSExec.ClientID ← PSExec.GetClientID[];
sequence: StringSequence.Handle;
beepClear: REF TEXTNEW[TEXT[2]];
line: CARDINAL ← 0;
screenLines: CARDINAL = 23;
beepClear ← RefText.AppendChar[beepClear, Ascii.BEL];
beepClear ← RefText.AppendChar[beepClear, Ascii.ControlZ];
sequence ← StringSequence.Create[
sequenceLength: 68, stringLength: StringSequence.learSieglerStringLength];
BuildTechRepLog[sequence: sequence];
DO -- log display loop
NSExec.PutAsyncMessage[
exec: NSExec.localExec,
string: NSString.StringFromMesaString[s: beepClear], id: psClientID];
FOR index: CARDINAL IN [line..MIN[line + screenLines, sequence.length]) DO
screen display loop
NSExec.PutAsyncMessage[
exec: NSExec.localExec,
string: NSString.StringFromMesaString[s: sequence[index]],
id: psClientID];
Process.Pause[Process.MsecToTicks[100]]; -- for SCS bug
ENDLOOP;
IF (line ← line + screenLines) >= sequence.length THEN EXIT;
keyPadCode ← RavenConsole.WaitKeyPadCode[];
IF keyPadCode.sort = clear THEN EXIT;
ENDLOOP;
StringSequence.Delete[sequence];
END; -- ListTechRepLog
ReadRegistration: PROCEDURE = BEGIN
displays the registration values from PSCommand.State record requires input from console before displaying long and short axis registrations
state: REF raven PSState.State;
state ← NARROW[PSCommand.GetPrintServiceStatus[]]; -- get values from State record
RavenConsole.UpdateDisplay[code: RavenConsole.D7];
keyPadCode ← RavenConsole.WaitKeyPadCode[]; -- wait for test key input before displaying
SELECT keyPadCode.sort FROM
clear => RETURN;
test => -- display long axis registration
RavenConsole.UpdateDisplay[
code: [
LOOPHOLE[state.registration.long / 10],
LOOPHOLE[state.registration.long MOD 10]]];
ENDCASE;
keyPadCode ← RavenConsole.WaitKeyPadCode[]; -- wait for test key input before displaying
SELECT keyPadCode.sort FROM
clear => RETURN;
test => -- display short axis registration
RavenConsole.UpdateDisplay[
code: [
LOOPHOLE[state.registration.short / 10],
LOOPHOLE[state.registration.short MOD 10]]];
ENDCASE;
keyPadCode ← RavenConsole.WaitKeyPadCode[];
END; -- ReadRegistration
RunCommandStatusTest: PROCEDURE = BEGIN
displays every console character for one second each
following the display, waits for entry of test key in order to exit
RavenConsole.UpdateDisplay[RavenConsole.D6];
Process.Pause[Process.SecondsToTicks[1]];
FOR character: RavenConsole.Character IN RavenConsole.Character DO
RavenConsole.BlankDisplay;
RavenConsole.UpdateDisplay[code: [character, character]];
Process.Pause[Process.SecondsToTicks[1]];
ENDLOOP;
DO
keyPadCode ← RavenConsole.WaitKeyPadCode[];
IF keyPadCode.sort = test THEN EXIT;
ENDLOOP;
END; -- RunCommandStatusTest
RunImageTest: PROCEDURE = BEGIN
builds images, prints test patterns
fault: LSEPDiagnostics.ImageFault;
RavenConsole.UpdateDisplay[RavenConsole.D5];
three print cycles, monitoring Video Data, Line Sync, and Video Clock signals
THROUGH [0..3) DO
fault ← RunImageTestInternal[];
SELECT fault FROM
notTested =>
BEGIN RavenConsole.UpdateDisplay[code: [letterF, letterE]]; EXIT; END;
aborted =>
BEGIN RavenConsole.UpdateDisplay[code: [letterE, letterE]]; EXIT; END;
ENDCASE => RavenConsole.UpdateDisplay[code: [digit0, LOOPHOLE[fault]]];
ENDLOOP;
Process.Pause[Process.SecondsToTicks[5]];
END;
RunTestJob: PROCEDURE = BEGIN
prints a test pattern
requires console input for four parameters for PrintTestPattern
copyCount: CARDINAL;
testPatternName: NSString.String;
testPatternStacking: PaperHandling.PaperStacking;
testPatternTray: PSCommand.PaperTray;
DO -- loop until a single, non-zero digit is entered, followed by test key
this input identifies the test pattern to be printed
displayAlternating ← FORK AlternateDisplay[
RavenConsole.D4, [digit0, digit1]]; -- alternate displaying "D4" and "01"
keyPadCode ← RavenConsole.WaitKeyPadCode[];
TRUSTED {Process.Abort[displayAlternating]};
SELECT keyPadCode.sort FROM
clear => RETURN;
test =>
IF keyPadCode.value IN TestPattern.TestPatternID THEN
BEGIN
testPatternName ← TestPattern.Name[
keyPadCode.value ! TestPattern.NotFound => GOTO noTestPattern];
EXIT;
END;
ENDCASE;
ENDLOOP;
DO -- loop until one or two digits are entered for the copy count
displayAlternating ← FORK AlternateDisplay[
RavenConsole.D4, [digit0, digit2]]; -- alternate displaying "D4" and "02"
keyPadCode ← RavenConsole.WaitKeyPadCode[];
TRUSTED {Process.Abort[displayAlternating]};
SELECT keyPadCode.sort FROM
clear => RETURN;
test =>
IF keyPadCode.value IN [1..99] THEN
BEGIN -- changed from 0 for AR 9904; 0 copies hung
copyCount ← keyPadCode.value;
EXIT;
END;
ENDCASE;
ENDLOOP;
DO -- loop until "1" or "2" is entered as top or bottom paper tray indicator
displayAlternating ← FORK AlternateDisplay[
RavenConsole.D4, [digit0, digit3]]; -- alternate displaying "D4" and "03"
keyPadCode ← RavenConsole.WaitKeyPadCode[];
TRUSTED {Process.Abort[displayAlternating]};
SELECT keyPadCode.sort FROM
clear => RETURN;
test =>
SELECT keyPadCode.value FROM
1 => BEGIN testPatternTray ← top; EXIT; END; -- Temporary?
2 => BEGIN testPatternTray ← bottom; EXIT; END; -- Temporary?
ENDCASE;
ENDCASE;
ENDLOOP;
DO -- loop until entry of "1", "2", or "3", indicating stacking choice
displayAlternating ← FORK AlternateDisplay[
RavenConsole.D4, [digit0, digit4]]; -- alternate displaying "D4" and "04"
keyPadCode ← RavenConsole.WaitKeyPadCode[];
TRUSTED {Process.Abort[displayAlternating]};
SELECT keyPadCode.sort FROM
clear => RETURN;
test =>
SELECT keyPadCode.value FROM
1 => BEGIN testPatternStacking ← aligned; EXIT; END;
2 => BEGIN testPatternStacking ← documentOffset; EXIT; END;
3 => BEGIN testPatternStacking ← jobOffset; EXIT; END;
ENDCASE;
ENDCASE;
ENDLOOP;
RavenConsole.UpdateDisplay[RavenConsole.D4]; -- refresh display of "D4"
PSCommand.PrintFile[
fileName: testPatternName,
senderName: RavenBansheeMessage.GetNSMessage[repairMode],
copies: copyCount,
options: [
var: raven[tray: testPatternTray, stacking: testPatternStacking]]];
[] ← RavenEngine.WaitPrintingState[targetState: started, targetEqual: TRUE];
UNTIL RavenEngine.GetPrintingState[] = completed DO
SELECT RavenControl.GetEngineStatus[] FROM
IN [communicationFault..sequenceFault] => -- includes imageFault
BEGIN
RavenEngine.SetPrintingState[completed]; -- abort test job
EXIT;
END;
ENDCASE;
Process.Pause[Process.SecondsToTicks[1]];
ENDLOOP;
EXITS
noTestPattern =>
BEGIN
RavenConsole.UpdateDisplay[code: [letterF, letterE]];
Process.Pause[Process.SecondsToTicks[5]];
END;
END; -- RunTestJob
SetRegistration: PROCEDURE =
BEGIN
sets value of registration in PSState record
requires two console input items for the registation values
r: raven PaperHandling.Registration;
DO -- loop until a value in [10..43] is entered for the long axis registration
displayAlternating ← FORK AlternateDisplay[
RavenConsole.D3, [digit0, digit1]]; -- alternate displaying "D3" and "01"
keyPadCode ← RavenConsole.WaitKeyPadCode[];
TRUSTED {Process.Abort[displayAlternating]};
SELECT keyPadCode.sort FROM
clear => RETURN;
test =>
IF keyPadCode.value IN PaperHandling.RavenRegLong THEN
BEGIN r.reg.long ← keyPadCode.value; EXIT; END;
ENDCASE;
ENDLOOP;
DO -- loop until a value in [1..30] is entered for the short axis registration
displayAlternating ← FORK AlternateDisplay[
RavenConsole.D3, [digit0, digit2]]; -- alternate displaying "D3" and "02"
keyPadCode ← RavenConsole.WaitKeyPadCode[];
TRUSTED {Process.Abort[displayAlternating]};
SELECT keyPadCode.sort FROM
clear => RETURN;
test =>
IF keyPadCode.value IN PaperHandling.RavenRegShort THEN
BEGIN r.reg.short ← keyPadCode.value; EXIT; END;
ENDCASE;
ENDLOOP;
RavenConsole.UpdateDisplay[RavenConsole.D3]; -- refresh display of "D3"
PSCommand.SetRegistration[r];
Process.Pause[Process.SecondsToTicks[1]];
END; -- SetRegistration
body of RunRepairMode
DO
RavenConsole.UpdateDisplay[RavenConsole.DC];
keyPadCode ← RavenConsole.WaitKeyPadCode[];
SELECT keyPadCode FROM
RavenConsole.displayAnalystLog, RavenConsole.displayTechRepLog =>
BEGIN RavenConsole.UpdateDisplay[RavenConsole.D1]; ListTechRepLog[]; END;
RavenConsole.resetLog =>
BEGIN
RavenConsole.UpdateDisplay[RavenConsole.D2];
RavenCounter.Reset[];
Process.Pause[Process.SecondsToTicks[5]];
END;
RavenConsole.setRegistration => SetRegistration[];
RavenConsole.runTestJob => RunTestJob[];
RavenConsole.runImageTest => RunImageTest[];
RavenConsole.runCommandStatusTest => RunCommandStatusTest[];
RavenConsole.readRegistration => ReadRegistration[];
RavenConsole.printAnalystLog, RavenConsole.printTechRepLog =>
BEGIN
RavenConsole.UpdateDisplay[RavenConsole.D9];
PrintTechRepLog[];
END;
RavenConsole.exitRepairMode => EXIT;
ENDCASE;
ENDLOOP;
RavenConsole.BlankDisplay;
END; -- RunRepairMode
PRIVATE PROCEDUREs:
BuildTechRepLog: PROCEDURE [sequence: StringSequence.Handle] = BEGIN
called by DisplayLog to put appropriate text into sequence
dataBase: RavenCounter.Handle;
ExpandAppendFreeBump: PROCEDURE [messageKey: RavenBansheeMessage.Key] = BEGIN
inserts arguments into a message, places the string into the string sequence, and increments the index
expandedString ← XMessage.Compose[
source: RavenBansheeMessage.GetNSMessage[messageKey],
args: expansionString];
NSString.AppendToMesaString[to: sequence[index], from: expandedString];
index ← index + 1;
END; -- ExpandAppendFreeBump
FormatLogCounterMessage: PROCEDURE [item: RavenCounter.Item,
messageKey: RavenBansheeMessage.Key] = BEGIN
mesaString.length ← 0;
mesaString ← Convert.AppendCard[mesaString, dataBase.counter[item]];
expansionString.data[1] ← mesaString;
ExpandAppendFreeBump[messageKey];
expansionString.data[1] ← NSString.nullString;
END; -- FormatLogCounterMessage
expansionString: REF XMessage.StringArray ← NEW[XMessage.StringArray[2]]; -- for arguments to embed in message
expandedString: NSString.String; -- string for message with embedded arguments
index: CARDINAL ← 0;
body of BuildTechRepLog
mesaString: REF TEXTNEW[TEXT[StringSequence.learSieglerStringLength]];
nsString: NSString.String ← NSString.MakeString[
bytes: StringSequence.learSieglerStringLength];
used for appending dates:
sDateAndTime: NSString.String ← NEW[NSString.StringRep[40]];
nsDateAndTime: NSString.String ← NSString.StringFromMesaString[sDateAndTime];
used for appending counters:
rateFormat: Format.NumberFormat = [
base: 10, zerofill: TRUE, unsigned: TRUE, columns: counterFieldWidth];
decFormat: Format.NumberFormat = [
base: 10, zerofill: FALSE, unsigned: TRUE, columns: 0];
hexFormat: Format.NumberFormat = [
base: 16, zerofill: FALSE, unsigned: TRUE, columns: 0];
counterFieldWidth: CARDINAL = 10;
dataBase ← RavenCounter.Get[]; -- get event counts from log
expansionString.data[0] ← NSString.nullString;
Make "Tech Rep Log Of..." line
nsString.length ← 0;
nsDateAndTime.length ← 0;
nsDateAndTime ← Convert.AppendTime[to: nsDateAndTime, from: BasicTime.Now[]];
appends time to nsDateAndTime
expansionString.data[1] ← nsDateAndTime;
ExpandAppendFreeBump[xerox804xTechRepLogOf];
Make "Host #" line
mesaString.length ← 0;
expansionString.data[1] ← Rope.ToRefText[ThisMachine.ProcessorID[$ProductSoftware]];
ExpandAppendFreeBump[host];
Make "Software Of..." line
nsString.length ← 0;
nsDateAndTime.length ← 0;
nsDateAndTime ← Convert.AppendTime[to: nsDateAndTime, from: Loader.BCDBuildTime[], end: seconds];
expansionString.data[1] ← nsDateAndTime;
ExpandAppendFreeBump[softwareOf];
Make "Last Reset On..." line
nsString.length ← 0;
nsDateAndTime.length ← 0;
nsDateAndTime ← Convert.AppendTime[to: nsDateAndTime, from: dataBase.resetTime, end: seconds];
expansionString.data[1] ← nsDateAndTime;
ExpandAppendFreeBump[lastResetOn];
Make "Feeds..." line
mesaString.length ← 0;
mesaString ← Convert.AppendCard[mesaString, dataBase.counter[feeding]];
expansionString.data[1] ← mesaString;
ExpandAppendFreeBump[feedsSinceLastReset];
index ← index + 1;
Make "Jam Counters" line
ExpandAppendFreeBump[jamCountersTotalRate];
Make the Jam Counters log block
FOR i: CARDINAL IN [0..LENGTH[jamList]) DO
feeds: LONG CARDINAL;
feeds ←
SELECT jamList[i].counter FROM
feederFaultBottom =>
dataBase.counter[feedBottomAligned] + dataBase.counter[
feedBottomOffset],
feederFaultTop =>
dataBase.counter[feedTopAligned] + dataBase.counter[feedTopOffset],
ENDCASE => dataBase.counter[feeding];
mesaString.length ← 0;
mesaString ← Convert.AppendCard[mesaString, dataBase.counter[jamList[i].counter]];
FOR character: CARDINAL IN [0..counterFieldWidth - 1) DO
IF mesaString[character] = '0 THEN mesaString[character] ← '. ELSE EXIT;
ENDLOOP;
expansionString.data[0] ← NSString.CopyString[mesaString];
mesaString.length ← 0;
IF feeds = 0 THEN mesaString ← RefText.Append[to: mesaString, from: "**********"]
ELSE BEGIN
mesaString ← Convert.AppendCard[mesaString, (dataBase.counter[jamList[i].counter] / feeds) * 1000];
FOR character: CARDINAL IN [0..counterFieldWidth - 1) DO
IF mesaString[character] = '0 THEN mesaString[character] ← '. ELSE EXIT;
ENDLOOP;
END;
expansionString.data[1] ← mesaString;
ExpandAppendFreeBump[jamList[i].message];
ENDLOOP;
expansionString.data[0] ← expansionString.data[1] ← NSString.nullString;
Make "Rate =..." line
ExpandAppendFreeBump[rateTotalTotalFeeds];
Make the Command Counters log block
index ← index + 1;
ExpandAppendFreeBump[commandCounters];
FOR i: CARDINAL IN [0..LENGTH[commandList]) DO
FormatLogCounterMessage[commandList[i].counter, commandList[i].message];
ENDLOOP;
Make the Status Counters log block
index ← index + 1;
ExpandAppendFreeBump[statusCounters];
FOR i: CARDINAL IN [0..LENGTH[statusList]) DO
FormatLogCounterMessage[statusList[i].counter, statusList[i].message];
ENDLOOP;
Make the Plate Status Counters log block
index ← index + 1;
ExpandAppendFreeBump[plateStatusCounters];
FOR i: CARDINAL IN [0..LENGTH[plateStatusList]) DO
FormatLogCounterMessage[
plateStatusList[i].counter, plateStatusList[i].message];
ENDLOOP;
Make the Status Extras Counters log block
index ← index + 1;
ExpandAppendFreeBump[statusExtrasCounters];
FOR i: CARDINAL IN [0..LENGTH[statusExtrasList]) DO
FormatLogCounterMessage[
statusExtrasList[i].counter, statusExtrasList[i].message];
ENDLOOP;
END; -- BuildTechRepLog
PrintTechRepLog: PROCEDURE = BEGIN
builds and prints the tech rep log
jobData: RavenEngine.Job;
sequence: StringSequence.Handle;
sequence ← StringSequence.Create[
sequenceLength: 68, stringLength: StringSequence.learSieglerStringLength];
BuildTechRepLog[sequence: sequence];
jobData ← [
banner: suppressed, printOrder: firstPageOutFirst, copyCount: 1,
document: RasterLogFont.TransferStringSequence[sequence: sequence],
paperFeed: fromBottomOrTop, firstPage: 0, lastPage: LAST[CARDINAL],
paperStacking: aligned];
StringSequence.Delete[sequence];
RavenEngine.SetPrintingState[completed]; -- kill current job
[] ← RavenEngine.WaitPrintingState[targetState: completed, targetEqual: TRUE];
RavenEngine.SetJob[@jobData];
RavenEngine.SetPrintingState[started];
[] ← RavenEngine.WaitPrintingState[targetState: started, targetEqual: TRUE];
[] ← RavenEngine.WaitPrintingState[targetState: started, targetEqual: FALSE];
END; -- PrintTechRepLog
RunImageTestInternal: PROCEDURE RETURNS [fault: LSEPDiagnostics.ImageFault] = BEGIN
eventContext: REF RavenControl.EventContext ← NEW[RavenControl.EventContext];
check Video Data, Line Sync, and Video Clock signals
run at priorityForeground
oldPriority: Process.Priority ← Process.GetPriority[];
Process.SetPriority[Process.priorityForeground];
TRUSTED BEGIN
make sure engine is idle
RavenEngine.SetPrintingState[completed]; -- abort current job
[] ← RavenEngine.WaitPrintingState[targetState: completed, targetEqual: TRUE];
LSEPDiagnostics.BuildImageSample[phase: prePrinting];
PSCommand.PrintFile[
fileName: TestPattern.Name[9 ! TestPattern.NotFound => GOTO noTestPattern],
senderName: RavenBansheeMessage.GetNSMessage[imageTest], copies: 1,
options: [var: raven[tray: bottom, stacking: aligned]]];
wait for testable status indication
DO
SELECT RavenControl.GetEngineStatus[] FROM
IN [okay..tonerLow], IN [imageFault1..sequenceFault] => EXIT;
communicationFault => GOTO testingError; -- don't bother
ENDCASE => [] ← RavenControl.WaitEngineStatus[];
ENDLOOP;
wait for page sync (feeding) or error event
RavenControl.SetToCurrentEventContext[eventContext];
DO
SELECT RavenControl.WaitEngineEvent[eventContext] FROM
feeding => EXIT; -- feeding is pageSync
pageDelivery, idle, feedError, softError, hardError, timeout => EXIT; -- image fault is hard error
ENDCASE => NULL; -- all others loop
ENDLOOP;
LSEPDiagnostics.BuildImageSample[phase: printing];
RavenEngine.SetPrintingState[completed]; -- make sure engine is done (kill error retries)
[] ← RavenEngine.WaitPrintingState[targetState: completed, targetEqual: TRUE];
LSEPDiagnostics.BuildImageSample[phase: postPrinting];
fault ← LSEPDiagnostics.InterpretImageSample[];
EXITS noTestPattern => fault ← notTested; testingError => fault ← aborted;
END;
Process.SetPriority[oldPriority]; -- restore priority
END; -- RunImageTestInternal
END.
LOG
When - Who - What.
18-Jun-85 23:24:58 - Strickberger - Rewrite for Raven engine driver redesign. Eliminate automatic reboot if image test fail. Previous log entries deleted.
12-Aug-85 21:16:32 - Strickberger - Update for Euclid interfaces. Rewrite Tech Rep Log stuff, eliminate Analyst log. Add Print Tech Rep Log, Display Tech Rep Log and Reste Tech Rep Log commands to RunServeTestMode. FixArrows.
23-Aug-85 15:15:46 - Strickberger - TTY.Rubout exits RunServeTestMode. Catch TestPattern.NotFound and display FE when specifying test pattern in RunTestJob. Don't run image test 3 times if no test pattern or status error.
19-Sep-85 18:48:20 - Strickberger - Specify senderName when printing test pattern from Image Test.
19-Dec-85 11:57:45 - Strickberger - Base Tech Rep Log feeder jam rates on correct feed counters (AR23114).
18-Mar-86 12:29:58 - Strickberger - Modify ListTechRepLog to use PSExec.GetClientID instead of NSExec.nullClientID (AR3873).
1-Apr-86 0:35:52 - Strickberger - Change RunImageTestInternal to not wait after feeding event, as feeding event is now pageSync (AR3721). SetPrintingState[completed] before waiting on it (AR2805). WaitPrintingState[started], abort if image or communication fault in RunTestJob.
23-Apr-86 23:24:35 - Strickberger - SetPrintingState[completed], wait for printing state to not be started instead of completed in PrintTechRepLog. Both printAnalystLog and printTechRepLog codes print Tech Rep Log. Both displayAnalystLog and displayTechRepLog codes display Tech Rep Log.
14-May-86 18:50:11 - Prochaska - Update for new RavenControl, add call to RavenControl.SetToCurrentEventContext.