********************************************************************
* NOTE: This file is generated automatically from the event * definition file Maxflow.evt. ********************************************************************MODULEFix any FormsVBT errors; don't handle exceptions for them.; <*NOWARN*> IMPORT Rd, ZeusClass, R2, Fmt, Algorithm, MFGraph, Wr; <*NOWARN*> IMPORT ZeusPanel, FormsVBT, Text, VBT, MFAlgs, GraphVBT; <*NOWARN*> IMPORT MFViews, RefList, MFFmt, ZeusUtil; <* PRAGMA LL *> MaxflowAlgClass <* FATAL FormsVBT.Error, FormsVBT.Unimplemented *> REVEAL T = Public BRANDED OBJECT OVERRIDES <* LL = VBT.mu *> init := MaxflowDefaultInit; snapshot := MaxflowDefaultSnapshot; restore := MaxflowDefaultRestore; updateEventCounts := MaxflowDefaultUpdateCts; feAddVertex := AddVertex; feAddEdge := AddEdge; END; PROCEDUREMaxflowDefaultInit (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("MaxflowEventData.fv"); Attach("stopatCodeEvents", MaxflowDoIt); Attach("waitatCodeEvents", MaxflowDoIt); Attach("eventCounts", MaxflowRefreshCts); Attach("stopAtSetup", MaxflowDoIt); Attach("waitAtSetup", MaxflowDoIt); Attach("stopAtHighlightPath", MaxflowDoIt); Attach("waitAtHighlightPath", MaxflowDoIt); Attach("stopAtIncFlow", MaxflowDoIt); Attach("waitAtIncFlow", MaxflowDoIt); Attach("stopAtDecFlow", MaxflowDoIt); Attach("waitAtDecFlow", MaxflowDoIt); Attach("stopAtShowEdge", MaxflowDoIt); Attach("waitAtShowEdge", MaxflowDoIt); Attach("stopAtRemoveHighlight", MaxflowDoIt); Attach("waitAtRemoveHighlight", MaxflowDoIt); Attach("stopAtFinalResult", MaxflowDoIt); Attach("waitAtFinalResult", MaxflowDoIt); FromFV (v.eventData, v); (* Get FV and internal data in sync *) RETURN Algorithm.T.init(v); END MaxflowDefaultInit; PROCEDUREMaxflowDoIt ( 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, "stopAtSetup") THEN NARROW(arg, T).eventDataRec.stopAtSetup := FormsVBT.GetBoolean(fv, "stopAtSetup"); END; IF Text.Equal(e, "waitAtSetup") THEN NARROW(arg, T).eventDataRec.waitAtSetup := FormsVBT.GetInteger(fv, "waitAtSetup"); END; IF Text.Equal(e, "stopAtHighlightPath") THEN NARROW(arg, T).eventDataRec.stopAtHighlightPath := FormsVBT.GetBoolean(fv, "stopAtHighlightPath"); END; IF Text.Equal(e, "waitAtHighlightPath") THEN NARROW(arg, T).eventDataRec.waitAtHighlightPath := FormsVBT.GetInteger(fv, "waitAtHighlightPath"); END; IF Text.Equal(e, "stopAtIncFlow") THEN NARROW(arg, T).eventDataRec.stopAtIncFlow := FormsVBT.GetBoolean(fv, "stopAtIncFlow"); END; IF Text.Equal(e, "waitAtIncFlow") THEN NARROW(arg, T).eventDataRec.waitAtIncFlow := FormsVBT.GetInteger(fv, "waitAtIncFlow"); END; IF Text.Equal(e, "stopAtDecFlow") THEN NARROW(arg, T).eventDataRec.stopAtDecFlow := FormsVBT.GetBoolean(fv, "stopAtDecFlow"); END; IF Text.Equal(e, "waitAtDecFlow") THEN NARROW(arg, T).eventDataRec.waitAtDecFlow := FormsVBT.GetInteger(fv, "waitAtDecFlow"); END; IF Text.Equal(e, "stopAtShowEdge") THEN NARROW(arg, T).eventDataRec.stopAtShowEdge := FormsVBT.GetBoolean(fv, "stopAtShowEdge"); END; IF Text.Equal(e, "waitAtShowEdge") THEN NARROW(arg, T).eventDataRec.waitAtShowEdge := FormsVBT.GetInteger(fv, "waitAtShowEdge"); END; IF Text.Equal(e, "stopAtRemoveHighlight") THEN NARROW(arg, T).eventDataRec.stopAtRemoveHighlight := FormsVBT.GetBoolean(fv, "stopAtRemoveHighlight"); END; IF Text.Equal(e, "waitAtRemoveHighlight") THEN NARROW(arg, T).eventDataRec.waitAtRemoveHighlight := FormsVBT.GetInteger(fv, "waitAtRemoveHighlight"); END; IF Text.Equal(e, "stopAtFinalResult") THEN NARROW(arg, T).eventDataRec.stopAtFinalResult := FormsVBT.GetBoolean(fv, "stopAtFinalResult"); END; IF Text.Equal(e, "waitAtFinalResult") THEN NARROW(arg, T).eventDataRec.waitAtFinalResult := FormsVBT.GetInteger(fv, "waitAtFinalResult"); END; END MaxflowDoIt; PROCEDUREMaxflowRefreshCts ( <*UNUSED*> fv : FormsVBT.T; <*UNUSED*> e : TEXT; arg : REFANY; <*UNUSED*> t : VBT.TimeStamp) = <* LL = VBT.mu *> BEGIN NARROW(arg, T).updateEventCounts(FALSE); END MaxflowRefreshCts; PROCEDUREFromFV (fv : FormsVBT.T; alg: T) = <* LL = VBT.mu *> BEGIN alg.stopatCodeEvents := FormsVBT.GetBoolean(fv, "stopatCodeEvents"); alg.waitatCodeEvents := FormsVBT.GetInteger(fv, "waitatCodeEvents"); alg.eventDataRec.stopAtSetup := FormsVBT.GetBoolean(fv, "stopAtSetup"); alg.eventDataRec.waitAtSetup := FormsVBT.GetInteger(fv, "waitAtSetup"); alg.eventDataRec.stopAtHighlightPath := FormsVBT.GetBoolean(fv, "stopAtHighlightPath"); alg.eventDataRec.waitAtHighlightPath := FormsVBT.GetInteger(fv, "waitAtHighlightPath"); alg.eventDataRec.stopAtIncFlow := FormsVBT.GetBoolean(fv, "stopAtIncFlow"); alg.eventDataRec.waitAtIncFlow := FormsVBT.GetInteger(fv, "waitAtIncFlow"); alg.eventDataRec.stopAtDecFlow := FormsVBT.GetBoolean(fv, "stopAtDecFlow"); alg.eventDataRec.waitAtDecFlow := FormsVBT.GetInteger(fv, "waitAtDecFlow"); alg.eventDataRec.stopAtShowEdge := FormsVBT.GetBoolean(fv, "stopAtShowEdge"); alg.eventDataRec.waitAtShowEdge := FormsVBT.GetInteger(fv, "waitAtShowEdge"); alg.eventDataRec.stopAtRemoveHighlight := FormsVBT.GetBoolean(fv, "stopAtRemoveHighlight"); alg.eventDataRec.waitAtRemoveHighlight := FormsVBT.GetInteger(fv, "waitAtRemoveHighlight"); alg.eventDataRec.stopAtFinalResult := FormsVBT.GetBoolean(fv, "stopAtFinalResult"); alg.eventDataRec.waitAtFinalResult := FormsVBT.GetInteger(fv, "waitAtFinalResult"); 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, "stopAtSetup", alg.eventDataRec.stopAtSetup); FormsVBT.PutInteger(fv, "waitAtSetup", alg.eventDataRec.waitAtSetup); FormsVBT.PutBoolean(fv, "stopAtHighlightPath", alg.eventDataRec.stopAtHighlightPath); FormsVBT.PutInteger(fv, "waitAtHighlightPath", alg.eventDataRec.waitAtHighlightPath); FormsVBT.PutBoolean(fv, "stopAtIncFlow", alg.eventDataRec.stopAtIncFlow); FormsVBT.PutInteger(fv, "waitAtIncFlow", alg.eventDataRec.waitAtIncFlow); FormsVBT.PutBoolean(fv, "stopAtDecFlow", alg.eventDataRec.stopAtDecFlow); FormsVBT.PutInteger(fv, "waitAtDecFlow", alg.eventDataRec.waitAtDecFlow); FormsVBT.PutBoolean(fv, "stopAtShowEdge", alg.eventDataRec.stopAtShowEdge); FormsVBT.PutInteger(fv, "waitAtShowEdge", alg.eventDataRec.waitAtShowEdge); FormsVBT.PutBoolean(fv, "stopAtRemoveHighlight", alg.eventDataRec.stopAtRemoveHighlight); FormsVBT.PutInteger(fv, "waitAtRemoveHighlight", alg.eventDataRec.waitAtRemoveHighlight); FormsVBT.PutBoolean(fv, "stopAtFinalResult", alg.eventDataRec.stopAtFinalResult); FormsVBT.PutInteger(fv, "waitAtFinalResult", alg.eventDataRec.waitAtFinalResult); CountsToFV (fv, alg); END ToFV; PROCEDURECountsToFV (fv : FormsVBT.T; alg: T) = <* LL = VBT.mu *> BEGIN FormsVBT.PutText(fv, "ctOfSetup", Fmt.Int(alg.eventDataRec.ctOfSetup)); FormsVBT.PutText(fv, "ctOfHighlightPath", Fmt.Int(alg.eventDataRec.ctOfHighlightPath)); FormsVBT.PutText(fv, "ctOfIncFlow", Fmt.Int(alg.eventDataRec.ctOfIncFlow)); FormsVBT.PutText(fv, "ctOfDecFlow", Fmt.Int(alg.eventDataRec.ctOfDecFlow)); FormsVBT.PutText(fv, "ctOfShowEdge", Fmt.Int(alg.eventDataRec.ctOfShowEdge)); FormsVBT.PutText(fv, "ctOfRemoveHighlight", Fmt.Int(alg.eventDataRec.ctOfRemoveHighlight)); FormsVBT.PutText(fv, "ctOfFinalResult", Fmt.Int(alg.eventDataRec.ctOfFinalResult)); END CountsToFV; PROCEDUREMaxflowDefaultUpdateCts ( v: T; reset: BOOLEAN) = <* LL = VBT.mu *> BEGIN IF reset THEN v.eventDataRec.ctOfSetup := 0; v.eventDataRec.ctOfHighlightPath := 0; v.eventDataRec.ctOfIncFlow := 0; v.eventDataRec.ctOfDecFlow := 0; v.eventDataRec.ctOfShowEdge := 0; v.eventDataRec.ctOfRemoveHighlight := 0; v.eventDataRec.ctOfFinalResult := 0; END; CountsToFV (v.eventData, v); END MaxflowDefaultUpdateCts; PROCEDUREMaxflowDefaultSnapshot (v: T; wr: Wr.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TRY Wr.PutChar(wr, '(') EXCEPT ELSE RAISE ZeusClass.Error( "MaxflowAlgClass.MaxflowDefaultSnapshot write error"); END; IF v.eventData = NIL THEN RAISE ZeusClass.Error( "MaxflowAlgClass.MaxflowDefaultSnapshot: " & "eventData not set!"); END; TRY v.eventData.snapshot(wr) EXCEPT FormsVBT.Error (msg) => RAISE ZeusClass.Error( "MaxflowAlgClass.MaxflowDefaultSnapshot FV error: " & msg); ELSE RAISE ZeusClass.Error( "MaxflowAlgClass.MaxflowDefaultSnapshot error"); END; Algorithm.T.snapshot(v, wr); TRY Wr.PutChar(wr, ')') EXCEPT ELSE RAISE ZeusClass.Error( "MaxflowAlgClass.MaxflowDefaultSnapshot write error"); END; END MaxflowDefaultSnapshot; PROCEDUREMaxflowDefaultRestore (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( "MaxflowAlgClass.MaxflowDefaultRestore read error"); END; IF v.eventData = NIL THEN RAISE ZeusClass.Error( "MaxflowAlgClass.MaxflowDefaultRestore: " & "eventData not set!"); END; TRY v.eventData.restore(rd); v.updateEventCounts(FALSE); FromFV(v.eventData, v); EXCEPT ELSE RAISE ZeusClass.Error( "MaxflowAlgClass.MaxflowDefaultRestore error"); END; Algorithm.T.restore(v, rd); IF NOT ZeusUtil.EatChar(rd, ')') THEN RAISE ZeusClass.Error( "MaxflowAlgClass.MaxflowDefaultRestore read error"); END; END MaxflowDefaultRestore; PROCEDUREAddVertex (self: T ; <*UNUSED*> pos: R2.T ) = <* LL = VBT.mu *> BEGIN self.evtHandled := FALSE; END AddVertex; PROCEDUREAddEdge (self: T ; <*UNUSED*> v0: MFGraph.Vertex ; <*UNUSED*> v1: MFGraph.Vertex ) = <* LL = VBT.mu *> BEGIN self.evtHandled := FALSE; END AddEdge; BEGIN END MaxflowAlgClass.