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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
#include structs.h
bool check(float num1,float num2, int pipesize, string pipeType)
{
const float pi = 3.14159265358979;
int div = 180;
float value;
bool valCheck = true;
struct EMT
{
int pipesizeEmt;
float bendRadiusEmt;
float shoeDimensionEmt;
float conduitDimensionEmt;
float tailEmt;
};
EMT myemt[10][5] =
{ 12, 5.883, 2.973, 0.530, 48.000,
34, 6.000, 2.480, 0.692, 48.000,
100, 7.000, 2.990, 0.872, 48.000,
114, 8.500, 3.662, 1.133, 46.500,
112, 8.500, 3.662, 1.305, 46.500,
200, 9.250, 3.610, 1.648, 46.500,
212, 12.000, 4.180, 2.156, 46.500,
300, 16.000, 7.544, 2.625, 53.750,
312, 18.625, 7.518, 3.000, 53.750,
400, 20.875, 7.277, 3.375, 53.750
};
struct RIGID
{
int pipesizeR;
float bendRadiusR;
float shoeDimensionR;
float conduitDimensionR;
float tailR;
};
RIGID myrigid[10][5] =
{ 12, 5.950, 2.562, 0.875, 48.000,
34, 6.937, 3.264, 0.875, 48.000,
100, 7.000, 3.434, 1.165, 48.000,
114, 8.500, 4.111, 1.285, 48.000,
112, 8.500, 4.239, 1.530, 48.000,
200, 9.000, 4.314, 1.781, 48.000,
212, 12.000, 4.180, 2.000, 46.500,
300, 16.000, 7.544, 2.000, 53.750,
312, 18.625, 7.518, 2.500, 53.750,
400, 20.875, 7.277, 2.500, 53.750
};
if (pipeType == "EMT")
{
switch (pipesize)
{
case 12:
value = (((num1)) + (myemt[0][1].bendRadiusEmt*(num2*pi / div))) + myemt[0][4].tailEmt;
break;
case 34:
value = (((num1)) + (myemt[1][1].bendRadiusEmt*(num2*pi / div))) + myemt[1][4].tailEmt;
break;
case 100:
value = (((num1)) + (myemt[2][1].bendRadiusEmt*(num2*pi / div))) + myemt[2][4].tailEmt;
break;
case 114:
value = (((num1)) + (myemt[3][1].bendRadiusEmt*(num2*pi / div))) + myemt[3][4].tailEmt;
break;
case 112:
value = (((num1)) + (myemt[4][1].bendRadiusEmt*(num2*pi / div))) + myemt[4][4].tailEmt;
break;
case 200:
value = (((num1)) + (myemt[5][1].bendRadiusEmt*(num2*pi / div))) + myemt[5][4].tailEmt;
break;
case 212:
value = (((num1)) + (myemt[6][1].bendRadiusEmt*(num2*pi / div))) + myemt[6][4].tailEmt;
break;
case 300:
value = (((num1)) + (myemt[7][1].bendRadiusEmt*(num2*pi / div))) + myemt[7][4].tailEmt;
break;
case 312:
value = (((num1)) + (myemt[8][1].bendRadiusEmt*(num2*pi / div))) + myemt[8][4].tailEmt;
break;
case 400:
value = (((num1)) + (myemt[9][1].bendRadiusEmt*(num2*pi / div))) + myemt[9][4].tailEmt;
break;
}
}
else if (pipeType == "RIGID")
{
switch (pipesize)
{
case 12:
value = (((num1)) + (myrigid[0][1].bendRadiusR*(num2*pi / div))) + myrigid[0][4].tailR;
break;
case 34:
value = (((num1)) + (myrigid[1][1].bendRadiusR*(num2*pi / div))) + myrigid[1][4].tailR;
break;
case 100:
value = (((num1)) + (myrigid[2][1].bendRadiusR*(num2*pi / div))) + myrigid[2][4].tailR;
break;
case 114:
value = (((num1)) + (myrigid[3][1].bendRadiusR*(num2*pi / div))) + myrigid[3][4].tailR;
break;
case 112:
value = (((num1)) + (myrigid[4][1].bendRadiusR*(num2*pi / div))) + myrigid[4][4].tailR;
break;
case 200:
value = (((num1)) + (myrigid[5][1].bendRadiusR*(num2*pi / div))) + myrigid[5][4].tailR;
break;
case 212:
value = (((num1)) + (myrigid[6][1].bendRadiusR*(num2*pi / div))) + myrigid[6][4].tailR;
break;
case 300:
value = (((num1)) + (myrigid[7][1].bendRadiusR*(num2*pi / div))) + myrigid[7][4].tailR;
break;
case 312:
value = (((num1)) + (myrigid[8][1].bendRadiusR*(num2*pi / div))) + myrigid[8][4].tailR;
break;
case 400:
value = (((num1)) + (myrigid[9][1].bendRadiusR*(num2*pi / div))) + myrigid[9][4].tailR;
break;
}
// do some more stuff and then
//return bool
}
|