diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 76a27c7e..1678fc9d 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1999,7 +1999,62 @@ namespace Volian.Print.Library else if (vpo is vlnText) // As of 6/22/15, CP wants the step designator in the continue message also. { vpo.YOffset = yTopMargin; - MyPageHelper.TopMessageRs.Add(vpo as vlnText); + int nlcnt = 1; // number of lines to adjust the yoffset for the next step designator we are adding to TopMessageRs + string rtxt = ""; + int istr = 0; + int Rsidx = 0; + MyPageHelper.TopMessageRs.Add(vpo as vlnText); // this appends a previous step designator associated with this sub-step (there may be more than one and/or might have multiple lines) + // we are processing the step designator on the top continue message in reverse order + // we therefore need to adjust the y location of multiple step designors attached tothe top continue message + if (MyPageHelper.TopMessageRs.Count > 3) + { + Rsidx = MyPageHelper.TopMessageRs.Count - 1; + rtxt = MyPageHelper.TopMessageRs[Rsidx].Text; + // find the number of lines to shift existing TopMessageRs step designators down + istr = rtxt.IndexOf("\\line", 0); + while (istr != -1) + { + nlcnt++; + istr = rtxt.IndexOf("\\line", istr + 1); + } + // move the previous TopMessageRs step designators down + Rsidx -= 2; // index to the previous step desginator + while (Rsidx > 0) + { + MyPageHelper.TopMessageRs[Rsidx].YOffset -= (nlcnt * SixLinesPerInch); + Rsidx -= 2;// every other TopMessageRs is a step designator + } + } + // for Comanche Peak - if step breaks on a sub-step, and both the high level step and the sub-step have a step designator + // then since the high level step and its step designator are printed as part of the top continue message, + // move the step designator associated with the sub-step down so that it does not print on top of the + // ones in the top continue message. + if (this.PartsLeft.Count > 1) // was a step designator printed for the sub-step? + { + // count the number of lines in the step designator text in the top continue message + nlcnt = 0; // reset for the number of lines to push the sub-step's step designator down + Rsidx = MyPageHelper.TopMessageRs.Count - 1; // note that TopMessageRs[0] is a tab not a step designator + while (Rsidx > 0) + { + nlcnt++; + rtxt = MyPageHelper.TopMessageRs[Rsidx].Text; + istr = rtxt.IndexOf("\\line", 0); + while (istr != -1) + { + nlcnt++; + istr = rtxt.IndexOf("\\line", istr + 1); + } + Rsidx -= 2; // every other TopMessageRs is a step designator + } + if (nlcnt > 0) + { + for (int idx = 1; idx < this.PartsLeft.Count; idx++) + { + vlnPrintObject vpol = this.PartsLeft[idx]; + vpol.YOffset += (nlcnt * SixLinesPerInch); // move the existing step designator down + } + } + } } } }