From 0c9b289020f68ccfe2fa6a49d7d6cd4b237faebe Mon Sep 17 00:00:00 2001 From: Teemu Murtola Date: Sun, 10 Aug 2014 07:24:06 +0300 Subject: [PATCH] Improve initAfterFirstFrame() usability The initAnalysis() function was changed a long time ago to take the analysis settings as a parameter, to make it easy to use those values in initialization without storing them in local variables. Do the same for initAfterFirstFrame(), now that there is a tool in pipeline (gmx rdf) that would actually use this function and sees the same issue there. Change-Id: Ib10abb3790ac5472070edc76155cfa50cce96541 --- src/gromacs/trajectoryanalysis/analysismodule.cpp | 4 +++- src/gromacs/trajectoryanalysis/analysismodule.h | 3 ++- src/gromacs/trajectoryanalysis/cmdlinerunner.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gromacs/trajectoryanalysis/analysismodule.cpp b/src/gromacs/trajectoryanalysis/analysismodule.cpp index 721bac031e..a9ccfd833c 100644 --- a/src/gromacs/trajectoryanalysis/analysismodule.cpp +++ b/src/gromacs/trajectoryanalysis/analysismodule.cpp @@ -293,7 +293,9 @@ void TrajectoryAnalysisModule::optionsFinished( } -void TrajectoryAnalysisModule::initAfterFirstFrame(const t_trxframe & /*fr*/) +void TrajectoryAnalysisModule::initAfterFirstFrame( + const TrajectoryAnalysisSettings & /*settings*/, + const t_trxframe & /*fr*/) { } diff --git a/src/gromacs/trajectoryanalysis/analysismodule.h b/src/gromacs/trajectoryanalysis/analysismodule.h index 1bee97d8a9..af1cfbbf18 100644 --- a/src/gromacs/trajectoryanalysis/analysismodule.h +++ b/src/gromacs/trajectoryanalysis/analysismodule.h @@ -295,7 +295,8 @@ class TrajectoryAnalysisModule * * The default implementation does nothing. */ - virtual void initAfterFirstFrame(const t_trxframe &fr); + virtual void initAfterFirstFrame(const TrajectoryAnalysisSettings &settings, + const t_trxframe &fr); /*! \brief * Starts the analysis of frames. diff --git a/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp b/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp index 426796c5d1..9374c26c46 100644 --- a/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp +++ b/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp @@ -195,7 +195,7 @@ TrajectoryAnalysisCommandLineRunner::run(int argc, char *argv[]) // Load first frame. common.initFirstFrame(); - module->initAfterFirstFrame(common.frame()); + module->initAfterFirstFrame(settings, common.frame()); t_pbc pbc; t_pbc *ppbc = settings.hasPBC() ? &pbc : NULL; -- 2.22.0