Add persisted state-machine diagram contexts and shared geometry

This commit is contained in:
2026-09-06 02:23:31 +03:00
parent fef2e0dbce
commit e7a81637dd
9 changed files with 1143 additions and 15 deletions
+13
View File
@@ -1190,6 +1190,7 @@ impl RelationBody {
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub enum ProjectionKind {
Overview,
Decomposition,
@@ -1197,10 +1198,21 @@ pub enum ProjectionKind {
Traceability,
FunctionalDataflow,
Capabilities,
StateMachine { machine: Id },
}
impl ProjectionKind {
pub fn state_machine(self) -> Option<Id> {
match self {
Self::StateMachine { machine } => Some(machine),
_ => None,
}
}
pub fn includes(self, kind: Kind) -> bool {
match self {
Self::StateMachine { .. } => {
matches!(kind, Kind::StateMachine | Kind::Region) || kind.is_state()
}
Self::Allocation => kind.is_performer() || kind.is_work(),
Self::FunctionalDataflow => kind.is_work(),
Self::Capabilities => {
@@ -1221,6 +1233,7 @@ impl ProjectionKind {
impl std::fmt::Display for ProjectionKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(match self {
Self::StateMachine { .. } => "State machine",
Self::Allocation => "Architecture · allocated work",
Self::FunctionalDataflow => "Functional dataflow",
Self::Capabilities => "Missions & capabilities",