C2024-003-Print-Sub-Section
This commit is contained in:
@@ -12,7 +12,7 @@ using Volian.Base.Library;
|
||||
|
||||
namespace Volian.Print.Library
|
||||
{
|
||||
public partial class VlnSvgPageHelper:SvgPageHelper
|
||||
public partial class VlnSvgPageHelper : SvgPageHelper
|
||||
{
|
||||
private float _TableAdjustment = 0;// RHM20150525 - Table Scrunch
|
||||
public float TableAdjustment
|
||||
@@ -52,14 +52,14 @@ namespace Volian.Print.Library
|
||||
private float? _BottomContent = null;// RHM20150525 - Table Scrunch
|
||||
public float? BottomContent
|
||||
{
|
||||
get
|
||||
{
|
||||
return _BottomContent;
|
||||
get
|
||||
{
|
||||
return _BottomContent;
|
||||
}
|
||||
set
|
||||
{
|
||||
if(value == null || _BottomContent == null || _BottomContent > value)
|
||||
_BottomContent = value;
|
||||
set
|
||||
{
|
||||
if (value == null || _BottomContent == null || _BottomContent > value)
|
||||
_BottomContent = value;
|
||||
}
|
||||
}
|
||||
private PageBookmarks _PageBookmarks = new PageBookmarks();
|
||||
@@ -85,43 +85,43 @@ namespace Volian.Print.Library
|
||||
get { return _TopMessage; }
|
||||
set { _TopMessage = value; }
|
||||
}
|
||||
private int _prtSectID = -1;
|
||||
public int PrtSectID
|
||||
private int[] _prtSectID = new int[] { -1, -1, 0 };
|
||||
public int[] PrtSectID
|
||||
{
|
||||
get { return _prtSectID; }
|
||||
set { _prtSectID = value; }
|
||||
}
|
||||
private List<vlnText> _TopMessageRs=new List<vlnText>(); // Added if there are 2 messages, in AER AND RNO (for BGE)
|
||||
private List<vlnText> _TopMessageRs = new List<vlnText>(); // Added if there are 2 messages, in AER AND RNO (for BGE)
|
||||
public List<vlnText> TopMessageRs
|
||||
{
|
||||
get { return _TopMessageRs; }
|
||||
set { _TopMessageRs = value; }
|
||||
}
|
||||
private List<vlnText> _TopMessageSub1s=new List<vlnText>(); // BGE Alarms: in CONDITION/RESPONSE if break within substep
|
||||
private List<vlnText> _TopMessageSub1s = new List<vlnText>(); // BGE Alarms: in CONDITION/RESPONSE if break within substep
|
||||
public List<vlnText> TopMessageSub1s
|
||||
{
|
||||
get { return _TopMessageSub1s; }
|
||||
set { _TopMessageSub1s = value; }
|
||||
}
|
||||
private List<vlnText> _TopMessageSub2s=new List<vlnText>(); // BGE Alarms: in CONDITION/RESPONSE if break within substep
|
||||
private List<vlnText> _TopMessageSub2s = new List<vlnText>(); // BGE Alarms: in CONDITION/RESPONSE if break within substep
|
||||
public List<vlnText> TopMessageSub2s
|
||||
{
|
||||
get { return _TopMessageSub2s; }
|
||||
set { _TopMessageSub2s = value; }
|
||||
}
|
||||
private List<vlnText> _BottomMessage = new List<vlnText>(); // B2017-203) any continuous sections with end messages may have more than 1 message on a page
|
||||
private List<vlnText> _BottomMessage = new List<vlnText>(); // B2017-203) any continuous sections with end messages may have more than 1 message on a page
|
||||
public List<vlnText> BottomMessage
|
||||
{
|
||||
get { return _BottomMessage; }
|
||||
set { _BottomMessage = value; }
|
||||
}
|
||||
private vlnText _BottomMessageR; // Added if there are 2 messages, in AER AND RNO (for BGE)
|
||||
private vlnText _BottomMessageR; // Added if there are 2 messages, in AER AND RNO (for BGE)
|
||||
public vlnText BottomMessageR
|
||||
{
|
||||
get { return _BottomMessageR; }
|
||||
set { _BottomMessageR = value; }
|
||||
}
|
||||
private vlnText _BottomMessageA; // Added if there are 3 messages, at bottom AND in AER AND RNO (for BGEALARMS)
|
||||
private vlnText _BottomMessageA; // Added if there are 3 messages, at bottom AND in AER AND RNO (for BGEALARMS)
|
||||
public vlnText BottomMessageA
|
||||
{
|
||||
get { return _BottomMessageA; }
|
||||
@@ -186,12 +186,12 @@ namespace Volian.Print.Library
|
||||
public PdfWriter MyPdfWriter
|
||||
{
|
||||
get { return _MyPdfWriter; }
|
||||
set
|
||||
set
|
||||
{
|
||||
MyPageCounts = new PageCounts();
|
||||
MyTOCPageCounts = new PageCounts();
|
||||
MyTOCPageNums = new Dictionary<string, int>();
|
||||
_MyPdfWriter = value;
|
||||
_MyPdfWriter = value;
|
||||
}
|
||||
}
|
||||
private PdfContentByte _MyPdfContentByte;
|
||||
@@ -226,7 +226,7 @@ namespace Volian.Print.Library
|
||||
// when false, no page has been printed yet (for determining whether a blank page before print
|
||||
// needs done if first section has foldouts)
|
||||
private bool _PrintedAPage = false;
|
||||
public bool PrintedAPage
|
||||
public bool PrintedAPage
|
||||
{
|
||||
get { return _PrintedAPage; }
|
||||
set { _PrintedAPage = value; }
|
||||
@@ -262,11 +262,11 @@ namespace Volian.Print.Library
|
||||
public override void OnEndPage(PdfWriter writer, iTextSharp.text.Document document)
|
||||
{
|
||||
TableAdjustment = 0;// RHM20150525 - Table Scrunch
|
||||
//string path = Volian.Base.Library.vlnStackTrace.StackToStringLocal(3, 1);
|
||||
//Console.WriteLine("End {0}",path);
|
||||
//string path = Volian.Base.Library.vlnStackTrace.StackToStringLocal(3, 1);
|
||||
//Console.WriteLine("End {0}",path);
|
||||
int profileDepth = ProfileTimer.Push(">>>> OnEndPage");
|
||||
InitialsPrinted = false;
|
||||
MyPromsPrinter.OnStatusChanged(string.Format("Page {0}", CurrentPageNumber+1));
|
||||
MyPromsPrinter.OnStatusChanged(string.Format("Page {0}", CurrentPageNumber + 1));
|
||||
// B2019-152: Landscape page merged page numbers
|
||||
if (this.MySection != null && MySection.MyDocStyle.LandscapePageList) PromsPrinter.AddMergedLandscapePage(this, MyPromsPrinter.PDFFile);
|
||||
bool onBlankPage = OnBlankPage;
|
||||
@@ -287,15 +287,15 @@ namespace Volian.Print.Library
|
||||
{
|
||||
DrawRuler(writer.DirectContent);
|
||||
float x = MySection == null ? 555 : (float)MySection.MyDocStyle.Layout.PageWidth;
|
||||
DrawBottomRuler(writer.DirectContent, x / 2 - 144); //aer column
|
||||
DrawBottomRuler(writer.DirectContent, x - 144); //rno column
|
||||
DrawBottomRuler(writer.DirectContent, x / 2 - 144); //aer column
|
||||
DrawBottomRuler(writer.DirectContent, x - 144); //rno column
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence??0;
|
||||
E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence ?? 0;
|
||||
// if a foldout is only printing within its section, don't do increments on pagecounts:
|
||||
if (numseq==E_NumberingSequence.WithinEachSection)
|
||||
if (numseq == E_NumberingSequence.WithinEachSection)
|
||||
MyPageCounts.CanIncrement = false;
|
||||
else
|
||||
MyPageCounts.CanIncrement = true;
|
||||
@@ -305,7 +305,7 @@ namespace Volian.Print.Library
|
||||
}
|
||||
// added the check for onBlankPage and Foldouts to fix bug found in V.C. Summer auto table of contents - 03/08/2016
|
||||
//C2019-042 Section_IsFoldout checks Section Number, Section Title, and use of check box
|
||||
if (!onBlankPage && (MySection.MyDocStyle.StructureStyle.Style==null || (MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountInTabOfCont) == 0) &&
|
||||
if (!onBlankPage && (MySection.MyDocStyle.StructureStyle.Style == null || (MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountInTabOfCont) == 0) &&
|
||||
!(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (MySection.MyConfig as SectionConfig).Section_IsFoldout == "Y"))
|
||||
CurrentTOCPageNumber++;
|
||||
if (MySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
|
||||
@@ -340,12 +340,12 @@ namespace Volian.Print.Library
|
||||
|
||||
if (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm)
|
||||
{
|
||||
float left = (float)MySection.MyDocStyle.Layout.LeftMargin + 4.40f - 6; // used 4.40 -6 to line up with the macro & not touch two digit sub-step tabs.
|
||||
float right = (float)MySection.MyDocStyle.Layout.PageWidth - .76f; // used -.76 to make bge alarm lines closest to lining up with macro
|
||||
float left = (float)MySection.MyDocStyle.Layout.LeftMargin + 4.40f - 6; // used 4.40 -6 to line up with the macro & not touch two digit sub-step tabs.
|
||||
float right = (float)MySection.MyDocStyle.Layout.PageWidth - .76f; // used -.76 to make bge alarm lines closest to lining up with macro
|
||||
if (AlarmYoffStart > 0)
|
||||
{
|
||||
// draw vertical - either to the alarmyoffend or bottom of page
|
||||
if (AlarmYoffEnd > 0) // ends on this page.
|
||||
if (AlarmYoffEnd > 0) // ends on this page.
|
||||
{
|
||||
DrawVertical(writer.DirectContent, left, AlarmYoffStart, AlarmYoffEnd);
|
||||
DrawVertical(writer.DirectContent, right, AlarmYoffStart, AlarmYoffEnd);
|
||||
@@ -403,7 +403,7 @@ namespace Volian.Print.Library
|
||||
cb.LineTo(x, y);
|
||||
cb.Stroke();
|
||||
}
|
||||
for (float y = yBottom; y <= yTop; y += 10)
|
||||
for (float y = yBottom; y <= yTop; y += 10)
|
||||
{
|
||||
float w = 10;
|
||||
if (i % 10 == 0) w = 30;
|
||||
@@ -414,7 +414,7 @@ namespace Volian.Print.Library
|
||||
cb.LineTo(x, y);
|
||||
cb.Stroke();
|
||||
}
|
||||
i = 0;
|
||||
i = 0;
|
||||
cb.Stroke();
|
||||
cb.RestoreState();
|
||||
cb.EndLayer();
|
||||
@@ -426,7 +426,7 @@ i = 0;
|
||||
if (PageListLayer != null) cb.BeginLayer(PageListLayer);
|
||||
cb.SetColorStroke(new Color(PrintOverride.SvgColor));
|
||||
cb.SetLineWidth(1.05f); // Tweak the line width to match vlnmacro
|
||||
//cb.SetColorStroke(lineColor);
|
||||
//cb.SetColorStroke(lineColor);
|
||||
cb.MoveTo(x, top);
|
||||
cb.LineTo(x, bottom);
|
||||
cb.Stroke();
|
||||
@@ -521,13 +521,13 @@ i = 0;
|
||||
{
|
||||
if (_MyGaps == null)
|
||||
_MyGaps = new Gaps();
|
||||
return _MyGaps;
|
||||
return _MyGaps;
|
||||
}
|
||||
}
|
||||
public void AddGap(float top, float bottom, float left, float right)
|
||||
{
|
||||
float center = MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0;
|
||||
if(center == 0) return;
|
||||
if (center == 0) return;
|
||||
if (center > right || center < left) return;
|
||||
MyGaps.Add(top, bottom);
|
||||
}
|
||||
@@ -578,7 +578,7 @@ i = 0;
|
||||
if ((MySection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0)
|
||||
{
|
||||
//Console.WriteLine("{0} ResetDocStyleAndValues", MySection.MyDocStyle.Name);
|
||||
ItemInfo ii = (ItemInfo) MySection;
|
||||
ItemInfo ii = (ItemInfo)MySection;
|
||||
int indx = (int)MySection.MyDocStyle.IndexOtherThanFirstPage;
|
||||
foreach (DocStyle ds in ii.ActiveFormat.PlantFormat.DocStyles.DocStyleList)
|
||||
{
|
||||
@@ -614,7 +614,7 @@ i = 0;
|
||||
cb.SetColorStroke(new Color(System.Drawing.Color.CornflowerBlue));
|
||||
float yTop = (float)(cb.PdfWriter.PageSize.Height - layout.TopMargin);
|
||||
//Console.WriteLine("Page,yTop,yTopMargin {0},{1},{2}", cb.PdfDocument.PageNumber, yTop, YTopMargin);
|
||||
if(YTopMargin != null) yTop = (float)YTopMargin;
|
||||
if (YTopMargin != null) yTop = (float)YTopMargin;
|
||||
float yBottom = (float)(cb.PdfWriter.PageSize.Height - (layout.TopMargin + layout.PageLength));
|
||||
//Console.WriteLine("'{0}',{1},{2}", MySection.MyDocStyle.Name, yTop, yBottom);
|
||||
cb.MoveTo(x, yTop);
|
||||
@@ -655,14 +655,14 @@ i = 0;
|
||||
}
|
||||
cb.SetLineWidth(w / 30);
|
||||
i++;
|
||||
cb.MoveTo(x + w, y-1);
|
||||
cb.LineTo(x, y-1);
|
||||
cb.MoveTo(x + w, y - 1);
|
||||
cb.LineTo(x, y - 1);
|
||||
cb.Stroke();
|
||||
}
|
||||
cb.SetLineWidth(.1F);
|
||||
cb.Rectangle((float)layout.LeftMargin, yTop, (float)layout.PageWidth - (float)layout.LeftMargin, yBottom - yTop);
|
||||
float yFooter = yBottom+(float)layout.FooterLength;
|
||||
cb.MoveTo((float)layout.LeftMargin,yFooter);
|
||||
float yFooter = yBottom + (float)layout.FooterLength;
|
||||
cb.MoveTo((float)layout.LeftMargin, yFooter);
|
||||
cb.LineTo((float)layout.PageWidth, yFooter);
|
||||
float yRuler = 612;
|
||||
cb.MoveTo(0, yRuler);
|
||||
@@ -671,17 +671,17 @@ i = 0;
|
||||
{
|
||||
if (x1 % 72 == 0)
|
||||
{
|
||||
cb.MoveTo(x1, yRuler-20);
|
||||
cb.LineTo(x1, yRuler+20);
|
||||
cb.MoveTo(x1, yRuler - 20);
|
||||
cb.LineTo(x1, yRuler + 20);
|
||||
}
|
||||
else if (x1 % 36 == 0)
|
||||
{
|
||||
cb.MoveTo(x1, yRuler-10);
|
||||
cb.LineTo(x1, yRuler+10);
|
||||
cb.MoveTo(x1, yRuler - 10);
|
||||
cb.LineTo(x1, yRuler + 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
cb.MoveTo(x1, yRuler-5);
|
||||
cb.MoveTo(x1, yRuler - 5);
|
||||
cb.LineTo(x1, yRuler);
|
||||
}
|
||||
}
|
||||
@@ -720,20 +720,24 @@ i = 0;
|
||||
foreach (PageBookmark pb in PageBookmarks)
|
||||
{
|
||||
int lev = pb.Level;
|
||||
if (MyPdfOutlines.Count < lev || lev==0)
|
||||
if (MyPdfOutlines.Count < lev || lev == 0)
|
||||
{
|
||||
PdfDestination dest = new PdfDestination(PdfDestination.FIT);
|
||||
PdfOutline pdo = new PdfOutline(writer.DirectContent.RootOutline, dest, pb.Title, false);
|
||||
if (MyPdfOutlines.Count == lev)
|
||||
MyPdfOutlines.Add(pdo);
|
||||
else
|
||||
MyPdfOutlines[lev] = pdo;
|
||||
if (!Convert.ToBoolean(_prtSectID[2]))
|
||||
{
|
||||
if (MyPdfOutlines.Count == lev)
|
||||
MyPdfOutlines.Add(pdo);
|
||||
else
|
||||
MyPdfOutlines[lev] = pdo;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
PdfDestination dest =pb.PdfDestination;
|
||||
if(dest==null) dest = new PdfDestination(PdfDestination.FIT);
|
||||
PdfOutline pdo = new PdfOutline(MyPdfOutlines[lev-1], dest,Regex.Replace(pb.Title, @"\\{Prerequisite Step: .*?\\}", string.Empty), false);
|
||||
PdfDestination dest = pb.PdfDestination;
|
||||
if (dest == null) dest = new PdfDestination(PdfDestination.FIT);
|
||||
PdfOutline pdo = new PdfOutline(MyPdfOutlines[lev - 1], dest, Regex.Replace(pb.Title, @"\\{Prerequisite Step: .*?\\}", string.Empty), false);
|
||||
if (MyPdfOutlines.Count == lev)
|
||||
MyPdfOutlines.Add(pdo);
|
||||
else
|
||||
@@ -756,10 +760,10 @@ i = 0;
|
||||
// to the physical page location.
|
||||
ntfn.YOffset = yTopMargin - myYOff;
|
||||
ntfn.YTopMost = yTopMargin - myYOff;
|
||||
|
||||
|
||||
ntfn.Processed = false; // process from here
|
||||
// Only use ParagraphToPdf for printing of a single step.
|
||||
// This is assuming that footnotes do not have child steps.
|
||||
// Only use ParagraphToPdf for printing of a single step.
|
||||
// This is assuming that footnotes do not have child steps.
|
||||
ntfn.ParagraphToPdf(cb, yTopMargin, yTopMargin, tmp);
|
||||
//ntfn.ToPdf(cb, yTopMargin, ref yTopMargin, ref tmp);
|
||||
|
||||
@@ -844,11 +848,11 @@ i = 0;
|
||||
// TODO: Pass in zeroes because topdf is inherited.
|
||||
vcb.ToPdf(cb, topMargin, ref tmp, ref tmp);
|
||||
}
|
||||
_MyChangeBars = new List<vlnChangeBar>();
|
||||
_MyChangeBars = new List<vlnChangeBar>();
|
||||
}
|
||||
#region SectionLevelData
|
||||
private ChangeBarDefinition _ChangeBarDefinition;
|
||||
public ChangeBarDefinition ChangeBarDefinition
|
||||
public ChangeBarDefinition ChangeBarDefinition
|
||||
{
|
||||
get { return _ChangeBarDefinition; }
|
||||
set { _ChangeBarDefinition = value; }
|
||||
@@ -879,7 +883,8 @@ i = 0;
|
||||
DidFirstPageDocStyle = false;
|
||||
if (DidFirstPageDocStyle)
|
||||
forceLoadSvg = SetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this)
|
||||
if (_prtSectID > -1) {
|
||||
if (_prtSectID[0] > -1)
|
||||
{
|
||||
forceLoadSvg = true;
|
||||
}
|
||||
Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg);
|
||||
@@ -896,7 +901,7 @@ i = 0;
|
||||
private int _MaxRNO;
|
||||
public int MaxRNO
|
||||
{
|
||||
get
|
||||
get
|
||||
{
|
||||
return _MySection.ColumnMode;
|
||||
}
|
||||
@@ -939,7 +944,7 @@ i = 0;
|
||||
foreach (vlnChangeBar cb in MyChangeBars)
|
||||
{
|
||||
// only look at changebars in same column
|
||||
if (cb.XOffset == vcb.XOffset)
|
||||
if (cb.XOffset == vcb.XOffset)
|
||||
{
|
||||
// if the two change bars end at same location, set prevCB which will
|
||||
// adjust the length (top position) of the change bar. This condition
|
||||
@@ -972,7 +977,7 @@ i = 0;
|
||||
float yChangeBarBottomExtend = prevCB.YChangeBarBottomExtend;
|
||||
prevCB.Height = Math.Max(prevCB.Height, vcb.Height);
|
||||
prevCB.YExtendLine = prevCB.YChangeBarBottom - Math.Min(yChangeBarBottomExtend, vcb.YChangeBarBottomExtend); //Math.Max(prevCB.YExtendLine, vcb.YExtendLine);
|
||||
// if a change bar message at this ychangebarbottom exists, see which message is used
|
||||
// if a change bar message at this ychangebarbottom exists, see which message is used
|
||||
if (cbmess != null && prevCB.Messages.ContainsKey(prevCB.YChangeBarBottom)) UpdateCbMessage(cbmess, prevCB, vcb.XOffset);
|
||||
return;
|
||||
}
|
||||
@@ -982,7 +987,7 @@ i = 0;
|
||||
float yChangeBarBottomExtend1 = prevCB.YChangeBarBottomExtend;
|
||||
prevCB.YChangeBarBottom = Math.Min(prevCB.YChangeBarBottom, vcb.YChangeBarBottom);
|
||||
prevCB.YExtendLine = prevCB.YChangeBarBottom - Math.Min(yChangeBarBottomExtend1, vcb.YChangeBarBottomExtend); //Math.Max(prevCB.YExtendLine, vcb.YExtendLine);
|
||||
// Two messages at this location, determine which one to use
|
||||
// Two messages at this location, determine which one to use
|
||||
if (cbmess != null && prevCB.Messages.ContainsKey(prevCB.YChangeBarBottom)) UpdateCbMessage(cbmess, prevCB, vcb.XOffset);
|
||||
|
||||
// no message at this location, just add it.
|
||||
@@ -1017,7 +1022,7 @@ i = 0;
|
||||
if (cb.MyParent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm &&
|
||||
(vcb.MyParent.MyItemInfo.IsTable || cb.MyParent.MyItemInfo.IsTable || cb.BottomIsTable)) tolerance *= 1.5f;
|
||||
bool bothFootnotes = cb.MyParent.MyItemInfo.IsFootnote && vcb.MyParent.MyItemInfo.IsFootnote;
|
||||
if (!bothFootnotes && cb.MyParent.MyItemInfo.MyHLS != null && vcb.MyParent.MyItemInfo.MyHLS != null &&
|
||||
if (!bothFootnotes && cb.MyParent.MyItemInfo.MyHLS != null && vcb.MyParent.MyItemInfo.MyHLS != null &&
|
||||
cb.MyParent.MyItemInfo.MyHLS.ItemID != vcb.MyParent.MyItemInfo.MyHLS.ItemID) return false;
|
||||
// cb.Yoffset is within range of vcb:
|
||||
if (cb.YOffset <= vcb.YOffset &&
|
||||
@@ -1040,7 +1045,7 @@ i = 0;
|
||||
set { _MyPromsPrinter = value; }
|
||||
}
|
||||
private int _MyRomanPage = 1;
|
||||
public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId, int PrtSectID)
|
||||
public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId, int[] PrtSectID = null)
|
||||
: base()
|
||||
{
|
||||
_prtSectID = PrtSectID;
|
||||
@@ -1095,7 +1100,7 @@ i = 0;
|
||||
}
|
||||
//if (sPag == SectionConfig.SectionPagination.Continuous && !mySection.DidFirstPageDocStyle) return null;
|
||||
if (forceLoad) return mySvg;
|
||||
if (sPag == SectionConfig.SectionPagination.Continuous) return null;
|
||||
if (sPag == SectionConfig.SectionPagination.Continuous) return null;
|
||||
return mySvg;
|
||||
}
|
||||
public PageCounts MyPageCounts = null;
|
||||
@@ -1148,7 +1153,7 @@ i = 0;
|
||||
//string tocKey = "TOC" + MySection.ItemID.ToString();
|
||||
if (args.MyText.Contains("{PAGE}") || args.MyText.Contains("{OF}"))
|
||||
{
|
||||
|
||||
|
||||
#region numberingseq
|
||||
/*
|
||||
public enum E_NumberingSequence : uint
|
||||
@@ -1170,8 +1175,8 @@ i = 0;
|
||||
// default for the key is to make it NumberingSequence. Then handle
|
||||
// specific cases.
|
||||
string key = ((int)MySection.MyDocStyle.NumberingSequence).ToString();
|
||||
|
||||
E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence??0;
|
||||
|
||||
E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence ?? 0;
|
||||
//Console.WriteLine("\"{0}\"\t\"{1}\"\t{2}", MySection.DisplayNumber, MySection.DisplayText, numseq);
|
||||
switch (numseq)
|
||||
{
|
||||
@@ -1202,7 +1207,7 @@ i = 0;
|
||||
key = key + "." + MySection.ItemID;
|
||||
break;
|
||||
case E_NumberingSequence.WithinEachSectionNumber:
|
||||
key = key + "." + ( MySection.DisplayNumber == string.Empty ? (MySection.ActiveParent as ItemInfo).DisplayNumber : MySection.DisplayNumber);
|
||||
key = key + "." + (MySection.DisplayNumber == string.Empty ? (MySection.ActiveParent as ItemInfo).DisplayNumber : MySection.DisplayNumber);
|
||||
break;
|
||||
case E_NumberingSequence.GroupedByLevel:
|
||||
case E_NumberingSequence.Like6_ButDoesntNeedSubsection:
|
||||
@@ -1238,7 +1243,7 @@ i = 0;
|
||||
if (!args.MyText.StartsWith("Non-printing ")) MyPdfContentByte.AddTemplate(tmp, args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y));
|
||||
return string.Empty;
|
||||
}
|
||||
if (args.MyText.Contains("{FINALPAGE}"))
|
||||
if (args.MyText.Contains("{FINALPAGE}"))
|
||||
{
|
||||
if (MySection.ItemID == FinalMessageSectionID)
|
||||
{
|
||||
@@ -1281,7 +1286,7 @@ i = 0;
|
||||
{
|
||||
// If subformat and does not have its own genmac, find an inherited genmac.
|
||||
FormatInfo tmpf = FormatInfo.Get(activeFormat.ParentID);
|
||||
while (tmpf.FormatID!=1 && (sGenMac==null||sGenMac==string.Empty))
|
||||
while (tmpf.FormatID != 1 && (sGenMac == null || sGenMac == string.Empty))
|
||||
{
|
||||
sGenMac = tmpf.GenMac;
|
||||
tmpf = FormatInfo.Get(tmpf.ParentID);
|
||||
@@ -1332,7 +1337,7 @@ i = 0;
|
||||
SectionConfig sc = section.MyConfig as SectionConfig;
|
||||
// C2018-004 create meta file for baseline compares
|
||||
Volian.Base.Library.BaselineMetaFile.WriteLine("SecNum=\"{0}\" SecTitle=\"{1}\" DocStyle=\"{2}\" Format=\"{3}\" ItemID={4}", section.DisplayNumber, section.DisplayText, section.MyDocStyle.Name, sc.FormatSelection, section.ItemID);
|
||||
Volian.Base.Library.BaselineMetaFile.WriteLine(" Pagination=\"{0}\" MSWordPgCnt={1} NumPages={2} WordMargin={3}", sc.Section_Pagination, section.MSWordPageCount, (string.IsNullOrEmpty(sc.Section_NumPages)) ? "0" : sc.Section_NumPages, (string.IsNullOrEmpty(sc.Section_WordMargin))?"N":sc.Section_WordMargin);
|
||||
Volian.Base.Library.BaselineMetaFile.WriteLine(" Pagination=\"{0}\" MSWordPgCnt={1} NumPages={2} WordMargin={3}", sc.Section_Pagination, section.MSWordPageCount, (string.IsNullOrEmpty(sc.Section_NumPages)) ? "0" : sc.Section_NumPages, (string.IsNullOrEmpty(sc.Section_WordMargin)) ? "N" : sc.Section_WordMargin);
|
||||
if (PgLogicals == null) PgLogicals = new Dictionary<string, bool>();
|
||||
else PgLogicals.Clear();
|
||||
|
||||
@@ -1356,16 +1361,16 @@ i = 0;
|
||||
|
||||
bool usePSIvalue = false; // C2021-065 used with ROLkUpMatch pagelist flag (Barakah Alarms)
|
||||
string otherChildUnit = string.Empty; // C2021-065 used when OTHER applicability information is used for the ROLookUp
|
||||
// F2023-035: WCN - allow for change in left margin for supplemental information pages by
|
||||
// setting a value in the DocStyle for the adjustment.
|
||||
// F2023-035: WCN - allow for change in left margin for supplemental information pages by
|
||||
// setting a value in the DocStyle for the adjustment.
|
||||
float supInfoMargAdj = 0;
|
||||
if (CreatingSupInfoPage || MyPromsPrinter.DoingFacingPage) supInfoMargAdj = MySection.MyDocStyle.SupInfoMargAdj == null ? 0 : (float)MySection.MyDocStyle.SupInfoMargAdj;
|
||||
foreach (VEPROMS.CSLA.Library.PageItem pageItem in pageStyle.PageItems)
|
||||
{
|
||||
if (pageItem.Token == null) continue; // can be null if token is dependent on PSI lookup!
|
||||
DidHLSText = false; // reset to false for this group of tokens.
|
||||
//if (pageItem.Token.Contains("HLSTEXT"))
|
||||
// Console.WriteLine("{0} - PageList Token", pageItem.Token);
|
||||
//if (pageItem.Token.Contains("HLSTEXT"))
|
||||
// Console.WriteLine("{0} - PageList Token", pageItem.Token);
|
||||
|
||||
// the pagelist 'justify="{PSNotFirst}"' flag only puts item out if not on first page of section, check for this
|
||||
if (((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSNotFirst) == VEPROMS.CSLA.Library.E_Justify.PSNotFirst)
|
||||
@@ -1376,7 +1381,7 @@ i = 0;
|
||||
}
|
||||
|
||||
VE_Font useFontForCheckOffHeader = null;
|
||||
if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag ==0 )&& (pageItem.Row < 0))))
|
||||
if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag == 0) && (pageItem.Row < 0))))
|
||||
{
|
||||
//if (PrevRow > 0)
|
||||
//{
|
||||
@@ -1390,12 +1395,12 @@ i = 0;
|
||||
// prevLPI = curLPI;
|
||||
// }
|
||||
//}
|
||||
// C2019-006 - Moved and modified the RO_Lookup() logic here, before we process the tokens in the page list
|
||||
// this allows us to use RO_Lookup() in a "PS=" conditional token (is usually a PSI check box)
|
||||
// A while loop was also added to the we can have more than one call to RO_Lookup() on a pagelist line
|
||||
// this logic was put in for Barakah Alarms
|
||||
// Note that each Alarm is defined as its own RO in the Referenced Object database, with multiple return values
|
||||
// to define the Window ID, Alarm, Source, Setpoint, etc. for example.
|
||||
// C2019-006 - Moved and modified the RO_Lookup() logic here, before we process the tokens in the page list
|
||||
// this allows us to use RO_Lookup() in a "PS=" conditional token (is usually a PSI check box)
|
||||
// A while loop was also added to the we can have more than one call to RO_Lookup() on a pagelist line
|
||||
// this logic was put in for Barakah Alarms
|
||||
// Note that each Alarm is defined as its own RO in the Referenced Object database, with multiple return values
|
||||
// to define the Window ID, Alarm, Source, Setpoint, etc. for example.
|
||||
string pltok = pageItem.Token;
|
||||
while (pltok.Contains("RO_Lookup("))
|
||||
{
|
||||
@@ -1441,11 +1446,11 @@ i = 0;
|
||||
int idx = procnum.IndexOf('-');
|
||||
otherChildUnit = procnum.Substring(0, idx); // we need to get RO info for the Other child applicability - this gets child's number
|
||||
}
|
||||
ROLookupVal = ROLookup(parts[0], parts[1], string.Empty,otherChildUnit); // will return empty string if alarm point is not found in RO database
|
||||
ROLookupVal = ROLookup(parts[0], parts[1], string.Empty, otherChildUnit); // will return empty string if alarm point is not found in RO database
|
||||
usePSIvalue = (ROLookupVal != section.MyProcedure.DisplayNumber); // use PSI value if child alarm ID not found or does not match resolved procedure number (alarm point)
|
||||
}
|
||||
// C2021-065 if usePSIvalue is true, then we know alarm point info is not in the RO database, so just use the default (PSI) value
|
||||
if (usePSIvalue)
|
||||
if (usePSIvalue)
|
||||
ROLookupVal = parts[2]; // C2021-065 use the value defined in the PSI
|
||||
else
|
||||
ROLookupVal = ROLookup(parts[0], parts[1], parts[2], otherChildUnit);
|
||||
@@ -1476,18 +1481,18 @@ i = 0;
|
||||
}
|
||||
// C2021-065 (BNPP Alarms format) we are processing a paglist flag (ROLkUpMatch) to determine how to get Alarm Point information
|
||||
// Nothing else is on this page list item, so use "continue" to jump to the next pagelist item as nothing gets printed for this item
|
||||
if (pageItem.ROLkUpMatch)
|
||||
if (pageItem.ROLkUpMatch)
|
||||
continue;
|
||||
|
||||
MatchCollection matches = regexFindToken.Matches(pltok);//(pageItem.Token);
|
||||
if (matches.Count > 0)
|
||||
{
|
||||
string plstr = string.Empty;
|
||||
string plstr = string.Empty;
|
||||
// When a pagelist line (row) has more than one token that is resolved to text, each resolved token text was place on top
|
||||
// of each other. Use a temporary string (plstr) to process the pagelist tokens for each pagelist line (row) before adding
|
||||
// it to the svgGroup.
|
||||
plstr = pltok;//pageItem.Token;
|
||||
// F2017-046: Remove the '@@' characters that were getting printed on SAMG Sup Info facing pages for Calvert (BGESAM1 format).
|
||||
plstr = pltok;//pageItem.Token;
|
||||
// F2017-046: Remove the '@@' characters that were getting printed on SAMG Sup Info facing pages for Calvert (BGESAM1 format).
|
||||
if (MyPromsPrinter.DoingFacingPage && plstr.Contains("@@")) plstr = plstr.Replace("@@", string.Empty);
|
||||
foreach (Match match in matches)
|
||||
{
|
||||
@@ -1519,8 +1524,8 @@ i = 0;
|
||||
if (relval == "Y")
|
||||
{
|
||||
//svgGroup.Add(PageItemToSvgText(pageItem.Token, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection));
|
||||
svgGroup.Add(PageItemToSvgText(pltok, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection));
|
||||
plstr = string.Empty; // Clear it so it isn't put out twice (used below)
|
||||
svgGroup.Add(PageItemToSvgText(pltok, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection));
|
||||
plstr = string.Empty; // Clear it so it isn't put out twice (used below)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1531,7 +1536,7 @@ i = 0;
|
||||
}
|
||||
if (val != null && val != string.Empty && !PgLogicals.ContainsKey(pstok)) PgLogicals.Add(pstok, val != null);
|
||||
//if (val == null || val == string.Empty)
|
||||
//val = " ";
|
||||
//val = " ";
|
||||
if (val == null)
|
||||
val = string.Empty;
|
||||
plstr = plstr.Replace(token, val);
|
||||
@@ -1619,7 +1624,7 @@ i = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
svgGroup.Add(PageItemToSvgText(pageItem, pltok, MySection, supInfoMargAdj));
|
||||
svgGroup.Add(PageItemToSvgText(pageItem, pltok, MySection, supInfoMargAdj));
|
||||
}
|
||||
}
|
||||
// Proms page numbering designed requires a "{PAGE}" token to increment the page counter. So the easiest way
|
||||
@@ -1649,7 +1654,7 @@ i = 0;
|
||||
private string ROLookup(string accpageid, string multiid, string deflt, string overrideChild)
|
||||
{
|
||||
ROFSTLookup myLookup = MySection.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MySection.MyDocVersion, overrideChild);
|
||||
|
||||
|
||||
string accpgid = accpageid;
|
||||
ROFSTLookup.rochild roc = myLookup.GetROChildByAccPageID("<" + accpgid + "." + multiid + ">", MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix);
|
||||
|
||||
@@ -1685,10 +1690,10 @@ i = 0;
|
||||
public string HLSText
|
||||
{
|
||||
get { return _HLSText; }
|
||||
set
|
||||
set
|
||||
{
|
||||
if (_HLSText == string.Empty)
|
||||
_HLSText = value;
|
||||
_HLSText = value;
|
||||
}
|
||||
}
|
||||
private string _HLSTAB = string.Empty;
|
||||
@@ -1782,7 +1787,7 @@ i = 0;
|
||||
plstr = plstr.Replace(token, string.Empty);
|
||||
svgGroup.Add(PageItemToSvgUse(pageItem, FirstAndLast(token), supInfoMargAdj));
|
||||
break;
|
||||
case "{PMODEBOX}": // need to set either 1 or 2 depending on number of columns
|
||||
case "{PMODEBOX}": // need to set either 1 or 2 depending on number of columns
|
||||
case "[PMODEBOX]":
|
||||
string box = "1";
|
||||
if (_MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.Four)
|
||||
@@ -1824,7 +1829,7 @@ i = 0;
|
||||
case "[PROCTITLE3]":
|
||||
case "{COVERPROCTITLE}":
|
||||
case "[COVERPROCTITLE]":
|
||||
int tlen = (token.Contains("COVERPROCTITLE"))?(int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength;
|
||||
int tlen = (token.Contains("COVERPROCTITLE")) ? (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength;
|
||||
//float linelen = (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength * (float)pageItem.Font.CPI / 12;
|
||||
float linelen = tlen * (float)pageItem.Font.CPI / 12;
|
||||
string title = section.MyProcedure.MyContent.Text;
|
||||
@@ -1852,7 +1857,7 @@ i = 0;
|
||||
break;
|
||||
case "{TITLE&UNIT}":
|
||||
case "[TITLE&UNIT]":
|
||||
tlen = (token.Contains("COVERPROCTITLE"))?(int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength;
|
||||
tlen = (token.Contains("COVERPROCTITLE")) ? (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength;
|
||||
linelen = tlen * (float)pageItem.Font.CPI / 12;
|
||||
plstr = SplitTitleAndUnit(svgGroup, pageItem, section.MyProcedure.MyContent.Text.ToUpper(), (int)linelen, token, plstr); //,rowAdj);
|
||||
break;
|
||||
@@ -1899,8 +1904,8 @@ i = 0;
|
||||
case "{PDFTime}":
|
||||
plstr = plstr.Replace("{PDFTime}", DateTime.Now.ToString("HH:mm:ss"));
|
||||
break;
|
||||
// F2023-087: Added PDFDate at PDFTime - note that cannot have multiple tokens in a conditional because of reg expression
|
||||
// processing.
|
||||
// F2023-087: Added PDFDate at PDFTime - note that cannot have multiple tokens in a conditional because of reg expression
|
||||
// processing.
|
||||
case "[PDFDateAtTime]":
|
||||
plstr = plstr.Replace("[PDFDateAtTime]", DateTime.Now.ToString("MM/dd/yyyy") + " at " + DateTime.Now.ToString("HH:mm:ss"));
|
||||
break;
|
||||
@@ -1916,12 +1921,12 @@ i = 0;
|
||||
if (unitnum.Length > 0)
|
||||
{
|
||||
if (unitnum.Contains("#"))
|
||||
eopnum = unitnum.Replace("#", eopnum);
|
||||
eopnum = unitnum.Replace("#", eopnum);
|
||||
if (unitnum.Contains("!"))
|
||||
eopnum = unitnum.Replace("!", unitname);
|
||||
if (eopnum == string.Empty)
|
||||
eopnum = section.MyProcedure.MyContent.Number;
|
||||
|
||||
|
||||
if (eopnum.ToUpper().Contains(@"<U"))
|
||||
{
|
||||
// C2021-064 If we are processing the EOP number or an ROLookUp in the pagelist, then strip out the Parent/Child unit tokens
|
||||
@@ -1971,13 +1976,13 @@ i = 0;
|
||||
case "[ATTACHTITLECONT]":
|
||||
// B2020-038: incorrect pagination: Note that if PSOnlyFirst is active and pagination is set to continuous, pagination may be incorrect in printed output (no code change-just info here in case happens again)
|
||||
bool printsectlevel = ((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) != VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) ||
|
||||
(((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) == VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) && PrintedSectionPage==0);
|
||||
(((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) == VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) && PrintedSectionPage == 0);
|
||||
// if there is 'no title' for the section, only print it if a format flag says to print it.
|
||||
if (printsectlevel)
|
||||
{
|
||||
if (section.DisplayText.ToUpper().Contains("<NO TITLE>") && !section.ActiveFormat.PlantFormat.FormatData.ProcData.PrintNoTitle) printsectlevel = false;
|
||||
}
|
||||
if (MyPromsPrinter.DoingFacingPage) printsectlevel = false; // don't put out section title/number if doing SAMG facing pages
|
||||
if (MyPromsPrinter.DoingFacingPage) printsectlevel = false; // don't put out section title/number if doing SAMG facing pages
|
||||
if (printsectlevel)
|
||||
{
|
||||
string stitle = section.DisplayText;
|
||||
@@ -1985,11 +1990,11 @@ i = 0;
|
||||
&& token.Contains("ATTACHTITLECONT") && DidFirstPageDocStyle)
|
||||
{
|
||||
string myMsg = section.MyDocStyle.Continue.Top.Message;
|
||||
if (myMsg != null && myMsg != string.Empty)stitle = stitle + myMsg;
|
||||
if (myMsg != null && myMsg != string.Empty) stitle = stitle + myMsg;
|
||||
}
|
||||
// B2023-043: Beaver Valley AOP - allow attributes, such as superscript on section titles when printing
|
||||
if (section.ActiveFormat.PlantFormat.FormatData.PrintData.SectionTitleWithAttributes)
|
||||
stitle = section.FormattedDisplayText;
|
||||
if (section.ActiveFormat.PlantFormat.FormatData.PrintData.SectionTitleWithAttributes)
|
||||
stitle = section.FormattedDisplayText;
|
||||
// B2021-119: large titles on Landscape Word Attachments are printing on 2 lines.
|
||||
// B2022-149: crash on cast if null
|
||||
int? stl = (int?)section.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumberAndTitleLength;
|
||||
@@ -2004,7 +2009,7 @@ i = 0;
|
||||
plstr = plstr.Replace(token, string.Empty);
|
||||
//svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayText));
|
||||
break;
|
||||
case "{METASECTIONTITLE}": // This will print the top level section title (versus level above current) starting from a sub-section
|
||||
case "{METASECTIONTITLE}": // This will print the top level section title (versus level above current) starting from a sub-section
|
||||
case "[METASECTIONTITLE]":
|
||||
if (section.MyParent.IsSection)
|
||||
{
|
||||
@@ -2054,9 +2059,9 @@ i = 0;
|
||||
// text starts with a ' - ' - remove it.
|
||||
else if (plstr.StartsWith(" - ") && plstr.IndexOf("{SECTIONLEVELTITLE}") == 3)
|
||||
plstr = plstr.Substring(3);
|
||||
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.DisplayNumber)));
|
||||
break;
|
||||
case "{METASECTIONNUMBER}": // This will print the top level section number when starting from a sub-section
|
||||
//svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.DisplayNumber)));
|
||||
break;
|
||||
case "{METASECTIONNUMBER}": // This will print the top level section number when starting from a sub-section
|
||||
case "[METASECTIONNUMBER]":
|
||||
if (section.MyParent.IsSection)
|
||||
{
|
||||
@@ -2118,12 +2123,12 @@ i = 0;
|
||||
break;
|
||||
case "{ATTACHNUM}":
|
||||
case "[ATTACHNUM]":
|
||||
plstr = plstr.Replace(token, "1"); // used by SHESDD - but 16bit returns '1' unless has format flag 'MoveParensToToken' that was only in SCE (San Onofre)
|
||||
plstr = plstr.Replace(token, "1"); // used by SHESDD - but 16bit returns '1' unless has format flag 'MoveParensToToken' that was only in SCE (San Onofre)
|
||||
break;
|
||||
case "{ATTACHNUM1}":
|
||||
case "[ATTACHNUM1]":
|
||||
string numAtt = GetAttachNum1();
|
||||
plstr = plstr.Replace(token, numAtt); // used by SHESDD - but 16bit returns '1' unless has format flag 'MoveParensToToken' that was only in SCE (San Onofre)
|
||||
plstr = plstr.Replace(token, numAtt); // used by SHESDD - but 16bit returns '1' unless has format flag 'MoveParensToToken' that was only in SCE (San Onofre)
|
||||
break;
|
||||
case "{CHKOFFHEADING}":
|
||||
case "[CHKOFFHEADING]":
|
||||
@@ -2212,7 +2217,7 @@ i = 0;
|
||||
// plants that have been delivered - so added special code for BGE.
|
||||
if (section.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert)
|
||||
{
|
||||
if (Regex.IsMatch(procnum.Substring(0,1),"[A-Za-z]"))
|
||||
if (Regex.IsMatch(procnum.Substring(0, 1), "[A-Za-z]"))
|
||||
plstr = pd.ProcDescr1;
|
||||
else
|
||||
plstr = string.Empty;
|
||||
@@ -2268,12 +2273,12 @@ i = 0;
|
||||
plstr = plstr.Replace(token, thisDate2.ToString("H:mm"));
|
||||
break;
|
||||
case "{HLRNO}":
|
||||
plstr = HLRNO==null?string.Empty:plstr.Replace(token, HLRNO);
|
||||
plstr = HLRNO == null ? string.Empty : plstr.Replace(token, HLRNO);
|
||||
break;
|
||||
case "{HLSTAB}":
|
||||
if (HLSTAB.Contains("{!Clock}")) // F2022-024 replace with the clock symbol defined in GenMac format file
|
||||
{
|
||||
HLSTAB = HLSTAB.Replace("{!Clock}",string.Empty).TrimStart(" ".ToCharArray());
|
||||
HLSTAB = HLSTAB.Replace("{!Clock}", string.Empty).TrimStart(" ".ToCharArray());
|
||||
svgGroup.Add(PageItemToSvgUse(pageItem, "Clock", supInfoMargAdj));
|
||||
}
|
||||
plstr = plstr.Replace(token, HLSTAB);
|
||||
@@ -2392,7 +2397,7 @@ i = 0;
|
||||
}
|
||||
if (token.Contains(@"RO-"))
|
||||
{
|
||||
plstr = token.Replace("{",string.Empty).Replace("}",string.Empty);
|
||||
plstr = token.Replace("{", string.Empty).Replace("}", string.Empty);
|
||||
svgGroup.Add(PageItemToSvgText(pageItem, plstr, MySection, 0));
|
||||
}
|
||||
if (token.Contains(@"PS-"))
|
||||
@@ -2407,7 +2412,7 @@ i = 0;
|
||||
{
|
||||
val = procConfig.GetValue("PSI", token.Substring(4, token.Length - 5));
|
||||
// F2021-034: Resolve applicability unit tokens (not just '<u>')
|
||||
if(val.ToUpper().Contains("<U>") || val.ToUpper().Contains("<U-")) // Replace token with the applicable unit information
|
||||
if (val.ToUpper().Contains("<U>") || val.ToUpper().Contains("<U-")) // Replace token with the applicable unit information
|
||||
{
|
||||
string unbr3 = ResolveUnitApp(MySection.MyDocVersion, val);
|
||||
val = unbr3 ?? string.Empty;
|
||||
@@ -2416,9 +2421,9 @@ i = 0;
|
||||
// defined, see if the text is too wide for a single line (SplitTextMaxWidth). The
|
||||
// AdjustTopMarginForMultLinePageListItem contains the y-adjustment that must be considered
|
||||
// in the TopMargin if the PSI text split onto more than one line.
|
||||
if ((pageItem.MaxWidth ?? 0) > 0 || (pageItem.MaxWidthCurPage ?? 0) > 0)
|
||||
if ((pageItem.MaxWidth ?? 0) > 0 || (pageItem.MaxWidthCurPage ?? 0) > 0)
|
||||
{
|
||||
int locwid = ((pageItem.MaxWidth??0)>0)?(int)pageItem.MaxWidth:(int)pageItem.MaxWidthCurPage;
|
||||
int locwid = ((pageItem.MaxWidth ?? 0) > 0) ? (int)pageItem.MaxWidth : (int)pageItem.MaxWidthCurPage;
|
||||
AdjustTopMarginForMultiLinePageListItems = SplitTextMaxWidth(svgGroup, pageItem, val, locwid, token, ref plstr);
|
||||
if ((pageItem.MaxWidthCurPage ?? 0) > 0) AdjustTopMarginForMultiLinePageListItems = 0;
|
||||
}
|
||||
@@ -2561,7 +2566,7 @@ i = 0;
|
||||
foreach (string line in titleLines)
|
||||
{
|
||||
cnt++;
|
||||
if (cnt == 1 && yOffset == 0)
|
||||
if (cnt == 1 && yOffset == 0)
|
||||
plstr = plstr.Replace(match, line);
|
||||
else
|
||||
{
|
||||
@@ -2579,7 +2584,7 @@ i = 0;
|
||||
}
|
||||
return Math.Max(0, yOffset);
|
||||
}
|
||||
private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr,int? numAndTitleLen)
|
||||
private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr, int? numAndTitleLen)
|
||||
{
|
||||
bool includePrecedingText = false;
|
||||
if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, string.Empty);
|
||||
@@ -2590,7 +2595,7 @@ i = 0;
|
||||
// This logic does not handle any pagelist tokens following the section title.
|
||||
// "@@" acts like a hanging indent (Calvert) so don't include stuff before the title
|
||||
// For now, made this explicite with the use of SectionLevelTitle
|
||||
if ((numAndTitleLen != null && numAndTitleLen > 0) && !plstr.Contains("@@") && (plstr.IndexOf("{SECTIONLEVELTITLE}") > 0))
|
||||
if ((numAndTitleLen != null && numAndTitleLen > 0) && !plstr.Contains("@@") && (plstr.IndexOf("{SECTIONLEVELTITLE}") > 0))
|
||||
{
|
||||
int idx = plstr.IndexOf(match);
|
||||
title = plstr.Replace(match, title); // include everthing on this line for splitting
|
||||
@@ -2603,11 +2608,11 @@ i = 0;
|
||||
// B2022-061: don't print '\line' as part of procedure title in pagelist items.
|
||||
if (match == "{PROCTITLE}") title = title.Replace("\\line ", string.Empty);
|
||||
if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, string.Empty); // this would have been done in proctitle1
|
||||
plstr = plstr.Replace(match, title).Replace("@@",string.Empty);
|
||||
plstr = plstr.Replace(match, title).Replace("@@", string.Empty);
|
||||
//svgGroup.Add(PageItemToSvgText(pageItem, title));
|
||||
return plstr;
|
||||
}
|
||||
|
||||
|
||||
// BGE has a '@@' in its section number/title pagelist item for eops. If the title goes onto two lines,
|
||||
// the '@@' marked the starting location for the title. Process this differently than other split titles:
|
||||
if (plstr.Contains("@@"))
|
||||
@@ -2616,7 +2621,7 @@ i = 0;
|
||||
return string.Empty; // all resolved pagelist items were already added to svgGroup for printing.
|
||||
}
|
||||
// Otherwise determine how many line to split the text into
|
||||
List<string>titleLines = Volian.Base.Library.RtfTools.SplitText(title,(includePrecedingText)?(int)numAndTitleLen: (int)len);
|
||||
List<string> titleLines = Volian.Base.Library.RtfTools.SplitText(title, (includePrecedingText) ? (int)numAndTitleLen : (int)len);
|
||||
|
||||
// Adjust y location based on which pagelist token & how many lines. Proctitle1 is adjusted if
|
||||
// there are more than 2 lines (proctitle1 should have it's own y location that is used if there are 1 or 2 lines.)
|
||||
@@ -2662,11 +2667,11 @@ i = 0;
|
||||
public PageItem PIInitials
|
||||
{
|
||||
get { return _PIInitials; }
|
||||
set
|
||||
set
|
||||
{
|
||||
if (_PIInitials != null && value == null)
|
||||
_LastPIInitials = _PIInitials;
|
||||
_PIInitials = value;
|
||||
_PIInitials = value;
|
||||
}
|
||||
}
|
||||
private PageItem _LastPIInitials = null;
|
||||
@@ -2687,11 +2692,11 @@ i = 0;
|
||||
get { return _InitialsPrinted; }
|
||||
set { _InitialsPrinted = value; }
|
||||
}
|
||||
public bool PrintInitials(PdfContentByte cb,float yLocation, float leftMargin)
|
||||
public bool PrintInitials(PdfContentByte cb, float yLocation, float leftMargin)
|
||||
{
|
||||
if (InitialsPrinted) return false;
|
||||
InitialsPrinted = true;
|
||||
vlnParagraph.TextAt(cb,this, PIInitials ?? LastPIInitials, yLocation, leftMargin);
|
||||
vlnParagraph.TextAt(cb, this, PIInitials ?? LastPIInitials, yLocation, leftMargin);
|
||||
return true;
|
||||
}
|
||||
private void DoSpecialSectNumTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr)
|
||||
@@ -2780,7 +2785,7 @@ i = 0;
|
||||
}
|
||||
// if the token was proctitle, dont' adjust. If the token was PROCTITLE1/2 then
|
||||
// move down 6.
|
||||
// int adj = pageItem.Token.Contains("1") || pageItem.Token.Contains("2") ? 0 : -6;
|
||||
// int adj = pageItem.Token.Contains("1") || pageItem.Token.Contains("2") ? 0 : -6;
|
||||
int adj = (titleLines.Count > 2) ? -6 : 0;
|
||||
float yOffset = adj * (titleLines.Count - 2);
|
||||
int lnCnt = 0;
|
||||
@@ -2853,7 +2858,7 @@ i = 0;
|
||||
// Take the difference between the width in Points of a character at 12CPI and a character
|
||||
// at the defined font's CPI. Multiply that times the length of title and divide by two
|
||||
// to find the half-way point.
|
||||
|
||||
|
||||
// if the PageItem's font CPI is null, then default to 12 CPI
|
||||
colAdj16bit = (1 + text.Length) * ((72 / (float)(pageItem.Font.CPI ?? 12)) - (72 / 12)) / 2;
|
||||
}
|
||||
@@ -2877,11 +2882,11 @@ i = 0;
|
||||
}
|
||||
// F2023-035: WCN - allow for change in left margin for supplemental information pages by
|
||||
// setting a value in the DocStyle for the adjustment.
|
||||
svgText.X = new SvgMeasurement((float)lcol - colAdj16bit + supmargadj, E_MeasurementUnits.PT); // F2023-035: Add in supplemental info margin adjust
|
||||
svgText.X = new SvgMeasurement((float)lcol - colAdj16bit + supmargadj, E_MeasurementUnits.PT); // F2023-035: Add in supplemental info margin adjust
|
||||
svgText.Y = new SvgMeasurement(row, E_MeasurementUnits.PT);
|
||||
if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace
|
||||
// C2018-004 create meta file for baseline compares
|
||||
Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text));
|
||||
// C2018-004 create meta file for baseline compares
|
||||
Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text));
|
||||
return svgText;
|
||||
}
|
||||
// F2021-070 & 066 - shrink font size of page list items if format has amount. ShrinkIt compares size (width) of text with input font and
|
||||
@@ -2968,7 +2973,7 @@ i = 0;
|
||||
svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT); // new SvgMeasurement((float)(pageItem.Col ?? 0), E_MeasurementUnits.PT);
|
||||
svgText.Y = new SvgMeasurement((float)(yOffset + pageItem.Row ?? 0), E_MeasurementUnits.PT);
|
||||
if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace
|
||||
// C2018-004 create meta file for baseline compares
|
||||
// C2018-004 create meta file for baseline compares
|
||||
Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text));
|
||||
return svgText;
|
||||
}
|
||||
@@ -3015,8 +3020,8 @@ i = 0;
|
||||
svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT); // new SvgMeasurement((float)(pageItem.Col ?? 0), E_MeasurementUnits.PT);
|
||||
svgText.Y = new SvgMeasurement(row, E_MeasurementUnits.PT);
|
||||
if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace
|
||||
// C2018-004 create meta file for baseline compares
|
||||
Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text));
|
||||
// C2018-004 create meta file for baseline compares
|
||||
Volian.Base.Library.BaselineMetaFile.WriteLine(" PL x {0} y {1} {2} {3} {4} \"{5}\"", svgText.X, svgText.Y, svgText.FontFamily, svgText.FontSize, svgText.SVGFontStyle, TextForBaseline.FixText(svgText.Text));
|
||||
return svgText;
|
||||
}
|
||||
private static List<string> _MissingTokens = new List<string>();
|
||||
@@ -3028,7 +3033,7 @@ i = 0;
|
||||
return CurrentPageNumber.ToString();
|
||||
case "{OF}": // Total Page Count for this section
|
||||
return CurrentPageOf.ToString();
|
||||
case "{REV}": // Revision Number and/or Revision string.
|
||||
case "{REV}": // Revision Number and/or Revision string.
|
||||
case "{REV2}":
|
||||
// The 16bit code has a revision number & then a revision date. This revision date
|
||||
// was actually either a date OR a string. The 32bit code no longer will call this
|
||||
@@ -3039,14 +3044,14 @@ i = 0;
|
||||
if (Rev != null && Rev != string.Empty) Rev = Rev.TrimStart(" ".ToCharArray());
|
||||
|
||||
// Now check the format flags to determine if/how the Rev string should be parsed.
|
||||
if ((MySection.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && Rev.Contains("/"))
|
||||
if ((MySection.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && Rev.Contains("/"))
|
||||
|| (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && Rev.Contains("\\")))
|
||||
{
|
||||
int indx = Rev.IndexOf(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/');
|
||||
if (match.Value == "{REV}") return Rev.Substring(0,indx);
|
||||
return Rev.Substring(indx+1);
|
||||
if (match.Value == "{REV}") return Rev.Substring(0, indx);
|
||||
return Rev.Substring(indx + 1);
|
||||
}
|
||||
if (match.Value == "{REV}")return Rev;
|
||||
if (match.Value == "{REV}") return Rev;
|
||||
return System.DateTime.Today.ToShortDateString();
|
||||
case "{CHKOFFHEADING}":
|
||||
return PageListTopCheckOffHeader;
|
||||
@@ -3109,8 +3114,8 @@ i = 0;
|
||||
private ItemInfo _MyItemInfo;
|
||||
public ItemInfo MyItemInfo
|
||||
{
|
||||
get { return _MyItemInfo; }
|
||||
set { _MyItemInfo = value; }
|
||||
get { return _MyItemInfo; }
|
||||
set { _MyItemInfo = value; }
|
||||
}
|
||||
private string _Title;
|
||||
public string Title
|
||||
@@ -3188,7 +3193,7 @@ i = 0;
|
||||
}
|
||||
/*
|
||||
* could have line thickness (set default from 16-bit), line color (set default as black), line style
|
||||
*/
|
||||
*/
|
||||
public ChangeBarDefinition()
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user