X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fcommandline%2Fpargs.cpp;h=a05bc495c399c05db80c411fbfbab15aed0a59d4;hb=86f86f19d985cd5516b5f8bd5d3dab4760d4b573;hp=6daf7d554bceab34c6c1c401424a4ec44d5e4b85;hpb=bd8ff104f5c56e7040041a456a349dac48bf60d9;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/commandline/pargs.cpp b/src/gromacs/commandline/pargs.cpp index 6daf7d554b..a05bc495c3 100644 --- a/src/gromacs/commandline/pargs.cpp +++ b/src/gromacs/commandline/pargs.cpp @@ -487,9 +487,10 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags, try { - double tbegin = 0.0, tend = 0.0, tdelta = 0.0; - bool bView = false; - int xvgFormat = 0; + double tbegin = 0.0, tend = 0.0, tdelta = 0.0; + bool bBeginTimeSet = false, bEndTimeSet = false, bDtSet = false; + bool bView = false; + int xvgFormat = 0; gmx::TimeUnitManager timeUnitManager; gmx::OptionsAdapter adapter(*argc, argv); gmx::Options options(NULL, NULL); @@ -506,19 +507,22 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags, if (FF(PCA_CAN_BEGIN)) { options.addOption( - gmx::DoubleOption("b").store(&tbegin).timeValue() + gmx::DoubleOption("b") + .store(&tbegin).storeIsSet(&bBeginTimeSet).timeValue() .description("First frame (%t) to read from trajectory")); } if (FF(PCA_CAN_END)) { options.addOption( - gmx::DoubleOption("e").store(&tend).timeValue() + gmx::DoubleOption("e") + .store(&tend).storeIsSet(&bEndTimeSet).timeValue() .description("Last frame (%t) to read from trajectory")); } if (FF(PCA_CAN_DT)) { options.addOption( - gmx::DoubleOption("dt").store(&tdelta).timeValue() + gmx::DoubleOption("dt") + .store(&tdelta).storeIsSet(&bDtSet).timeValue() .description("Only use frame when t MOD dt = first time (%t)")); } if (FF(PCA_TIME_UNIT)) @@ -586,16 +590,15 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags, timeUnitManager.scaleTimeOptions(&options); /* Extract Time info from arguments */ - // TODO: Use OptionInfo objects instead of string constants - if (FF(PCA_CAN_BEGIN) && options.isSet("b")) + if (bBeginTimeSet) { setTimeValue(TBEGIN, tbegin); } - if (FF(PCA_CAN_END) && options.isSet("e")) + if (bEndTimeSet) { setTimeValue(TEND, tend); } - if (FF(PCA_CAN_DT) && options.isSet("dt")) + if (bDtSet) { setTimeValue(TDELTA, tdelta); }