本文整理汇总了C++中mantid::api::IAlgorithm_sptr::name方法的典型用法代码示例。如果您正苦于以下问题:C++ IAlgorithm_sptr::name方法的具体用法?C++ IAlgorithm_sptr::name怎么用?C++ IAlgorithm_sptr::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid::api::IAlgorithm_sptr
的用法示例。
在下文中一共展示了IAlgorithm_sptr::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateAlgorithm
/**
Upadates the non-default algorithm properties in the history.
@param alg :: Pointer to the algorthm
*/
void InputHistoryImpl::updateAlgorithm(Mantid::API::IAlgorithm_sptr alg)
{
const std::vector< Property* >& props = alg->getProperties();
QList< PropertyData > prop_hist_list;
for(std::vector< Property* >::const_iterator prop=props.begin();prop!=props.end();++prop)
if (!(*prop)->isDefault())
{
PropertyData prop_hist(QString::fromStdString((*prop)->name()),QString::fromStdString((*prop)->value()));
prop_hist_list.push_back(prop_hist);
}
else
{
PropertyData prop_hist(QString::fromStdString((*prop)->name()),"");
prop_hist_list.push_back(prop_hist);
}
m_history[QString::fromStdString(alg->name())] = prop_hist_list;
}
示例2: setAlgorithm
/**
* Set the algorithm pointer
* @param alg :: A pointer to the algorithm
*/
void AlgorithmDialog::setAlgorithm(Mantid::API::IAlgorithm_sptr alg) {
m_algorithm = alg;
m_algName = QString::fromStdString(alg->name());
m_algProperties.clear();
m_tied_properties.clear();
std::vector<Mantid::Kernel::Property *>::const_iterator iend =
alg->getProperties().end();
for (std::vector<Mantid::Kernel::Property *>::const_iterator itr =
alg->getProperties().begin();
itr != iend; ++itr) {
Mantid::Kernel::Property *p = *itr;
if (dynamic_cast<Mantid::API::IWorkspaceProperty *>(p) ||
p->direction() != Mantid::Kernel::Direction::Output) {
m_algProperties.append(QString::fromStdString(p->name()));
}
}
m_validators.clear();
m_noValidation.clear();
}
示例3: executeAlgorithmAsync
/**
* Execute the underlying algorithm
*/
void AlgorithmDialog::executeAlgorithmAsync() {
Mantid::API::IAlgorithm_sptr algToExec = m_algorithm;
// Clear any previous trackers so we know what state we are in
this->stopObserving(algToExec);
try {
// Add any custom AlgorithmObservers to the algorithm
for (auto it = m_observers.begin(); it != m_observers.end(); ++it) {
(*it)->observeAll(algToExec);
}
// Only need to observe finish events if we are staying open
if (m_keepOpenCheckBox && m_keepOpenCheckBox->isChecked()) {
this->observeFinish(algToExec);
this->observeError(algToExec);
m_statusTracked = true;
// Disable close button for a short period. If it is clicked to soon then
// Mantid crashes - https://github.com/mantidproject/mantid/issues/13836
if (m_exitButton) {
m_exitButton->setEnabled(false);
m_btnTimer.setInterval(1000);
connect(&m_btnTimer, SIGNAL(timeout()), this, SLOT(enableExitButton()));
} else {
m_statusTracked = false;
}
}
algToExec->executeAsync();
m_btnTimer.start();
if (m_okButton) {
m_okButton->setEnabled(false);
}
} catch (Poco::NoThreadAvailableException &) {
g_log.error() << "No thread was available to run the " << algToExec->name()
<< " algorithm in the background.\n";
}
}