#include "Gui.h"
#include "DevProperty.h"

#define cmDeviceSetTempeSensType	211
#define cmDeviceReadTempeSensType	212

//1～9=A1、A1R、A1S、A2、A2R、A2S、B、BR、BS

void TDevProperty::DrawFixTextTempe()
{
	if(LanguageEnCn==0){
		TextRender_string24(Lv.Grid.Left[2] +10, Lv.Grid.Top[2] + 4, clNearWhite, ItemColor, "探测类型");
		TRoundRect::sDrawBySize(Lv.Grid.Left[2] +60, Lv.Grid.Top[2] + 40, 76, 30, 7, clNearWhite, "读取", 14, clNearBlack);
		TextRender_string24(Lv.Grid.Left[3] +10, Lv.Grid.Top[3] + 4, clNearWhite, ItemColor, "操作");
		unsigned int aClr;
		if(RunState == TRunModeCfg::RunModeAdjust)aClr = clNearBlack;else	aClr = clSilver;
		TRoundRect::sDrawBySize(Lv.Grid.Left[3] +60, Lv.Grid.Top[3] + 36, 76, 30, 7, clNearWhite, "灯点", 14, aClr);
		TRoundRect::sDrawBySize(Lv.Grid.Left[3] +150, Lv.Grid.Top[3] + 36, 124, 30, 7, clNearWhite, "模拟报警", 14, aClr);
	}else{
		TextRender_string24(Lv.Grid.Left[2] +10, Lv.Grid.Top[2] + 4, clNearWhite, ItemColor, "DET TYPE");
		TRoundRect::sDrawBySize(Lv.Grid.Left[2] +60, Lv.Grid.Top[2] + 40, 76, 30, 7, clNearWhite, "Read", 14, clNearBlack);
		TextRender_string24(Lv.Grid.Left[3] +10, Lv.Grid.Top[3] + 4, clNearWhite, ItemColor, "OPER");
		unsigned int aClr;
		if(RunState == TRunModeCfg::RunModeAdjust)aClr = clNearBlack;else	aClr = clSilver;
		TRoundRect::sDrawBySize(Lv.Grid.Left[3] +60, Lv.Grid.Top[3] + 36, 76, 30, 7, clNearWhite, "LED", 14, aClr);
		TRoundRect::sDrawBySize(Lv.Grid.Left[3] +150, Lv.Grid.Top[3] + 36, 124, 30, 7, clNearWhite, "SimAlarm", 14, aClr);
	}
}

void TDevProperty::FullRedrawhtTempe(int Prm)
{
	if(Prm == 0){
		for(int i=2; i<Lv.Grid.UsingCount; i++)RectFillRender(Lv.Grid.Left[i], Lv.Grid.Top[i], Lv.Grid.Right[i], Lv.Grid.Bottom[i], ItemColor);
		if(Lv.Panel.Active)RectFillRender(Lv.Panel.Left, Lv.Panel.Top, Lv.Panel.Right, Lv.Panel.Bottom, PanelColor);
		if(Lv.Panel.Active)RectFillRender(Lv.PanelSmall.Left, Lv.PanelSmall.Top, Lv.PanelSmall.Right, Lv.PanelSmall.Bottom, SmallPanelColor);
		ReDrawCommonInf();
		DrawFixTextTempe();
		IList->Edit[0].Show();
		DrawTempeReadStates();
		DrawLightOnStateTempe();
		RedrawPanelData();
		Redraw4TempeSmallPanelData();
		if(EdittingDescp){
			CnInput.FullRedraw();
		}else{
			Check4SelectedHtTempe();
		}
	}else{
		for(int i=2; i<3; i++)RectFillRender(Lv.Grid.Left[i], Lv.Grid.Top[i], Lv.Grid.Right[i], Lv.Grid.Bottom[i], ItemColor);
		if(Lv.Panel.Active)RectFillRender(Lv.Panel.Left, Lv.Panel.Top, Lv.Panel.Right, Lv.Panel.Bottom, PanelColor);
		ReDrawCommonInf();
		DrawFixTextTempe();
		IList->Edit[0].Show();
		DrawTempeReadStates();
		
		DrawLightOnStateTempe();
		RedrawPanelData();
		Redraw4TempeSmallPanelData();
		if(EdittingDescp){
			CnInput.FullRedraw();
		}else{
			Check4SelectedHtTempe();
		}
		if(IsPermission)PmsIntervene4Gui.ReDraw4GuiRecall();
	}
}

void TDevProperty::DrawTempeReadStates()
{
	char *tText;
	if(TempeReadSta == 0){
		tText="        ";
	}else
	if(TempeReadSta == 1){
		if(LanguageEnCn==0)tText="获取中  "; else tText="Reading ";
	}else
	if(TempeReadSta == 2){
		if(LanguageEnCn==0)tText="获取成功"; else tText="ReadOK  ";
	}else
	if(TempeReadSta == 3){
		if(LanguageEnCn==0)tText="获取失败"; else tText="ReadErr ";
	}
	TextRender_string24(IList->Edit[0].Bound.Right + 6, IList->Edit[0].Bound.Top + 4, clNearWhite, ItemColor, tText);
}

void TDevProperty::DrawTempeReadStates(unsigned char aNewState)
{
	TempeReadSta = aNewState;
	DrawTempeReadStates();
}

void TDevProperty::InitHtTempe()
{
	PanelIsUsingText = 1;
	
	for(int i=2; i<Lv.Grid.UsingCount; i++)RectFillRender(Lv.Grid.Left[i], Lv.Grid.Top[i], Lv.Grid.Right[i], Lv.Grid.Bottom[i], ItemColor);
	
	DrawFixTextTempe();
	
	DrawLightOnStateTempe();
	
	if(Lv.Panel.Active)RectFillRender(Lv.Panel.Left, Lv.Panel.Top, Lv.Panel.Right, Lv.Panel.Bottom, PanelColor);
	if(Lv.Panel.Active)RectFillRender(Lv.PanelSmall.Left, Lv.PanelSmall.Top, Lv.PanelSmall.Right, Lv.PanelSmall.Bottom, SmallPanelColor);
	
	RectFillRender(Lv.PanelSmall.Left + 10, Lv.PanelSmall.Top + 6, Lv.PanelSmall.Left + 10 + 20, Lv.PanelSmall.Top + 6 + 20, clGreen);
	RectFillRender(Lv.PanelSmall.Left + 120, Lv.PanelSmall.Top + 6, Lv.PanelSmall.Left + 120 + 20, Lv.PanelSmall.Top + 6 + 20, clPurple);
	
	TextRender_string24(Lv.PanelSmall.Left +146, Lv.PanelSmall.Top + 4, clNearWhite, ItemColor, "T");
	TCircle::sRender(Lv.PanelSmall.Left + 242, Lv.PanelSmall.Top + 10, 2, clNearWhite, 0);
	TextRender_string24(Lv.PanelSmall.Left +246, Lv.PanelSmall.Top + 4, clNearWhite, ItemColor, "C");
	
	IList->Edit[0].Init(Lv.Grid.Left[2] +116, Lv.Grid.Top[2] + 4, 60,30,0,0,1,clNearBlack);
	IList->Edit[0].Str.Clear();
	IList->Edit[0].Show(); 
	
	SendTempeCmdRead();
	DrawTempeReadStates(1); //"获取中  ");
}

void TDevProperty::EditDescpReturnHtTempe()
{
	PanelIsUsingText = 1;
	
	for(int i=2; i<4; i++)RectFillRender(Lv.Grid.Left[i], Lv.Grid.Top[i], Lv.Grid.Right[i], Lv.Grid.Bottom[i], ItemColor);
	
	DrawFixTextTempe();
	
	DrawLightOnStateTempe();
	
	IList->Edit[0].Init(Lv.Grid.Left[2] +116, Lv.Grid.Top[2] + 4, 60,30,0,0,1,clNearBlack);
	IList->Edit[0].Str.Clear();
	IList->Edit[0].Show(); 
	
	ReDrawPanel();
}

void TDevProperty::Redraw4TempeNewLoad()
{
	IList->Edit[0].Str.Clear();
	IList->Edit[0].Show();
	
	SendTempeCmdRead();
	DrawTempeReadStates(1); //"获取中  ");
	
	if(Lv.Panel.Active)RectFillRender(Lv.Panel.Left, Lv.Panel.Top, Lv.Panel.Right, Lv.Panel.Bottom, PanelColor);
	
	CurveInit(Lv.Panel.Left+8, Lv.Panel.Top+8, Lv.Panel.Width-16, Lv.Panel.Heigh-16, 2);
	CurveSetMargin(60, 2, 60, 2);
	CurveSetGrid(6, 6, 50, 50);
	CurveSetColor(clDeepGreen, clPurple, clDeepGreen, clDeepGreen);
	CurveSetScaling();
	
	DrawLightOnStateTempe();
}

void TDevProperty::Redraw4TempeSmallPanelData()
{
	unsigned char tCelsius, iVal;
	RectFillRender(Lv.PanelSmall.Left + 10, Lv.PanelSmall.Top + 6, Lv.PanelSmall.Left + 10 + 20, Lv.PanelSmall.Top + 6 + 20, clGreen);
	RectFillRender(Lv.PanelSmall.Left + 120, Lv.PanelSmall.Top + 6, Lv.PanelSmall.Left + 120 + 20, Lv.PanelSmall.Top + 6 + 20, clPurple);

	TMyString::sClear(TextDraw);
	TMyString::sFrom2Dg(RuntimeData.voltage % 100, TextDraw);
	TMyString::sAddOnChar('.', TextDraw);
	TMyString::sAddOn1Dg(0, TextDraw);
	TMyString::sAddOnChar('V', TextDraw);
	TextRender_string24(Lv.PanelSmall.Left + 32, Lv.PanelSmall.Top + 4, clNearWhite, SmallPanelColor, TextDraw);
	
	TMyString::sClear(TextDraw);
	iVal = static_cast<unsigned char>(RuntimeData.TempeCelsiusData);
	if(iVal>127){
		tCelsius = (255-iVal)+1;
		TMyString::sAddOnChar('-', TextDraw);
	}else{
		tCelsius=iVal;
		TMyString::sAddOnChar('+', TextDraw);
	}
	TMyString::sAddOn3Dg(tCelsius % 1000, TextDraw);
	TMyString::sAddOnChar('.', TextDraw);
	TMyString::sAddOn1Dg(0, TextDraw);
	TextRender_string24(Lv.PanelSmall.Left + 164, Lv.PanelSmall.Top + 4, clNearWhite, SmallPanelColor, TextDraw);
	
	DrawMac();
}

void TDevProperty::ClearSelectedHtTempe()
{
	char *tText;
	switch(Tag.Inx){
		case 0:
			
			break;
		case 1:
			IList->EditPortNum.Selected = 0;
			IList->EditPortNum.Show();
			break;
		case 2:
			IList->EditAddrNum.Selected = 0;
			IList->EditAddrNum.Show();
			break;
		case 3:
			IList->EditDescpShow.Selected = 0;
			IList->EditDescpShow.Show();
			break;
		case 4:
			IList->EditUserCode.Selected = 0;
			IList->EditUserCode.Show();
			break;
		case 5:
			IList->EditAreaAssign.Selected = 0;
			IList->EditAreaAssign.Show();
			break;
		case 6:
			IList->Edit[0].Selected = 0;
			IList->Edit[0].Show();
			break;
		case 7:
			if(LanguageEnCn==0)tText="读取"; else tText="Read";
			TRoundRect::sDrawBySize(Lv.Grid.Left[2] +60, Lv.Grid.Top[2] + 40, 76, 30, 7, clNearWhite, tText, 14, clNearBlack);
			break;
		case 8:
			//TRoundRect::sDrawBySize(Lv.Grid.Left[3] +60, Lv.Grid.Top[3] + 36, 76, 30, 7, clNearWhite, "灯点", 14, clNearBlack);
			DrawLightOnStateTempe(-1);
			break;
		case 9:
			unsigned int aClr;
			if(RunState == TRunModeCfg::RunModeAdjust)aClr = clNearBlack;else	aClr = clSilver;
			if(LanguageEnCn==0)tText="模拟报警"; else tText="SimAlarm";
			TRoundRect::sDrawBySize(Lv.Grid.Left[3] +150, Lv.Grid.Top[3] + 36, 124, 30, 7, clNearWhite, tText, 14, aClr);
			break;
	}
}
void TDevProperty::Check4SelectedHtTempe()
{
	char *tText;
	switch(Tag.Inx){
		case 0:
			
			break;
		case 1:
			IList->EditPortNum.Selected = 1;
			IList->EditPortNum.SetPstTail();
			IList->EditPortNum.Show();
			IList->EditPortNum.ShowCursor();
			break;
		case 2:
			IList->EditAddrNum.Selected = 1;
			IList->EditAddrNum.SetPstTail();
			IList->EditAddrNum.Show();
			IList->EditAddrNum.ShowCursor();
			break;
		case 3:
			IList->EditDescpShow.Selected = 1;
			IList->EditDescpShow.Show();
			break;
		case 4:
			IList->EditUserCode.Selected = 1;
			IList->EditUserCode.SetPstTail();
			IList->EditUserCode.Show();
			IList->EditUserCode.ShowCursor();
			break;
		case 5:
			IList->EditAreaAssign.Selected = 1;
			IList->EditAreaAssign.SetPstTail();
			IList->EditAreaAssign.Show();
			IList->EditAreaAssign.ShowCursor();
			break;
		case 6:
			IList->Edit[0].Selected = 1;
			IList->Edit[0].Show();
			break;
		case 7:
			if(LanguageEnCn==0)tText="读取"; else tText="Read";
			TRoundRect::sDrawBySize(Lv.Grid.Left[2] +60, Lv.Grid.Top[2] + 40, 76, 30, 7, clDeepBlue, tText, 14, clNearWhite);
			break;
		case 8:
			//TRoundRect::sDrawBySize(Lv.Grid.Left[3] +60, Lv.Grid.Top[3] + 36, 76, 30, 7, clDeepBlue, "灯点", 14, clNearWhite);
			DrawLightOnStateTempe();
			break;
		case 9:
			unsigned int aClr;
			if(RunState == TRunModeCfg::RunModeAdjust)aClr = clNearWhite;else	aClr = clSilver;
			if(LanguageEnCn==0)tText="模拟报警"; else tText="SimAlarm";
			TRoundRect::sDrawBySize(Lv.Grid.Left[3] +150, Lv.Grid.Top[3] + 36, 124, 30, 7, clDeepBlue, tText, 14, clNearWhite);
			break;
	}	
}

void TDevProperty::RedrawTempeSensType()
{
	//1～9=A1、A1R、A1S、A2、A2R、A2S、B、BR、BS
	char *tText;
	if(Data.TempeSenType == 1){
		IList->Edit[0].Str.FromStr("A1");
	}else
	if(Data.TempeSenType == 2){
		IList->Edit[0].Str.FromStr("A1R");
	}else
	if(Data.TempeSenType == 3){
		IList->Edit[0].Str.FromStr("A1S");
	}else
	if(Data.TempeSenType == 4){
		IList->Edit[0].Str.FromStr("A2");
	}else
	if(Data.TempeSenType == 5){
		IList->Edit[0].Str.FromStr("A2R");
	}else
	if(Data.TempeSenType == 6){
		IList->Edit[0].Str.FromStr("A2S");
	}else
	if(Data.TempeSenType == 7){
		IList->Edit[0].Str.FromStr("B");
	}else
	if(Data.TempeSenType == 8){
		IList->Edit[0].Str.FromStr("BR");
	}else
	if(Data.TempeSenType == 9){
		IList->Edit[0].Str.FromStr("BS");
	}else{
		if(LanguageEnCn==0)tText="未知   "; else tText="Unknown";
		IList->Edit[0].Str.FromStr(tText);
	}
	IList->Edit[0].Show();
}

void TDevProperty::SendTempeCmdRead()
{
	TCanHeaderID aIde;
	unsigned char cVal;
	unsigned int i;
	unsigned int Len;
	int iVal;
	unsigned char aPx;
	
	TempeRt.IsWait4ReadSensType = 1;
	TempeRt.RecRdy = 0;
	TempeRt.RecCmd = 0;
	TempeRt.WaitTick = 0;
	
	Len =4;
	
	for(i=0; i<8; i++){
		CommData[i] = 0;
	}
	
	CommData[0] = 0;
	CommData[1] = MainCtl.fData.Split.MyNum;
	CommData[2] = Path0;
	ProcessingRt.P0 = Path0;
	CommData[3] = Path1;
	ProcessingRt.P1 = Path1;
	
	CommData[4] = 0x06;
	
	aIde.BitF.Cmd = cmQueryStaticData;
	aIde.BitF.Pri = 1;
	aIde.BitF.sLvl = 1;
	aIde.BitF.dLvl = 7;
	aIde.BitF.sAddr = 0;
	aIde.BitF.dAddr = 127;
	
	InnerCan.Buf4GuiSend.Insert(aIde, CommData, 6);
}

void TDevProperty::SendTempeCmdCfg()
{
/*	TCanHeaderID aIde;
	unsigned char cVal, tP0, tP1;
	unsigned int i;
	unsigned int Len;
	int iVal;
	unsigned char aPx;
	
	ProcessingRt.DevType = 0;	//点型烟感
	ProcessingRt.DataType = 1;	//烟感灵敏度
	
	if(Data.SmokerSens < 4)
		ProcessingRt.dVal[0] = dSmokeSensGrade_MarkValue[Data.SmokerSens];
	else
		ProcessingRt.dVal[0] = 0;
	ProcessingRt.dVal[1] =0;
	ProcessingRt.dVal[2] =0;
	ProcessingRt.dVal[3] =0;
	
	Len =8;
	for(i=0; i<8; i++){
		CommData[i] = 0;
	}
	CommData[0] = 0;
	CommData[1] = MainCtl.fData.Split.MyNum;
	CommData[2] = Path0;
	ProcessingRt.P0 = Path0;
	ProcessingRt.P1 = Path1;
	CommData[3] = ProcessingRt.P1;
		
	aIde.BitF.Cmd = cmQueryStaticData;
	
	RedrawSmokeSensValue();
	
	CommData[3] = ProcessingRt.DataType;
	CommData[4] = ProcessingRt.dVal[0];
	CommData[5] = ProcessingRt.dVal[1];
	CommData[6] = ProcessingRt.dVal[2];
	CommData[7] = ProcessingRt.dVal[3];
	
	aIde.BitF.Pri = 1;
	aIde.BitF.sLvl = 1;
	aIde.BitF.dLvl = 7;
	aIde.BitF.sAddr = 0;
	aIde.BitF.dAddr = 127;
		
	InnerCan.Buf4GuiSend.Insert(aIde, CommData, Len);*/
}

void TDevProperty::PushTempeCanData(unsigned char aCmd, unsigned char *pData)
{
	int i;
	if(aCmd == cmQueryStaticData){
		for(i=0; i<8; i++)RecData[i] = pData[i];
		if(   (ProcessingRt.P0 == RecData[1]) &&
			(ProcessingRt.P1 == RecData[2]) ){
				if( RecData[3] == 0 ){
					Data.TempeSenType = RecData[5];
					TempeRt.RecRdy =1;
					TempeRt.RecCmd =aCmd;
				}
		}
	}
}

TGuiMsgReturn TDevProperty::KeyInHtTempe(unsigned char aKey)
{
	TGuiMsgReturn aMsg = guiMsgNone;
	switch(aKey){
		case VK_0:
		case VK_1:
		case VK_2:
		case VK_3:
		case VK_4:
		case VK_5:
		case VK_6:
		case VK_7:
		case VK_8:
		case VK_9:
		case VK_DELETE:
		case VK_LEFT:
		case VK_RIGHT:
			if(Tag.Inx < 6){
				KeyInCommonEdit(aKey);
			}else{
				if(Tag.Inx == 6){
					//Change Sens Type

				}else
				if(Tag.Inx == 7){
					//Read Sens
				}else
				if(Tag.Inx == 8){
					//Light Up
					if(aKey == VK_RIGHT){
						ClearSelectedHtTempe();
						Tag.Inx = 9;
						Check4SelectedHtTempe();
					}
				}else
				if(Tag.Inx == 9){
					//Sim Alram
					if(aKey == VK_LEFT){
						ClearSelectedHtTempe();
						Tag.Inx = 8;
						Check4SelectedHtTempe();
					}
				}
			}
			break;
		case VK_UP:
			if(PortNumValid && AddrNumValid){
				ClearSelectedHtTempe();
				Tag.Inx > Tag.InxMin ? Tag.Inx-- : Tag.Inx = 9;
				Check4SelectedHtTempe();
			}
			break;
		case VK_DOWN:
			if(PortNumValid && AddrNumValid){
				ClearSelectedHtTempe();
				Tag.Inx < 9 ? Tag.Inx++ : Tag.Inx = Tag.InxMin;
				Check4SelectedHtTempe();
			}
			break;
		case VK_TAB:
			PanelIsUsingText = PanelIsUsingText ? 0 : 1;
			if(PanelIsUsingText == 0){
				CurveHide();
			}
			Check4Selected();
			if(Lv.Panel.Active)RectFillRender(Lv.Panel.Left, Lv.Panel.Top, Lv.Panel.Right, Lv.Panel.Bottom, PanelColor);
			RedrawPanelData();
			break;
		case dfKEY_SETUP:
			break;
		case dfKEY_QUERY:
			PanelDrawData.DesertTextHex = PanelDrawData.DesertTextHex ? 0: 1;
			break;
		case dfKEY_ENCN:
			SendReqMac();
			break;
		case VK_EXECUTE:
			if(PortNumValid && AddrNumValid){
				if(Tag.Inx <6){
					KeyInCommonEnter(aKey);
				}else{
					if(Tag.Inx == 6){
						//Change Sens
						
					}else
					if(Tag.Inx == 7){
						//Read Sens
						SendTempeCmdRead();
						DrawTempeReadStates(1); //"获取中  ");
					}else
					if(Tag.Inx == 8){
						//Light Up
						if(RunState == TRunModeCfg::RunModeAdjust){
							SendCmdLightOn();
							DrawLightOnStateTempe();
						}
					}else
					if(Tag.Inx == 9){
						//Sim Alram
						if(RunState == TRunModeCfg::RunModeAdjust){
							PermissionCmd = pcSimAlram; //pcSimAlram,pcSimStart,pcSimInputActive,
							if(SystemPermission >1){
								PermissionCmdGO();
							}else{
								IsPermission = 1;
								PmsIntervene4Gui.Show4Gui(Lv.Panel.Left + 16, Lv.Panel.Top + 16, Lv.Panel.Width -34, 140, 2);
							}
						}
					}
				}
			}
			break;
		case VK_RETURN:
			IsShow = 0;
			RealTimeSendCmdAbort();
			aMsg = guiMsgReturn;
			break;
	}
	
	
	return aMsg;
}

void TDevProperty::DrawLightOnStateTempe(int aPrm)
{
	unsigned char aP0, aP1;
	char *tText;
	unsigned int TextColor, bClr;
	if( (Path0) && (Path0<=dPORT_MAX_COUNT) && (Path1) ){
		aP0 = Path0 -1;
		aP1 = Path1 -1;
		if( (Tag.Inx == 8) && (aPrm != -1) ){
			TextColor = clNearWhite;
			bClr = clDeepBlue;
		}else{
			if(RunState == TRunModeCfg::RunModeAdjust)TextColor = clNearBlack;else	TextColor = clSilver;
			bClr = clNearWhite;
		}
		if(Port[aP0].HasSetLightOn[aP1]){
			TextColor = clRed;
		}
		if(LanguageEnCn == 0)tText="灯点";else tText="LED ";
		TRoundRect::sDrawBySize(Lv.Grid.Left[3] +60, Lv.Grid.Top[3] + 36, 76, 30, 7, bClr, tText, 14, TextColor);
	}	
}
                                                          

void TDevProperty::Task1000MsTempe()
{
	if(TempeRt.IsWait4ReadSensType){
		if(TempeRt.RecRdy){
			if(TempeRt.RecCmd == cmQueryStaticData){
				TempeRt.RecRdy = 0;
				TempeRt.IsWait4ReadSensType = 0;
				//Add Record Here
				if(Data.TempeSenType){
					if( (EdittingDescp == 0) && (IsHotKeyCheckingPermission == 0) ){
						RedrawTempeSensType();
						DrawTempeReadStates(2); //"获取成功")
					}else{
						TempeReadSta = 2;
					}
				}
			}
			TempeRt.RecRdy = 0;
		}
		TempeRt.WaitTick ++;
		if(TempeRt.WaitTick > 6){
			TempeRt.IsWait4ReadSensType = 0;
			if( (EdittingDescp == 0) && (IsHotKeyCheckingPermission == 0) ){
				DrawTempeReadStates(3); //"读取失败");
			}else{
				TempeReadSta = 3;
			}
		}
	}
	/*if( (Data.GotTempeSensType[0] == 0xF1) && (Data.GotTempeSensType[4] == 0) ){
		if( (Data.GotTempeSensType[1] == Path0) && (Data.GotTempeSensType[2] == Path1) ){
			Data.TempeSenType = Data.GotTempeSensType[3];
			if(IsHotKeyCheckingPermission == 0){
				RedrawTempeSensType();
				DrawTempeReadStates(2); //"获取成功")
				Data.GotTempeSensType[4] =1;
			}
		}
	}*/
	Redraw4TempeSmallPanelData();
}



