public string cmdTRANSChildProcess(ref clsCommonCommandGuider clsInput) { if (!(clsInput.objSources is clsChildProcessModel)) { return("cmdTRANSChildProcess: Not class acceptable!"); } clsChildProcessModel clsChildProcess = (clsChildProcessModel)clsInput.objSources; if (clsInput.args.Parameters == null) { return("cmdTRANSChildProcess() error: null parameter"); } if (clsInput.args.Parameters.Length != 2) { return("cmdTRANSChildProcess() error: input " + clsInput.args.Parameters.Length.ToString() + " parameter is invalid"); } //Function Desc int intStepRet = 0; int intTargetStepPos = 0; int intOption = 0; string strTemp = ""; strTemp = clsInput.args.Parameters[0].Evaluate().ToString(); if (int.TryParse(strTemp, out intStepRet) == false) { return("Parameter for TRANS function is not numeric: " + strTemp); } strTemp = clsInput.args.Parameters[1].Evaluate().ToString(); if (int.TryParse(strTemp, out intOption) == false) { return("Option parameter is not numeric: " + strTemp); } //Check if step number want to return data is exist in step list or not intTargetStepPos = clsChildProcess.FindCheckingStepPos(intStepRet); if (intTargetStepPos == -1) { return("TRANS() function NG: No found step " + intStepRet.ToString() + " in step list"); } //Return value if (intOption == 1) { return(clsChildProcess.lstTotalStep[intTargetStepPos].strTransmisstionEx); //Return transmission value which is already done special command if exist } else { return(clsChildProcess.lstTotalStep[intTargetStepPos].strTransmisstion); //Return origin transmission value } }
public object cmdRETChildProcess(ref clsCommonCommandGuider clsInput) { if (!(clsInput.objSources is clsChildProcessModel)) { return("cmdRETChildProcess: Not class acceptable!"); } clsChildProcessModel clsChildProcess = (clsChildProcessModel)clsInput.objSources; int intStepRet = 0; int intTargetStepPos = 0; if (clsInput.args.Parameters == null) { return("cmdRETChildProcess() error: null parameter"); } if (clsInput.args.Parameters.Length > 1) { return("cmdRETChildProcess() error: input " + clsInput.args.Parameters.Length.ToString() + " parameter is invalid"); } string parameter = clsInput.args.Parameters[0].Evaluate().ToString().Trim(); if (parameter == "") //Get current step result { intTargetStepPos = clsInput.intStepPos; } else //Get another step result { string strTemp = ""; strTemp = clsInput.args.Parameters[0].Evaluate().ToString(); if (int.TryParse(strTemp, out intStepRet) == false) { return("Parameter for RET function is not numeric: " + strTemp); } //Check if step number want to return data is exist in step list or not intTargetStepPos = clsChildProcess.FindCheckingStepPos(intStepRet); if (intTargetStepPos == -1) { return("cmdRETChildProcess() Error: No found step " + strTemp.ToString() + " in step list"); } } //If every OK. Then, we get return of step parameter and assign new value for current parameter return(clsChildProcess.lstTotalStep[intTargetStepPos].objStepCheckingData); }
public object cmdGETLISTChildProcess(ref clsCommonCommandGuider clsInput) { if (!(clsInput.objSources is clsChildProcessModel)) { return("cmdGETLISTChildProcess: Not class acceptable!"); } clsChildProcessModel clsChildProcess = (clsChildProcessModel)clsInput.objSources; //if (clsInput.lstobjCmdPara.Count < 2) return "cmdGETLISTChildProcess() Error: not enough parameter"; if (clsInput.args.Parameters.Length != 2) { return("cmdGETLISTChildProcess() Error: input " + clsInput.args.Parameters.Length.ToString() + " parameter is invalid"); } int intStepRet = 0; int intTargetStepPos = 0; List <object> lstobjRet = new List <object>(); string strTemp = ""; strTemp = clsInput.args.Parameters[1].Evaluate().ToString(); if (int.TryParse(strTemp, out intStepRet) == false) { return("Parameter for cmdGETLISTChildProcess function is not numeric: " + strTemp); } //Check if step number want to return data is exist in step list or not intTargetStepPos = clsChildProcess.FindCheckingStepPos(intStepRet); if (intTargetStepPos == -1) { return("cmdGETLISTChildProcess() Error: No found step " + intStepRet.ToString() + " in step list"); } //If every OK. Then, we get return of step parameter and assign new value for current parameter bool blFlagFound = false; strTemp = clsInput.args.Parameters[0].Evaluate().ToString(); foreach (List <object> lstTemp in clsChildProcess.lstTotalStep[intTargetStepPos].clsStepDataRet.lstlstobjDataReturn) { if (lstTemp[0].ToString().ToUpper().Trim() == strTemp.ToUpper().Trim()) //Matching user description { if (lstTemp.Count < 2) { return("cmdGETLISTChildProcess() error: there is no seri element"); } int i = 0; for (i = 1; i < lstTemp.Count; i++) //Create seri string { lstobjRet.Add(lstTemp[i]); } blFlagFound = true; break; } } if (blFlagFound == false) { return("cmdGETLISTChildProcess() error: cannot find any list of data return have description: " + strTemp + "!"); } return(lstobjRet); }
public object cmdUSERRETChildProcess(ref clsCommonCommandGuider clsInput) { //UserRet(McrUsb,4,2) //Function Desc // +strUserDesc: string to describe what need to looking for to return. Ex: "McrUsb" , "MainUsb", "DumMainUsb"... this come from user plug-in // +strStepRet: the step number want to get return value // +strPosition: the position of data in list of user data want to get return. Count from Zero. // +intStepPos: the position of step in all step which are running, count from Zero // +intParamOrder: the position of executing parameter in all parameter of step which are running // *Return: return value of target step if (!(clsInput.objSources is clsChildProcessModel)) { return("cmdTRANSChildProcess: Not class acceptable!"); } clsChildProcessModel clsChildProcess = (clsChildProcessModel)clsInput.objSources; //if (clsInput.lstobjCmdPara.Count < 3) return "cmdUSERRETChildProcess() Error: not enough parameter"; if (clsInput.args.Parameters.Length != 3) { return("cmdUSERRETChildProcess() Error: input " + clsInput.args.Parameters.Length.ToString() + " parameter is invalid"); } int intStepRet = 0; int intTargetStepPos = 0; object objRet = ""; string strTemp = ""; strTemp = clsInput.args.Parameters[1].Evaluate().ToString(); if (int.TryParse(strTemp, out intStepRet) == false) { return("Parameter for USERRET function is not numeric: " + strTemp); } //Check if step number want to return data is exist in step list or not intTargetStepPos = clsChildProcess.FindCheckingStepPos(intStepRet); if (intTargetStepPos == -1) { return("USERRET() function NG: No found step " + intStepRet.ToString() + " in step list"); } //Check position to get data int intPos = 0; strTemp = clsInput.args.Parameters[2].Evaluate().ToString(); if (int.TryParse(strTemp, out intPos) == false) { return("USERRET() error: Second parameter input [" + strTemp + "] is not integer format!"); } //If every OK. Then, we get return of step parameter and assign new value for current parameter bool blFlagFound = false; strTemp = clsInput.args.Parameters[0].Evaluate().ToString(); foreach (List <object> lstTemp in clsChildProcess.lstTotalStep[intTargetStepPos].clsStepDataRet.lstlstobjDataReturn) { if (lstTemp[0].ToString().ToUpper().Trim() == strTemp.ToUpper().Trim()) //Found { if ((lstTemp.Count - 1) < (intPos + 1)) //error { return("error"); } objRet = lstTemp[intPos + 1]; //Not counting lstTemp[0] : description for list of return data blFlagFound = true; break; } } if (blFlagFound == false) { return("cmdUSERRETChildProcess Error: cannot find any list of data return have description: " + strTemp + "!"); } return(objRet); }