#include "EpDevice.h"
#include "GlobalString.h"

unsigned int TEpDevice::GetInputModuleChannelCount(void)
{
	unsigned int i=0;
	/*i = (fData.Split.Flag & 0x03) +1;*/
	return i;
}
unsigned int TEpDevice::GetOutputModuleChannelCount(void)
{
	unsigned int i=0;
	/*i = (fData.Split.Flag & 0x03) +1;*/
	return i;	
}
unsigned int TEpDevice::GetInOutModuleInChannelCount(void)
{
	unsigned int i=0;
	/*i = (fData.Split.Flag & 0x01) +1;*/
	return i;
}
unsigned int TEpDevice::GetInOutModuleOutChannelCount(void)
{
	unsigned int i=0;
	/*if (fData.Split.Flag & 0x02)  i=2;
	else i =1;*/
	return i;
}

void TEpDevice::SetInputModuleChannelCount(unsigned int aCount)
{
	/*fData.Split.Flag &= ~0x03;
	if(aCount == 2)fData.Split.Flag &= ~0x03;
	else if(aCount == 3)fData.Split.Flag &= ~0x03;
	else if(aCount == 4)fData.Split.Flag &= ~0x03;*/
}
void TEpDevice::SetOutputModuleChannelCount(unsigned int aCount)
{
	/*fData.Split.Flag &= ~0x03;
	if(aCount == 2)fData.Split.Flag &= ~0x03;
	else if(aCount == 3)fData.Split.Flag &= ~0x03;
	else if(aCount == 4)fData.Split.Flag &= ~0x03;*/
}
void TEpDevice::SetInOutModuleInChannelCount(unsigned int aCount)
{
	/*if(aCount >1)fData.Split.Flag |= 0x01;*/
}
void TEpDevice::SetInOutModuleOutChannelCount(unsigned int aCount)
{
	/*if(aCount >1)fData.Split.Flag |= 0x02;*/
}

unsigned int TEpDevice::Calc_Addr4EpData(void)
{
	unsigned int addr=0;
	/*unsigned int PortNum, EpNum;
	PortNum = static_cast<unsigned int>(fData.Split.PortNum);
	EpNum = static_cast<unsigned int>(fData.Split.Id);*/
	//addr = dAddr_Flash_EpData + (PortNum * 16 * 256) + (EpNum * 16);
	return addr;
}

unsigned int TEpDevice::Calc_Addr4EpDataPage(void)
{
	unsigned int addr=0;
	/*unsigned int PortNum, EpNum;
	PortNum = static_cast<unsigned int>(fData.Split.PortNum);
	EpNum = static_cast<unsigned int>(fData.Split.Id);
	//addr = dAddr_Flash_EpData + (PortNum * 16 * 256) + (EpNum * 16);
	addr = addr & 0xFFFFFF00;*/
	return addr;
}

unsigned int TEpDevice::Calc_Addr4EpDataSector(void)
{
	unsigned int addr =0;
	/*unsigned int PortNum, EpNum;
	PortNum = static_cast<unsigned int>(fData.Split.PortNum);
	EpNum = static_cast<unsigned int>(fData.Split.Id);
	//addr = dAddr_Flash_EpData + (PortNum * 16 * 256) + (EpNum * 16);
	addr = addr & 0xFFFFF000;*/
	return addr;
}

unsigned int TEpDevice::Calc_D4K_PageIndex(void)
{
	unsigned int Index =0;
	/*unsigned int PortNum, EpNum;
	PortNum = static_cast<unsigned int>(fData.Split.PortNum);
	EpNum = static_cast<unsigned int>(fData.Split.Id);
	Index = ((PortNum * 16 * 256) + (EpNum * 16)) / 256;*/
	return Index;
}

void TEpDevice::Copy_DataFrom4KData(unsigned int *D4K)
{
	/*unsigned int start;
	unsigned int EpNum;
	EpNum = static_cast<unsigned int>(fData.Split.Id);
	start = (EpNum * 16) / 4;*/
}

void TEpDevice::Write_DataTo4KData(unsigned int *D4K)
{
	/*unsigned int start;
	unsigned int EpNum;
	EpNum = static_cast<unsigned int>(fData.Split.Id);
	start = (EpNum * 16) / 4;*/
}


//smoke
//const char cPrmSensitivity[8] = {"灵敏度"};
//const char cPrmTH[8] = {"上阀值"};
//const char cPrmTL[8] = {"下阀值"};
//const char cPrmPollute[8] = {"污染度"};

//tempe
//const char cPrmAlarm[8] = {"报警值"};
//const char cPrmWarn[8]  = {"预警值"};
//const char cPrmHoldTime[8] = {"时间值"};

void TEpDevice::PrintProperty(TMyString *Str0, TMyString *Str1, TMyString *Str2)
{
	//Str0->FromUInt6Dg(fData.Split.UserCode);
	/*Str1->FromUInt3Dg(fData.Split.Id);
	Str2->FromStr(StrType[fData.Split.dType]);*/
}


void TEpDevice::PrintAttribute(TMyString *Str0, TMyString *Str1, TMyString *Str2, TMyString *Str3)
{
	/*switch(fData.Split.dType){
		case 	dgTYPE_SMOKE_DETECTOR:
			//Str0->FromStr("灵敏度");
		//		Str0->FromUInt3Dg(fPrm.Smoke.Sensitivity);
			//Str1->FromStr("上阀值");
		//		Str1->FromUInt3Dg(fPrm.Smoke.UpPoint);
			//Str2->FromStr("下阀值");
		//		Str2->FromUInt3Dg(fPrm.Smoke.DownPoint);
			//Str3->FromStr("污染度");
		//		Str3->FromUInt3Dg(fPrm.Smoke.Pollute);
			break;
			
		case  dgTYPE_TEMPE_DETECTOR:
			//Str0->FromStr("报警值");
		//		Str0->FromUInt3Dg(fPrm.Tempe.AlarmPoint);
			//Str1->FromStr("预警值");
		//		Str1->FromUInt3Dg(fPrm.Tempe.WarningPoint);
			//Str2->FromStr("时间值");
		//		Str2->FromUInt3Dg(fPrm.Tempe.HoldTime_100mS);
			break;
			
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_I:
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_II:
			//Str0->FromStr("灵敏度");
		//		Str0->FromUInt3Dg(fPrm.SmokeTempe.Sensitivity);
			//Str1->FromStr("污染度");
		//		Str1->FromUInt3Dg(fPrm.SmokeTempe.Pollute);
			//Str2->FromStr("报警值");
		//		Str2->FromUInt3Dg(fPrm.SmokeTempe.AlarmPoint);
			//Str3->FromStr("时间值");
		//		Str3->FromUInt3Dg(fPrm.SmokeTempe.HoldTime_100mS);
		//	break;
			
		case  dgTYPE_HAND_REPORT:
			
			break;
		case  dgTYPE_IN_MODULE:
			
			break;
		case  dgTYPE_OUT_MODULE:
			
			break;
		case  dgTYPE_INOUT_MODULE_NonSource:
		case  dgTYPE_INOUT_MODULE_Source:
			
			break;
		case  dgType_VAALRAM:
			
			break;
		//case  dgTYPE_BUS_BROKE:
			
		///	break;
			
		case	dgTYPE_DISPLAY_PAD:		

			break;
	}*/
}

void TEpDevice::PrintAttribute(TMyString *Str0, TMyString *Str1, TMyString *Str2, TMyString *Str3, TMyString *Str4, TMyString *Str5, TMyString *Str6, TMyString *Str7 )
{
	/*switch(fData.Split.dType){
		case 	dgTYPE_SMOKE_DETECTOR:
			//Str0->FromStr("灵敏度");
			//	Str0->FromUInt3Dg(fPrm.Smoke.Sensitivity);
			//Str1->FromStr("上阀值");
			//	Str1->FromUInt3Dg(fPrm.Smoke.UpPoint);
			//Str2->FromStr("下阀值");
			//	Str2->FromUInt3Dg(fPrm.Smoke.DownPoint);
			//Str3->FromStr("污染度");
			//	Str3->FromUInt3Dg(fPrm.Smoke.Pollute);
			break;
			
		case  dgTYPE_TEMPE_DETECTOR:
			//Str0->FromStr("报警值");
			//	Str0->FromUInt3Dg(fPrm.Tempe.AlarmPoint);
			//Str1->FromStr("预警值");
			//	Str1->FromUInt3Dg(fPrm.Tempe.WarningPoint);
			//Str2->FromStr("时间值");
			//	Str2->FromUInt3Dg(fPrm.Tempe.HoldTime_100mS);
			break;
			
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_I:
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_II:
			//Str0->FromStr("灵敏度");
			//	Str0->FromUInt3Dg(fPrm.SmokeTempe.Sensitivity);
			//Str1->FromStr("上阀值");
			//	Str1->FromUInt3Dg(fPrm.SmokeTempe.UpPoint);
			//Str2->FromStr("下阀值");
			//	Str2->FromUInt3Dg(fPrm.SmokeTempe.DownPoint);
			//Str3->FromStr("污染度");
			//	Str3->FromUInt3Dg(fPrm.SmokeTempe.Pollute);
			//Str4->FromStr("报警值");
			//	Str4->FromUInt3Dg(fPrm.SmokeTempe.AlarmPoint);
			//Str5->FromStr("预警值");
			//	Str5->FromUInt3Dg(fPrm.SmokeTempe.WarningPoint);
			//Str6->FromStr("时间值");
			//	Str6->FromUInt3Dg(fPrm.SmokeTempe.HoldTime_100mS);
			//break;
			
		case  dgTYPE_HAND_REPORT:
			
			break;
		case  dgTYPE_IN_MODULE:
			
			break;
		case  dgTYPE_OUT_MODULE:
			
			break;
		case  dgTYPE_INOUT_MODULE_NonSource:
		case  dgTYPE_INOUT_MODULE_Source:
			
			break;
		case  dgType_VAALRAM:
			
			break;
		//case  dgTYPE_BUS_BROKE:
			
		//	break;
			
			
		case	dgTYPE_DISPLAY_PAD:	

			break;
	}*/
}



