Commit a07dd823 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[WP] (libstfinv): adjust usage printout functions

parent a4bb4215
......@@ -48,6 +48,7 @@
#include <stfinv/stfinv_summary_usage.h>
#include <stfinv/stfinv_description_usage.h>
#include <stfinv/error.h>
#include <stfinv/tools.h>
namespace stfinv {
......@@ -132,40 +133,27 @@ namespace stfinv {
void STFEngine::engines(std::ostream& os)
{
os << "The following procedures are available:" << std::endl;
os << "---------------------------------------" << std::endl;
os << std::endl;
const int width1=10;
/*----------------------------------------------------------------------*/
os.width(width1);
os << STFEngineIdentity::ID;
os.width(0);
os << ": " << STFEngineIdentity::description << std::endl;
/*----------------------------------------------------------------------*/
/*
os.width(width1);
os << STFEngineFixedWavelet::ID;
os.width(0);
os << ": " << STFEngineFixedWavelet::description << std::endl;
*/
/*----------------------------------------------------------------------*/
os.width(width1);
os << STFEngineFDLeastSquares::ID;
os.width(0);
os << ": " << STFEngineFDLeastSquares::description << std::endl;
os << "Available procedures:" << std::endl;
os << "---------------------" << std::endl;
tools::report_engine<STFEngineIdentity>(os);
// tools::report_engine<STFEngineFixedWavelet>(os);
tools::report_engine<STFEngineFDLeastSquares>(os);
} // void STFEngine::help(std::ostream& os=std::cout)
/*----------------------------------------------------------------------*/
void STFEngine::help(std::ostream& os)
{
STFEngine::engines(os);
os << std::endl;
os << stfinv_summary_usage;
os << std::endl;
STFEngine::engines(os);
os << std::endl;
STFEngineIdentity::classhelp(os);
os << std::endl;
STFEngineFDLeastSquares::classhelp(os);
os << std::endl;
STFFourierDomainEngine::classhelp(os);
os << std::endl;
STFBaseEngine::classhelp(os);
os << std::endl;
os << stfinvany_summary_usage;
......
......@@ -212,7 +212,7 @@ namespace stfinv {
void STFBaseEngine::classhelp(std::ostream& os)
{
os << stfinvbase_description_usage << std::endl;
os << stfinvbase_summary_usage << std::endl;
} // void STFBaseEngine::classhelp(std::ostream& os)
/*----------------------------------------------------------------------*/
......@@ -226,7 +226,7 @@ namespace stfinv {
void STFBaseEngine::classusage(std::ostream& os)
{
os << stfinvbase_summary_usage << std::endl;
os << stfinvbase_description_usage << std::endl;
} // void STFBaseEngine::classusage(std::ostream& os)
/*----------------------------------------------------------------------*/
......
......@@ -90,17 +90,20 @@ namespace stfinv {
void STFEngineFDLeastSquares::classhelp(std::ostream& os)
{
stfinv::tools::report_engine<STFEngineFDLeastSquares>(os);
os << stfinvfdleastsquares_summary_usage << std::endl;
os << std::endl;
stfinv::tools::report_engine<STFEngineFDLeastSquares>(os);
} // void STFEngineFDLeastSquares::classhelp(std::ostream& os)
/*----------------------------------------------------------------------*/
void STFEngineFDLeastSquares::classusage(std::ostream& os)
{
stfinv::tools::report_engine<STFEngineFDLeastSquares>(os);
os << stfinvfdleastsquares_description_usage << std::endl;
os << std::endl;
Tbase::classusage(os);
os << std::endl;
stfinv::tools::report_engine<STFEngineFDLeastSquares>(os);
} // void STFEngineFDLeastSquares::classusage(std::ostream& os)
/*----------------------------------------------------------------------*/
......
......@@ -140,6 +140,7 @@ namespace stfinv {
void STFFourierDomainEngine::classusage(std::ostream& os)
{
os << stfinvfourier_description_usage << std::endl;
os << std::endl;
Tbase::classusage(os);
} // void STFFourierDomainEngine::classusage(std::ostream& os)
......
......@@ -50,7 +50,7 @@ namespace stfinv {
const char* const STFEngineIdentity::ID="ident";
const char* const STFEngineIdentity::description
="identity: just apply a scalar factor";
="scale with amplitude factor";
/*----------------------------------------------------------------------*/
......@@ -126,17 +126,20 @@ namespace stfinv {
void STFEngineIdentity::classhelp(std::ostream& os)
{
stfinv::tools::report_engine<STFEngineIdentity>(os);
os << stfinvidentity_summary_usage << std::endl;
os << std::endl;
stfinv::tools::report_engine<STFEngineIdentity>(os);
} // void STFEngineIdentity::classhelp(std::ostream& os)
/*----------------------------------------------------------------------*/
void STFEngineIdentity::classusage(std::ostream& os)
{
stfinv::tools::report_engine<STFEngineIdentity>(os);
os << stfinvidentity_description_usage << std::endl;
os << std::endl;
Tbase::classusage(os);
os << std::endl;
stfinv::tools::report_engine<STFEngineIdentity>(os);
} // void STFEngineIdentity::classusage(std::ostream& os)
} // namespace stfinv
......
......@@ -61,12 +61,18 @@ namespace stfinv {
/*! \brief report engine identifier
* \ingroup tools
* \param C class to report ID and oneline description
* \param os output stream to send output to
*/
template<class C>
void report_engine(std::ostream& os)
{
os << "Procedure: " << C::description << "\n"
<< " ID: " << C::ID << std::endl;
os << " ID: ";
os.width(10);
os.setf(std::ios_base::left);
os << C::ID;
os.width(0);
os << " (" << C::description << ")" << std::endl;
} // void report_engine(std::ostream& os)
} // namespace tools
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment