Example #1
0
        private BaseAction CreateAction(XmlReader reader, FulFillable lastToDoAble)
        {
            BaseAction action = null;

            var attributes  = GetAttributes(reader);
            var actionName  = attributes["name"];
            int repititions = 1;

            if (attributes.ContainsKey("repititions"))
            {
                repititions = int.Parse(attributes["repititions"]);
            }

            if (actionName == "hold")
            {
                action = new HoldAction(actionName, DB.StatisticType.action, null, double.Parse(attributes["value"]), lastToDoAble, settingsManager, feedback, PitchType.pitchDefault, repititions, statisticManager);
            }

            else if (actionName == "wait")
            {
                action = new WaitAction(actionName, DB.StatisticType.action, null, double.Parse(attributes["value"]), lastToDoAble, settingsManager, feedback, PitchType.pitchDefault, repititions, statisticManager);
            }

            if (lastToDoAble != null)
            {
                lastToDoAble.AddNext(action);
            }

            return(action);
        }
Example #2
0
        private Joint CreateJoint(XmlReader reader, FulFillable lastToDoAble)
        {
            var attributes = GetAttributes(reader);

            int repititions = 1;

            if (attributes.ContainsKey("repititions"))
            {
                repititions = int.Parse(attributes["repititions"]);
            }

            Joint joint = new Joint(attributes["name"], DB.StatisticType.joint, null, settingsManager, feedback, PitchType.pitchDefault, lastToDoAble, repititions, statisticManager);

            if (lastToDoAble != null)
            {
                lastToDoAble.AddNext(joint);
            }

            return(joint);
        }
Example #3
0
 public BaseJointValueBehaviour(double value, string unityObjectName, StatisticType statisticType, PatientJoint affectedJoint, PatientJoint activeJoint, PatientJoint passiveJoint, SettingsManager settingsManager, Feedback feedback, PitchType pitchType, FulFillable previous, int repetitions, WriteStatisticManager statisticManager) : base(unityObjectName, statisticType, affectedJoint, activeJoint, passiveJoint, settingsManager, feedback, pitchType, previous, repetitions, statisticManager)
 {
     this.initialValue = this.value = value;
 }
Example #4
0
 public DistanceValueBehaviour(double value, string unityObjectName, StatisticType statisticType, PatientJoint affectedJoint, PatientJoint activeJoint, PatientJoint passiveJoint, SettingsManager settingsManager, Feedback feedback, PitchType pitchType, FulFillable previous, int repetitions, WriteStatisticManager statisticManager) : base(value, unityObjectName, statisticType, affectedJoint, activeJoint, passiveJoint, settingsManager, feedback, pitchType, previous, repetitions, statisticManager)
 {
     logger.AddLogAppender <ConsoleAppender>();
 }
 public AngleValueBehaviour(double value, string unityObjectName, StatisticType statisticType, PatientJoint affectedJoint, PatientJoint activeJoint, PatientJoint childJoint, SettingsManager settingsManager, Feedback feedback, PitchType pitchType, FulFillable previous, int repetitions, WriteStatisticManager statisticManager) : base(value, unityObjectName, statisticType, affectedJoint, activeJoint, childJoint, settingsManager, feedback, pitchType, previous, repetitions, statisticManager)
 {
     this.tolerance = settingsManager.GetValue <int>("ingame", "angleTolerance");
     this.angle     = 0;
     this.minAngle  = initialValue - tolerance;
     this.maxAngle  = initialValue + tolerance;
 }
Example #6
0
 public HoldAction(string unityObjectName, StatisticType statisticType, PatientJoint affectedJoint, double value, FulFillable previous, SettingsManager settingsManager, Feedback feedback, PitchType pitchType, int repetitions, WriteStatisticManager statisticManager) : base(unityObjectName, statisticType, affectedJoint, value, previous, settingsManager, feedback, pitchType, repetitions, statisticManager)
 {
 }
 public EqualHeightBehaviour(string unityObjectName, StatisticType statisticType, PatientJoint affectedJoint, PatientJoint activeJoint, PatientJoint passiveJoint, SettingsManager settingsManager, Feedback feedback, PitchType pitchType, FulFillable previous, int repetitions, WriteStatisticManager statisticManager) : base(unityObjectName, statisticType, affectedJoint, activeJoint, passiveJoint, settingsManager, feedback, pitchType, previous, repetitions, statisticManager)
 {
     this.tolerance = settingsManager.GetValue <double>("ingame", "distanceTolerance");
 }
