Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f/shashank-website -- Website Documentation -- Creation of Website using Python #46

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
168b407
Adding Python directory and CMake files to generate bindings
Shashankjain12 May 27, 2020
6f8e9b0
Adding schema related code to generate folder in which where the bind…
Shashankjain12 May 27, 2020
2fbb980
Changing the dir name of Python to python
Shashankjain12 May 27, 2020
0e90341
Adding XSDToDoxygen File Parser Function
Shashankjain12 Jun 12, 2020
b975b1d
Adding comments to the file and improvizing the executing structure o…
Shashankjain12 Jun 14, 2020
53de0ca
Adding parsers for attribute and sequence
Shashankjain12 Jun 15, 2020
491e4c2
Adding cdm2md
Shashankjain12 Jun 15, 2020
c68dadd
Adding cdm CMakeLists.txt setting up of variables using Parentscope
Shashankjain12 Jun 15, 2020
8ad1faa
Adding biogears Cmakelists.txt
Shashankjain12 Jun 15, 2020
c993aee
Adding CDMSerializer.py
Shashankjain12 Jun 15, 2020
238f0ba
Adding description.py file for creating references to extracted defgr…
Shashankjain12 Jun 15, 2020
9e47a5e
Changes to XSDToDoxygen.py file adding enumeration and extension tags
Shashankjain12 Jun 15, 2020
e175054
Adding Python directory and CMake files to generate bindings
Shashankjain12 May 27, 2020
ffa3a01
Adding schema related code to generate folder in which where the bind…
Shashankjain12 May 27, 2020
9079817
Changing the dir name of Python to python
Shashankjain12 May 27, 2020
c9fae5a
Adding Args Parse to XSDToDoxygen.py file
Shashankjain12 Jun 15, 2020
cb26fdc
Fixing ArgParser in XSDToDoxygen File
Shashankjain12 Jun 15, 2020
96aab51
Deleting xsd.ixx
Shashankjain12 Jun 15, 2020
67ee476
Adding XSDToDoxygen.py Complete Source Code
Shashankjain12 Jun 16, 2020
c12ab95
Adding CDM2MD file
Shashankjain12 Jun 19, 2020
95bb089
Adding brief explanation documentation XSDToDoxygen.py commenting fun…
Shashankjain12 Jun 20, 2020
283452e
XSDToDoxgen Revision
Shashankjain12 Jun 20, 2020
053632c
Adding Class based CDM2MD and handled whether list_type or not
Shashankjain12 Jun 22, 2020
a9ca9ec
Extracted Extension base tags and improved iterdict to extract all th…
Shashankjain12 Jun 23, 2020
dac3cef
CDM2MD modification related to iterdict
Shashankjain12 Jun 24, 2020
4953768
Parser which can parse all the file is created
Shashankjain12 Jun 24, 2020
a3ebffd
Adding Convert function to convert all tags suitable for table creation
Shashankjain12 Jun 24, 2020
c424d6e
Adding table creation function to CDM2MD
Shashankjain12 Jun 25, 2020
0050571
Adding documentation to CDM2MD file
Shashankjain12 Jun 26, 2020
1232663
Setting Environment related comments in CDM2MD and XSDToDoxygen
Shashankjain12 Jun 26, 2020
090fe27
Adding DoxygenPreprocessor.py with ArgParser
Shashankjain12 Jun 30, 2020
bc6016f
Adding DoxygenPreprocessor.py completed script
Shashankjain12 Jul 1, 2020
aceaa34
Adding some comments to test out CDM2MD.py
Shashankjain12 Jul 1, 2020
d8850c6
Adding argument parser in CDM2MD.py file as well
Shashankjain12 Jul 2, 2020
863ae1d
Some minor changes in XSDToDoxygen.py file
Shashankjain12 Jul 2, 2020
d44b68e
f/shashank-website -- Adding CMakeLists -- Adding CMakeLists to creat…
Shashankjain12 Jul 9, 2020
8f4b9ce
f/shashank-website -- Plotting functions PlotDriver.py -- Created the…
Shashankjain12 Jul 15, 2020
14f0acf
f/shashank-website -- Changing docs-stage-py -- Adding new zipping st…
Shashankjain12 Jul 16, 2020
091ef61
f/shashank-website -- Processing Config -- Implemented reading of con…
Shashankjain12 Jul 17, 2020
c04e23b
f/shashank-website -- PlotDriver -- Completed PlotDriver.py file whic…
Shashankjain12 Jul 20, 2020
99ba37a
f/shashank-website -- ActionEventPlotter -- Adding basic structure to…
Shashankjain12 Jul 21, 2020
d049198
f/shashank-website -- ActionEventPlotter -- Extracting Events and act…
Shashankjain12 Jul 23, 2020
0821a41
f/shashank-website -- ActionEventPlotter.py -- Adding Plotting functi…
Shashankjain12 Jul 27, 2020
a9c3c31
f/shashank-website -- Removing Pyxb -- Cleaning the imports as well a…
Shashankjain12 Jul 30, 2020
44af6fc
f/shashank-website -- Resolving all suggested changes -- Added virtua…
Shashankjain12 Aug 4, 2020
0722131
f/shashank-website --Removing unwanted file -- Removing the left cach…
Shashankjain12 Aug 4, 2020
da6d857
f/shashank-website --Threads and XSD cleaner -- Created threads in Pl…
Shashankjain12 Aug 6, 2020
2ad3123
f/shashank-website -- Resolving Changes -- Cleaning the code implemen…
Shashankjain12 Aug 6, 2020
21ab818
f/shashank-website -- ActionEventPlotter -- Tweaking some parameters …
Shashankjain12 Aug 7, 2020
a2794c0
f/shashank-website --ActionEventPlotter-- Adding no. of columns to le…
Shashankjain12 Aug 7, 2020
8332d57
f/shashank-website -- verbose -- Adding the verbose argument for prin…
Shashankjain12 Aug 10, 2020
3c9e8d9
f/shashank-website -- Changes to the repository -- Adding changes rel…
Shashankjain12 Aug 10, 2020
136e66e
f/shashank-website --verbosity levels -- Added 4 verbosity levels as …
Shashankjain12 Aug 11, 2020
0865cf9
f/shashank-website -- Termination -- Adding termination logic one ctr…
Shashankjain12 Aug 11, 2020
996d306
f/shashank-website -- Termination Handling -- Handling termination re…
Shashankjain12 Aug 11, 2020
77d8777
f/shashank-website -- Handling try-except statements -- Handling try-…
Shashankjain12 Aug 12, 2020
13e77aa
f/shashank-website -- ActionEventPlotter -- Revising changes for plo…
Shashankjain12 Aug 12, 2020
82ccdff
f/shashank-website -- Multiplotter.py -- Adding Multiplotter script w…
Shashankjain12 Aug 13, 2020
f803eff
f/shashank-website -- Removing Dependencies -- Removing the unwanted …
Shashankjain12 Aug 17, 2020
5e9090a
f/shashank-website -- Patient Validation Table writing -- Added track…
Shashankjain12 Aug 24, 2020
202bdb1
f/shashank-website -- ReportWriter -- Made changes in Report Writer t…
Shashankjain12 Aug 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions projects/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ find_path (
${PROJECT_SOURCE_DIR}/../verification
${PROJECT_SOURCE_DIR}/../validation
${PROJECT_SOURCE_DIR}/../baselines
DOC "Optional directory path to hiarchial filetree of baseline archives. This will be used by Java Utilities to find Baselines"
DOC "Optional directory path to hiarchial filetree of baseline archives. This will be used by Python Plotters to find Baselines"
)
find_path (
${ROOT_PROJECT_NAME}_Reference_DIR
Expand Down Expand Up @@ -138,11 +138,7 @@ add_custom_target( prepare_runtime_dir
# this list
###############################################################################

find_package(Java)
find_package(JNI)
verify_package(Log4cpp REQUIRED)
option(${ROOT_PROJECT_NAME}_BUILD_JAVATOOLS "Build Java based development tools (requires Doxygen)" OFF )

add_subdirectory(biogears-common)
add_subdirectory(biogears)
add_subdirectory(test_driver)
Expand All @@ -151,10 +147,7 @@ add_subdirectory(unit)
add_subdirectory(circuit_profiler)
add_subdirectory(zip)
add_subdirectory(cli)

if(Java_FOUND AND ${ROOT_PROJECT_NAME}_BUILD_JAVATOOLS)
add_subdirectory(java)
endif()
add_subdirectory(website)

##############################################################################
# Step 3: Global Doxygen configuration
Expand Down
2 changes: 2 additions & 0 deletions projects/cli/bg-cli-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,10 @@ int main(int argc, char** argv)
std::transform(table.begin(), table.end(), table.begin(), ::tolower);
if (table == "html") {
report_writer.gen_tables(biogears::ReportWriter::HTML);
report_writer.gen_patient_tables(biogears::ReportWriter::HTML);
} else if (table == "md") {
report_writer.gen_tables(biogears::ReportWriter::MD);
report_writer.gen_patient_tables(biogears::ReportWriter::MD);
} else if (table == "xml") {
report_writer.gen_tables(biogears::ReportWriter::XML);
} else if (table == "web") {
Expand Down
35 changes: 27 additions & 8 deletions projects/cli/src/exec/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <biogears/engine/BioGearsPhysiologyEngine.h>
#include <biogears/engine/Controller/Scenario/BioGearsScenario.h>
#include <biogears/engine/Controller/Scenario/BioGearsScenarioExec.h>
#include <biogears/cdm/engine/PhysiologyEngineDynamicStabilization.h>
#include <biogears/cdm/engine/PhysiologyEngineTimedStabilization.h>

#ifdef CMD_BIO_SUPPORT_CIRCUIT_TEST
#include <biogears/cdm/test/CommonDataModelTest.h>
Expand Down Expand Up @@ -285,13 +287,13 @@ void Driver::queue_Scenario(Executor exec, bool as_subprocess)
}
}

std::unique_ptr<mil::tatrc::physiology::datamodel::ScenarioData> scenario;
std::unique_ptr<CDM::ScenarioData> scenario;
try {
xml_schema::flags xml_flags;
xml_schema::properties xml_properties;

xml_properties.schema_location("uri:/mil/tatrc/physiology/datamodel", "xsd/BioGearsDataModel.xsd");
scenario = mil::tatrc::physiology::datamodel::Scenario(ifs, xml_flags, xml_properties);
scenario = CDM::Scenario(ifs, xml_flags, xml_properties);
} catch (std::runtime_error e) {
std::cout << e.what() << "\n";
return;
Expand Down Expand Up @@ -362,13 +364,22 @@ void Driver::subprocess_execute(biogears::Executor& ex, bool multi_patient_run)
{
using namespace biogears;
_process_count += 1;

std::cout<<"Trying this up in subprocess_execute";
try {
using namespace boost::process;

std::string options;

options = "--quiet";
if(ex.TrackStabilization()){
std::cout<<"Checking sub fun";
if (eng->GetConfiguration()->HasDynamicStabilizationCriteria()) {
const_cast<PhysiologyEngineDynamicStabilization*>(eng->GetConfiguration()->GetDynamicStabilizationCriteria())->TrackStabilization(CDM::enumOnOff::On);
}
if (eng->GetConfiguration()->HasTimedStabilizationCriteria()) {
const_cast<PhysiologyEngineTimedStabilization*>(eng->GetConfiguration()->GetTimedStabilizationCriteria())->TrackStabilization(CDM::enumOnOff::On);
}
}

if (ex.Name().size()) {
auto name = biogears::trim(ex.Name());
Expand Down Expand Up @@ -542,7 +553,6 @@ void Driver::async_execute(biogears::Executor& ex, bool multi_patient_run)
if (multi_patient_run) {
ex.Name(ex.Name() + "-" + patient_no_extension);
}

std::string base_file_name = (multi_patient_run) ? scenario_no_extension + "-" + patient_no_extension : scenario_no_extension;
std::string console_file = base_file_name + ".log";
std::string log_file = base_file_name + "Results.log";
Expand All @@ -556,14 +566,23 @@ void Driver::async_execute(biogears::Executor& ex, bool multi_patient_run)
file_logger.SetConsolesetConversionPattern("%d{%H:%M} [%p] " + ex.Name() + " %m%n");
console_logger.SetConsolesetConversionPattern("%d{%H:%M} [%p] %m%n");
console_logger.FormatMessages(false);

eng = CreateBioGearsEngine(&file_logger);
} catch (std::exception e) {
std::cout << e.what();
_thread_count -= 1;
return;
}

if(ex.TrackStabilization()){
std::cout<<"Checking the function\n";
if (eng->GetConfiguration()->HasDynamicStabilizationCriteria()) {
std::cout<<"Checking the function 2 \n";
const_cast<PhysiologyEngineDynamicStabilization*>(eng->GetConfiguration()->GetDynamicStabilizationCriteria())->TrackStabilization(CDM::enumOnOff::On);
}
if (eng->GetConfiguration()->HasTimedStabilizationCriteria()) {
std::cout<<"Checking the function 3 \n";
const_cast<PhysiologyEngineTimedStabilization*>(eng->GetConfiguration()->GetTimedStabilizationCriteria())->TrackStabilization(CDM::enumOnOff::On);
}
}
BioGearsScenario sce(eng->GetSubstanceManager());
if (!sce.Load(trim(trimed_scenario_path))) {
console_logger.Info(biogears::asprintf("Error[%d]: %s failed to find the specified scenario file %s", ExecutionErrors::SCENARIO_IO_ERROR, ex.Name().c_str(), ex.Scenario().c_str()));
Expand All @@ -581,13 +600,13 @@ void Driver::async_execute(biogears::Executor& ex, bool multi_patient_run)
return;
}

std::unique_ptr<mil::tatrc::physiology::datamodel::ScenarioData> scenario;
std::unique_ptr<CDM::ScenarioData> scenario;
try {
xml_schema::flags xml_flags;
xml_schema::properties xml_properties;
std::cout << "Reading " << ex.Scenario() << std::endl;
xml_properties.schema_location("uri:/mil/tatrc/physiology/datamodel", "xsd/BioGearsDataModel.xsd");
scenario = mil::tatrc::physiology::datamodel::Scenario(ifs, xml_flags, xml_properties);
scenario = CDM::Scenario(ifs, xml_flags, xml_properties);
} catch (std::runtime_error e) {
std::cout << e.what() << std::endl;
console_logger.Info(biogears::asprintf("Error[%d]: %s failed parse the specified scenario file %s", ExecutionErrors::SCENARIO_PARSE_ERROR, ex.Name().c_str(), ex.Scenario().c_str()));
Expand Down
2 changes: 2 additions & 0 deletions projects/cli/src/utils/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,8 @@ bool handle_driver_paramaters(Tokenizer::token_list::iterator& tokenItr, Tokeniz
continue;
} else if (token == "nocompare") {
rhs.NoCompare(true);
} else if (token == "track_stabilization") {
rhs.TrackStabilization(true);
} else if (token == "fastplot") {
rhs.PlotStyle(EPlotStyle::FastPlot);
} else if (token == "fullplot") {
Expand Down
11 changes: 11 additions & 0 deletions projects/cli/src/utils/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Executor::Executor(std::string n, EDriver d)
, driver(d)
, plot_style(EPlotStyle::FastPlot)
, no_compare(false)
, track_stabilization(false)
, group("Other")
, patient("")
, state("")
Expand All @@ -33,6 +34,11 @@ bool Executor::NoCompare() const
return no_compare;
}
//-----------------------------------------------------------------------------
bool Executor::TrackStabilization() const
{
return track_stabilization;
}
//-----------------------------------------------------------------------------
std::string Executor::Baselines() const { return baselines; }
//-----------------------------------------------------------------------------
std::string Executor::Computed() const { return computed; }
Expand Down Expand Up @@ -68,6 +74,11 @@ void Executor::NoCompare(bool nc)
no_compare = nc;
}
//-----------------------------------------------------------------------------
void Executor::TrackStabilization(bool t)
{
track_stabilization=t;
}
//-----------------------------------------------------------------------------
void Executor::Baselines(const std::string& b)
{
baselines = b;
Expand Down
6 changes: 5 additions & 1 deletion projects/cli/src/utils/Executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class Executor {
EDriver Driver() const;
EPlotStyle PlotStyle() const;
bool NoCompare() const;
bool TrackStabilization() const;
std::string Baselines() const;
std::string Computed() const;
std::string Group() const;
Expand All @@ -73,6 +74,7 @@ class Executor {
void Driver(EDriver);
void PlotStyle(EPlotStyle);
void NoCompare(bool);
void TrackStabilization(bool);
void Baselines(const std::string&);
void Computed(const std::string&);
void Group(const std::string&);
Expand All @@ -88,6 +90,7 @@ class Executor {
EDriver driver;
EPlotStyle plot_style;
bool no_compare;
bool track_stabilization;
std::string name;
std::string baselines;
std::string computed;
Expand All @@ -104,4 +107,5 @@ std::ostream& operator<<(std::ostream&, const EPlotter&);
std::ostream& operator<<(std::ostream&, const EPlotStyle&);
} //namespace biogears

#endif //CMD_BIO_UTILS_EXECUTOR_H
#endif //CMD_BIO_UTILS_EXECUTOR_H

Loading