This commit is contained in:
Kathy Ruffing 2013-05-01 13:41:55 +00:00
parent e25ba6d26e
commit 35cf39ea1a
4 changed files with 86 additions and 24 deletions

View File

@ -2807,9 +2807,11 @@ namespace VEPROMS.CSLA.Library
_MyHeader.Justify = ContentAlignment.MiddleCenter; _MyHeader.Justify = ContentAlignment.MiddleCenter;
_MyHeader.Text = (!FormatStepData.TabData.NoTrim)?tbformat.Replace("\\xA0"," ").Trim():tbformat.Replace("\\xA0"," "); _MyHeader.Text = (!FormatStepData.TabData.NoTrim)?tbformat.Replace("\\xA0"," ").Trim():tbformat.Replace("\\xA0"," ");
_MyHeader.CleanText = StripRtfFormatting(_MyHeader.Text); _MyHeader.CleanText = StripRtfFormatting(_MyHeader.Text);
// if there is only step in the group - no bullet is used, if more that one replace the tab // if there is only step in the group or we have a change in step type (caution/note) when there is
// use of the MixCautionsAndNotes format flag - no bullet is used, if more that one replace the tab
// with a bullet. Also, if only one in group and tab text ends with 'S', remove it: // with a bullet. Also, if only one in group and tab text ends with 'S', remove it:
if (MyPrevious == null && NextItem == null) bool mixCandN = MixCautionNotesDiffType();
if ((MyPrevious == null && NextItem == null) || mixCandN)
{ {
if (_MyHeader.CleanText.ToUpper().EndsWith("S")) if (_MyHeader.CleanText.ToUpper().EndsWith("S"))
{ {
@ -2872,6 +2874,14 @@ namespace VEPROMS.CSLA.Library
return tbformat; return tbformat;
} }
public bool MixCautionNotesDiffType()
{
if (!FormatStepData.MixCautionsAndNotes) return false;
if (IsNote && ((NextItem != null && NextItem.IsCaution) || (MyPrevious != null && MyPrevious.IsCaution))) return true;
if (IsCaution && ((NextItem != null && NextItem.IsNote) || (MyPrevious != null && MyPrevious.IsNote))) return true;
return false;
}
private bool TabToIdentBAdjustFont() private bool TabToIdentBAdjustFont()
{ {
if ((FormatStepData.TabData.Font.Style & E_Style.Underline) > 0) if ((FormatStepData.TabData.Font.Style & E_Style.Underline) > 0)

View File

@ -316,20 +316,29 @@ namespace Volian.Print.Library
} }
return PrintProcedureOrFoldout(myProcedure, null, outputFileName); return PrintProcedureOrFoldout(myProcedure, null, outputFileName);
} }
// Find the last section that has a Final Message defined in its format
// Return that section's itemID or a -1 if the Final Message is not defined // See if the last non Foldout Section has a Final Message.
private int GetFinalMessageSectionID(ProcedureInfo myProcedure, bool doingFoldout) private int GetFinalMessageSectionID(ProcedureInfo myProcedure, bool doingFoldout)
{ {
int sectionID = -1;
if (!doingFoldout) if (!doingFoldout)
{ {
foreach (SectionInfo mySection in myProcedure.Sections) // Work backwards because we don't want to include any foldouts. Find the last section that is not
// a foldout. If it has a final message, this is the 'last section' and should have a final message.
// If it doesn't have a final message, then none should be printed.
int cntSect = myProcedure.Sections.Count;
for (int i = cntSect - 1; i >= 0; i--)
{ {
if (mySection.MyDocStyle.Final.Message != null && mySection.MyDocStyle.Final.Message.Length > 0) SectionInfo mySection = myProcedure.Sections[i] as SectionInfo;
sectionID = mySection.ItemID; if (!mySection.DisplayText.ToUpper().Contains("FOLDOUT"))
{
if (mySection.MyDocStyle.Final != null && mySection.MyDocStyle.Final.Message != null && mySection.MyDocStyle.Final.Message.Length > 0)
return mySection.ItemID;
else
return -1;
}
} }
} }
return sectionID; return -1;
} }
private bool _AllowAllWatermarks = false; private bool _AllowAllWatermarks = false;
public bool AllowAllWatermarks public bool AllowAllWatermarks

View File

