
CString ShowCompare(double d1, double d2)
{
	if(fabs(d1 - d2) < 0.0001)
		return "=";

	if(d1 < d2)
		return "<";

	return ">";
}

void ShowWrong(CString sKey)
{
	font(sKey, "color", 6);	
	font(sKey, "粗", 1);
	font(sKey, "大", 23);
}

//钢筋和混凝土指标

//得到钢筋fy
//参见《混凝土结构设计规范》表4.2.3-1 普通钢筋强度设计值(N/mm2)
//nRf = 2; //人防构件
int r2f(int nG, double &fy, double &dEs, int nRf = 1);
int r2f(int nG, double &fy, double &dEs, int nRf)
{
	int nRet = 0;

	//HPB235
	fy = 210;
	dEs = 21000;

	double dS = 1.0;
	
	if(nG==235)
	{
		fy = 210;
		dS = 1.5;
		dEs = 210000;
		nRet = 1;
	}

	//HRB335
	if(nG==335)
	{
		fy = 300;
		dS = 1.35;
		dEs = 200000;
		nRet = 1;
	}

	//HRB400
	if(nG==400)
	{
		fy = 360;
		dS = 1.2;
		dEs = 200000;
		nRet = 1;
	}
	
	if(nRf==2)
		fy=fy*dS;
	
	return nRet;
}

double r2fy(int nG, int nRf = 1);
double r2fy(int nG, int nRf)
{
	double fy = 0.0;
	double dEs = 0.0;
	r2f(nG, fy, dEs, nRf);
	return fy;
}

double r2Es(int nG, int nRf = 1);
double r2Es(int nG, int nRf)
{
	double fy = 0.0;
	double dEs = 0.0;
	r2f(nG, fy, dEs, nRf);
	return dEs;
}

//混凝土强度
//参见《混凝土结构设计规范》混凝土轴心抗压轴心抗拉强度标准值fck、dEc 应按表4.1.3采 用
int c2f(int nG, double &fc, double &ft, double &dEc)
{
	int nRet = 0;

	//fc= N/mm^2
	//ft= N/mm^2
	//dEc= N/mm^2

	//C20
	fc=9.6;
	ft=1.1;
	dEc=25500;

	if(nG == 20)
		nRet = 1;
	
	if(nG==25)
	{
		fc=11.9;
		ft=1.27;
		dEc=28000;
		nRet = 1;
	}
	if(nG==30)
	{
		fc=14.3;
		ft=1.43;
		dEc=30000;
		nRet = 1;
	}
	if(nG==35)
	{
		fc=16.7;
		ft=1.57;
		dEc=31500;
		nRet = 1;
	}

	if(nG==40)
	{
		fc==19.1;
		ft=1.71;
		dEc=32500;
		nRet = 1;
	}
	if(nG==45)
	{
		fc==21.1;
		ft=1.8;
		fc==33500;
		nRet = 1;
	}
	if(nG==50)
	{
		fc==23.1;
		ft=1.89;
		fc=34500;
		nRet = 1;
	}
	if(nG==55)
	{
		fc==25.3;
		ft=1.96;
		fc=35500;
		nRet = 1;
	}

	return nRet;
}

double c2fc(int nG)
{
	double fc, ft, dEc;
	c2f(nG, fc, ft, dEc);
	return fc;
}

double c2ft(int nG)
{
	double fc, ft, dEc;
	c2f(nG, fc, ft, dEc);
	return ft;
}

double c2Ec(int nG)
{
	double fc, ft, dEc;
	c2f(nG, fc, ft, dEc);
	return dEc;
}

//βc＝ 砼强度系数 1.0<C50<内插<C80<0.8
double c2Bc(int CC)
{
	double B6=1;//IF(CC<50,1,IF(CC<80,(CC-50)*(0.8-1)/(80-50)+1,0.8));
	if(CC >= 80) 
		B6 = 0.8;
	else if(CC > 50 && CC < 80)
		B6 = (CC - 50) * (0.8 - 1) / (80-50)+1;

	return B6;
}

//α1＝ 受压区等效 0.8<C50<内插<C80<0.74
double c2A1(int CC)
{
	double dA1=1;//IF(CC<50,1,IF(CC<80,(CC-50)*(0.94-1)/(80-50)+1,0.94));
	if(CC >= 80) 
		dA1 = 0.94;
	else if(CC > 50 && CC < 80)
		dA1 = (CC - 50) * (0.94 - 1) / (80-50)+1;
	return dA1;
}

//β1＝ 矩形应力系数
double c2B1(int CC)
{
	double B11=0.8;//IF(CC<50,0.8,IF(CC<80,(CC-50)*(0.74-0.8)/(80-50)+0.8,0.74));
	if(CC >= 80) 
		B11 = 0.74;
	else if(CC > 50 && CC < 80)
		B11 = (CC - 50) * (0.74 - 0.8) / (80-50)+0.8;
	return B11;
}
