Changeset 12252 for trunk


Ignore:
Timestamp:
10/23/11 19:43:03 (13 years ago)
Author:
tbretz
Message:
Added commands to set LED brightness.
File:
1 edited

Legend:

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

    r11837 r12252  
    307307            tpoint.fRealMag = mag;
    308308
     309            UpdteTPoint(t1, tpoint);
     310
    309311            return;
    310312        }
     
    661663        return SendCommand(command);
    662664    }
     665
     666    int SetLedBrightness(const EventImp &evt)
     667    {
     668        if (!CheckEventSize(evt.GetSize(), "SetLedBrightness", 8))
     669            return T::kSM_FatalError;
     670
     671        const uint32_t *led = evt.Ptr<uint32_t>();
     672
     673        ostringstream cmd;
     674        cmd << "LEDS " << led[0] << " " << led[1];
     675        return SendCommand(cmd.str());
     676    }
     677
    663678
    664679    int SetVerbosity(const EventImp &evt)
     
    800815        T::AddEvent("TPOINT")
    801816            (bind(&StateMachineDrive::SendCommand, this, "TPOIN FACT 0"))
     817            ("");
     818
     819        T::AddEvent("SET_LED_BRIGHTNESS", "I:2")
     820            (bind(&StateMachineDrive::SetLedBrightness, this, placeholders::_1))
     821            ("");
     822
     823        T::AddEvent("LEDS_OFF")
     824            (bind(&StateMachineDrive::SendCommand, this, "LEDS 0 0"))
    802825            ("");
    803826
Note: See TracChangeset for help on using the changeset viewer.