void TEpDevice::PrintAttributeWithAName(TMyString *Str0, TMyString *Str1, TMyString *Str2, TMyString *Str3)
{
	/*switch(fData.Split.dType){
		case 	dgTYPE_SMOKE_DETECTOR:
			Str0->FromStr("灵敏度");
			//	Str0->AddOn3Dg(fPrm.Smoke.Sensitivity);
			Str1->FromStr("报警点");
			//	Str1->AddOn3Dg(fPrm.Smoke.UpPoint);
			Str2->FromStr("下阀值");
			//	Str2->AddOn3Dg(fPrm.Smoke.DownPoint);
			Str3->FromStr("污染度");
			//	Str3->AddOn3Dg(fPrm.Smoke.Pollute);
			break;
			
		case  dgTYPE_TEMPE_DETECTOR:
			Str0->FromStr("报警值");
			//	Str0->AddOn3Dg(fPrm.Tempe.AlarmPoint);
			Str1->FromStr("预警值");
			//	Str1->AddOn3Dg(fPrm.Tempe.WarningPoint);
			Str2->FromStr("时间值");
			//	Str2->AddOn3Dg(fPrm.Tempe.HoldTime_100mS);
			break;
			
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_I:
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_II:
		//	Str0->FromStr("报警点");
		//		Str0->AddOn3Dg(fPrm.SmokeTempe.UpPoint);
		//	Str1->FromStr("污染度");
		//		Str1->AddOn3Dg(fPrm.SmokeTempe.Pollute);
		//	Str2->FromStr("报警值");
		//		Str2->AddOn3Dg(fPrm.SmokeTempe.AlarmPoint);
		//	Str3->FromStr("延时");
		//		Str3->AddOn3Dg(fPrm.SmokeTempe.HoldTime_100mS);
		//	break;
			
		case  dgTYPE_HAND_REPORT:
			
			break;
		case  dgTYPE_IN_MODULE:
			
			break;
		case  dgTYPE_OUT_MODULE:
			
			break;
		case  dgTYPE_INOUT_MODULE_NonSource:
		case  dgTYPE_INOUT_MODULE_Source:
			
			break;
		case  dgType_VAALRAM:
			
			break;
		//case  dgTYPE_BUS_BROKE:
			
		//	break;
			
			
		case	dgTYPE_DISPLAY_PAD:		

			break;
	}*/
}

void TEpDevice::PrintAttributeWithAName(TMyString *Str0, TMyString *Str1, TMyString *Str2, TMyString *Str3, TMyString *Str4, TMyString *Str5, TMyString *Str6, TMyString *Str7 )
{
	/*switch(fData.Split.dType){
		case 	dgTYPE_SMOKE_DETECTOR:
			Str0->FromStr("灵敏度");
			//	Str0->AddOn3Dg(fPrm.Smoke.Sensitivity);
			Str1->FromStr("上阀值");
			//	Str1->AddOn3Dg(fPrm.Smoke.UpPoint);
			Str2->FromStr("下阀值");
			//	Str2->AddOn3Dg(fPrm.Smoke.DownPoint);
			Str3->FromStr("污染度");
			//	Str3->AddOn3Dg(fPrm.Smoke.Pollute);
			break;
			
		case  dgTYPE_TEMPE_DETECTOR:
			Str0->FromStr("报警值");
			//	Str0->AddOn3Dg(fPrm.Tempe.AlarmPoint);
			Str1->FromStr("预警值");
			//	Str1->AddOn3Dg(fPrm.Tempe.WarningPoint);
			Str2->FromStr("时间值");
			//	Str2->AddOn3Dg(fPrm.Tempe.HoldTime_100mS);
			break;
			
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_I:
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_II:
		//	Str0->FromStr("灵敏度");
		//		Str0->AddOn3Dg(fPrm.SmokeTempe.Sensitivity);
		//	Str1->FromStr("上阀值");
		//		Str1->AddOn3Dg(fPrm.SmokeTempe.UpPoint);
		//	Str2->FromStr("下阀值");
		//		Str2->AddOn3Dg(fPrm.SmokeTempe.DownPoint);
		//	Str3->FromStr("污染度");
		//		Str3->AddOn3Dg(fPrm.SmokeTempe.Pollute);
		//	Str4->FromStr("报警值");
		//		Str4->AddOn3Dg(fPrm.SmokeTempe.AlarmPoint);
		//	Str5->FromStr("预警值");
		//		Str5->AddOn3Dg(fPrm.SmokeTempe.WarningPoint);
		//	Str6->FromStr("时间值");
		//		Str6->AddOn3Dg(fPrm.SmokeTempe.HoldTime_100mS);
		//	break;
			
		case  dgTYPE_HAND_REPORT:
			
			break;
		case  dgTYPE_IN_MODULE:
			
			break;
		case  dgTYPE_OUT_MODULE:
			
			break;
		case  dgTYPE_INOUT_MODULE_NonSource:
		case  dgTYPE_INOUT_MODULE_Source:
			
			break;
		case  dgType_VAALRAM:
			
			break;
		//case  dgTYPE_BUS_BROKE:
			
		//	break;
			
			
		case	dgTYPE_DISPLAY_PAD:	

			break;
	}*/
}


void TEpDevice::PrintSensitivity(TMyString *Str0)
{
	/*switch(fData.Split.dType){
		case 	dgTYPE_SMOKE_DETECTOR:
			//	Str0->FromUInt3Dg(fPrm.Smoke.Sensitivity);
				break;
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_I:
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_II:
		//		Str0->FromUInt3Dg(fPrm.SmokeTempe.Sensitivity);
		//		break;

	}*/
}

void TEpDevice::PrintDynamicsData(TMyString *Str0, TMyString *Str1, TMyString *Str2, TMyString *Str3, TMyString *Str4, TMyString *Str5)
{
	/*switch(fData.Split.dType){
		case 	dgTYPE_SMOKE_DETECTOR:
			//Str0->FromUInt4Dg(fPrm.Smoke.IRVal);
			//Str1->FromUInt4Dg(fPrm.Smoke.BlueVal);
			//Str1->FromUInt4Dg(fPrm.Smoke.P1);
			//Str1->FromUInt4Dg(fPrm.Smoke.P2);
			break;
		case  dgTYPE_TEMPE_DETECTOR:
			//Str0->FromUInt4Dg(fPrm.Tempe.DegVal);
			break;
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_I:
		//case  dgTYPE_SMOKE_TEMPE_DETECTOR_II:
		//	Str0->FromUInt4Dg(fPrm.Smoke.IRVal);
		//	Str1->FromUInt4Dg(fPrm.Smoke.BlueVal);
		//	Str2->FromUInt4Dg(fPrm.Smoke.P1);
		//	Str3->FromUInt4Dg(fPrm.Smoke.P2);
		//	Str4->AddOn3Dg(fPrm.SmokeTempe.DegVal);
		//	break;
			
		case  dgTYPE_HAND_REPORT:
			
			break;
		case  dgTYPE_IN_MODULE:
			
			break;
		case  dgTYPE_OUT_MODULE:
			
			break;
		case  dgTYPE_INOUT_MODULE_NonSource:
		case  dgTYPE_INOUT_MODULE_Source:
			
			break;
		case  dgType_VAALRAM:
			
			break;
		//case  dgTYPE_BUS_BROKE:
			
		//	break;
		case	dgTYPE_DISPLAY_PAD:	

			break;
	}*/	
}


