SEExercise.h
1 /**************************************************************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 #pragma once
14 #include <biogears/cdm/patient/actions/SEPatientAction.h>
15 #include <biogears/schema/cdm/PatientActions.hxx>
16 #include <biogears/cdm/properties/SEScalar0To1.h>
17 #include <biogears/cdm/properties/SEScalarFrequency.h>
18 #include <biogears/cdm/properties/SEScalarLengthPerTime.h>
19 #include <biogears/cdm/properties/SEScalarMass.h>
20 #include <biogears/cdm/properties/SEScalarPower.h>
21 
22 namespace biogears {
23 class SEScalar;
24 
25 class BIOGEARS_API SEExercise : public SEPatientAction {
26 public:
27  enum ExerciseType {
32  NONE
33  };
34  struct SEGeneric {
37  };
38  struct SECycling {
42  };
43  struct SERunning {
47  };
51  };
52 
53  SEExercise();
58 
59  virtual ~SEExercise() override;
60 
61  static constexpr const char* TypeTag() { return "SEExercise"; };
62  const char* classname() const override { return TypeTag(); }
63 
64  virtual void Clear() override; //clear memory
65 
66  virtual bool IsValid() const override;
67  virtual bool IsActive() const override;
68 
69  virtual bool Load(const CDM::ExerciseData& in);
70 
71  virtual bool HasGenericExercise() const;
72  virtual bool HasCyclingExercise() const;
73  virtual bool HasRunningExercise() const;
74  virtual bool HasStrengthExercise() const;
75 
76  virtual CDM::ExerciseData* Unload() const override;
77 
78  virtual ExerciseType GetExerciseType() const;
79  virtual SEGeneric GetGenericExercise() const;
80  virtual SECycling GetCyclingExercise() const;
81  virtual SERunning GetRunningExercise() const;
82  virtual SEStrengthTraining GetStrengthExercise() const;
83 
84  virtual SEGeneric& GetGenericExercise();
85  virtual SECycling& GetCyclingExercise();
86  virtual SERunning& GetRunningExercise();
87  virtual SEStrengthTraining& GetStrengthExercise();
88 
89  virtual void SetGenericExercise(SEGeneric exercise);
90  virtual void SetRunningExercise(SERunning exercise);
91  virtual void SetCyclingExercise(SECycling exercise);
92  virtual void SetStrengthExercise(SEStrengthTraining exercise);
93 
94  virtual void ToString(std::ostream& str) const override;
95 
96 protected:
97  virtual void Unload(CDM::ExerciseData& data) const;
98  virtual bool LoadGeneric(const CDM::GenericExerciseData& in);
99  virtual bool LoadCycling(const CDM::CyclingExerciseData& in);
100  virtual bool LoadRunning(const CDM::RunningExerciseData& in);
101  virtual bool LoadStrength(const CDM::StrengthExerciseData& in);
102 
103 private:
109 
110 };
111 }
Definition: SEExercise.h:30
Class corresponding to the CyclingExerciseData schema type.
Definition: PatientActions.hxx:5453
Definition: SEScalarFrequency.h:36
Definition: SEScalar.h:33
static constexpr const char * TypeTag()
Definition: SEExercise.h:61
Definition: SEPatientAction.h:18
SEScalar0To1 InclineRun
Definition: SEExercise.h:45
SEScalarPower DesiredWorkRate
Definition: SEExercise.h:35
Definition: SEScalarMass.h:38
Class corresponding to the ExerciseData schema type.
Definition: PatientActions.hxx:5992
Definition: SEExercise.h:28
SEScalarMass WeightStrength
Definition: SEExercise.h:49
SEScalar RepsStrength
Definition: SEExercise.h:50
Definition: SEScalarLengthPerTime.h:38
const char * classname() const override
Definition: SEExercise.h:62
Definition: SEExercise.h:43
SEScalarFrequency CadenceCycle
Definition: SEExercise.h:39
SEScalarLengthPerTime SpeedRun
Definition: SEExercise.h:44
Definition: SEExercise.h:34
SEScalarMass AddedWeight
Definition: SEExercise.h:41
SECycling m_cyclingExercise
Definition: SEExercise.h:106
Definition: SEScalar0To1.h:17
Definition: SEScalarPower.h:38
Definition: SEExercise.h:29
SEScalar0To1 Intensity
Definition: SEExercise.h:36
Definition: SEExercise.h:25
SEGeneric m_genericExercise
Definition: SEExercise.h:105
SERunning m_runningExercise
Definition: SEExercise.h:107
SEScalarPower PowerCycle
Definition: SEExercise.h:40
Definition: SEExercise.h:31
SEStrengthTraining m_strengthExercise
Definition: SEExercise.h:108
ExerciseType
Definition: SEExercise.h:27
SEScalarMass AddedWeight
Definition: SEExercise.h:46
ExerciseType m_mode
Definition: SEExercise.h:104
Definition: SEExercise.h:48
Definition: SEElectricalCircuit.h:18
Class corresponding to the StrengthExerciseData schema type.
Definition: PatientActions.hxx:5761
Definition: SEExercise.h:38
Class corresponding to the RunningExerciseData schema type.
Definition: PatientActions.hxx:5145
Class corresponding to the GenericExerciseData schema type.
Definition: PatientActions.hxx:4898