Additional code to support special cases in Template for Calvert Alarms including a TemplateColumnMode and mix of Cautions/Notes

Added Support for BGE Alarms, bottom continue message location.
Additional code to support special cases in Template for Calvert Alarms and new flag SpecialCaseCalvertAlarm
Support for Docstyle DSS_PageBreakHLS for page break on HLS
Changes for Calvert Alarms use of template to define top portion of alarm pages and CONDITION/RESPONSE table support.
Handle 3 top/bottom continue messages for Calvert Alarms; support box around CONDITION/RESPONSE table in Calvert Alarms; {REVUNIT} fix;
if TabPtsPerChar format is 0, set to a default of 6
This commit is contained in:
2014-08-01 11:56:02 +00:00
parent b24dfe988d
commit 9b67771f55
7 changed files with 762 additions and 281 deletions

View File

@@ -49,6 +49,18 @@ namespace Volian.Print.Library
get { return _TopMessageR; }
set { _TopMessageR = value; }
}
private vlnText _TopMessageSub1; // BGE Alarms: in CONDITION/RESPONSE if break within substep
public vlnText TopMessageSub1
{
get { return _TopMessageSub1; }
set { _TopMessageSub1 = value; }
}
private vlnText _TopMessageSub2; // BGE Alarms: in CONDITION/RESPONSE if break within substep
public vlnText TopMessageSub2
{
get { return _TopMessageSub2; }
set { _TopMessageSub2 = value; }
}
private vlnText _BottomMessage;
public vlnText BottomMessage
{
@@ -61,6 +73,12 @@ namespace Volian.Print.Library
get { return _BottomMessageR; }
set { _BottomMessageR = value; }
}
private vlnText _BottomMessageA; // Added if there are 3 messages, at bottom AND in AER AND RNO (for BGEALARMS)
public vlnText BottomMessageA
{
get { return _BottomMessageA; }
set { _BottomMessageA = value; }
}
Dictionary<int, vlnParagraph> _MyParagraphs = new Dictionary<int, vlnParagraph>();
public Dictionary<int, vlnParagraph> MyParagraphs
{
@@ -79,6 +97,18 @@ namespace Volian.Print.Library
get { return _PhoneListHeight; }
set { _PhoneListHeight = value; }
}
private float _AlarmYoffStart = 0;
public float AlarmYoffStart
{
get { return _AlarmYoffStart; }
set { _AlarmYoffStart = value; }
}
private float _AlarmYoffEnd = 0;
public float AlarmYoffEnd
{
get { return _AlarmYoffEnd; }
set { _AlarmYoffEnd = value; }
}
private PdfWriter _MyPdfWriter;
public PdfWriter MyPdfWriter
{
@@ -203,12 +233,53 @@ namespace Volian.Print.Library
if (MySection.ColumnMode > 0)
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.SpecialCaseCalvertAlarm)
{
float left = (float)MySection.MyDocStyle.Layout.LeftMargin + 4.5f; // used 4.5 to make bge alarm lines closest to lining up with macro
float right = (float)MySection.MyDocStyle.Layout.PageWidth;
if (AlarmYoffStart > 0)
{
// draw vertical - either to the alarmyoffend or bottom of page
if (AlarmYoffEnd > 0) // ends on this page.
{
DrawVertical(writer.DirectContent, left, AlarmYoffStart, AlarmYoffEnd);
DrawVertical(writer.DirectContent, right, AlarmYoffStart, AlarmYoffEnd);
DrawVertical(writer.DirectContent, (right + left) / 2, AlarmYoffStart, AlarmYoffEnd);
DrawHorizontal(writer.DirectContent, left, right, AlarmYoffEnd);
AlarmYoffStart = 0;
AlarmYoffEnd = 0;
}
else
{
float yBottom = (float)(writer.DirectContent.PdfWriter.PageSize.Height - ((float)MySection.MyDocStyle.Layout.TopMargin + (float)MySection.MyDocStyle.Layout.PageLength));
DrawVertical(writer.DirectContent, left, AlarmYoffStart, yBottom);
DrawVertical(writer.DirectContent, right, AlarmYoffStart, yBottom);
DrawVertical(writer.DirectContent, (right + left) / 2, AlarmYoffStart, yBottom);
DrawHorizontal(writer.DirectContent, left, right, yBottom);
AlarmYoffStart = (float)writer.DirectContent.PdfWriter.PageSize.Height - (float)MySection.MyDocStyle.Layout.TopMargin;
}
}
}
PageListTopCheckOffHeader = null;
PageListLastCheckOffHeader = null;
YMultiplier = 1;
PrintedAPage = true;
}
private void DrawVertical(PdfContentByte cb, float x, float top, float bottom)
{
cb.SaveState();
if (PageListLayer != null) cb.BeginLayer(PageListLayer);
cb.SetColorStroke(new Color(PrintOverride.SvgColor));
//cb.SetColorStroke(lineColor);
cb.MoveTo(x, top);
cb.LineTo(x, bottom);
cb.Stroke();
if (PageListLayer != null) cb.EndLayer();
cb.RestoreState();
}
private void DrawPhoneList(PdfContentByte pdfContentByte, float leftMargin, float pageWidth, float yOff, string plist)
{
// draw the line above the phone list:
@@ -490,6 +561,16 @@ namespace Volian.Print.Library
TopMessageR.ToPdf(cb, 0, ref tmp, ref tmp);
TopMessageR = null; // Only output it once.
}
if (TopMessageSub1 != null)
{
TopMessageSub1.ToPdf(cb, 0, ref tmp, ref tmp);
TopMessageSub1 = null; // Only output it once.
}
if (TopMessageSub2 != null)
{
TopMessageSub2.ToPdf(cb, 0, ref tmp, ref tmp);
TopMessageSub2 = null; // Only output it once.
}
if (BottomMessage != null)
{
BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp);
@@ -500,6 +581,11 @@ namespace Volian.Print.Library
BottomMessageR.ToPdf(cb, 0, ref tmp, ref tmp);
BottomMessageR = null; // Only output it once.
}
if (BottomMessageA != null)
{
BottomMessageA.ToPdf(cb, 0, ref tmp, ref tmp);
BottomMessageA = null; // Only output it once.
}
}
public void DrawBottomMessage(PdfContentByte cb)
{
@@ -1472,7 +1558,11 @@ namespace Volian.Print.Library
string revUnit = null;
string unitNum = MySection.MyDocVersion.DocVersionConfig.Print_UnitNumberForPageList;
if (Rev != null && Rev != "")
{
revUnit = Rev;
int indxs = Rev.IndexOf(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/');
if (indxs > 0) revUnit = Rev.Substring(0, indxs);
}
else
revUnit = " ";