Skip to content
Snippets Groups Projects
ReflDataProcessorPresenter.h 3.55 KiB
Newer Older
#ifndef MANTID_CUSTOMINTERFACES_REFLDATAPROCESSORPRESENTER_H
#define MANTID_CUSTOMINTERFACES_REFLDATAPROCESSORPRESENTER_H

#include "MantidQtMantidWidgets/DataProcessorUI/GenericDataProcessorPresenter.h"
#include "MantidQtMantidWidgets/DataProcessorUI/DataProcessorMainPresenter.h"

namespace MantidQt {
namespace CustomInterfaces {

/** @class ReflDataProcessorPresenter

ReflDataProcessorPresenter is a presenter class that inherits from
GenericDataProcessorPresenter and re-implements some methods

Copyright © 2011-16 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source

This file is part of Mantid.

Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class ReflDataProcessorPresenter
    : public MantidQt::MantidWidgets::GenericDataProcessorPresenter {
public:
  // Constructor
  ReflDataProcessorPresenter(
      const MantidQt::MantidWidgets::DataProcessorWhiteList &whitelist,
      const std::map<
          std::string,
          MantidQt::MantidWidgets::DataProcessorPreprocessingAlgorithm> &
          preprocessMap,
      const MantidQt::MantidWidgets::DataProcessorProcessingAlgorithm &
          processor,
      const MantidQt::MantidWidgets::DataProcessorPostprocessingAlgorithm &
          postprocessor,
      const std::map<std::string, std::string> &postprocessMap =
          std::map<std::string, std::string>(),
      const std::string &loader = "Load");
  ~ReflDataProcessorPresenter() override;

private:
  // Process selected rows
  // Plotting
  void plotRow() override;
  void plotGroup() override;
  // Get the name of a post-processed workspace
  std::string getPostprocessedWorkspaceName(const GroupData &groupData,
                                            const std::string &prefix,
                                            double startTime, double stopTime);
  // Loads a group of runs
  bool loadGroup(const GroupData& group);
  // Process a group of runs which are event workspaces
  bool processGroupAsEventWS(int groupID, const GroupData &group,
                             const std::vector<double> &startTimes,
                             const std::vector<double> &stopTimes);
  // Process a group of runs which are not event workspaces
  bool processGroupAsNonEventWS(int groupID, const GroupData& group);
  // Parse time slicing from string
  void parseTimeSlicing(const std::string &timeSlicing,
                        std::vector<double> &startTimes,
                        std::vector<double> &stopTimes);
  // Load a run as event workspace
  bool loadEventRun(const std::string &runno);
  // Load a run (non-event workspace)
  void loadNonEventRun(const std::string &runno);
  // Take a slice from event workspace
Raquel Alvarez's avatar
Raquel Alvarez committed
  std::string takeSlice(const std::string &runno, double startTime,
                        double stopTime);
};
}
}
#endif /*MANTID_CUSTOMINTERFACES_REFLDATAPROCESSORPRESENTER_H*/