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

@ -4600,6 +4600,14 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _UsePreviousStyle, "TabData/@UsePreviousStyle"); return LazyLoad(ref _UsePreviousStyle, "TabData/@UsePreviousStyle");
} }
} }
private LazyLoad<bool> _IsTransition;
public bool IsTransition
{
get
{
return LazyLoad(ref _IsTransition, "TabData/@IsTransition");
}
}
private LazyLoad<float?> _IdentWidth; private LazyLoad<float?> _IdentWidth;
public float? IdentWidth public float? IdentWidth
{ {
@ -5135,6 +5143,22 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _BoldTransition, "@BoldTransition"); return LazyLoad(ref _BoldTransition, "@BoldTransition");
} }
} }
private LazyLoad<bool> _BoldTransitionExceptHLS;
public bool BoldTransitionExceptHLS
{
get
{
return LazyLoad(ref _BoldTransitionExceptHLS, "@BoldTransitionExceptHLS");
}
}
private LazyLoad<bool> _AdjustStepTransitionText;
public bool AdjustStepTransitionText
{
get
{
return LazyLoad(ref _AdjustStepTransitionText, "@AdjustStepTransitionText");
}
}
} }
#endregion #endregion
#region TransType #region TransType

View File

@ -225,7 +225,7 @@ namespace Volian.Controls.Library
} }
// Adjust RO display // Adjust RO display
if (ROsShouldBeAdjusted) if (ROsShouldBeAdjusted)
text = DoTransitionAdjustments(text, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransition); text = DoTransitionAdjustments(text, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransition || (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransitionExceptHLS && !_MyItemInfo.IsHigh));
// add colors around links: // add colors around links:
if (colorLinks) if (colorLinks)
text = DoColorLinks(text); text = DoColorLinks(text);

View File

