Browse Source

修改状态变化、时间统计和report反馈的几个bug

sangwq 1 month ago
parent
commit
7fb0e6cd6e

+ 1 - 1
TIN001-PLC/Jet_Furance_PMC/Jet_Furance_PMC/Jet_Furance_PMC/FurancePMC/Main.cpp

@@ -514,7 +514,7 @@ HRESULT CMain::SendClientData(ULONG socketId, ULONG nData, PVOID pData, ULONG& n
 	HRESULT hr = S_OK;
 		
 	m_spIpTcp->SendData(socketId, nData, pData, nSendData);
-	m_Trace.Log(tlInfo, FLEAVEA "CMain::SendClientData() Send nData = %d , strlen(nSendData) = %d", nData, nSendData);
+	//m_Trace.Log(tlInfo, FLEAVEA "CMain::SendClientData() Send nData = %d , strlen(nSendData) = %d", nData, nSendData);
 
 	return hr;
 }

+ 1 - 1
TIN001-PLC/Jet_Furance_PMC/Jet_Furance_PMC/Jet_Furance_PMC/FurancePMC/Main.h

@@ -3,7 +3,7 @@
 #ifndef _MAIN_H_
 #define _MAIN_H_
 
-#define USE_LIKE_TCP 
+//#define USE_LIKE_TCP 
 #include "FurancePMCInterfaces.h"
 
 

+ 155 - 68
TIN001-PLC/Jet_Furance_PMC/Jet_Furance_PMC/Jet_Furance_PMC/FurancePMC/RecipeContext.cpp

@@ -48,7 +48,7 @@ int RecipeContext::Moniter() {
 			return -1;
 		}
 	}
