|
|
|
@@ -71,11 +71,16 @@ namespace Volian.Print.Library
|
|
|
|
|
bool didComponentTableRow = false;
|
|
|
|
|
float tableBottomMost = 0;
|
|
|
|
|
float xoffBase = xoff;
|
|
|
|
|
int prevTplRow = 0;
|
|
|
|
|
int maxRnoSav = maxRNO;
|
|
|
|
|
foreach (ItemInfo iChildItemInfo in itemInfoList)
|
|
|
|
|
{
|
|
|
|
|
maxRNO = maxRnoSav;
|
|
|
|
|
if (iChildItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.DiffContActBox && iChildItemInfo.IsHigh) bxIndex = null;
|
|
|
|
|
if (iChildItemInfo.IsSection && (iChildItemInfo as SectionInfo).ColumnMode != maxRNO)
|
|
|
|
|
maxRNO = (iChildItemInfo as SectionInfo).ColumnMode;
|
|
|
|
|
int maxRnoTemplate = iChildItemInfo.TemplateChildColumnMode;
|
|
|
|
|
if (maxRnoTemplate >= 0) maxRNO = maxRnoTemplate-1;
|
|
|
|
|
ItemInfo childItemInfo = iChildItemInfo;
|
|
|
|
|
int? bxIndx = childItemInfo.FormatStepData == null ? -1 : childItemInfo.FormatStepData.StepLayoutData.STBoxindex;
|
|
|
|
|
// if the Caution or Note is not boxed, then use ColT to set the starting column of the Note or Caution
|
|
|
|
@@ -89,13 +94,41 @@ namespace Volian.Print.Library
|
|
|
|
|
// by the first level of children. The data for the column is the child of the column header.
|
|
|
|
|
// Sometimes the column will not have data, the following handles that case. Also, use
|
|
|
|
|
// the boolean didComponentTableRow to keep track of the bottom most yoff of the table row.
|
|
|
|
|
if ((childItemInfo.MyDocStyle.ComponentList) && childItemInfo.MyParent.IsInTemplate())
|
|
|
|
|
if ((childItemInfo.MyDocStyle.ComponentList) && childItemInfo.MyParent.IsInTemplate()||
|
|
|
|
|
(childItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && childItemInfo.IsInTemplate()))
|
|
|
|
|
{
|
|
|
|
|
// childItemInfo = 'child' and set to use a template for defining size.
|
|
|
|
|
if (childItemInfo.Steps == null)
|
|
|
|
|
continue;
|
|
|
|
|
if (childItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
|
|
|
|
{
|
|
|
|
|
// if this template element has a -1 for row, print it (if = 0 this is a heading for edit
|
|
|
|
|
// and not printed). if this template element has a width of 0, then also print it,
|
|
|
|
|
// these are headings and should be printed). This was added for Calvert Alarm (BGEALN) format for
|
|
|
|
|
// DEVICE/SETPOINT (row=-1), and for POSSIBLE CAUSES, AUTOMATIC ACTIONS, etc (width=0)
|
|
|
|
|
// find the indexes into the template for this item. The index must be for the HLS this is
|
|
|
|
|
// or this is under.
|
|
|
|
|
int tindx = childItemInfo.TemplateIndex;
|
|
|
|
|
if (tindx == -1)
|
|
|
|
|
xoff = (float)childItemInfo.MyDocStyle.Layout.LeftMargin;
|
|
|
|
|
else if (childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row < 0 ||
|
|
|
|
|
childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].width == 0)
|
|
|
|
|
{
|
|
|
|
|
// move down for the 'POSSIBLE CAUSES'. To know it's that step type, check
|
|
|
|
|
// the column field in template. -1 represents staying on same row but using
|
|
|
|
|
// the start template field to get the xoffset.
|
|
|
|
|
if (prevTplRow == -1 && prevTplRow != childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row)
|
|
|
|
|
{
|
|
|
|
|
// position to the furthest down the page of the Device/setpoint/annunciator window:
|
|
|
|
|
yoff = Math.Max(yoff, Parent.YBottomMost + vlnPrintObject.SixLinesPerInch);
|
|
|
|
|
yoff = Math.Max(yoff, tableBottomMost + vlnPrintObject.SixLinesPerInch);
|
|
|
|
|
}
|
|
|
|
|
xoff = (float)childItemInfo.MyDocStyle.Layout.LeftMargin + (childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].start * 7.2f);
|
|
|
|
|
prevTplRow = childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// childItemInfo = 'child' and set to use a template for defining size.
|
|
|
|
|
if (childItemInfo.Steps == null)
|
|
|
|
|
continue;
|
|
|
|
|
childItemInfo = childItemInfo.Steps[0];
|
|
|
|
|
didComponentTableRow = true;
|
|
|
|
|
}
|
|
|
|
@@ -237,6 +270,11 @@ namespace Volian.Print.Library
|
|
|
|
|
para.PartsContainer.Add(box);
|
|
|
|
|
}
|
|
|
|
|
Add(para);
|
|
|
|
|
|
|
|
|
|
// Calvert Alarm's caution1 is the Annunciator window, i.e. in top right of page. Adjust
|
|
|
|
|
// y offset for this caution that is printed BELOW the hls.
|
|
|
|
|
if (childItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && iChildItemInfo.IsCaution1) para.MyHighLevelParagraph.YBottomMost = para.YBottomMost;
|
|
|
|
|
|
|
|
|
|
// para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box.
|
|
|
|
|
if (childItemInfo.IsStep && childItemInfo.MyHLS != null && childItemInfo.MyHLS.FormatStepData.UseSmartTemplate && para.ChildrenBelow.Count > 0 && para.ChildrenBelow[0].YBottomMost > para.YBottomMost)
|
|
|
|
|
yoff = para.ChildrenBelow[0].YBottomMost;
|
|
|
|
@@ -314,6 +352,7 @@ namespace Volian.Print.Library
|
|
|
|
|
get { return _PageBreakOnStep; }
|
|
|
|
|
set { _PageBreakOnStep = value; }
|
|
|
|
|
}
|
|
|
|
|
private bool HasCalvertMacro = false; // this step has the Calvert (BGE) Alarm CONDITION/RESPONSE macro associated with it
|
|
|
|
|
private float WidthNoLimit = 0;
|
|
|
|
|
private vlnTable _MyGrid;
|
|
|
|
|
public vlnTable MyGrid
|
|
|
|
@@ -687,9 +726,17 @@ namespace Volian.Print.Library
|
|
|
|
|
if(DebugText.IsOpen)DebugText.WriteLine("{0},'{1}','{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText);
|
|
|
|
|
//Console.WriteLine("{0},{1},'{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content);
|
|
|
|
|
float retval = yLocation;
|
|
|
|
|
// Calvert Alarms have a special case, center text if the next/previous is not the same type of caution or note.
|
|
|
|
|
// Calvert Alarms have a note1 that is a warning. if a regular note preceeded it, this regular note was not centered.
|
|
|
|
|
bool doAlign = false;
|
|
|
|
|
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
|
|
|
|
{
|
|
|
|
|
if ((MyItemInfo.MyPrevious != null && MyItemInfo.MyContent.Type != MyItemInfo.MyPrevious.MyContent.Type)||
|
|
|
|
|
(MyItemInfo.GetNextItem() != null && MyItemInfo.MyContent.Type != MyItemInfo.GetNextItem().MyContent.Type)) doAlign = true;
|
|
|
|
|
}
|
|
|
|
|
// Check if only one line, i.e. "Height < (1.2F * IParagraph.Leading". The Leading can be for six or seven lines per inch, so the 1.2
|
|
|
|
|
// multiplier accounts for both.
|
|
|
|
|
if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.CenterOneLineOnly && ((MyItemInfo.MyPrevious == null && MyItemInfo.GetNextItem() == null) || MyItemInfo.FormatStepData.SeparateBox) && Height < (1.2F * IParagraph.Leading))
|
|
|
|
|
if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.CenterOneLineOnly && ((MyItemInfo.MyPrevious == null && MyItemInfo.GetNextItem() == null) || MyItemInfo.FormatStepData.SeparateBox || doAlign) && Height < (1.2F * IParagraph.Leading))
|
|
|
|
|
IParagraph.Alignment = Element.ALIGN_CENTER;
|
|
|
|
|
// if this step is centered, but not part of the checklist or valvelist format, use itextsharp to center it.
|
|
|
|
|
// if it was part of the checklist or valvelist, then the centering is based on the column definitions for the table and
|
|
|
|
@@ -837,6 +884,7 @@ namespace Volian.Print.Library
|
|
|
|
|
}
|
|
|
|
|
public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin)
|
|
|
|
|
{
|
|
|
|
|
bool doThreeContinues = false;
|
|
|
|
|
// For BGE, the very first subsection's pagelist items were not correct - the section/meta section titles were
|
|
|
|
|
// at the wrong level. Reset the page helper's section.
|
|
|
|
|
if (MyItemInfo.IsSection && MyItemInfo.MyPrevious == null && MyItemInfo.MyParent.IsSection && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseWestinghouse)
|
|
|
|
@@ -845,6 +893,13 @@ namespace Volian.Print.Library
|
|
|
|
|
MyPageHelper.ResetSvg();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// For Calvert Alarms: A macro exists around the CONDITION/RESPONSE portion. If the page break occurs so that
|
|
|
|
|
// this 'table' moved to the following page AND there is an associated note/caution that is not on the next page,
|
|
|
|
|
// remove the macro so that the header macro doesn't print on the page with the note (without this, an extraneous
|
|
|
|
|
// header for the 'table'is printed.
|
|
|
|
|
if (PartsLeft.Count != 0 && (PartsLeft[0] is vlnMacro) && MyPageHelper.ParaBreaks.Count != 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.MyPrevious == null)
|
|
|
|
|
if (!MyPageHelper.ParaBreaks[0].MyItemInfo.IsNote && !MyPageHelper.ParaBreaks[0].MyItemInfo.IsCaution) PartsLeft.Clear();
|
|
|
|
|
|
|
|
|
|
if (IsWordDocPara)
|
|
|
|
|
{
|
|
|
|
|
PdfReader tmp = null;
|
|
|
|
@@ -880,7 +935,7 @@ namespace Volian.Print.Library
|
|
|
|
|
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
|
|
|
|
docstyle = MyItemInfo.MyDocStyle;
|
|
|
|
|
bool doSectionContinue = !MyItemInfo.IsSection && ((docstyle.StructureStyle.Style & E_DocStructStyle.BottomSectionContinue) == E_DocStructStyle.BottomSectionContinue);
|
|
|
|
|
if (doSectionContinue) DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle);
|
|
|
|
|
if (doSectionContinue) DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle, false);
|
|
|
|
|
cb.PdfDocument.NewPage();
|
|
|
|
|
//_MyLog.InfoFormat("NewPage 10 {0}", cb.PdfWriter.CurrentPageNumber);
|
|
|
|
|
if (MyItemInfo.IsSection && MyParent != null && MyParent.MyItemInfo.IsSection && (MyItemInfo as SectionInfo).IsSeparatePagination())
|
|
|
|
@@ -917,7 +972,7 @@ namespace Volian.Print.Library
|
|
|
|
|
yPageStart = yTopMargin + YTopMost;
|
|
|
|
|
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
|
|
|
|
|
|
|
|
|
|
if (doSectionContinue) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle);
|
|
|
|
|
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 (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader)
|
|
|
|
|
{
|
|
|
|
@@ -929,7 +984,31 @@ namespace Volian.Print.Library
|
|
|
|
|
case 2: // Break within a Step
|
|
|
|
|
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
|
|
|
|
|
docstyle = MyItemInfo.MyDocStyle;
|
|
|
|
|
DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle);
|
|
|
|
|
bool doAlarmBox = false;
|
|
|
|
|
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
// Recognize that the break occurred WITHIN the CONDITION/RESPONSE table.
|
|
|
|
|
// Otherwise, we get extraneous header/top of box lines in pdf.
|
|
|
|
|
if (MyPageHelper.AlarmYoffStart > 0)
|
|
|
|
|
{
|
|
|
|
|
// if the first step in box is what broke to next page, then
|
|
|
|
|
// don't print the box on this page, only print it on next page:
|
|
|
|
|
if (MyItemInfo.MyPrevious == null)
|
|
|
|
|
MyPageHelper.AlarmYoffStart = 0;
|
|
|
|
|
else if (MyPageHelper.AlarmYoffEnd == 0)
|
|
|
|
|
{
|
|
|
|
|
// doThreeContinues flags when continue messages are printed in the
|
|
|
|
|
// bottom of the CONDITION/RESPONSE table columns.
|
|
|
|
|
doThreeContinues = MyItemInfo.StepLevel>1;
|
|
|
|
|
MyPageHelper.AlarmYoffEnd = CalculateYLocation(yLocation, yTopMargin);
|
|
|
|
|
}
|
|
|
|
|
doAlarmBox = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle, doThreeContinues);
|
|
|
|
|
cb.PdfDocument.NewPage();
|
|
|
|
|
//_MyLog.InfoFormat("NewPage 11 {0}", cb.PdfWriter.CurrentPageNumber);
|
|
|
|
|
ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
|
|
|
|
@@ -967,7 +1046,7 @@ namespace Volian.Print.Library
|
|
|
|
|
yPageStart = yTopMargin + yTopMost;// -2 * SixLinesPerInch;
|
|
|
|
|
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
|
|
|
|
|
if (EmptyTopMostPart) yPageStart += SixLinesPerInch;
|
|
|
|
|
DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle);
|
|
|
|
|
DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, doThreeContinues?"2 ":null);
|
|
|
|
|
|
|
|
|
|
// If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it
|
|
|
|
|
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader)
|
|
|
|
@@ -977,6 +1056,17 @@ namespace Volian.Print.Library
|
|
|
|
|
}
|
|
|
|
|
MyPageHelper.YMultiplier = 1;
|
|
|
|
|
|
|
|
|
|
// For Calvert Alarms, if there was a page break and there is an box around the current
|
|
|
|
|
// step, need to add the header for the box, which is stored in a macro. Also set the
|
|
|
|
|
// 'AlarmYoffStart' value to where the vertical lines of the box start on this page.
|
|
|
|
|
if (doAlarmBox && MyItemInfo.StepLevel>1)
|
|
|
|
|
{
|
|
|
|
|
float alrmY = CalculateYOffset(yPageStart, yTopMargin);
|
|
|
|
|
PartsLeft.Add(new vlnMacro((float)docstyle.Layout.LeftMargin - 12, YOffset-(4*SixLinesPerInch), "H4")); // probably not the right paragraph?
|
|
|
|
|
MyPageHelper.AlarmYoffStart = alrmY - SixLinesPerInch;
|
|
|
|
|
yPageStart -= (4 * SixLinesPerInch);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Now check if this is a template type step & if so, add the HLS's prefix/suffix to it.
|
|
|
|
|
if (MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate)
|
|
|
|
|
{
|
|
|
|
@@ -1055,6 +1145,20 @@ namespace Volian.Print.Library
|
|
|
|
|
MyPageHelper.ParaBreaks.RemoveAt(0);
|
|
|
|
|
yPageStart = yTopMargin + YTop;
|
|
|
|
|
}
|
|
|
|
|
// The following sets the beginning/ending y location for the lines around the
|
|
|
|
|
// CONDITION/RESPONSE text for Calvert Alarm format
|
|
|
|
|
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
|
|
|
|
{
|
|
|
|
|
int tindx = MyItemInfo.TemplateIndex;
|
|
|
|
|
if (tindx >= 0)
|
|
|
|
|
{
|
|
|
|
|
// save this position to start drawing the alarm box lines around substeps:
|
|
|
|
|
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[MyItemInfo.TemplateIndex].row > 0)
|
|
|
|
|
MyPageHelper.AlarmYoffStart = CalculateYOffset(yPageStart, yTopMargin) - SixLinesPerInch;
|
|
|
|
|
else if (MyPageHelper.AlarmYoffStart > 0 && MyPageHelper.AlarmYoffEnd == 0)
|
|
|
|
|
MyPageHelper.AlarmYoffEnd = CalculateYOffset(yPageStart, yTopMargin) + (2 * SixLinesPerInch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yPageStart = ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin);
|
|
|
|
|
// If the yPageStart changes by more than a small amount (pagination) in the RNO (right column), then update
|
|
|
|
|
// yPageStart for the AER (left column).
|
|
|
|
@@ -1133,7 +1237,7 @@ namespace Volian.Print.Library
|
|
|
|
|
return yPageStart;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DoTopContinueMsg(PdfContentByte cb, ref float yPageStart, float yTopMargin, DocStyle docstyle)
|
|
|
|
|
private void DoTopContinueMsg(PdfContentByte cb, ref float yPageStart, float yTopMargin, DocStyle docstyle, string subTab)
|
|
|
|
|
{
|
|
|
|
|
string myMsg = docstyle.Continue.Top.Message;
|
|
|
|
|
MyPageHelper.TopMessageR = null;
|
|
|
|
@@ -1186,6 +1290,27 @@ namespace Volian.Print.Library
|
|
|
|
|
myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray()));
|
|
|
|
|
if (myMsg.IndexOf(@"%c") > -1)
|
|
|
|
|
myMsg = myMsg.Replace(@"%c", " ");
|
|
|
|
|
|
|
|
|
|
// Calvert Alarms, step description have the alarm number as part of the top continue message
|
|
|
|
|
// Also, if the break is within the CONDITION/RESPONSE, there are continue messages in both columns at the top
|
|
|
|
|
// of the table, note that the continue messages WITHIN table are only printed when the
|
|
|
|
|
// steplevel is greater than 2 - this is from 16bit.
|
|
|
|
|
// NOTE THAT this code is not complete - the positioning & addition of step tab for within table are not working correctly
|
|
|
|
|
if ((docstyle.Continue.Top.HLS ?? 0) == 3)
|
|
|
|
|
{
|
|
|
|
|
string HLSTabTextForContMsg = MyHighLevelParagraph.MyItemInfo.MyTab.CleanText + " " + MyHighLevelParagraph.MyItemInfo.MyContent.Text;
|
|
|
|
|
int len = (HLSTabTextForContMsg.Length - 10) * 6;
|
|
|
|
|
HLSTabTextForContMsg = @"\ul\b " + MyHighLevelParagraph.MyItemInfo.MyTab.CleanText.Trim() + @" \b0\ulnone \b " + MyHighLevelParagraph.MyItemInfo.MyContent.Text + @"\b0";
|
|
|
|
|
MyPageHelper.TopMessageR = new vlnText(cb, this, HLSTabTextForContMsg, HLSTabTextForContMsg, (float)docstyle.Layout.PageWidth - len, yTopMargin + 0.1F, docstyle.Continue.Top.Font);
|
|
|
|
|
if (subTab != null && MyItemInfo.StepLevel > 2)
|
|
|
|
|
{
|
|
|
|
|
float ybot = yTopMargin + (4 * SixLinesPerInch);
|
|
|
|
|
float xoffB = (float)docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0;
|
|
|
|
|
MyPageHelper.TopMessageSub1 = new vlnText(cb, this, myMsg, myMsg, xoffB, ybot, docstyle.Continue.Bottom.Font);
|
|
|
|
|
xoffB = docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.MarginR ?? 0;
|
|
|
|
|
MyPageHelper.TopMessageSub2 = new vlnText(cb, this, myMsg, myMsg, xoffB, ybot, docstyle.Continue.Bottom.Font);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!PageBreakOnStep)
|
|
|
|
|
MyPageHelper.TopMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Top.Margin ?? 0, yTopMargin + 0.1F, docstyle.Continue.Top.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font);
|
|
|
|
|
else
|
|
|
|
@@ -1193,7 +1318,7 @@ namespace Volian.Print.Library
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DoBottomContinueMsg(PdfContentByte cb, float yBottomMargin, float yLocation, DocStyle docstyle)
|
|
|
|
|
private void DoBottomContinueMsg(PdfContentByte cb, float yBottomMargin, float yLocation, DocStyle docstyle, bool doThreeContinues)
|
|
|
|
|
{
|
|
|
|
|
string myMsg = docstyle.Continue.Bottom.Message;
|
|
|
|
|
|
|
|
|
@@ -1248,6 +1373,9 @@ namespace Volian.Print.Library
|
|
|
|
|
case E_ContBottomLoc.BelowBottom1:
|
|
|
|
|
msg_yLocation = msg_yLocation + yBtmMarginForMsg;
|
|
|
|
|
break;
|
|
|
|
|
case E_ContBottomLoc.BottomWithFooter: // put bottom message AND if in CONDITION/RESPONSE table, in both columns.
|
|
|
|
|
msg_yLocation = msg_yLocation + yBtmMarginForMsg;
|
|
|
|
|
break;
|
|
|
|
|
case E_ContBottomLoc.EndOfText2: // Like EndOfText but limited within yBottomMargin
|
|
|
|
|
msg_yLocation = Math.Max(msg_yLocation + yLocation - SixLinesPerInch, yBottomMargin + SixLinesPerInch);
|
|
|
|
|
break;
|
|
|
|
@@ -1264,7 +1392,25 @@ namespace Volian.Print.Library
|
|
|
|
|
if (!PageBreakOnStep)
|
|
|
|
|
{
|
|
|
|
|
float xoffB = 0;
|
|
|
|
|
if (RNOContinueOnly)
|
|
|
|
|
// Added for Calvert Alarms: if 'doThreeContinues', continue message at bottom of page
|
|
|
|
|
// and a continue message at the bottom of each column.
|
|
|
|
|
if (doThreeContinues)
|
|
|
|
|
{
|
|
|
|
|
float ybot = yLocation;
|
|
|
|
|
xoffB = (float)docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0;
|
|
|
|
|
MyPageHelper.BottomMessageA = new vlnText(cb, this, myMsg, myMsg, xoffB, ybot, docstyle.Continue.Bottom.Font);
|
|
|
|
|
xoffB = docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.MarginR ?? 0;
|
|
|
|
|
MyPageHelper.BottomMessageR = new vlnText(cb, this, myMsg, myMsg, xoffB, ybot, docstyle.Continue.Bottom.Font);
|
|
|
|
|
MyPageHelper.AlarmYoffEnd -= SixLinesPerInch;
|
|
|
|
|
float tmp = (((float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin) / 2) - (myMsg.Length / 2 * 5);
|
|
|
|
|
xoffB = (float)docstyle.Layout.LeftMargin + tmp;
|
|
|
|
|
}
|
|
|
|
|
else if (docstyle.Continue.Bottom.Location == E_ContBottomLoc.BottomWithFooter)
|
|
|
|
|
{
|
|
|
|
|
float tmp = (((float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin) / 2) - (myMsg.Length / 2 * 5);
|
|
|
|
|
xoffB = (float)docstyle.Layout.LeftMargin + tmp;
|
|
|
|
|
}
|
|
|
|
|
else if (RNOContinueOnly)
|
|
|
|
|
{
|
|
|
|
|
// The following line was added for McGuire APs/AP/1/5500/12, Step 13
|
|
|
|
|
//if (msg_yLocation < yBottomMargin + SixLinesPerInch) msg_yLocation = yBottomMargin + SixLinesPerInch;
|
|
|
|
@@ -1555,6 +1701,17 @@ namespace Volian.Print.Library
|
|
|
|
|
}
|
|
|
|
|
public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix, float yoffRightParent)
|
|
|
|
|
{
|
|
|
|
|
// do some 'setup' for Calvert Alarms:
|
|
|
|
|
if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
|
|
|
|
{
|
|
|
|
|
// The CONDITION/RESPONSE portion of the alarm uses a macro to print the 'table' heading,
|
|
|
|
|
// i.e. the lines/boxes and text for CONDITION and RESPONSE. This does not have a tab,
|
|
|
|
|
// tabs are where the macros are usually stored, so flag this for future reference.
|
|
|
|
|
// The 2nd if is executed when the step is at the same y offset as the parent, i.e. DEVICE & SETPOINT text.
|
|
|
|
|
if (itemInfo.TemplateIndex > 0 && itemInfo.ActiveFormat.PlantFormat.FormatData.Templates[itemInfo.TemplateIndex].hmacro > 0)
|
|
|
|
|
HasCalvertMacro = true;
|
|
|
|
|
if (KeepOnParentLine(itemInfo)) yoff = parent.YOffset;
|
|
|
|
|
}
|
|
|
|
|
float yOffOrig = yoff;
|
|
|
|
|
BuildPlacekeeper(parent, itemInfo);
|
|
|
|
|
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj != null)
|
|
|
|
@@ -1747,7 +1904,7 @@ namespace Volian.Print.Library
|
|
|
|
|
if (itemInfo.IsInRNO)
|
|
|
|
|
{
|
|
|
|
|
XOffset = MyTopRNO.MyTab != null ? MyTopRNO.MyTab.XOffset : MyTopRNO.XOffset;
|
|
|
|
|
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - XOffset - 10; // subtract 10 (about a character) so it doesn't touch line
|
|
|
|
|
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - XOffset - 10;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@@ -1763,20 +1920,20 @@ namespace Volian.Print.Library
|
|
|
|
|
float yoffLeft = yoff;
|
|
|
|
|
if (ChildrenAbove != null)
|
|
|
|
|
ChildrenAbove.StepDesignator = null; //reset StepDesignator
|
|
|
|
|
if (itemInfo.Cautions != null && !(itemInfo.IsCaution || itemInfo.IsNote))
|
|
|
|
|
if (itemInfo.Cautions != null && (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || itemInfo.Cautions[0].FormatStepData.Type != "Caution1") && !(itemInfo.IsCaution || itemInfo.IsNote))
|
|
|
|
|
{
|
|
|
|
|
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
|
|
|
|
|
{
|
|
|
|
|
// For deviations, the Cautions are always in the same place.
|
|
|
|
|
// Fix for Catawba E-1 deviation for step 10. Has note/caution off of a paragraph instead of HLS
|
|
|
|
|
float xoffDev = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
|
|
|
|
yoffLeft = ChildrenLeft.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (yoffRightParent > yoff && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) != E_DocStructStyle.DoubleBoxHLS)) yoff = yoffRightParent;
|
|
|
|
|
yoff = ChildrenAbove.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
|
|
|
|
|
}
|
|
|
|
|
if (itemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
|
|
|
|
|
{
|
|
|
|
|
// For deviations, the Cautions are always in the same place.
|
|
|
|
|
// Fix for Catawba E-1 deviation for step 10. Has note/caution off of a paragraph instead of HLS
|
|
|
|
|
float xoffDev = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
|
|
|
|
yoffLeft = ChildrenLeft.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (yoffRightParent > yoff && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) != E_DocStructStyle.DoubleBoxHLS)) yoff = yoffRightParent;
|
|
|
|
|
yoff = ChildrenAbove.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (itemInfo.Notes != null && !(itemInfo.IsCaution || itemInfo.IsNote))
|
|
|
|
|
{
|
|
|
|
@@ -1793,7 +1950,7 @@ namespace Volian.Print.Library
|
|
|
|
|
// yoff from this. Without this, an overlap of text between the note and the bottom of the
|
|
|
|
|
// RNO was occurring for FNP - Unit 2/AOP, AOP-4.0.
|
|
|
|
|
if (yoffRightParent > yoff && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) != E_DocStructStyle.DoubleBoxHLS)) yoff = yoffRightParent;
|
|
|
|
|
yoff = ChildrenAbove.Add(cb, itemInfo.Notes, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
|
|
|
|
|
yoff = ChildrenAbove.Add(cb, itemInfo.Notes, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2029,6 +2186,11 @@ namespace Volian.Print.Library
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// For Calvert Alarms, the 'CONDITION/RESPONSE' portion uses a macro to print
|
|
|
|
|
// the CONDITION and RESPONSE text with the lines around it. Add the macro here because
|
|
|
|
|
// there is no tab for the step & that's where the macro is usually stored:
|
|
|
|
|
if (HasCalvertMacro) PartsLeft.Add(new vlnMacro(xoff - 12f, yoff, "H4"));
|
|
|
|
|
|
|
|
|
|
//if (itemInfo.IsSection)
|
|
|
|
|
// Rtf = GetRtf(itemInfo, prefix, " (Continued)");
|
|
|
|
|
//else
|
|
|
|
@@ -2107,6 +2269,7 @@ namespace Volian.Print.Library
|
|
|
|
|
// y direction (bottommost) across the row.
|
|
|
|
|
if (itemInfo.IsStep && itemInfo.MyHLS != null && (itemInfo.MyHLS.FormatStepData.UseSmartTemplate || (itemInfo.MyHLS.FormatStepData.UseOldTemplate && itemInfo.MyDocStyle.ComponentList)) && (TheStepLevel(itemInfo) >= 0))
|
|
|
|
|
savCheckListBottomMost = yoff + Height + (itemInfo.MyHLS.FormatStepData.UseSmartTemplate ? SixLinesPerInch : 0);
|
|
|
|
|
if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.IsCaution1) savCheckListBottomMost = yoff + Height;
|
|
|
|
|
// Get Y offset for regular steps, or if section title is output or if not within row (not last column of
|
|
|
|
|
// text) for wcn checklist, i.e.
|
|
|
|
|
if ((!itemInfo.IsStepSection && itemInfo.MyHLS != null && !itemInfo.MyHLS.FormatStepData.UseSmartTemplate) // regular step
|
|
|
|
@@ -2140,7 +2303,31 @@ namespace Volian.Print.Library
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
|
|
|
|
{
|
|
|
|
|
// For Calvert Alarms, the row has formatting that makes this template item have a header & box
|
|
|
|
|
// (CONDITION/RESPONSE), header with box around it is defined in genmac whereas the lines around
|
|
|
|
|
// substeps are drawn in pagehelper. Adjust some yoffsets around this box.
|
|
|
|
|
// Need to:
|
|
|
|
|
// 1) move the text down a bit for top line (1.5f * SixLinesPerInch)
|
|
|
|
|
// 2) move the substep down 2 lines (2 * SixLinesPerInch) for bottom of box
|
|
|
|
|
// and space before substep
|
|
|
|
|
// 3) if the previous item had this condition, add space for the
|
|
|
|
|
// line below.
|
|
|
|
|
if (HasCalvertMacro)
|
|
|
|
|
{
|
|
|
|
|
YOffset += (1.5f * vlnPrintObject.SixLinesPerInch);
|
|
|
|
|
yoff += (2 * vlnPrintObject.SixLinesPerInch);
|
|
|
|
|
}
|
|
|
|
|
if (itemInfo.MyPrevious != null && itemInfo.MyPrevious.TemplateIndex > 0)
|
|
|
|
|
{
|
|
|
|
|
if (itemInfo.MyPrevious.ActiveFormat.PlantFormat.FormatData.Templates[itemInfo.MyPrevious.TemplateIndex].hmacro > 0)
|
|
|
|
|
{
|
|
|
|
|
YOffset += (3 * vlnPrintObject.SixLinesPerInch);
|
|
|
|
|
yoff += (3 * vlnPrintObject.SixLinesPerInch);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CheckOff co = itemInfo.GetCheckOffStep();
|
|
|
|
|
if (co != null)
|
|
|
|
|
{
|
|
|
|
@@ -2257,6 +2444,13 @@ namespace Volian.Print.Library
|
|
|
|
|
yoff += mySep.Height;// +SixLinesPerInch;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// For Calvert Alarms, 'Caution1' was used to implement the Annunciator Window, i.e. is printed
|
|
|
|
|
// below the HLS and close to the right margin.
|
|
|
|
|
if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.Cautions != null && itemInfo.Cautions[0].FormatStepData.Type == "Caution1")
|
|
|
|
|
{
|
|
|
|
|
yoff = ChildrenBelow.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
|
|
|
|
|
savCheckListBottomMost = yoff;
|
|
|
|
|
}
|
|
|
|
|
if (itemInfo.Steps != null && printsteps)
|
|
|
|
|
{
|
|
|
|
|
if (itemInfo.FormatStepData == null || itemInfo.FormatStepData.Type != "TitleWithTextRight")
|
|
|
|
@@ -2295,6 +2489,16 @@ namespace Volian.Print.Library
|
|
|
|
|
if (XOffsetCenter != null) XOffset = (float)XOffsetCenter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// for Calvert (BGE) alarms, some step text is kept on the same line as its parent. This
|
|
|
|
|
// is flagged by the -1 row in the template definition.
|
|
|
|
|
private bool KeepOnParentLine(ItemInfo itemInfo)
|
|
|
|
|
{
|
|
|
|
|
int tindx = itemInfo.TemplateIndex;
|
|
|
|
|
if (tindx < 0) return false;
|
|
|
|
|
if (itemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row == -1) return true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void AdjustYOffset(float yDelta)
|
|
|
|
|
{
|
|
|
|
|
YOffset -= yDelta;
|
|
|
|
@@ -2782,7 +2986,16 @@ namespace Volian.Print.Library
|
|
|
|
|
if (!itemInfo.IsTable && StepRTB.MyFontFamily != null)
|
|
|
|
|
myFont = new System.Drawing.Font(StepRTB.MyFontFamily, myFont.Size, myFont.Style);
|
|
|
|
|
|
|
|
|
|
string stText = vlntxt.StartText;
|
|
|
|
|
string stText = null; // if Calvert (BGE) Alarms, the text is included in the macro, so save text as a blank:
|
|
|
|
|
if (HasCalvertMacro)
|
|
|
|
|
{
|
|
|
|
|
stText = " ";
|
|
|
|
|
// turn underline off
|
|
|
|
|
myFont = new System.Drawing.Font(myFont.FontFamily, myFont.Size, FontStyle.Regular); //myFont.Style. | FontStyle.Underline);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
stText = vlntxt.StartText;
|
|
|
|
|
|
|
|
|
|
if (itemInfo.IsHigh && itemInfo.MyDocStyle.UndSpecialStepsFoldout)
|
|
|
|
|
{
|
|
|
|
|
myFont = new System.Drawing.Font(myFont.FontFamily, myFont.Size, myFont.Style | FontStyle.Underline);
|
|
|
|
@@ -3115,7 +3328,7 @@ namespace Volian.Print.Library
|
|
|
|
|
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (itemInfo.MyParent.FormatStepData != null && itemInfo.MyParent.FormatStepData.Type == "TitleWithTextBelow")
|
|
|
|
|
else if (itemInfo.MyParent.FormatStepData != null && itemInfo.MyParent.FormatStepData.Type == "TitleWithTextBelow" && (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || (!itemInfo.IsCaution && !itemInfo.IsNote)))
|
|
|
|
|
{
|
|
|
|
|
float childindent = itemInfo.MyParent.FormatStepData.ChildIndent ?? 0;
|
|
|
|
|
if (myTab != null)
|
|
|
|
@@ -3143,6 +3356,30 @@ namespace Volian.Print.Library
|
|
|
|
|
}
|
|
|
|
|
if (itemInfo.IsHigh)
|
|
|
|
|
{
|
|
|
|
|
if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
|
|
|
|
{
|
|
|
|
|
// the HLS in the template prints the tab/step on the right edge of page. Don't
|
|
|
|
|
// do the other calculations to relocate it.
|
|
|
|
|
if (itemInfo.FormatStepData.UseOldTemplate && itemInfo.IsInTemplate())
|
|
|
|
|
{
|
|
|
|
|
MyTab.XOffset = XOffset - MyTab.Width;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// the following code handles the xoffsets of tabs/HLS in the non-alarm sections for
|
|
|
|
|
// the Calvert Alarm format.
|
|
|
|
|
if (itemInfo.MyDocStyle.UseColSByLevel)
|
|
|
|
|
{
|
|
|
|
|
if (myTab != null)
|
|
|
|
|
{
|
|
|
|
|
myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray()));
|
|
|
|
|
myTab.XOffset = MyParent.XOffset;
|
|
|
|
|
XOffset = myTab.XOffset + MyTab.Width;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
XOffset = MyParent.XOffset; // unnumbered hls
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
float x = 0;
|
|
|
|
|
float xoff = 0;
|
|
|
|
|
if ((colOvrd ?? 0) != 0)
|
|
|
|
@@ -3371,7 +3608,7 @@ namespace Volian.Print.Library
|
|
|
|
|
if (itemInfo.IsStep && itemInfo.MyHLS != null && UseTemplateWidthOrXOff(itemInfo) && (xwid = GetWidthOrStartFromTemplate(itemInfo, formatInfo, true)) > 0)
|
|
|
|
|
widOvrd = xwid;
|
|
|
|
|
else
|
|
|
|
|
widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride == null ? null :
|
|
|
|
|
widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride == null ? null :
|
|
|
|
|
(float?)ToInt(itemInfo.FormatStepData.WidthOverride, maxRNO);
|
|
|
|
|
//widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride;
|
|
|
|
|
// Don't adjust the RNO width if in single column mode:
|
|
|
|
@@ -3536,7 +3773,8 @@ namespace Volian.Print.Library
|
|
|
|
|
public bool UseTemplateKeepOnCurLine(ItemInfo itemInfo)
|
|
|
|
|
{
|
|
|
|
|
if (!itemInfo.IsStep || !itemInfo.MyDocStyle.ComponentList) return false;
|
|
|
|
|
if (itemInfo.MyHLS.FormatStepData.UseOldTemplate) return true;
|
|
|
|
|
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert
|
|
|
|
|
&& itemInfo.MyHLS.FormatStepData.UseOldTemplate) return true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
private bool UseTemplateWidthOrXOff(ItemInfo itemInfo)
|
|
|
|
@@ -3549,7 +3787,14 @@ namespace Volian.Print.Library
|
|
|
|
|
{
|
|
|
|
|
ItemInfo useForTemplate = itemInfo.IsHigh ? itemInfo : itemInfo.MyParent;
|
|
|
|
|
int topIndx = useForTemplate.GetSmartTemplateTopLevelIndx();
|
|
|
|
|
int tpIndx = useForTemplate.GetSmartTemplateIndex(topIndx, (int)useForTemplate.MyContent.Type);
|
|
|
|
|
int tpIndx = -1;
|
|
|
|
|
if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
|
|
|
|
{
|
|
|
|
|
if (itemInfo.IsCaution1) return false;
|
|
|
|
|
else tpIndx = useForTemplate.GetSmartTemplateIndex(topIndx, itemInfo.MyContent.Text);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
tpIndx = useForTemplate.GetSmartTemplateIndex(topIndx, (int)useForTemplate.MyContent.Type);
|
|
|
|
|
if (tpIndx > -1) return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
@@ -3560,19 +3805,39 @@ namespace Volian.Print.Library
|
|
|
|
|
int tmplIndx = 0;
|
|
|
|
|
if (itemInfo.MyDocStyle.ComponentList && !itemInfo.IsHigh)
|
|
|
|
|
{
|
|
|
|
|
// The ComponentTable format (FNP component table as one example), uses a template
|
|
|
|
|
// where the items in the template below the HLS are all paragraphs (the intermediate steps
|
|
|
|
|
// are TitleWithTextRight). Find the ordinal of in this list to get the index. Use the ordinal
|
|
|
|
|
// as an offset from the HLS's index into the template.
|
|
|
|
|
tmplIndx = itemInfo.MyParent.Ordinal + topIndx;
|
|
|
|
|
if (tmplIndx < 0 || tmplIndx > formatInfo.PlantFormat.FormatData.Templates.Count - 1) return 0;
|
|
|
|
|
// The following was added so that the Calvert Alarms sequentials under the CONDITION/RESPONSE would be
|
|
|
|
|
// printed as 2 column (data within the template definition set the columns to 2)
|
|
|
|
|
if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
|
|
|
|
{
|
|
|
|
|
if (itemInfo.IsSequential && itemInfo.MyParent.TemplateIndex > 0)
|
|
|
|
|
{
|
|
|
|
|
if (bGetWidth && itemInfo.MyParent.ColumnMode == 1) // 2 columns
|
|
|
|
|
return (ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, itemInfo.ColumnMode) - MyTab.Width);
|
|
|
|
|
}
|
|
|
|
|
tmplIndx = itemInfo.TemplateIndex;
|
|
|
|
|
if (tmplIndx == -1) return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// The ComponentTable format (FNP component table as one example), uses a template
|
|
|
|
|
// where the items in the template below the HLS are all paragraphs (the intermediate steps
|
|
|
|
|
// are TitleWithTextRight). Find the ordinal of in this list to get the index. Use the ordinal
|
|
|
|
|
// as an offset from the HLS's index into the template.
|
|
|
|
|
tmplIndx = itemInfo.MyParent.Ordinal + topIndx;
|
|
|
|
|
if (tmplIndx < 0 || tmplIndx > formatInfo.PlantFormat.FormatData.Templates.Count - 1) return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tmplIndx = itemInfo.GetSmartTemplateIndex(topIndx, (int)itemInfo.MyContent.Type);
|
|
|
|
|
if (tmplIndx == -1) return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Calvert Alarms' template defines number of columns & their width.
|
|
|
|
|
if (bGetWidth && formatInfo.PlantFormat.FormatData.Templates[tmplIndx].width == 0)
|
|
|
|
|
{
|
|
|
|
|
int nocol = formatInfo.PlantFormat.FormatData.Templates[tmplIndx].nocolm == 0 ? 0 : formatInfo.PlantFormat.FormatData.Templates[tmplIndx].nocolm - 1;
|
|
|
|
|
return ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, nocol);
|
|
|
|
|
}
|
|
|
|
|
int ncol = bGetWidth ? formatInfo.PlantFormat.FormatData.Templates[tmplIndx].width : formatInfo.PlantFormat.FormatData.Templates[tmplIndx].start;
|
|
|
|
|
// now convert to the units for this format. The template width data is in number of columns.
|
|
|
|
|
return (ncol * itemInfo.FormatStepData.Font.CharsToTwips) + (bGetWidth ? 1 : 0); // + 1 is slight adjustment so column doesn't wrap
|
|
|
|
|