CommandData GestureHoldModeAction::getAction(angleData ad) { if (actionMap.find(ad.hash()) == actionMap.end()) { CommandData retVal; retVal.setType(commandType::NONE); return retVal; } return actionMap[ad.hash()]; }
SequenceStatus GestureSeqRecorder::progressSequence(Pose::Type gesture, ControlState state, CommandData& response) { SequenceStatus status = SequenceStatus::SUCCESS; response.setType(commandType::NONE); prevPose = gesture; if (activeSequences.size() != 0) { status = ensureSameState(state); if (status == SequenceStatus::SUCCESS) { status = progressActiveSequences(gesture, state, response); } } else { status = findActivation(gesture, state, response); if (state.getMode() != prevState) { updateGuiSequences(); } prevState = state.getMode(); } if (response.getType() != commandType::NONE || status != SequenceStatus::SUCCESS) { // if the response is not NONE, a sequence has completed. Therefore all // active sequences must be cleared so that all valid sequences can potentially // be started. emptyActiveSequences(); if (response.getType() != commandType::NONE) { std::cout << "GestureSeqRecorder returning a registered response." << std::endl; } } return status; }