Changeset 18382


Ignore:
Timestamp:
11/24/15 13:22:43 (9 years ago)
Author:
Daniela Dorner
Message:
added command SCREENSHOT, fixed bug in automatic parking
File:
1 edited

Legend:

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

    r18379 r18382  
    21802180    }
    21812181
     2182    int Screenshot(const EventImp &evt)
     2183    {
     2184        if (evt.GetSize()<2)
     2185        {
     2186            ostringstream msg;
     2187            msg << "Screenshot - Received event has " << evt.GetSize() << " bytes, but expected at least 2.";
     2188            T::Fatal(msg);
     2189            return T::kSM_FatalError;
     2190        }
     2191
     2192        if (evt.GetSize()==2)
     2193        {
     2194            ostringstream msg;
     2195            msg << "Screenshot - Filename missing.";
     2196            T::Error(msg);
     2197            return T::GetCurrentState();
     2198        }
     2199
     2200        T::Info("Screenshot initiated.");
     2201        Dim::SendCommandNB("TPOINT/SCREENSHOT", evt.GetData(), evt.GetSize());
     2202        return T::GetCurrentState();
     2203    }
     2204
    21822205    int SetLedBrightness(const EventImp &evt)
    21832206    {
     
    24872510        if (now>fSunRise)
    24882511        {
    2489             if (T::GetCurrentState()>State::kLocked)
     2512            if (T::GetCurrentState()==State::kParking)
     2513                return State::kParking;
     2514
     2515            if (T::GetCurrentState()>State::kLocked && T::GetCurrentState()!=StateMachineImp::kError)
    24902516                return Park();
    24912517
     
    27692795            (bind(&StateMachineDrive::TPoint, this))
    27702796            ("Take a TPoint");
     2797
     2798        T::AddEvent("SCREENSHOT", "B:1;C")
     2799            (bind(&StateMachineDrive::Screenshot, this, placeholders::_1))
     2800            ("Take a screenshot"
     2801             "|color[bool]:False if just the gray image should be saved."
     2802             "|name[string]:Filename");
    27712803
    27722804        T::AddEvent("SET_LED_BRIGHTNESS", "I:2")
Note: See TracChangeset for help on using the changeset viewer.