@ -422,6 +422,8 @@ namespace Volian.Print.Library
} }
else else
{ {
//added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section
_MyHelper.MyGaps.Clear();
//Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText); //Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText);
if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
_MyHelper.DidFirstPageDocStyle = false; _MyHelper.DidFirstPageDocStyle = false;

View File

@ -495,6 +495,7 @@ namespace Volian.Print.Library
get { return _MyPromsPrinter; } get { return _MyPromsPrinter; }
set { _MyPromsPrinter = value; } set { _MyPromsPrinter = value; }
} }
private int _MyRomanPage = 1;
public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection,PromsPrinter myPromsPrinter,string hlsText) : base() public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection,PromsPrinter myPromsPrinter,string hlsText) : base()
{ {
HLSText = hlsText; HLSText = hlsText;
@ -564,10 +565,14 @@ namespace Volian.Print.Library
MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y));
return string.Empty; return string.Empty;
} }
if (args.MyText.Contains("{ROMANPAGE}")) //if (args.MyText.Contains("{ROMANPAGE}"))
{ //{
return args.MyText.Replace("{ROMANPAGE}", ItemInfo.RomanNumbering(1).ToLower()); // //return args.MyText.Replace("{ROMANPAGE}", ItemInfo.RomanNumbering(_MyRomanPage++).ToLower());
} // string key = "RomanPage." + MySection.ItemID;
// string txt = args.MyText;
// MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y));
// return string.Empty;
//}
if (args.MyText.Contains("{SECONDARYPAGE}") || args.MyText.Contains("{SECONDARYOF}")) if (args.MyText.Contains("{SECONDARYPAGE}") || args.MyText.Contains("{SECONDARYOF}"))
{ {
string key = "SecondaryPage." + MySection.ItemID; string key = "SecondaryPage." + MySection.ItemID;
@ -1203,6 +1208,12 @@ namespace Volian.Print.Library
private List<string> SplitText(string text, int len) private List<string> SplitText(string text, int len)
{ {
List<string> results = new List<string>(); List<string> results = new List<string>();
if (text.Contains("\\LINE ") || text.Contains("\r\n"))
{
string[] mySplit = {"\\LINE ","\r\n"};
return new List<string>(text.Split(mySplit, StringSplitOptions.None));
}
int width = 0; // width of text, non-rtf int width = 0; // width of text, non-rtf
int start = 0; // start of line (index into string 'text'), includes rtf int start = 0; // start of line (index into string 'text'), includes rtf
int lastspace = 0; // location of lastspace (index into string 'text'), includes rtf int lastspace = 0; // location of lastspace (index into string 'text'), includes rtf
@ -1251,7 +1262,7 @@ namespace Volian.Print.Library
if (width > len) if (width > len)
{ {
// what should be done if lastspace == 0 // what should be done if lastspace == 0
results.Add(nextprefix+text.Substring(start, lastspace-start)); results.Add(nextprefix+text.Substring(start, lastspace-start).Trim(" ".ToCharArray()));
nextprefix = rtfprefix; nextprefix = rtfprefix;
if (nextprefix != "") nextprefix += " "; if (nextprefix != "") nextprefix += " ";
start = lastspace + 1; start = lastspace + 1;
@ -1261,7 +1272,7 @@ namespace Volian.Print.Library
} }
} }
if (width > 0 || start < text.Length) results.Add(nextprefix + text.Substring(start)); if (width > 0 || start < text.Length) results.Add(nextprefix + text.Substring(start).Trim(" ".ToCharArray()));
return results; return results;
} }
@ -1471,6 +1482,8 @@ namespace Volian.Print.Library
return System.DateTime.Today.ToShortDateString(); return System.DateTime.Today.ToShortDateString();
case "{CHKOFFHEADING}": case "{CHKOFFHEADING}":
return PageListTopCheckOffHeader; return PageListTopCheckOffHeader;
case "{ROMANPAGE}":
return ItemInfo.RomanNumbering(CurrentPageNumber).ToLower();
} }
if (!_MissingTokens.Contains(match.Value)) if (!_MissingTokens.Contains(match.Value))
{ {

View File

@ -34,100 +34,113 @@ namespace Volian.Print.Library
vlnBox box = null; vlnBox box = null;
float yTop = yoff; float yTop = yoff;
ItemInfo lastChild = null; ItemInfo lastChild = null;
string lastHeader = null;
foreach (ItemInfo childItemInfo in itemInfoList) 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.TabData != null && childItemInfo.FormatStepData.TabData.IsTransition)
if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.MatchUpRNO)
{ {
if (childItemInfo.MyParent != null && childItemInfo.MyParent.MyParent != null && !childItemInfo.MyParent.MyParent.IsHigh) lastHeader = childItemInfo.DisplayText;
yoff += vlnPrintObject.SixLinesPerInch;
} }
// if this is a caution/note and it has a caution/note substep, do it before this caution/note, so that else
// 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 if (lastHeader != null)
{ {
box = new vlnBox(); childItemInfo.SetHeader(childItemInfo.FormatStepData.TabData.Font, lastHeader);
box.MyBox = new Box(); lastHeader = null;
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 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; if (childItemInfo.MyParent != null && childItemInfo.MyParent.MyParent != null && !childItemInfo.MyParent.MyParent.IsHigh)
box = new vlnBox(); yoff += vlnPrintObject.SixLinesPerInch;
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; }
if (box.MyBox != null) // 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; box = new vlnBox();
int ln = 1; // a format flag determines whether there is a space before the note/caution. box.MyBox = new Box();
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; box.DefBox = vlnBox.BoxThin;
if (!boxHLS || (boxHLS && !childItemInfo.HasCautionOrNote)) StepSectionLayoutData ssld = formatInfo.MyStepSectionLayoutData;
yoff += ln * vlnPrintObject.SixLinesPerInch; 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 if (bxIndex == null) // First boxed step
else // Change Box Style
{
if (bxIndx != null)
{ {
if (box != null) if (childItemInfo.IsHigh) boxHLS = true;
{
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 = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; 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 (box.MyBox != null)
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; {
if (childItemInfo.MixCautionNotesDiffType()) ln += 2; box.YOffset = yoff;
box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch); int ln = 1; // a format flag determines whether there is a space before the note/caution.
yoff += ln * vlnPrintObject.SixLinesPerInch; 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) if (box != null && box.MyBox != null)
{ {