/// <summary> /// Constructor /// </summary> /// <param name="lineNr">The line number in the test script output that represents the start of this item</param> /// <param name="timeStamp">The time and data of the moment this item was started</param> /// <param name="flowLineType">Marks if the item was started, ended or aborted</param> /// <param name="testItemType">The type of the item (Loop, Test batch etc.)</param> /// <param name="identifier">The name of the item</param> /// <param name="enabled">True if the item is executed;False otherwise</param> public TafScriptFlowLine(int lineNr, string timeStamp, FlowLineType flowLineType, TestItemType testItemType, string identifier, bool enabled) : base(lineNr, timeStamp, testItemType.ToString(), identifier, enabled) { FlowLineType = flowLineType; TestItemType = testItemType; if (TestItemType == TestItemType.TestBatch || TestItemType == TestItemType.NormalTestCase) { Value = Value.Replace(".xml", ""); Value = Value.Replace(".xls", ""); } if (TestItemType != TestItemType.NormalTestCase) { return; } if (!Value.Contains("(")) { return; } // The test case identifiers also contain the type of test case. Move this to the type field i.s.o. the value field Value = $"{Value} {Value.Substring(Value.IndexOf("(", StringComparison.Ordinal))}"; Value = Value.Substring(0, Value.IndexOf("(", StringComparison.Ordinal)); }
//******************************************************************* /// <summary>設定をクリック</summary> /// <param name="lineType">線のタイプ</param> /// <param name="item1">開始ジョブ</param> /// <param name="item2">終了ジョブ</param> /// <param name="flowType">フローのタイプ(True、False)</param> /// <param name="editType">編集タイプ</param> //******************************************************************* public void MakeFlow(FlowLineType lineType, IRoom item1, IRoom item2, int flowType, Consts.EditType editType) { Point startPos; Point endPos; IFlow flow = null; double flowWith = 0; // 直線の場合 if (FlowLineType.Line.Equals(lineType)) { flow = new Flow(); List <Point> connectPoints = CommonUtil.GetConnectPoints(item1, item2); if (connectPoints == null || connectPoints.Count != 2) { return; } startPos = connectPoints[0]; endPos = connectPoints[1]; flow.BeginPosition = connectPoints[0]; flow.EndPosition = connectPoints[1]; } // 曲線の場合 else if (FlowLineType.Curve.Equals(lineType)) { flow = new FlowArc(); List <Point> connectPoints = CommonUtil.GetConnectPointsForCurve(item1, item2); if (connectPoints == null || connectPoints.Count != 2) { return; } flow.BeginPosition = connectPoints[0]; flow.EndPosition = connectPoints[1]; // フロー幅 = 半径 flowWith = Point.Subtract(connectPoints[0], connectPoints[1]).Length; ((FlowArc)flow).arrow.Radius = flowWith * 0.65; ((FlowArc)flow).arrow.LineSweepDirection = SweepDirection.Clockwise; ((FlowArc)flow).arrow.InitCenterPosition(); } else { return; } AddFlow(flow, item1, item2, flowWith, editType); item1.AddBeginFlow(flow); item2.AddEndFlow(flow); flow.BeginItem = item1; flow.EndItem = item2; // フロータイプをセット if (FlowType.TRUE == (FlowType)flowType) { flow.SetTrue(editType); } if (FlowType.FALSE == (FlowType)flowType) { flow.SetFalse(editType); } }