cwPerfMeas.h/cpp : create() now includes a parameter record.
This commit is contained in:
parent
2283140e3a
commit
5201c47d5a
@ -96,6 +96,7 @@ namespace cw
|
||||
|
||||
typedef struct perf_meas_str
|
||||
{
|
||||
params_t params;
|
||||
sfscore::handle_t scoreH;
|
||||
|
||||
loc_t* locA; // locA[locN]
|
||||
@ -586,6 +587,7 @@ namespace cw
|
||||
{
|
||||
s->lastPerfUpdateCnt = s->set->perfUpdateCnt;
|
||||
|
||||
if( p->params.print_rt_events_fl )
|
||||
cwLogInfo("Set %i eval.",s->set->id);
|
||||
|
||||
switch( s->set->varId )
|
||||
@ -629,6 +631,7 @@ namespace cw
|
||||
&& are_all_loc_set_events_performed( p->scoreH, loc_idx ))))
|
||||
{
|
||||
|
||||
if( p->params.print_rt_events_fl )
|
||||
cwLogInfo("Calc: Loc:%i nci:%i",loc_idx,p->next_calc_loc_idx );
|
||||
|
||||
calc_t* calc = p->locA[ p->next_calc_loc_idx ].calc;
|
||||
@ -733,7 +736,7 @@ namespace cw
|
||||
}
|
||||
}
|
||||
|
||||
cw::rc_t cw::perf_meas::create( handle_t& hRef, sfscore::handle_t scoreH )
|
||||
cw::rc_t cw::perf_meas::create( handle_t& hRef, sfscore::handle_t scoreH, const params_t& params )
|
||||
{
|
||||
rc_t rc;
|
||||
if((rc = destroy(hRef)) != kOkRC )
|
||||
@ -744,6 +747,7 @@ cw::rc_t cw::perf_meas::create( handle_t& hRef, sfscore::handle_t scoreH )
|
||||
const section_t* prev_section = nullptr;
|
||||
|
||||
p->scoreH = scoreH;
|
||||
p->params = params;
|
||||
p->locN = loc_count(scoreH);
|
||||
p->locA = mem::allocZ<loc_t>(p->locN);
|
||||
p->next_section_loc_idx = kInvalidIdx;
|
||||
@ -962,7 +966,7 @@ cw::rc_t cw::perf_meas::write_result_json( handle_t h,
|
||||
object_t* sectionL = root->insert_pair("sectionL",newListObject());
|
||||
|
||||
for(loc_t* loc=p->locA; loc<p->locA+p->locN; ++loc)
|
||||
if( loc->section != nullptr && loc->section->calc != nullptr )
|
||||
if( loc->section != nullptr && loc->section->calc != nullptr && loc->section->triggeredFl )
|
||||
{
|
||||
object_t* sect = newDictObject(sectionL);
|
||||
const double* valueV = loc->section->calc->value;
|
||||
|
@ -22,7 +22,12 @@ namespace cw
|
||||
unsigned valueN; // Count of elements in valueA[]
|
||||
} result_t;
|
||||
|
||||
rc_t create( handle_t& hRef, sfscore::handle_t scoreH );
|
||||
typedef struct params_str
|
||||
{
|
||||
bool print_rt_events_fl;
|
||||
} params_t;
|
||||
|
||||
rc_t create( handle_t& hRef, sfscore::handle_t scoreH, const params_t& params );
|
||||
rc_t destroy( handle_t& hRef );
|
||||
|
||||
rc_t reset( handle_t h, unsigned init_locId );
|
||||
|
Loading…
Reference in New Issue
Block a user