Skip to content

Commit

Permalink
New functions to interact with tables and XML files.
Browse files Browse the repository at this point in the history
Plus removed old ones and tmp file usage. Grouping is not applied
properly yet.

Refs #7557
  • Loading branch information
arturbekasov committed Oct 16, 2013
1 parent 7b82e2c commit c28ec3a
Show file tree
Hide file tree
Showing 6 changed files with 398 additions and 201 deletions.
1 change: 1 addition & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ set( TEST_FILES CreateMDWorkspaceAlgDialogTest.h
WorkspaceMementoTest.h
WorkspaceInADSTest.h
RawFileMementoTest.h
IO_MuonGroupingTest.h
)

include_directories ( inc )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,38 @@ File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/

/// save XML grouping file
void saveGroupingTabletoXML(Ui::MuonAnalysis& m_uiForm, const std::string& filename);
using namespace Mantid;

/// load XML grouping file
void loadGroupingXMLtoTable(Ui::MuonAnalysis& m_uiForm, const std::string& filename);
/// Structure to represent grouping information for Muon Analysis
typedef struct {
std::vector<std::string> groupNames;
std::vector<std::string> groups; // Range strings, e.g. "1-32"

std::vector<std::string> pairNames;
std::vector<std::pair<size_t, size_t> > pairs; // Pairs of group ids
std::vector<double> pairAlphas;

std::string description;
std::string defaultName; // Not storing id because can be either group or pair
} Grouping;

/// Saves grouping to the XML file specified
void saveGroupingToXML(const Grouping& grouping, const std::string& filename);

/// Loads grouping from the XML file specified
void loadGroupingFromXML(const std::string& filename, Grouping& grouping);

/// Parses information from the grouping table and saves to Grouping struct
void parseGroupingTable(const Ui::MuonAnalysis& form, Grouping& grouping);

/// Fills in the grouping table using information from provided Grouping struct
void fillGroupingTable(const Grouping& grouping, Ui::MuonAnalysis& form);

/// create 'map' relating group number to row number in group table
void whichGroupToWhichRow(Ui::MuonAnalysis& m_uiForm, std::vector<int>& groupToRow);
void whichGroupToWhichRow(const Ui::MuonAnalysis& m_uiForm, std::vector<int>& groupToRow);

/// create 'map' relating pair number to row number in pair table
void whichPairToWhichRow(Ui::MuonAnalysis& m_uiForm, std::vector<int>& pairToRow);
void whichPairToWhichRow(const Ui::MuonAnalysis& m_uiForm, std::vector<int>& pairToRow);

/// Set Group / Group Pair name
void setGroupGroupPair(Ui::MuonAnalysis& m_uiForm, const std::string& name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ private slots:
/// List of current group names
std::vector<std::string> m_groupNames;

/// name for file to temperary store grouping
std::string m_groupingTempFilename;

/// Deal with input file changes.
void handleInputFileChanges();

Expand Down

0 comments on commit c28ec3a

Please sign in to comment.