Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit 22a2d111 authored by Aaron Bray's avatar Aaron Bray
Browse files

Engine Schema is up, Renamed engine to 'Pulse'

parent c302938d
......@@ -67,7 +67,7 @@ file(GLOB_RECURSE JAVA_FILES
"${CMAKE_SOURCE_DIR}/test/cdm/java/*.java"
"${CMAKE_SOURCE_DIR}/test/engine/java/*.java"
"${CMAKE_SOURCE_DIR}/test/driver/java/*.java")
add_jar(BioGearsJava ${JAVA_FILES}
add_jar(PulseJava ${JAVA_FILES}
INCLUDE_JARS
${CMAKE_SOURCE_DIR}/jar/jcommon-1.0.16.jar
${CMAKE_SOURCE_DIR}/jar/jdom-2.0.2.jar
......@@ -80,12 +80,12 @@ add_jar(BioGearsJava ${JAVA_FILES}
${CMAKE_SOURCE_DIR}/jar/pdfbox-2.0.0-RC3.jar
${CMAKE_SOURCE_DIR}/jar/reflections-0.9.9-RC1-uberjar.jar
${CMAKE_SOURCE_DIR}/jar/zip4j-1.3.1.jar
OUTPUT_NAME BioGears)
get_target_property(_jarFile BioGearsJava JAR_FILE)
add_custom_command(TARGET BioGearsJava POST_BUILD
OUTPUT_NAME Pulse)
get_target_property(_jarFile PulseJava JAR_FILE)
add_custom_command(TARGET PulseJava POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}
COMMAND ${CMAKE_COMMAND} -E copy ${_jarFile} ${INSTALL_BIN})
install_jar(BioGearsJava ${INSTALL_BIN})
install_jar(PulseJava ${INSTALL_BIN})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX})
set(DATA_ROOT ${CMAKE_SOURCE_DIR})
......@@ -97,7 +97,7 @@ install(FILES ${CMAKE_BINARY_DIR}/run.config DESTINATION ${CMAKE_INSTALL_PREFIX}
configure_file(${CMAKE_SOURCE_DIR}/docs/Doxygen/full.doxy.in ${CMAKE_BINARY_DIR}/full.doxy @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/full.doxy DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/docs)
# BioGears Testing
# Pulse Testing
enable_testing()
add_test(NAME runCDMUnitTests
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=CDMUnitTests -P ${CMAKE_BINARY_DIR}/install/bin/run.cmake
......
......@@ -31,7 +31,7 @@ ExternalProject_Add( Eigen
-DCMAKE_INSTALL_PREFIX:STRING=${Eigen_INSTALL}
-DINCLUDE_INSTALL_DIR:STRING=${Eigen_INSTALL}/include
)
list(APPEND BioGears_DEPENDENCIES Eigen)
list(APPEND Pulse_DEPENDENCIES Eigen)
# Install Headers
install(DIRECTORY ${Eigen_INSTALL}/include
DESTINATION ${CMAKE_INSTALL_PREFIX})
......@@ -73,7 +73,7 @@ ExternalProject_Add( log4cpp
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
list(APPEND BioGears_DEPENDENCIES log4cpp)
list(APPEND Pulse_DEPENDENCIES log4cpp)
list(APPEND CMAKE_PREFIX_PATH ${log4cpp_INSTALL})
###################################################
......@@ -112,7 +112,7 @@ ExternalProject_Add( protobuf
-DADDITIONAL_C_FLAGS:STRING=${ADDITIONAL_C_FLAGS}
-DADDITIONAL_CXX_FLAGS:STRING=${ADDITIONAL_CXX_FLAGS}
)
list(APPEND BioGears_DEPENDENCIES protobuf)
list(APPEND Pulse_DEPENDENCIES protobuf)
list(APPEND CMAKE_PREFIX_PATH ${protobuf_INSTALL})
install(DIRECTORY ${protobuf_INSTALL}/include
......@@ -211,7 +211,7 @@ if(WIN32)
-DINCLUDE_INSTALL_DIR:STRING=${dirent_INSTALL}/include
)
message(STATUS "dirent is here : ${dirent_DIR}" )
list(APPEND BioGears_DEPENDENCIES dirent)
list(APPEND Pulse_DEPENDENCIES dirent)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/dirent/install)
# Install Headers
install(DIRECTORY ${dirent_INSTALL}/include
......@@ -232,10 +232,10 @@ endif()
# ExternalProject_Add doesn't like to work with lists: it keeps only the first element
string(REPLACE ";" "::" CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}")
# Generate the BioGears project after dependencies have been built
# Generate the Pulse project after dependencies have been built
ExternalProject_Add( InnerBuild
PREFIX InnerBuild
DEPENDS Eigen ${BioGears_DEPENDENCIES}
DEPENDS Eigen ${Pulse_DEPENDENCIES}
DOWNLOAD_COMMAND ""
DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}
SOURCE_DIR ${CMAKE_SOURCE_DIR}
......
/**************************************************************************************
Copyright 2015 Applied Research Associates, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the License
at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
**************************************************************************************/
#include "stdafx.h"
#include "utils/ScopedMutex.h"
#include <mutex>
static std::recursive_mutex g_rMutex;
ScopedMutex::ScopedMutex()
{
g_rMutex.lock();
}
ScopedMutex::~ScopedMutex()
{
g_rMutex.unlock();
}
/**************************************************************************************
Copyright 2015 Applied Research Associates, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the License
at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
**************************************************************************************/
#pragma once
#include "CommonDataModel.h"
class DLL_DECL ScopedMutex
{
public:
ScopedMutex();
~ScopedMutex();
ScopedMutex(const ScopedMutex& other) = delete;
ScopedMutex& operator=(const ScopedMutex& other) = delete;
ScopedMutex(ScopedMutex&& other) = delete;
ScopedMutex& operator=(ScopedMutex&& other) = delete;
};
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>BioGearsEngine</name>
<name>Engine</name>
<comment></comment>
<projects>
</projects>
......
# Files in the project (Relative to this CMAKE file)
file(GLOB BIOGEARS_FILES
file(GLOB PULSE_FILES
"cpp/*.h"
"cpp/*.cpp"
)
list(REMOVE_ITEM BIOGEARS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/BioGearsEngineJNI.h)
list(REMOVE_ITEM BIOGEARS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/BioGearsEngineJNI.cpp)
list(REMOVE_ITEM BIOGEARS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/BioGearsScenarioDriver.cpp)
list(REMOVE_ITEM BIOGEARS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/BioGearsScenarioDriver.h)
list(REMOVE_ITEM BIOGEARS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/Verification.cpp)
list(REMOVE_ITEM BIOGEARS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/Verification.h)
list(REMOVE_ITEM BIOGEARS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/stdafx.cpp)#PreCompiled Header Generator, will add later
set(SOURCE ${BIOGEARS_FILES})
file(GLOB BIOGEARS_CONTROLLER_FILES
list(REMOVE_ITEM PULSE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/PulseEngineJNI.h)
list(REMOVE_ITEM PULSE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/PulseEngineJNI.cpp)
list(REMOVE_ITEM PULSE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/PulseScenarioDriver.cpp)
list(REMOVE_ITEM PULSE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/PulseScenarioDriver.h)
list(REMOVE_ITEM PULSE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/Verification.cpp)
list(REMOVE_ITEM PULSE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/Verification.h)
list(REMOVE_ITEM PULSE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/stdafx.cpp)#PreCompiled Header Generator, will add later
set(SOURCE ${PULSE_FILES})
file(GLOB PULSE_CONTROLLER_FILES
"cpp/Controller/*.h"
"cpp/Controller/*.cpp"
)
list(APPEND SOURCE ${BIOGEARS_CONTROLLER_FILES})
file(GLOB BIOGEARS_SCENARIO_FILES
list(APPEND SOURCE ${PULSE_CONTROLLER_FILES})
file(GLOB PULSE_SCENARIO_FILES
"cpp/Controller/Scenario/*.h"
"cpp/Controller/Scenario/*.cpp"
)
list(APPEND SOURCE ${BIOGEARS_SCENARIO_FILES})
file(GLOB BIOGEARS_EQUIPMENT_FILES
list(APPEND SOURCE ${PULSE_SCENARIO_FILES})
file(GLOB PULSE_EQUIPMENT_FILES
"cpp/Equipment/*.h"
"cpp/Equipment/*.cpp"
)
list(APPEND SOURCE ${BIOGEARS_EQUIPMENT_FILES})
file(GLOB BIOGEARS_SYSTEMS_FILES
list(APPEND SOURCE ${PULSE_EQUIPMENT_FILES})
file(GLOB PULSE_SYSTEMS_FILES
"cpp/Systems/*.h"
"cpp/Systems/*.cpp"
)
list(APPEND SOURCE ${BIOGEARS_SYSTEMS_FILES})
list(APPEND SOURCE ${PULSE_SYSTEMS_FILES})
# Set up Filters
source_group("" FILES ${BIOGEARS_FILES})
source_group("Controller" FILES ${BIOGEARS_CONTROLLER_FILES})
source_group("Controller\\Scenario" FILES ${BIOGEARS_SCENARIO_FILES})
source_group("Equipment" FILES ${BIOGEARS_EQUIPMENT_FILES})
source_group("Systems" FILES ${BIOGEARS_SYSTEMS_FILES})
source_group("" FILES ${PULSE_FILES})
source_group("Controller" FILES ${PULSE_CONTROLLER_FILES})
source_group("Controller\\Scenario" FILES ${PULSE_SCENARIO_FILES})
source_group("Equipment" FILES ${PULSE_EQUIPMENT_FILES})
source_group("Systems" FILES ${PULSE_SYSTEMS_FILES})
# The DLL we are building
add_library(BioGearsEngine SHARED ${SOURCE})
add_library(PulseEngine SHARED ${SOURCE})
# Preprocessor Definitions and Include Paths
set(ENG_FLAGS)
set(ENG_FLAGS "${ENG_FLAGS} -D BIOGEARS_EXPORT")
set(ENG_FLAGS "${ENG_FLAGS} -D PULSE_EXPORT")
set(ENG_FLAGS "${ENG_FLAGS} -D UNICODE")
set(ENG_FLAGS "${ENG_FLAGS} -D _UNICODE")
if(MSVC)
set(ENG_FLAGS "${ENG_FLAGS} -Zm120")
endif(MSVC)
target_include_directories(BioGearsEngine PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp)
target_include_directories(BioGearsEngine PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/bind)
target_include_directories(BioGearsEngine PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cpp)
target_include_directories(BioGearsEngine PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../cdm/cpp)
target_include_directories(BioGearsEngine PRIVATE ${EIGEN3_INCLUDE_DIR})
target_include_directories(BioGearsEngine PRIVATE ${LOG4CPP_INCLUDE_DIR})
target_include_directories(BioGearsEngine PRIVATE ${PROTOBUF_INCLUDE_DIR})
target_include_directories(PulseEngine PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp)
target_include_directories(PulseEngine PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/bind)
target_include_directories(PulseEngine PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cpp)
target_include_directories(PulseEngine PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../cdm/cpp)
target_include_directories(PulseEngine PRIVATE ${EIGEN3_INCLUDE_DIR})
target_include_directories(PulseEngine PRIVATE ${LOG4CPP_INCLUDE_DIR})
target_include_directories(PulseEngine PRIVATE ${PROTOBUF_INCLUDE_DIR})
set_target_properties(BioGearsEngine PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(BioGearsEngine PROPERTIES COMPILE_FLAGS "${ENG_FLAGS}" PREFIX "")
set_target_properties(PulseEngine PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(PulseEngine PROPERTIES COMPILE_FLAGS "${ENG_FLAGS}" PREFIX "")
if(APPLE)
set_target_properties(BioGearsEngine PROPERTIES MACOSX_RPATH ON)
set_target_properties(PulseEngine PROPERTIES MACOSX_RPATH ON)
endif()
# Dependent Libraries
target_link_libraries(BioGearsEngine CommonDataModel)
target_link_libraries(PulseEngine CommonDataModel)
add_custom_command(TARGET BioGearsEngine POST_BUILD
add_custom_command(TARGET PulseEngine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:BioGearsEngine> ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG})
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:PulseEngine> ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG})
if(WIN32)# Copy dll files to the bin
install(TARGETS BioGearsEngine
install(TARGETS PulseEngine
RUNTIME CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG}
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS BioGearsEngine
install(TARGETS PulseEngine
RUNTIME CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG}
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS BioGearsEngine
install(TARGETS PulseEngine
RUNTIME CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG}
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
else()# Copy so files to the bin
install(TARGETS BioGearsEngine
install(TARGETS PulseEngine
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS BioGearsEngine
install(TARGETS PulseEngine
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS BioGearsEngine
install(TARGETS PulseEngine
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
endif()
# Copy lib/so files to the sdk/lib
install(TARGETS BioGearsEngine
install(TARGETS PulseEngine
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_LIB}/release${EX_CONFIG}
ARCHIVE CONFIGURATIONS Release DESTINATION ${INSTALL_LIB}/release${EX_CONFIG})
install(TARGETS BioGearsEngine
install(TARGETS PulseEngine
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_LIB}/debug${EX_CONFIG}
ARCHIVE CONFIGURATIONS Debug DESTINATION ${INSTALL_LIB}/debug${EX_CONFIG})
install(TARGETS BioGearsEngine
install(TARGETS PulseEngine
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_LIB}/relwithdebinfo${EX_CONFIG}
ARCHIVE CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_LIB}/relwithdebinfo${EX_CONFIG})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/BioGearsPhysiologyEngine.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cpp/PulsePhysiologyEngine.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
source_group("" FILES cpp/BioGearsEngineJNI.h
cpp/BioGearsEngineJNI.cpp)
source_group("" FILES cpp/PulseEngineJNI.h
cpp/PulseEngineJNI.cpp)
add_library(BioGearsEngineJNI SHARED cpp/BioGearsEngineJNI.h
cpp/BioGearsEngineJNI.cpp)
add_library(PulseEngineJNI SHARED cpp/PulseEngineJNI.h
cpp/PulseEngineJNI.cpp)
find_package(JNI REQUIRED)
target_include_directories(BioGearsEngineJNI PRIVATE ${JNI_INCLUDE_DIRS})
target_include_directories(BioGearsEngineJNI PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/)
target_include_directories(BioGearsEngineJNI PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/bind/)
target_include_directories(BioGearsEngineJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cpp)
target_include_directories(BioGearsEngineJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../cdm/cpp)
target_include_directories(BioGearsEngineJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../test/engine/cpp)
target_include_directories(BioGearsEngineJNI PRIVATE ${EIGEN3_INCLUDE_DIR})
target_include_directories(BioGearsEngineJNI PRIVATE ${LOG4CPP_INCLUDE_DIR})
target_include_directories(BioGearsEngineJNI PRIVATE ${PROTOBUF_INCLUDE_DIR})
target_include_directories(PulseEngineJNI PRIVATE ${JNI_INCLUDE_DIRS})
target_include_directories(PulseEngineJNI PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/)
target_include_directories(PulseEngineJNI PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/bind/)
target_include_directories(PulseEngineJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cpp)
target_include_directories(PulseEngineJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../cdm/cpp)
target_include_directories(PulseEngineJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../test/engine/cpp)
target_include_directories(PulseEngineJNI PRIVATE ${EIGEN3_INCLUDE_DIR})
target_include_directories(PulseEngineJNI PRIVATE ${LOG4CPP_INCLUDE_DIR})
target_include_directories(PulseEngineJNI PRIVATE ${PROTOBUF_INCLUDE_DIR})
set(BioGearsEngineJNI_FLAGS)
set_target_properties(BioGearsEngineJNI PROPERTIES COMPILE_FLAGS "${BioGearsEngineJNI_FLAGS}" PREFIX "")
set(PulseEngineJNI_FLAGS)
set_target_properties(PulseEngineJNI PROPERTIES COMPILE_FLAGS "${PulseEngineJNI_FLAGS}" PREFIX "")
if(APPLE)
set_target_properties(CommonDataModelJNI PROPERTIES MACOSX_RPATH ON)
endif()
target_link_libraries(BioGearsEngineJNI BioGearsEngineUnitTests)
target_link_libraries(PulseEngineJNI PulseEngineUnitTests)
add_custom_command(TARGET BioGearsEngineJNI POST_BUILD
add_custom_command(TARGET PulseEngineJNI POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:BioGearsEngineJNI> ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG})
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:PulseEngineJNI> ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG})
if(WIN32)# Copy dll files to the bin
install(TARGETS BioGearsEngineJNI
install(TARGETS PulseEngineJNI
RUNTIME CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG}
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS BioGearsEngineJNI
install(TARGETS PulseEngineJNI
RUNTIME CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG}
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS BioGearsEngineJNI
install(TARGETS PulseEngineJNI
RUNTIME CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG}
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
else()# Copy so files to the bin
install(TARGETS BioGearsEngineJNI
install(TARGETS PulseEngineJNI
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS BioGearsEngineJNI
install(TARGETS PulseEngineJNI
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS BioGearsEngineJNI
install(TARGETS PulseEngineJNI
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
endif()
# Files in the project
add_executable(ScenarioDriver cpp/BioGearsScenarioDriver.cpp
cpp/BioGearsScenarioDriver.h
add_executable(ScenarioDriver cpp/PulseScenarioDriver.cpp
cpp/PulseScenarioDriver.h
cpp/Verification.cpp
cpp/Verification.h)
......@@ -16,7 +16,7 @@ target_include_directories(ScenarioDriver PRIVATE ${LOG4CPP_INCLUDE_DIR})
target_include_directories(ScenarioDriver PRIVATE ${PROTOBUF_INCLUDE_DIR})
# Dependent Libraries
target_link_libraries(ScenarioDriver BioGearsEngine)
target_link_libraries(ScenarioDriver PulseEngine)
# Generate cxx/hxx files from xsd
# Copy to the bin
......
......@@ -11,7 +11,7 @@ specific language governing permissions and limitations under the License.
**************************************************************************************/
#include "stdafx.h"
#include "BioGears.h"
#include "Pulse.h"
#include "substance/SESubstance.h"
#include "patient/SEPatient.h"
......@@ -42,13 +42,13 @@ specific language governing permissions and limitations under the License.
#include "properties/SEScalarHeatCapacitancePerMass.h"
#include "properties/SEScalarFlowElastance.h"
BioGears::BioGears(const std::string& logFileName) : BioGears(new Logger(logFileName))
Pulse::Pulse(const std::string& logFileName) : Pulse(new Logger(logFileName))
{
myLogger = true;
m_DataTrack = nullptr;
}
BioGears::BioGears(Logger* logger) : Loggable(logger)
Pulse::Pulse(Logger* logger) : Loggable(logger)
{
myLogger = false;
m_DataTrack = nullptr;
......@@ -61,12 +61,12 @@ BioGears::BioGears(Logger* logger) : Loggable(logger)
m_SimulationTime->SetValue(0, TimeUnit::s);
m_Logger->SetLogTime(m_SimulationTime.get());
m_Substances = std::unique_ptr<BioGearsSubstances>(new BioGearsSubstances(*this));
m_Substances = std::unique_ptr<PulseSubstances>(new PulseSubstances(*this));
m_Substances->LoadSubstanceDirectory();
m_Patient = std::unique_ptr<SEPatient>(new SEPatient(GetLogger()));
m_Config = std::unique_ptr<BioGearsConfiguration>(new BioGearsConfiguration(*m_Substances));
m_Config = std::unique_ptr<PulseConfiguration>(new PulseConfiguration(*m_Substances));
m_Config->Initialize();
m_SaturationCalculator = std::unique_ptr<SaturationCalculator>(new SaturationCalculator(*this));
......@@ -94,19 +94,19 @@ BioGears::BioGears(Logger* logger) : Loggable(logger)
m_Inhaler = std::unique_ptr<Inhaler>(new Inhaler(*this));
m_Compartments = std::unique_ptr<BioGearsCompartments>(new BioGearsCompartments(*this));
m_Compartments = std::unique_ptr<PulseCompartments>(new PulseCompartments(*this));
m_Circuits = std::unique_ptr<BioGearsCircuits>(new BioGearsCircuits(*this));
m_Circuits = std::unique_ptr<PulseCircuits>(new PulseCircuits(*this));
}
DataTrack& BioGears::GetDataTrack()
DataTrack& Pulse::GetDataTrack()
{
if (m_DataTrack == nullptr)
m_DataTrack = new DataTrack();
return *m_DataTrack;
}
bool BioGears::Initialize(const PhysiologyEngineConfiguration* config)
bool Pulse::Initialize(const PhysiologyEngineConfiguration* config)
{
m_State = EngineState::NotReady;
Info("Configuring patient");
......@@ -130,8 +130,8 @@ bool BioGears::Initialize(const PhysiologyEngineConfiguration* config)
}
// Now, Let's see if there is anything to merge into our base configuration
Info("Merging OnDisk Configuration");
BioGearsConfiguration cFile(*m_Substances);
cFile.LoadFile("BioGearsConfiguration.xml");
PulseConfiguration cFile(*m_Substances);
cFile.LoadFile("PulseConfiguration.xml");
m_Config->Merge(cFile);
// Now we can check the config
......@@ -161,7 +161,7 @@ bool BioGears::Initialize(const PhysiologyEngineConfiguration* config)
Info("Creating Circuits and Compartments");
CreateCircuitsAndCompartments();
m_AirwayMode = CDM::enumBioGearsAirwayMode::Free;
m_AirwayMode = CDM::enumPulseAirwayMode::Free;
m_Intubation = cdm::eSwitch::Off;
m_CurrentTime->SetValue(0, TimeUnit::s);
m_SimulationTime->SetValue(0, TimeUnit::s);
......@@ -189,15 +189,15 @@ bool BioGears::Initialize(const PhysiologyEngineConfiguration* config)
return true;
}
void BioGears::SetAirwayMode(CDM::enumBioGearsAirwayMode::value mode)
void Pulse::SetAirwayMode(CDM::enumPulseAirwayMode::value mode)
{
if (mode == m_AirwayMode)
return;// do nazing!
if (mode == CDM::enumBioGearsAirwayMode::Inhaler && m_AirwayMode != CDM::enumBioGearsAirwayMode::Free)
if (mode == CDM::enumPulseAirwayMode::Inhaler && m_AirwayMode != CDM::enumPulseAirwayMode::Free)
throw CommonDataModelException("Can only change airway mode to Inhaler from the Free mode, Disable other equipment first.");
if (mode == CDM::enumBioGearsAirwayMode::AnesthesiaMachine && m_AirwayMode != CDM::enumBioGearsAirwayMode::Free)
if (mode == CDM::enumPulseAirwayMode::AnesthesiaMachine && m_AirwayMode != CDM::enumPulseAirwayMode::Free)
throw CommonDataModelException("Can only change airway mode to Anesthesia Machine from the Free mode, Disable other equipment first.");
if (mode == CDM::enumBioGearsAirwayMode::MechanicalVentilator && m_AirwayMode != CDM::enumBioGearsAirwayMode::Free)
if (mode == CDM::enumPulseAirwayMode::MechanicalVentilator && m_AirwayMode != CDM::enumPulseAirwayMode::Free)
throw CommonDataModelException("Can only change airway mode to Mechanical Ventilator from the Free mode, Disable other equipment first.");
if (mode != m_AirwayMode)
m_Compartments->UpdateAirwayGraph();
......@@ -206,16 +206,16 @@ void BioGears::SetAirwayMode(CDM::enumBioGearsAirwayMode::value mode)
ss << "Airway Mode : " << m_AirwayMode;
Info(ss);
}
void BioGears::SetIntubation(cdm::eSwitch s)
void Pulse::SetIntubation(cdm::eSwitch s)
{
if (m_Intubation == s)
return;// do nazing!
if (m_AirwayMode == CDM::enumBioGearsAirwayMode::Inhaler)
if (m_AirwayMode == CDM::enumPulseAirwayMode::Inhaler)
throw CommonDataModelException("Cannot intubate if the inhaler is active.");
m_Intubation = s;
}
bool BioGears::SetupPatient()
bool Pulse::SetupPatient()
{
bool err = false;
std::stringstream ss;
......@@ -825,7 +825,7 @@ bool BioGears::SetupPatient()
return true;
}
BioGears::~BioGears()
Pulse::~Pulse()
{
if (myLogger)
{
......@@ -835,7 +835,7 @@ BioGears::~BioGears()
m_Logger->SetForward(nullptr);
}
void BioGears::AtSteadyState(EngineState state)
void Pulse::AtSteadyState(EngineState state)
{
m_State = state;
m_Environment->AtSteadyState();
......@@ -855,7 +855,7 @@ void BioGears::AtSteadyState(EngineState state)
m_ECG->AtSteadyState();
}
void BioGears::PreProcess()
void Pulse::PreProcess()
{
m_Environment->PreProcess();
m_CardiovascularSystem->PreProcess();
......@@ -873,7 +873,7 @@ void BioGears::PreProcess()
m_BloodChemistrySystem->PreProcess();
m_ECG->PreProcess();
}
void BioGears::Process()
void Pulse::Process()
{
m_Environment->Process();
m_CardiovascularSystem->Process();
......@@ -891,7 +891,7 @@ void BioGears::Process()
m_BloodChemistrySystem->Process();
m_ECG->Process();
}
void BioGears::PostProcess()
void Pulse::PostProcess()
{
m_Environment->PostProcess();
m_CardiovascularSystem->PostProcess();
......@@ -910,7 +910,7 @@ void BioGears::PostProcess()
m_ECG->PostProcess();
}
bool BioGears::GetPatientAssessment(SEPatientAssessment& assessment)
bool Pulse::GetPatientAssessment(SEPatientAssessment& assessment)
{
SEPulmonaryFunctionTest* pft = dynamic_cast<SEPulmonaryFunctionTest*>(&assessment);
if (pft != nullptr)
......@@ -934,7 +934,7 @@ bool BioGears::GetPatientAssessment(SEPatientAssessment& assessment)
return false;
}
void BioGears::ForwardFatal(const std::string& msg, const std::string& origin)
void Pulse::ForwardFatal(const std::string& msg, const std::string& origin)
{
std::string err;
err.append(msg);
......@@ -943,7 +943,7 @@ void BioGears::ForwardFatal(const std::string& msg, const std::string& origin)
throw PhysiologyEngineException(err);
}
bool BioGears::CreateCircuitsAndCompartments()
bool Pulse::CreateCircuitsAndCompartments()
{
m_Circuits->Clear();
m_Compartments->Clear();
......@@ -1007,7 +1007,7 @@ bool BioGears::CreateCircuitsAndCompartments()
return true;
}
void BioGears::SetupCardiovascular()
void Pulse::SetupCardiovascular()
{
Info("Setting Up Cardiovascular");
bool male = m_Patient->GetSex() == CDM::enumSex::Male ? true : false;
......@@ -1092,7 +1092,7 @@ void BioGears::SetupCardiovascular()
double ResistanceSpleen = (systolicPressureTarget_mmHg - VascularPressureTargetSpleen) / VascularFlowTargetSpleen, ResistanceSpleenVenous = (VascularPressureTargetArmLeft - VascularPressureTargetLiver) / VascularFlowTargetSpleen;
// Portal vein and shunt are just paths - only have resistance
double ResistancePortalVein = 0.001; // The portal vein is just a pathway in BioGears. The pressure across this path does not represent portal vein pressure (if it did our patient would always be portal hypertensive)
double ResistancePortalVein = 0.001; // The portal vein is just a pathway in Pulse. The pressure across this path does not represent portal vein pressure (if it did our patient would always be portal hypertensive)
double ResistanceShuntRight = (VascularPressureTargetPulmArtRight - VascularPressureTargetPulmCapRight) / (cardiacOutputTarget_mL_Per_s*pulmonaryShuntFractionFactor);
double ResistanceShuntLeft = (VascularPressureTargetPulmArtLeft - VascularPressureTargetPulmCapLeft) / (cardiacOutputTarget_mL_Per_s*pulmonaryShuntFractionFactor);
......@@ -1956,7 +1956,7 @@ void BioGears::SetupCardiovascular()
gCombinedCardiovascular.StateChange();
}
void BioGears::SetupRenal()
void Pulse::SetupRenal()
{
Info("Setting Up Renal");
//////////////////////////
......@@ -2717,7 +2717,7 @@ void BioGears::SetupRenal()
gCombinedCardiovascular.StateChange();
}
void BioGears::SetupTissue()
void Pulse::SetupTissue()
{
Info("Setting Up Tissue");
SEFluidCircuit& cCardiovascular = m_Circuits->GetCardiovascularCircuit();
...