********************************************************************
* NOTE: This file is generated automatically from the event * definition file ShortestPath.evt. ********************************************************************MODULEFix any FormsVBT errors; don't handle exceptions for them.; <*NOWARN*> IMPORT TextConv, Rd, ZeusClass, Fmt, Algorithm, Wr; <*NOWARN*> IMPORT ZeusPanel, FormsVBT, VBT, Text, ZeusUtil; <* PRAGMA LL *> ShortestPathAlgClass <* FATAL FormsVBT.Error, FormsVBT.Unimplemented *> REVEAL T = Public BRANDED OBJECT OVERRIDES <* LL = VBT.mu *> init := ShortestPathDefaultInit; snapshot := ShortestPathDefaultSnapshot; restore := ShortestPathDefaultRestore; updateEventCounts := ShortestPathDefaultUpdateCts; END; PROCEDUREShortestPathDefaultInit (v: T): Algorithm.T = <* LL = VBT.mu *> PROCEDURE Attach (id: TEXT; proc: FormsVBT.Proc) = BEGIN FormsVBT.AttachProc(v.eventData, id, proc, v); END Attach; BEGIN v.eventData := ZeusPanel.NewForm("ShortestPathEventData.fv"); Attach("stopatCodeEvents", ShortestPathDoIt); Attach("waitatCodeEvents", ShortestPathDoIt); Attach("eventCounts", ShortestPathRefreshCts); Attach("stopAtNewVertex", ShortestPathDoIt); Attach("waitAtNewVertex", ShortestPathDoIt); Attach("stopAtNewEdge", ShortestPathDoIt); Attach("waitAtNewEdge", ShortestPathDoIt); Attach("stopAtStartFind", ShortestPathDoIt); Attach("waitAtStartFind", ShortestPathDoIt); Attach("stopAtPromote", ShortestPathDoIt); Attach("waitAtPromote", ShortestPathDoIt); Attach("stopAtConsider", ShortestPathDoIt); Attach("waitAtConsider", ShortestPathDoIt); Attach("stopAtTraceback", ShortestPathDoIt); Attach("waitAtTraceback", ShortestPathDoIt); FromFV (v.eventData, v); (* Get FV and internal data in sync *) RETURN Algorithm.T.init(v); END ShortestPathDefaultInit; PROCEDUREShortestPathDoIt ( fv : FormsVBT.T; e : TEXT; arg: REFANY; <*UNUSED*> t : VBT.TimeStamp) = <* LL = VBT.mu *> BEGIN IF Text.Equal(e, "stopatCodeEvents") THEN NARROW(arg, T).stopatCodeEvents := FormsVBT.GetBoolean(fv, "stopatCodeEvents"); END; IF Text.Equal(e, "waitatCodeEvents") THEN NARROW(arg, T).waitatCodeEvents := FormsVBT.GetInteger(fv, "waitatCodeEvents"); END; IF Text.Equal(e, "stopAtNewVertex") THEN NARROW(arg, T).eventDataRec.stopAtNewVertex := FormsVBT.GetBoolean(fv, "stopAtNewVertex"); END; IF Text.Equal(e, "waitAtNewVertex") THEN NARROW(arg, T).eventDataRec.waitAtNewVertex := FormsVBT.GetInteger(fv, "waitAtNewVertex"); END; IF Text.Equal(e, "stopAtNewEdge") THEN NARROW(arg, T).eventDataRec.stopAtNewEdge := FormsVBT.GetBoolean(fv, "stopAtNewEdge"); END; IF Text.Equal(e, "waitAtNewEdge") THEN NARROW(arg, T).eventDataRec.waitAtNewEdge := FormsVBT.GetInteger(fv, "waitAtNewEdge"); END; IF Text.Equal(e, "stopAtStartFind") THEN NARROW(arg, T).eventDataRec.stopAtStartFind := FormsVBT.GetBoolean(fv, "stopAtStartFind"); END; IF Text.Equal(e, "waitAtStartFind") THEN NARROW(arg, T).eventDataRec.waitAtStartFind := FormsVBT.GetInteger(fv, "waitAtStartFind"); END; IF Text.Equal(e, "stopAtPromote") THEN NARROW(arg, T).eventDataRec.stopAtPromote := FormsVBT.GetBoolean(fv, "stopAtPromote"); END; IF Text.Equal(e, "waitAtPromote") THEN NARROW(arg, T).eventDataRec.waitAtPromote := FormsVBT.GetInteger(fv, "waitAtPromote"); END; IF Text.Equal(e, "stopAtConsider") THEN NARROW(arg, T).eventDataRec.stopAtConsider := FormsVBT.GetBoolean(fv, "stopAtConsider"); END; IF Text.Equal(e, "waitAtConsider") THEN NARROW(arg, T).eventDataRec.waitAtConsider := FormsVBT.GetInteger(fv, "waitAtConsider"); END; IF Text.Equal(e, "stopAtTraceback") THEN NARROW(arg, T).eventDataRec.stopAtTraceback := FormsVBT.GetBoolean(fv, "stopAtTraceback"); END; IF Text.Equal(e, "waitAtTraceback") THEN NARROW(arg, T).eventDataRec.waitAtTraceback := FormsVBT.GetInteger(fv, "waitAtTraceback"); END; END ShortestPathDoIt; PROCEDUREShortestPathRefreshCts ( <*UNUSED*> fv : FormsVBT.T; <*UNUSED*> e : TEXT; arg : REFANY; <*UNUSED*> t : VBT.TimeStamp) = <* LL = VBT.mu *> BEGIN NARROW(arg, T).updateEventCounts(FALSE); END ShortestPathRefreshCts; PROCEDUREFromFV (fv : FormsVBT.T; alg: T) = <* LL = VBT.mu *> BEGIN alg.stopatCodeEvents := FormsVBT.GetBoolean(fv, "stopatCodeEvents"); alg.waitatCodeEvents := FormsVBT.GetInteger(fv, "waitatCodeEvents"); alg.eventDataRec.stopAtNewVertex := FormsVBT.GetBoolean(fv, "stopAtNewVertex"); alg.eventDataRec.waitAtNewVertex := FormsVBT.GetInteger(fv, "waitAtNewVertex"); alg.eventDataRec.stopAtNewEdge := FormsVBT.GetBoolean(fv, "stopAtNewEdge"); alg.eventDataRec.waitAtNewEdge := FormsVBT.GetInteger(fv, "waitAtNewEdge"); alg.eventDataRec.stopAtStartFind := FormsVBT.GetBoolean(fv, "stopAtStartFind"); alg.eventDataRec.waitAtStartFind := FormsVBT.GetInteger(fv, "waitAtStartFind"); alg.eventDataRec.stopAtPromote := FormsVBT.GetBoolean(fv, "stopAtPromote"); alg.eventDataRec.waitAtPromote := FormsVBT.GetInteger(fv, "waitAtPromote"); alg.eventDataRec.stopAtConsider := FormsVBT.GetBoolean(fv, "stopAtConsider"); alg.eventDataRec.waitAtConsider := FormsVBT.GetInteger(fv, "waitAtConsider"); alg.eventDataRec.stopAtTraceback := FormsVBT.GetBoolean(fv, "stopAtTraceback"); alg.eventDataRec.waitAtTraceback := FormsVBT.GetInteger(fv, "waitAtTraceback"); END FromFV; <*UNUSED*> PROCEDUREToFV (fv : FormsVBT.T; alg: T) = <* LL = VBT.mu *> BEGIN FormsVBT.PutBoolean(fv, "stopatCodeEvents", alg.stopatCodeEvents); FormsVBT.PutInteger(fv, "waitatCodeEvents", alg.waitatCodeEvents); FormsVBT.PutBoolean(fv, "stopAtNewVertex", alg.eventDataRec.stopAtNewVertex); FormsVBT.PutInteger(fv, "waitAtNewVertex", alg.eventDataRec.waitAtNewVertex); FormsVBT.PutBoolean(fv, "stopAtNewEdge", alg.eventDataRec.stopAtNewEdge); FormsVBT.PutInteger(fv, "waitAtNewEdge", alg.eventDataRec.waitAtNewEdge); FormsVBT.PutBoolean(fv, "stopAtStartFind", alg.eventDataRec.stopAtStartFind); FormsVBT.PutInteger(fv, "waitAtStartFind", alg.eventDataRec.waitAtStartFind); FormsVBT.PutBoolean(fv, "stopAtPromote", alg.eventDataRec.stopAtPromote); FormsVBT.PutInteger(fv, "waitAtPromote", alg.eventDataRec.waitAtPromote); FormsVBT.PutBoolean(fv, "stopAtConsider", alg.eventDataRec.stopAtConsider); FormsVBT.PutInteger(fv, "waitAtConsider", alg.eventDataRec.waitAtConsider); FormsVBT.PutBoolean(fv, "stopAtTraceback", alg.eventDataRec.stopAtTraceback); FormsVBT.PutInteger(fv, "waitAtTraceback", alg.eventDataRec.waitAtTraceback); CountsToFV (fv, alg); END ToFV; PROCEDURECountsToFV (fv : FormsVBT.T; alg: T) = <* LL = VBT.mu *> BEGIN FormsVBT.PutText(fv, "ctOfNewVertex", Fmt.Int(alg.eventDataRec.ctOfNewVertex)); FormsVBT.PutText(fv, "ctOfNewEdge", Fmt.Int(alg.eventDataRec.ctOfNewEdge)); FormsVBT.PutText(fv, "ctOfStartFind", Fmt.Int(alg.eventDataRec.ctOfStartFind)); FormsVBT.PutText(fv, "ctOfPromote", Fmt.Int(alg.eventDataRec.ctOfPromote)); FormsVBT.PutText(fv, "ctOfConsider", Fmt.Int(alg.eventDataRec.ctOfConsider)); FormsVBT.PutText(fv, "ctOfTraceback", Fmt.Int(alg.eventDataRec.ctOfTraceback)); END CountsToFV; PROCEDUREShortestPathDefaultUpdateCts ( v: T; reset: BOOLEAN) = <* LL = VBT.mu *> BEGIN IF reset THEN v.eventDataRec.ctOfNewVertex := 0; v.eventDataRec.ctOfNewEdge := 0; v.eventDataRec.ctOfStartFind := 0; v.eventDataRec.ctOfPromote := 0; v.eventDataRec.ctOfConsider := 0; v.eventDataRec.ctOfTraceback := 0; END; CountsToFV (v.eventData, v); END ShortestPathDefaultUpdateCts; PROCEDUREShortestPathDefaultSnapshot (v: T; wr: Wr.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TRY Wr.PutChar(wr, '(') EXCEPT ELSE RAISE ZeusClass.Error( "ShortestPathAlgClass.ShortestPathDefaultSnapshot write error"); END; IF v.eventData = NIL THEN RAISE ZeusClass.Error( "ShortestPathAlgClass.ShortestPathDefaultSnapshot: " & "eventData not set!"); END; TRY v.eventData.snapshot(wr) EXCEPT FormsVBT.Error (msg) => RAISE ZeusClass.Error( "ShortestPathAlgClass.ShortestPathDefaultSnapshot FV error: " & msg); ELSE RAISE ZeusClass.Error( "ShortestPathAlgClass.ShortestPathDefaultSnapshot error"); END; Algorithm.T.snapshot(v, wr); TRY Wr.PutChar(wr, ')') EXCEPT ELSE RAISE ZeusClass.Error( "ShortestPathAlgClass.ShortestPathDefaultSnapshot write error"); END; END ShortestPathDefaultSnapshot; PROCEDUREShortestPathDefaultRestore (v: T; rd: Rd.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN IF rd = NIL THEN RETURN END; IF NOT ZeusUtil.EatChar(rd, '(') THEN RAISE ZeusClass.Error( "ShortestPathAlgClass.ShortestPathDefaultRestore read error"); END; IF v.eventData = NIL THEN RAISE ZeusClass.Error( "ShortestPathAlgClass.ShortestPathDefaultRestore: " & "eventData not set!"); END; TRY v.eventData.restore(rd); v.updateEventCounts(FALSE); FromFV(v.eventData, v); EXCEPT ELSE RAISE ZeusClass.Error( "ShortestPathAlgClass.ShortestPathDefaultRestore error"); END; Algorithm.T.restore(v, rd); IF NOT ZeusUtil.EatChar(rd, ')') THEN RAISE ZeusClass.Error( "ShortestPathAlgClass.ShortestPathDefaultRestore read error"); END; END ShortestPathDefaultRestore; BEGIN END ShortestPathAlgClass.