MODULE; <* PRAGMA LL *> IMPORT Algorithm, Axis, DataView, Filter, FormsVBT, Rd, Rsrc, TextVBT, Thread, VBT, View, Zeus, ZeusClass; <* FATAL Rd.Failure, Thread.Alerted, FormsVBT.Error *> REVEAL T = View.T BRANDED OBJECT tc: CARDINAL; slate: TextVBT.T; OVERRIDES isCompat := IsCompat; startrun := Startrun; shape := Shape; END; PROCEDURE ZeusDataView IsCompat (<* UNUSED *> v: T; alg: ZeusClass.T): BOOLEAN = <* LL = arbitrary *> BEGIN RETURN NARROW(alg, Algorithm.T).varRsrc # NIL END IsCompat; PROCEDUREStartrun (view: T) = <* LL.sup < VBT.mu *> <* FATAL Rsrc.NotFound *> VAR alg := Zeus.Resolve(view).alg; ch : VBT.T; BEGIN LOCK VBT.mu DO (* This code is serialized among all data views. Just before Zeus calls Startrun, it NILs alg.varView. Thus, only the first data view whose Startrun executes will actually install the varRsrc form. *) IF alg.varRsrc = NIL THEN (* TextVBT.Put(view.slate, "No variable-view form specified in this algorithm."); ch := view.slate; *) <* ASSERT FALSE *> ELSIF alg.varView # NIL THEN TextVBT.Put( view.slate, "Another variable-view installed."); ch := view.slate; ELSE alg.varView := NEW(DataView.T).initFromRsrc(alg.varRsrc, alg.varPath); ch := alg.varView; END; IF ch # Filter.Child(view) THEN EVAL Filter.Replace(view, ch) END END; View.T.startrun(view); END Startrun; CONST DefaultShape = VBT.SizeRange{lo := VBT.DefaultShape.lo, pref := 300, hi := VBT.DefaultShape.hi}; PROCEDUREShape (<* UNUSED *> v : VBT.T; <* UNUSED *> axis: Axis.T; <* UNUSED *> n : CARDINAL): VBT.SizeRange = BEGIN RETURN DefaultShape END Shape; PROCEDURENew (): View.T = <* LL.sup <= VBT.mu *> VAR ch := TextVBT.New (""); BEGIN RETURN NEW (T, slate := ch).init (ch); END New; BEGIN END ZeusDataView.