Esempio n. 1
0
void LoadChemStationDataDialog::onFilesDoubleClicked(const QModelIndex &index)
{
  if (!index.isValid())
    return;

  switch (m_loadingMode) {
  case LoadingMode::SINGLE_FILE:
    loadSingleFile(index);
    break;
  case LoadingMode::WHOLE_DIRECTORY:
    loadWholeDirectory(index);
    break;
  case LoadingMode::MULTIPLE_DIRECTORIES:
    loadMultipleDirectories(index);
    break;
  }
}
Esempio n. 2
0
/**
 * Executes the algorithm.
 */
void Load::exec() {
  std::vector<std::vector<std::string>> fileNames = getProperty("Filename");

  // Test for loading as a single file
  IAlgorithm_sptr loader = getFileLoader(fileNames[0][0]);
  auto ifl =
      boost::dynamic_pointer_cast<IFileLoader<Kernel::FileDescriptor>>(loader);
  auto iflNexus =
      boost::dynamic_pointer_cast<IFileLoader<Kernel::NexusDescriptor>>(loader);

  if (isSingleFile(fileNames) || (ifl && ifl->loadMutipleAsOne()) ||
      (iflNexus && iflNexus->loadMutipleAsOne())) {
    // This is essentially just the same code that was called before multiple
    // files were supported.
    loadSingleFile();
  } else {
    // Code that supports multiple file loading.
    loadMultipleFiles();
  }
}