-	
+	report();
 	while (true) {
 		if (recipeExecuteCommand != RecipeExecuteCommandEnum::Default) {
 			command = recipeExecuteCommand;
@@ -86,6 +86,7 @@ int RecipeContext::Moniter() {
 			if (oldStatus == recipeExecuteStatus) {				
 				break;
 			}
+			report();
 		}
 		else {
 			if (recipeExecuteCommand != RecipeExecuteCommandEnum::Hold && recipeExecuteCommand != RecipeExecuteCommandEnum::Skip &&  recipeExecuteCommand != RecipeExecuteCommandEnum::Jump) {
@@ -214,6 +215,8 @@ BOOL RecipeContext::judgeStep()
 	//	TRUE - recipe未结束,且执行指针定位到了可执行的步骤上
 	//	FALSE - recipe执行结束,或发生了语法错误
 	//流程:
+	stepName[0] = 0;
+	nextStepName[0] = 0;
 	while (true) 
 	{
 		if (currentRecipeType == RecipeTypeEnum::NormalRecipe)
@@ -263,6 +266,13 @@ BOOL RecipeContext::judgeStep()
 			if (mainStepList.get(currentStepNo)->isLoopEndStep)
 			{
 				currentStepInfo = mainStepList.get(currentStepNo);
+				strcpy(stepName, currentStepInfo->name);
+				if (currentStepInfo->elapsedLoopCount + 1 >= currentStepInfo->loopCount) {
+					strcpy(nextStepName, mainStepList.get(currentStepNo+1)->name);
+				}
+				else {
+					strcpy(nextStepName, mainStepList.get(currentStepInfo->loopStartStep)->name);
+				}
 				return true;//循环结束也是像普通步骤一样先执行,循环判断放在next函数中
 			}
 
@@ -290,11 +300,20 @@ BOOL RecipeContext::judgeStep()
 				{
 					mainStepList.get(currentStepNo)->elapsedSubRecipeLoopCount = 0;
 					currentStepInfo = mainStepList.get(currentStepNo);
+					strcpy(stepName, currentStepInfo->name);
+					if (currentStepNo<mainStepList.length-1) {
+						strcpy(nextStepName, mainStepList.get(currentStepNo + 1)->name);
+					}
+					
 					return true;
 				}
 			}
 			//	e)返回TRUE(normal recipe的正常无跳转步骤)
 			currentStepInfo = mainStepList.get(currentStepNo);
+			strcpy(stepName, currentStepInfo->name);
+			if (currentStepNo < mainStepList.length - 1) {
+				strcpy(nextStepName, mainStepList.get(currentStepNo + 1)->name);
+			}
 			return true;
 		}
 
@@ -364,11 +383,35 @@ BOOL RecipeContext::judgeStep()
 			if (node->get(currentOtherStepNo)->isLoopEndStep)
 			{
                 currentStepInfo = node->get(currentOtherStepNo);
+				strcpy(stepName, currentStepInfo->name);
+				if (currentStepInfo->elapsedLoopCount + 1 >= currentStepInfo->loopCount) {
+					if (currentOtherStepNo < node->length - 1) {
+						strcpy(nextStepName, node->get(currentOtherStepNo+1)->name);
+					}
+					else {
+
+					}
+				}
+				else {
+					strcpy(nextStepName, node->get(currentStepInfo->loopStartStep)->name);
+				}
 				return true;//循环结束也是像普通步骤一样先执行,循环判断放在next函数中
 			}
 
 			//	f)返回TRUE(sub recipe的正常无跳转步)
 			currentStepInfo = node->get(currentOtherStepNo);
+			strcpy(stepName, currentStepInfo->name);
+			if (currentStepNo < node->length - 1) {
+				strcpy(nextStepName, node->get(currentOtherStepNo + 1)->name);
+			}
+			else {
+				if (mainStepList.get(currentStepNo)->elapsedSubRecipeLoopCount >= mainStepList.get(currentStepNo)->subRecipeLoopCount) {
+					strcpy(nextStepName, mainStepList.get(currentStepNo)->name);
+				}
+				else {
+					strcpy(nextStepName, node->get(0)->name);
+				}
+			}
 			return true;
 		}
 
@@ -431,11 +474,24 @@ BOOL RecipeContext::judgeStep()
 			if (node->get(currentOtherStepNo)->isLoopEndStep)
 			{
 				currentStepInfo = node->get(currentOtherStepNo);
+				strcpy(stepName, currentStepInfo->name);
+				if (currentStepInfo->elapsedLoopCount + 1 >= currentStepInfo->loopCount) {
+					if (currentOtherStepNo < node->length - 1) {
+						strcpy(nextStepName, node->get(currentOtherStepNo + 1)->name);
+					}
+				}
+				else {
+					strcpy(nextStepName, node->get(currentStepInfo->loopStartStep)->name);
+				}
 				return true;//循环结束也是像普通步骤一样先执行,循环判断放在next函数中
 
 			}
 			//	e)返回TRUE(abort recipe的正常无跳转步)
 			currentStepInfo = node->get(currentOtherStepNo);
+			strcpy(stepName, currentStepInfo->name);
+			if (currentStepNo < node->length - 1) {
+				strcpy(nextStepName, node->get(currentOtherStepNo + 1)->name);
+			}
 			return true;
 
 		}
@@ -479,10 +535,23 @@ BOOL RecipeContext::judgeStep()
 			if (node->get(currentOtherStepNo)->isLoopEndStep)
 			{
 				currentStepInfo = node->get(currentOtherStepNo);
+				strcpy(stepName, currentStepInfo->name);
+				if (currentStepInfo->elapsedLoopCount + 1 >= currentStepInfo->loopCount) {
+					if (currentOtherStepNo < node->length - 1) {
+						strcpy(nextStepName, node->get(currentOtherStepNo + 1)->name);
+					}
+				}
+				else {
+					strcpy(nextStepName, node->get(currentStepInfo->loopStartStep)->name);
+				}
 				return true;//循环结束也是像普通步骤一样先执行,循环判断放在next函数中
 
 			}
 			currentStepInfo = node->get(currentOtherStepNo);
+			strcpy(stepName, currentStepInfo->name);
+			if (currentStepNo < node->length - 1) {
+				strcpy(nextStepName, node->get(currentOtherStepNo + 1)->name);
+			}
 			return true;
 		}
 
