F2022-024 – added logic to generate a Time Critical Action Summary report

F2022-024 – logic to replace {!Clock} with the defined genmac macro when step tab is printed from the pagelist (Enhanced Backgrounds)
This commit is contained in:
2022-08-11 18:27:03 +00:00
parent bfeed42a59
commit 67a19a4358
4 changed files with 92 additions and 16 deletions

View File

@@ -361,7 +361,7 @@ namespace Volian.Print.Library
// B2019-152: MergedLandscapePages is a dictionary whose key is the pdf file name & values are all of the page numbers
// in that pdf that should have landscaped page numbers. These are added when the page is finished (onEndPage)
public static Dictionary<string, List<int>> MergedLandscapePages = null;
public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary)
public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalActionSummary)
{
if (_MyItem is ProcedureInfo)
{
@@ -386,10 +386,10 @@ namespace Volian.Print.Library
SectionInfo.ResetLookupStepSectPageBreaks(); // B2017-192: Reset lists for tracking page breaks
SectionInfo.ResetLookupStepSectPageBreaksForSupInfo();
SupInfoPrintType = E_SupInfoPrintType.DoPageBreaks;
string retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false, false);
string retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false, false, false);
if (retstr == null) return null;
SupInfoPrintType = E_SupInfoPrintType.Merge;
string tmps = Print(_MyItem as ProcedureInfo, pdfFolder, false, false);
string tmps = Print(_MyItem as ProcedureInfo, pdfFolder, false, false, false);
if (!BatchPrint && ForcedPaginations != null && ForcedPaginations.Count > 0) // B2020-159: Forced Pagination Reporting
{
ReportForcedPaginations();
@@ -399,7 +399,7 @@ namespace Volian.Print.Library
}
else // B2017-186 Neither Facing Pages or Page Number Transitions
{
string tmpss = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary);
string tmpss = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary, makeTimeCriticalActionSummary);
if (!BatchPrint && ForcedPaginations != null && ForcedPaginations.Count > 0) // B2020-159: Forced Pagination Reporting
{
ReportForcedPaginations();
@@ -424,17 +424,17 @@ namespace Volian.Print.Library
// Second pass prints the supplemental information pdfs using the list generated in the first pass to know where to do the
// supplemental information page breaks & then merges in those pages when printing the step sections.
SupInfoPrintType = E_SupInfoPrintType.DoPageBreaks;
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false, false);
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false, false, false);
if (retstr == null) return null;
SupInfoPrintType = E_SupInfoPrintType.Merge;
}
retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\PageNumberPass1", false, false);
retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\PageNumberPass1", false, false, false);
if (retstr == null) return null;
BeforePageNumberPdf = retstr;
BeforePageNumber2Pdf = null; // C2017-018 Initialize Pass 2 PDF Name
ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo);
_MyReaderHelper = new ReaderHelper(this);
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary);
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary, makeTimeCriticalActionSummary);
if (! BatchPrint && ForcedPaginations != null && ForcedPaginations.Count > 0) // B2020-159: Forced Pagination Reporting
{
ReportForcedPaginations();
@@ -463,7 +463,7 @@ namespace Volian.Print.Library
RefreshPageNumber(_MyItem);
ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo);
_MyReaderHelper = new ReaderHelper(this);
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary);
retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary, makeTimeCriticalActionSummary);
}
}
return retstr;
@@ -570,7 +570,7 @@ namespace Volian.Print.Library
}
public void NewPage()
{
string path = Volian.Base.Library.vlnStackTrace.StackToStringLocal(2, 1);
//string path = Volian.Base.Library.vlnStackTrace.StackToStringLocal(2, 1);
NewPage(false);
}
public void NewPage(bool sectionChange)
@@ -744,7 +744,7 @@ namespace Volian.Print.Library
set { PromsPrinter._MyFoldoutReader = value; }
}
private static List<SectionInfo> _MyFoldoutSection = null;
private string Print(ProcedureInfo myProcedure, string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary)
private string Print(ProcedureInfo myProcedure, string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalAction)
{
if (_ForcedPaginations != null) _ForcedPaginations.Clear();
int profileDepth = ProfileTimer.Push(">>>> PromsPrinter.Print");
@@ -768,7 +768,7 @@ namespace Volian.Print.Library
// if floating foldouts, need a list of sections & foldoutreaders. Just do first for now.
_MyFoldoutSection.Add(mySection);
string foldoutPdf = PrintProcedureOrFoldout(myProcedure, mySection, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout" + cnt.ToString() + @".pdf", false, false);
string foldoutPdf = PrintProcedureOrFoldout(myProcedure, mySection, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout" + cnt.ToString() + @".pdf", false, false, false);
_MyFoldoutReader.Add(foldoutPdf != null ? new PdfReader(foldoutPdf) : null);
cnt++;
}
@@ -785,7 +785,7 @@ namespace Volian.Print.Library
return null;
}
}
string retval = PrintProcedureOrFoldout(myProcedure, null, outputFileName, makePlacekeeper, makeContinuousActionSummary);
string retval = PrintProcedureOrFoldout(myProcedure, null, outputFileName, makePlacekeeper, makeContinuousActionSummary, makeTimeCriticalAction);
ProfileTimer.Pop(profileDepth);
return retval;
}
@@ -826,7 +826,7 @@ namespace Volian.Print.Library
set { _WatermarkOverrideColor = value; }
}
//private PdfReader readerWord;
private string PrintProcedureOrFoldout(ProcedureInfo myProcedure, SectionInfo myFoldoutSection, string outputFileName, bool makePlacekeeper, bool makeContinuousActionSummary)
private string PrintProcedureOrFoldout(ProcedureInfo myProcedure, SectionInfo myFoldoutSection, string outputFileName, bool makePlacekeeper, bool makeContinuousActionSummary, bool makeTimeCriticalActionSummary)
{
int profileDepth = ProfileTimer.Push(">>>> PrintProcedureOrFoldout");
Rtf2Pdf.TextAtCounter = 0;
@@ -1118,6 +1118,15 @@ namespace Volian.Print.Library
if (_MyHelper.MyContActSteps.Count > 0)
MyContActSummary = new ContinuousActionSummary(_MyHelper.MyContActSteps, pkFont);
}
// F2022-024 Generate the Time Critical Action Summary
// we use the ContinuousActionSummary generator to create the Time Critical summay
if (_MyHelper != null && makeTimeCriticalActionSummary)
{
// Set the font for the Time Critical Action Summary
VE_Font pkFont = myProcedure.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.ContinuousActionSummaryData.Font; // uses font defined in the format or uses what is definced in BaseAll format
if (_MyHelper.MyTimeCriticalActionSteps.Count > 0)
MyTimeCriticalActSummary = new ContinuousActionSummary(_MyHelper.MyTimeCriticalActionSteps, pkFont, true);
}
_MyHelper = null;
ProfileTimer.Pop(profileDepth);
return outputFileName;
@@ -1165,6 +1174,15 @@ namespace Volian.Print.Library
set { _MyContActSummary = value; }
}
//F2022-024 Time Critical Action Summary
private ContinuousActionSummary _MyTimeCriticalActSummary = null;
public ContinuousActionSummary MyTimeCriticalActSummary
{
get { return _MyTimeCriticalActSummary; }
set { _MyTimeCriticalActSummary = value; }
}
public void CreateWordDocPdf(PdfContentByte cb, SectionInfo mySection)
{
if (mySection.PageNumber == -1) // If page num transition goes to a section, need the pagenumber of section.
@@ -2139,6 +2157,9 @@ namespace Volian.Print.Library
_MyHelper.MyPlacekeepers.Add(myParagraph.MyPlaceKeeper); // add this step text to the PlaceKeeper (Calvert Cliffs)
if (myParagraph.MyContAct != null)
_MyHelper.MyContActSteps.Add(myParagraph.MyContAct); // add this step to the Continuous Action Summary
// F2022-024 Time Critical Action
if (myParagraph.MyTimeCriticalAction != null)
_MyHelper.MyTimeCriticalActionSteps.Add(myParagraph.MyTimeCriticalAction); // add this step to the Time Critical Action Summary
}
else if (!myItemInfo.MyDocStyle.OptionalSectionContent)
{