本文整理汇总了C++中NXEntry::containsGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ NXEntry::containsGroup方法的具体用法?C++ NXEntry::containsGroup怎么用?C++ NXEntry::containsGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NXEntry
的用法示例。
在下文中一共展示了NXEntry::containsGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: root
/** Log the run details from the file
* @param localWorkspace :: The workspace details to use
*/
void LoadMuonNexus2::loadRunDetails(
DataObjects::Workspace2D_sptr localWorkspace) {
API::Run &runDetails = localWorkspace->mutableRun();
runDetails.addProperty("run_title", localWorkspace->getTitle(), true);
int numSpectra = static_cast<int>(localWorkspace->getNumberHistograms());
runDetails.addProperty("nspectra", numSpectra);
m_filename = getPropertyValue("Filename");
NXRoot root(m_filename);
NXEntry entry = root.openEntry(m_entry_name);
std::string start_time = entry.getString("start_time");
runDetails.addProperty("run_start", start_time);
std::string stop_time = entry.getString("end_time");
runDetails.addProperty("run_end", stop_time);
if (entry.containsGroup("run")) {
NXClass runRun = entry.openNXGroup("run");
if (runRun.containsDataSet("good_total_frames")) {
int dum = runRun.getInt("good_total_frames");
runDetails.addProperty("goodfrm", dum);
}
if (runRun.containsDataSet("number_periods")) {
int dum = runRun.getInt("number_periods");
runDetails.addProperty("nperiods", dum);
}
}
{ // Duration taken to be stop_time minus stat_time
auto start = createFromSanitizedISO8601(start_time);
auto end = createFromSanitizedISO8601(stop_time);
double duration_in_secs = DateAndTime::secondsFromDuration(end - start);
runDetails.addProperty("dur_secs", duration_in_secs);
}
}