B2022-026 RO Memory reduction coding (Jakes Merge)

This commit is contained in:
Jake 2022-06-03 19:45:42 +00:00
parent 7e0f04207c
commit 3f7cbc10bc
8 changed files with 1114 additions and 877 deletions

View File

@ -1090,7 +1090,7 @@ namespace VEPROMS
this.displayRO.Location = new System.Drawing.Point(1, 1); this.displayRO.Location = new System.Drawing.Point(1, 1);
this.displayRO.Margin = new System.Windows.Forms.Padding(4); this.displayRO.Margin = new System.Windows.Forms.Padding(4);
this.displayRO.MyROFST = null; this.displayRO.MyROFST = null;
this.displayRO.MyROFSTLookup = null; //this.displayRO.MyROFSTLookup = null;
this.displayRO.MyRTB = null; this.displayRO.MyRTB = null;
this.displayRO.Name = "displayRO"; this.displayRO.Name = "displayRO";
this.displayRO.ProgressBar = null; this.displayRO.ProgressBar = null;

View File

@ -359,7 +359,8 @@ namespace VEPROMS
public bool PauseRefresh public bool PauseRefresh
{ {
get { return _PauseRefresh; } get { return _PauseRefresh; }
set { set
{
//_MyLog.WarnFormat(value ? "=== Pause" : "=== UnPause"); //_MyLog.WarnFormat(value ? "=== Pause" : "=== UnPause");
_PauseRefresh = value; _PauseRefresh = value;
} }
@ -437,6 +438,20 @@ namespace VEPROMS
displayBookMarks.ResetBookMarksInPROMSWindows += displayBookMarks_ResetBookMarksInPROMSWindows; displayBookMarks.ResetBookMarksInPROMSWindows += displayBookMarks_ResetBookMarksInPROMSWindows;
} }
// Part of Separate Windows upgrade C2015-022
// Extend changeds to BookMark information to all of the child windows
void displayBookMarks_ResetBookMarksInPROMSWindows(object sender, EventArgs args)
{
foreach (int k in PROMSWindowForms.Keys)
{
frmVEPROMS tmp = PROMSWindowForms[k];
if (tmp.MyDocVersion.VersionID != this.SelectedDVI.VersionID)
tmp.displayBookMarks.ResetBookMarkList();
else if (tmp.MyParent != null)
tmp.MyParent.displayBookMarks.ResetBookMarkList();
}
}
// Part of Separate Windows upgrade C2015-022 // Part of Separate Windows upgrade C2015-022
// Extend changeds to BookMark information to all of the child windows // Extend changeds to BookMark information to all of the child windows
void displayBookMarks_ResetBookMarksInPROMSWindows(object sender, EventArgs args) void displayBookMarks_ResetBookMarksInPROMSWindows(object sender, EventArgs args)
@ -511,7 +526,7 @@ namespace VEPROMS
void tv_NodeCopy(object sender, vlnTreeEventArgs args) void tv_NodeCopy(object sender, vlnTreeEventArgs args)
{ {
VETreeNode tn = args.Node as VETreeNode; VETreeNode tn = args.Node as VETreeNode;
ItemInfo ii = tn.VEObject as ItemInfo; ItemInfo ii = tn.VEObject as ItemInfo;?
tc.MyCopyStep = ii; tc.MyCopyStep = ii;
tc_CopyStepSelected(sender, null); // C2015-022 set copy step info in the child windows tc_CopyStepSelected(sender, null); // C2015-022 set copy step info in the child windows
} }
@ -906,7 +921,7 @@ namespace VEPROMS
ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo;
pi.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex; pi.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex;
if (pi == null) return; if (pi == null) return;
// B2017-242 added check for duplicate procedure numbers in a procedure set // B2017-242 added check for duplicate procedure numbers in a procedure set?
if (DuplicateProcedureNumbers(pi.MyDocVersion, pi)) if (DuplicateProcedureNumbers(pi.MyDocVersion, pi))
{ {
// C2020-036 display list of duplicate procedure numbers // C2020-036 display list of duplicate procedure numbers
@ -1044,23 +1059,27 @@ namespace VEPROMS
{ {
tmrTreeView.Enabled = true; tmrTreeView.Enabled = true;
} }
private int _LastROFSTID = 0; private int _LastROFSTID = 0;
void frmVEPROMS_Activated(object sender, EventArgs e) void frmVEPROMS_Activated(object sender, EventArgs e)
{ {
if (ActiveControl == tc) tc.HideCaret(); if (ActiveControl == tc) tc.HideCaret();
// refresh anything that pertains to external files or programs: // refresh anything that pertains to external files or programs:
// if ro.fst was 'updated' from the roeditor, enable the update ro.fst values on // if ro.fst was 'updated' from the roeditor, enable the update ro.fst values on the stepRibbon
// the steptabribbon.
if (tc.ShuttingDown) return; if (tc.ShuttingDown) return;
// B2017-202 update the RO tree in the step properties panel // B2017-202 update the RO tree in the step properties panel
// B2017-205 - displayRO.MyROFST will be null if first thing opened is a Word section so added null check // B2017-205 - displayRO.MyROFST will be null if first thing opened is a Word section so added null check
if (tc.MyBar.SelectedDockTab > -1 && displayRO.MyROFST != null) if (tc.MyBar.SelectedDockTab > -1 && displayRO.MyROFST != null)
{ {
DisplayTabItem myDTI = tc.MyBar.Items[tc.MyBar.SelectedDockTab] as DisplayTabItem; DisplayTabItem myDTI = tc.MyBar.Items[tc.MyBar.SelectedDockTab] as DisplayTabItem;
if (myDTI.MyDSOTabPanel != null) if (myDTI.MyDSOTabPanel != null)
{ {
DSOTabPanel myDTP = myDTI.MyDSOTabPanel; DSOTabPanel myDTP = myDTI.MyDSOTabPanel;
if (myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations == null) if (myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations == null)
{ {
SelectedROFst = null; // B2020-071 ROs are not associated with this procedure set. Set value to null so that PROMS does not try to generate the RO tree in Step Properties. SelectedROFst = null; // B2020-071 ROs are not associated with this procedure set. Set value to null so that PROMS does not try to generate the RO tree in Step Properties.
@ -1068,29 +1087,22 @@ namespace VEPROMS
else else
{ {
SelectedROFst = myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; SelectedROFst = myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
if (_LastROFSTID != SelectedROFst.ROFstID) // B2017-240 Only refresh when the ROFSTID is different
{
_LastROFSTID = SelectedROFst.ROFstID;
displayRO.MyROFST = SelectedROFst; // need this to update RO Tree after UpdateRofst (B2015-226)
displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI);
displayRO.RefreshRoTree();
}
} }
} }
else if (tc.MyEditItem != null && displayRO.MyROFST != null && tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].ROFstID != displayRO.MyROFST.ROFstID) else if (tc.MyEditItem != null && displayRO.MyROFST != null && tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].ROFstID != displayRO.MyROFST.ROFstID)
{ {
SelectedROFst = tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; SelectedROFst = tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
if (_LastROFSTID != SelectedROFst.ROFstID)// B2017-240 Only refresh when the ROFSTID is different
{
_LastROFSTID = SelectedROFst.ROFstID;
displayRO.MyROFST = SelectedROFst; // need this to update RO Tree after UpdateRofst (B2015-226)
displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI);
displayRO.RefreshRoTree();
}
} }
// need this to update RO Tree after UpdateRofst (B2015-226)
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.MyROFST = SelectedROFst;
displayRO.LoadTree();
} }
if (SelectedStepTabPanel != null && SelectedStepTabPanel.MyStepTabRibbon != null) if (SelectedStepTabPanel != null && SelectedStepTabPanel.MyStepTabRibbon != null)
SelectedStepTabPanel.MyStepTabRibbon.SetUpdRoValBtn(SelectedStepTabPanel.MyStepTabRibbon.NewerRoFst()); SelectedStepTabPanel.MyStepTabRibbon.SetUpdRoValBtn(SelectedStepTabPanel.MyStepTabRibbon.NewerRoFst());
// C2015-022 needed when creating a separate window from a tree selection // C2015-022 needed when creating a separate window from a tree selection
if (selectedChildWindow != null) if (selectedChildWindow != null)
{ {
@ -1098,12 +1110,14 @@ namespace VEPROMS
selectedChildWindow = null; selectedChildWindow = null;
} }
} }
// Add a tree node for a procedure if this is the first procedure in the docversion, added from // Add a tree node for a procedure if this is the first procedure in the docversion, added from
// step editor (used for creating enhanced procedure in empty docversion) // step editor (used for creating enhanced procedure in empty docversion)
void MyStepTabRibbon_AddProcToDocVersionInTree(object sender, StepTabRibbonEventArgs args) void MyStepTabRibbon_AddProcToDocVersionInTree(object sender, StepTabRibbonEventArgs args)
{ {
tv.AdjustTree(args.Proc as ProcedureInfo); tv.AdjustTree(args.Proc as ProcedureInfo);
} }
void MyStepTabRibbon_PrintRequest(object sender, StepTabRibbonEventArgs args) void MyStepTabRibbon_PrintRequest(object sender, StepTabRibbonEventArgs args)
{ {
// Fix for B2013-173: // Fix for B2013-173:
@ -1129,6 +1143,7 @@ namespace VEPROMS
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
//end added by jcb 20130718 //end added by jcb 20130718
} }
void displaySearch1_PrintRequest(object sender, DisplaySearchEventArgs args) void displaySearch1_PrintRequest(object sender, DisplaySearchEventArgs args)
{ {
// C2020-002 paper size is now set in the format files - default is Letter, pass this PDFReport // C2020-002 paper size is now set in the format files - default is Letter, pass this PDFReport
@ -1171,20 +1186,20 @@ namespace VEPROMS
{ {
Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\ROSummaryReport.pdf", args.RofstLookup, args.ROListForReport, args.PaperSize); Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\ROSummaryReport.pdf", args.RofstLookup, args.ROListForReport, args.PaperSize);
myReport.Build(); myReport.Build();
} }
} }
bool tv_InsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args) bool tv_InsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args)
{ {
// Don't select the newly created Step. This will be handled by tmrTreeView // Don't select the newly created Step. This will be handled by tmrTreeView
return tc.InsertRTBItem(args.MyItemInfo, args.StepText, args.InsertType, args.FromType, args.Type, false); return tc.InsertRTBItem(args.MyItemInfo, args.StepText, args.InsertType, args.FromType, args.Type, false);
} }
private bool tv_DeleteItemInfo(object sender, vlnTreeItemInfoEventArgs args) private bool tv_DeleteItemInfo(object sender, vlnTreeItemInfoEventArgs args)
{ {
if (displayHistory.MyEditItem != null && displayHistory.MyItemInfo.MyProcedure.ItemID == args.MyItemInfo.ItemID) if (displayHistory.MyEditItem != null && displayHistory.MyItemInfo.MyProcedure.ItemID == args.MyItemInfo.ItemID)
displayHistory.MyEditItem = null; displayHistory.MyEditItem = null;
// bug fix B2016-005 - set MyCopyStep to null. This will take the paste options off of the tree node context menus. jsj 4-19-2016 // bug fix B2016-005 - set MyCopyStep to null. This will take the paste options off of the tree node context menus. jsj 4-19-2016
// B2016-105 - added null reference check -jsj // B2016-105 - added null reference check -jsj
if (tc.MyCopyStep != null && args.MyItemInfo.ItemID == tc.MyCopyStep.ItemID) if (tc.MyCopyStep != null && args.MyItemInfo.ItemID == tc.MyCopyStep.ItemID)
@ -1192,20 +1207,24 @@ namespace VEPROMS
tc.MyCopyStep = null; tc.MyCopyStep = null;
tc_CopyStepSelected(sender, null); // C2015-022 update copystep info in the child windows tc_CopyStepSelected(sender, null); // C2015-022 update copystep info in the child windows
} }
bool rtval = tc.DeleteRTBItem(args.MyItemInfo); bool rtval = tc.DeleteRTBItem(args.MyItemInfo);
// Also disable the paste options on the ribbon if it is open. jsj 4-19-2016 // Also disable the paste options on the ribbon if it is open. jsj 4-19-2016
if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel != null) // MyStepTabPanel will be null if the active tab is a Word Attachment if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel != null) // MyStepTabPanel will be null if the active tab is a Word Attachment
{ {
StepPanel pnl = tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepPanel; StepPanel pnl = tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepPanel;
if (pnl != null) if (pnl != null) pnl.MyStepTabPanel.MyStepTabRibbon.SetPasteButtons(false);
pnl.MyStepTabPanel.MyStepTabRibbon.SetPasteButtons(false);
} }
return rtval; return rtval;
} }
private bool tv_PasteItemInfo(object sender, vlnTreeItemInfoPasteEventArgs args) private bool tv_PasteItemInfo(object sender, vlnTreeItemInfoPasteEventArgs args)
{ {
return tc.PasteRTBItem(args.MyItemInfo, args.CopyStartID, args.PasteType, (int)args.Type); return tc.PasteRTBItem(args.MyItemInfo, args.CopyStartID, args.PasteType, (int)args.Type);
} }
// C2020-033: Display the search panel with Incoming Transition info for the tree view // C2020-033: Display the search panel with Incoming Transition info for the tree view
// and for the editor. // and for the editor.
private ItemInfo tv_SearchIncTrans(object sender, vlnTreeItemInfoEventArgs args) private ItemInfo tv_SearchIncTrans(object sender, vlnTreeItemInfoEventArgs args)
@ -1215,6 +1234,7 @@ namespace VEPROMS
displaySearch1.UpdateSearchIncTransResults(); displaySearch1.UpdateSearchIncTransResults();
return args.MyItemInfo; return args.MyItemInfo;
} }
private ItemInfo tc_SearchIncTrans(object sender, vlnTreeItemInfoEventArgs args) private ItemInfo tc_SearchIncTrans(object sender, vlnTreeItemInfoEventArgs args)
{ {
displaySearch1.SearchIncTransII = args.MyItemInfo; displaySearch1.SearchIncTransII = args.MyItemInfo;
@ -1222,9 +1242,11 @@ namespace VEPROMS
displaySearch1.UpdateSearchIncTransResults(); displaySearch1.UpdateSearchIncTransResults();
return args.MyItemInfo; return args.MyItemInfo;
} }
private bool _RemoveFromPROMSWindowForms = true; private bool _RemoveFromPROMSWindowForms = true;
public bool ClosingWithError = false; // B2019-098: prevent looping between error & exit dialog public bool ClosingWithError = false; // B2019-098: prevent looping between error & exit dialog
private bool _WeAreExitingPROMS = false; // B2019-101 if exiting PROMS from main window don't prompt on each child window (separate windows) private bool _WeAreExitingPROMS = false; // B2019-101 if exiting PROMS from main window don't prompt on each child window (separate windows)
private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e) private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e)
{ {
// B2017-212 If the user uses the X button in Word to close the word attachment, PROMS thinks that the user wants to close out of PROMS as well // B2017-212 If the user uses the X button in Word to close the word attachment, PROMS thinks that the user wants to close out of PROMS as well
@ -1243,6 +1265,7 @@ namespace VEPROMS
dctoe.Close(); dctoe.Close();
return; return;
} }
string stk = Volian.Base.Library.vlnStackTrace.StackToString(); string stk = Volian.Base.Library.vlnStackTrace.StackToString();
if (!stk.Contains("Exception")) if (!stk.Contains("Exception"))
{ {
@ -1271,19 +1294,22 @@ namespace VEPROMS
} }
//C2015-022 Separate Windows - if child windows are open and we are closing the main PROMS window, give user a chance to not close PROMS and that child windows //C2015-022 Separate Windows - if child windows are open and we are closing the main PROMS window, give user a chance to not close PROMS and that child windows
// B2019-101 if we are exiting from PROMS main window no need to prompt user about child windows. // B2019-101 if we are exiting from PROMS main window no need to prompt user about child windows.
if (MyParent == null && PROMSWindowForms.Count > 0 && !_WeAreExitingPROMS) if (MyParent == null && PROMSWindowForms.Count > 0 && !_WeAreExitingPROMS)?
{ {
DialogResult dr = MessageBox.Show("Close all of the child windows and exit PROMS?", "Exit PROMS", MessageBoxButtons.YesNo); DialogResult dr = MessageBox.Show("Close all of the child windows and exit PROMS?", "Exit PROMS", MessageBoxButtons.YesNo);?
if (dr == System.Windows.Forms.DialogResult.No) if (dr == System.Windows.Forms.DialogResult.No)
{ {
e.Cancel = true; e.Cancel = true;
return; return;
} }
} }
tc.ShuttingDown = true; // This keeps PROMS from Hanging under certain circumstances tc.ShuttingDown = true; // This keeps PROMS from Hanging under certain circumstances
// B2019-161 When shutting down output the timing information (to the error log) // B2019-161 When shutting down output the timing information (to the error log)
if (VolianTimer.TimingsOn) if (VolianTimer.TimingsOn)
VolianTimer.ShowTimers(); VolianTimer.ShowTimers();
foreach (DisplayTabItem dti in tc.MyBar.Items) foreach (DisplayTabItem dti in tc.MyBar.Items)
{ {
if (dti.MyDSOTabPanel != null) if (dti.MyDSOTabPanel != null)
@ -1291,6 +1317,7 @@ namespace VEPROMS
else else
MySessionInfo.CheckInItem(dti.OwnerID); //C2015-022 Separate Windows closing child form only left procedure ownership active MySessionInfo.CheckInItem(dti.OwnerID); //C2015-022 Separate Windows closing child form only left procedure ownership active
} }
//_MyLog.WarnFormat("frmVEPROMS_FormClosing"); //_MyLog.WarnFormat("frmVEPROMS_FormClosing");
if (MyParent == null) if (MyParent == null)
{ {
@ -1299,6 +1326,7 @@ namespace VEPROMS
MyActivityTimer.Dispose(); MyActivityTimer.Dispose();
_MyLog.Debug("VEPROMS FormClosing - dispose timer"); _MyLog.Debug("VEPROMS FormClosing - dispose timer");
} }
// part of separate windows upgrade C2015-022 // part of separate windows upgrade C2015-022
// close all of the child windows before closing the main PROMS window // close all of the child windows before closing the main PROMS window
if (PROMSWindowForms != null && PROMSWindowForms.Count > 0) if (PROMSWindowForms != null && PROMSWindowForms.Count > 0)
@ -1313,28 +1341,35 @@ namespace VEPROMS
child.MySessionInfo.EndSession(); child.MySessionInfo.EndSession();
} }
} }
if (MySessionInfo != null) MySessionInfo.EndSession(); if (MySessionInfo != null) MySessionInfo.EndSession();
// Save the location and size of the VE-PROMS appication for this user // Save the location and size of the VE-PROMS appication for this user
if (this.WindowState == FormWindowState.Normal) if (this.WindowState == FormWindowState.Normal)
{ {
Settings.Default.Location = this.Location; Settings.Default.Location = this.Location;
Settings.Default.Size = this.Size; Settings.Default.Size = this.Size;
} }
if (this.MyVersionWindowList != null) if (this.MyVersionWindowList != null)
Settings.Default.VersionWindows = this.MyVersionWindowList.ToSettings(); Settings.Default.VersionWindows = this.MyVersionWindowList.ToSettings();
Settings.Default.WindowState = this.WindowState; Settings.Default.WindowState = this.WindowState;
Settings.Default.QATItems = ribbonControl1.QatLayout; Settings.Default.QATItems = ribbonControl1.QatLayout;
SaveMRU(); SaveMRU();
//Settings.Default.Save(); //Settings.Default.Save();
Volian.Base.Library.DebugPagination.Close(); Volian.Base.Library.DebugPagination.Close();
Volian.Base.Library.DebugText.Close(); Volian.Base.Library.DebugText.Close();
Volian.Base.Library.BaselineMetaFile.Close(); // C2018-004 create meta file for baseline compares Volian.Base.Library.BaselineMetaFile.Close(); // C2018-004 create meta file for baseline compares
} }
} }
void frmVEPROMS_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) void frmVEPROMS_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e)
{ {
// Close any open documents // Close any open documents
tc.Dispose(); tc.Dispose();
// RHM 20121010 // RHM 20121010
// Something was causing the process to remain in memory for an extended period of time // Something was causing the process to remain in memory for an extended period of time
// after printing procedures. The following lines kills the process immediately. // after printing procedures. The following lines kills the process immediately.
@ -1350,6 +1385,7 @@ namespace VEPROMS
} }
} }
} }
// Get the "Procedures" Panel Heading (title). // Get the "Procedures" Panel Heading (title).
// by default the heading is "Procedures" (handled in the getting from the config) // by default the heading is "Procedures" (handled in the getting from the config)
// the heading is stored in the "title" field of the folder config. // the heading is stored in the "title" field of the folder config.
@ -1362,6 +1398,7 @@ namespace VEPROMS
else else
return jj_vetn.Text; // C2018-029 return the child window's procedure set name return jj_vetn.Text; // C2018-029 return the child window's procedure set name
} }
private int getTimeout() private int getTimeout()
{ {
VETreeNode jj_vetn = (VETreeNode)tv.Nodes[0]; // the VEPROMS tree node VETreeNode jj_vetn = (VETreeNode)tv.Nodes[0]; // the VEPROMS tree node
@ -1399,6 +1436,8 @@ namespace VEPROMS
void _RefreshTimer_Tick(object sender, EventArgs e) void _RefreshTimer_Tick(object sender, EventArgs e)
{ {
//_MyLog.DebugFormat("_RefreshTimer_Tick {0}", RefreshTimerActive); //_MyLog.DebugFormat("_RefreshTimer_Tick {0}", RefreshTimerActive);
if (RefreshTimerActive) if (RefreshTimerActive)
{ {
_TimeActivity.Open(); _TimeActivity.Open();
@ -1407,6 +1446,7 @@ namespace VEPROMS
RefreshChanged(this); RefreshChanged(this);
_TimeActivity.Close(); _TimeActivity.Close();
} }
} }
private void btnStepRTF_Click(object sender, System.EventArgs e) private void btnStepRTF_Click(object sender, System.EventArgs e)
@ -1416,32 +1456,21 @@ namespace VEPROMS
{ {
PingSession(null); PingSession(null);
StartRefreshChanged(null); StartRefreshChanged(null);
//RefreshChanged(null);
//if (tc.MyStepRTB != null)
//{
// StepConfig sc = new StepConfig(tc.MyStepRTB.MyItemInfo.MyContent.Config);
// if (sc.Step_SourceToBackground != null)
// OpenMyItem(sc.Step_SourceToBackground);
// if(sc.Step_BackgroundToSource != null)
// OpenMyItem(sc.Step_BackgroundToSource);
//frmStepRTF frm = new frmStepRTF();
//frm.MyStepRTB = tc.MyStepRTB;
//frm.Show();
//}
} }
} }
private SessionInfo _MySessionInfo; private SessionInfo _MySessionInfo;
public SessionInfo MySessionInfo public SessionInfo MySessionInfo
{ {
get { get
{
if (_MySessionInfo == null && MyParent != null)// B2017-152 Don't crash if MySessionInfo is null if (_MySessionInfo == null && MyParent != null)// B2017-152 Don't crash if MySessionInfo is null
_MySessionInfo = MyParent.MySessionInfo; _MySessionInfo = MyParent.MySessionInfo;
return _MySessionInfo; return _MySessionInfo;
} }
set { _MySessionInfo = value; } set { _MySessionInfo = value; }
} }
private System.Threading.Timer MyActivityTimer; private System.Threading.Timer MyActivityTimer;
//private System.Threading.Timer MyRefreshTimer; //private System.Threading.Timer MyRefreshTimer;
private DevComponents.DotNetBar.ButtonItem btnManageSecurity; private DevComponents.DotNetBar.ButtonItem btnManageSecurity;
@ -1453,10 +1482,12 @@ namespace VEPROMS
private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsExport; private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsExport;
private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsImport; private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsImport;
private TabItemsToClose _MyCloseTabList = new TabItemsToClose(); private TabItemsToClose _MyCloseTabList = new TabItemsToClose();
public TabItemsToClose MyCloseTabList public TabItemsToClose MyCloseTabList
{ {
get { return _MyCloseTabList; } get { return _MyCloseTabList; }
} }
private bool _DisablePing = false; private bool _DisablePing = false;
public bool DisablePing public bool DisablePing
{ {
@ -1467,6 +1498,7 @@ namespace VEPROMS
//_MyLog.WarnFormat("DisableSessionPing = {0}", value); //_MyLog.WarnFormat("DisableSessionPing = {0}", value);
} }
} }
private void PingSession(Object obj) private void PingSession(Object obj)
{ {
MySemaphore.WaitOne(); MySemaphore.WaitOne();
@ -1485,6 +1517,7 @@ namespace VEPROMS
} }
MySemaphore.Release(); MySemaphore.Release();
} }
WindowsFormsSynchronizationContext mUIContext = new WindowsFormsSynchronizationContext(); WindowsFormsSynchronizationContext mUIContext = new WindowsFormsSynchronizationContext();
public void MyFindNodeAndExpand(object obj) public void MyFindNodeAndExpand(object obj)
{ {
@ -1509,6 +1542,7 @@ namespace VEPROMS
} }
MySemaphore.Release(); // ping session control MySemaphore.Release(); // ping session control
} }
private void StartRefreshChanged(Object obj) private void StartRefreshChanged(Object obj)
{ {
//_MyLog.Debug("StartRefreshChanged"); //_MyLog.Debug("StartRefreshChanged");
@ -1517,6 +1551,7 @@ namespace VEPROMS
RefreshTimerActive = !PauseRefresh; RefreshTimerActive = !PauseRefresh;
MySemaphore.Release(); MySemaphore.Release();
} }
private void RefreshChanged(Object obj) private void RefreshChanged(Object obj)
{ {
//if (SkipRefresh) return; //if (SkipRefresh) return;
@ -1536,8 +1571,10 @@ namespace VEPROMS
MyFindNodeAndExpand(id); MyFindNodeAndExpand(id);
} }
} }
// B2017-247 Error Handler for Ping Session // B2017-247 Error Handler for Ping Session
if (MySessionInfo.ChangedContents != null && MySessionInfo.ChangedContents.Count > 0) if (MySessionInfo.ChangedContents != null && MySessionInfo.ChangedContents.Count > 0)
{
foreach (int id in MySessionInfo.ChangedContents.Keys) foreach (int id in MySessionInfo.ChangedContents.Keys)
{ {
if (ContentInfo.IsInCache(id)) if (ContentInfo.IsInCache(id))
@ -1554,20 +1591,23 @@ namespace VEPROMS
} }
lastChanged = MySessionInfo.ChangedContents[id]; lastChanged = MySessionInfo.ChangedContents[id];
} }
}
MySessionInfo.ChangedItems.Clear(); MySessionInfo.ChangedItems.Clear();
MySessionInfo.ChangedContents.Clear(); MySessionInfo.ChangedContents.Clear();
if (lastChanged > 0) if (lastChanged > 0)
{ {
MySessionInfo.LastContentChange = lastChanged; MySessionInfo.LastContentChange = lastChanged;
RefreshLastChange(); RefreshLastChange();
} }
} }
catch catch { }
{
}
//MySemaphore.Release(); //MySemaphore.Release();
//_MyLog.DebugFormat("{0},{1:X},{2:X},{3:X}", DateTime.Now.ToLongTimeString(), lastChanged, MySessionInfo.LastContentChange, MySessionInfo.LastChangedInt64); //_MyLog.DebugFormat("{0},{1:X},{2:X},{3:X}", DateTime.Now.ToLongTimeString(), lastChanged, MySessionInfo.LastContentChange, MySessionInfo.LastChangedInt64);
} }
private int TotalCount(TreeNodeCollection tns) private int TotalCount(TreeNodeCollection tns)
{ {
int total = tns.Count; int total = tns.Count;
@ -1575,6 +1615,7 @@ namespace VEPROMS
total += TotalCount(tn.Nodes); total += TotalCount(tn.Nodes);
return total; return total;
} }
private bool ByteArrayIsEmpty(byte[] myArray) private bool ByteArrayIsEmpty(byte[] myArray)
{ {
for (int i = 0; i < myArray.Length; i++) for (int i = 0; i < myArray.Length; i++)
@ -1594,6 +1635,7 @@ namespace VEPROMS
public Timer tmrCloseTabItems; public Timer tmrCloseTabItems;
public System.Threading.Semaphore MySemaphore = new System.Threading.Semaphore(1, 1); public System.Threading.Semaphore MySemaphore = new System.Threading.Semaphore(1, 1);
private bool _frmVEPROMSloading = false; private bool _frmVEPROMSloading = false;
private void frmVEPROMS_Load(object sender, EventArgs e) private void frmVEPROMS_Load(object sender, EventArgs e)
{ {
// B2019-116 Use Volian.Base.Library.VlnItextFont // B2019-116 Use Volian.Base.Library.VlnItextFont
@ -1813,6 +1855,7 @@ namespace VEPROMS
if (this.txtSearch.Text.Length > 0 && !this.txtSearch.Text.Contains("\r\n")) if (this.txtSearch.Text.Length > 0 && !this.txtSearch.Text.Contains("\r\n"))
CurrentID = txtSearch.Text; CurrentID = txtSearch.Text;
} }
} }
void tc_RefreshEnhancedDocument(object sender, ItemSelectedChangedEventArgs args) void tc_RefreshEnhancedDocument(object sender, ItemSelectedChangedEventArgs args)
{ {
@ -1874,12 +1917,6 @@ namespace VEPROMS
if (i == 0)// Turn-on Change Manger if there are no active Sessions if (i == 0)// Turn-on Change Manger if there are no active Sessions
TurnChangeManagerOn.Execute(); TurnChangeManagerOn.Execute();
} }
//public bool IsEnhancedDocumentOpen(ItemInfo ii)
//{
// if (tc.dicEnhancedDocuments.ContainsKey(ii.MyProcedure))
// return true;
// return false;
//}
// C2015-022 Separate Windows. This is a dictionary of child PROMS windows forms (frmVEPROMS) // C2015-022 Separate Windows. This is a dictionary of child PROMS windows forms (frmVEPROMS)
// //
@ -2052,6 +2089,7 @@ namespace VEPROMS
OpenMyItem(value); OpenMyItem(value);
} }
} }
private string FindNextLine() private string FindNextLine()
{ {
if (txtSearch.SelectionLength > 0) if (txtSearch.SelectionLength > 0)
@ -2065,6 +2103,7 @@ namespace VEPROMS
} }
return null; return null;
} }
private string FindPreviousLine() private string FindPreviousLine()
{ {
if (txtSearch.SelectionLength > 0) if (txtSearch.SelectionLength > 0)
@ -2082,6 +2121,7 @@ namespace VEPROMS
txtSearch.ScrollToCaret(); txtSearch.ScrollToCaret();
return GetCurrentLine(); return GetCurrentLine();
} }
void txtSearch_KeyUp(object sender, KeyEventArgs e) void txtSearch_KeyUp(object sender, KeyEventArgs e)
{ {
if (e.Control && e.KeyCode == Keys.V) if (e.Control && e.KeyCode == Keys.V)
@ -2103,6 +2143,7 @@ namespace VEPROMS
e.Handled = true; e.Handled = true;
} }
} }
private string GetCurrentLine() private string GetCurrentLine()
{ {
while (txtSearch.SelectionStart > 0 && txtSearch.Text[txtSearch.SelectionStart - 1] != '\n') while (txtSearch.SelectionStart > 0 && txtSearch.Text[txtSearch.SelectionStart - 1] != '\n')
@ -2111,6 +2152,7 @@ namespace VEPROMS
if (sub.Contains("\r\n")) return sub.Substring(0, sub.IndexOf("\r\n")); if (sub.Contains("\r\n")) return sub.Substring(0, sub.IndexOf("\r\n"));
return sub; return sub;
} }
void txtSearch_KeyPress(object sender, KeyPressEventArgs e) // used when running in debug mode, for text box where you enter an ItemID or ContextID number void txtSearch_KeyPress(object sender, KeyPressEventArgs e) // used when running in debug mode, for text box where you enter an ItemID or ContextID number
{ {
if (e.KeyChar == '\r') if (e.KeyChar == '\r')
@ -2137,7 +2179,7 @@ namespace VEPROMS
{ {
DisplayTabItem dti = tc.OpenItem(ii);// B2018-035 Allow procedure to be printed and property grid to be opened DisplayTabItem dti = tc.OpenItem(ii);// B2018-035 Allow procedure to be printed and property grid to be opened
// B2019-003: was crashing if another user was in same procedure (dti would have been null because procedure could not be opened): // B2019-003: was crashing if another user was in same procedure (dti would have been null because procedure could not be opened):
if (dti == null) return; if (dti == null) return;?
SelectedStepTabPanel = dti.MyStepTabPanel; SelectedStepTabPanel = dti.MyStepTabPanel;
tc.SelectedDisplayTabItem = dti; tc.SelectedDisplayTabItem = dti;
@ -2177,6 +2219,8 @@ namespace VEPROMS
} }
private static VolianTimer _TimeActivity1 = new VolianTimer("frmVEPROMS.cs tmrCloseTabItems_Tick", 2108); private static VolianTimer _TimeActivity1 = new VolianTimer("frmVEPROMS.cs tmrCloseTabItems_Tick", 2108);
private static VolianTimer _TimeActivity1 = new VolianTimer("frmVEPROMS.cs tmrCloseTabItems_Tick", 2108);
void tmrCloseTabItems_Tick(object sender, EventArgs e) void tmrCloseTabItems_Tick(object sender, EventArgs e)
{ {
_TimeActivity1.Open(); _TimeActivity1.Open();
@ -2257,11 +2301,13 @@ namespace VEPROMS
lblUser.Text = VlnSettings.UserID; lblUser.Text = VlnSettings.UserID;
lblUser.MouseDown += new MouseEventHandler(lblUser_MouseDown); lblUser.MouseDown += new MouseEventHandler(lblUser_MouseDown);
} }
private string GetSecurityKey() private string GetSecurityKey()
{ {
Random rnd = new Random(DateTime.Now.Year + DateTime.Now.DayOfYear * 1000); Random rnd = new Random(DateTime.Now.Year + DateTime.Now.DayOfYear * 1000);
return rnd.Next(10000).ToString(); return rnd.Next(10000).ToString();
} }
void lblUser_MouseDown(object sender, MouseEventArgs e) void lblUser_MouseDown(object sender, MouseEventArgs e)
{ {
if (e.Button == MouseButtons.Right) if (e.Button == MouseButtons.Right)
@ -2719,6 +2765,7 @@ namespace VEPROMS
{ {
_ExpandingTree = false; _ExpandingTree = false;
} }
void tv_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) void tv_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{ {
if (_ExpandingTree) if (_ExpandingTree)
@ -2853,7 +2900,7 @@ namespace VEPROMS
toolsPanel.Expanded = true; toolsPanel.Expanded = true;
toolsTabs.SelectedTab = toolstabResults; toolsTabs.SelectedTab = toolstabResults;
} }
if (frmver._refreshProcedureList) tv.RefreshDocVersion(); //B2021-066: Refresh Procedure Numbers if Working Draft (docversion) applicability change if (frmver._refreshProcedureList) tv.RefreshDocVersion(); //B2021-066: Refresh Procedure Numbers if Working Draft (docversion) applicability change?
MySessionInfo.CheckInItem(ownerID); MySessionInfo.CheckInItem(ownerID);
} }
else if (args.ProcedureConfig != null) else if (args.ProcedureConfig != null)
@ -3222,22 +3269,26 @@ namespace VEPROMS
this.Close(); this.Close();
} }
#endregion #endregion
#region InfoTabRO #region InfoTabRO
private void infotabRO_Click(object sender, EventArgs e) private void infotabRO_Click(object sender, EventArgs e)
{ {
infoPanel.Expanded = true; infoPanel.Expanded = true;
infoTabs.SelectedTab = infotabRO; infoTabs.SelectedTab = infotabRO;
//if (dtp == null) return;
//displayRO.Mydvi = SelectedDVI; displayRO.ProgressBar = bottomProgBar;
displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI);
displayRO.MyRTB = (SelectedStepTabPanel == null) ? null : displayRO.MyRTB = (SelectedStepTabPanel == null) ? null :
SelectedStepTabPanel.MyStepPanel.SelectedEditItem == null ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; SelectedStepTabPanel.MyStepPanel.SelectedEditItem == null ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.ProgressBar = bottomProgBar;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code displayRO.LoadTree(); //B2022-026 RO Memory reduction coding (Jakes Merge)
} }
#endregion #endregion
#region InfoTabTransition #region InfoTabTransition
private void infotabTransition_Click(object sender, EventArgs e) private void infotabTransition_Click(object sender, EventArgs e)
{ {
if (tc == null || tc.SelectedDisplayTabItem == null) return; if (tc == null || tc.SelectedDisplayTabItem == null) return;
@ -3327,6 +3378,7 @@ namespace VEPROMS
private void tc_PanelTabDisplay(object sender, StepPanelTabDisplayEventArgs args) private void tc_PanelTabDisplay(object sender, StepPanelTabDisplayEventArgs args)
{ {
if (_SelectedDVI == null) return; if (_SelectedDVI == null) return;
if (args.PanelTabName == "Bookmarks") if (args.PanelTabName == "Bookmarks")
{ {
toolsPanel.Expanded = true; toolsPanel.Expanded = true;
@ -3376,21 +3428,23 @@ namespace VEPROMS
else if (args.PanelTabName == "DisplayROUpdateROFST") else if (args.PanelTabName == "DisplayROUpdateROFST")
{ {
_SelectedROFst = null; _SelectedROFst = null;
displayRO.MyROFST = SelectedROFst; // need this to update RO Tree after UpdateRofst (B2015-226)
displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI); // need this to update RO Tree after UpdateRofst (B2015-226)
displayRO.RefreshRoTree(); // B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.MyROFST = SelectedROFst;
displayRO.LoadTree();
// resetting the MyROFSTLookup for the search & reports panels will refresh the RO trees after UpdateRofst in each of those panels (B2015-226) // resetting the MyROFSTLookup for the search & reports panels will refresh the RO trees after UpdateRofst in each of those panels (B2015-226)
if (SelectedDVI != null) if (SelectedDVI != null)
{ {
displaySearch1.MyROFSTLookup = SelectedDVI.DocVersionAssociations[0].MyROFst.GetROFSTLookup(SelectedDVI); displaySearch1.MyROFSTLookup = SelectedDVI.DocVersionAssociations[0].MyROFst.GetROFSTLookup(SelectedDVI);
displayReports.MyROFSTLookup = SelectedDVI.DocVersionAssociations[0].MyROFst.GetROFSTLookup(SelectedDVI); displayReports.Mydocversion = SelectedDVI; // B2022-026 RO Memory reduction coding (Jakes Merge)
} }
} }
} }
private void tc_SelectedDisplayTabItemChanged(object sender, EventArgs args) 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 (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. // If the current procedure or section in the treeview doesn't match then change the treeview selection.
//jcb added for error B2012-117 //jcb added for error B2012-117
ItemInfo tvii; ItemInfo tvii;
@ -3398,8 +3452,10 @@ namespace VEPROMS
tvii = null; tvii = null;
else else
tvii = ((tv.SelectedNode as VETreeNode).VEObject) as ItemInfo; tvii = ((tv.SelectedNode as VETreeNode).VEObject) as ItemInfo;
if (tc.SelectedDisplayTabItem == null) return; if (tc.SelectedDisplayTabItem == null) return;
if (tc.SelectedDisplayTabItem.MyItemInfo == null) return; // library document. if (tc.SelectedDisplayTabItem.MyItemInfo == null) return; // library document.
if (tc.SelectedDisplayTabItem.MyItemInfo.IsProcedure) if (tc.SelectedDisplayTabItem.MyItemInfo.IsProcedure)
{ {
if (tvii == null || tvii.IsSection || tc.SelectedDisplayTabItem.MyItemInfo.ItemID != tvii.MyProcedure.ItemID) if (tvii == null || tvii.IsSection || tc.SelectedDisplayTabItem.MyItemInfo.ItemID != tvii.MyProcedure.ItemID)
@ -3418,16 +3474,26 @@ namespace VEPROMS
SetCaption(tv.SelectedNode as VETreeNode); SetCaption(tv.SelectedNode as VETreeNode);
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem; displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
{ {
displayRO.MyROFSTLookup = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion); displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
} }
else
{
displayRO.MyROFST = null;
}
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.LoadTree();
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole; lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.MultiUnitCount > 1) if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.MultiUnitCount > 1)
btnPrint.Visible = false; btnPrint.Visible = false;
else else
btnPrint.Visible = true; btnPrint.Visible = true;
// Reset the ribbon buttons B2016-148 (ex. a copystep done in a different procedure tab my require the paste step options to be active // Reset the ribbon buttons B2016-148 (ex. a copystep done in a different procedure tab my require the paste step options to be active
if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel != null) // MyStepTabPanel will be null if the active tab is a Word Attachment if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel != null) // MyStepTabPanel will be null if the active tab is a Word Attachment
{ {
@ -3444,6 +3510,7 @@ namespace VEPROMS
} }
} }
} }
private void tc_StepPanelModeChange(object sender, StepRTBModeChangeEventArgs args) private void tc_StepPanelModeChange(object sender, StepRTBModeChangeEventArgs args)
{ {
this.lblEditView.Text = args.ViewMode == E_ViewMode.Edit ? "Edit" : "View"; this.lblEditView.Text = args.ViewMode == E_ViewMode.Edit ? "Edit" : "View";
@ -3455,6 +3522,7 @@ namespace VEPROMS
if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel != null && tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepTabRibbon != null) if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel != null && tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepTabRibbon != null)
tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.ToggleFindReplaceToolTip(args.ViewMode == E_ViewMode.View); tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.ToggleFindReplaceToolTip(args.ViewMode == E_ViewMode.View);
} }
private ItemInfo _CurrentItem = null; private ItemInfo _CurrentItem = null;
private StepRTB _LastStepRTB = null; private StepRTB _LastStepRTB = null;
//private Timer _TmrRefreshItem = null; //private Timer _TmrRefreshItem = null;
@ -3531,10 +3599,11 @@ namespace VEPROMS
if (args.MyItemInfo.MyDocVersion.DocVersionAssociations != null) if (args.MyItemInfo.MyDocVersion.DocVersionAssociations != null)
{ {
displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
displayRO.MyRTB = null;
infotabRO.Visible = true; infotabRO.Visible = true;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.MyRTB = null;
displayRO.LoadTree();
} }
infotabTags.Visible = false; infotabTags.Visible = false;
@ -3552,6 +3621,7 @@ namespace VEPROMS
{ {
epAnnotations.Enabled = true; epAnnotations.Enabled = true;
ctrlAnnotationDetails.Enabled = true; ctrlAnnotationDetails.Enabled = true;
if (args.MyEditItem.MyItemInfo.IsSection || args.MyEditItem.MyItemInfo.IsProcedure) if (args.MyEditItem.MyItemInfo.IsSection || args.MyEditItem.MyItemInfo.IsProcedure)
{ {
infotabRO.Visible = false; // B2022-039 Do NOT allow ROs to be inserted in section or procedures // B2017-245 Allow Ro Menu to be seen for Procedures and Sections infotabRO.Visible = false; // B2022-039 Do NOT allow ROs to be inserted in section or procedures // B2017-245 Allow Ro Menu to be seen for Procedures and Sections
@ -3562,6 +3632,7 @@ namespace VEPROMS
else else
{ {
infotabTags.Visible = true; infotabTags.Visible = true;
if (_LastStepRTB != null) if (_LastStepRTB != null)
{ {
infotabRO.Visible = _LastStepRTB.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0; infotabRO.Visible = _LastStepRTB.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0;
@ -3573,13 +3644,16 @@ namespace VEPROMS
displayTransition.Enabled = _LastStepRTB.EditMode; displayTransition.Enabled = _LastStepRTB.EditMode;
} }
else else
{
infotabRO.Visible = infotabTransition.Visible = false; infotabRO.Visible = infotabTransition.Visible = false;
}
// When infotabTags is set to Visible, the matching panel also needs to be set to visible // When infotabTags is set to Visible, the matching panel also needs to be set to visible
// the other panels will appear as they are selected by the user. // the other panels will appear as they are selected by the user.
infotabControlPanelTags.Visible = true; infotabControlPanelTags.Visible = true;
displayTags.IsVisible = true; displayTags.IsVisible = true;
} }
infotabHistory.Visible = true; infotabHistory.Visible = true;
// C2021-027: Procedure level PC/PC // C2021-027: Procedure level PC/PC
// B2021-065: wasn't showing applicability tab for formats that didn't have procedure level flag. // B2021-065: wasn't showing applicability tab for formats that didn't have procedure level flag.
@ -3589,7 +3663,10 @@ namespace VEPROMS
displayApplicability.MyItemInfo = args.MyEditItem.MyItemInfo; displayApplicability.MyItemInfo = args.MyEditItem.MyItemInfo;
} }
else else
{
infotabApplicability.Visible = false; infotabApplicability.Visible = false;
}
if (args.MyEditItem.MyItemInfo.ActiveFormat != null) if (args.MyEditItem.MyItemInfo.ActiveFormat != null)
{ {
// see if format has floating foldouts, and if so, display the panel. // see if format has floating foldouts, and if so, display the panel.
@ -3602,29 +3679,33 @@ namespace VEPROMS
displayFoldoutMaint.MyItemInfo = args.MyItemInfo; displayFoldoutMaint.MyItemInfo = args.MyItemInfo;
} }
} }
// When infotabTags is set to Visible, it is given focus. The next line returns focus to the StepRTB // When infotabTags is set to Visible, it is given focus. The next line returns focus to the StepRTB
args.MyEditItem.SetFocus(); args.MyEditItem.SetFocus();
displayTransition.MyRTB = args.MyEditItem.MyStepRTB; displayTransition.MyRTB = args.MyEditItem.MyStepRTB;
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.ProgressBar = bottomProgBar;
displayRO.MyRTB = args.MyEditItem.MyStepRTB; displayRO.MyRTB = args.MyEditItem.MyStepRTB;
displayRO.LoadTree();
displayBookMarks.MyEditItem = args.MyEditItem; displayBookMarks.MyEditItem = args.MyEditItem;
displayHistory.MyEditItem = args.MyEditItem; displayHistory.MyEditItem = args.MyEditItem;
displayRO.ProgressBar = bottomProgBar;
lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View"; lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View";
_CurrentItem.Deleted += new ItemInfoEvent(_CurrentItem_Deleted); _CurrentItem.Deleted += new ItemInfoEvent(_CurrentItem_Deleted);
dlgFindReplace.MyEditItem = args.MyEditItem; dlgFindReplace.MyEditItem = args.MyEditItem;
SpellChecker.MyEditItem = args.MyEditItem; SpellChecker.MyEditItem = args.MyEditItem;
} }
if (args.MyEditItem != null) if (args.MyEditItem != null)
{ {
SelectedStepTabPanel = args.MyEditItem.MyStepPanel.MyStepTabPanel; SelectedStepTabPanel = args.MyEditItem.MyStepPanel.MyStepTabPanel;
displayTags.Mydvi = SelectedDVI; displayTags.Mydvi = SelectedDVI;
displayTags.MyEditItem = args.MyEditItem; displayTags.MyEditItem = args.MyEditItem;
displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ? 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; 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) if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0]; displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0];
@ -3632,35 +3713,29 @@ namespace VEPROMS
if (_LastStepRTB.IsRoFigure && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0) if (_LastStepRTB.IsRoFigure && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[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)
{
// originally had these two lines to make the step properties panel/tran & ro tabs invisitble for
// enhanced steps but this was causing an error in the caret management code in StepTabPanel (Hide/ShowCaret)
//infotabTransition.Visible = false;
//infotabRO.Visible = false;
// RHM: Had to use a timer to keep from getting into an infinite loop // B2022-026 RO Memory reduction coding (Jakes Merge)
// Not sure why , but tc_Leave was being called over and over again.
//KBR:TmrSetTransROInVisible.Enabled = true;
}
displayRO.SetFindDocROButton(false); displayRO.SetFindDocROButton(false);
displayRO.LoadTree();
} }
else else
{ {
SelectedDVI = args.MyItemInfo.MyDocVersion;
//B2017-244 Open RO Panel for MSWord Sections //B2017-244 Open RO Panel for MSWord Sections
if (args.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) if (args.MyItemInfo != null && args.MyItemInfo.MyDocVersion != null && args.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
{ {
displayRO.MyROFSTLookup = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(args.MyItemInfo.MyDocVersion);
displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
} }
// B2022-026 RO Memory reduction coding (Jakes Merge)
SelectedDVI = args.MyItemInfo.MyDocVersion;
displayRO.MyDvi = SelectedDVI;
displayRO.ROTypeFilter = E_ROValueType.All; // allow all RO types for Word attachments (but fix) 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); displayRO.SetFindDocROButton(true);
displayRO.LoadTree();
} }
} }
if (ctrlAnnotationDetails.Enabled && epAnnotations.Enabled) if (ctrlAnnotationDetails.Enabled && epAnnotations.Enabled)
{ {
ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem);
@ -3711,8 +3786,11 @@ namespace VEPROMS
{ {
//displayBookMarks.DeleteItemBookMarkPanel(_CurrentItem); //displayBookMarks.DeleteItemBookMarkPanel(_CurrentItem);
} }
#endregion #endregion
#region Annotations #region Annotations
/// <summary> /// <summary>
/// Display or hide the Annotation Details panel /// Display or hide the Annotation Details panel
/// </summary> /// </summary>
@ -3733,8 +3811,11 @@ namespace VEPROMS
ctrlAnnotationDetails.AnnotationText = null; ctrlAnnotationDetails.AnnotationText = null;
} }
} }
#endregion #endregion
#region LinkSupport #region LinkSupport
private void tc_LinkActiveChanged(object sender, StepPanelLinkEventArgs args) private void tc_LinkActiveChanged(object sender, StepPanelLinkEventArgs args)
{ {
// determine if any infotabs are visisble, and if it is the Transition, // determine if any infotabs are visisble, and if it is the Transition,
@ -3744,6 +3825,7 @@ namespace VEPROMS
displayTransition.CurTrans = null; displayTransition.CurTrans = null;
} }
} }
private void tc_LinkModifyTran(object sender, StepPanelLinkEventArgs args) private void tc_LinkModifyTran(object sender, StepPanelLinkEventArgs args)
{ {
infoPanel.Expanded = true; infoPanel.Expanded = true;
@ -3753,6 +3835,7 @@ namespace VEPROMS
displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayTransition.CurTrans = args.MyLinkText.MyTransitionInfo; displayTransition.CurTrans = args.MyLinkText.MyTransitionInfo;
} }
private void tc_LinkModifyRO(object sender, StepPanelLinkEventArgs args) private void tc_LinkModifyRO(object sender, StepPanelLinkEventArgs args)
{ {
if (_SelectedROFst == null && (SelectedDVI == null || SelectedDVI.DocVersionAssociationCount == 0)) return; // B2016-128, not RO path associated to the working draft if (_SelectedROFst == null && (SelectedDVI == null || SelectedDVI.DocVersionAssociationCount == 0)) return; // B2016-128, not RO path associated to the working draft
@ -3761,17 +3844,21 @@ namespace VEPROMS
infoPanel.Expanded = true; infoPanel.Expanded = true;
infoTabs.SelectedTab = infotabRO; infoTabs.SelectedTab = infotabRO;
displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI);
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ? 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; E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text;
//displayRO.Mydvi = SelectedDVI;
displayRO.ProgressBar = bottomProgBar; displayRO.ProgressBar = bottomProgBar;
displayRO.LoadTree(); // B2022-026 RO Memory Reduction code displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.LoadTree();
} }
#endregion #endregion
#region VButton #region VButton
private void office2007StartButton1_Click(object sender, EventArgs e) private void office2007StartButton1_Click(object sender, EventArgs e)
{ {
// If the V-Button is clicked, check to see what tree node is s selected // If the V-Button is clicked, check to see what tree node is s selected
@ -3783,7 +3870,7 @@ namespace VEPROMS
btnNew.Enabled = false; btnNew.Enabled = false;
// if focus is in the step editor, position in the tree view to match the location in the step editor // if focus is in the step editor, position in the tree view to match the location in the step editor
if (!tv.Focused && tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null) if (!tv.Focused && tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null)
tv.AdjustTree(tc.SelectedDisplayTabItem.SelectedItemInfo); tv.AdjustTree(tc.SelectedDisplayTabItem.SelectedItemInfo);?
VETreeNode vtn = tv.SelectedNode as VETreeNode; VETreeNode vtn = tv.SelectedNode as VETreeNode;
if (vtn == null) return; if (vtn == null) return;
@ -3888,7 +3975,7 @@ namespace VEPROMS
if (si.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) if (si.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections)
{ {
ButtonItem subbtn = new ButtonItem("subbtn", "SubSection"); ButtonItem subbtn = new ButtonItem("subbtn", "SubSection");
btnNew.SubItems.Add(subbtn); btnNew.SubItems.Add(subbtn);?
subbtn.Click += new EventHandler(subbtn_Click); subbtn.Click += new EventHandler(subbtn_Click);
} }
ButtonItem stpbtn = new ButtonItem("stpbtn", "New Step"); ButtonItem stpbtn = new ButtonItem("stpbtn", "New Step");

View File

@ -8,8 +8,9 @@ using System.Data.SqlClient;
using System.Linq; using System.Linq;
using Csla.Data; using Csla.Data;
using System.Threading;
using System.Threading.Tasks;
// B2022-026 New code for RO Memory reduction - now use SQL tables instead of building dictionarys to get RO values
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
@ -38,7 +39,7 @@ namespace VEPROMS.CSLA.Library
#region Enums #region Enums
[Flags] [Flags]
public enum SearchType public enum SearchTypes
{ {
StartsWith = 1, StartsWith = 1,
EndsWith = 2, EndsWith = 2,
@ -46,6 +47,15 @@ namespace VEPROMS.CSLA.Library
ExactMatch = 4 ExactMatch = 4
} }
public enum HeaderStatuses
{
Unknown = 0,
NotLoaded = 1,
InProgress = 2,
LoadComplete = 3,
LoadFailed = 4
}
#endregion #endregion
#region Structs / Internal Classes #region Structs / Internal Classes
@ -128,6 +138,7 @@ namespace VEPROMS.CSLA.Library
} }
}; };
#endregion #endregion
#region Fields #region Fields
@ -230,20 +241,39 @@ namespace VEPROMS.CSLA.Library
#region (RO Info) #region (RO Info)
public ROFSTLookup.rochild GetRoChild12(string ROID16, bool loadChildren = false, bool loadAllChildren = false) public bool HasChildren(ref ROFSTLookup.rochild child)
{ {
string ROID = (ROID16.Length < 12) ? ROID16 : ROID16.Substring(0, 12); LoadChildren(ref child);
return child.children.Any();
ROFSTLookup.rochild rc = RofstDataGetChildByRoid(_rofstID, ROID, loadChildren, loadAllChildren);
if (rc.ID <= 0 && ROID16.Length == 4)
{
rc.title = GetRODatabaseTitle(GetRODatabaseTitleIndex(ROID16));
} }
return rc; public bool HasChildren(ref ROFSTLookup.rodbi db)
{
LoadChildren(ref db);
return db.children.Any();
} }
public void LoadChildren(ref ROFSTLookup.rochild child)
{
// If Children is null then it hasn't been loaded yet
if (child.children == null || child.children.Length <= 0)
{
if (!string.IsNullOrEmpty(child.appid))
child = GetRoChild12(child.roid, true);
else
child.children = GetRoChildrenByRoid(child.roid, true);
}
}
public void LoadChildren(ref ROFSTLookup.rodbi db)
{
// If Children is null then it hasn't been loaded yet
if (db.children == null || db.children.Length <= 0)
db.children = GetRoChildrenByID(db.ID, db.dbiID, true);
}
public ROFSTLookup.rochild GetRoChild(string ROID, bool loadChildren = false, bool loadAllChildren = false) public ROFSTLookup.rochild GetRoChild(string ROID, bool loadChildren = false, bool loadAllChildren = false)
{ {
ROFSTLookup.rochild rc = new ROFSTLookup.rochild() { ID = -1 }; ROFSTLookup.rochild rc = new ROFSTLookup.rochild() { ID = -1 };
@ -280,6 +310,34 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
nextIDX = aplString.IndexOf(",UnitIdx", offsetIdx);
if (nextIDX == -1) nextIDX = aplString.IndexOf(" /APL>");
sb.Append(aplString.Substring(offsetIdx, nextIDX - offsetIdx));
lastIndex = m.Index + m.Length;
}
// B2022-018 append any remaining text
if (lastIndex < roval.Length)
{
sb.Append(roval.Substring(lastIndex));
}
return sb.ToString();
}
public List<string> GetROReturnValue(string roval)
{
_lstRoValues = new List<string>();
_multiRoValues = new List<string>();
_dicRoVars = new Dictionary<string, string>();
string tmp = ProcessRO(_myDocVersionInfo == null ? roval : _myDocVersionInfo.ProcessDocVersionSpecificInfo(roval), false);
if (!string.IsNullOrEmpty(tmp) && _lstRoValues.Count == 0) // was not a multiple return value
{
_lstRoValues.Add(tmp);
} }
return rc; return rc;
@ -392,22 +450,6 @@ namespace VEPROMS.CSLA.Library
return sb.ToString(); return sb.ToString();
} }
public List<string> GetROReturnValue(string roval)
{
_lstRoValues = new List<string>();
_multiRoValues = new List<string>();
_dicRoVars = new Dictionary<string, string>();
string tmp = ProcessRO(_myDocVersionInfo == null ? roval : _myDocVersionInfo.ProcessDocVersionSpecificInfo(roval), false);
if (!string.IsNullOrEmpty(tmp) && _lstRoValues.Count == 0) // was not a multiple return value
{
_lstRoValues.Add(tmp);
}
return _lstRoValues;
}
public string GetTranslatedRoValue(string ROID16, bool DoCaret, bool DoDOSSuperSubScript) public string GetTranslatedRoValue(string ROID16, bool DoCaret, bool DoDOSSuperSubScript)
{ {
string retval = GetRoValue(ROID16); string retval = GetRoValue(ROID16);
@ -425,6 +467,9 @@ namespace VEPROMS.CSLA.Library
return retval.Replace("\r\n", @"\par "); return retval.Replace("\r\n", @"\par ");
} }
public Dictionary<string, string> Search(string value, int searchTypeID, int? maxNumRecords = null) public Dictionary<string, string> Search(string value, int searchTypeID, int? maxNumRecords = null)
{ {
if (string.IsNullOrEmpty(value)) if (string.IsNullOrEmpty(value))
@ -523,7 +568,7 @@ namespace VEPROMS.CSLA.Library
rc = GetRoChild12(parentROID); rc = GetRoChild12(parentROID);
if (rc.ID > 0) sb.Insert(0, rc.title + " - "); if (rc.ID > 0) sb.Insert(0, rc.title + " - ");
} while (rc.ID > 0); } while (rc.ID > 0);?
return sb.ToString(); return sb.ToString();
} }
@ -641,6 +686,21 @@ namespace VEPROMS.CSLA.Library
#region (Database Calls) #region (Database Calls)
private bool RofstDataExists(int rofstID) private bool RofstDataExists(int rofstID)
{
int headerStatusID = RofstDataGetHeaderLoadStatus(rofstID);
while (headerStatusID == (int)HeaderStatuses.InProgress)
{
// Wait 5 sec(s) then Check Header Status Again
Thread.Sleep(5000);
headerStatusID = RofstDataGetHeaderLoadStatus(rofstID);
}
return (headerStatusID == (int)HeaderStatuses.LoadComplete); // false includes [NotLoaded = 1 || LoadFailed = 4 || Unknown = 0]
}
private int RofstDataGetHeaderLoadStatus(int rofstID)
{ {
try try
{ {
@ -650,17 +710,22 @@ namespace VEPROMS.CSLA.Library
{ {
cmd.CommandTimeout = Database.DefaultTimeout; cmd.CommandTimeout = Database.DefaultTimeout;
cmd.CommandType = CommandType.StoredProcedure; cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "vesp_RofstDataExists"; cmd.CommandText = "vesp_RofstDataGetHeaderRofstByID";
cmd.Parameters.Add(new SqlParameter("@RofstID", SqlDbType.Int)).Value = rofstID; cmd.Parameters.Add(new SqlParameter("@RofstID", SqlDbType.Int)).Value = rofstID;
return Convert.ToBoolean(cmd.ExecuteScalar()); using (SafeDataReader dr = new SafeDataReader(cmd.ExecuteReader()))
{
if (dr.Read()) return Convert.ToInt32(dr.GetValue("RofstHeaderStatusID"));
} }
} }
} }
return 0; // Unknown Status
}
catch (Exception ex) catch (Exception ex)
{ {
throw new DbCslaException("RofstData.vesp_RofstDataExists", ex); throw new DbCslaException("RofstData.vesp_RofstDataGetHeaderRofstByID", ex);
} }
} }
@ -759,6 +824,30 @@ namespace VEPROMS.CSLA.Library
} }
} }
private void RofstHeaderFinalizeLoad(int rofstID)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cmd = cn.CreateCommand())
{
cmd.CommandTimeout = Database.DefaultTimeout;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "vesp_RofstHeaderFinalizeLoad";
cmd.Parameters.Add(new SqlParameter("@RofstID", SqlDbType.Int)).Value = rofstID;
cmd.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
throw new DbCslaException("RofstData.vesp_RofstHeaderFinalizeLoad", ex);
}
}
private void RofstDatabaseInsert(int rofstID, int dbiID, int dbiType, int dbiAW, string dbiTitle, string dbiAP, int id, int parentID) private void RofstDatabaseInsert(int rofstID, int dbiID, int dbiType, int dbiAW, string dbiTitle, string dbiAP, int id, int parentID)
{ {
try try
@ -1369,6 +1458,10 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
//Finalized Load for Rofst Header / Rebuild Indexes
RofstHeaderFinalizeLoad(rofstID);
} }
private void LoadChild(int rofstID, int dbiID, ROFSTLookup.rochild child) private void LoadChild(int rofstID, int dbiID, ROFSTLookup.rochild child)
@ -1428,7 +1521,7 @@ namespace VEPROMS.CSLA.Library
if (loadChildren || loadAllChildren) if (loadChildren || loadAllChildren)
{ {
rd.children = RofstDataGetChildrenByID(_rofstID, rd.dbiID, rd.ID, loadAllChildren); rd.children = RofstDataGetChildrenByID(_rofstID, rd.dbiID, rd.ID, false, loadAllChildren);
} }
return rd; return rd;
@ -1451,10 +1544,9 @@ namespace VEPROMS.CSLA.Library
rc.value = (string)dr.GetValue("value"); rc.value = (string)dr.GetValue("value");
ProcessROReturnValue(ref rc, rc.value, GetRODatabaseTitleIndex(rc.roid)); ProcessROReturnValue(ref rc, rc.value, GetRODatabaseTitleIndex(rc.roid));
} }
else if (loadChildren || loadAllChildren)
if (loadChildren || loadAllChildren)
{ {
rc.children = RofstDataGetChildrenByRoid(_rofstID, rc.roid, loadAllChildren); rc.children = RofstDataGetChildrenByRoid(_rofstID, rc.roid, false, loadAllChildren);
} }
return rc; return rc;
@ -1464,6 +1556,36 @@ namespace VEPROMS.CSLA.Library
#region (RO Values) #region (RO Values)
private ROFSTLookup.rochild GetRoChild12(string ROID16, bool loadChildren = false, bool loadAllChildren = false)
{
string ROID = (ROID16.Length < 12) ? ROID16 : ROID16.Substring(0, 12);
ROFSTLookup.rochild rc = RofstDataGetChildByRoid(_rofstID, ROID, loadChildren, loadAllChildren);
if (rc.ID <= 0 && ROID16.Length == 4)
{
rc.title = GetRODatabaseTitle(GetRODatabaseTitleIndex(ROID16));
}
return rc;
}
private List<string> GetROReturnValue(string roval)
{
_lstRoValues = new List<string>();
_multiRoValues = new List<string>();
_dicRoVars = new Dictionary<string, string>();
string tmp = ProcessRO(_myDocVersionInfo == null ? roval : _myDocVersionInfo.ProcessDocVersionSpecificInfo(roval), false);
if (!string.IsNullOrEmpty(tmp) && _lstRoValues.Count == 0) // was not a multiple return value
{
_lstRoValues.Add(tmp);
}
return _lstRoValues;
}
private void ProcessROReturnValue(ref ROFSTLookup.rochild child, string rawvalue, int tableID) private void ProcessROReturnValue(ref ROFSTLookup.rochild child, string rawvalue, int tableID)
{ {
// This function will take the raw RO return value and resolve any macros, conditionals, // This function will take the raw RO return value and resolve any macros, conditionals,
@ -1773,7 +1895,7 @@ namespace VEPROMS.CSLA.Library
s2 = s2.Replace("\x2190", @"\u8592?"); // Leftwards Arrow s2 = s2.Replace("\x2190", @"\u8592?"); // Leftwards Arrow
s2 = s2.Replace("\x2191", @"\u8593?"); // Upwards Arrow s2 = s2.Replace("\x2191", @"\u8593?"); // Upwards Arrow
s2 = s2.Replace("\x2193", @"\u8595?"); // Downwards Arrow s2 = s2.Replace("\x2193", @"\u8595?"); // Downwards Arrow
s2 = s2.Replace("\x2207", @"\u8711?"); // Nabla (?) s2 = s2.Replace("\x2207", @"\u8711?"); // Nabla
s2 = s2.Replace("\x2591", @"\'b0"); // Degree Symbol s2 = s2.Replace("\x2591", @"\'b0"); // Degree Symbol
s2 = s2.Replace("\xFF", @"\u8593?"); // Up Arrow s2 = s2.Replace("\xFF", @"\u8593?"); // Up Arrow
s2 = s2.Replace("\xD6", @"\u8595?"); // Down Arrow s2 = s2.Replace("\xD6", @"\u8595?"); // Down Arrow

View File

@ -82,7 +82,7 @@ namespace VEPROMS.CSLA.Library
ROFSTLookup lu = MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MyDocVersion); ROFSTLookup lu = MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MyDocVersion);
foreach (ROCheck roc in MyDifferences.ROConsistency.MyROChecks) foreach (ROCheck roc in MyDifferences.ROConsistency.MyROChecks)
{ {
ROFSTLookup.rochild rocc = lu.GetRoChild12(roc.ROID); ROFSTLookup.rochild rocc = lu.GetRoChild(roc.ROID);
if (rocc.ID == -1) // B2020-125: View of Consistency check report displaying error message and crashing. if (rocc.ID == -1) // B2020-125: View of Consistency check report displaying error message and crashing.
{ {
sb.Append(string.Format(" {0}\r\n", lu.GetROTitle(roc.ROID))); sb.Append(string.Format(" {0}\r\n", lu.GetROTitle(roc.ROID)));

View File

@ -135,11 +135,6 @@ namespace VEPROMS.CSLA.Library
get get
{ {
CanReadProperty("ROLookup", true); CanReadProperty("ROLookup", true);
//if (_ROLookup == null)
//{
// _ROLookup = ROFSTLookup.GetRofstLookupBytes(_ROFstID);
//}
//return _ROLookup;
// B2022-026 RO Memory reduction // B2022-026 RO Memory reduction
return null; return null;

File diff suppressed because it is too large Load Diff

View File

@ -339,7 +339,7 @@ namespace Volian.Print.Library
{ {
foreach (ROCheck roc in pi.MyDifferences.ROConsistency.MyROChecks) foreach (ROCheck roc in pi.MyDifferences.ROConsistency.MyROChecks)
{ {
ROFSTLookup.rochild rocc = lu.GetRoChild12(roc.ROID); ROFSTLookup.rochild rocc = lu.GetRoChild(roc.ROID);
if (rocc.type == 1) if (rocc.type == 1)
{ {
string newROValue = lu.GetRoValue(roc.ROID).Replace('`', '\xb0'); string newROValue = lu.GetRoValue(roc.ROID).Replace('`', '\xb0');