Browse Source

1.处理SetBoatMotion运动的OP,把第一个参数也拼接到命令名称之中,以兼容当前recipe格式
2.在op轮询monitor之前,增加对所有device的monitor,目前无实际操作,留待扩展

shishenghui 1 week ago
parent
commit
ac6546f246

+ 12 - 0
TIN001-PLC/Jet_Furance_PMC/Jet_Furance_PMC/Jet_Furance_PMC/FurancePMC/ModuleMoniter.cpp

@@ -241,6 +241,18 @@ HRESULT CModuleMoniter::CycleUpdate(ITcTask* ipTask, ITcUnknown* ipCaller, ULONG
 		//}
 		//if (m_counter % 3 != 0 && m_counter % 5 != 0 && m_counter % 7 == 0)
 		{
+			/*
+			* recipe执行器处理顺序:
+			*    1.上位机传送的特定OP或OP干预指令(在解析中完成动作)
+			*    2.Recipe干预指令:Hold、Continue、Abort、Jump(在解析中完成设置)
+			*    3.Device的monitor
+			*    4.RecipeContext的monitor
+			*/
+			int deviceCount = DEVICE->getDeviceCount();
+			for (int deviceId = 0; deviceId < deviceCount; deviceId++) {
+				BaseDevice* device = DEVICE->getDeviceByIndex(deviceId);
+				device->monitor();
+			}
 			RecipeContext::GetInstance()->Moniter();						//执行数据
 		}
 	}

+ 10 - 2
TIN001-PLC/Jet_Furance_PMC/Jet_Furance_PMC/Jet_Furance_PMC/FurancePMC/RecipeContext.cpp

@@ -1310,8 +1310,16 @@ void RecipeContext::executeNextStep()
 			if (retcommand[i].Param[0] == '\0') continue;  // 跳过空元素
 			CommandMapST* rc = retcommand + i;
 			//LOG->Log(tlInfo, FLEAVEA"Command = %s,Param = %s", retcommand[i].Command, retcommand[i].Param);
-
-			auto retnode = OP->select(rc->Command);
+			static char opName[MAX_NAME_LEN];
+			opName[0] = '\0';
+			if (strcmp(rc->Command, "SetBoatMotion") == 0) {
+				//TODO:boat运动,第一个参数拼到命令中
+				sprintf(opName, "SetBoatMotion.%s", SC->getBaseName(rc->Param, ';'));
+			}
+			else {
+				strcpy(opName, rc->Command);
+			}
+			auto retnode = OP->select(opName);
 			retnode->setParams(rc->Param);
 			retnode->Do();