wavelength 1.0.0
Loading...
Searching...
No Matches
forcefeedbackmgrmotoreffectoffcmd.h
Go to the documentation of this file.
1#pragma once
2
4#include "os/command.h"
5
12public:
19 ~OffCmd() override = default;
20
28 explicit OffCmd(MotorEffect *pEffect) : mEffect(pEffect) {
29 }
30
37 void Execute() override {
38 mEffect->SetActive(0);
39 mEffect->SetMotors(mEffect->GetController(), 0, 0);
40 }
41
42private:
43 MotorEffect *mEffect;
44};
Unit of work a Scheduler runs at a set time.
Definition command.h:13
Command that ends a MotorEffect once its duration has passed.
Definition forcefeedbackmgrmotoreffectoffcmd.h:11
OffCmd(MotorEffect *pEffect)
Construct the command of an effect.
Definition forcefeedbackmgrmotoreffectoffcmd.h:28
void Execute() override
Mark the effect as not running and stop the controller's motors.
Definition forcefeedbackmgrmotoreffectoffcmd.h:37
~OffCmd() override=default
Destroy the object.
MotorEffect(int nController, int nSmallMotor, int nBigMotor, int nDuration)
Construct an effect that is not running, with the command that ends it.