variables["FLICK_LEFT"] = generateFlickFunction(400, 200, 200, 200);
variables["FLICK_UP"] = generateFlickFunction(300, 600, 300, 200);
variables["FLICK_DOWN"] = generateFlickFunction(300, 200, 300, 600);
+
+ auto generateWheelTurnFunction = [&]() {
+ return EvaluationValueFunction{ [&](bool clockwise, int multiplicity) -> EvaluationValue {
+
+ if (multiplicity <= 0)
+ throw EvaluationFailure{} << "Invalid multiplicity (must be more that 0)";
+
+ auto delay = multiplicity > 1 ? 0.75 : 0;
+
+ executeOnMainThread([&]()
+ {
+ utils::generateWheelTurn(clockwise, multiplicity, delay);
+ });
+
+ int await = 1000 * (multiplicity * delay);
+ std::this_thread::sleep_for(std::chrono::milliseconds{ await });
+
+ return EvaluationValue{};
+ }, { {"clockwise", true}, {"multiplicity", 1} } };
+ };
+ variables["TURN_WHEEL"] = generateWheelTurnFunction();
}
class PredicateWaitInterface : public EvaluationValueWaitInterface