diff --git a/cwScoreParse.cpp b/cwScoreParse.cpp index bedfa8d..f4158fd 100644 --- a/cwScoreParse.cpp +++ b/cwScoreParse.cpp @@ -163,6 +163,38 @@ namespace cw return s; } + rc_t _parse_section_stats( score_parse_t* p, csv::handle_t csvH, event_t* e ) + { + rc_t rc; + + if((rc = getv(csvH, + "even_min", e->section->statsA[ kEvenStatIdx ].min, + "even_max", e->section->statsA[ kEvenStatIdx ].max, + "even_mean", e->section->statsA[ kEvenStatIdx ].mean, + "even_std", e->section->statsA[ kEvenStatIdx ].std, + "dyn_min", e->section->statsA[ kDynStatIdx ].min, + "dyn_max", e->section->statsA[ kDynStatIdx ].max, + "dyn_mean", e->section->statsA[ kDynStatIdx ].mean, + "dyn_std", e->section->statsA[ kDynStatIdx ].std, + "tempo_min", e->section->statsA[ kTempoStatIdx ].min, + "tempo_max", e->section->statsA[ kTempoStatIdx ].max, + "tempo_mean",e->section->statsA[ kTempoStatIdx ].mean, + "tempo_std", e->section->statsA[ kTempoStatIdx ].std, + "cost_min", e->section->statsA[ kCostStatIdx ].min, + "cost_max", e->section->statsA[ kCostStatIdx ].max, + "cost_mean", e->section->statsA[ kCostStatIdx ].mean, + "cost_std", e->section->statsA[ kCostStatIdx ].std )) != kOkRC ) + { + rc = cwLogError(rc,"Error parsing CSV meas. stats field."); + goto errLabel; + } + + errLabel: + + return rc; + } + + rc_t _parse_section_row( score_parse_t* p, csv::handle_t csvH, event_t* e ) { rc_t rc; @@ -180,6 +212,9 @@ namespace cw goto errLabel; } + //if((rc = _parse_section_stats(p,csvH,e)) != kOkRC ) + // goto errLabel; + e->section->csvRowNumb = e->csvRowNumb; errLabel: diff --git a/cwScoreParse.h b/cwScoreParse.h index d468af7..6de2e36 100644 --- a/cwScoreParse.h +++ b/cwScoreParse.h @@ -48,8 +48,26 @@ namespace cw kVarCnt }; + typedef enum { + kDynStatIdx, + kEvenStatIdx, + kTempoStatIdx, + kCostStatIdx, + kStatCnt + } stats_idx_t; + struct set_str; struct event_str; + + typedef struct stats_str + { + stats_idx_t id; + double min; + double max; + double mean; + double std; + } stats_t; + typedef struct section_str { char* label; // This sections label @@ -60,6 +78,9 @@ namespace cw struct event_str* endEvent; // last event in this section struct event_str* begSetEvent; // first set event in this section struct event_str* endSetEvent; // last set event in this section + + stats_t statsA[ kStatCnt ]; + struct section_str* link; // p->sectionL links } section_t;