Changeset 12243


Ignore:
Timestamp:
10/23/11 15:06:51 (13 years ago)
Author:
tbretz
Message:
Added output of commands and states to --help
Location:
trunk/FACT++/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/mcp.cc

    r12218 r12243  
    194194    {
    195195        fRunType = "";
    196         Message("Resetiing configuration states of FAD and FTM");
     196        Message("Reseting configuration states of FAD and FTM");
    197197        Dim::SendCommand("FTM_CONTROL/RESET_CONFIGURE");
    198198        Dim::SendCommand("FAD_CONTROL/RESET_CONFIGURE");
     
    292292                {
    293293                    Message("Starting datalogger");
    294                     Dim::SendCommand("DATA_LOGGER/WAIT_FOR_RUN_NUMBER");
     294                    Dim::SendCommand("DATA_LOGGER/START_RUN_LOGGING");
    295295                }
    296296                Message("Configuring Trigger (FTM)");
     
    388388
    389389        AddStateName(kStateConfiguring2, "Configuring2",
    390                      ".");
     390                     "Waiting for FTM and Datalogger to get ready");
    391391
    392392        AddStateName(kStateConfiguring3, "Configuring3",
    393                      ".");
     393                     "Waiting for FAD to get ready");
    394394
    395395        AddStateName(kStateConfigured, "Configured",
  • trunk/FACT++/src/ratescan.cc

    r12242 r12243  
    502502    control.add_options()
    503503        ("max-wait",   var<uint16_t>(150), "The maximum number of seconds to wait to get the anticipated resolution for a point.")
    504         ("resolution", var<double>(0.05), "The minimum resolution required for a single data point.")
     504        ("resolution", var<double>(0.05) , "The minimum resolution required for a single data point.")
    505505        ;
    506506
     
    529529void PrintHelp()
    530530{
     531    Main::PrintHelp<StateMachineRateScan>();
     532
    531533    /* Additional help text which is printed after the configuration
    532534     options goes here */
  • trunk/FACT++/src/tools.cc

    r12161 r12243  
    7373    return str.substr(start, end-start+1);
    7474}
     75
     76// --------------------------------------------------------------------------
     77//
     78//! This is a static helper to remove leading and trailing whitespaces.
     79//!
     80//! Usage example:
     81//!
     82//! \code
     83//!    string str = "     Dies ist ein test fuer einen ganz     langen Satz "
     84//!        "und ob er korrekt umgebrochen und formatiert wird. Alles "
     85//!        "nur ein simpler test aber trotzdem ganz wichtig.";
     86//!
     87//!    cout << setfill('-') << setw(40) << "+" << endl;
     88//!    while (1)
     89//!    {
     90//!        const string rc = Tools::Wrap(str, 40);
     91//!        if (rc.empty())
     92//!            break;
     93//!        cout << rc << endl;
     94//!    }
     95//! \endcode
     96//!
     97string Tools::Wrap(string &str, size_t width)
     98{
     99    const size_t pos = str.length()<width ? string::npos : str.find_last_of(' ', width);
     100    if (pos==string::npos)
     101    {
     102        const string rc = str;
     103        str = "";
     104        return rc;
     105    }
     106
     107    const size_t indent = str.find_first_not_of(' ');
     108
     109    const string rc = str.substr(0, pos);
     110    const size_t p2 = str.find_first_not_of(' ', pos+1);
     111
     112    str = str.substr(0, indent) + str.substr(p2==string::npos ? pos+1 : p2);
     113
     114    return rc;
     115}
  • trunk/FACT++/src/tools.h

    r12161 r12243  
     1#ifndef FACT_Tools
     2#define FACT_Tools
     3
    14#include <string>
    25
     
    69    std::string Form(const char *fmt, ...);
    710    std::string Trim(const std::string &str);
     11    std::string Wrap(std::string &str, size_t width=78);
    812}
     13
     14#endif
Note: See TracChangeset for help on using the changeset viewer.