Changeset 14667 for trunk/FACT++/src


Ignore:
Timestamp:
11/20/12 10:28:49 (12 years ago)
Author:
tbretz
Message:
Correctly copy the state index even if no description is available; if new description arrive, update the list of current states.
File:
1 edited

Legend:

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

    r14662 r14667  
    297297{
    298298    fMutex.lock();
    299     const State state = dim->description();
    300     fCurrentStateList[server] = State(state.index, state.index==DimState::kNotAvailable?"":state.name, state.comment, state.time);
     299    const State descr = dim->description();
     300    const State state = State(dim->state(), descr.index==DimState::kNotAvailable?"":descr.name, descr.comment, dim->cur.first);
     301    fCurrentStateList[server] = state;
    301302    fMutex.unlock();
    302303
     
    317318{
    318319    fMutex.lock();
     320
     321    const auto is = fCurrentStateList.find(server);
    319322    for (auto it=dim->states.begin(); it!=dim->states.end(); it++)
     323    {
    320324        fStateDescriptionList[make_pair(server, it->index)] = make_pair(it->name, it->comment);
     325        if (is==fCurrentStateList.end())
     326            continue;
     327
     328        if (is->first==it->index)
     329        {
     330            is->second.name    = it->name;
     331            is->second.comment = it->comment;
     332        }
     333    }
     334
    321335    fMutex.unlock();
    322336
Note: See TracChangeset for help on using the changeset viewer.