<> <> <> DIRECTORY DM, DragOpsCross, DMPBusModel; DMPBusModelImpl: CEDAR PROGRAM IMPORTS DM EXPORTS DMPBusModel = BEGIN OPEN DMPBusModel; Create: PUBLIC PROC [] RETURNS [pbus: DM.Component] = { pbus _ NEW [DM.ComponentRec _ [ action: [Reset, PhA, EvPhA, PhB, EvPhB], history: NIL, componentType: $PBus, subComponents: NIL, specific: NEW [PBusSpecificRec]]] }; Cmd: PUBLIC PROC [pbus: DM.Component] RETURNS [PCmdType] = { pvt: PBusSpecific _ NARROW[pbus.specific]; RETURN [pvt.pCmdA] }; DrCmd: PUBLIC PROC [pbus: DM.Component, pCmdA: PCmdType] = { pvt: PBusSpecific _ NARROW[pbus.specific]; pvt.pCmdA _ pCmdA; }; Data: PUBLIC PROC [pbus: DM.Component] RETURNS [DM.Word] = { pvt: PBusSpecific _ NARROW[pbus.specific]; RETURN [pvt.pData] }; DrData: PUBLIC PROC [pbus: DM.Component, pData: DM.Word] = { pvt: PBusSpecific _ NARROW[pbus.specific]; pvt.pData _ pData; }; Reject: PUBLIC PROC [pbus: DM.Component] RETURNS [BOOL] = { pvt: PBusSpecific _ NARROW[pbus.specific]; RETURN [pvt.pRejectB] }; DrReject: PUBLIC PROC [pbus: DM.Component, pRejectB: BOOL] = { pvt: PBusSpecific _ NARROW[pbus.specific]; pvt.pRejectB _ pRejectB; }; PhA: DM.ActionProc = { }; EvPhA: DM.ActionProc = { pvt: PBusSpecific _ NARROW[component.specific]; component.history _ DM.ConsHistory[EvPhA, NEW[PBusSpecificRec _ pvt^], component.history] }; PhB: DM.ActionProc = { }; EvPhB: DM.ActionProc = { pvt: PBusSpecific _ NARROW[component.specific]; component.history _ DM.ConsHistory[EvPhB, NEW[PBusSpecificRec _ pvt^], component.history] }; Reset: DM.ActionProc = { component.history _ NIL }; END.