Added a hidden check box which is used to generate a Continuous Action Summary

Continuous Action Summary logic
Continuous Action Summary logic – hooks for tree menu and ribbon button
This commit is contained in:
2015-10-23 18:10:31 +00:00
parent e30019797e
commit 17d4c2b26b
5 changed files with 514 additions and 393 deletions

View File

@@ -66,6 +66,15 @@ namespace VEPROMS
get { return _Prefix; }
set { _Prefix = value; }
}
// this flag is used when the Continuous Action Sumamry is printed from the tree or ribbon button
// it will prevent the temporary PDF (generated with printing - needed to get page numbers) from being displayed
// and will delete that temporary PDF file
private bool _OnlyShowContinuousActionSummary = false;
public bool OnlyShowContinuousActionSummary
{
get { return _OnlyShowContinuousActionSummary; }
set { _OnlyShowContinuousActionSummary = value; }
}
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd,string pdfFile, Point newLocation,bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks)
{
Prefix = prefix;
@@ -109,6 +118,8 @@ namespace VEPROMS
{
Location = _NewLocation;
tmrRun.Enabled = true;
if (MakeContinuousActionSummary)
Text = Text.Replace("PDF", "Continuous Action Summary");
}
private string _PdfFile;
@@ -120,6 +131,15 @@ namespace VEPROMS
get { return _MakePlaceKeeper; }
set { _MakePlaceKeeper = value; }
}
private bool _MakeContinuousActionSummary = false;
public bool MakeContinuousActionSummary
{
get { return _MakeContinuousActionSummary; }
set { _MakeContinuousActionSummary = value; }
}
private void tmrRun_Tick(object sender, EventArgs e)
{
tmrRun.Enabled = false;
@@ -131,7 +151,7 @@ namespace VEPROMS
do
{
int profileDepth = ProfileTimer.Push(">>>> MyPromsPrinter.Print");
_PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper);
_PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper, MakeContinuousActionSummary);
ProfileTimer.Pop(profileDepth);
}
while (_PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
@@ -174,11 +194,13 @@ namespace VEPROMS
// - requested by Calvert Cliffs
private void OpenPDFandPlacekeeper(string pdffile)
{
if ((pdffile ?? "") != "")
if ((pdffile ?? "") != "" && !OnlyShowContinuousActionSummary)
{
System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(pdffile);
sdp.WaitForInputIdle();
}
if (OnlyShowContinuousActionSummary)
System.IO.File.Delete(pdffile); // remove the temporary PDF file used to create the Continuous Action Summary
if (MyPromsPrinter.MyPlacekeeper != null)
{
// The PlacekeeperDelay is a switch that can be added to the PROMS.exe shortcut
@@ -188,6 +210,19 @@ namespace VEPROMS
System.Threading.Thread.Sleep(mydelay);
MyPromsPrinter.MyPlacekeeper.Visible();
}
// this will display the generated Continuous Action Summary in MS Word (starting a new instance of MS Word outside of PROMS)
if (MyPromsPrinter.MyContActSummary != null)
{
string instructions = "The Coninuous Action Summary will be opened in MS Word.\n\nYou can make modifications and copy it into a PROMS Word section.";
MessageBox.Show(instructions, "Continuous Action Summary");
// The ContActSummaryDelay is a switch that can be added to the PROMS.exe shortcut
// ex: VEPROMS.EXE /ContActSummaryDelay=2.5 will delay it 2 1/2 seconds
float delay = Volian.Base.Library.VlnSettings.GetCommandFloat("ContActSummaryDelay", 1.0f);
int mydelay = (int)(1000 * delay);
System.Threading.Thread.Sleep(mydelay);
MyPromsPrinter.MyContActSummary.Visible();
}
}
private void btnOpenFolder_Click(object sender, EventArgs e)
{