Invoking Actions while Running Pulse Engine on a Terminal

Hi,

My team and I are working on trying to extend the Pulse Engine to simulate an ECMO machine on a web server, while doing so, we are unsure about how to get Pulse Engine simulate in real time and how to get the actions to work interactively in real time as well while the engine is running on a terminal.

Any help and guidance would be deeply appreciated.

Cheers,
Denzel.

Hi Denzel!

So you are going to want to associate and manage a pulse engine for each instance of your web client.

You can look at the explorer and how we wrapped up a thread that does this for a single pulse engine.

We are currently working on a scalable and dynamic multithreaded engine pool / management system, which would probably be exactly what you want. (when complete, I don’t have a timeline on when this would be ready yet). Currently this is not dynamic and not real time locked.

Basically, you need to manage (provide actions and pull data for your system) and advance time in each engine in some kind of threaded application. You would want to sleep the thread to maintain real time.

Take a look at the engine pool example. If you would like to take a shot, I can help review updates to help expedite this functionality.

You can run any of these how to examples on the terminal

1 Like

Alright thanks abray! Appreciate the help! We let you know if we make any progress as well :slight_smile:, thanks again and have a fine week ahead!

Hi Aaron,

I have a question about implementing the thread wrapping for a single pulse engine. Based of the Pulse Explorer, I am quite puzzled as to how to implement what’s been coded into the engine code repository. Would the “Controller.h” file be a good starting place?

Does this help

https://gitlab.kitware.com/physiology/engine/-/blob/master/src/cpp/howto/HowTo-RunThreaded.cpp

It does! I was just wondering if we want to store the Pulse Engine output into a database, what would be the best approach for this? Thanks Aaron!

You can pull data from pulse after every time step. Just access the system via something like pulse->GetCardiovascular()->GetMeanArterialPressure(PressureUnit::mmHg) and it will give you a double value. Collect all the doubles you want into an array and stash it in your database. Something like that… It depends on your databases and what you want to do with the data.