-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPatientShiftConverter.txt
48 lines (48 loc) · 2.19 KB
/
PatientShiftConverter.txt
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
//calculate image path from shift
var shift = value as PatientShiftModel;
switch (shift.ShiftDirection)
{
//go through shift directions
case ShiftDirectionEnum.XDir:
if (Math.Abs(shift.Magnitude) < 0.01)
{
return null;
}
else if (shift.Magnitude < 0.0)
{
//get executing assembly path and couch direction from magnitude.
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Resources", "CouchLeft.jfif");
}
else
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Resources", "CouchRight.jfif");
}
case ShiftDirectionEnum.YDir:
if (Math.Abs(shift.Magnitude) < 0.01)
{
return null;
}
else if (shift.Magnitude < 0.0)
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Resources", "CouchDown.jfif");
}
else
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Resources", "CouchUp.jfif");
}
case ShiftDirectionEnum.ZDir:
if (Math.Abs(shift.Magnitude) < 0.01)
{
return null;
}
else if (shift.Magnitude < 0.0)
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Resources", "CouchOut.jfif");
}
else
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Resources", "CouchIn.jfif");
}
default:
return null;
}