From 21407f336aa4edce7513dac4adde81b7d7a4724b Mon Sep 17 00:00:00 2001 From: John Date: Tue, 2 Jun 2015 21:40:45 +0000 Subject: [PATCH] Added format variables for Wolf Creek Training format Save the Y position for the placement of a line after the section title. Also adjust the width of the section title with respect to the section number. All for the Wolf Creek Training format Print a horizontal line after the section header (number and title) for the Wolf Creek Training format --- .../Format/PlantFormat.cs | 34 +++++++++++++++++++ .../Volian.Print.Library/VlnSvgPageHelper.cs | 10 ++++++ PROMS/Volian.Print.Library/vlnParagraph.cs | 5 +++ 3 files changed, 49 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 00f75c33..39c5dbb4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -1768,6 +1768,15 @@ namespace VEPROMS.CSLA.Library return _SectionHeader; } } + private SectionHeaderSeparatorLine _SectionHeaderSeparatorLine; + public SectionHeaderSeparatorLine SectionHeaderSeparatorLine + { + get + { + if (_SectionHeaderSeparatorLine == null) _SectionHeaderSeparatorLine = new SectionHeaderSeparatorLine(SelectSingleNode("SectionHeaderSeparatorLine")); + return _SectionHeaderSeparatorLine; + } + } private StepSectionData _StepSectionData; public StepSectionData StepSectionData { @@ -2003,6 +2012,31 @@ namespace VEPROMS.CSLA.Library } } #endregion + #region SectionHeaderSeparatorLine + [TypeConverter(typeof(ExpandableObjectConverter))] + public class SectionHeaderSeparatorLine : vlnFormatItem + { + public SectionHeaderSeparatorLine(XmlNode xmlNode) : base(xmlNode) { } + public SectionHeaderSeparatorLine() : base() { } + private LazyLoad _XStartPos; + public float? XStartPos + { + get + { + return LazyLoad(ref _XStartPos, "@XStartPos"); + } + } + private LazyLoad _Length; + public float? Length + { + get + { + return LazyLoad(ref _Length, "@Length"); + } + } + } + #endregion + #region StepSectionDataAll #region StepSectionData [TypeConverter(typeof(ExpandableObjectConverter))] diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index 87afda3a..8d9f0ab1 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -147,6 +147,12 @@ namespace Volian.Print.Library get { return _AlarmYoffEnd; } set { _AlarmYoffEnd = value; } } + private float _SectionSepLineYoffStart = 0; + public float SectionSepLineYoffStart + { + get { return _SectionSepLineYoffStart; } + set { _SectionSepLineYoffStart = value; } + } private PdfWriter _MyPdfWriter; public PdfWriter MyPdfWriter { @@ -281,7 +287,11 @@ namespace Volian.Print.Library DrawHorizontal(writer.DirectContent, (float)MySection.MyDocStyle.Layout.LeftMargin, (float)MySection.MyDocStyle.Layout.PageWidth, (float)MySection.MyDocStyle.CenterLineYTop); //if (MySection.ColumnMode > 0 && onBlankPage == false) if (MySection.ColumnMode > 0 || MySection.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining) + { DrawCenterLine(writer.DirectContent, MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0, MySection.MyDocStyle.CenterLineYTop ?? 0, MySection.MyDocStyle.CenterLineYBottom ?? 0); + if (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining) + DrawHorizontal(writer.DirectContent, (float)(MySection.ActiveFormat.PlantFormat.FormatData.SectData.SectionHeaderSeparatorLine.XStartPos ?? 0), (float)(MySection.ActiveFormat.PlantFormat.FormatData.SectData.SectionHeaderSeparatorLine.Length ?? 0), SectionSepLineYoffStart); + } } if (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 178e92be..db457437 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -561,6 +561,9 @@ namespace Volian.Print.Library { int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DrawText"); retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); + // Wolf Creek Training format puts a separator line after printing the section number/title + if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining) + MyPageHelper.SectionSepLineYoffStart = retval - (SixLinesPerInch / 2); SectionContinuePrinted = true; ProfileTimer.Pop(profileDepth); } @@ -5018,6 +5021,8 @@ namespace Volian.Print.Library float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; adjwidth -= seclvlindent; if (itemInfo.IsStep) adjwidth -= AdjustForSectionLevelTab(); + if (itemInfo.IsSection && itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining) + adjwidth -= (float)((itemInfo.MyTab.CleanText.Trim().Length * 72) / itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Font.CPI); } } else