diff --git a/docs/stpa_class_diagram.png b/docs/stpa_class_diagram.png new file mode 100644 index 0000000..483a911 Binary files /dev/null and b/docs/stpa_class_diagram.png differ diff --git a/docs/stpa_class_diagram.puml b/docs/stpa_class_diagram.puml new file mode 100644 index 0000000..e52cece --- /dev/null +++ b/docs/stpa_class_diagram.puml @@ -0,0 +1,117 @@ +@startuml stpa +!pragma useIntermediatePackages false + +class stpa.control_structures.ControlActionOrFeedback { + description: str + control_type: ControlType + controller: Entity + controlled: Entity +} +class stpa.control_structures.ControlStructure { + entities: frozenset[Entity] + control_actions_or_feedbacks: frozenset[ControlActionOrFeedback] +} +enum stpa.control_structures.ControlType { + ACTION: 1 {static} + FEEDBACK: 2 {static} +} +class stpa.definitions.ControllerConstraint { + source: str + type_: str + control_action: str + context: str + unsafe_control_actions: list[UnsafeControlAction] +} +abstract class stpa.definitions.Definition { + _NAME_PATTERN: ClassVar[Pattern[str]] + _Definition__lookup: ClassVar[dict[str, Definition]] + name: str +} +class stpa.control_structures.Entity { + name: str +} +class stpa.definitions.Hazard { + system: str + unsafe_condition: str + losses: list[Loss] +} +class stpa.definitions.Loss { + description: str +} +class stpa.definitions.Responsibility { + description: str + system_level_constraints: list[SystemLevelConstraint] +} +abstract class stpa.definitions.Scenario { +} +class stpa.definitions.ScenarioType1 { + description: str + unsafe_control_action: UnsafeControlAction | None + result: str | None + hazard: Hazard | None +} +class stpa.definitions.ScenarioType2 { + description: str + result: str + hazard: Hazard +} +class stpa.definitions.SubHazard { + hazard: Hazard + description: str +} +abstract class stpa.definitions.SystemLevelConstraint { +} +class stpa.definitions.SystemLevelConstraintType1 { + system: str + enforcement_condition: str + hazards: list[Hazard] +} +class stpa.definitions.SystemLevelConstraintType2 { + hazard: Hazard + loss_mitigation: str + hazards: list[Hazard] +} +class stpa.definitions.SystemLevelConstraintType3 { + sub_hazard: SubHazard + enforcement_condition: str +} +class stpa.definitions.UnsafeControlAction { + source: str + type_: str + control_action: str + context: str + hazards: list[Hazard | SubHazard] +} +stpa.control_structures.ControlActionOrFeedback *-- stpa.control_structures.ControlType +stpa.control_structures.ControlActionOrFeedback *-- stpa.control_structures.Entity +stpa.control_structures.ControlStructure *-- stpa.control_structures.Entity +stpa.control_structures.ControlStructure *-- stpa.control_structures.ControlActionOrFeedback +stpa.definitions.ControllerConstraint *-- stpa.definitions.UnsafeControlAction +stpa.definitions.Definition <|-- stpa.definitions.ControllerConstraint +stpa.definitions.Definition *-- stpa.definitions.Definition +stpa.definitions.Hazard *-- stpa.definitions.Loss +stpa.definitions.Definition <|-- stpa.definitions.Hazard +stpa.definitions.Definition <|-- stpa.definitions.Loss +stpa.definitions.Responsibility *-- stpa.definitions.SystemLevelConstraint +stpa.definitions.Definition <|-- stpa.definitions.Responsibility +stpa.definitions.Definition <|-- stpa.definitions.Scenario +stpa.definitions.ScenarioType1 *-- stpa.definitions.UnsafeControlAction +stpa.definitions.ScenarioType1 *-- stpa.definitions.Hazard +stpa.definitions.Scenario <|-- stpa.definitions.ScenarioType1 +stpa.definitions.ScenarioType2 *-- stpa.definitions.Hazard +stpa.definitions.Scenario <|-- stpa.definitions.ScenarioType2 +stpa.definitions.SubHazard *-- stpa.definitions.Hazard +stpa.definitions.SystemLevelConstraint <|-- stpa.definitions.SubHazard +stpa.definitions.Definition <|-- stpa.definitions.SystemLevelConstraint +stpa.definitions.SystemLevelConstraintType1 *-- stpa.definitions.Hazard +stpa.definitions.SystemLevelConstraint <|-- stpa.definitions.SystemLevelConstraintType1 +stpa.definitions.SystemLevelConstraintType2 *-- stpa.definitions.Hazard +stpa.definitions.SystemLevelConstraint <|-- stpa.definitions.SystemLevelConstraintType2 +stpa.definitions.SystemLevelConstraintType3 *-- stpa.definitions.SubHazard +stpa.definitions.SystemLevelConstraint <|-- stpa.definitions.SystemLevelConstraintType3 +stpa.definitions.UnsafeControlAction *-- stpa.definitions.Hazard +stpa.definitions.UnsafeControlAction *-- stpa.definitions.SubHazard +stpa.definitions.Definition <|-- stpa.definitions.UnsafeControlAction +footer Generated by //py2puml// +@enduml + diff --git a/docs/stpa_class_diagram.svg b/docs/stpa_class_diagram.svg new file mode 100644 index 0000000..347c3dc --- /dev/null +++ b/docs/stpa_class_diagram.svg @@ -0,0 +1 @@ +stpacontrol_structuresdefinitionsControlActionOrFeedbackdescription: strcontrol_type: ControlTypecontroller: Entitycontrolled: EntityControlStructureentities: frozenset[Entity]control_actions_or_feedbacks: frozenset[ControlActionOrFeedback]ControlTypeACTION: 1FEEDBACK: 2Entityname: strControllerConstraintsource: strtype_: strcontrol_action: strcontext: strunsafe_control_actions: list[UnsafeControlAction]Definition_NAME_PATTERN: ClassVar[Pattern[str]]_Definition__lookup: ClassVar[dict[str, Definition]]name: strHazardsystem: strunsafe_condition: strlosses: list[Loss]Lossdescription: strResponsibilitydescription: strsystem_level_constraints: list[SystemLevelConstraint]ScenarioScenarioType1description: strunsafe_control_action: UnsafeControlAction | Noneresult: str | Nonehazard: Hazard | NoneScenarioType2description: strresult: strhazard: HazardSubHazardhazard: Hazarddescription: strSystemLevelConstraintSystemLevelConstraintType1system: strenforcement_condition: strhazards: list[Hazard]SystemLevelConstraintType2hazard: Hazardloss_mitigation: strhazards: list[Hazard]SystemLevelConstraintType3sub_hazard: SubHazardenforcement_condition: strUnsafeControlActionsource: strtype_: strcontrol_action: strcontext: strhazards: list[Hazard | SubHazard]Generated bypy2puml \ No newline at end of file