@@ -519,6 +588,7 @@ BOOL RecipeContext::next()
 		{
 			//上位机把循环次数多加了1,所以下面看起来循环少一次,其实正好
 			mainStepList.get(currentStepNo)->elapsedLoopCount++;
+			report();
 			if (mainStepList.get(currentStepNo)->elapsedLoopCount < mainStepList.get(currentStepNo)->loopCount)
 			{
 				currentStepNo = mainStepList.get(currentStepNo)->loopStartStep;					
@@ -533,7 +603,7 @@ BOOL RecipeContext::next()
 		else {
 			currentStepNo++;
 		}
-			
+		
 	}
 	else
 	{
@@ -563,6 +633,7 @@ BOOL RecipeContext::next()
 			if (stepInfo->isLoopEndStep)
 			{
 				stepInfo->elapsedLoopCount++;
+				report();
 				if (stepInfo->elapsedLoopCount <stepInfo->loopCount)
 				{
 					currentOtherStepNo = stepInfo->loopStartStep;
@@ -809,40 +880,7 @@ void RecipeContext::updateTime(BOOL newStep)
 		elapsedStepTime = 0;
 		remainStepTime = currentStepInfo->time*1000;
 		
-		if (startTime == 0)
-		{
-			int backupCurrentStepNo = currentStepNo;
-			int backupCurrentOtherStepNo = currentOtherStepNo;
-			RecipeTypeEnum backupCurrentRecipeType = (RecipeTypeEnum)currentRecipeType;
-			RecipeStepInfo* backupRecipeStepInfo = currentStepInfo;
-			while (next())
-			{
-				RecipeStepInfo* testStepInfo = getCurrentStepInfo();
-				if (testStepInfo != NULL) {
-					remainTotalTime += testStepInfo->time*1000;
-				}
-
-			}
-			currentStepNo = backupCurrentStepNo;
-			currentRecipeType = backupCurrentRecipeType;
-			currentOtherStepNo = backupCurrentOtherStepNo;
-			currentStepInfo = backupRecipeStepInfo;
-			holdStepTime = 0;
-			if (startTime ==0)
-			{
-				//const SYSTEMTIME Currontsystemtime;
-				//FILETIME cuttentFileTime;
-				//TcSystemTimeToFileTime(&Currontsystemtime, &cuttentFileTime);
-
-				//// 转换为 ULONGLONG
-				//ULONGLONG ulFileTime = (static_cast<ULONGLONG>(cuttentFileTime.dwHighDateTime) << 32) | cuttentFileTime.dwLowDateTime;
-
-				startTime = sysTime;//当前时间
-
-				// 再调用 TcEncodeFileTime 转换为字符串
-			
-			}
-		}
+		 
 	}
 	else
 	{
@@ -874,7 +912,29 @@ void RecipeContext::updateTime(BOOL newStep)
 	}
 }
 
-
+void RecipeContext::countTime()
+{
+	currentStepNo = -1;
+	currentOtherStepNo = 0;
+	currentRecipeType = RecipeTypeEnum::NormalRecipe;
+	while (next())
+	{
+		RecipeStepInfo* testStepInfo = getCurrentStepInfo();
+		if (testStepInfo != NULL) {
+			remainTotalTime += testStepInfo->time * 1000;
+		}
+	}
+	currentStepNo = -1;
+	currentOtherStepNo = 0;
+	currentRecipeType = RecipeTypeEnum::NormalRecipe;
+	holdStepTime = 0;
+	startTime = sysTime;//当前时间
+	elapsedStepTime = 0;
+	elapsedTotalTime = 0;
+	holdStepTime = 0;
+	holdTotalTime = 0;
+	remainStepTime = 0;
+}
 
 
  
@@ -1020,6 +1080,7 @@ void RecipeContext::report() {
 	report(NULL, RecipeReportCommandEnum::None);
 }
 void RecipeContext::report(const char *message,RecipeReportCommandEnum command) {
+	
 	short tagId = 0;
 	switch (this->recipeExecuteStatus) {
 	case RecipeExecuteStatusEnum::ExecStep:
@@ -1055,8 +1116,22 @@ void RecipeContext::report(const char *message,RecipeReportCommandEnum command)
 		tagId = (short)ReportTagIdEnum::AlarmTrigger;
 	}
 	static RecipeReport reportInfo;
-	reportInfo.elapsedLoopCount = 0;
-	reportInfo.loopCount = 0;
+	if (reportInfo.tagId == tagId && reportInfo.stepNo == currentStepNo && reportInfo.otherRecipeKey == currentOtherRecipeKey
+		&& reportInfo.recipeType == (unsigned char)currentRecipeType && reportInfo.otherStepNo == currentOtherStepNo
+		&& reportInfo.status == (unsigned char)recipeExecuteStatus && reportInfo.command ==(unsigned char) command ) {
+		//信息没有变化的1秒刷一次
+		if (elapsedTotalTime - reportInfo.elapsedTotalTime < 1000) {
+			if (currentStepInfo != NULL && currentStepInfo->isLoopEndStep && currentStepInfo->elapsedLoopCount != reportInfo.elapsedLoopCount) {
+				//循环次数变更,需要强制通知
+			}
+			else {
+				return;
+			}
+			
+		}
+	}
+	//reportInfo.elapsedLoopCount = 0;
+	//reportInfo.loopCount = 0;
 	reportInfo.subElapsedLoopCount = 0;
 	reportInfo.subLoopCount = 0;
 	reportInfo.elapsedStepTime = elapsedStepTime;
@@ -1071,24 +1146,41 @@ void RecipeContext::report(const char *message,RecipeReportCommandEnum command)
 	reportInfo.startTime = startTime;
 	reportInfo.stepNo = currentStepNo;
 	reportInfo.tagId = tagId;
+	if (currentStepNo == 0) {
+		reportInfo.loopCount = 0;				//源数据N+1,反馈N
+		reportInfo.elapsedLoopCount = 0;		//源数据0-N,反馈0-N
+		reportInfo.subElapsedLoopCount = 0;		//源数据1-N,反馈1-N
+		reportInfo.subLoopCount = 0;			//元数据N,反馈N
+	}
+	if (currentRecipeType == RecipeTypeEnum::SubRecipe)
+	{
 
-	switch (currentRecipeType) {
-		case RecipeTypeEnum::NormalRecipe:
-			if (currentStepNo > 0 && currentStepInfo!=NULL) {
-				reportInfo.loopCount = currentStepInfo->loopCount;
-                reportInfo.elapsedLoopCount = currentStepInfo->elapsedLoopCount;
-			}
-		case RecipeTypeEnum::SubRecipe:
-			if (currentStepNo >= 0) {
-				reportInfo.subElapsedLoopCount = mainStepList.get(currentStepNo)->elapsedLoopCount;
-				reportInfo.subLoopCount = mainStepList.get(currentStepNo)->loopCount;
-			}
-			break;
-		case RecipeTypeEnum::AbortRecipe:
-		case RecipeTypeEnum::AlarmRecipe:
-		case RecipeTypeEnum::ResetRecipe:
-			break;
+		if (currentStepNo >= 0) {
+			reportInfo.subElapsedLoopCount = mainStepList.get(currentStepNo)->elapsedSubRecipeLoopCount;
+			reportInfo.subLoopCount = mainStepList.get(currentStepNo)->subRecipeLoopCount;
+		}
+		else {
+			reportInfo.subElapsedLoopCount = 0;
+			reportInfo.subLoopCount = 0;
+		}
+	}
+	else {
+		reportInfo.subElapsedLoopCount = 0;
+		reportInfo.subLoopCount = 0;
 	}
+	if (currentStepNo > 0 && currentStepInfo!=NULL) {
+		if (currentStepInfo->isLoopEndStep && currentStepInfo->elapsedLoopCount>0) {
+			reportInfo.loopCount = currentStepInfo->loopCount-1;
+			reportInfo.elapsedLoopCount = currentStepInfo->elapsedLoopCount;
+					
+		}
+		if (reportInfo.elapsedLoopCount > reportInfo.loopCount) {
+			reportInfo.loopCount = 0;
+			reportInfo.elapsedLoopCount = 0;
+		}
+	}
+
+	
 	if (tagId == (short)ReportTagIdEnum::AlarmTrigger) {
 		if (message == NULL) {
 			message = OP->alarmText;
@@ -1109,6 +1201,8 @@ void RecipeContext::report(const char *message,RecipeReportCommandEnum command)
 	reportInfo.status= (unsigned char)recipeExecuteStatus;
 	reportInfo.time = sysTime;
 	reportInfo.command = (unsigned char)command;
+	strcpy(reportInfo.stepName, stepName);
+	strcpy(reportInfo.nextStepName, nextStepName);
 	static char sendData[sizeof(RecipeReport) + 32];
 	*(short*)sendData = reportInfo.tagId;
 	int len = reportInfo.serialize(sendData + 2, sizeof(sendData) - 2);
@@ -1219,7 +1313,7 @@ void RecipeContext::ParseDataWithRawData()
 	{
 		return;
 	}
-	if (recipeExecuteStatus == RecipeExecuteStatusEnum::RecipeCompleted || recipeExecuteStatus == RecipeExecuteStatusEnum::Unknown)
+	if (recipeExecuteStatus == RecipeExecuteStatusEnum::Unknown)
 	{
 		recipeExecuteStatus = RecipeExecuteStatusEnum::Idle;
 	}
@@ -1421,8 +1515,8 @@ void RecipeContext::ParseDataWithRawDataOnce(char *buffer,int rawDataLength)
 
 			int len = tempCorrectionDic.length;
 
-			sprintf(OP->alarmText, "tempCorrectionDic.length = %d", len);
-			ReportAlarm();
+			LOG->Log(tlInfo, "tempCorrectionDic.length = %d", len);
+			 
 		}
 	}else if (tagid == 10)
 	{
@@ -1471,14 +1565,7 @@ void RecipeContext::ParseDataWithRawDataOnce(char *buffer,int rawDataLength)
 		}else if (cks->CKey == (int)CommandKey::Abort)
 		{
 			recipeExecuteCommand = RecipeExecuteCommandEnum::Abort;
-			//TODO:需要迁移到事件处理中
-			{
-				//TODO:abort应该调用abort recipe...
-				recipeExecuteStatus = RecipeExecuteStatusEnum::Error;
-				recipeExecuteCommand = RecipeExecuteCommandEnum::Abort;
-
-				ClearDicAndLisrData();
-			}
+			
 
 		}else if (cks->CKey == (int)CommandKey::Hold)
 		{
@@ -1572,7 +1659,7 @@ char* RecipeContext::CovertIntToChar(int key)
 
 void RecipeContext::ClearDicAndLisrData()
 {
-	AllDataSession.sendData.clear();
+	//AllDataSession.sendData.clear(); 系统会自动不停地发反馈,不需要在这里clear,否则有可能丢数据
 	AllDataSession.recvData.clear();
 	mainStepList.clear();
 	subStepListMap.clear();
@@ -1636,7 +1723,7 @@ bool RecipeContext::checkRecipeCommand() {
 			}
 			else {
 				recipeExecuteStatus = RecipeExecuteStatusEnum::StepCompleted;
-				report();
+				//report();
 			}
 			
 			return true;

+ 5 - 3
TIN001-PLC/Jet_Furance_PMC/Jet_Furance_PMC/Jet_Furance_PMC/FurancePMC/RecipeContext.h

@@ -38,7 +38,8 @@ using namespace std;
 
 typedef enum class RecipeTypeEnum
 {
-	NormalRecipe = 0,	//主recipe
+	Unknown=0,
+	NormalRecipe ,	//主recipe
 	SubRecipe,			//sub recipe
 	AbortRecipe,		//abort recipe
 	AlarmRecipe,		//alarm recipe
@@ -361,7 +362,8 @@ public:
 
 	Dictionary<List<RecipeStepInfo,50>,20> abortStepListMap;//	abort recipe对照表
 	Dictionary<List<RecipeStepInfo,50>,20> alarmStepListMap;//	alarm recipe对照表
-
+	char stepName[MAX_NAME_LEN];
+	char nextStepName[MAX_NAME_LEN];
 	BOOL   isPaused;		// 当前步骤的暂停标志
 
 
@@ -446,7 +448,7 @@ public:
 	void pause();
 	void release();
 	void updateTime(BOOL newStep);
-	
+	void countTime();
 	
 	int getCurrentRecipeType();	//当前步骤所在recipe的类型
 	int getCurrentStepNo();		//0开始,主recipe的步骤号

+ 15 - 11
TIN001-PLC/Jet_Furance_PMC/Jet_Furance_PMC/Jet_Furance_PMC/FurancePMC/RecipeContextMethod.cpp

@@ -54,14 +54,17 @@ bool  RecipeContext::executeNextStep()
 {
 	//处理流程:
 	//	1.取出recipe的下一个步骤RecipeContext.next()
-	
+	if (recipeExecuteStatus == RecipeExecuteStatusEnum::Idle) {
+		countTime();
+	}
 	if (!next())
 	{
 		//	2.如果next返回FALSE,设置recipeExecuteStatus = RecipeCompleted并返回
 		recipeExecuteStatus = RecipeExecuteStatusEnum::RecipeCompleted;
-		ClearDicAndLisrData();
 		//数据上报,recipe执行结束tagid
-		report();
+		//report();
+		//ClearDicAndLisrData();
+		
 		return true;
 	}
 	//	3.设置recipeExecuteStatus = ExecStep
@@ -76,7 +79,7 @@ bool  RecipeContext::executeNextStep()
 		return false;
 	}
 	//数据上报,本步开始
-	report();
+	//report();
 
 	//	4.刷新计时upateTime(TRUE)
 	updateTime(true);
@@ -87,8 +90,8 @@ bool  RecipeContext::executeNextStep()
 	{
 		recipeExecuteStatus = RecipeExecuteStatusEnum::StepCompleted;
 		//数据上报,本步结束
-		report();
-		OP->reset();
+		//report();
+		//OP->reset();
 		return true;
 	}
 
@@ -147,7 +150,7 @@ bool  RecipeContext::executeNextStep()
 					if (strcmp(opName, "SetCommand.None") != 0) {
 						auto retnode = OP->select(opName);
 						retnode->setParams(retcommand + cmdParamIndex);
-						retnode->setTimes(TIME_USE_LAST, TIME_USE_LAST, TIME_USE_LAST, currentStepInfo->time*100);
+						retnode->setTimes(TIME_USE_LAST, TIME_USE_LAST, TIME_USE_LAST, currentStepInfo->time*1000);
 						//retnode->Do();
 						recipeOPList[recipeOPCount++] = retnode;
 					}
@@ -237,6 +240,7 @@ bool  RecipeContext::abortRecipe() {
 	if (abortStepListMap.length <= 0 || currentStepInfo->abortRecipeKey < 0 || currentStepInfo->abortRecipeKey >= abortStepListMap.length) {
 		//abort recipe不存在,直接abort
 		recipeExecuteStatus = RecipeExecuteStatusEnum::RecipeCompleted;
+		//report();
 		return true;
 	}
 	currentRecipeType = RecipeTypeEnum::AbortRecipe;
@@ -259,7 +263,7 @@ bool  RecipeContext::checkStep() {
 			logger->info("Step [%s] success finished", currentStepInfo->name);
 			
 		}
-		report();
+		//report();
 		//TODO:这里是第n次所有命令都检查通过(或alarm condition设置了跳转),但仍需根据step time和jumpRecipeCmd继续判断处理
 		return checkRecipeCommand();
 		
@@ -272,7 +276,7 @@ bool  RecipeContext::checkStep() {
 		return true;
 	}
 	else {
-		report();
+		//report();
 	}
 
 	return true;
@@ -306,12 +310,12 @@ bool  RecipeContext::dischargeOver() {
 }
 bool  RecipeContext::simpleTick() {
 	updateTime(FALSE);
-	report();
+	//report();
 	return true;
 }
 bool  RecipeContext::simpleReport() {
 	
-	report();
+	//report();
 	return true;
 }
 bool  RecipeContext::retryAlarm() {

+ 26 - 20
TIN001-PLC/Jet_Furance_PMC/Jet_Furance_PMC/Jet_Furance_PMC/FurancePMC/RecipeReport.h

@@ -18,28 +18,30 @@ typedef enum class _t_recipe_report_command {
 }RecipeReportCommandEnum;
 class RecipeReport :SerializedBase {
 public:
-	short	tagId;
-	time_t  time;
-	unsigned char status;
-	unsigned char recipeType;
-	unsigned char stepNo;
-	unsigned char otherRecipeKey;
-	unsigned char otherStepNo;
-	short loopCount;
-	short elapsedLoopCount;
-	short subLoopCount;
-	short subElapsedLoopCount;
-	int remainTotalTime;
-	time_t startTime;
-	int elapsedTotalTime;
-	int holdTotalTime;
-	int elapsedStepTime;
-	int holdStepTime;
-	int remainStepTime;
-	unsigned char command;//补充命令,用于通知上位机做一些辅助动作
+	short	tagId=0;
+	time_t  time=0;
+	unsigned char status=0;
+	unsigned char recipeType=0;
+	unsigned char stepNo=0;
+	unsigned char otherRecipeKey=0;
+	unsigned char otherStepNo=0;
+	short loopCount=0;
+	short elapsedLoopCount=0;
+	short subLoopCount=0;
+	short subElapsedLoopCount=0;
+	int remainTotalTime=0;
+	time_t startTime=0;
+	int elapsedTotalTime=0;
+	int holdTotalTime=0;
+	int elapsedStepTime=0;
+	int holdStepTime=0;
+	int remainStepTime=0;
+	unsigned char command=0;//补充命令,用于通知上位机做一些辅助动作
+	char stepName[100];
+	char nextStepName[100];
 	char alarmNo[20];
 	char message[255];
-	unsigned char  RecipeReportVersion = 0x01;
+	unsigned char  RecipeReportVersion = 0x02;
 	int serialize(char* buffer, int bufferSize)
 	{
 		BEGIN_SERIALIZE(buffer, bufferSize, RecipeReportVersion);
@@ -61,6 +63,8 @@ public:
 		SERIALIZE(holdStepTime);
 		SERIALIZE(remainStepTime);
 		SERIALIZE(command);
+		SERIALIZE_STR(stepName);
+		SERIALIZE_STR(nextStepName);
 		SERIALIZE_STR(alarmNo);
 		SERIALIZE_STR(message);
 		return END_SERIALIZE();
@@ -86,6 +90,8 @@ public:
 		UNSERIALIZE(holdStepTime);
 		UNSERIALIZE(remainStepTime);
 		UNSERIALIZE(command);
+		UNSERIALIZE_STR(stepName);
+		UNSERIALIZE_STR(nextStepName);
 		UNSERIALIZE_STR(alarmNo);
 		UNSERIALIZE_STR(message);
 		return END_UNSERIALIZE();