Added IsTransition, AdjustStepTransitionText and BoldTransitionExceptHLS properties to PlantFormat class for VCSummer data

Added code to utilize BoldTransitionExceptHLS property for VCSummer data
Added code to reset MyGaps when changing sections for drawing centerline for VCSummer data
Added code to handle Transition Caution and Transiton Note when printing PDF for VCSummer data
Added code to handle proper incrementing for lower case roman numeral page numbering for VCSummer data
Added code to handle hard new lines in Procedure title for VCSummer data
This commit is contained in:
Rich
2013-07-03 03:40:09 +00:00
parent 2160e20c16
commit 2067a6f212
5 changed files with 137 additions and 85 deletions

View File

@@ -34,100 +34,113 @@ namespace Volian.Print.Library
vlnBox box = null;
float yTop = yoff;
ItemInfo lastChild = null;
string lastHeader = null;
foreach (ItemInfo childItemInfo in itemInfoList)
{
// if the format has MatchUpRNOCautNote, then add a line to yoff, if not at top of rno column.
if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.MatchUpRNO)
if (childItemInfo.FormatStepData.TabData != null && childItemInfo.FormatStepData.TabData.IsTransition)
{
if (childItemInfo.MyParent != null && childItemInfo.MyParent.MyParent != null && !childItemInfo.MyParent.MyParent.IsHigh)
yoff += vlnPrintObject.SixLinesPerInch;
lastHeader = childItemInfo.DisplayText;
}
// if this is a caution/note and it has a caution/note substep, do it before this caution/note, so that
// it comes above it.
if (childItemInfo.Cautions != null && (childItemInfo.IsCaution || childItemInfo.IsNote))
yoff = Add(cb, childItemInfo.Cautions, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo);
if (childItemInfo.Notes != null && (childItemInfo.IsCaution || childItemInfo.IsNote))
yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo);
int? bxIndx = childItemInfo.FormatStepData==null?-1:childItemInfo.FormatStepData.StepLayoutData.STBoxindex;
bool boxHLS = false;
if ((bxIndx ?? -1) != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt || childItemInfo.MyHeader != null))
else
{
if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS
if (lastHeader != null)
{
box = new vlnBox();
box.MyBox = new Box();
box.DefBox = vlnBox.BoxThin;
StepSectionLayoutData ssld = formatInfo.MyStepSectionLayoutData;
int colR = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[childItemInfo.ColumnMode]);
int widS = vlnPrintObject.ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO);
box.DefEnd = (float)(ssld.ColS + colR + widS + (60/4.8));
box.YOffset = yoff - .75F * vlnPrintObject.SixLinesPerInch;
childItemInfo.SetHeader(childItemInfo.FormatStepData.TabData.Font, lastHeader);
lastHeader = null;
}
else if (bxIndex == null) // First boxed step
// if the format has MatchUpRNOCautNote, then add a line to yoff, if not at top of rno column.
if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.MatchUpRNO)
{
if (childItemInfo.IsHigh) boxHLS = true;
box = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
if (box.MyBox != null)
if (childItemInfo.MyParent != null && childItemInfo.MyParent.MyParent != null && !childItemInfo.MyParent.MyParent.IsHigh)
yoff += vlnPrintObject.SixLinesPerInch;
}
// if this is a caution/note and it has a caution/note substep, do it before this caution/note, so that
// it comes above it.
if (childItemInfo.Cautions != null && (childItemInfo.IsCaution || childItemInfo.IsNote))
yoff = Add(cb, childItemInfo.Cautions, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo);
if (childItemInfo.Notes != null && (childItemInfo.IsCaution || childItemInfo.IsNote))
yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo);
int? bxIndx = childItemInfo.FormatStepData == null ? -1 : childItemInfo.FormatStepData.StepLayoutData.STBoxindex;
bool boxHLS = false;
if ((bxIndx ?? -1) != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt || childItemInfo.MyHeader != null))
{
if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS
{
box.YOffset = yoff;
int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
if (!boxHLS || (boxHLS && !childItemInfo.HasCautionOrNote))
yoff += ln * vlnPrintObject.SixLinesPerInch;
box = new vlnBox();
box.MyBox = new Box();
box.DefBox = vlnBox.BoxThin;
StepSectionLayoutData ssld = formatInfo.MyStepSectionLayoutData;
int colR = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[childItemInfo.ColumnMode]);
int widS = vlnPrintObject.ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO);
box.DefEnd = (float)(ssld.ColS + colR + widS + (60 / 4.8));
box.YOffset = yoff - .75F * vlnPrintObject.SixLinesPerInch;
}
}
else // Change Box Style
{
if (bxIndx != null)
else if (bxIndex == null) // First boxed step
{
if (box != null)
{
box.Height = yoff - box.YOffset; // new height, with children
if (childItemInfo.MyHeader != null && childItemInfo.MyPrevious != null
&& ((childItemInfo.MyPrevious.IsCaution && childItemInfo.IsCaution) ||
(childItemInfo.MyPrevious.IsNote && childItemInfo.IsNote)))
yoff += vlnPrintObject.SixLinesPerInch * 2;
}
if (childItemInfo.IsHigh) boxHLS = true;
box = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
if (childItemInfo.MixCautionNotesDiffType()) ln += 2;
box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch);
yoff += ln * vlnPrintObject.SixLinesPerInch;
if (box.MyBox != null)
{
box.YOffset = yoff;
int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
if (!boxHLS || (boxHLS && !childItemInfo.HasCautionOrNote))
yoff += ln * vlnPrintObject.SixLinesPerInch;
}
}
else // Change Box Style
{
if (bxIndx != null)
{
if (box != null)
{
box.Height = yoff - box.YOffset; // new height, with children
if (childItemInfo.MyHeader != null && childItemInfo.MyPrevious != null
&& ((childItemInfo.MyPrevious.IsCaution && childItemInfo.IsCaution) ||
(childItemInfo.MyPrevious.IsNote && childItemInfo.IsNote)))
yoff += vlnPrintObject.SixLinesPerInch * 2;
}
box = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
if (childItemInfo.MixCautionNotesDiffType()) ln += 2;
box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch);
yoff += ln * vlnPrintObject.SixLinesPerInch;
}
}
bxIndex = bxIndx;
}
bxIndex = bxIndx;
if (childItemInfo is SectionInfo) formatInfo = (childItemInfo as SectionInfo).LocalFormat ?? formatInfo;
if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight);
vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null);
if (box != null && box.MyParent == null)
{
box.MyParent = para;
para.PartsContainer.Add(box);
}
Add(para);
// para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box.
if (childItemInfo.IsStep && childItemInfo.MyHLS.FormatStepData.UseSmartTemplate && para.ChildrenBelow.Count > 0 && para.ChildrenBelow[0].YBottomMost > para.YBottomMost)
yoff = para.ChildrenBelow[0].YBottomMost;
else
yoff = para.YBottomMost;
if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt)
{
box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch);
box = null; // if doing boxed steps, only do single sibling at a time.
}
if (boxHLS)
{
box.YOffset = para.YTop - (2 * vlnPrintObject.SixLinesPerInch);
box.Height = para.YBottomMost - box.YOffset; // para.YTop - (1.1F * vlnPrintObject.SixLinesPerInch);
box = null;
}
boxHLS = false;
lastChild = childItemInfo;
}
if (childItemInfo is SectionInfo) formatInfo = (childItemInfo as SectionInfo).LocalFormat ?? formatInfo;
if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight);
vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null);
if (box != null && box.MyParent == null)
{
box.MyParent = para;
para.PartsContainer.Add(box);
}
Add(para);
// para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box.
if (childItemInfo.IsStep && childItemInfo.MyHLS.FormatStepData.UseSmartTemplate && para.ChildrenBelow.Count>0 && para.ChildrenBelow[0].YBottomMost > para.YBottomMost)
yoff = para.ChildrenBelow[0].YBottomMost;
else
yoff = para.YBottomMost;
if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt)
{
box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch);
box = null; // if doing boxed steps, only do single sibling at a time.
}
if (boxHLS)
{
box.YOffset = para.YTop - (2 * vlnPrintObject.SixLinesPerInch);
box.Height = para.YBottomMost - box.YOffset; // para.YTop - (1.1F * vlnPrintObject.SixLinesPerInch);
box = null;
}
boxHLS = false;
lastChild = childItemInfo;
}
if (box != null && box.MyBox != null)
{