-- LutherWatcher.mesa -- Last edited by -- Kolling on August 5, 1983 4:30 pm DIRECTORY AlpineEnvironment USING[FileStore], AlpInstance USING[Create, Failed, Handle], AlpTransaction USING[Create, OperationFailed], Icons USING[IconFlavor, NewIconFromFile], IO USING[PutF, PutRope, rope, UserAborted], Process USING[Pause, SecondsToTicks], Rope USING[ROPE], RPC USING[CallFailed], SpecialCache USING[NameIt], UserExec USING[CheckForAbort, ExecHandle, GetStreams, HistoryEvent, RegisterCommand], UserProfile USING[Boolean], ViewerClasses USING[ViewerClass, ViewerClassRec, Viewer], ViewerOps USING[CreateViewer, DestroyViewer, PaintViewer, RegisterViewerClass]; LutherWatcher: CEDAR PROGRAM IMPORTS AlpI: AlpInstance, AlpT: AlpTransaction, Icons, IO, Process, RPC, SpecialCache, UserExec, UserProfile, ViewerOps SHARES SpecialCache = BEGIN OPEN AE: AlpineEnvironment; fileStore: AE.FileStore _ "luther.alpine"; quiescent: Icons.IconFlavor _ Icons.NewIconFromFile[file: "LutherWatcher.icons", n: 0]; stillDownFlavor1: Icons.IconFlavor _ Icons.NewIconFromFile[file: "LutherWatcher.icons", n: 1]; stillDownFlavor2: Icons.IconFlavor _ Icons.NewIconFromFile[file: "LutherWatcher.icons", n: 2]; stillDownFlavor3: Icons.IconFlavor _ Icons.NewIconFromFile[file: "LutherWatcher.icons", n: 3]; stillDownFlavor4: Icons.IconFlavor _ Icons.NewIconFromFile[file: "LutherWatcher.icons", n: 4]; viewerClass: ViewerClasses.ViewerClass _ NEW[ViewerClasses.ViewerClassRec _ [icon: quiescent]]; LutherWatcherTool: ViewerClasses.Viewer; viewerName: Rope.ROPE _ "LutherWatcher"; firstFail: BOOLEAN _ TRUE; LutherWatcherProc: PROCEDURE[event: UserExec.HistoryEvent, exec: UserExec.ExecHandle, clientData: REF ANY] RETURNS[ok: BOOLEAN, msg: Rope.ROPE] = BEGIN ENABLE IO.UserAborted, ABORTED => IF NOT firstFail THEN ViewerOps.DestroyViewer[LutherWatcherTool]; instHandle: AlpI.Handle _ NIL; DoNumber: PROCEDURE[what: Rope.ROPE] = BEGIN UserExec.GetStreams[exec].out.PutF["%g. ", IO.rope[what]]; IF firstFail THEN BEGIN ViewerOps.RegisterViewerClass[$LutherWatcher, viewerClass]; LutherWatcherTool _ ViewerOps.CreateViewer[ flavor: $LutherWatcher, info: [ name: viewerName, iconic: TRUE, column: right, icon: quiescent, scrollable: FALSE ]]; firstFail _ FALSE; END; LutherWatcherTool.icon _ quiescent; ViewerOps.PaintViewer[LutherWatcherTool, all]; Process.Pause[10]; LutherWatcherTool.icon _ stillDownFlavor1; ViewerOps.PaintViewer[LutherWatcherTool, all]; Process.Pause[10]; LutherWatcherTool.icon _ stillDownFlavor2; ViewerOps.PaintViewer[LutherWatcherTool, all]; Process.Pause[10]; LutherWatcherTool.icon _ stillDownFlavor3; ViewerOps.PaintViewer[LutherWatcherTool, all]; Process.Pause[10]; LutherWatcherTool.icon _ stillDownFlavor4; ViewerOps.PaintViewer[LutherWatcherTool, all]; Process.Pause[20]; LutherWatcherTool.icon _ quiescent; ViewerOps.PaintViewer[LutherWatcherTool, all]; THROUGH [1..5] DO Process.Pause[Process.SecondsToTicks[6]]; UserExec.CheckForAbort[exec, ]; ENDLOOP; END; firstFail _ TRUE; DO instHandle _ AlpI.Create[fileStore, , ! AlpI.Failed => SELECT why FROM grapevineDownOrCommunications => BEGIN DoNumber["Grapevine down or Ethernet problem"]; LOOP; END; alpineDownOrCommunications => BEGIN DoNumber["Luther down or Ethernet problem"]; LOOP; END; alpineDown => BEGIN DoNumber["Luther down"]; LOOP; END; ENDCASE;]; [] _ AlpT.Create[instHandle, TRUE ! RPC.CallFailed => SELECT why FROM timeout => BEGIN DoNumber["Luther down or Ethernet problem"]; LOOP; END; unbound => BEGIN DoNumber["Luther down"]; LOOP; END; ENDCASE; AlpT.OperationFailed => IF why = busy THEN BEGIN DoNumber["Luther busy"]; RETRY; END;]; UserExec.GetStreams[exec].out.PutRope["Luther up. "]; IF NOT firstFail THEN BEGIN IF UserProfile.Boolean["LutherWatcher.Armageddon", TRUE] THEN TRUSTED BEGIN SpecialCache.NameIt[viewerName]; END; ViewerOps.DestroyViewer[LutherWatcherTool]; END; EXIT; ENDLOOP; END; -- main line code. UserExec.RegisterCommand["LutherWatcher", LutherWatcherProc, NIL, NIL, ]; END. Edit Log Initial: Kolling: July 18, 1983 2:28 pm ʘJšðÏcOœÏk œ"žœ'žœ7žœ0žœ1žœ:žœ-žœžœ*žœ"žœcžœ(žœ@žœCÐbl œžœžœžœ{žœžœžœžœÏn œžœ  œQ œQ œQ œQ œQ  œžœ7 œ œ  œ  œžœžœ œž œGžœžœžœžœ žœžœ žœžœžœžœžœ, œ  œžœ  œž œžœžœ:žœžœžœ‰žœjžœ-ž œžœ œ²žœ žœRžœžœ œžœ žœ žœEžœžœFžœ0žœžœDžœ-žœžœ4žœžœžœ žœ%žœžœžœžœ-žœžœžœ žœžœžœ ž œ#žœ žœžœžœžœžœ5žœžœžœžœžœ1žœžœžœžœ"žœ;ž.œžœœ?žœžœžœ}˜ó&—…—vƒ