33 std::vector<std::string> mechanisms;
34 std::stringstream ss(filter);
41 std::string mech_name;
44 std::getline(iss, mech_name,
'.');
45 std::getline(iss, var_name,
'.');
46 if (var_name.empty()) {
51 if (mech_name ==
"i_membrane") {
58 report.
type = report_type;
101 std::cerr <<
"Report error: unsupported target type" << std::endl;
107 const std::string& output_dir,
109 std::string report_on;
111 std::ifstream report_conf(conf_file);
114 report_conf >> num_reports;
115 std::vector<ReportConfiguration> reports(num_reports);
116 for (
auto& report: reports) {
117 report.buffer_size = 4;
119 report_conf >> report.name >> report.target_name >> report.type_str >> report_on >>
120 report.unit >> report.format >> target >> report.report_dt >> report.start >>
121 report.stop >> report.num_gids >> report.buffer_size;
123 report.target_type =
static_cast<TargetType>(target);
125 report.type_str.end(),
126 report.type_str.begin(),
127 [](
unsigned char c) { return std::tolower(c); });
128 report.output_path = output_dir +
"/" + report.name;
130 if (report.type_str ==
"compartment") {
132 if (report_on ==
"i_membrane") {
136 }
else if (report.type_str ==
"synapse") {
138 }
else if (report.type_str ==
"summation") {
140 }
else if (report.type_str ==
"lfp") {
144 std::cerr <<
"Report error: unsupported type " << report.type_str << std::endl;
151 if (report.num_gids) {
152 report.target.resize(report.num_gids);
153 report_conf.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
154 report_conf.read(
reinterpret_cast<char*
>(report.target.data()),
155 report.num_gids *
sizeof(
int));
157 report_conf.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
162 std::string spikes_population_name;
163 int spikes_population_offset;
164 if (report_conf.peek() ==
'\n') {
166 report_conf.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
168 if (isdigit(report_conf.peek())) {
169 report_conf >> num_populations;
174 for (
int i = 0;
i < num_populations;
i++) {
175 if (!(report_conf >> spikes_population_name >> spikes_population_offset)) {
177 report_conf >> spikes_population_name;
178 spikes_population_offset = 0;
181 std::make_pair(spikes_population_name, spikes_population_offset));
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
void nrn_abort(int errcode)
static const char * mechanism[]
void register_target_type(ReportConfiguration &report, ReportType report_type)
void parse_filter_string(const std::string &filter, ReportConfiguration &config)
std::vector< ReportConfiguration > create_report_configurations(const std::string &filename, const std::string &output_dir, SpikesInfo &spikes_info)
data_handle< T > transform(data_handle< T > handle, Transform type)
bool section_all_compartments
std::vector< std::string > var_names
std::vector< std::string > mech_names
std::vector< std::pair< std::string, int > > population_info