Limit Calvert Alarm logic for Condition/Response to only be run for SpecialCaseCalvertAlarm format flag.

Added debug logic for TextAt counter.
This commit is contained in:
Rich 2014-08-18 18:38:39 +00:00
parent 35bed5b381
commit dec6a46080
2 changed files with 18 additions and 10 deletions

View File

@ -461,16 +461,19 @@ namespace Volian.Print.Library
, MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath); , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath);
break; break;
} }
// if first condition/response and the parent has caution, notes or warnings then move the break to the caution, note or warning if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) // only do the following for Calvert Alarms
if (paraBreak.ParentHasCalvertMacro && paraBreak.MyParent.HasCalvertMacro && paraBreak.MyItemInfo.MyPrevious == null && paraBreak.MyParent.ChildrenAbove.Count > 0)
{ {
paraBreak = paraBreak.MyParent.ChildrenAbove[0]; // if first condition/response and the parent has caution, notes or warnings then move the break to the caution, note or warning
} if (paraBreak.ParentHasCalvertMacro && paraBreak.MyParent.HasCalvertMacro && paraBreak.MyItemInfo.MyPrevious == null && paraBreak.MyParent.ChildrenAbove.Count > 0)
// If the lastbreak was part of a condition response and the location is part of a condition response account for the size of the footer. {
if (lastBreak != null && lastBreak.ParentHasCalvertMacro && paraBreak.ParentHasCalvertMacro) paraBreak = paraBreak.MyParent.ChildrenAbove[0];
{ }
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage - 12 * 4, yLowerLimit, myList, paraBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace, // If the lastbreak was part of a condition response and the location is part of a condition response account for the size of the footer.
myBottomMsgSpace,MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly); if (lastBreak != null && lastBreak.ParentHasCalvertMacro && paraBreak.ParentHasCalvertMacro)
{
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage - 12 * 4, yLowerLimit, myList, paraBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace,
myBottomMsgSpace, MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly);
}
} }
if (lastBreak == paraBreak) if (lastBreak == paraBreak)
{ {

View File

@ -81,7 +81,12 @@ namespace Volian.Print.Library
} }
private static int NextTextAtCounter private static int NextTextAtCounter
{ {
get { return ++TextAtCounter; } get
{
int retval = ++TextAtCounter;
//if (InList(retval, 461)) Console.WriteLine("TextAt {0}", retval);
return retval;
}
} }
public static float TextAt(PdfContentByte cb, Paragraph iParagraph, float x, float y, float width, float height, string debugText, float yBottomMargin) public static float TextAt(PdfContentByte cb, Paragraph iParagraph, float x, float y, float width, float height, string debugText, float yBottomMargin)
{ {