From 0aa476d9dde45f14ecd9a616ad7676fb171c24e1 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Mon, 11 Nov 2024 15:56:55 -0500 Subject: [PATCH] F2024-078 - Adjust the spacing before and after the Note tab, along with the blank space (line) at the bottom of the Note box per the example supplied by the customer. Also made similar adjustments to the Caution tab and box. --- PROMS/Formats/fmtall/BVPS1all.xml | Bin 131186 -> 132024 bytes PROMS/Formats/fmtall/BVPS2all.xml | Bin 97142 -> 97400 bytes PROMS/Formats/fmtall/BVPSAOPall.xml | Bin 148484 -> 149156 bytes PROMS/Formats/fmtall/BVPSAtchall.xml | Bin 126226 -> 127018 bytes PROMS/Formats/fmtall/BVPSSAMGall.xml | Bin 126908 -> 127746 bytes .../Format/PlantFormat.cs | 30 ++++++++ PROMS/Volian.Print.Library/vlnParagraph.cs | 67 +++++++++++++----- 7 files changed, 81 insertions(+), 16 deletions(-) diff --git a/PROMS/Formats/fmtall/BVPS1all.xml b/PROMS/Formats/fmtall/BVPS1all.xml index af860004108ee93deebdc4e847b9c01d525cda42..1eaecf8f21da7ad1c6ef2fdb91487dbfd388c38a 100644 GIT binary patch delta 987 zcmey=z_Fv9W5b?_>5dF33|S1p3XA42cX$47LnP42D3gz<`i-WJqHufyyg@ zRp>I9BB}8K>MRDTaAL?|$YaQ6@Bxw_b98~G>M@v3{yBO1WCsVf$!(MQCO1svm|Qg} zB^hBls@*0?=7L;CzTK9SrKk2z4&Y>&oHcn0z5KfQ=VWz8dU$TL^i0a$ zDJCdPpRkzGYr8@Zqly}7`ZoMxd^SB`Eu+Zxyv>XOoWyG04s`YzHeywSJh^ZBs!fa= zrd#b}plzgcN`roG`s0f>CdJ WnIWUm_Gfn)^~iAbcA%?2$p8R4GwEFb delta 259 zcmdnd&he>%W5b?_lkKK1n(W}fHu=J&s?D1wD===ho2tY(dDG;M%>mO7yq_GgUub(k zJEIO8h&3I^lAC^EBIA_pd3}txR1snajxj!)KH)i|$o2(W83Q=M+6?wHo`Prtvi3~3 zd%&15eS$q>$n<#!7`e7@InG$ZiZH<7CgUQA?1O)dGSmIuFd9t`h~k*MEJb8{&VNQ7 z=IIC(K>Z5aH7+wcLG%MnKQ!I%5@Xu*c@G%1w*R@w=mj@;$9AB#@8DcHuqoSho-_8y F003vPZejoc diff --git a/PROMS/Formats/fmtall/BVPS2all.xml b/PROMS/Formats/fmtall/BVPS2all.xml index db484426377bbb7e04643d28cec2bf14145dffac..4808f67dacf550169b7e4da7fef6b4d28d43d9c2 100644 GIT binary patch delta 273 zcmezNjrGS5)(tBC>5dF33|S1p3XA42cX$47LnP42D3gz<`i-WJqHufyyg@ zRp>I9BB}8K>MRDTaAL?|$YaQ6@Bxw_b98~G>M@v3cAOx**{ENHF&SYbs)Z&X9Vh5dRrX`ZXYgkzV@PEv0>Vt7KU2Z}Ok_v~vOsPtnfy0ZdV7N^aQcs5NymPZ;0!1~tYXp#a;E4GI7N diff --git a/PROMS/Formats/fmtall/BVPSAOPall.xml b/PROMS/Formats/fmtall/BVPSAOPall.xml index eb9702ca637350962395bca32f1fe8059129ed69..a45ea4eb87f9fbae778b90c923c0eb22c89ceb56 100644 GIT binary patch delta 550 zcmbV`y-Pw-7{=fCpkh%G_AxZvF4oYHVx~h-RJTn;#6A#*=tCSTLa3lEp$3P#N>_NJ zDIzc;;*!DHsx4@US`w_Gp`4_lKOj2SB(1UG9M0kSJs(@ix}%*sJ*;kwLKGHY9O9sW z2PR+^=3ofy&?k-zRdp0%uv*dOGT{Jk4dWNi6+tMl1k11pesLQ)4w34tkP3uh5<)Om zR%FAiU8&|=T&>6XYSr%{o|+P4=KqHbY_6sFS_*I4=ejm8jvY+;F-KV5p6L+x;dm9ul1_u|{Znz%s@ZE*PtXar%c}j3Sd4Y!TT$ zVH2YqSjlvtk{#10{9;U){!56_XuHKpMkPLwj_D12Od%kNInxikWfYmdfsIjU`-U5g zCxlUC6Sn8PWi(*}+wtHtV--XeVdw-kMzP5`pG3Cb;b2N(1uFv@Tn5$vvf{vW1!Jb5 t?H*!G4PaS>*z`CHCb{VjPE1CV4U#yfPy5Z7wOzrEDTQ&ngFI7;Isnx)T|fW; diff --git a/PROMS/Formats/fmtall/BVPSAtchall.xml b/PROMS/Formats/fmtall/BVPSAtchall.xml index 0f62c4559b983958ce1f14aa638010d89a8e173d..e6d575033884608ae813f26bcfd66c2f042dffd3 100644 GIT binary patch delta 869 zcmbPqi+$At_6;Ka>5dF33|S1p3XA42cX$47LnP42D3gz<`i-WJqHufyyg@ zRp>I9BB}8K>MRDTaAL?|$YaQ6@Bxw_b98~G>M@v34xG4r^0xklWQ2*R_L(4=1#%7f z_E~N=oS@1`FOO{woT$!74_{3-oY1>zGRu8sKZbk;e}*!KRE8oT%ml_?DmeZU8Ipl4 zP?(oYzRxATU7(23h>cj)(+`|yOxV7zg3(Bg6fIHHHZpFQUcksGG`&uOk!?HQ0!A-R zq74W*#CT#l(9VeI6ZSBcZ2z%}(TbH6&4;#aB+-k4_kf6czfHjO$wsTc8-cp6|3(hc3o4#N+ zW6E}$MT~x&Ai=2VQkxk|;M)17AE;vVntosxW7u}9wTuy9gQB(r)huI!m|-x9(Pn$p pF2-eCsM>R;>v%D0O@Cm^D6)OoF~%R<2<6j(%G0*byUf@l0|1kYV=Mpw diff --git a/PROMS/Formats/fmtall/BVPSSAMGall.xml b/PROMS/Formats/fmtall/BVPSSAMGall.xml index e9c68548032e18ce94af0bcf467d02ba640293ad..5ca7a9ec05bc78f28926333fd099837505c22dac 100644 GIT binary patch delta 996 zcmdmUpS|fB`-ZFu^^OcF3|S1p3XA42cX$47LnP42D3gz<`i-WJqHufyyg@ zRp>I9BB}8K>MRDTaAL?|$YaQ6@Bxw_b98~G>OoaHF+?zgG6XR=gJl#zx+m|S)IWKG z4cla)iB-u6+fdzNf@BZKrR2NCa`MT^y^|-fvrLwlG-aUuzIp#7enxtDdh^N2zW1g5 z81fnX8Oj(^8H#`~6BzHQ;CN4DNS>}(%_uxsD@|a!T@|Ck^mR`d*G+#gi_u`aN(mzu z8&Nv919kSP5v3GlN!WCQSBx8`*Mu^PZ2z{9@ewD{I>FAr zHSA}U+g`DjF@%*wgSG<=T1K1~r{`T_JOr|?U_0M###iJy`9U!w+x9a@8E=v3&{^9H P&M>|sPSbXvL;Yj{nMCA8 delta 239 zcmZpA#=hr1`-ZFuo3Bk!Vw_wywPW%Gc9zL+CQX@qZNj3-eN!4XmreD!Klzsz-}Dd1 z8GWY9y _AdjSpB4Tab; + public float? AdjSpB4Tab + { + get + { + return LazyLoad(ref _AdjSpB4Tab, "@AdjSpB4Tab"); + } + } + + // F2024-078 adjusts the the spacing after the Note/Caution tab - the space betwee the tab text and the first line of of Note/Caution text + private LazyLoad _AdjSpAftTab; + public float? AdjSpAftTab + { + get + { + return LazyLoad(ref _AdjSpAftTab, "@AdjSpAftTab"); + } + } + + // F2024-078 adjusts the the spacing after the last line of Note/Caution text - between the last line of text and the bottom of the box + private LazyLoad _AdjLastBlnkLn; + public float? AdjLastBlnkLn + { + get + { + return LazyLoad(ref _AdjLastBlnkLn, "@AdjLastBlnkLn"); + } + } + // this will adjust the line spacing when an extra thick line is used for a box, so that the text below the box doesn't hit up against the bottom of the box private LazyLoad _ThickDouble; // F2021-026: Barakah single column 2 thick double lines around Warnings public bool ThickDouble diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 9c91303f..35d5d787 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -226,6 +226,8 @@ namespace Volian.Print.Library else yoff += vlnPrintObject.SixLinesPerInch; } + if (box.MyBox != null) + yoff += (float)(box.MyBox.AdjSpB4Tab ?? 0); // F2024-078 adjust space above the Note/Caution box tab } bxIndex = bxIndx; } @@ -273,6 +275,8 @@ namespace Volian.Print.Library box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch); if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; yoff += ln * vlnPrintObject.SixLinesPerInch; + if (box.MyBox != null) + yoff += (float)(box.MyBox.AdjSpB4Tab ?? 0); // F2024-078 adjust space above the Note/Caution box tab } } bxIndex = bxIndx; @@ -5497,24 +5501,53 @@ namespace Volian.Print.Library // code looks up parents to see if they have next before returning a 0 (no blank line) // B2022-042: double Caution followed by Critical Step missing bullet // F2022-010: substeps in multiple notes, cautions, warning print differently - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.NoBlankLastNoteCautionWarn && (MyItemInfo.IsInCautionOrNote)) + if (MyItemInfo.IsInCautionOrNote) { - if ((MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) && (MyItemInfo.NextItem == null)) // there are no sub-steps, see if any parents have next + float adjLastBlankLineInNoteCautionWarning = 0; + // Get the box information for the Note, Caution, or Warning + ItemInfo tifo = (MyItemInfo.IsCaution || MyItemInfo.IsNote) ? MyItemInfo : MyItemInfo.ParentNoteOrCaution; + int typ = ((int)tifo.MyContent.Type) % 10000; + int? bxIndx = tifo.ActiveFormat.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; + if (bxIndx != null) { - ItemInfo par = MyItemInfo.MyParent; - while (par.IsInCautionOrNote) // while in the caution or note, see if there is anything below this item - { - // if there is no next item, or content types are different, go up to see if the parent has any next item. If note - // keep going up tree, otherwise there is a next so don't return 0, i.e. continue on with code to determine - // whether there is a blank line - if ((par.NextItem == null) || (par.MyContent.Type != par.NextItem.MyContent.Type)) par = par.MyParent; - else break; - } - if (!par.IsInCautionOrNote || (par != null && par.MyContent.Type != par.NextItem.MyContent.Type)) return 0; + Box bx = tifo.ActiveFormat.PlantFormat.FormatData.BoxList[(int)bxIndx]; + // F2024-078 save the adjustment of the last blank line - this value will be added to the SixLinesPerInch value (a blank line) + adjLastBlankLineInNoteCautionWarning = (float)(bx.AdjLastBlnkLn ?? 0); + } + //} + // if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.NoBlankLastNoteCautionWarn && (MyItemInfo.IsInCautionOrNote)) + // F2024-078 added check for adjustment of the last blank line in the Note/Caution box + if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.NoBlankLastNoteCautionWarn || adjLastBlankLineInNoteCautionWarning != 0) + { + if ((MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) && (MyItemInfo.NextItem == null)) // there are no sub-steps, see if any parents have next + { + ItemInfo par = MyItemInfo.MyParent; + while (par.IsInCautionOrNote) // while in the caution or note, see if there is anything below this item + { + // if there is no next item, or content types are different, go up to see if the parent has any next item. If note + // keep going up tree, otherwise there is a next so don't return 0, i.e. continue on with code to determine + // whether there is a blank line + if ((par.NextItem == null) || (par.MyContent.Type != par.NextItem.MyContent.Type)) par = par.MyParent; + else break; + } + if (!par.IsInCautionOrNote || (par != null && par.MyContent.Type != par.NextItem.MyContent.Type)) + { + if (adjLastBlankLineInNoteCautionWarning != 0) + return SixLinesPerInch + adjLastBlankLineInNoteCautionWarning; // F2024-078 adjust the size of the last blank line of Note/Caution box + else + return 0; // no blank line after last text line of Note/Caution/Warning + } + } + if ((MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) && MyItemInfo.NextItem != null && MyItemInfo.MyContent.Type != MyItemInfo.NextItem.MyContent.Type) + { + if (adjLastBlankLineInNoteCautionWarning != 0) + return SixLinesPerInch + adjLastBlankLineInNoteCautionWarning; + else + return 0; // no blank line after last text line of Note/Caution/Warning + } } - if ((MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) && MyItemInfo.NextItem != null && MyItemInfo.MyContent.Type != MyItemInfo.NextItem.MyContent.Type) return 0; } - if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; + if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; // B2022-003: BNPP Alarms (BNPPalr) - incorrect line spacing for substeps off substeps. Added a format flag so as not to affect other plants. if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.StepPrintData != null && MyItemInfo.FormatStepData.StepPrintData.BlankAfterSubWithSub && MyItemInfo.NextItem != null && MyItemInfo.HasChildren && MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0) return SixLinesPerInch; @@ -5797,6 +5830,7 @@ namespace Volian.Print.Library float hdrWidth = (itemInfo.MyHeader.CleanText == null) ? 0 : itemInfo.MyHeader.CleanText.Length * 6; int typ = ((int)itemInfo.MyContent.Type) % 10000; int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; + float adjmentAfterBoxedNoteCautionTab = 0; // F2024-078 used to save the adjustment of the space after the Note/Caution tab if (itemInfo.MyHeader.Justify == System.Drawing.ContentAlignment.MiddleCenter) { @@ -5806,7 +5840,8 @@ namespace Volian.Print.Library if (bx.TabPos > 0) xoff += (float)bx.TabPos; // xoff starts as left margin else - xoff += (float)((bx.TxtStart + _MyBoxLeftAdj + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin + xoff += (float)((bx.TxtStart + _MyBoxLeftAdj + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin + adjmentAfterBoxedNoteCautionTab = (float) (bx.AdjSpAftTab ?? 0); // F2024-078 save the adjustment of the space (line) after the Note/Caution tab } else if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.IsInRNO && (itemInfo.IsCaution || itemInfo.IsNote)) // C2014-009 xoff = XOffset + (para.Width / 2) - (hdrWidth / 2); @@ -5841,7 +5876,7 @@ namespace Volian.Print.Library // F2022-121 added SpecialStepsFoldoutKeepWhiteSpace flag to allow for all of the other special foldout formatting, but // not compress the page - this need to handle explicit OR and AND sub-steps to ensure there are blank lines before and after // the separator text. - return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout || (MyItemInfo.MyDocStyle.SpecialStepsFoldout && MyItemInfo.MyDocStyle.SpecialStepsFoldoutKeepWhiteSpace) || (MyItemInfo.MyDocStyle.ExtraLineHeader && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? bSpaceIn ? SixLinesPerInch : 0 : 0); + return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout || (MyItemInfo.MyDocStyle.SpecialStepsFoldout && MyItemInfo.MyDocStyle.SpecialStepsFoldoutKeepWhiteSpace) || (MyItemInfo.MyDocStyle.ExtraLineHeader && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? bSpaceIn ? SixLinesPerInch : 0 : 0) + adjmentAfterBoxedNoteCautionTab; // F2024-078 add adjustment to the space after the Note/Caution tab } private float AdjustToCharPosition(float position, float? CPI) {