NSPIFG support

NSPIFG2 missing genmac
NSP IFG improvements
This commit is contained in:
2013-07-17 13:09:04 +00:00
parent 60fc6bbd18
commit 15efb46dd3
7 changed files with 61 additions and 18 deletions

View File

@@ -42,6 +42,17 @@ namespace Volian.Print.Library
// procedure in questions was VEWCNEMG\EMGAPP.PRC, ES-01, Step 8.
bool ManualPageBreak = false;
float yEndMsg = !MyItemInfo.IsSection && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
// The following code is to fix a pagination issue in SHE. It was decided to not put it into development
// because some of the pagination logic may be redesigned. Without this fix, some pages had a page break
// before they should. I did not want to lose this code, in case at some point we want to revisit this.
// if doing an end message & we already are ending with a blank line, add one line for the end message
// otherwise, we need to add two lines, i.e. ((2 * SixLinesPerInch) - yEndsWithBlankLine)
// this change was necessary to fix a pagination problem in Shearon Harris, EOPs, User Guide, Attachment 2.
//float yEndsWithBlankLine = AdjustForBlankLines();
//KBR debug: if (yEndsWithBlankLine != 0) Console.WriteLine("*** yEndsWithBlankLine = {0}", yEndsWithBlankLine);
//float yEndMsg = !MyItemInfo.IsSection && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? ((2 * SixLinesPerInch) - yEndsWithBlankLine) : 0;
float yWithinMargins = CalculateYLocation(yLocation, yTopMargin) - yBottomMargin; // -SixLinesPerInch;
bool isFirstChild = MyItemInfo.MyPrevious == null;
bool nearTheTop = (yWithinMargins < yPageSize) && (yWithinMargins > (yPageSize - 5 * SixLinesPerInch));
@@ -64,7 +75,7 @@ namespace Volian.Print.Library
// Steps that have the smart template (the WCNCKL format for example), always include two children.
if (MyItemInfo.IsHigh && MyItemInfo.FormatStepData.UseSmartTemplate && ChildrenBelow.Count > 1)
firstChild = ChildrenBelow[1];
if (firstChild != null && !firstChild.MyItemInfo.IsNumbered) // If not numbered get the last child
if (firstChild != null && firstChild.MyItemInfo != null && !firstChild.MyItemInfo.IsNumbered) // If not numbered get the last child
firstChild = firstChild.MyParent.ChildrenBelow[firstChild.MyParent.ChildrenBelow.Count - 1];
float ySizeIncludingFirst = firstChild == null ? YSize : firstChild.YSize + (firstChild.YTopMost - YTopMost);
bool KeepStepsOnPage = MyItemInfo.ActiveFormat.MyStepSectionLayoutData.KeepStepsOnPage;
@@ -127,7 +138,7 @@ namespace Volian.Print.Library
return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page
}
if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level
MyPageHelper.HLSText = MyItemInfo.DisplayText; // save the High Level Step Text
//MyPageHelper.HLSText = MyItemInfo.DisplayText; // save the High Level Step Text
//Console.WriteLine("{0} Paginate", MyPageHelper.HLSText);
StepConfig sc1 = MyItemInfo.MyConfig as StepConfig;
ManualPageBreak = MyPageHelper.OriginalPageBreak ? (sc1 == null ? false : sc1.Step_ManualPagebreak) :

View File

@@ -369,6 +369,7 @@ namespace Volian.Print.Library
OnStatusChanged(myProcedure.DisplayNumber, PromsPrinterStatusType.ProgressSetup, myProcedure.Sections.Count);
int progress = 0;
int finalMessageSectionID = GetFinalMessageSectionID(myProcedure, doingFoldout);
string LastFmtName = null;
foreach (SectionInfo mySection in myProcedure.Sections)
{
if (((mySection.MyContent.Number.ToUpper() == "FOLDOUT" && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts)
@@ -381,10 +382,15 @@ namespace Volian.Print.Library
// Set up Helper for the particular Section
if (_MyHelper == null)
{
LastFmtName = mySection.ActiveFormat.Name;
string hlsText = "";
int hlsItemId = 0;
if (mySection.IsStepSection && mySection.Steps.Count > 0)
{
hlsItemId = mySection.Steps[0].ItemID;
hlsText = mySection.Steps[0].DisplayText; // save the High level step text for use in the page list
cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText);
}
cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText, hlsItemId);
_MyHelper.AllowAllWatermarks = AllowAllWatermarks;
_MyHelper.MyPdfWriter = cb.PdfWriter;
_MyHelper.CreatingFoldoutPage = doingFoldout;
@@ -425,7 +431,9 @@ namespace Volian.Print.Library
//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);
if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
// if pagination is separate or we've changed the format, we have not done the first page
// (if this format has the useonfirst page docstyle flag)
if (LastFmtName != mySection.ActiveFormat.Name || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate)
_MyHelper.DidFirstPageDocStyle = false;
if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null);
_MyHelper.MySection = mySection;

View File

@@ -507,9 +507,11 @@ namespace Volian.Print.Library
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, int hlsItemId)
: base()
{
HLSText = hlsText;
HasHLSTextId = hlsItemId;
MySection = mySection;
MyPromsPrinter = myPromsPrinter;
}
@@ -531,7 +533,7 @@ namespace Volian.Print.Library
//}
VEPROMS.CSLA.Library.FormatInfo activeFormat = mySection.ActiveFormat;
VEPROMS.CSLA.Library.DocStyle docStyle = mySection.MyDocStyle;
Volian.Svg.Library.Svg mySvg = null;
Volian.Svg.Library.Svg mySvg = null;
mySvg = SvgSerializer<Volian.Svg.Library.Svg>.StringDeserialize(BuildMyText(activeFormat));
mySvg.ViewBox.Height = 1100;
mySvg.ViewBox.Width = 850;
@@ -753,6 +755,8 @@ namespace Volian.Print.Library
//float rowAdj = 0; // = 18;
foreach (VEPROMS.CSLA.Library.PageItem pageItem in pageStyle.PageItems)
{
if (pageItem.Token == null) continue; // can be null if token is dependent on PSI lookup!
DidHLSText = false; // reset to false for this group of tokens.
//if (pageItem.Token.Contains("HLSTEXT"))
// Console.WriteLine("{0} - PageList Token", pageItem.Token);
@@ -866,11 +870,17 @@ namespace Volian.Print.Library
}
return deflt;
}
private bool _HasHLSText = false;
public bool HasHLSText
private bool _DidHLSText = false;
public bool DidHLSText
{
get { return _HasHLSText; }
set { _HasHLSText = value; }
get { return _DidHLSText; }
set { _DidHLSText = value; }
}
private int _HasHLSTextId = 0;
public int HasHLSTextId
{
get { return _HasHLSTextId; }
set { _HasHLSTextId = value; }
}
private string _HLSText = "";
public string HLSText
@@ -1049,9 +1059,8 @@ namespace Volian.Print.Library
PageListCheckOffHeader = PageItemToSvgText(pageItem, pageItem.Token, vf, section);
break;
case "{HLSTEXT}":
HasHLSText = true;
DidHLSText = true;
plstr = plstr.Replace(token, HLSText);
Console.WriteLine("'{0}' pagelist", plstr);
break;
default:
if (token.Contains(@"RO-"))

View File

@@ -206,9 +206,9 @@ namespace Volian.Print.Library
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);
float retval = yLocation;
bool doprint = true;
if (MyItemInfo.ItemID == 25045)
Console.WriteLine("jcb");
// 'doprint' will always be true if not doing NSP's {HLSTEXT} token in page list. The following code is used to prevent
// printing the High level step, if the high level step is printed from the pagelist using {HLSTEXT} token.
bool doprint = !(MyPageHelper.DidHLSText && MyItemInfo.ItemID == MyPageHelper.HasHLSTextId);
if (MyItemInfo.IsFigure)
{
yLocation -= (SixLinesPerInch * MyPageHelper.YMultiplier);
@@ -674,7 +674,7 @@ namespace Volian.Print.Library
case 1: // Break on High Level Step
OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
cb.PdfDocument.NewPage();
if(MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null) //do not reset for 1st step
if(MyItemInfo.IsSection || (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null)) //do not reset for 1st step
ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
DebugText.WriteLine("Paginate1");
if (MyItemInfo.IsSection)