-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMetric.cs
90 lines (82 loc) · 2.35 KB
/
Metric.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
namespace TheraWii
{
[XmlInclude(typeof(TimeInRegion)), XmlInclude(typeof(TimeOutRegion)),
XmlInclude(typeof(TotalTime)), XmlInclude(typeof(CenterOfBalanceAverage)),
XmlInclude(typeof(CenterOfBalancePosition)), XmlInclude(typeof(Smoothness))]
public abstract class Metric
{
public static Metric[] GetPossibleMetrics()
{
return new Metric[] {
new TimeInRegion(),
new TimeOutRegion(),
new TotalTime(),
new CenterOfBalanceAverage(),
new CenterOfBalancePosition(),
new Smoothness()
};
}
public static int GetMetricIndex(Metric m)
{
if (m.GetType() == typeof(TimeInRegion))
return 0;
else if (m.GetType() == typeof(TimeOutRegion))
return 1;
else if (m.GetType() == typeof(TotalTime))
return 2;
else if (m.GetType() == typeof(CenterOfBalanceAverage))
return 3;
else if (m.GetType() == typeof(CenterOfBalancePosition))
return 4;
else if (m.GetType() == typeof(Smoothness))
return 5;
return 0;
}
}
public class TimeInRegion : Metric
{
public override string ToString()
{
return "Time In Region";
}
}
public class TimeOutRegion : Metric
{
public override string ToString()
{
return "Time Out Region";
}
}
public class TotalTime : Metric
{
public override string ToString()
{
return "Center of Balance Position";
}
}
public class CenterOfBalanceAverage : Metric
{
public override string ToString()
{
return "Center of Balance Average";
}
}
public class CenterOfBalancePosition : Metric
{
public override string ToString()
{
return "Center of Balance Position";
}
}
public class Smoothness : Metric
{
public override string ToString()
{
return "Smoothness";
}
}
}