Example #8
0
 public BaseAction(string unityObjectName, StatisticType statisticType, PatientJoint affectedJoint, double value, FulFillable previous, SettingsManager settingsManager, Feedback feedback, PitchType pitchType, int repetitions, WriteStatisticManager statisticManager) : base(settingsManager, feedback, pitchType, unityObjectName, statisticType, affectedJoint, previous, repetitions, statisticManager)
 {
     this.type         = Types.action;
     this.initialValue = this.value = value;
     this.information  = Models.Model.GetModel <Models.ExerciseInformation>(unityObjectName).Order;
 }
        public BaseJointBehaviour(string unityObjectName, StatisticType statisticType, PatientJoint affectedJoint, PatientJoint activeJoint, Models.PatientJoint passiveJoint, SettingsManager settingsManager, Feedback feedback, PitchType pitchType, FulFillable previous, int repetitions, WriteStatisticManager statisticManager) : base(settingsManager, feedback, pitchType, unityObjectName, statisticType, affectedJoint, previous, repetitions, statisticManager)
        {
            this.type         = Types.behaviour;
            this.activeJoint  = activeJoint;
            this.passiveJoint = passiveJoint;

            this.information = Models.Model.GetModel <Models.ExerciseInformation>(unityObjectName).Order;
        }
Example #10
0
        private BaseJointBehaviour CreateJointBehaviour(XmlReader reader, FulFillable lastToDoAble, BaseJointBehaviour lastBehaviour)
        {
            BaseJointBehaviour behaviour = null;

            var attributes    = GetAttributes(reader);
            var behaviourName = attributes["is"];

            var active = patient.GetJointByName(((Joint)lastToDoAble).Name);

            int repititions = 1;

            if (attributes.ContainsKey("repititions"))
            {
                repititions = int.Parse(attributes["repititions"]);
            }

            if (attributes.ContainsKey("joint"))
            {
                var passive = patient.GetJointByName(attributes["joint"]);

                if (attributes.ContainsKey("value"))
                {
                    var value = double.Parse(attributes["value"]);

                    if (behaviourName == "distance")
                    {
                        behaviour = new DistanceValueBehaviour(value, behaviourName, DB.StatisticType.behaviour, active, active, passive, settingsManager, feedback, PitchType.pitchDistance, lastBehaviour, repititions, statisticManager);
                    }

                    else if (behaviourName == "on")
                    {
                        behaviour = new OnJointValueBehaviour(value, behaviourName, DB.StatisticType.behaviour, active, active, passive, settingsManager, feedback, PitchType.pitchOnJoint, lastBehaviour, repititions, statisticManager);
                    }
                }
                else
                {
                    if (behaviourName == "above")
                    {
                        behaviour = new AboveBehaviour(behaviourName, DB.StatisticType.behaviour, active, active, passive, settingsManager, feedback, PitchType.pitchHeight, lastBehaviour, repititions, statisticManager);
                    }
                    else if (behaviourName == "below")
                    {
                        behaviour = new BelowBehaviour(behaviourName, DB.StatisticType.behaviour, active, active, passive, settingsManager, feedback, PitchType.pitchHeight, lastBehaviour, repititions, statisticManager);
                    }
                    else if (behaviourName == "behind")
                    {
                        behaviour = new BehindBehaviour(behaviourName, DB.StatisticType.behaviour, active, active, passive, settingsManager, feedback, PitchType.pitchDepth, lastBehaviour, repititions, statisticManager);
                    }
                    else if (behaviourName == "before")
                    {
                        behaviour = new BeforeBehaviour(behaviourName, DB.StatisticType.behaviour, active, active, passive, settingsManager, feedback, PitchType.pitchDepth, lastBehaviour, repititions, statisticManager);
                    }
                    else if (behaviourName == "equalHeight")
                    {
                        behaviour = new EqualHeightBehaviour(behaviourName, DB.StatisticType.behaviour, active, active, passive, settingsManager, feedback, PitchType.pitchHeight, lastBehaviour, repititions, statisticManager);
                    }
                }
            }
            else if (attributes.ContainsKey("value"))
            {
                DB.PatientJoint childJoint = null;
                var             value      = double.Parse(attributes["value"]);

                if (attributes.ContainsKey("toChild"))
                {
                    childJoint = patient.GetJointByName(attributes["toChild"]);
                }
                else
                {
                    childJoint = patient.GetJointByName(active.KinectJoint.Children.First().Value.Name);
                }

                if (behaviourName == "angle")
                {
                    behaviour = new AngleValueBehaviour(value, behaviourName, DB.StatisticType.behaviour, active, active, childJoint, settingsManager, feedback, PitchType.pitchAngleValue, lastBehaviour, repititions, statisticManager);
                }
            }

            if (lastBehaviour != null)
            {
                lastBehaviour.AddNext(behaviour);
            }

            return(behaviour);
        }