From 8ec820a7f7402d1fee646443e056d1a12644dc60 Mon Sep 17 00:00:00 2001 From: mschill Date: Thu, 20 Feb 2025 15:54:29 -0500 Subject: [PATCH 1/5] C2025-019 RO Editor - Update the Orphaned RO Record text file to save in the current RO folder instead of the users appdata folder. Found while using the WEP ROMOD database and the ROEPU folder. Note for Word doc: Update D.2.10 in the PROMS Manual for this update --- PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RO_FST.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RO_FST.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RO_FST.cs index 2a263265..0a2451f9 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RO_FST.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RO_FST.cs @@ -264,9 +264,11 @@ namespace ROEditor File.Delete(FstNew); // remove ROFST.NEW if (OrphanedRecords.Length > 0) { - StreamWriter sw = new StreamWriter(VlnSettings.TemporaryFolder + @"\Orphaned RO Records.txt"); - sw.Write(OrphanedRecords.ToString()); - sw.Close(); + using (StreamWriter sw = new StreamWriter(Path.Combine(FstDir, @"Orphaned RO Records.txt"), false)) + { + sw.Write(OrphanedRecords.ToString()); + sw.Close(); + } MessageBox.Show("The file Orphaned RO Records.txt has been created", "Warning - Orphan RO Record"); } From dc74da6e86f1661e63c23fb61256923c1f1390ab Mon Sep 17 00:00:00 2001 From: mschill Date: Fri, 21 Feb 2025 15:52:16 -0500 Subject: [PATCH 2/5] B2025-018 PROMS - Issues with folder order in tree view. --- .../Extension/FolderExt.cs | 52 +++++++++++++++++-- .../VEPROMS.CSLA.Library/Generated/Folder.cs | 27 ++++++++++ PROMS/Volian.Controls.Library/vlnTreeView.cs | 32 +++++++----- 3 files changed, 93 insertions(+), 18 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/FolderExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/FolderExt.cs index 15b2ffda..61904404 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/FolderExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/FolderExt.cs @@ -19,6 +19,7 @@ using System.Drawing; using System.Collections.Generic; using System.ComponentModel; using System.Text.RegularExpressions; +using System.Linq; namespace VEPROMS.CSLA.Library { @@ -143,6 +144,8 @@ namespace VEPROMS.CSLA.Library } #endregion #region SortingChildren + private static bool IsInManualOrderNullFix = false; + [NonSerialized] public Csla.SortedBindingList _SortedChildFolders; public Csla.SortedBindingList SortedChildFolders @@ -151,6 +154,29 @@ namespace VEPROMS.CSLA.Library { if (ChildFolders != null) { + //B2025-018 Issues with folder order in tree view + // if any ChildFolders with a missing Manual Order + // set them to the end of the list + // use IsInManualOrderNullFix - so, if setting ChildFolders Currently, + // do not try to set them (thus creating an infinite loop) + if (!IsInManualOrderNullFix && ChildFolders.Any(x => x.ManualOrder == null)) + { + IsInManualOrderNullFix = true; + foreach (FolderInfo fi in ChildFolders.Where(x => x.ManualOrder == null)) + { + using (FolderInfo parfolderinfo = FolderInfo.Get(fi.ParentID)) + { + using (Folder fldr = fi.Get()) + { + fldr.ManualOrder = parfolderinfo.NewManualOrder(9999); + fldr.Save(); + } + } + } + RefreshChildFolders(); + IsInManualOrderNullFix = false; + } + if (_SortedChildFolders == null) { _SortedChildFolders = new SortedBindingList(ChildFolders); @@ -166,6 +192,10 @@ namespace VEPROMS.CSLA.Library return _SortedChildFolders; } } + + //B2025-018 Issues with folder order in tree view + //Note: this should be called from the parent item + //As you want to put this into the sorted order of the parent item public double? NewManualOrder(int index) { double? retval = 1; @@ -174,13 +204,27 @@ namespace VEPROMS.CSLA.Library else if (index == 0) { if (retval >= SortedChildFolders[index].ManualOrder) // If one is too big, then divide first value in half - retval = SortedChildFolders[index].ManualOrder / 2; + retval = SortedChildFolders[index].ManualOrder / 2.0; } else if (SortedChildFolders.Count > index) { - retval += SortedChildFolders[index - 1].ManualOrder; // Just go to the next whole number - if (retval >= SortedChildFolders[index].ManualOrder) - retval = (SortedChildFolders[index - 1].ManualOrder + SortedChildFolders[index].ManualOrder) / 2; + //B2025-018 Issues with folder order in tree view + //filter to just items with the same parent + //want new order to be halfway between the previous item + //and the next ManualOrder + var tmp = SortedChildFolders.Where(x => x.ParentID == FolderID); + var lbound = SortedChildFolders[index - 1].ManualOrder; + var ubound = tmp.OrderBy(y => y.ManualOrder).FirstOrDefault(x => x.ManualOrder > lbound)?.ManualOrder; + if (ubound != null) + { + retval = ((ubound - lbound) / 2.0) + lbound; + } + else + { + //in this case, item before is highest for that parent + //so just make this 1 more + retval = lbound + 1; + } } else { diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs index fb8a0a45..0232759d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Folder.cs @@ -769,6 +769,15 @@ namespace VEPROMS.CSLA.Library tmp.MyParent = myParent; tmp.Name = name; tmp.ShortName = shortName; + + //B2025-018 Issues with folder order in tree view + //if no manual order is set, add it at the end + if (myParent != null) + { + using (FolderInfo parfolderinfo = FolderInfo.Get(myParent.FolderID)) + tmp.ManualOrder = parfolderinfo.NewManualOrder(9999); + } + return tmp; } public static Folder New(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, double? manualOrder, string config, DateTime dts, string usrID) @@ -784,6 +793,15 @@ namespace VEPROMS.CSLA.Library tmp.Config = config; tmp.DTS = dts; tmp.UsrID = usrID; + + //B2025-018 Issues with folder order in tree view + //if no manual order is set, add it at the end + if (myParent != null && manualOrder == null) + { + using (FolderInfo parfolderinfo = FolderInfo.Get(myParent.FolderID)) + tmp.ManualOrder = parfolderinfo.NewManualOrder(9999); + } + return tmp; } public static Folder MakeFolder(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, double? manualOrder, string config, DateTime dts, string usrID) @@ -813,6 +831,15 @@ namespace VEPROMS.CSLA.Library tmp.MyFormat = myFormat; tmp.ManualOrder = manualOrder; tmp.Config = config; + + //B2025-018 Issues with folder order in tree view + //if no manual order is set, add it at the end + if (myParent != null && manualOrder == null) + { + using (FolderInfo parfolderinfo = FolderInfo.Get(myParent.FolderID)) + tmp.ManualOrder = parfolderinfo.NewManualOrder(9999); + } + return tmp; } public static Folder MakeFolder(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, double? manualOrder, string config) diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index e60b358b..3eac21cf 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -2812,23 +2812,27 @@ namespace Volian.Controls.Library int f2 = -1; string uniquename = _LastFolderInfo.MyParent.UniqueChildName("New Folder"); int myindex = SelectedNode.Index + ((newtype == MenuSelections.FolderAfter) ? 1 : 0); - FolderInfo parfolderinfo = FolderInfo.Get(parentfolder.FolderID); - double? myorder = parfolderinfo.NewManualOrder(myindex); - using (Folder folder = Folder.MakeFolder(parentfolder.MyParent, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, myorder, string.Empty, DateTime.Now, VlnSettings.UserID)) - { - ShowBrokenRules(folder.BrokenRulesCollection); - SetLastValues(FolderInfo.Get(folder.FolderID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(uniquename, folder.FolderConfig)) == DialogResult.OK) + //B2025-018 Issues with folder order in tree view + //since before/after folder is at same level as current folder + //so need to use the parents order to determine where to place it + using (FolderInfo parfolderinfo = FolderInfo.Get(parentfolder.MyParent.FolderID)) + { double? myorder = parfolderinfo.NewManualOrder(myindex); + using (Folder folder = Folder.MakeFolder(parentfolder.MyParent, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, myorder, string.Empty, DateTime.Now, VlnSettings.UserID)) { - folder.Save(); - tn = new VETreeNode((IVEDrillDownReadOnly)_LastFolderInfo); - if (newtype == MenuSelections.FolderBefore) SelectedNode.Parent.Nodes.Insert(SelectedNode.Index, tn); - if (newtype == MenuSelections.FolderAfter) SelectedNode.Parent.Nodes.Insert(SelectedNode.Index + 1, tn); + ShowBrokenRules(folder.BrokenRulesCollection); + SetLastValues(FolderInfo.Get(folder.FolderID)); + if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(uniquename, folder.FolderConfig)) == DialogResult.OK) + { + folder.Save(); + tn = new VETreeNode((IVEDrillDownReadOnly)_LastFolderInfo); + if (newtype == MenuSelections.FolderBefore) SelectedNode.Parent.Nodes.Insert(SelectedNode.Index, tn); + if (newtype == MenuSelections.FolderAfter) SelectedNode.Parent.Nodes.Insert(SelectedNode.Index + 1, tn); + } + else + f2 = folder.FolderID; } - else - f2 = folder.FolderID; + if (f2 != -1) Folder.Delete(f2); } - if (f2 != -1) Folder.Delete(f2); } } } From 0749f5e72497e8479230f357434895f22b63139b Mon Sep 17 00:00:00 2001 From: John Jenko Date: Wed, 26 Feb 2025 11:07:17 -0500 Subject: [PATCH 3/5] B2025-020 Fixed NULL reference error while running the Refresh Transitions administrator tool. --- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 031ece04..4b680ed0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -805,7 +805,21 @@ namespace VEPROMS.CSLA.Library } } } - + // B2025-020 Null Reference fix. Added check for valid index into the TransitionTypeList + if (!forceConvertToText) + { + if (traninfo.TranType >= itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList.Count) + { + forceConvertToText = true; + TranFixCount++; + itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition type is not available"); + using (Content content = Content.Get(itemInfo.MyContent.ContentID)) + { + content.FixTransitionText(traninfo, true); + content.Save(); + } + } + } if (!forceConvertToText) { if (itemInfo.MyProcedure.ItemID != traninfo.MyItemToID.MyProcedure.ItemID) //different proc From 86a98118fbd712ad204b88a17ea401bdd821f943 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Thu, 27 Feb 2025 11:20:31 -0500 Subject: [PATCH 4/5] Updated the developer tool that copied the format files to the FMTall an GENMACall folders. Added a list box to show what format files will not be copied. --- PROMS/Formats/fmtall/FNPNew2all.xml | Bin 92846 -> 92914 bytes PROMS/Formats/fmtall/vcb1all.xml | Bin 108526 -> 108544 bytes PROMS/Formats/fmtall/vcb2all.xml | Bin 82168 -> 82186 bytes PROMS/Formats/fmtall/vcbaall.xml | Bin 98488 -> 98506 bytes PROMS/Formats/fmtall/vcbalrall.xml | Bin 50160 -> 50178 bytes PROMS/Formats/fmtall/vcbbckall.xml | Bin 68526 -> 68544 bytes PROMS/Formats/fmtall/vcbeppall.xml | Bin 92178 -> 92196 bytes PROMS/Formats/frmFormatCopy.Designer.cs | 49 +++++++++++++++++++++--- PROMS/Formats/frmFormatCopy.cs | 9 ++++- PROMS/Formats/frmFormatCopy.resx | 4 +- 10 files changed, 53 insertions(+), 9 deletions(-) diff --git a/PROMS/Formats/fmtall/FNPNew2all.xml b/PROMS/Formats/fmtall/FNPNew2all.xml index 3f9a3bb4f328b7f054e611b54ef2b86ccad29f28..8aed627d02d8d0e81c1b5852a9ddf31987bfb47c 100644 GIT binary patch delta 86 zcmZ2?mG#qA)(tjH&I$|~48aWf45bVu3>gfm3`Goi3Kz=eq4v?P+6j5LZ2a=gU e6(D(ahGL+IJ5WU?Lkdttv)P(yyEPMIaRvZ|s}l|Y delta 18 Zcmex#m37@!)(tjH%?(W38<-f2G5}Fl2V4LE diff --git a/PROMS/Formats/fmtall/vcb1all.xml b/PROMS/Formats/fmtall/vcb1all.xml index 89b3f9c21cb3942c41d4bcde94193abcadc6da3d..30d0e84baee142a942ba0adbc837d87dff4105ba 100644 GIT binary patch delta 34 mcmaENo~_{m+lD+wehmgkh5!ab1_LnEY|dufp3TVEybJ)awh1Qy delta 22 ecmZp;!1nGu+lD;G$$yS+7HfJ+#&t_!wtp@;}od`hy delta 23 ecmX@r$hM=AZ9^X8^j!grJk33f+j|%p?dkz<&Q3t;O delta 18 ZcmZqbVE)j~ydjTq@~M8V&0UNYhX70m2o(ST diff --git a/PROMS/Formats/fmtall/vcbbckall.xml b/PROMS/Formats/fmtall/vcbbckall.xml index 243bb2e0b7275ed6db92a06b200b8bd2390d6ff4..3e7fdb259137d1cde93acb80ac961b00a558d828 100644 GIT binary patch delta 40 scmZ2Co#nuEmJNA~f*K5t3;_&=3won_s0mJNA~lh@1^X`aHkeF`I^4i^A!W(Z9H diff --git a/PROMS/Formats/fmtall/vcbeppall.xml b/PROMS/Formats/fmtall/vcbeppall.xml index 5afe836a5829cc5cf2f95f6705fbf02b59f15a61..880aee4bad276492778f7a5f62d18baeebf353c6 100644 GIT binary patch delta 34 mcmbPqfpy6R)(v@#{2C073;_&=32.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file From 1ae422c74e841f17832855bd0335b3f5d7edcd84 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 27 Feb 2025 19:16:47 -0500 Subject: [PATCH 5/5] B2025-017-Print-Section-Sub-Section-v2 --- PROMS/Volian.Controls.Library/vlnTreeView.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 3eac21cf..5fcb43b6 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -983,19 +983,22 @@ namespace Volian.Controls.Library SectionInfo si2 = (tn as VETreeNode).VEObject as SectionInfo; if (si2.MyDocVersion.MultiUnitCount > 1) { - MenuItem mps = new MenuItem("Print Section"); - int k = 0; - foreach (string s in si2.MyDocVersion.UnitNames) + if (!si2.IsSubsection) { - k++; - MenuItem mp = mps.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); - mp.Tag = k; + MenuItem mps = new MenuItem("Print Section"); + int k = 0; + foreach (string s in si2.MyDocVersion.UnitNames) + { + k++; + MenuItem mp = mps.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); + mp.Tag = k; + } + cm.MenuItems.Add(mps); } - cm.MenuItems.Add(mps); } else { - cm.MenuItems.Add("Print Section", new EventHandler(mi_Click)); + if(!si2.IsSubsection) cm.MenuItems.Add("Print Section", new EventHandler(mi_Click)); } } }