diff --git a/capella_model_explorer/demo.py b/capella_model_explorer/demo.py index 379af53..b42e82e 100644 --- a/capella_model_explorer/demo.py +++ b/capella_model_explorer/demo.py @@ -22,6 +22,14 @@ env = Environment() + +def red_text(text): + st.write( + f'{text}', + unsafe_allow_html=True, + ) + + if "all_models" not in st.session_state: st.session_state["all_models"] = { i.name: i for i in WORKSPACE.rglob("*.aird") @@ -107,17 +115,34 @@ def jump_to(vp: str, name: str) -> None: st.write("## Description") st.write(cap.description, unsafe_allow_html=True) + st.write("### Pre-condition") + if cap.precondition: + st.write(cap.precondition.specification) + else: + red_text("No pre-condition defined") - st.write("## Context Diagram") + st.write("### Post-condition") + if cap.postcondition: + st.write(cap.postcondition.specification) + else: + red_text("No post-condition defined") st.write( """\ - The image below provides an overview over the actors immediately - involved in the Capability. + ## Context Diagram + + The diagram below provides an overview over the entities immediately + involved in the Capability and related Capabilities. """ ) st.image(cap.context_diagram.as_svg) - st.write("## Data Flow Diagram") + st.write( + """\ + ## Data Flow Diagram + + The diagram below provides an overview of the System (green) and actor + (blue) functions that are required to realize the Capability. + """) st.image(cap.data_flow_view.as_svg) st.write( @@ -166,6 +191,7 @@ def jump_to(vp: str, name: str) -> None: # hide_index=True, # ) st.divider() + st.write("# All the other attributes of the object") st.write(cap.__html__(), unsafe_allow_html=True) elif viewpoint == "Functions":