correct error messages and make use of utils and fmtlib
This commit is contained in:
@ -249,7 +249,6 @@ double Timer::get_timeout_remain()
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
static const char *timer_style[] = { "off", "loop", "normal", "full" };
|
static const char *timer_style[] = { "off", "loop", "normal", "full" };
|
||||||
static const char *timer_mode[] = { "nosync", "(dummy)", "sync" };
|
static const char *timer_mode[] = { "nosync", "(dummy)", "sync" };
|
||||||
static const char timer_fmt[] = "New timer settings: style=%s mode=%s timeout=%s\n";
|
|
||||||
|
|
||||||
void Timer::modify_params(int narg, char **arg)
|
void Timer::modify_params(int narg, char **arg)
|
||||||
{
|
{
|
||||||
@ -271,15 +270,15 @@ void Timer::modify_params(int narg, char **arg)
|
|||||||
++iarg;
|
++iarg;
|
||||||
if (iarg < narg) {
|
if (iarg < narg) {
|
||||||
_timeout = utils::timespec2seconds(arg[iarg]);
|
_timeout = utils::timespec2seconds(arg[iarg]);
|
||||||
} else error->all(FLERR,"Illegal timers command");
|
} else error->all(FLERR,"Illegal timer command");
|
||||||
} else if (strcmp(arg[iarg],"every") == 0) {
|
} else if (strcmp(arg[iarg],"every") == 0) {
|
||||||
++iarg;
|
++iarg;
|
||||||
if (iarg < narg) {
|
if (iarg < narg) {
|
||||||
_checkfreq = utils::inumeric(FLERR,arg[iarg],false,lmp);
|
_checkfreq = utils::inumeric(FLERR,arg[iarg],false,lmp);
|
||||||
if (_checkfreq <= 0)
|
if (_checkfreq <= 0)
|
||||||
error->all(FLERR,"Illegal timers command");
|
error->all(FLERR,"Illegal timer command");
|
||||||
} else error->all(FLERR,"Illegal timers command");
|
} else error->all(FLERR,"Illegal timer command");
|
||||||
} else error->all(FLERR,"Illegal timers command");
|
} else error->all(FLERR,"Illegal timer command");
|
||||||
++iarg;
|
++iarg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,9 +294,8 @@ void Timer::modify_params(int narg, char **arg)
|
|||||||
strftime(timebuf,32,"%H:%M:%S",tm);
|
strftime(timebuf,32,"%H:%M:%S",tm);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screen)
|
utils::logmesg(lmp,fmt::format("New timer settings: style={} mode={} "
|
||||||
fprintf(screen,timer_fmt,timer_style[_level],timer_mode[_sync],timebuf);
|
"timeout={}\n",timer_style[_level],
|
||||||
if (logfile)
|
timer_mode[_sync],timebuf);
|
||||||
fprintf(logfile,timer_fmt,timer_style[_level],timer_mode[_sync],timebuf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user