plant_PW.mvc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. include "primitives.alh"
  2. SimpleClassDiagrams Plant_PW{
  3. SimpleAttribute String {
  4. constraint = $
  5. String function constraint(model : Element, name : String):
  6. if (is_physical_string(model["model"][name])):
  7. return "OK"!
  8. else:
  9. return "String has non-string value"!
  10. $
  11. }
  12. Class Named {
  13. name : String
  14. }
  15. Class Port {
  16. name : String
  17. }
  18. Class Switch : Named {}
  19. Class Boundary : Named {}
  20. Class PowerWindow : Named{}
  21. Class Sensor : Named {}
  22. Class Movement : Switch {}
  23. Class LockOut : Switch {}
  24. Class Infrared : Sensor {}
  25. Class ForceDetecting : Sensor {}
  26. Class Rocker : Movement {}
  27. Class PushPull : Movement {}
  28. Class Side : PowerWindow{}
  29. Class Roof : PowerWindow{}
  30. Association ConnectSwitch (Port, Switch) {}
  31. Association has1 (Boundary, Switch) {}
  32. Association Controls (Movement, PowerWindow) {}
  33. Association HasSwitch (PowerWindow, Switch) {}
  34. Association Locks (LockOut, PowerWindow) {}
  35. Association HasSensor (PowerWindow, Sensor) {}
  36. Association Around (Boundary, PowerWindow) {}
  37. Association Interface (Boundary, Port) {}
  38. Association ConnectSensor (Port, Sensor) {}
  39. Association has2 (Boundary, Sensor) {}
  40. }