1
0
mirror of https://github.com/wfjm/w11.git synced 2026-05-02 14:31:17 +00:00

more compact dumps, add Dump(..,detail); trace output with cntl name

- RlinkCommand: add CommandInfo()
- RtclCmdBase: add GetArgsDump()
- RlinkCommandList: Dump(): add detail arg
- Rstats: add NameMaxLength(); Print(): add counter name
- Rw11Cntl: use Dump(detail) for PrimClist ect
- Rw11CntlBase,Rw11Rdma*: Dump(): add detail arg
- Rw11Cntl*: Dump(): add detail arg; use cntl name as message prefix
- RtclRw11Cntl: M_dump: use GetArgsDump and Dump detail
This commit is contained in:
Walter F.J. Mueller
2017-04-02 19:06:38 +02:00
parent e73c041309
commit 79c565f6f3
31 changed files with 361 additions and 178 deletions

View File

@@ -1,4 +1,4 @@
// $Id: RtclCmdBase.cpp 863 2017-04-02 11:43:15Z mueller $
// $Id: RtclCmdBase.cpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2011-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.1.1 add GetArgsDump()
// 2017-04-02 863 1.1 add DelMeth(),TstMeth(); add M_info() and '?'
// rename fMapMeth -> fMethMap
// 2017-03-11 859 1.1 support now sub-command handling
@@ -24,13 +25,15 @@
/*!
\file
\version $Id: RtclCmdBase.cpp 863 2017-04-02 11:43:15Z mueller $
\version $Id: RtclCmdBase.cpp 865 2017-04-02 16:45:06Z mueller $
\brief Implemenation of RtclCmdBase.
*/
#include "RtclCmdBase.hpp"
#include "librtools/Rexception.hpp"
#include "librtcltools/RtclNameSet.hpp"
#include "Rtcl.hpp"
#include "RtclOPtr.hpp"
@@ -164,6 +167,26 @@ bool RtclCmdBase::TstMeth(const std::string& name)
//------------------------------------------+-----------------------------------
//! FIXME_docs
bool RtclCmdBase::GetArgsDump(RtclArgs& args, int& detail)
{
static RtclNameSet optset("-brief|-v|-vv|-vvv");
detail = 0;
string opt;
while (args.NextOpt(opt, optset)) {
if (opt == "-brief") { detail = -1;}
else if (opt == "-v") { detail = +1;}
else if (opt == "-vv") { detail = +2;}
else if (opt == "-vvv") { detail = +3;}
else { detail = 0;}
}
return true;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
int RtclCmdBase::M_info(RtclArgs& args)
{
Tcl_Interp* interp = args.Interp();

View File

@@ -1,4 +1,4 @@
// $Id: RtclCmdBase.hpp 863 2017-04-02 11:43:15Z mueller $
// $Id: RtclCmdBase.hpp 865 2017-04-02 16:45:06Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-02 865 1.1.1 add GetArgsDump()
// 2017-04-02 863 1.1 add DelMeth(),TstMeth(); add M_info() and '?'
// rename fMapMeth -> fMethMap
// 2013-04-26 511 1.0.1 AddMeth() now public
@@ -21,7 +22,7 @@
/*!
\file
\version $Id: RtclCmdBase.hpp 863 2017-04-02 11:43:15Z mueller $
\version $Id: RtclCmdBase.hpp 865 2017-04-02 16:45:06Z mueller $
\brief Declaration of class RtclCmdBase.
*/
@@ -56,12 +57,13 @@ namespace Retro {
void AddMeth(const std::string& name, const methfo_t& methfo);
void DelMeth(const std::string& name);
bool TstMeth(const std::string& name);
// some constants (also defined in cpp)
static const int kOK = TCL_OK; //<!
static const int kERR = TCL_ERROR; //<!
protected:
bool GetArgsDump(RtclArgs& args, int& detail);
int M_info(RtclArgs& args);
protected: