of(Tp.Buffer));memset(OIL_3MIN_REC,0,sizeof(OIL_3MIN_REC));Oil_Shape=g_stSystemConfig.OilBoxShape;//T=g_stSystemConfig.ScalingPoints;memcpy(Tp.Buf16B,g_stSystemConfig.OilScalingBuf,T*4);while(TRUE){//找到靠近的采样点if(!ExtOilScallingFlag){DEBUG_PRINT(LOG_LEVEL_INFO,"!!!!!!!!!SamMod!!!!!!!!!!\r\n");OIL_AD=OIL_GetAdValue();OIL_L=OIL_AD;DEBUG_PRINT(LOG_LEVEL_INFO,"OilBoxShape:%d,ScallingPoint:%d,OIL_AD:%d,g_stSystemConfig.OilDescTh:%d",Oil_Shape,T,OIL_AD,g_stSystemConfig.OilDescTh);if(Oil_Shape==0){if(OIL_AD<=Tp.Buf16B[1])//samplevaluelessthanthefirstscalingpointvalue{OIL_L=0;}elseif(OIL_AD>=Tp.Buf16B[T*2-1])//samplevaluemorethanthelastscalingpointvalue{OIL_L=Tp.Buf16B[T*2-2];//maxoilvalue}elseif(T)//middlevalue{Low=1;High=T-1;i=0;while(Low<=High){Middle=(Low+High)/2;if(OIL_AD<Tp.Buf16B[Middle*2+1])