/// <summary> /// 在主线程中运行的测试项完成事件响应函数 /// </summary> /// <param name="flowItem"></param> private void ItemExecuteCompleteHandler(FlowItem flowItem) { Log.Debug("Item[" + flowItem.Id + "] " + flowItem.Item.Property.Name + " ItemExecuteCompleteHandler"); flowItem.Status = FlowItem.STATUS_FINISH; UpdatePhoneInfo(flowItem); UpdateFinish(flowItem); if (!flowItem.IsPass() && flowItem.SwitchType > 0) //检查是否需要switch { Switch(flowItem); } else if (!flowItem.IsPass() && flowItem.AlarmType > 0) //检查是否需要alarm { } else { NextFlowItem(flowItem); toolStripProgressBar.PerformStep(); } if (FlowComplete()) { FlowCompleteHandler(); } }
/// <summary> /// switch后的处理函数 /// </summary> /// <returns></returns> private void Switch(FlowItem flowItem) { if (flowItem.SwitchType > 0 && !flowItem.IsPass()) { StopFlowTest(); if (flowItem.SwitchType == FlowItem.SWITCH_TYPE_SWITCH) { FlowControl.Instance.FlowCompleteReason = FlowControl.FLOW_COMPLETE_SWITCH; FlowControl.Instance.FlowResult = FlowControl.FLOW_RESULT_FAIL; } else if (flowItem.SwitchType == FlowItem.SWITCH_TYPE_STOP) { FlowControl.Instance.FlowCompleteReason = FlowControl.FLOW_COMPLETE_STOP; FlowControl.Instance.FlowResult = FlowControl.FLOW_RESULT_EXCEPTION; } } }