-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBridge.m
executable file
·65 lines (51 loc) · 1.88 KB
/
Bridge.m
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
#import "Bridge.h"
#import "psychrometrics.cpp"
@implementation MyPsychro (Bridge)
- (id) process: (MyPsychro *) type
{
a = [self drybulbtemp];
j = [type flag];
//printf("%i", j);
switch ( j )
{
case 1 :
wetbulbtemp = [type wetbulbtemp];
pressure = [type pressure];
dewpointtemp = GetTDewPointFromTWetBulb(a,wetbulbtemp,pressure);
relhumidity = GetRelHumFromTWetBulb(a,wetbulbtemp,pressure);
humratio = GetHumRatioFromTWetBulb(a,wetbulbtemp,pressure);
specvol = GetMoistAirVolume(a,humratio,pressure);
degreeofsat = GetDegreeOfSaturation(a,humratio,pressure);
enthalpy = GetMoistAirEnthalpy(a,humratio);
vappress = GetVapPresFromHumRatio(humratio,pressure);
break;
case 2 :
dewpointtemp = [type dewpointtemp];
pressure = [type pressure];
wetbulbtemp = GetTWetBulbFromTDewPoint(a,dewpointtemp,pressure);
relhumidity = GetRelHumFromTWetBulb(a,wetbulbtemp,pressure);
humratio = GetHumRatioFromTWetBulb(a,wetbulbtemp,pressure);
specvol = GetMoistAirVolume(a,humratio,pressure);
degreeofsat = GetDegreeOfSaturation(a,humratio,pressure);
enthalpy = GetMoistAirEnthalpy(a,humratio);
vappress = GetVapPresFromHumRatio(humratio,pressure);
break;
case 3 :
relhumidity = [type relhumidity];
pressure = [type pressure];
dewpointtemp = GetTDewPointFromRelHum(a,relhumidity);
wetbulbtemp = GetTWetBulbFromTDewPoint(a,dewpointtemp,pressure);
humratio = GetHumRatioFromTWetBulb(a,wetbulbtemp,pressure);
specvol = GetMoistAirVolume(a,humratio,pressure);
degreeofsat = GetDegreeOfSaturation(a,humratio,pressure);
enthalpy = GetMoistAirEnthalpy(a,humratio);
vappress = GetVapPresFromHumRatio(humratio,pressure);
break;
}
//b = [type relhumidity];
//printf( "%4.2f\n", a);
//printf( "%4.2f\n", b);
//return [self type:GetTDewPointFromRelHum(a,b)];
return self;
}
@end