@ -33,8 +33,15 @@ namespace Volian.Print.Library
int? bxIndex = null; int? bxIndex = null;
vlnBox box = null; vlnBox box = null;
float yTop = yoff; float yTop = yoff;
ItemInfo lastChild = 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.MatchUpRNO)
{
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 // 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. // it comes above it.
if (childItemInfo.Cautions != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) if (childItemInfo.Cautions != null && (childItemInfo.IsCaution || childItemInfo.IsNote))
@ -72,9 +79,10 @@ namespace Volian.Print.Library
if (box != null) box.Height = yoff - box.YOffset; // new height, with children if (box != null) box.Height = yoff - box.YOffset; // new height, with children
box = new vlnBox(); box = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
box.YOffset = yoff;
int ln = 1; // a format flag determines whether there is a space before the note/caution. int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
if (childItemInfo.MixCautionNotesDiffType()) ln += 2;
box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch);
yoff += ln * vlnPrintObject.SixLinesPerInch; yoff += ln * vlnPrintObject.SixLinesPerInch;
} }
bxIndex = bxIndx; bxIndex = bxIndx;
@ -99,11 +107,17 @@ namespace Volian.Print.Library
box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch); box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch);
box = null; // if doing boxed steps, only do single sibling at a time. box = null; // if doing boxed steps, only do single sibling at a time.
} }
lastChild = childItemInfo;
} }
if (box != null && box.MyBox != null) if (box != null && box.MyBox != null)
{ {
box.Height = yoff - box.YOffset; // new height, with children box.Height = yoff - box.YOffset; // new height, with children
yoff += 2 * vlnPrintObject.SixLinesPerInch; yoff += 2 * vlnPrintObject.SixLinesPerInch;
if (lastChild != null && lastChild.FormatStepData.AlwaysUseExtraLines && (lastChild.IsCaution || lastChild.IsNote))
{
if (!lastChild.MyParent.IsHigh)
yoff += lastChild.ActiveFormat.PlantFormat.FormatData.StepDataList[2].StepLayoutData.STExtraSpace ?? 0;
}
} }
return yoff; return yoff;
} }
@ -144,7 +158,11 @@ namespace Volian.Print.Library
if (_PartsAbove != null && _PartsAbove.Count > 0) yPageStart = PartsAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); if (_PartsAbove != null && _PartsAbove.Count > 0) yPageStart = PartsAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
if (MyItemInfo.IsHigh && MyItemInfo.MyDocStyle.SpecialStepsFoldout) yPageStart -= SixLinesPerInch; if (MyItemInfo.IsHigh && MyItemInfo.MyDocStyle.SpecialStepsFoldout) yPageStart -= SixLinesPerInch;
if (MyItemInfo.IsHigh && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.DoSTExtraAtTop && (yPageStart - YTopMost == yTopMargin)) if (MyItemInfo.IsHigh && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.DoSTExtraAtTop && (yPageStart - YTopMost == yTopMargin))
{
yPageStart += ((MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0); yPageStart += ((MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0);
if ((MyItemInfo.Cautions != null && MyItemInfo.Cautions[0].FormatStepData.AlwaysUseExtraLines) || (MyItemInfo.Notes != null && MyItemInfo.Notes[0].FormatStepData.AlwaysUseExtraLines))
yPageStart -= ((MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0);
}
float yLocation = CalculateYOffset(yPageStart, yTopMargin); float yLocation = CalculateYOffset(yPageStart, yTopMargin);
if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess); if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess);
float retval = yLocation; float retval = yLocation;
@ -1061,6 +1079,12 @@ namespace Volian.Print.Library
// Added check for UseSTExtraRealValue, if set, we want to use what is set for the specific step type // Added check for UseSTExtraRealValue, if set, we want to use what is set for the specific step type
if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.UseSTExtraRealValue && MyItemInfo.IsHigh) if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.UseSTExtraRealValue && MyItemInfo.IsHigh)
addExtraSpace = MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[2].StepLayoutData.STExtraSpace ?? 0; addExtraSpace = MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[2].StepLayoutData.STExtraSpace ?? 0;
// if this plant has the AlwaysUseExtraLines and there are notes/cautions above the hls, don't add in the
// extra space:
if (itemInfo.IsHigh && (itemInfo.Cautions != null || itemInfo.Notes != null))
{
if ((itemInfo.Cautions != null && itemInfo.Cautions[0].FormatStepData.AlwaysUseExtraLines) || (itemInfo.Notes != null && itemInfo.Notes[0].FormatStepData.AlwaysUseExtraLines)) addExtraSpace = 0;
}
if (addExtraSpace > 0) this.PartsAbove.Add(new vlnText(cb, this, " ", " ", 0, yoff, MyItemInfo.FormatStepData.Font)); if (addExtraSpace > 0) this.PartsAbove.Add(new vlnText(cb, this, " ", " ", 0, yoff, MyItemInfo.FormatStepData.Font));
yoff += addExtraSpace; yoff += addExtraSpace;
@ -1075,8 +1099,11 @@ namespace Volian.Print.Library
} }
if (itemInfo.MyTab.AsteriskOffset != 0) if (itemInfo.MyTab.AsteriskOffset != 0)
{ {
// the '-24' was used for the SHE format to get the continuous HLS's asterisk to match 16bit.
vlnText myAsterisk = new vlnText(cb, this, "*", "*", mytab.XOffset - 24, YOffset, MyItemInfo.FormatStepData.TabData.Font); // the '-24' in x-direction & '+4' in y-direction was used for the SHE format to get the continuous
// HLS's asterisk to match 16bit. The font size was set at 16 to make it match also:
VE_Font astFont = new VE_Font(MyItemInfo.FormatStepData.TabData.Font.Family, 16, E_Style.Bold, 10);
vlnText myAsterisk = new vlnText(cb, this, "*", "*", mytab.XOffset - 24, YOffset+4, astFont);
PartsLeft.Add(myAsterisk); PartsLeft.Add(myAsterisk);
} }
if (itemInfo.IsRNOPart) if (itemInfo.IsRNOPart)
@ -1492,9 +1519,10 @@ namespace Volian.Print.Library
vlnParagraph hls1 = MyParent; vlnParagraph hls1 = MyParent;
while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent; while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent;
float colR = float.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]); float colR = float.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]);
float xLowerLimit = hls1.PartsLeft != null && hls1.PartsLeft.Count > 0 ? hls1.PartsLeft[0].XOffset : hls1.XOffset; float xLowerLimit = (aerTableOrFigure && hls1.PartsLeft != null && hls1.PartsLeft.Count > 0) ? hls1.PartsLeft[0].XOffset : hls1.XOffset;
float xUpperLimit = 0; float xUpperLimit = 0;
float pageWidth = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.PageWidth); float pageWidth = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.PageWidth);
float leftMargin = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.LeftMargin); //* (float)MyItemInfo.FormatStepData.Font.CPI / 12;
if (itemInfo.IsInRNO) if (itemInfo.IsInRNO)
// if in rno column, the upper limit is width of the page (right margin). Subtract off size of a character // if in rno column, the upper limit is width of the page (right margin). Subtract off size of a character
@ -1504,16 +1532,9 @@ namespace Volian.Print.Library
float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[itemInfo.ColumnMode]); float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[itemInfo.ColumnMode]);
if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel)
{
float leftMargin = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.LeftMargin); //* (float)MyItemInfo.FormatStepData.Font.CPI / 12;
XOffset = leftMargin + (pageWidth - leftMargin - Width) / 2; XOffset = leftMargin + (pageWidth - leftMargin - Width) / 2;
}
else else
{ {
// Determine center of hls
XOffset = hls1.XOffset + hls1.Width / 2;
// Determine left edge of the table by subtracting 1/2 of its width.
XOffset -= Width / 2;
if (aerTableOrFigure || itemInfo.RNOLevel != 0) // AER or RNO if (aerTableOrFigure || itemInfo.RNOLevel != 0) // AER or RNO
XOffset = MyParent.XOffset + MyParent.Width / 2 - Width / 2; XOffset = MyParent.XOffset + MyParent.Width / 2 - Width / 2;
else if (TableCenterPos != 0) else if (TableCenterPos != 0)
@ -1523,8 +1544,13 @@ namespace Volian.Print.Library
} }
else // Centered Table or Figure else // Centered Table or Figure
{ {
// Determine center of hls
XOffset = hls1.XOffset + hls1.Width / 2;
// Determine left edge of the table by subtracting 1/2 of its width.
XOffset -= Width / 2;
// Add in 1/2 of the width of all RNO columns // Add in 1/2 of the width of all RNO columns
XOffset += (colR * itemInfo.ColumnMode) / 2; XOffset += (colR * itemInfo.ColumnMode) / 2;
if (!aerTableOrFigure) if (!aerTableOrFigure)
{ {
// 05/14/12 - 16bit code adjusts the center depending upon the CPI of the table font. // 05/14/12 - 16bit code adjusts the center depending upon the CPI of the table font.
@ -1541,7 +1567,6 @@ namespace Volian.Print.Library
XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0);
} }
// if the XOffset < High Level Step Text's XOffset, then align with the High Level Step Text // if the XOffset < High Level Step Text's XOffset, then align with the High Level Step Text
if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit)) if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit))
XOffset = xLowerLimit; XOffset = xLowerLimit;

View File

@ -859,10 +859,15 @@ namespace fmtxml
fmtdata.StepData[2].TabData.RNOIdent = " ."; fmtdata.StepData[2].TabData.RNOIdent = " .";
fmtdata.StepData[7].TabData.Ident = @" \ul NOTE\ulnone"; fmtdata.StepData[7].TabData.Ident = @" \ul NOTE\ulnone";
fmtdata.StepData[26].TabData.Ident = @" \ul NOTE\ulnone"; fmtdata.StepData[26].TabData.Ident = @" \ul NOTE\ulnone";
fmtdata.StepData[6].MatchUpRNO = "False";
fmtdata.StepData[6].MixCautionsAndNotes = "True";
fmtdata.StepData[7].MatchUpRNO = "False";
fmtdata.StepData[7].MixCautionsAndNotes = "True";
fmtdata.StepData[7].TabData.NoTrim = "True"; // need this field in stepdata/tabdata. fmtdata.StepData[7].TabData.NoTrim = "True"; // need this field in stepdata/tabdata.
fmtdata.StepData[9].TabData.Ident = "{asterisk} {numeric}."; fmtdata.StepData[9].TabData.Ident = "{asterisk} {numeric}.";
fmtdata.StepData[18].TabData.Ident = null; fmtdata.StepData[18].TabData.Ident = null;
fmtdata.StepData[18].TabData.RNOIdent = null; fmtdata.StepData[18].TabData.RNOIdent = null;
fmtdata.StepData[23].MatchUpRNO = "True";
fmtdata.BoxData[2].TxtWidth = 432; fmtdata.BoxData[2].TxtWidth = 432;
} }
private void AddSHESSDfmt(ref FormatData fmtdata) private void AddSHESSDfmt(ref FormatData fmtdata)
@ -926,9 +931,22 @@ namespace fmtxml
pgstyles.PgStyles[2].Items[7].Col = 315; pgstyles.PgStyles[2].Items[7].Col = 315;
pgstyles.PgStyles[2].Items[8].Col = 315; pgstyles.PgStyles[2].Items[8].Col = 315;
pgstyles.PgStyles[2].Items[9].Col = 315; pgstyles.PgStyles[2].Items[9].Col = 315;
pgstyles.PgStyles[3].Items[1].Col = 447; // Adjust columns on some PSI for cover page. pgstyles.PgStyles[3].Items[4].Col = 477; // Adjust columns on some PSI for cover page.
pgstyles.PgStyles[3].Items[2].Col = 447; pgstyles.PgStyles[3].Items[5].Col = 477;
pgstyles.PgStyles[3].Items[3].Col = 447; pgstyles.PgStyles[3].Items[6].Col = 477;
pgstyles.PgStyles[3].Items[7].Col = 477;
pgstyles.PgStyles[3].Items[8].Col = 477;
pgstyles.PgStyles[3].Items[9].Col = 477;
pgstyles.PgStyles[3].Items[10].Col = 477;
pgstyles.PgStyles[3].Items[11].Col = 477;
pgstyles.PgStyles[3].Items[12].Col = 477;
pgstyles.PgStyles[3].Items[23].Col = 296;
pgstyles.PgStyles[3].Items[23].Style.CPI = "10";
pgstyles.PgStyles[3].Items[24].Row = 426;
pgstyles.PgStyles[3].Items[24].Col = 270;
pgstyles.PgStyles[3].Items[24].Justify = "PSCenter";
pgstyles.PgStyles[3].Items[24].Style.CPI = "10";
} }
// NSP_ALL // NSP_ALL
private void AddNSPPage(ref PageStyles pgstyles) private void AddNSPPage(ref PageStyles pgstyles)