********************************************************************
* NOTE: This file is generated automatically from the event * definition file PktRoute.evt. ********************************************************************<* PRAGMA LL *> MODULEevent handling methods:; <*NOWARN*> IMPORT TextConv, TextPort, Rd, IntList, ZeusClass; <*NOWARN*> IMPORT Filter, TextEditVBT, PktRouteViewClass, Fmt; <*NOWARN*> IMPORT ZFmt, Wr, IntListUtils, ZeusPanel, FormsVBT; <*NOWARN*> IMPORT RefIntArray, VBT, View, OblFmt; <* FATAL FormsVBT.Error, FormsVBT.Unimplemented *> REVEAL T = Public BRANDED OBJECT fv: FormsVBT.T := NIL; te: TextEditVBT.T := NIL; OVERRIDES init := TViewInit; install := TViewInstall; delete := TViewDelete; snapshot := TViewSnapshot; restore := TViewRestore; config := TViewConfig; reactivity := TViewReactivity; startrun := TViewStartrun; endrun := TViewEndrun; oeStartGraph := StartGraph; oeNewNode := NewNode; oeNewStraightEdge := NewStraightEdge; oeNewCurvedEdge := NewCurvedEdge; oeNewLabel := NewLabel; oeEndGraph := EndGraph; oeStartPackets := StartPackets; oeNewPacket := NewPacket; oeEndPackets := EndPackets; oeBlocked := Blocked; oeMovePacket := MovePacket; oeQueueSizes := QueueSizes; oeAbsorb := Absorb; oeStep := Step; END; PROCEDURE PktRouteTranscriptView TViewInit (view: T): T = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "init"); RETURN PktRouteViewClass.T.init (view, NIL); END TViewInit; PROCEDUREClear (<* UNUSED *> fv : FormsVBT.T; <* UNUSED *> name: TEXT; cl : REFANY; <* UNUSED *> time: VBT.TimeStamp) = BEGIN TextPort.SetText(NARROW(cl, T).te.tp, "") END Clear; PROCEDURETViewInstall (view: T) = <* LL = VBT.mu *> BEGIN view.fv := ZeusPanel.NewForm("PktRouteTranscriptView.fv"); view.te := FormsVBT.GetVBT(view.fv, "transcript"); TViewZTrace (view, "install"); FormsVBT.AttachProc(view.fv, "clear", Clear, view); EVAL Filter.Replace (view, view.fv); PktRouteViewClass.T.install (view); END TViewInstall; PROCEDURETViewDelete (view: T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "delete"); PktRouteViewClass.T.delete (view); END TViewDelete; PROCEDURETViewSnapshot (view: T; wr: Wr.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "snapshot"); PktRouteViewClass.T.snapshot (view, wr); END TViewSnapshot; PROCEDURETViewRestore (view: T; rd: Rd.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "restore"); PktRouteViewClass.T.restore (view, rd); END TViewRestore; PROCEDURETViewConfig ( view: T; state: ZeusClass.StateChange; o: ZeusClass.T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "config"); PktRouteViewClass.T.config (view, state, o); END TViewConfig; PROCEDURETViewReactivity (view: T; <*UNUSED*> on: BOOLEAN) = <* LL = VBT.mu *> BEGIN TViewZTrace(view, "reactivity"); PktRouteViewClass.T.reactivity (view, TRUE); END TViewReactivity; PROCEDURETViewStartrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "startrun"); PktRouteViewClass.T.startrun (view); END TViewStartrun; PROCEDURETViewEndrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "endrun"); PktRouteViewClass.T.endrun (view); END TViewEndrun;PROCEDUREStartGraph (view: T; nodeCnt: CARDINAL; queueSize: CARDINAL; bounded: BOOLEAN; maxX, maxY: REAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "StartGraph ...") ELSE TViewTrace (view, "StartGraph " & Fmt.Int(nodeCnt) & " " & Fmt.Int(queueSize) & " " & OblFmt.Bool(bounded) & " " & OblFmt.Real(maxX) & " " & OblFmt.Real(maxY) ) END END END END StartGraph; PROCEDURENewNode (view: T; id: CARDINAL; x, y: REAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "NewNode ...") ELSE TViewTrace (view, "NewNode " & Fmt.Int(id) & " " & OblFmt.Real(x) & " " & OblFmt.Real(y) ) END END END END NewNode; PROCEDURENewStraightEdge (view: T; id1, id2: CARDINAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "NewStraightEdge ...") ELSE TViewTrace (view, "NewStraightEdge " & Fmt.Int(id1) & " " & Fmt.Int(id2) ) END END END END NewStraightEdge; PROCEDURENewCurvedEdge (view: T; id1, id2: CARDINAL; x1, y1, x2, y2: REAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "NewCurvedEdge ...") ELSE TViewTrace (view, "NewCurvedEdge " & Fmt.Int(id1) & " " & Fmt.Int(id2) & " " & OblFmt.Real(x1) & " " & OblFmt.Real(y1) & " " & OblFmt.Real(x2) & " " & OblFmt.Real(y2) ) END END END END NewCurvedEdge; PROCEDURENewLabel (view: T; label: TEXT; x, y: REAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "NewLabel ...") ELSE TViewTrace (view, "NewLabel " & TextConv.Encode(label) & " " & OblFmt.Real(x) & " " & OblFmt.Real(y) ) END END END END NewLabel; PROCEDUREEndGraph (view: T; ) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "EndGraph ...") ELSE TViewTrace (view, "EndGraph " ) END END END END EndGraph; PROCEDUREStartPackets (view: T; pktCnt: CARDINAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "StartPackets ...") ELSE TViewTrace (view, "StartPackets " & Fmt.Int(pktCnt) ) END END END END StartPackets; PROCEDURENewPacket (view: T; id, source, dest, fewestHops: CARDINAL; name: TEXT) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "NewPacket ...") ELSE TViewTrace (view, "NewPacket " & Fmt.Int(id) & " " & Fmt.Int(source) & " " & Fmt.Int(dest) & " " & Fmt.Int(fewestHops) & " " & TextConv.Encode(name) ) END END END END NewPacket; PROCEDUREEndPackets (view: T; ) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "EndPackets ...") ELSE TViewTrace (view, "EndPackets " ) END END END END EndPackets; PROCEDUREBlocked (view: T; id, from, to: CARDINAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Blocked ...") ELSE TViewTrace (view, "Blocked " & Fmt.Int(id) & " " & Fmt.Int(from) & " " & Fmt.Int(to) ) END END END END Blocked; PROCEDUREMovePacket (view: T; id, from, to: CARDINAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "MovePacket ...") ELSE TViewTrace (view, "MovePacket " & Fmt.Int(id) & " " & Fmt.Int(from) & " " & Fmt.Int(to) ) END END END END MovePacket; PROCEDUREQueueSizes (view: T; sz: RefIntArray.T) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "QueueSizes ...") ELSE TViewTrace (view, "QueueSizes " & RefIntArray.ToText(sz) ) END END END END QueueSizes; PROCEDUREAbsorb (view: T; pktId, node: CARDINAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Absorb ...") ELSE TViewTrace (view, "Absorb " & Fmt.Int(pktId) & " " & Fmt.Int(node) ) END END END END Absorb; PROCEDUREStep (view: T; ) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Step ...") ELSE TViewTrace (view, "Step " ) END END END END Step; PROCEDURETViewZTrace (view: T; t: TEXT) = BEGIN IF view.fv # NIL THEN IF FormsVBT.GetBoolean(view.fv, "zeus") THEN TextPort.PutText(view.te.tp, "**zeus: " & t & "\n"); TextPort.Normalize(view.te.tp, LAST(INTEGER)) END END END TViewZTrace; PROCEDURETViewTrace (view: T; t: TEXT) = BEGIN TextPort.PutText(view.te.tp, "--event: " & t & "\n"); TextPort.Normalize(view.te.tp, LAST(INTEGER)) END TViewTrace; PROCEDURETViewNew (): View.T = BEGIN RETURN NEW(T).init() END TViewNew; BEGIN ZeusPanel.RegisterView (TViewNew, "PktRoute Transcript View", "PktRoute"); END PktRouteTranscriptView.