Changeset 19381


Ignore:
Timestamp:
Nov 11, 2018, 7:23:40 PM (4 months ago)
Author:
tbretz
Message:
Added PRINT command and --client option. No need anymore to skip the TM channel.
File:
1 edited

Legend:

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

    r19231 r19381  
    3333class StateMachineEventServer : public StateMachineDim
    3434{
     35public:
     36    static bool fIsServer;
     37
     38private:
     39
    3540    DimDescribedState fDimFadControl;
    3641
     
    5358
    5459    Time fTimer;
    55 
    56 private:
    5760
    5861    int Execute()
     
    154157                fMax[i] /= 1000;
    155158
    156             for (int i=8; i<1440; i+=9)
    157                 fMax[i] = fMax[i-2];
     159            //for (int i=8; i<1440; i+=9)
     160            //    fMax[i] = fMax[i-2];
    158161
    159162            // construct output
     
    240243    }
    241244
     245    int Print() const
     246    {
     247        Out() << fDimFadControl << endl;
     248        return GetCurrentState();
     249    }
     250
    242251
    243252public:
    244     StateMachineEventServer(ostream &out=cout) : StateMachineDim(out, "EVENT_SERVER"),
     253    StateMachineEventServer(ostream &out=cout) : StateMachineDim(out, fIsServer?"EVENT_SERVER":""),
    245254        fDimFadControl("FAD_CONTROL"), fStartDate(0), fNight(0), fIn(0), fMax(1440)
    246255
     
    269278            (bind(&StateMachineEventServer::StopServer, this))
    270279            ("Stop serving the smartfact camera file");
     280
     281        AddEvent("PRINT")
     282            (bind(&StateMachineEventServer::Print, this))
     283            ("Print current status");
    271284    }
    272285    ~StateMachineEventServer()
     
    285298};
    286299
     300bool StateMachineEventServer::fIsServer = false;
     301
    287302// ------------------------------------------------------------------------
    288303
     
    292307int RunShell(Configuration &conf)
    293308{
     309    StateMachineEventServer::fIsServer = !conf.Get<bool>("client");
    294310    return Main::execute<T, StateMachineEventServer>(conf);
    295311}
     
    302318        ("out-path", var<string>("www/smartfact/data"), "Path where the output camera file should be written.")
    303319        ("interval", var<uint32_t>(5000), "Interval of updates in milliseconds.")
     320        ("client",   po_bool(false), "For a standalone client choose this option.")
    304321        ;
    305322
Note: See TracChangeset for help on using the changeset viewer.