Changeset 13867


Ignore:
Timestamp:
05/24/12 14:10:42 (13 years ago)
Author:
tbretz
Message:
Updated some strange namings
File:
1 edited

Legend:

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

    r13212 r13867  
    228228            "Cache-Control: max-age=0\r\n"
    229229            "\r\n";
     230
    230231        PostMessage(cmd);
    231232    }
     
    326327#include "DimDescriptionService.h"
    327328
    328 class ConnectionDimDrive : public ConnectionWeather
     329class ConnectionDimWeather : public ConnectionWeather
    329330{
    330331private:
     
    339340
    340341public:
    341     ConnectionDimDrive(ba::io_service& ioservice, MessageImp &imp) :
     342    ConnectionDimWeather(ba::io_service& ioservice, MessageImp &imp) :
    342343        ConnectionWeather(ioservice, imp),
    343344        fDimWeather("MAGIC_WEATHER/DATA", "S:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1",
     
    357358
    358359template <class T, class S>
    359 class StateMachineDrive : public T, public ba::io_service, public ba::io_service::work
    360 {
    361     int Wrap(boost::function<void()> f)
    362     {
    363         f();
    364         return T::GetCurrentState();
    365     }
    366 
    367     boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func)
    368     {
    369         return bind(&StateMachineDrive::Wrap, this, func);
    370     }
    371 
     360class StateMachineWeather : public T, public ba::io_service, public ba::io_service::work
     361{
    372362private:
    373363    S fWeather;
     
    441431
    442432public:
    443     StateMachineDrive(ostream &out=cout) :
     433    StateMachineWeather(ostream &out=cout) :
    444434        T(out, "MAGIC_WEATHER"), ba::io_service::work(static_cast<ba::io_service&>(*this)),
    445435        fWeather(*this, *this)
     
    464454        // Verbosity commands
    465455        T::AddEvent("SET_VERBOSE", "B")
    466             (bind(&StateMachineDrive::SetVerbosity, this, placeholders::_1))
     456            (bind(&StateMachineWeather::SetVerbosity, this, placeholders::_1))
    467457            ("set verbosity state"
    468458             "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
     
    470460        // Conenction commands
    471461        AddEvent("DISCONNECT")
    472             (bind(&StateMachineDrive::Disconnect, this))
     462            (bind(&StateMachineWeather::Disconnect, this))
    473463            ("disconnect from ethernet");
    474464
    475465        AddEvent("RECONNECT", "O")
    476             (bind(&StateMachineDrive::Reconnect, this, placeholders::_1))
     466            (bind(&StateMachineWeather::Reconnect, this, placeholders::_1))
    477467            ("(Re)connect ethernet connection to FTM, a new address can be given"
    478468             "|[host][string]:new ethernet address in the form <host:port>");
    479469*/
    480         fWeather.StartConnect();
    481     }
    482 
    483     void SetEndpoint(const string &url)
    484     {
    485         fWeather.SetEndpoint(url);
    486470    }
    487471
     
    492476        fWeather.SetDebugTx(conf.Get<bool>("debug-tx"));
    493477        fWeather.SetSite(conf.Get<string>("url"));
    494 
    495         SetEndpoint(conf.Get<string>("addr"));
    496 
     478        fWeather.SetEndpoint(conf.Get<string>("addr"));
     479        fWeather.StartConnect();
    497480
    498481        return -1;
     
    508491int RunShell(Configuration &conf)
    509492{
    510     return Main::execute<T, StateMachineDrive<S, R>>(conf);
     493    return Main::execute<T, StateMachineWeather<S, R>>(conf);
    511494}
    512495
    513496void SetupConfiguration(Configuration &conf)
    514497{
    515     po::options_description control("Drive control options");
     498    po::options_description control("MAGIC weather control options");
    516499    control.add_options()
    517500        ("no-dim,d",  po_switch(),    "Disable dim services")
     
    538521{
    539522    cout <<
    540         "The drivectrl is an interface to cosy.\n"
     523        "The magicweather is an interface to the MAGIC weather data.\n"
    541524        "\n"
    542525        "The default is that the program is started without user intercation. "
     
    545528        "help message about the usuage can be brought to the screen.\n"
    546529        "\n"
    547         "Usage: drivectrl [-c type] [OPTIONS]\n"
    548         "  or:  drivectrl [OPTIONS]\n";
     530        "Usage: magicweather [-c type] [OPTIONS]\n"
     531        "  or:  magicweather [OPTIONS]\n";
    549532    cout << endl;
    550533}
     
    590573                return RunShell<LocalStream, StateMachine, ConnectionWeather>(conf);
    591574            else
    592                 return RunShell<LocalStream, StateMachineDim, ConnectionDimDrive>(conf);
     575                return RunShell<LocalStream, StateMachineDim, ConnectionDimWeather>(conf);
    593576        }
    594577        // Cosole access w/ and w/o Dim
     
    603586        {
    604587            if (conf.Get<int>("console")==0)
    605                 return RunShell<LocalShell, StateMachineDim, ConnectionDimDrive>(conf);
     588                return RunShell<LocalShell, StateMachineDim, ConnectionDimWeather>(conf);
    606589            else
    607                 return RunShell<LocalConsole, StateMachineDim, ConnectionDimDrive>(conf);
     590                return RunShell<LocalConsole, StateMachineDim, ConnectionDimWeather>(conf);
    608591        }
    609592    }
Note: See TracChangeset for help on using the changeset viewer.