public void ScriptUpdateWait(SeparationMethodStage stageType, string waitForSymbolName, bool addCommand) { ITimeStep stage = m_EditMethod.Stages.GetFirstTimeStepOfStage(stageType, addCommand); if (!addCommand && stage == null) { return; } string waitForSymbolPath = GetSymbolPath(m_Page, waitForSymbolName); ISymbolStep waitForSymbolStep = DDKHelper.FindStepInStage(CommandName.Wait, stage, new string[] { waitForSymbolPath }); if (addCommand) { if (waitForSymbolStep == null) { // System Wait always exist, therefore not checking for nulls ICommand command = m_EditMethod.SymbolTable.Child(CommandName.Wait) as ICommand; ICommandStep commandStep = m_Page.Component.CreateStep(command) as ICommandStep; string path = m_DeviceSymbol.Child(waitForSymbolName).Path; commandStep.Parameters[0].ValueExpression.Parse(path, ExpressionParseOptions.None); stage.SymbolSteps.Add(commandStep); } } else { if (waitForSymbolStep != null) { waitForSymbolStep.Remove(); } } }
public void ScriptUpdate(SeparationMethodStage stageType, string commandName, bool addCommand) { ITimeStep stage = m_EditMethod.Stages.GetFirstTimeStepOfStage(stageType, true); ICommand command = m_DeviceSymbol.Children[commandName] as ICommand; ISymbolStep commandStep = DDKHelper.FindStepInStage(command.Path, stage); if (addCommand) { if (commandStep == null) // The command is not in the script { command = m_DeviceSymbol.Child(commandName) as ICommand; commandStep = m_Page.Component.CreateStep(command) as ICommandStep; stage.SymbolSteps.Add(commandStep); } } else // Remove Command { if (commandStep != null) // The command is in the script { commandStep.Remove(); } } }