
@requires discrete-time
COMPONENT FoldableDrill system
INTERFACE
INPUT command : { OPEN , CLOSE } ;
REFINEMENT
SUB drill : Drill ;
SUB cavity : DrillCavity ;
SUB controller : Controller ;
CONNECTION controller.command := command ;
CONNECTION controller.drill_sensed_value := drill.sensed_value ;
CONNECTION controller.door_sensed_value := cavity.sensed_value ;
CONNECTION drill.operation := controller.drill_operation ;
CONNECTION cavity.operation := controller.door_operation ;
COMPONENT Drill
INTERFACE
INPUT operation : { OPEN , CLOSE , IDLE } ;
OUTPUT sensed_value : integer ;
REFINEMENT
SUB hinge : DrillFoldHinge ;
SUB drill_motor : ElectricMotor ;
SUB drill_angle_sensor : AngleSensor ;
CONNECTION drill_angle_sensor.value := hinge.percentage ;
CONNECTION hinge.torque := drill_motor.torque ;
CONNECTION sensed_value := drill_angle_sensor.sensed_value ;
CONNECTION drill_motor.operation := operation ;
COMPONENT DrillFoldHinge
INTERFACE
INPUT torque : integer ;
OUTPUT percentage : integer ;
COMPONENT ElectricMotor
INTERFACE
INPUT operation : { OPEN , CLOSE , IDLE } ;
OUTPUT torque : integer ;
COMPONENT AngleSensor
INTERFACE
INPUT value : integer ;
OUTPUT sensed_value : integer ;
COMPONENT DrillCavity
INTERFACE
INPUT operation : { OPEN , CLOSE , IDLE } ;
OUTPUT sensed_value : integer ;
REFINEMENT
SUB door : DrillCavityDoor ;
SUB door_motor : ElectricMotor ;
SUB door_angle_sensor : AngleSensor ;
CONNECTION door_angle_sensor.value := door.percentage ;
CONNECTION door.torque := door_motor.torque ;
CONNECTION sensed_value := door_angle_sensor.sensed_value ;
CONNECTION door_motor.operation := operation ;
COMPONENT DrillCavityDoor
INTERFACE
INPUT torque : integer ;
OUTPUT percentage : integer ;
COMPONENT Controller
INTERFACE
INPUT command : { OPEN , CLOSE } ;
INPUT drill_sensed_value : integer ;
INPUT door_sensed_value : integer ;
OUTPUT drill_operation : { OPEN , CLOSE , IDLE } ;
OUTPUT door_operation : { OPEN , CLOSE , IDLE } ;
