Changeset 14372 for trunk


Ignore:
Timestamp:
08/14/12 12:30:05 (12 years ago)
Author:
tbretz
Message:
Fixed a few dimctrl issues related to the new version.
File:
1 edited

Legend:

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

    r14362 r14372  
    705705            return GetCurrentState();
    706706
    707         cout << d.GetQoS() << ": " << d.GetText() << endl;
    708 
    709707        if (d.GetQoS()==90)
    710708            HandleControlMessageImp(d);
     
    718716            return StateMachineImp::kSM_KeepState;
    719717
    720         // [0] DimControl::kReady (Idle)
    721         // [1] DimControl::kLoad
    722         // [2] DimControl::kStarted
    723         if (d.GetQoS()==1 && fDimControl.scriptdepth==0)
    724             fControlMessageHist.clear();
    725 
    726         // Not that this will also "ding" just after program startup
    727         // if the dimctrl is still in state -3
    728         if (fDimControl.last.second!=DimState::kOffline &&
    729             d.GetQoS()==0 && fDimControl.scriptdepth==0)
    730             SetAudio("ding");
     718        if (fDimControl.scriptdepth>0)
     719            return StateMachineImp::kSM_KeepState;
    731720
    732721        if (d.GetQoS()>=2)
     
    739728#endif
    740729
    741         HandleControlMessageImp(Event(d, fDimControl.shortmsg.data(), fDimControl.shortmsg.length()+1));
    742         if (!file.empty())
     730        // [0] DimControl::kReady (Idle)
     731        // [1] DimControl::kLoad
     732        // [2] DimControl::kStarted
     733        if (d.GetQoS()==1)
     734        {
     735            fControlMessageHist.clear();
     736            HandleControlMessageImp(Event(d, "========================================", 41));
     737        }
     738
     739        HandleControlMessageImp(Event(d, ("----- "+fDimControl.shortmsg+" -----").data(), fDimControl.shortmsg.length()+13));
     740        if (!file.empty() && d.GetQoS()<2)
    743741            HandleControlMessageImp(Event(d, file.data(), file.length()+1));
     742
     743        // Not that this will also "ding" just after program startup
     744        // if the dimctrl is still in state -3
     745        if (d.GetQoS()==0)
     746        {
     747            HandleControlMessageImp(Event(d, "========================================", 41));
     748            if (fDimControl.last.second!=DimState::kOffline)
     749                SetAudio("ding");
     750        }
    744751
    745752        return StateMachineImp::kSM_KeepState;
     
    18241831
    18251832        if (&state==&fDimControl)
    1826             return HTML::kGreen +'\t'+(state.state()<-2?"Idle":fDimControl.shortmsg)+'\n';
     1833            return HTML::kGreen +'\t'+(state.state()==0?"Idle":fDimControl.shortmsg)+'\n';
    18271834
    18281835        const State rc = state.description();
     
    25132520                }
    25142521        }
    2515         if (fDimDNS.online() && fDimDriveControl.state()==0x100)   // Armed, Moving, Tracking
    2516             out << " [ERR]";
     2522        if (fDimDNS.online() && fDimDriveControl.state()==0x100)
     2523            out << " <ERR>";
     2524        if (fDimDNS.online() && fDimDriveControl.state()==Drive::State::kLocked)
     2525            out << " &otimes;";
    25172526        out << '\n';
    25182527
     
    26512660
    26522661        out.str("");
    2653         out << Header(now) << '\t' << (fErrorList.size()>0) << '\t' << (fDimControl.state()>-3) << '\n';
     2662        out << Header(now) << '\t' << (fErrorList.size()>0) << '\t' << (fDimControl.state()>0) << '\n';
    26542663
    26552664        if (!fDimDNS.online())
Note: See TracChangeset for help on using the changeset viewer.