Bodylight.js

Bodylight.js

  • Docs
  • GitHub

›Simple project

Getting started

  • Introduction
  • Compiling Modelica

Simple project

  • Creating a simple project
  • Adding the model
  • Visualisation
  • Controls
  • Events and Actions

Physiological application

  • Pressure volume cardiac simulator
  • Creating the layout
  • Adding the heart
  • Heart Beat
  • Controls
  • Phases
  • Pressure volume chart
  • Rolling charts
  • Custom actions
  • Buttons
  • Finishing touches

API

  • Model
  • Plotly chart
  • Range
  • Toggle

Events and Actions

Add reset button

  • Drag the Button widget from the Blocks palette to the right of the second range, so that it is inserted below this range.
  • Name the button "Reset simulation"

Configure reset model action

  • Click the button to select it.
  • Set the mode of the button to the "Button triggers an event" option in the Mode section.
  • Click "Add event" in the Events section.
  • Select the "On-click" event.
  • Select the "Reset model" action to be triggered.
  • Select the "Lissajous" model so that the action is performed on it.


  • Preview the simulator


  • the button restsarts the model but
  • mr. Wrong Wrongstein Wrongington – an action to reset chart must be added.

Create action - clear chart

  • Drag the action widget from the Blocks palette to the canvas.

* Name the action "Clear chart" * Write "Removes traces from chart" to the Description

write code

chart.clear()

connect with button

The project in the current stage may be downloaded here and the simulator is:

← ControlsPressure volume cardiac simulator →
Copyright © 2019 Creative Connections s.r.o.