本文整理汇总了C++中Algorithm_sptr::setLogging方法的典型用法代码示例。如果您正苦于以下问题:C++ Algorithm_sptr::setLogging方法的具体用法?C++ Algorithm_sptr::setLogging怎么用?C++ Algorithm_sptr::setLogging使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Algorithm_sptr
的用法示例。
在下文中一共展示了Algorithm_sptr::setLogging方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runCompareWorkspaces
/**
* Run new CompareWorkspaces algorithm as a child algorithm.
*
* Result string formatted the same way as before; "Success!" when workspaces
* match or a newline separated list of mismatch messages.
*
* @param group_compare Should output be formatted like group comparison?
* @return A string containing either successString() or mismatch messages
*/
std::string CheckWorkspacesMatch::runCompareWorkspaces(bool group_compare) {
// This algorithm produces a single result string
std::string result;
// Use new CompareWorkspaces algorithm to perform comparison
Algorithm_sptr compare = this->createChildAlgorithm("CompareWorkspaces");
compare->setRethrows(true);
compare->setLogging(false);
// Forward workspace properties
Workspace_sptr ws1 = getProperty("Workspace1");
Workspace_sptr ws2 = getProperty("Workspace2");
compare->setProperty("Workspace1", ws1);
compare->setProperty("Workspace2", ws2);
// Copy any other non-default properties
const std::vector<Property *> &allProps = this->getProperties();
auto propCount = allProps.size();
for (size_t i = 0; i < propCount; ++i) {
Property *prop = allProps[i];
const std::string &pname = prop->name();
if (!prop->isDefault() && pname != "Workspace1" && pname != "Workspace2" &&
pname != "Result")
compare->setPropertyValue(pname, prop->value());
}
// Execute comparison
compare->execute();
// Generate result string
if (!compare->getProperty("Result")) {
ITableWorkspace_sptr table = compare->getProperty("Messages");
auto rowcount = table->rowCount();
for (size_t i = 0; i < rowcount; ++i) {
result += table->cell<std::string>(i, 0);
// Emulate special case output format when comparing groups
if (group_compare &&
table->cell<std::string>(i, 0) !=
"Type mismatch. One workspace is a group, the other is not." &&
table->cell<std::string>(i, 0) != "GroupWorkspaces size mismatch.") {
result += ". Inputs=[" + table->cell<std::string>(i, 1) + "," +
table->cell<std::string>(i, 2) + "]";
}
if (i < (rowcount - 1))
result += "\n";
}
} else {
result = successString();
}
return result;
}