Added property ‘BottomIsTable’ for determining that last item with change bar is a table

For Calvert Alarms, include table in continuous change bars
This commit is contained in:
Kathy Ruffing 2014-08-27 16:48:35 +00:00
parent 9825ea8ff9
commit 01f078ea4f
2 changed files with 18 additions and 7 deletions

View File

@ -722,6 +722,7 @@ namespace Volian.Print.Library
{ {
if (prevCB == null) prevCB = cb; if (prevCB == null) prevCB = cb;
else if (prevCB.YChangeBarBottom > cb.YChangeBarBottom) prevCB = cb; else if (prevCB.YChangeBarBottom > cb.YChangeBarBottom) prevCB = cb;
cb.BottomIsTable = (vcb.MyParent.MyItemInfo.IsTable);
} }
} }
} }
@ -779,19 +780,23 @@ namespace Volian.Print.Library
} }
private bool OverlapOrSpan(vlnChangeBar cb, vlnChangeBar vcb) private bool OverlapOrSpan(vlnChangeBar cb, vlnChangeBar vcb)
{ {
float tolerance = vlnPrintObject.SixLinesPerInch;
if (cb.MyParent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm &&
(vcb.MyParent.MyItemInfo.IsTable || cb.MyParent.MyItemInfo.IsTable || cb.BottomIsTable)) tolerance *= 1.5f;
if (cb.MyParent.MyItemInfo.MyHLS.ItemID != vcb.MyParent.MyItemInfo.MyHLS.ItemID) return false; if (cb.MyParent.MyItemInfo.MyHLS.ItemID != vcb.MyParent.MyItemInfo.MyHLS.ItemID) return false;
// cb.Yoffset is within range of vcb: // cb.Yoffset is within range of vcb:
if (cb.YOffset <= vcb.YOffset && if (cb.YOffset <= vcb.YOffset &&
cb.YOffset >= (vcb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch)) return true; cb.YOffset >= (vcb.YChangeBarBottomExtend - tolerance)) return true;
// cb.YChangeBarBottom is within range of vcb: // cb.YChangeBarBottom is within range of vcb:
if ((cb.YChangeBarBottomExtend-vlnPrintObject.SixLinesPerInch) <= vcb.YOffset && if ((cb.YChangeBarBottomExtend - tolerance) <= vcb.YOffset &&
cb.YChangeBarBottomExtend >= (vcb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch)) return true; cb.YChangeBarBottomExtend >= (vcb.YChangeBarBottomExtend - tolerance)) return true;
// vcb.Yoffset is within range of cb: // vcb.Yoffset is within range of cb:
if (vcb.YOffset <= cb.YOffset && if (vcb.YOffset <= cb.YOffset &&
vcb.YOffset >= (cb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch)) return true; vcb.YOffset >= (cb.YChangeBarBottomExtend - tolerance)) return true;
// vcb.YChangeBarBottom is within range of cb: // vcb.YChangeBarBottom is within range of cb:
if ((vcb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch) <= cb.YOffset && if ((vcb.YChangeBarBottomExtend - tolerance) <= cb.YOffset &&
vcb.YChangeBarBottomExtend >= (cb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch)) return true; vcb.YChangeBarBottomExtend >= (cb.YChangeBarBottomExtend - tolerance)) return true;
return false; return false;
} }
private PromsPrinter _MyPromsPrinter; private PromsPrinter _MyPromsPrinter;

View File

@ -84,6 +84,12 @@ namespace Volian.Print.Library
{ {
get {return YChangeBarBottom - YExtendLine; } get {return YChangeBarBottom - YExtendLine; }
} }
private bool _BottomIsTable = false;
public bool BottomIsTable
{
get { return _BottomIsTable; }
set { _BottomIsTable = value; }
}
private bool _IsRev; private bool _IsRev;
private bool _MsgAtTop; // flags that message should be drawn at top of change bar private bool _MsgAtTop; // flags that message should be drawn at top of change bar
public vlnChangeBar(PdfContentByte cb, vlnParagraph parent, float xoff, float yoff, int msgAlignment, bool isRev, bool msgAtTop) public vlnChangeBar(PdfContentByte cb, vlnParagraph parent, float xoff, float yoff, int msgAlignment, bool isRev, bool msgAtTop)