WCNTRN :Implement printing of items for Wolf Creek Training format
This commit is contained in:
parent
c0dc3f174b
commit
ea525e2b0b
@ -1414,7 +1414,7 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
yPageStart = yTopMargin + YTopMost;
|
yPageStart = yTopMargin + YTopMost;
|
||||||
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
|
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
|
||||||
// KBR for WCNTRN work: SectionTopMessage(cb, yTopMargin, yLocation);
|
SectionTopMessage(cb, yTopMargin, yLocation);
|
||||||
if (doSectionContinue) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle , null);
|
if (doSectionContinue) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle , null);
|
||||||
// If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it
|
// If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it
|
||||||
if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && (!MyItemInfo.IsSection || MyItemInfo.IsSeparateSubsection))
|
if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && (!MyItemInfo.IsSection || MyItemInfo.IsSeparateSubsection))
|
||||||
@ -1553,7 +1553,7 @@ namespace Volian.Print.Library
|
|||||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
|
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// KBR for WCNTRN work:SectionTopMessage(cb, yTopMargin, yLocation);
|
SectionTopMessage(cb, yTopMargin, yLocation);
|
||||||
if (!doSectionTitleContinued || !SectionShowTitles)
|
if (!doSectionTitleContinued || !SectionShowTitles)
|
||||||
addExtraLines = DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, doThreeContinues && MyItemInfo.MyParent != null && MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.CleanText : null);
|
addExtraLines = DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, doThreeContinues && MyItemInfo.MyParent != null && MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.CleanText : null);
|
||||||
|
|
||||||
@ -1851,29 +1851,30 @@ namespace Volian.Print.Library
|
|||||||
ProfileTimer.Pop(profileDepth);
|
ProfileTimer.Pop(profileDepth);
|
||||||
return yPageStart;
|
return yPageStart;
|
||||||
}
|
}
|
||||||
// KBR: WCNTRN work
|
// For WCNTRN (Wolf Creek Training format): the following prints the section number (and continued, if
|
||||||
//private void SectionTopMessage(PdfContentByte cb, float yTopMargin, float yLocation)
|
// section is continued from previous page) in the Responsibility column.
|
||||||
//{
|
private void SectionTopMessage(PdfContentByte cb, float yTopMargin, float yLocation)
|
||||||
// if (MyItemInfo.MyDocStyle.SectTop != null && MyItemInfo.MyDocStyle.SectTop.Message != null)
|
{
|
||||||
// {
|
if (MyItemInfo.MyDocStyle.SectTop != null && MyItemInfo.MyDocStyle.SectTop.Message != null)
|
||||||
// float sectMsgY = CalculateYLocation(YTop, yTopMargin);
|
{
|
||||||
// if (MyPageHelper.YMultiplier != 1)
|
float sectMsgY = CalculateYLocation(YTop, yTopMargin);
|
||||||
// {
|
if (MyPageHelper.YMultiplier != 1)
|
||||||
// sectMsgY = -1 + yTopMargin - (yTopMargin - yLocation) * MyPageHelper.YMultiplier;
|
{
|
||||||
// }
|
sectMsgY = -1 + yTopMargin - (yTopMargin - yLocation) * MyPageHelper.YMultiplier;
|
||||||
// VE_Font sctMsgFont = MyItemInfo.MyDocStyle.SectTop.Font;
|
}
|
||||||
// string scttop = null;
|
VE_Font sctMsgFont = MyItemInfo.MyDocStyle.SectTop.Font;
|
||||||
// if (!MyItemInfo.IsStepSection && MyItemInfo.MyDocStyle.SectTop.Message != null)
|
string scttop = null;
|
||||||
// scttop = MyItemInfo.MyDocStyle.SectTop.Message.Replace("%s", (MyItemInfo.ActiveSection as SectionInfo).DisplayNumber);
|
if (!MyItemInfo.IsStepSection && MyItemInfo.MyDocStyle.SectTop.Message != null)
|
||||||
// else
|
scttop = MyItemInfo.MyDocStyle.SectTop.Message.Replace("%s", (MyItemInfo.ActiveSection as SectionInfo).DisplayNumber);
|
||||||
// scttop = (MyItemInfo as SectionInfo).DisplayNumber;
|
else
|
||||||
// float scttopWidth = scttop.Length * 6;
|
scttop = (MyItemInfo as SectionInfo).DisplayNumber;
|
||||||
// float ctr = (float)MyItemInfo.MyDocStyle.SectTop.Margin;
|
float scttopWidth = scttop.Length * 6;
|
||||||
// float sctcntrX = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ctr - (scttopWidth / 2);
|
float ctr = (float)MyItemInfo.MyDocStyle.SectTop.Margin;
|
||||||
// vlnText mySectMsg = new vlnText(cb, this, scttop, scttop, sctcntrX, sectMsgY, sctMsgFont);
|
float sctcntrX = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ctr - (scttopWidth / 2);
|
||||||
// PartsLeft.Add(mySectMsg);
|
vlnText mySectMsg = new vlnText(cb, this, scttop, scttop, sctcntrX, sectMsgY, sctMsgFont);
|
||||||
// }
|
PartsLeft.Add(mySectMsg);
|
||||||
//}
|
}
|
||||||
|
}
|
||||||
// Added to try to resolve a problem when printing FNP-1-FRP-I.3 Attachment 3 Table 1.
|
// Added to try to resolve a problem when printing FNP-1-FRP-I.3 Attachment 3 Table 1.
|
||||||
// May be needed to evaluate this problem in the future.
|
// May be needed to evaluate this problem in the future.
|
||||||
//private void CompareSectionInfo(SectionInfo si, SectionInfo si1)
|
//private void CompareSectionInfo(SectionInfo si, SectionInfo si1)
|
||||||
@ -3359,6 +3360,8 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// for WCNTRN, do the responsibility:
|
||||||
|
if (formatInfo.PlantFormat.FormatData.PrintData.WCNTraining) DoResponsibility(cb, YOffset);
|
||||||
float yOffRight = yoff;
|
float yOffRight = yoff;
|
||||||
float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO);
|
float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO);
|
||||||
if (DoSubs && rnoLevel < maxRNO && itemInfo.RNOs != null)
|
if (DoSubs && rnoLevel < maxRNO && itemInfo.RNOs != null)
|
||||||
@ -3518,6 +3521,17 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
yoff += (myRnoSep.Height + SixLinesPerInch);
|
yoff += (myRnoSep.Height + SixLinesPerInch);
|
||||||
}
|
}
|
||||||
|
// if in WCNTRN (Wolf Creek Training), need to consider the ysize of the Responsibility text when setting
|
||||||
|
// YBottomMost, i.e. if the Responsibilty has more height (y-direction) compared to the actual step text,
|
||||||
|
// need to move down on page the height of the responsibility.
|
||||||
|
if (formatInfo.PlantFormat.FormatData.PrintData.WCNTraining && MyItemInfo.IsHigh)
|
||||||
|
{
|
||||||
|
if (PartsLeft.Count > 0 && PartsLeft[0] is vlnText)
|
||||||
|
{
|
||||||
|
foreach (vlnText vt in PartsLeft)
|
||||||
|
yoff = Math.Max(yoff, vt.YOffset + vt.Height);
|
||||||
|
}
|
||||||
|
}
|
||||||
YBottomMost = yoff;
|
YBottomMost = yoff;
|
||||||
|
|
||||||
if ((MyItemInfo.IsHigh || MyItemInfo.IsCaution1) && MyItemInfo.MyDocStyle.LandscapePageList && MyItemInfo.MyDocStyle.ComponentList)
|
if ((MyItemInfo.IsHigh || MyItemInfo.IsCaution1) && MyItemInfo.MyDocStyle.LandscapePageList && MyItemInfo.MyDocStyle.ComponentList)
|
||||||
@ -3533,6 +3547,34 @@ namespace Volian.Print.Library
|
|||||||
if (XOffsetCenter != null) XOffset = (float)XOffsetCenter;
|
if (XOffsetCenter != null) XOffset = (float)XOffsetCenter;
|
||||||
ProfileTimer.Pop(profileDepth);
|
ProfileTimer.Pop(profileDepth);
|
||||||
}
|
}
|
||||||
|
private void DoResponsibility(PdfContentByte cb, float yoff) // WCNTRN's text in 1st column (saved in config for HLS)
|
||||||
|
{
|
||||||
|
StepConfig sc2 = MyItemInfo.MyConfig as StepConfig;
|
||||||
|
if (sc2 != null)
|
||||||
|
{
|
||||||
|
string resp = sc2.Step_Responsibility;
|
||||||
|
if (resp != null && resp != "") // lines are separated by "\r\n"
|
||||||
|
{
|
||||||
|
resp = resp.TrimEnd();
|
||||||
|
if (!resp.EndsWith("\r\n")) resp = resp + "\r\n"; // parsing needs this.
|
||||||
|
int indx = resp.IndexOf("\r\n");
|
||||||
|
int stindx = 0;
|
||||||
|
float y = yoff;
|
||||||
|
while (indx > -1)
|
||||||
|
{
|
||||||
|
string subresp = resp.Substring(stindx, indx - stindx);
|
||||||
|
float respWidth = subresp.Length * 6;
|
||||||
|
float ctr = (float)MyItemInfo.MyDocStyle.SectTop.Margin;
|
||||||
|
float respcntrX = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ctr - (respWidth / 2);
|
||||||
|
vlnText myResp = new vlnText(cb, this, subresp, subresp, respcntrX, y, MyItemInfo.FormatStepData.Font);
|
||||||
|
PartsLeft.Add(myResp);
|
||||||
|
y += SixLinesPerInch;
|
||||||
|
stindx = indx + 2;
|
||||||
|
indx = stindx < resp.Length ? resp.IndexOf("\r\n", stindx) : -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
public override string Rtf
|
public override string Rtf
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
Loading…
x
Reference in New Issue
Block a user