Skip to content
Steven A White edited this page Jun 24, 2021 · 7 revisions

BioGears includes a number HowTo API examples which are short BioGears simulations snippits that exercise one or two simple Patient Actions before closing a simulation. Each one can be built as an independent executable and launched from inside a BioGears runtime directory where all the relevant requirements are located. While the BioGears API does allow for the runtime directory to be specified when the physiology is created most HowTo's simply assume it is the current directory.

HowTos are toggled as a group by the Biogears_BUILD_HOWTOS CMake variable and are individually togged using the BUILD_EX_howto-${NAME} variables

Existing HowTos

  • AirwayObstruction
  • AnesthesiaMachine
  • Asthma
  • BolusDrug
  • BrainInjury
  • CMakeLists.txt
  • common-source
  • ConcurrentEngines
  • ConsumeNutrients
  • COPD
  • CPR
  • CreateAPatient
  • CWD_Change
  • EngineUse
  • EnvironmentChange
  • Exercise
  • Fasciculation
  • Hemorrhage
  • InfusionDrug
  • LobarPneumonia
  • MechanicalVentilation
  • PainStimulus
  • ParameterOverride
  • PulmonaryFunctionTest
  • RunScenario
  • SarinExposure
  • SceanrioBase
  • SepsisDynamic
  • Smoke
  • TensionPneumothorax
  • ThreadedBioGears
  • VasopressinShockTherapy

Running HowTos

Note: this is for running a how-to in a linux environment

    cd /opt/biogears/build-gcc9/runtime
    ../outputs/<CONFIG>/bin/howto-bolusdrug

This is only an example your build path will very based on your build configuration. is simply the name of which CMAKE_BUILD_TYPE you used during configuration generally this is Debug,Release,ReleaseWithDebInfo, or ReleaseMinSize. In general, you simply need to change to the sub directory runtime inside your CMake build folder and execute the howto using a relative path.

Creating New HowTos

Note: this is for creating a how-to in a linux environment

One of the easiest ways to prototype with the BioGears API is by cloning a HowTo and creating your own example inside the BioGears code base yourself. This is easily done by simply copying the directroy of bolusdrug to myexample

   cd /opt/biogears/projects/howto
   cp -r BolusDrug MyExample
   rename 's/BolusDrug/MyExample/' MyExample/src/*

Now simply rerun cmake in your build dir and it will add the new MyExample howto as a final target

   cd /opt/biogears}/build-gcc9
   cmake .
   ninja

Once you have verified your howto runs you can edit all of the files in MyExample/src until you have proven out your integration prototye. CMake will handle the discovery of any new files and linking to libBioGears for you automatically, provided it is manually run each time a new file is created. This is a good way to start integrating BioGears early and to figure out how to properly use the API