Changeset 16444


Ignore:
Timestamp:
05/30/13 00:17:24 (11 years ago)
Author:
tbretz
Message:
First send the command to the FTM then the Dim message; change the message in state configured if the configuration is updated.
File:
1 edited

Legend:

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

    r16383 r16444  
    516516    void CmdStartRun()
    517517    {
     518        PostCmd(FTM::kCmdStartRun, FTM::kStartRun);
     519        CmdGetRegister(0);
     520
    518521        Info("Sending start trigger.");
    519 
    520         PostCmd(FTM::kCmdStartRun, FTM::kStartRun);
    521 
    522         // Update state information by requesting a new header
     522    }
     523
     524    void CmdStopRun()
     525    {
     526        PostCmd(FTM::kCmdStopRun);
    523527        CmdGetRegister(0);
    524     }
    525 
    526     void CmdStopRun()
    527     {
     528
    528529        Info("Sending stop trigger.");
    529 
    530         PostCmd(FTM::kCmdStopRun);
    531 
    532         // Update state information by requesting a new header
    533         CmdGetRegister(0);
    534530    }
    535531
     
    576572            return false;
    577573
     574        PostCmd(FTM::kCmdCrateReset, 1<<addr);
    578575        Info("Sending crate reset for crate "+to_string(addr));
    579         PostCmd(FTM::kCmdCrateReset, 1<<addr);
    580576
    581577        return true;
     
    584580    bool CmdResetCamera()
    585581    {
    586         Info("Sending camera reset");
    587 
    588582        PostCmd(FTM::kCmdCrateReset, FTM::kResetCrate0);
    589583        PostCmd(FTM::kCmdCrateReset, FTM::kResetCrate1);
    590584        PostCmd(FTM::kCmdCrateReset, FTM::kResetCrate2);
    591585        PostCmd(FTM::kCmdCrateReset, FTM::kResetCrate3);
     586
     587        Info("Sending camera reset");
    592588
    593589        return true;
     
    19721968            fCounterStat = fFTM.GetCounter(FTM::kStaticData);
    19731969
     1970            fFTM.CmdSendStatDat(fTargetConfig->second);
     1971
    19741972            T::Message("Trigger successfully disabled... sending new configuration.");
    1975 
    1976             fFTM.CmdSendStatDat(fTargetConfig->second);
    19771973
    19781974            // Next state is: wait for the answer to our configuration
     
    19881984            // If now the configuration is not what we expected
    19891985            // we had an error (maybe old events waiting in the queue?)
    1990             // ======================
    19911986            if (fFTM.GetState()!=ConnectionFTM::kConfigured)
    19921987                return FTM::State::kConfigError2;
    1993             // ======================
    1994             // There is no simple way to check if the clock
    1995             // conditioner is locked. Every message send to request a static
    1996             // data block may end up in the same buffer at the FTM, thus
    1997             // the result will be that it is in state Configuring, which
    1998             // will always return the clock conditioner to be unlocked.
    1999             /*
    2000             if (!fFTM.IsLocked())
    2001             {
    2002                  T::Warn("Configuration successfull, but clock conditioner not locked.");
    2003                  return FTM::State::kConfigError3;
    2004             }*/
    2005             // ======================
    20061988
    20071989            // Check configuration again when a new static data block
     
    20091991            fCounterStat = fFTM.GetCounter(FTM::kStaticData);
    20101992
    2011             // T::Info(" ==> TODO: Update run in database!");
    2012             T::Message("Sending new configuration was successfull.");
     1993            // This is also displayed when the ratecontrol sends its configuration...
     1994            if (T::GetCurrentState()==FTM::State::kConfiguring2)
     1995                T::Message("Sending new configuration was successfull.");
     1996            else
     1997                T::Message("Configuration successfull updated.");
    20131998
    20141999            // Next state is: wait for the answer to our configuration
Note: See TracChangeset for help on using the changeset viewer.