Changeset 12270 for trunk


Ignore:
Timestamp:
10/25/11 19:51:01 (13 years ago)
Author:
tbretz
Message:
Added the possibility to switch off the update interval.
File:
1 edited

Legend:

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

    r12254 r12270  
    5555    int16_t fRampTime;
    5656
    57     uint16_t fUpdateTime;
     57    uint32_t fUpdateTime;
    5858    uint16_t fSyncTime;
    5959
     
    504504        case kResetChannels:
    505505        case kCmdRead:
     506            HandleReceivedData(fBuffer, bytes_received, command, send_counter);
    506507            fWaitingForAnswer = false;
    507             HandleReceivedData(fBuffer, bytes_received, command, send_counter);
    508508            return;
    509509
     
    620620
    621621        if (!is_open())
     622            return;
     623
     624        if (fUpdateTime==0)
    622625            return;
    623626
     
    13101313    // -------------------------------------------------------------------
    13111314
    1312     void SetUpdateInterval(uint16_t val)
     1315    void SetUpdateInterval(uint32_t val)
    13131316    {
    13141317        fUpdateTime = val;
     
    16891692    int SetUpdateInterval(const EventImp &evt)
    16901693    {
    1691         if (!CheckEventSize(evt.GetSize(), "SetUpdateInterval", 2))
    1692             return false;
    1693 
    1694         fBias.SetUpdateInterval(evt.Get<int16_t>()<0 ? 0 : evt.Get<int16_t>());
     1694        if (!CheckEventSize(evt.GetSize(), "SetUpdateInterval", 4))
     1695            return false;
     1696
     1697        fBias.SetUpdateInterval(evt.Get<int32_t>()<0 ? 0 : evt.Get<uint32_t>());
    16951698
    16961699        return T::GetCurrentState();
     
    18251828
    18261829
    1827         T::AddEvent("SET_UPDATE_INTERVAL", "S:1")
     1830        T::AddEvent("SET_UPDATE_INTERVAL", "I:1")
    18281831            (bind(&StateMachineBias::SetUpdateInterval, this, placeholders::_1))
    18291832            ("Set the updat einterval how often the currents are requested"
     
    19972000        fBias.SetRampStep(step);
    19982001        fBias.SetRampTime(time);
    1999         fBias.SetUpdateInterval(conf.Get<uint16_t>("update-interval"));
     2002        fBias.SetUpdateInterval(conf.Get<uint32_t>("update-interval"));
    20002003        fBias.SetSyncDelay(conf.Get<uint16_t>("sync-delay"));
    20012004
     
    20762079        ("ramp-time",       var<uint16_t>(15),   "Delay between the answer of one ramping step and sending the next ramp command to all channels in milliseconds.")
    20772080        ("ramp-step",       var<uint16_t>(46),   "Maximum step in DAC counts during ramping (Volt = DAC*90/4096)")
    2078         ("update-interval", var<uint16_t>(3000), "Interval between two current requests in milliseconds")
     2081        ("update-interval", var<uint32_t>(3000), "Interval between two current requests in milliseconds")
    20792082        ("sync-delay",      var<uint16_t>(500),  "Delay between sending the inital 0's after a newly established connection to synchronize the output stream in milliseconds")
    20802083        ("volt-max-abs",    var<float>(75),      "Absolte upper limit for the voltage (in Volts)")
Note: See TracChangeset for help on using the changeset viewer.