コード例 #1
0
        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;
        }
コード例 #2
0
        public FulFillable(string name, StatisticType dataType, PatientJoint affectedJoint, FulFillable previous, int repetitions, WriteStatisticManager statisticManager)
        {
            this.logger.AddLogAppender <ConsoleAppender>();

            this.name             = name;
            this.previous         = previous;
            this.repetitions      = this.initialRepetitions = repetitions;
            this.statisticManager = statisticManager;
            this.dataType         = dataType;
            this.affectedJoint    = affectedJoint;

            this.statisticData = AddStatisticData(dataType, affectedJoint);
        }
コード例 #3
0
ファイル: JointButton.cs プロジェクト: festeraddams/rahagame
        void OnEnable()
        {
            if (GameManager.ActivePatient != null)
            {
                this.button       = GetComponent <Button>();
                this.buttonColors = this.button.colors;

                this.joint = GameManager.ActivePatient.GetJointByName(this.name);
                States state = joint.Active ? States.active : States.inactive;
                this.buttonColors.normalColor      = colors[state];
                this.buttonColors.pressedColor     = state == States.active ? colors[States.specialActive] : colors[States.specialInactive];
                this.buttonColors.highlightedColor = state == States.active ? colors[States.specialActive] : colors[States.specialInactive];
                this.buttonColors.disabledColor    = state == States.active ? colors[States.specialActive] : colors[States.specialInactive];
                this.button.colors = this.buttonColors;
            }
        }
コード例 #4
0
        public GameObject CreateBodyObject(ulong id)
        {
            GameObject body         = new GameObject(GameManager.ActivePatient.Name);
            Material   boneMaterial = defaultBoneMaterial;

            for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
            {
                GameObject   jointObj      = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                PatientJoint patientJoint  = GameManager.ActivePatient.GetJointByName(jt.ToString());
                LineRenderer lr            = jointObj.AddComponent <LineRenderer>();
                Renderer     jointRenderer = jointObj.GetComponent <Renderer>();

                if (patientJoint.Active == false)
                {
                    jointRenderer.material = disabledJointMaterial;
                }
                else if (patientJoint.KinectJoint.Stressed)
                {
                    jointRenderer.material = stressedJointMaterial;
                }
                else
                {
                    jointRenderer.material = jointMaterial;
                }

                lr.SetVertexCount(2);
                lr.material = boneMaterial;
                lr.SetWidth(0.05f, 0.05f);

                jointObj.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
                jointObj.name             = jt.ToString();
                jointObj.transform.parent = body.transform;
            }

            return(body);
        }
コード例 #5
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>();
 }
コード例 #6
0
 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;
 }
コード例 #7
0
 public Joint(string name, StatisticType statisticType, PatientJoint affectedJoint, SettingsManager settingsManager, Feedback feedback, PitchType pitchType, FulFillable previous, int repetitions, WriteStatisticManager statisticManager) : base(settingsManager, feedback, pitchType, name, statisticType, affectedJoint, previous, repetitions, statisticManager)
 {
     this.type = Types.joint;
 }
コード例 #8
0
ファイル: HoldAction.cs プロジェクト: festeraddams/rahagame
 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)
 {
 }
コード例 #9
0
ファイル: Informable.cs プロジェクト: festeraddams/rahagame
 public Informable(SettingsManager settingsManager, Feedback feedback, PitchType pitchType, string name, StatisticType statisticType, PatientJoint affectedJoint, FulFillable previous, int repetitions, WriteStatisticManager statisticManager) : base(name, statisticType, affectedJoint, previous, repetitions, statisticManager)
 {
     this.database  = Database.Instance();
     this.feedback  = feedback;
     this.pitchType = pitchType;
 }
コード例 #10
0
ファイル: BaseAction.cs プロジェクト: festeraddams/rahagame
 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;
 }
コード例 #11
0
ファイル: Step.cs プロジェクト: festeraddams/rahagame
 public Step(string name, StatisticType statisticType, PatientJoint affectedJoint, BaseStep prevStep, int repetitions, WriteStatisticManager statisticManager) : base(name, statisticType, affectedJoint, prevStep, repetitions, statisticManager)
 {
     this.type = Types.step;
 }
コード例 #12
0
ファイル: BaseStep.cs プロジェクト: festeraddams/rahagame
 public BaseStep(string unityObjectName, StatisticType statisticType, PatientJoint affectedJoint, FulFillable previous, int repetitions, WriteStatisticManager statisticManager) : base(unityObjectName, statisticType, affectedJoint, previous, repetitions, statisticManager)
 {
     this.unityObjectName = unityObjectName;
 }
コード例 #13
0
ファイル: Exercise.cs プロジェクト: festeraddams/rahagame
 public Exercise(string name, StatisticType statisticType, PatientJoint affectedJoint, FulFillable previous, int repetitions, WriteStatisticManager statisticManager) : base(name, statisticType, affectedJoint, previous, repetitions, statisticManager)
 {
 }
コード例 #14
0
 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");
 }
コード例 #15
0
 private StatisticData AddStatisticData(StatisticType dataType, PatientJoint affectedJoint)
 {
     return(statisticManager.AddStatistic(name, dataType, StatisticStates.unfulfilled, "", affectedJoint));
 }
コード例 #16
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;
 }
コード例 #17
0
ファイル: StepGroup.cs プロジェクト: festeraddams/rahagame
 public StepGroup(string description, StatisticType statisticType, PatientJoint affectedJoint, BaseStep previous, int repetitions, WriteStatisticManager statisticManager) : base(description, statisticType, affectedJoint, previous, repetitions, statisticManager)
 {
 }
コード例 #18
0
        public StatisticData AddStatistic(string name, StatisticType dataType, StatisticStates state, string message, PatientJoint affectedJoint)
        {
            var statistic = new StatisticData(date, name, dataType, state, message, affectedJoint, GameManager.ActiveExercise, GameManager.ActivePatient);

            GameManager.ActivePatient.CurrentStatistic.Add(statistic);

            return(statistic);
        }