-- CountInterface.mesa Edited by Sandman September 4, 1980 3:33 PM DIRECTORY CountDefs USING [ condition, EnumerateNotify, groups, loadmatrix, modePos, modulePos, mon, ParamNotify, printmodule, printsorted, printtables, processPos, setProcess, sort, SortClass, zero], CountPrivate USING [Mode], FormSW USING [ AllocateItemDescriptor, ClientItemsProcType, CommandItem, Enumerated, EnumeratedItem, line0, line1, line2, line3, StringItem], PerfCommonOps USING [], Runtime USING [GetBcdTime], String USING [AppendString], Time USING [Append, Unpack], Tool USING [Create, MakeFileSW, MakeFormSW, MakeMsgSW], ToolWindow USING [TransitionProcType], Window USING [Handle, Place]; CountInterface: PROGRAM IMPORTS CountDefs, FormSW, Runtime, String, Time, Tool EXPORTS CountDefs, PerfCommonOps =PUBLIC BEGIN OPEN CountDefs; window: Window.Handle _ NIL; msgSW: Window.Handle _ NIL; cmdSW: Window.Handle _ NIL; logSW: Window.Handle _ NIL; MakeSWs: PROCEDURE [window: Window.Handle] = BEGIN msgSW _ Tool.MakeMsgSW[window]; cmdSW _ Tool.MakeFormSW[window: window, formProc: MakeForm]; logSW _ Tool.MakeFileSW[window: window, name: "Count.log"L]; END; Init: PROCEDURE = BEGIN title: STRING = "Xfer Counter 6.0 of "L; herald: STRING _ [60]; String.AppendString[to: herald, from: title]; Time.Append[herald, Time.Unpack[Runtime.GetBcdTime[]]]; herald.length _ herald.length - 3; window _ Tool.Create[ makeSWsProc: MakeSWs, name: herald, clientTransition: TransitionProc]; END; TransitionProc: ToolWindow.TransitionProcType = BEGIN SELECT TRUE FROM old = inactive => msgSW _ cmdSW _ logSW _ NIL; ENDCASE; END; monitorOn: BOOLEAN _ FALSE; module: STRING _ NIL; process: STRING _ NIL; sortClass: SortClass _ count; mode: CountPrivate.Mode _ plain; monPlace: Window.Place = [x: 0*7, y: FormSW.line0]; zeroPlace: Window.Place = [x: 22*7, y: FormSW.line0]; condPlace: Window.Place = [x: 42*7, y: FormSW.line0]; ptPlace: Window.Place = [x: 0*7, y: FormSW.line1]; psPlace: Window.Place = [x: 22*7, y: FormSW.line1]; sortPlace: Window.Place = [x: 42*7, y: FormSW.line1]; pmPlace: Window.Place = [x: 0*7, y: FormSW.line2]; modulePlace: Window.Place = [x: 14*7, y: FormSW.line2]; spPlace: Window.Place = [x: 39*7, y: FormSW.line2]; pPlace: Window.Place = [x: 52*7, y: FormSW.line2]; modePlace: Window.Place = [x: 0*7, y: FormSW.line3]; matrixPlace: Window.Place = [x: 26*7, y: FormSW.line3]; groupPlace: Window.Place = [x: 42*7, y: FormSW.line3]; MakeForm: FormSW.ClientItemsProcType = BEGIN OPEN FormSW; sortClassEnumRec: ARRAY SortClass OF Enumerated _ [[string: "count"L, value: SortClass[count]], [string: "time"L, value: SortClass[time]]]; monitorEnumRec: ARRAY BOOLEAN OF Enumerated _ [[string: "off"L, value: FALSE], [string: "on"L, value: TRUE]]; modeEnumRec: ARRAY CountPrivate.Mode OF Enumerated _ [[string: "plain"L, value: CountPrivate.Mode[plain]], [string: "matrix"L, value: CountPrivate.Mode[matrix]]]; nParams: CARDINAL = groups + 1; items _ AllocateItemDescriptor[nParams]; items[mon] _ EnumeratedItem[ tag: "Monitor"L, place: monPlace, feedback: all, choices: LOOPHOLE[DESCRIPTOR[monitorEnumRec]], proc: EnumerateNotify, value: @monitorOn]; items[zero] _ CommandItem[ tag: "Zero Tables"L, place: zeroPlace, proc: ParamNotify]; items[condition] _ CommandItem[ tag: "Condition Breaks"L, place: condPlace, proc: ParamNotify]; items[printtables] _ CommandItem[ tag: "Print Tables"L, place: ptPlace, proc: ParamNotify]; items[printsorted] _ CommandItem[ tag: "Print Sorted"L, place: psPlace, proc: ParamNotify]; items[sort] _ EnumeratedItem[ tag: "Sort by"L, place: sortPlace, feedback: all, choices: LOOPHOLE[DESCRIPTOR[sortClassEnumRec]], proc: EnumerateNotify, value: @sortClass]; items[printmodule] _ CommandItem[ tag: "Print Module"L, place: pmPlace, proc: ParamNotify]; items[modulePos] _ StringItem[ tag: "Module"L, place: modulePlace, string: @module, drawBox: TRUE, inHeap: TRUE]; items[setProcess] _ CommandItem[ tag: "Set Process"L, place: spPlace, proc: ParamNotify]; items[processPos] _ StringItem[ tag: "Process"L, place: pPlace, string: @process, drawBox: TRUE, inHeap: TRUE]; items[modePos] _ EnumeratedItem[ tag: "Mode"L, place: modePlace, feedback: all, choices: LOOPHOLE[DESCRIPTOR[modeEnumRec]], proc: EnumerateNotify, value: @mode]; items[loadmatrix] _ CommandItem[ tag: "Load Matrix"L, place: matrixPlace, proc: ParamNotify]; items[groups] _ CommandItem[ tag: "Show Group"L, place: groupPlace, proc: ParamNotify]; END; Init[]; END...