|
@@ -0,0 +1,38 @@
|
|
|
+SimpleClassDiagrams Plant_PW{
|
|
|
+ SimpleAttribute String {
|
|
|
+ constraint = $
|
|
|
+ String function constraint(model : Element, name : String):
|
|
|
+ if (is_physical_string(model["model"][name])):
|
|
|
+ return "OK"!
|
|
|
+ else:
|
|
|
+ return "String has non-string value"!
|
|
|
+ $
|
|
|
+ }
|
|
|
+ Class Rocker : Movement {}
|
|
|
+ Class PushPull : Movement {}
|
|
|
+ Class Movement : Switch {}
|
|
|
+ Class Switch : Named {}
|
|
|
+ Class LockOut : Switch {}
|
|
|
+ Class Port {}
|
|
|
+ Class Boundary : Named {}
|
|
|
+ Class PowerWindow : Named{}
|
|
|
+ Class Side : PowerWindow{}
|
|
|
+ Class Roof : PowerWindow{}
|
|
|
+ Class Named {
|
|
|
+ name : String
|
|
|
+ }
|
|
|
+ Class Sensor : Named {}
|
|
|
+ Class Infrared : Sensor {}
|
|
|
+ Class ForceDetecting : Sensor {}
|
|
|
+
|
|
|
+ Association ConnectSwitch (Port, Switch) {}
|
|
|
+ Association has1 (Boundary, Switch) {}
|
|
|
+ Association Controls (Movement, PowerWindow) {}
|
|
|
+ Association HasSwitch (PowerWindow, Switch) {}
|
|
|
+ Association Locks (LockOut, PowerWindow) {}
|
|
|
+ Association HasSensor (PowerWindow, Sensor) {}
|
|
|
+ Association Around (Boundary, PowerWindow) {}
|
|
|
+ Association Interface (Boundary, Port) {}
|
|
|
+ Association ConnectSensor (Port, Sensor) {}
|
|
|
+ Association has2 (Boundary, Sensor) {}
|
|
|
+}
|