Exemple #1
0
/**
 * 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();
}
Exemple #2
0
/**
     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;
}