B2022-026 RO Memory reduction coding

This commit is contained in:
2022-05-26 19:55:07 +00:00
parent 61febac1a0
commit 27993553cb
21 changed files with 6827 additions and 5160 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -31,6 +31,7 @@ namespace VEPROMS
setupProgessSteps1(); // C2017-030 - new Admin Tools user interface
UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID);
IsAdministratorUser = ui.IsAdministrator();
if (!IsAdministratorUser)
{
//C2020-035 if not full Admin disable repair tools
@@ -176,6 +177,15 @@ namespace VEPROMS
tnc = tmp;
}
}
else
{
if (tnc != null && tnc.Text != "VEPROMS") // B2020-114 - mad if statement removed: && !IsUsedPath(tnc.FullPath))
{
TreeNode tmp = tnc.Parent;
tnc.Remove();
tnc = tmp;
}
}
}
return rtnval;
}
@@ -253,7 +263,7 @@ namespace VEPROMS
if (dvil.Count > 0)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("The batch update process was not usccessful for all working drafts selected.");
sb.AppendLine("The batch update process was not successful for all working drafts selected.");
sb.AppendLine("The following working drafts were not able to be refreshed...");
sb.AppendLine();
sb.AppendLine(sbDocVersions.ToString());
@@ -536,8 +546,7 @@ namespace VEPROMS
this.Cursor = Cursors.Default;
}
// C2017-030 - new Admin Tools user interface
// is one of two tools run from Remove Obsolete RO Data
// C2017-030 - new Admin Tools user interface is one of two tools run from Remove Obsolete RO Data
private void RemoveUnusedRoFstsAndFigures()
{
this.Cursor = Cursors.WaitCursor;
@@ -621,6 +630,21 @@ namespace VEPROMS
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
if (rowCount > 0)
{
txtResults.AppendText(string.Format("The database contains {0} unused RO Associations.", rowCount));
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
}
else
{
txtResults.AppendText("No unused RO Associations Found");// B2017-108 Always output results even if there isn't any
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
this.Cursor = Cursors.Default;
@@ -744,6 +768,7 @@ namespace VEPROMS
txtResults.AppendText(statmsg);
txtResults.AppendText(Environment.NewLine);
Application.DoEvents();
if (dq.DocVersionAssociationCount < 1)
{
ProgressBar.ColorTable = eProgressBarItemColor.Error;
@@ -758,8 +783,11 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
return;
}
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
//if (!pathExists(rofstPath))
if (!File.Exists(rofstPath))
{
ProgressBar.ColorTable = eProgressBarItemColor.Error;
@@ -774,14 +802,24 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
return;
}
FileInfo fiRofst = new FileInfo(rofstPath);
//FileInfo fiRofst = new FileInfo(rofstPath);
Cursor = Cursors.WaitCursor;
using (DocVersion dv = DocVersion.Get(dq.VersionID))
{
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
{
// only load the RO.fst
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
roFstInfo = dq.DocVersionAssociations[0].MyROFst;
}
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.RefreshROFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo, DoProgressBarRefresh, txtProcess);
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
}
Cursor = Cursors.Default;
ProgressBar.ColorTable = eProgressBarItemColor.Normal;
FinalProgressBarMessage = "ROs values updated";
@@ -790,6 +828,7 @@ namespace VEPROMS
txtResults.AppendText("ROs values updated");
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
return;
}
@@ -890,6 +929,7 @@ namespace VEPROMS
sfd.FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm"));
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
DialogResult dr = sfd.ShowDialog();
if (dr == DialogResult.OK)
{
System.IO.StreamWriter sw = new System.IO.StreamWriter(sfd.FileName);
@@ -901,8 +941,13 @@ namespace VEPROMS
private void myTV_AfterCheck(object sender, TreeViewEventArgs e)
{
if (e.Action != TreeViewAction.Unknown)
if(e.Node.Nodes.Count > 0)
{
if (e.Node.Nodes.Count > 0)
{
CheckChildNodes(e.Node, e.Node.Checked);
}
}
btnFixLinks.Enabled = AtLeastOneNodeChecked(); // C2017-030 support for Refresh Transitions/Update RO Values
}
@@ -911,12 +956,16 @@ namespace VEPROMS
foreach (TreeNode tn in treeNode.Nodes)
{
tn.Checked = ischecked;
if (tn.Nodes.Count > 0)
{
CheckChildNodes(tn, ischecked);
}
}
}
private ProgressBarItem _ProgressBar = null;
public ProgressBarItem ProgressBar
{
get { return _ProgressBar; }
@@ -930,9 +979,11 @@ namespace VEPROMS
private void DoProgressBarRefresh(int value, int max, string text)
{
if (ProgressBar == null) return;
ProgressBar.Maximum = max;
ProgressBar.Value = value;
ProgressBar.Text = text;
Application.DoEvents();
}
@@ -941,12 +992,14 @@ namespace VEPROMS
set
{
if (ProgressBar == null) return;
ProgressBar.Maximum = 100;
ProgressBar.Value = 0;
ProgressBar.Text = value;
txtProcess.AppendText(value);
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
}
}
@@ -956,12 +1009,14 @@ namespace VEPROMS
set
{
if (ProgressBar == null) return;
ProgressBar.Value = 100;
ProgressBar.Maximum = 100;
ProgressBar.Text = value;
txtProcess.AppendText(value);
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
}
}
@@ -985,8 +1040,11 @@ namespace VEPROMS
AdminToolType = E_AdminToolType.Repair;
lblAdmToolProgressType.Text = "Repairing:";
setupProgessSteps1();
if (!IsAdministratorUser) // C2020-035 notify Set Amin user that only Full Admins can run repair tools
MessageBox.Show("Only Full PROMS Administrator Users can run these data repair tools","Data Repair Tools",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
{
MessageBox.Show("Only Full PROMS Administrator Users can run these data repair tools", "Data Repair Tools", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
// C2017-030 new Admin Tools user interface
@@ -994,6 +1052,7 @@ namespace VEPROMS
{
AdminToolType = E_AdminToolType.Links;
setupProgessSteps1();
if (swUpdateROVals.Value)
ResetTV(true);
else
@@ -1014,6 +1073,7 @@ namespace VEPROMS
}
#region On/Off Swiches
// C2017-030 new Admin Tools user interface
private enum E_AdminToolType : int
{
@@ -1035,6 +1095,7 @@ namespace VEPROMS
{
progressSteps1.Visible = false;
progressSteps1.Items.Clear();
switch (AdminToolType)
{
case E_AdminToolType.Check:
@@ -1048,6 +1109,7 @@ namespace VEPROMS
progressSteps1.Visible = true;
progressSteps1.Refresh();
break;
case E_AdminToolType.Repair:
if (swRmOrphanDataRecs.Value)
progressSteps1.Items.Add(siOrphDatRecs);
@@ -1061,6 +1123,7 @@ namespace VEPROMS
progressSteps1.Visible = true;
progressSteps1.Refresh();
break;
case E_AdminToolType.Links:
case E_AdminToolType.Users:
splitContainer3.Panel2Collapsed = true;
@@ -1068,6 +1131,7 @@ namespace VEPROMS
break;
}
}
// used for all of the Switch buttons (ON/OFF buttons)
private void swCk_ValueChanged(object sender, EventArgs e)
{
@@ -1091,6 +1155,7 @@ namespace VEPROMS
ResetTV(false);
}
}
#endregion
// C2017-030 New Admin Tools user interface
@@ -1100,15 +1165,17 @@ namespace VEPROMS
((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
return;
}
private void ClearStepProgress()
{
for (int i = 0; i < progressSteps1.Items.Count; i++)
{
((DevComponents.DotNetBar.StepItem)progressSteps1.Items[i]).Value = 0;
}
}
// C2017-030 New Admin Tools user interface
// button clicks for processing selected tools
//B2017-221 Allow the batch dialog to close when waiting to process.
private bool CheckProcessLater() // see if we should delay processing until later
{
@@ -1116,6 +1183,7 @@ namespace VEPROMS
{
long later = long.Parse(dtpDate.Value.ToString("yyyyMMdd") + dtpTime.Value.ToString("HHmm"));
long now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
while (now < later)
{
txtProcess.Clear();
@@ -1126,6 +1194,7 @@ namespace VEPROMS
now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
}
}
return true;// Close after complete
}
@@ -1133,18 +1202,23 @@ namespace VEPROMS
private void btn_ShowUsers_Click(object sender, EventArgs e)
{
if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process.
txtProcess.Clear();
txtResults.Clear();
GetDatabaseSessions();
}
private void btnFixLinks_Click(object sender, EventArgs e)
{
if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process.
txtProcess.Clear();
txtResults.Clear();
if (swRefreshTrans.Value)
RefreshTransitions();
if (swUpdateROVals.Value)
UpdateROValues();
}
@@ -1152,21 +1226,25 @@ namespace VEPROMS
private void btnRunCheck_Click(object sender, EventArgs e)
{
if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process.
int prgStpIdx = -1;
txtResults.Clear();
txtProcess.Clear();
if (swCkOrphanDataRecs.Value)
{
StepProgress(++prgStpIdx, 50);
IdentifyDisconnectedItems(); // orphan items
StepProgress(prgStpIdx, 100);
}
if (swHiddenDataLocs.Value)
{
StepProgress(++prgStpIdx, 50);
IdentifyNonEditableItems(); // hidden items
StepProgress(prgStpIdx, 100);
}
if (swCkObsoleteROData.Value)
{
StepProgress(++prgStpIdx, 25);
@@ -1175,22 +1253,27 @@ namespace VEPROMS
IdentifyUnusedRoFstsAndFigures();
StepProgress(prgStpIdx, 100);
}
MessageBox.Show("Check Functions Completed", "Check");
ClearStepProgress();
}
private void btnRunRepair_Click(object sender, EventArgs e)
{
if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process.
int prgStpIdx = -1;
txtResults.Clear();
txtProcess.Clear();
if (swRmOrphanDataRecs.Value)
{
StepProgress(++prgStpIdx, 50);
PurgeDisconnectedItems(); // Orphan Items
StepProgress(prgStpIdx, 100);
}
if (swRmObsoleteROData.Value)
{
StepProgress(++prgStpIdx, 25);
@@ -1199,12 +1282,14 @@ namespace VEPROMS
RemoveUnusedRoFstsAndFigures();
StepProgress(prgStpIdx, 100);
}
if (swStandardHypenChars.Value)
{
StepProgress(++prgStpIdx, 50);
FixHyphens();
StepProgress(prgStpIdx, 100);
}
if (swRefreshWordAttmts.Value)
{
StepProgress(++prgStpIdx, 50);
@@ -1213,6 +1298,7 @@ namespace VEPROMS
}
MessageBox.Show("Repair Functions Completed", "Repair");
ClearStepProgress();
}

View File

@@ -86,28 +86,37 @@ namespace VEPROMS
{
// B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic
ProcedureInfo MyProcedure = myItem as ProcedureInfo;
if (MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier)
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
else
MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID);
// B2021-102 moved the baseline meta file write here too - should have been done with B2021-088 fix
// C2018-015 add the procedure tree path and the procedure number and title to the meta file
if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0}", MyProcedure.SearchDVPath.Replace("\a", " | "));
if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0} | {1}", MyProcedure.DisplayNumber, MyProcedure.DisplayText);
myItem = MyProcedure;
Prefix = prefix;
OpenPDF = openPDF;
DidAll = didAll;
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.
// B2020-022 append a ".pdf" extension if the file name does on have one.
MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF"))?pdfFile:pdfFile+".pdf", insertBlankPages, allOrAuto,Prefix,saveLinks,removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor);
MyPromsPrinter.PromsVersion = (showPROMSVer) ? AboutVEPROMS.PROMSVersion : ""; //C2018-009 print PROMS version
PDFPath = pdfPath;
this.Text = "Creating PDF of " + myItem.DisplayNumber;
_NewLocation = newLocation;
DialogResult = DialogResult.OK;
}
public static void SetUnitWatermark(ProcedureInfo procInfo, ref string waterMarkText, ref string watermarkColor)
@@ -156,6 +165,7 @@ namespace VEPROMS
}
void pp_StatusChanged(object sender, PromsPrintStatusArgs args)
{
if (args.Type == PromsPrinterStatusType.ProgressSetup)
pb.Maximum = args.Progress;
else if (args.Type == PromsPrinterStatusType.Progress)
@@ -168,6 +178,7 @@ namespace VEPROMS
}
MyStatus = args.MyStatus;
Application.DoEvents();
}
public string MyStatus
{
@@ -210,13 +221,17 @@ namespace VEPROMS
tmrRun.Enabled = false;
if (CancelStop) btnCancel.Visible = true;
Application.DoEvents();
MyPromsPrinter.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged);
MyPromsPrinter.DocReplace = DocReplace; // used when approve generates an export with unlinked ROs and Transitions
DateTime tStart = DateTime.Now;
if (!CancelStop) PromsPrinter.ClearTransPageNumProblems();
// B2018-029: delete any pdf files related to printing supplemental information facing pages:
// B2018-039 Delete only pdf files that begin with "SupInof"
string[] filePaths = System.IO.Directory.GetFiles(Volian.Base.Library.VlnSettings.TemporaryFolder, "SupInfo*.pdf");
// B2018-039 Delete only pdf files that begin with "SupInof"
string[] filePaths = System.IO.Directory.GetFiles(Volian.Base.Library.VlnSettings.TemporaryFolder, "SupInfo*.pdf");
foreach (string filePath in filePaths) System.IO.File.Delete(filePath);
do
@@ -224,46 +239,59 @@ namespace VEPROMS
int profileDepth = ProfileTimer.Push(">>>> MyPromsPrinter.Print");
// B2018-099: remove cache items for contents, items and parts to prevent out of memory errors when
// doing print all or automated print testing or approval of some or all procedures, i.e. HashSet and use of them below.
HashSet<int> cacheContentInfo = null;
HashSet<int> cacheItemInfo = null;
HashSet<int> cachePartInfo = null;
if (DidAll)
{
cacheContentInfo = ContentInfo.CacheList;
cacheItemInfo = ItemInfo.CacheList;
cachePartInfo = PartInfo.CacheList;
}
_PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper, MakeContinuousActionSummary);
ProfileTimer.Pop(profileDepth);
if (DidAll)
{
ContentInfo.RestoreCacheList(cacheContentInfo);
ItemInfo.RestoreCacheList(cacheItemInfo);
PartInfo.RestoreCacheList(cachePartInfo);
}
}
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
if (_PdfFile == null)
{
this.Close();
return;
}
if (!CancelStop)
{
if (PromsPrinter.ReportTransPageNumProblems() == DialogResult.Yes && MyPromsPrinter.BeforePageNumberPdf != null)
{
System.Diagnostics.Process.Start(MyPromsPrinter.BeforePageNumberPdf);
// C2017-018 - Open Pass 2 output if it exists
if (MyPromsPrinter.BeforePageNumber2Pdf != null) System.Diagnostics.Process.Start(MyPromsPrinter.BeforePageNumber2Pdf);
}
}
DateTime tEnd = DateTime.Now;
MyStatus = _PdfFile + " created.";
MyStatus = string.Format("{0} created in {1:0.} milliseconds", _PdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds));
if (OpenPDF)
{
OpenPDFandPlacekeeper(_PdfFile);
this.Close();
// C2021-010: Remove trailing returns/spaces & manual page breaks & allow save. Ask if user wants to save chanages
// if they were found.
if ((MyPromsPrinter.RemoveManualPageBreaks != null && MyPromsPrinter.RemoveManualPageBreaks.Count > 0)
@@ -281,6 +309,7 @@ namespace VEPROMS
}
return;
}
btnOpenFolder.Visible = btnOpenPDF.Visible = true;
if (CloseWhenDone)
@@ -290,11 +319,13 @@ namespace VEPROMS
return;
}
}
private void btnOpenPDF_Click(object sender, EventArgs e)
{
OpenPDFandPlacekeeper(_PdfFile);
this.Close();
}
// set a delay so that the word document containing the newly generated placekeeper will appear on top of everything else.
// - requested by Calvert Cliffs
private void OpenPDFandPlacekeeper(string pdffile)
@@ -304,32 +335,41 @@ namespace VEPROMS
if ((pdffile ?? "") != "" && !OnlyShowContinuousActionSummary)
{
System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(pdffile);
if (sdp != null)
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
// ex: VEPROMS.EXE /PlacekeeperDelay=2.5 will delay it 2 1/2 seconds
float delay = Volian.Base.Library.VlnSettings.GetCommandFloat("PlacekeeperDelay", 3.0f);
int mydelay = (int)(1000 * delay);
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 Continuous 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();
}
}
catch (Exception ex)
{
@@ -337,12 +377,14 @@ namespace VEPROMS
MessageBox.Show(str, "Error Opening PDFFile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
private void btnOpenFolder_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Explorer", "/select," + _PdfFile);
OpenPDFandPlacekeeper(null);
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
CancelPrinting = true;

View File

@@ -189,9 +189,9 @@ namespace VEPROMS
displaySearch1.TopFolderID = myDocVersion.FolderID;
SelectedDVI = myDocVersion;
tc.VersionID = myDocVersion.VersionID;
tc.SeparateWindows = true; // need to set this in child window for goto Outside Transitions
displayBookMarks.MyBookMarks = MyParent.displayBookMarks.MyBookMarks;
displayBookMarks.SetupBookMarks(); // setup bookmarks in the child window
tc.SeparateWindows = true; // need to set this in child window for goto Outside Transitions
displayBookMarks.MyBookMarks = MyParent.displayBookMarks.MyBookMarks;
displayBookMarks.SetupBookMarks(); // setup bookmarks in the child window
tc.MyCopyStep = myParent.tc.MyCopyStep; // copy the copystep info to the child window
(tv.Nodes[0] as VETreeNode).InChildWindow = true; // tells us this folder's tree nodes are in the child window
}
@@ -324,8 +324,8 @@ namespace VEPROMS
if(Properties.Settings.Default.VersionWindows != null)
Properties.Settings.Default.VersionWindows.Clear();
Properties.Settings.Default.MRIList = null;
Properties.Settings.Default.DefaultDB = Database.SelectedDatabase;
Properties.Settings.Default.Save();
Properties.Settings.Default.DefaultDB = Database.SelectedDatabase;
Properties.Settings.Default.Save();
}
displayBookMarks.SetupBookMarks();
DateTime dtSunday = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek));
@@ -348,6 +348,8 @@ namespace VEPROMS
tc.SeparateWindows = Properties.Settings.Default.SeparateWindows;
tv.PauseRefresh += tv_PauseRefresh;
tv.UnPauseRefresh += tv_UnPauseRefresh;
}
void displaySearch1_SearchComplete(object sender, DisplaySearchEventArgs args)
{
@@ -432,7 +434,7 @@ namespace VEPROMS
tv.Processing += tv_Processing;
tv.CreateContinuousActionSummary += new vlnTreeViewEvent(tv_CreateContinuousActionSummary);
tv.SelectDateToStartChangeBars += tv_SelectDateToStartChangeBars;
displayBookMarks.ResetBookMarksInPROMSWindows += displayBookMarks_ResetBookMarksInPROMSWindows;
displayBookMarks.ResetBookMarksInPROMSWindows += displayBookMarks_ResetBookMarksInPROMSWindows;
}
// Part of Separate Windows upgrade C2015-022
@@ -1284,10 +1286,10 @@ namespace VEPROMS
VolianTimer.ShowTimers();
foreach (DisplayTabItem dti in tc.MyBar.Items)
{
if (dti.MyDSOTabPanel != null)
dti.MyDSOTabPanel.CloseDSO();
else
MySessionInfo.CheckInItem(dti.OwnerID); //C2015-022 Separate Windows closing child form only left procedure ownership active
if (dti.MyDSOTabPanel != null)
dti.MyDSOTabPanel.CloseDSO();
else
MySessionInfo.CheckInItem(dti.OwnerID); //C2015-022 Separate Windows closing child form only left procedure ownership active
}
//_MyLog.WarnFormat("frmVEPROMS_FormClosing");
if (MyParent == null)
@@ -2767,6 +2769,7 @@ namespace VEPROMS
/// <param name="e"></param>
private void tmrTreeView_Tick(object sender, EventArgs e)
{
_TimeActivity2.Open();
bool giveTvFocus = true;
@@ -3231,6 +3234,7 @@ namespace VEPROMS
displayRO.MyRTB = (SelectedStepTabPanel == null) ? null :
SelectedStepTabPanel.MyStepPanel.SelectedEditItem == null ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.ProgressBar = bottomProgBar;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
}
#endregion
#region InfoTabTransition
@@ -3385,6 +3389,8 @@ namespace VEPROMS
}
private void tc_SelectedDisplayTabItemChanged(object sender, EventArgs args)
{
if (tc.ShuttingDown) return; // B2022-026 RO Memory Reduction code - to prevent refreshing the RO tree again
// If the current procedure or section in the treeview doesn't match then change the treeview selection.
//jcb added for error B2012-117
ItemInfo tvii;
@@ -3413,7 +3419,10 @@ namespace VEPROMS
SetCaption(tv.SelectedNode as VETreeNode);
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
{
displayRO.MyROFSTLookup = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion);
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
}
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.MultiUnitCount > 1)
btnPrint.Visible = false;
@@ -3471,21 +3480,19 @@ namespace VEPROMS
private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
tc.HideTheCaret();
//if (args.MyEditItem != null)
//Volian.Base.Library.vlnStackTrace.ShowStackLocal(2,10,"Edit item {0}, Step Panel {1}",args.MyEditItem.MyStepRTB.ContainsFocus, args.MyEditItem.MyStepPanel.ContainsFocus);
if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus) return;
//if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
//{
// _RefreshRTB = args.MyEditItem.MyStepRTB;
// TmrRefreshItem.Enabled = true;
// return;
//}
if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
return;
btnFixMSWord.Visible = (args != null && ( args.MyItemInfo != null && args.MyEditItem == null));
if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed)
_LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged);
_LastStepRTB = args != null && args.MyEditItem != null ? args.MyEditItem.MyStepRTB : null;
if (_LastStepRTB != null) _LastStepRTB.EditModeChanged += new StepRTBEvent(_LastStepRTB_EditModeChanged);
lblEditView.Text = " ";
if (args == null)
{
_CurrentItem = null;
@@ -3507,12 +3514,13 @@ namespace VEPROMS
{
lblItemID.Text = string.Format("ItemID = {0}", args.MyItemInfo.ItemID);
lblItemID.ForeColor = Color.DarkBlue;
if (_CurrentItem != args.MyItemInfo)
{
if (_CurrentItem != null) _CurrentItem.Deleted -= new ItemInfoEvent(_CurrentItem_Deleted);
_CurrentItem = args.MyItemInfo;
}
//vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem);
if (args.MyEditItem == null)
{
ctrlAnnotationDetails.Enabled = false;
@@ -3520,12 +3528,15 @@ namespace VEPROMS
infotabFoldoutMaint.Visible = false;
infotabTransition.Visible = false;
infotabRO.Visible = false;
if (args.MyItemInfo.MyDocVersion.DocVersionAssociations != null)
{
displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
displayRO.MyRTB = null;
infotabRO.Visible = true;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
}
infotabTags.Visible = false;
infotabApplicability.Visible = false;
// Not sure why but the following line was causing a hang if
@@ -3613,10 +3624,14 @@ namespace VEPROMS
displayTags.MyEditItem = args.MyEditItem;
displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ?
E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0];
if (_LastStepRTB.IsRoFigure && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0];
// if this is an enhanced step (linked from a source document), don't bring up the ro or transition panel,
// and don't allow replace on the find/replace dialog.
if (args.MyItemInfo.IsEnhancedStep)
@@ -3642,6 +3657,7 @@ namespace VEPROMS
displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
}
displayRO.ROTypeFilter = E_ROValueType.All; // allow all RO types for Word attachments (but fix)
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
displayRO.SetFindDocROButton(true);
}
}
@@ -3654,8 +3670,10 @@ namespace VEPROMS
{
ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); // set the CurrentItem (send Message) when the MSWord section is opened.
}
btnPrint.Enabled = (_CurrentItem != null);
}
/*KBR:Timer _tmrSetTransROInVisible;
public Timer TmrSetTransROInVisible
{
@@ -3750,6 +3768,7 @@ namespace VEPROMS
E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image: E_ROValueType.Text;
//displayRO.Mydvi = SelectedDVI;
displayRO.ProgressBar = bottomProgBar;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
}
#endregion
#region VButton

File diff suppressed because it is too large Load Diff