HoloLens 2 Gait Training
The purpose of this project is to create gait training application.
Loading...
Searching...
No Matches
ISONoise.cs
Go to the documentation of this file.
1using Microsoft.MixedReality.Toolkit.UI;
2
6public class ISONoise : BaseNoiseClass
7{
8
15 protected override void Awake()
16 {
17 base.Awake();
18 m_DistributionButton.GetComponent<Interactable>().IsEnabled = false;
19 }
20
24 protected override void SetUITextVisibility()
25 {
26 m_MeanPeriodLabel.gameObject.SetActive(false);
27 m_SDPeriodLabel.gameObject.SetActive(false);
28 m_SampleSizeLabel.gameObject.SetActive(true);
29 m_PreferredSpeedLabel.gameObject.SetActive(true);
30 }
31
36 protected override void CalculateBaseNoise()
37 {
38 // No need to implement this method here.
39 }
40
45 public override void ApplyPattern()
46 {
48 bool noiseAppliedState = ( m_PreferredWalkingSpeed > m_DefaultISOWalkSpeed ) ? true : false;
49 SetReadyMessage( noiseAppliedState, "ISO" );
50 }
51
56 public override void CanclePattern()
57 {
58 m_NoiseAppliedFlag = false;
59 m_Title.text = "Pattern reset to default speed ";
60 m_ApplyButton.GetComponent<Interactable>().IsToggled = false;
61 }
62
66 protected override void CalculateNoise()
67 {
70
71 for( int i = 0; i < m_SampleSize; ++i )
72 {
74 }
75 }
76}
TextMeshPro m_PreferredSpeedLabel
TextMeshPro m_SDPeriodLabel
GameObject m_ApplyButton
int m_SampleSize
Defines how many samples we want.
TextMeshPro m_MeanPeriodLabel
We get the value from these text labels.
List< float > m_NoiseValueList
This list stores the calculated colored noise values.
bool m_NoiseAppliedFlag
This flag will indicate we applied or cancel the noise to animations.
TextMeshPro m_SampleSizeLabel
double ExtractDecimalFromUI(string textFromUI)
Get the number part from the UI textfields.
float m_PreferredWalkingSpeed
Hold the user's preferred walking speed.
void SetReadyMessage(bool flag, string lbl)
Indicate noise is successgully applied or not.
GameObject m_DistributionButton
const float m_DefaultISOWalkSpeed
Default ISO preferred walking speed.
Apply a constant speed for the whole walk cycle.
Definition: ISONoise.cs:7
override void CalculateNoise()
Calculate the ISO noise.
Definition: ISONoise.cs:66
override void Awake()
This UI only has one field and there is no need for a Distribution Button. Therefore,...
Definition: ISONoise.cs:15
override void CanclePattern()
Cancel the current noise pattern and reset it with default speed. Mapped to NoiseDataPanel CancelPatt...
Definition: ISONoise.cs:56
override void ApplyPattern()
Calculate the noise according to the user input. Mapped to NoiseDataPanel ApplyPattern button.
Definition: ISONoise.cs:45
override void CalculateBaseNoise()
We don't need this method for this class. This is just a dummy implementation.
Definition: ISONoise.cs:36
override void SetUITextVisibility()
Change the visibility of the text fields according to the noise patterns.
Definition: ISONoise.cs:24