From 45d311bdfe57a0dea8c8d2651ea5871306cb4a80 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 24 Apr 2015 13:13:47 +0000 Subject: [PATCH] =?UTF-8?q?increase=20PSI=20labels=20width=20Add=20argumen?= =?UTF-8?q?t=20to=20fmrPDFStatusForm=20call=20for=20pagenum=20transition?= =?UTF-8?q?=20processing=20(B2015-053)=20Add=20argument=20for=20pagenum=20?= =?UTF-8?q?transition=20processing=20(B2015-053)=20Add=20panel/scroll=20ba?= =?UTF-8?q?r=20for=20PSI=20that=20has=20many=20fields=20(on=20larger=20fon?= =?UTF-8?q?t=20display,=20could=20not=20access=20bottommost)=20(B2015-051)?= =?UTF-8?q?=20Add=20property=20for=20tracking=20of=20pagenum=20transitions?= =?UTF-8?q?=20(B2015-053)=20For=20section=20list,=20use=20section=20defaul?= =?UTF-8?q?t=20(procedure=20steps)=20if=20transition=20format=20has=20user?= =?UTF-8?q?=20interface=20of=20=E2=80=98SectDefault=E2=80=99.=20(B2015-052?= =?UTF-8?q?)=20Pagenum=20transition=20processing=20=E2=80=93=20add=203rd?= =?UTF-8?q?=20pass=20for=20fix.=20(B2015-053)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Formats/fmtall/AEPAPPRall.xml | Bin 30174 -> 30174 bytes PROMS/Formats/fmtall/AEPCHID_00all.xml | Bin 28668 -> 28668 bytes PROMS/Formats/fmtall/AEPCHIDall.xml | Bin 66772 -> 66772 bytes PROMS/Formats/fmtall/AEP_00all.xml | Bin 28610 -> 28610 bytes PROMS/Formats/fmtall/AEP_01all.xml | Bin 27352 -> 27352 bytes PROMS/Formats/fmtall/AEP_02all.xml | Bin 28396 -> 28396 bytes PROMS/Formats/fmtall/AEPall.xml | Bin 66392 -> 66392 bytes .../DlgPrintProcedure.cs | 8 +-- .../dlgApproveProcedure.cs | 2 +- .../frmPDFStatusForm.cs | 4 +- .../VEPROMS User Interface/frmPSI.Designer.cs | 29 +++++++---- PROMS/VEPROMS User Interface/frmPSI.cs | 29 +++++++++-- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 6 +++ .../DisplayTransition.cs | 12 ++++- PROMS/Volian.Print.Library/PromsPrinter.cs | 47 ++++++++++++++++-- PROMS/Volian.Print.Library/vlnParagraph.cs | 4 +- 16 files changed, 114 insertions(+), 27 deletions(-) diff --git a/PROMS/Formats/fmtall/AEPAPPRall.xml b/PROMS/Formats/fmtall/AEPAPPRall.xml index 65e38747c5040076f1f23affbbb0d15c7503e155..17efd3ba084701ae382d44ce3d259ebe835c59de 100644 GIT binary patch delta 22 ecmccjn(^Li#tjo#nT;3>CdaagZ(hY}QUCyNfCy3m delta 24 gcmccjn(^Li#tjo#Sq&MC7)&R}vx#nA#cEOj0DL?MiU0rr diff --git a/PROMS/Formats/fmtall/AEPCHID_00all.xml b/PROMS/Formats/fmtall/AEPCHID_00all.xml index 08f138b3daad1f7d56218187e88022f4f388e671..2d7e4355faa4dee33107f40970bfb548c6fb6264 100644 GIT binary patch delta 70 zcmex!pYhLq#tjdcnT;3>CU4{rpZtsY5)#{JvIJ`r65nd_JJviTzSQOkY&n?#vt=1b delta 70 zcmex!pYhLq#tjdcnGG3?CNpx2PyWSx35jhqS%S3*iElOe9cvyEUuyFNwwz1=RY?|@ diff --git a/PROMS/Formats/fmtall/AEPCHIDall.xml b/PROMS/Formats/fmtall/AEPCHIDall.xml index 88ec120b1f24d8a3e85a49bfc989a903576ec12b..8eb1b8a8dbae5cd469dee34e5e0a6afc4770fc87 100644 GIT binary patch delta 70 zcmcc8$#SKWWkVM$s}X|%gTdr}*5`1R`{YAxO>mz7mz7$(2j}Te-p3&^nU8~Ob03>Y FCICOW75xAJ delta 70 zcmX?fpYhOr#tnOzSq&MC7)&Q0WPT23xljJW(gf%EPd>$(2j}Te-p3&^nU8~Ob03>Y FCICZ978L*h diff --git a/PROMS/Formats/fmtall/AEP_01all.xml b/PROMS/Formats/fmtall/AEP_01all.xml index c0947e71ffdc45f52950ad7b5565c4e2ccc61f58..05d3d48a759f6b74bd1bba57f4e6f75c9aeae926 100644 GIT binary patch delta 74 zcmca{mGQ<^#tkei%tj0bljFI>C(E&1LSh?Dwqb2T;#*A?V#`C~OHH1@CAIk+8&?Vd D5Cjv< delta 74 zcmca{mGQ<^#tkei%!Uj`lP7YDPnKi3gv2(QY{S}w#J8F(#FmG|mzq3*OKS5uHm(!^ DE`Su2 diff --git a/PROMS/Formats/fmtall/AEP_02all.xml b/PROMS/Formats/fmtall/AEP_02all.xml index f6735fe0ddad1b4d00d70a4d3c8685f851c55609..5c943f1d3836084bf4f3587b6dec767c50388512 100644 GIT binary patch delta 77 zcmaEJm+{SA#tr|NnT;3>CZFdJpDe+035jhq*^IRbiElNThb<3@FExo%VsZcn*X9ds GG8q8hFc%5{ delta 85 zcmaEJm+{SA#tr|NSq&MC7)&Q$>>> frmStatus"); frmStatus.ShowDialog(); diff --git a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs index 6e87068d..596da35b 100644 --- a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs +++ b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs @@ -1100,7 +1100,7 @@ namespace VEPROMS //ProcedureInfo myproc = pi; //frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location); //myproc.ChangeBarDate = myDTS; - frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts); + frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts, true); frm.AllowAllWatermarks = true; frm.CloseWhenDone = !ViewPDF; frm.ShowDialog(); diff --git a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs index 3fb92a57..f0c42870 100644 --- a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs +++ b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs @@ -60,13 +60,13 @@ namespace VEPROMS set { _OpenPDF = value; } } private Point _NewLocation; - 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) + 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) { OpenPDF = openPDF; InitializeComponent(); // if the version number of PROMS is 1.0, then we are running a Demo version. // When running a Demo version, force a "Sample" watermark when printing. - MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\\Compare", false, overWrite, cbd, pdfFile, insertBlankPages);//openPDF); + MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\\Compare", false, overWrite, cbd, pdfFile, insertBlankPages, allOrAuto); PDFPath = pdfPath; this.Text = "Creating PDF of " + myItem.DisplayNumber; _NewLocation = newLocation; diff --git a/PROMS/VEPROMS User Interface/frmPSI.Designer.cs b/PROMS/VEPROMS User Interface/frmPSI.Designer.cs index acf43008..535ab7fa 100644 --- a/PROMS/VEPROMS User Interface/frmPSI.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmPSI.Designer.cs @@ -30,15 +30,16 @@ namespace VEPROMS { this.btnOk = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); + this.panelPSI = new System.Windows.Forms.Panel(); this.SuspendLayout(); // // btnOk // this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOk.Location = new System.Drawing.Point(9, 180); - this.btnOk.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.btnOk.Location = new System.Drawing.Point(12, 222); + this.btnOk.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnOk.Name = "btnOk"; - this.btnOk.Size = new System.Drawing.Size(56, 19); + this.btnOk.Size = new System.Drawing.Size(75, 23); this.btnOk.TabIndex = 0; this.btnOk.Text = "Ok"; this.btnOk.UseVisualStyleBackColor = true; @@ -46,24 +47,33 @@ namespace VEPROMS // // btnCancel // - this.btnCancel.Location = new System.Drawing.Point(82, 180); - this.btnCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.btnCancel.Location = new System.Drawing.Point(109, 222); + this.btnCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(56, 19); + this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.TabIndex = 1; this.btnCancel.Text = "Cancel"; this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // + // panelPSI + // + this.panelPSI.AutoScroll = true; + this.panelPSI.Location = new System.Drawing.Point(12, 12); + this.panelPSI.Name = "panelPSI"; + this.panelPSI.Size = new System.Drawing.Size(349, 205); + this.panelPSI.TabIndex = 2; + // // frmPSI // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; - this.ClientSize = new System.Drawing.Size(280, 209); + this.ClientSize = new System.Drawing.Size(373, 257); + this.Controls.Add(this.panelPSI); this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnOk); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Name = "frmPSI"; this.Text = "frmPSI"; this.TopMost = true; @@ -75,5 +85,6 @@ namespace VEPROMS private System.Windows.Forms.Button btnOk; private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Panel panelPSI; } } \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmPSI.cs b/PROMS/VEPROMS User Interface/frmPSI.cs index e6bbbf05..afb2ed6e 100644 --- a/PROMS/VEPROMS User Interface/frmPSI.cs +++ b/PROMS/VEPROMS User Interface/frmPSI.cs @@ -33,6 +33,9 @@ namespace VEPROMS this.Location = new Point((int)psiDialogDef.x * 2, (int)psiDialogDef.y * 2); int maxx = 0; int maxy = 0; + int xB4Scroll = 900; + int yB4Scroll = 630; + this.panelPSI.AutoScroll = false; foreach (PsiLabel lbl in psiDialogDef.LabelList) { Label wlbl = new Label(); @@ -41,7 +44,7 @@ namespace VEPROMS wlbl.AutoSize = true; //wlbl.Size = new Size((int)lbl.width * 2, (int)lbl.height * 2); wlbl.Visible = true; - this.Controls.Add(wlbl); + this.panelPSI.Controls.Add(wlbl); maxx = ((int)lbl.x * 2 + (int)lbl.width * 2) > maxx ? ((int)lbl.x * 2 + (int)lbl.width * 2) : maxx; maxy = ((int)lbl.y * 2 + (int)lbl.height * 2) > maxy ? ((int)lbl.y * 2 + (int)lbl.height * 2) : maxy; } @@ -69,7 +72,7 @@ namespace VEPROMS tb.Location = new Point((int)fld.x * 2, (int)fld.y * 2); tb.Size = new Size((int)fld.width * 2, (int)fld.height * 2); tb.Visible = true; - this.Controls.Add(tb); + this.panelPSI.Controls.Add(tb); maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx; maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy; } @@ -83,15 +86,31 @@ namespace VEPROMS cb.Width = (int)fld.width * 2; string val = procConfig.GetValue("PSI", fld.name); cb.Checked = val!=null && val!="" && val.ToUpper()[0] == 'Y' ? true : false; - this.Controls.Add(cb); + this.panelPSI.Controls.Add(cb); maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx; maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy; } } + if (maxx > xB4Scroll) + { + maxx = xB4Scroll; + this.panelPSI.Width = xB4Scroll; + this.panelPSI.AutoScroll = true; + } + else + this.panelPSI.Width = maxx + 50; + if (maxy > yB4Scroll) + { + maxy = yB4Scroll; + this.panelPSI.Height = yB4Scroll; + this.panelPSI.AutoScroll = true; + } + else + this.panelPSI.Height = maxy + 50; if (psiDialogDef.ButtonsOnBottom == null || psiDialogDef.ButtonsOnBottom.ToUpper() == "NO") { - btnOk.Location = new Point(maxx+20, 30); - btnCancel.Location = new Point(maxx + 20, 60); + btnOk.Location = new Point(maxx+70, 30); + btnCancel.Location = new Point(maxx + 70, 60); } } private void FieldStepRTB_Enter(object sender, EventArgs e) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 2c95ab36..aba08430 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -937,6 +937,12 @@ namespace VEPROMS.CSLA.Library get { return _PageNumberUsed; } set { _PageNumberUsed = value; } } + private int _PageNumberNextPass = 0; + public int PageNumberNextPass + { + get { return _PageNumberNextPass; } + set { _PageNumberNextPass = value; } + } private float _MSWordPageCount = 0; public float MSWordPageCount { diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.cs b/PROMS/Volian.Controls.Library/DisplayTransition.cs index 8a221652..eaa5cdbf 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.cs @@ -162,7 +162,17 @@ namespace Volian.Controls.Library cbTranProcsFillIn(_CurrentProcedure); if (_CurrentProcedure.Sections != null) { - cbTranSectsFillIn(secitm, secitm == null ? -1 : secitm.ItemID, true); + // if the selected format is using section default, initialize with the section default (find it), + // otherwise use current section item. + int secStartId = secitm.ItemID; + E_TransUI etm = (E_TransUI)_CurrentProcedure.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[_TranFmtIndx].TransUI; + if ((etm & E_TransUI.SectDefault) == E_TransUI.SectDefault) + { + secStartId = FindSectionStart(_CurrentProcedure); + secitm = ItemInfo.Get(secStartId); + selitm = (secitm.Steps.Count > 0) ? secitm.Steps[0] : null; + } + cbTranSectsFillIn(secitm, secitm == null ? -1 : secStartId, true); // Fill step items, passing in the active step to the selected item, or the first // step if the selection was not at the step level. ItemInfo stpitm = null; diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 55d6d8f6..fa04ab93 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -165,6 +165,12 @@ namespace Volian.Print.Library get { return _InsertBlankPages; } set { _InsertBlankPages = value; } } + private bool _BatchPrint = true; // flags that a batch-type print is occurring, i.e. AllProcedures or Automatic testing + public bool BatchPrint + { + get { return _BatchPrint; } + set { _BatchPrint = value; } + } private static List _TransPageNumProblems = null; public static List TransPageNumProblems { @@ -197,7 +203,7 @@ namespace Volian.Print.Library get { return _MyReaderHelper; } set { _MyReaderHelper = value; } } - public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite, ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages) + public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite, ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint) { _MyItem = myItem; _Rev = rev; @@ -210,6 +216,7 @@ namespace Volian.Print.Library _PDFFile = pdfFile; _OriginalPageBreak = origPgBrk; _InsertBlankPages = insertBlankPages; + _BatchPrint = batchPrint; _MyReaderHelper = new ReaderHelper(this); //_MyReaderHelper.LoadTree(myItem); } @@ -231,18 +238,50 @@ namespace Volian.Print.Library // if the plant uses transition modifiers and/or page num in transition format, // need to do two passes. First pass, sets the pagenumbers for each item, // 2nd pass fills in the page numbers in transitions. - DirectoryInfo di = new DirectoryInfo(pdfFolder + @"\BeforePageNumber"); + DirectoryInfo di = new DirectoryInfo(pdfFolder + @"\PageNumberPass1"); if (!di.Exists) di.Create(); - string retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\BeforePageNumber", false); + string retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\PageNumberPass1", false); if (retstr == null) return null; BeforePageNumberPdf = retstr; ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo); _MyReaderHelper = new ReaderHelper(this); - return Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper); + retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper); + if (TransPageNumProblems.Count > 0) + { + if (BatchPrint || ( MessageBox.Show("Page Number Transitions may be fixed if a second pass is performed. Do you want to perform a second pass?", "Page Number Transition Errors", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)) + { + DirectoryInfo di1 = new DirectoryInfo(pdfFolder + @"\PageNumberPass2"); + if (!di1.Exists) di1.Create(); + FileInfo fi = new FileInfo(retstr); + FileInfo fidest = new FileInfo(di1.FullName + @"\" + fi.Name); + if (fidest.Exists) fidest.Delete(); + fi.MoveTo(di1.FullName + @"\" + fi.Name); + ClearTransPageNumProblems(); + RefreshPageNumber(_MyItem); + ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo); + _MyReaderHelper = new ReaderHelper(this); + retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper); + } + } + return retstr; } } return ""; } + + private void RefreshPageNumber(ItemInfo _MyItem) + { + // set all page numbers for all items under the passed in procedure item + _MyItem.PageNumber = _MyItem.PageNumberNextPass; + if (_MyItem.MyContent.ContentPartCount > 0) + { + foreach (PartInfo pi in _MyItem.MyContent.ContentParts) + { + foreach (ItemInfo ii in pi.MyItems) + RefreshPageNumber(ii); + } + } + } internal string BuildMSWordPDF(SectionInfo section) { DateTime tStart = DateTime.Now; diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 36e7a3fd..e23ea610 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -470,8 +470,10 @@ namespace Volian.Print.Library else if (MyItemInfo.PageNumberUsed != 0 && MyItemInfo.PageNumberUsed != pagenumTran) { if (PromsPrinter.TransPageNumProblems == null) PromsPrinter.TransPageNumProblems = new List(); - PromsPrinter.TransPageNumProblems.Add(MyItemInfo.ShortPath); + string pnErr = string.Format("{0} {1} {2} {3}", MyItemInfo.ItemID, MyItemInfo.ShortPath, MyItemInfo.PageNumberUsed, pagenumTran); + PromsPrinter.TransPageNumProblems.Add(pnErr); } + MyItemInfo.PageNumberNextPass = pagenumTran; if (Processed) return yPageStart; //float localYPageStart = yPageStart; Processed = true;