Add persisted state-machine diagram contexts and shared geometry
Rust checks / check (ubuntu-latest) (push) Canceled after 0s
Rust checks / check (windows-latest) (push) Canceled after 0s
Rust checks / check (ubuntu-latest) (push) Canceled after 0s
Rust checks / check (windows-latest) (push) Canceled after 0s
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user