Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pulse Physiology Suite
engine
Commits
389ed547
Commit
389ed547
authored
Apr 13, 2020
by
Aaron Bray
Browse files
Log advance time actions in scenarios
Format cleanup
parent
b6f22a99
Changes
6
Hide whitespace changes
Inline
Side-by-side
data/human/adult/scenarios/patient/BasicStandard.json
View file @
389ed547
...
...
@@ -93,6 +93,8 @@
},
"AnyAction"
:
[
{
"AdvanceTime"
:
{
"Time"
:
{
"ScalarTime"
:
{
"Value"
:
2.0
,
"Unit"
:
"min"
}}}}
{
"AdvanceTime"
:
{
"Action"
:
{
"Comment"
:
"Advance some time"
},
"Time"
:
{
"ScalarTime"
:
{
"Value"
:
2.0
,
"Unit"
:
"min"
}}}}
]
}
\ No newline at end of file
src/cpp/cdm/engine/SEAdvanceTime.cpp
View file @
389ed547
...
...
@@ -30,7 +30,7 @@ void SEAdvanceTime::ToString(std::ostream &str) const
{
if
(
HasComment
())
str
<<
"
\n\t
Comment : "
<<
m_Comment
;
str
<<
"Advance Time : "
<<
m_Time
;
str
<<
"
\n\t
Advance Time : "
<<
m_Time
;
}
bool
SEAdvanceTime
::
HasTime
()
const
...
...
src/cpp/cdm/io/protobuf/PBActions.cpp
View file @
389ed547
...
...
@@ -121,6 +121,7 @@ void PBAction::Load(const CDM_BIND::AdvanceTimeData& src, SEAdvanceTime& dst)
}
void
PBAction
::
Serialize
(
const
CDM_BIND
::
AdvanceTimeData
&
src
,
SEAdvanceTime
&
dst
)
{
PBAction
::
Serialize
(
src
.
action
(),
dst
);
if
(
src
.
has_time
())
PBProperty
::
Load
(
src
.
time
(),
dst
.
GetTime
());
}
...
...
@@ -132,6 +133,7 @@ CDM_BIND::AdvanceTimeData* PBAction::Unload(const SEAdvanceTime& src)
}
void
PBAction
::
Serialize
(
const
SEAdvanceTime
&
src
,
CDM_BIND
::
AdvanceTimeData
&
dst
)
{
PBAction
::
Serialize
(
src
,
*
dst
.
mutable_action
());
if
(
src
.
HasTime
())
dst
.
set_allocated_time
(
PBProperty
::
Unload
(
*
src
.
m_Time
));
}
...
...
@@ -143,6 +145,7 @@ void PBAction::Load(const CDM_BIND::SerializeStateData& src, SESerializeState& d
}
void
PBAction
::
Serialize
(
const
CDM_BIND
::
SerializeStateData
&
src
,
SESerializeState
&
dst
)
{
PBAction
::
Serialize
(
src
.
action
(),
dst
);
dst
.
SetType
((
eSerialization_Type
)
src
.
type
());
dst
.
SetFilename
(
src
.
filename
());
}
...
...
@@ -154,6 +157,7 @@ CDM_BIND::SerializeStateData* PBAction::Unload(const SESerializeState& src)
}
void
PBAction
::
Serialize
(
const
SESerializeState
&
src
,
CDM_BIND
::
SerializeStateData
&
dst
)
{
PBAction
::
Serialize
(
src
,
*
dst
.
mutable_action
());
dst
.
set_type
((
CDM_BIND
::
SerializeStateData
::
eType
)
src
.
m_Type
);
if
(
src
.
HasFilename
())
dst
.
set_filename
(
src
.
m_Filename
);
...
...
@@ -166,6 +170,7 @@ void PBAction::Load(const CDM_BIND::OverridesData& src, SEOverrides& dst)
}
void
PBAction
::
Serialize
(
const
CDM_BIND
::
OverridesData
&
src
,
SEOverrides
&
dst
)
{
PBAction
::
Serialize
(
src
.
action
(),
dst
);
for
(
size_t
i
=
0
;
i
<
src
.
scalaroverride_size
();
i
++
)
{
const
CDM_BIND
::
ScalarPropertyData
&
sp
=
src
.
scalaroverride
()[
i
];
...
...
@@ -180,6 +185,7 @@ CDM_BIND::OverridesData* PBAction::Unload(const SEOverrides& src)
}
void
PBAction
::
Serialize
(
const
SEOverrides
&
src
,
CDM_BIND
::
OverridesData
&
dst
)
{
PBAction
::
Serialize
(
src
,
*
dst
.
mutable_action
());
for
(
auto
&
sp
:
src
.
GetScalarProperties
())
{
CDM_BIND
::
ScalarPropertyData
*
so
=
dst
.
add_scalaroverride
();
...
...
src/cpp/cdm/scenario/SEScenarioExec.cpp
View file @
389ed547
...
...
@@ -133,7 +133,7 @@ bool SEScenarioExec::ProcessActions(const SEScenario& scenario)
Info
(
"Executing Scenario"
);
double
dT_s
=
m_Engine
.
GetTimeStep
(
TimeUnit
::
s
);
double
scenarioTime_s
;
double
scenarioTime_s
=
0
;
double
statusTime_s
=
0
;
// Current time of this status cycle
double
statusStep_s
=
60
;
//How long did it take to simulate this much time
...
...
@@ -160,6 +160,9 @@ bool SEScenarioExec::ProcessActions(const SEScenario& scenario)
adv
=
dynamic_cast
<
const
SEAdvanceTime
*>
(
a
);
if
(
adv
!=
nullptr
)
{
m_ss
<<
"[Action] "
<<
*
a
;
Info
(
m_ss
);
double
time_s
=
adv
->
GetTime
(
TimeUnit
::
s
);
int
count
=
(
int
)(
time_s
/
dT_s
);
for
(
int
i
=
0
;
i
<=
count
;
i
++
)
...
...
src/java/pulse/utilities/csv/CSVContents.java
View file @
389ed547
...
...
@@ -233,7 +233,7 @@ public class CSVContents
list
=
results
.
get
(
header
);
if
(
list
==
null
)
{
list
=
new
ArrayList
<
Double
>();
list
=
new
ArrayList
<
Double
>();
results
.
put
(
header
,
list
);
}
d
=
this
.
rowDoubles
.
get
(
h
++);
...
...
@@ -250,7 +250,7 @@ public class CSVContents
{
if
(
buff
.
readLine
()==
null
)
{
eof
=
true
;
eof
=
true
;
break
;
}
}
...
...
src/java/pulse/utilities/csv/plots/CSVPlotTool.java
View file @
389ed547
...
...
@@ -242,7 +242,7 @@ public class CSVPlotTool
{
ValueAxis
yAxis
=
plot
.
getRangeAxis
();
yAxis
.
setRange
(
resMin0
+
0.05
*
resMin0
,
resMax0
+
0.15
*
Math
.
abs
(
resMax0
));
//5% buffer so we can see top and bottom clearly
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment