From 4bc73f847ccba72fbb610e8c117442c9f2fcd393 Mon Sep 17 00:00:00 2001 From: mschill Date: Mon, 11 Nov 2024 07:15:02 -0500 Subject: [PATCH] B2024-092 Add Initial Line/Ability to Disable to UI for South Texas --- PROMS/Formats/fmtall/hlpfsgall.xml | Bin 107312 -> 107312 bytes .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 18 ++++++++++-------- PROMS/Volian.Controls.Library/DisplayTags.cs | 2 +- PROMS/Volian.Print.Library/vlnParagraph.cs | 7 ++++++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/PROMS/Formats/fmtall/hlpfsgall.xml b/PROMS/Formats/fmtall/hlpfsgall.xml index 9b2a83dcf467045e17f858ceedc0b2771ab3ec41..828c3fb1653e8e916b98d8fcd8df38e9fbb1d028 100644 GIT binary patch delta 30 kcmdmRjBNuD#fUH)G8jyb7cplxU@&W*DYAX02;=lV0HCf3-2eap delta 30 icmdmRjBNuD#fUH)F_=t_7cmFX%`-)|&lF*t-Uk4o4hiA_ diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index e14ea891..bfdfa46d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -4286,7 +4286,7 @@ namespace VEPROMS.CSLA.Library tstr = tbformat.Replace("{!.+?}", " "); // Comanche Peak Indented Paragraph _MyTab.Text = tstr; //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line - if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled) + if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled) { if (tstr.StartsWith(" ")) tstr = tstr.Substring(1); @@ -4384,7 +4384,7 @@ namespace VEPROMS.CSLA.Library { //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line string tstr = MyParent.MyTab.CleanText.Trim() + "." + incSub; - if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_")) + if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_")) { if (tstr.StartsWith(" ")) tstr = tstr.Substring(1); @@ -4401,7 +4401,7 @@ namespace VEPROMS.CSLA.Library { //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line string tstr = MyParent.MyTab.CleanText.Trim() + "." + incSub + " "; - if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_")) + if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tstr.StartsWith("_")) { if (tstr.StartsWith(" ")) tstr = tstr.Substring(1); @@ -4417,7 +4417,7 @@ namespace VEPROMS.CSLA.Library string tmprnotab = MyParent.MyTab.CleanText.Substring(0, MyParent.MyTab.CleanText.IndexOf(".") + 1) + incSub; //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line tmprnotab = tmprnotab.TrimStart(); - if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tmprnotab.StartsWith("_")) + if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !tmprnotab.StartsWith("_")) { if (tmprnotab.StartsWith(" ")) tmprnotab = tmprnotab.Substring(1); @@ -4435,7 +4435,7 @@ namespace VEPROMS.CSLA.Library _MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText; _MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text; //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line - if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !_MyTab.CleanText.StartsWith("_")) + if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled && !_MyTab.CleanText.StartsWith("_")) { if (_MyTab.CleanText.StartsWith(" ")) _MyTab.CleanText = _MyTab.CleanText.Substring(1); @@ -4783,7 +4783,7 @@ namespace VEPROMS.CSLA.Library // Note could have modified logic for clock macro (above) but older logic uses the IdentEdit setting // for CAS (Continuous Action Summary steps) that have a circle printed around the step number // this is the least impact of current code/formats - if (!string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag)) + if (!string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag)) { int eidx = tbformat.IndexOf("}", macroindx); if (eidx > -1) @@ -4806,12 +4806,14 @@ namespace VEPROMS.CSLA.Library } } //CSM F2024 - 080: For South Texas - if format contains initial line and it is not disabled, show an initial line - else if (macroindx == -1 && !string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled) + else if (macroindx == -1 && !string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroList != null && FormatStepData.TabData.MacroList.Count > 0 && !(this.IsRNOPart && FormatStepData.TabData.MacroList[0].NotInRNO) && !IsInitialLineDisabled) { if (cltext == null) cltext = tbformat; if (cltext.StartsWith(" ")) cltext = cltext.Substring(1); + if (tbformat.StartsWith(" ")) + tbformat = tbformat.Substring(1); cltext = FormatStepData.TabData.MacroEditTag + cltext; } } @@ -5620,7 +5622,7 @@ namespace VEPROMS.CSLA.Library } //CSM F2024 - 080: For South Texas - if initial line is disabled for this step, do not add the macro - if (macro.Name.ToUpper() == "CHECKOFF" && ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ShowInitialLineDisable && !string.IsNullOrEmpty(FormatStepData.TabData.MacroEditTag) && FormatStepData.TabData.MacroEditTag == "_" && IsInitialLineDisabled) + if (macro.Name.ToUpper() == "CHECKOFF" && ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ShowInitialLineDisable && !string.IsNullOrEmpty(FormatStepData?.TabData?.MacroEditTag) && FormatStepData.TabData.MacroEditTag == "_" && IsInitialLineDisabled) addToList = false; if (addToList) tmp.Add(macro); diff --git a/PROMS/Volian.Controls.Library/DisplayTags.cs b/PROMS/Volian.Controls.Library/DisplayTags.cs index e1dcb28f..0a86be21 100644 --- a/PROMS/Volian.Controls.Library/DisplayTags.cs +++ b/PROMS/Volian.Controls.Library/DisplayTags.cs @@ -559,7 +559,7 @@ namespace Volian.Controls.Library //CSM F2024 - 080: For South Texas (HLP formats), enable the initial line checkbox if it is in the formats //Also, they want disable being selected to impact substeps - so do not show toggle if selected on a parent step cbInitialLine.Visible = cbInitialLine.Enabled = false; - if (CurItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ShowInitialLineDisable && !string.IsNullOrEmpty(CurItemInfo.FormatStepData.TabData.MacroEditTag) && CurItemInfo.FormatStepData.TabData.MacroEditTag == "_" && CurItemInfo.FormatStepData.TabData.MacroList != null && CurItemInfo.FormatStepData.TabData.MacroList.Count > 0 && !(CurItemInfo.IsRNOPart && CurItemInfo.FormatStepData.TabData.MacroList[0].NotInRNO)) + if (CurItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ShowInitialLineDisable && !string.IsNullOrEmpty(CurItemInfo.FormatStepData?.TabData?.MacroEditTag) && CurItemInfo.FormatStepData.TabData.MacroEditTag == "_" && CurItemInfo.FormatStepData.TabData.MacroList != null && CurItemInfo.FormatStepData.TabData.MacroList.Count > 0 && !(CurItemInfo.IsRNOPart && CurItemInfo.FormatStepData.TabData.MacroList[0].NotInRNO)) { cbInitialLine.Visible = cbInitialLine.Enabled = true; cbInitialLine.Checked = sc.Step_DisableInitialLine; diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 5148bd3e..9c91303f 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -3781,7 +3781,12 @@ namespace Volian.Print.Library else if (itemInfo.MyTab.AltPrintTab != null) mytab = new vlnTab(cb, this, itemInfo.MyTab.AltPrintTab, itemInfo.MyTab.AltPrintTab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); else - mytab = new vlnTab(cb, this, itemInfo.MyTab.Text, itemInfo.MyTab.CleanText, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); + { + string clntxt = itemInfo.MyTab.CleanText; + if (!string.IsNullOrEmpty(itemInfo.FormatStepData?.TabData?.MacroEditTag) && itemInfo.FormatStepData.TabData.MacroEditTag == "_" && clntxt.StartsWith("_")) + clntxt = clntxt.Substring(1); + mytab = new vlnTab(cb, this, itemInfo.MyTab.Text, clntxt, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); + } PartsLeft.Add(mytab); if (mytab.MyMacro != null) PartsLeft.Add(mytab.MyMacro); } -- 2.47.2