示例#1
0
        public override Wrapper VisitExecution_step(PreposeGesturesParser.Execution_stepContext context)
        {
            var pose = GetPose(context.ID().GetText());

            if (context.motion_constraint() != null && context.hold_constraint() != null)
            {
                var restriction      = context.motion_constraint().GetText();
                var motionConstraint = Wrapper.Convert(restriction);
                var duration         = int.Parse(context.hold_constraint().NUMBER().GetText());
                return
                    (new Wrapper(
                         new ExecutionStep(
                             motionConstraint,
                             pose,
                             duration)));
            }
            if (context.motion_constraint() != null)
            {
                var restriction      = context.motion_constraint().GetText();
                var motionConstraint = Wrapper.Convert(restriction);
                return
                    (new Wrapper(
                         new ExecutionStep(
                             motionConstraint,
                             pose)));
            }

            if (context.hold_constraint() != null)
            {
                var duration = int.Parse(context.hold_constraint().NUMBER().GetText());
                return
                    (new Wrapper(
                         new ExecutionStep(
                             pose, duration)));
            }

            return(new Wrapper(new ExecutionStep(pose)));
        }