diff --git a/PROMS/Formats/Formats.csproj b/PROMS/Formats/Formats.csproj index ffa7cbd8..73bd4d8b 100644 --- a/PROMS/Formats/Formats.csproj +++ b/PROMS/Formats/Formats.csproj @@ -301,6 +301,9 @@ + + + @@ -507,6 +510,9 @@ + + + diff --git a/PROMS/Formats/fmtall/SthNuc1all.xml b/PROMS/Formats/fmtall/SthNuc1all.xml new file mode 100644 index 00000000..46dbf72a Binary files /dev/null and b/PROMS/Formats/fmtall/SthNuc1all.xml differ diff --git a/PROMS/Formats/fmtall/SthNuc2all.xml b/PROMS/Formats/fmtall/SthNuc2all.xml new file mode 100644 index 00000000..98ea6bf8 Binary files /dev/null and b/PROMS/Formats/fmtall/SthNuc2all.xml differ diff --git a/PROMS/Formats/fmtall/SthNucAlrall.xml b/PROMS/Formats/fmtall/SthNucAlrall.xml new file mode 100644 index 00000000..bd02de80 Binary files /dev/null and b/PROMS/Formats/fmtall/SthNucAlrall.xml differ diff --git a/PROMS/Formats/fmtall/VEGP1all.xml b/PROMS/Formats/fmtall/VEGP1all.xml new file mode 100644 index 00000000..adb26c0b Binary files /dev/null and b/PROMS/Formats/fmtall/VEGP1all.xml differ diff --git a/PROMS/Formats/fmtall/VEGP2all.xml b/PROMS/Formats/fmtall/VEGP2all.xml new file mode 100644 index 00000000..29bb17a6 Binary files /dev/null and b/PROMS/Formats/fmtall/VEGP2all.xml differ diff --git a/PROMS/Formats/fmtall/VEGPAlrall.xml b/PROMS/Formats/fmtall/VEGPAlrall.xml new file mode 100644 index 00000000..685eb638 Binary files /dev/null and b/PROMS/Formats/fmtall/VEGPAlrall.xml differ diff --git a/PROMS/Formats/genmacall/SthNuc1.svg b/PROMS/Formats/genmacall/SthNuc1.svg new file mode 100644 index 00000000..37bcfb56 Binary files /dev/null and b/PROMS/Formats/genmacall/SthNuc1.svg differ diff --git a/PROMS/Formats/genmacall/SthNuc2.svg b/PROMS/Formats/genmacall/SthNuc2.svg new file mode 100644 index 00000000..6abf8489 Binary files /dev/null and b/PROMS/Formats/genmacall/SthNuc2.svg differ diff --git a/PROMS/Formats/genmacall/SthNucAlr.svg b/PROMS/Formats/genmacall/SthNucAlr.svg new file mode 100644 index 00000000..4c8d6d34 Binary files /dev/null and b/PROMS/Formats/genmacall/SthNucAlr.svg differ diff --git a/PROMS/Formats/genmacall/VEGP1.svg b/PROMS/Formats/genmacall/VEGP1.svg new file mode 100644 index 00000000..83f0ae3d Binary files /dev/null and b/PROMS/Formats/genmacall/VEGP1.svg differ diff --git a/PROMS/Formats/genmacall/VEGP2.svg b/PROMS/Formats/genmacall/VEGP2.svg new file mode 100644 index 00000000..8c0166db Binary files /dev/null and b/PROMS/Formats/genmacall/VEGP2.svg differ diff --git a/PROMS/Formats/genmacall/VEGPAlr.svg b/PROMS/Formats/genmacall/VEGPAlr.svg new file mode 100644 index 00000000..6c035692 Binary files /dev/null and b/PROMS/Formats/genmacall/VEGPAlr.svg differ diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index dbf346f8..f7ea84f7 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -8067,7 +8067,8 @@ namespace VEPROMS.CSLA.Library private string GetSectionTab(bool underline) { if (DisplayNumber == null || DisplayNumber == "" || !IsStepSection) return DisplayNumber; - if (MyDocStyle.SpecialStepsFoldout) return DisplayNumber; + // added DontParseSectionNumber flag so that the section number is used as is + if (MyDocStyle.SpecialStepsFoldout || MyDocStyle.DontParseSectionNumber) return DisplayNumber; if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) { if (underline) diff --git a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs index 4e17f2e3..2c85aa55 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs @@ -378,6 +378,18 @@ namespace VEPROMS.CSLA.Library } } #endregion + #region Section Number Flags + [Category("Miscellaneous")] + [Description("Don't parse the section number - use DisplayNumber value")] + private LazyLoad _DontParseSectionNumber; + public bool DontParseSectionNumber + { + get + { + return LazyLoad(ref _DontParseSectionNumber, "@DontParseSectionNumber"); + } + } + #endregion #region SpecialStepsFoldout [Category("Miscellaneous")] [Description("Section Special Steps Foldout")] @@ -628,13 +640,13 @@ namespace VEPROMS.CSLA.Library if (PlantFormat.IgnoreUCF) return LazyLoad(ref _LeftMargin, "@LeftMargin"); if (MyFormat.PlantFormat.FormatConfig == null) return LazyLoad(ref _LeftMargin, "@LeftMargin"); - // see if there is UCF data, need to match the index of the ucf data to that in the original format, and - // also need to check that LeftMargin is not null, since other docstyle data may exist in UCF but not PageLength: - XmlNode par = this.XmlNode.ParentNode; + // see if there is UCF (User Control of Format) data, need to match the index of the ucf data to that in the original format, and + // also need to check that LeftMargin is not null, since other docstyle data may exist in UCF but not LeftMargin: + XmlNode par = this.XmlNode.ParentNode; string indx = null; XmlElement ele = par as XmlElement; if (ele.HasAttribute("Index")) indx = ele.GetAttribute("Index"); - if (indx == null) return LazyLoad(ref _PageLength, "@LeftMargin"); + if (indx == null) return LazyLoad(ref _LeftMargin, "@LeftMargin"); if (MyFormat.PlantFormat.FormatConfig != null && this.MyFormat.PlantFormat.FormatConfig.PlantFormat.DocStyles != null && MyFormat.PlantFormat.FormatConfig.PlantFormat.DocStyles.Count > 0) { foreach (FormatConfig.DocStyle ds in MyFormat.PlantFormat.FormatConfig.PlantFormat.DocStyles) @@ -663,7 +675,7 @@ namespace VEPROMS.CSLA.Library if (PlantFormat.IgnoreUCF) return LazyLoad(ref _PageLength, "@PageLength"); if (MyFormat.PlantFormat.FormatConfig == null) return LazyLoad(ref _PageLength, "@PageLength"); - // see if there is UCF data, need to match the index of the ucf data to that in the original format, and + // see if there is UCF (User Control of Format) data, need to match the index of the ucf data to that in the original format, and // also need to check that PageLength is not null, since other docstyle data may exist in UCF but not PageLength: XmlNode par = this.XmlNode.ParentNode; string indx = null; diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 16e5f64e..879952fe 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -32,7 +32,11 @@ namespace VEPROMS.CSLA.Library } set { _FormatConfig = value; } } - // when IgnoreUCF is true, get the original data, i.e. don't apply any UCF changes to it + #region User Control of Format (UCF) + // User Control of Format allows a PROMS user to make modifications to a very limited set of format settings + // Variables in this region are not set in the format files. They are used only in the C# code + + // when IgnoreUCF is true, get the original data, i.e. don't apply any UCF changes to it private static bool _IgnoreUCF = false; public static bool IgnoreUCF { @@ -53,6 +57,7 @@ namespace VEPROMS.CSLA.Library get { return PlantFormat._DoingUCFCheckOffsUse; } set { PlantFormat._DoingUCFCheckOffsUse = value; } } + #endregion //User Control of Format (UCF) public static FormatConfig GetFormatConfig(IFormatOrFormatInfo format) { FormatConfig fc = null; @@ -78,6 +83,8 @@ namespace VEPROMS.CSLA.Library return _XmlDoc; } } + // FormatData contains flag and specific settings for step/sub-step types, tabbing information, etc. (pertains to the entire format) + // Reads this information in from the format file private FormatData _FormatData; public FormatData FormatData { @@ -88,6 +95,9 @@ namespace VEPROMS.CSLA.Library } } private PageStyles _PageStyles; + // PageStyles (AKA PageList) contains settings used to print page boarders, page numbers, and positions information such as procedure number/title in page headers. + // These are associated with the sections defined in DocStyle + // Reads this information in from the format file public PageStyles PageStyles { get @@ -97,6 +107,8 @@ namespace VEPROMS.CSLA.Library } } private DocStyles _DocStyles; + // DocStyles define page margins, continue messages, end messages and associate each section with a PageSyle + // Reads this information in from the format file public DocStyles DocStyles { get @@ -105,13 +117,18 @@ namespace VEPROMS.CSLA.Library return _DocStyles; } } - public bool HasPageListToken(string token) + // Used to test if the current PageStyle uses the passed in "token" + // A token in a PageStyle is surrounded by open/close curly brackets. + // ex: {myToken} + public bool HasPageListToken(string token) { string xpath = string.Format("/PlantFormat/PageStyles/PageStyle/Item[@Token = '{0}']", token); XmlNodeList nl = XmlDoc.SelectNodes(xpath); return nl.Count > 0; } private FormatConfig.ReplaceStrData _UCFandOrigReplaceStrData = null; + // This will return a complete list of ReplaceWords, combining those in the original plant format + // with the ones added by the user via User Control of Format (UCF) public FormatConfig.ReplaceStrData UCFandOrigReplaceStrData { get @@ -207,7 +224,7 @@ namespace VEPROMS.CSLA.Library _WinFontLookup.Add(key, new Font(family, size, style)); return _WinFontLookup[key]; } - // part of bug B2017-117 and for conservation of winow handles to reduce the frequency of + // part of bug B2017-117 and for conservation of window handles to reduce the frequency of // the Out of Window Handles error when editing and printing. // we are now using a common dictionary for font usages public static Font GetWinSysFont(string family, float size, FontStyle style) @@ -324,6 +341,7 @@ namespace VEPROMS.CSLA.Library public class FormatData : vlnFormatItem { public FormatData(XmlNode xmlNode) : base(xmlNode) { } + // Name of the format - as it appears when selecting the format to use in PROMS private LazyLoad _Name; public string Name { @@ -332,6 +350,7 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _Name, "@Name"); } } + // When true, this format is allowed to be used in the PROMS Express product private LazyLoad _Express; public bool Express { @@ -340,6 +359,8 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _Express, "@Express"); } } + // When set to True, it enables the use of a Procedure Set Specific dialog, containing defined fields + // in which the user enters data that is printed on all or specific pages for all of the procedures in the set using this format private LazyLoad _SpecificInfo; public bool SpecificInfo { @@ -348,6 +369,8 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _SpecificInfo, "@SpecificInfo"); } } + // this is a structure defined in the format file that defines labels and fields on a pop-up dialog + // in which the user will enter data - this is accessible only at the procedure set level private SI _SI; public SI SI { @@ -371,12 +394,15 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _TPL, "@TPL"); } } + // not defined in format files, we now use TPL to define both the original and new template + // the C# determines if it's a smart (new) template or the old style (search for NewTemplateFormat to see the code) private bool _NewTemplateFormat; public bool NewTemplateFormat { get { return _NewTemplateFormat; } set { _NewTemplateFormat = value; } } + // Creates a dictionary of the templates (TPL) defined in the format private Dictionary _TopTemplateTypes; public Dictionary TopTemplateTypes { @@ -398,6 +424,8 @@ namespace VEPROMS.CSLA.Library return _TopTemplateTypes; } } + // Parses the templates defined in the format file and creates a list + // this also determines if it a Smart Template or the original style private List _Templates; public List Templates { @@ -497,6 +525,9 @@ namespace VEPROMS.CSLA.Library } } + // Old style format flags (from DOS version of PROMS) + // where we check which bits of the integer is set to determine if that option can be used. + // See E_PurchaseOptions in ENums.cs for a description of each option flag (bit) private LazyLoad _PurchaseOptions; public E_PurchaseOptions? PurchaseOptions { @@ -505,6 +536,8 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _PurchaseOptions, "@PurchaseOptions"); } } + // Set at the top of the format(under FormatData) defined the default font used in this format. + // Specific step types can have different font information assigned to override this default private VE_Font _Font; public VE_Font Font { @@ -521,7 +554,7 @@ namespace VEPROMS.CSLA.Library return _PDFPageSize == null ? _PDFPageSize = new PDFPageSize(SelectSingleNode("PDFPageSize")) : _PDFPageSize; } } - //C2021-005 Format file grouping containing a list of possible font sizes (used only for table text) + //C2021-005 Format file grouping containing a list of possible font sizes (used only for table text via the Table Ribbon) private FontSizes _FontSizes; public FontSizes FontSizes { @@ -530,7 +563,7 @@ namespace VEPROMS.CSLA.Library return _FontSizes == null ? _FontSizes = new FontSizes(SelectSingleNode("FontSizes")) : _FontSizes; } } - // C2021-004 This gets the list for additional shading options defined in the format (base) file + // C2021-004 This gets the list for additional Table Cell shading options defined in the format (base) file private ShadingOptionList _ShadingOptionList; public ShadingOptionList ShadingOptionList { @@ -550,6 +583,8 @@ namespace VEPROMS.CSLA.Library } set { _UnitWatermarkList = value; } } + // This is a list of supported symbol characters used in the PROMS step editor + // the master list is defined in the base format (Baseall.xml) private SymbolList _SymbolList; public SymbolList SymbolList { @@ -1580,10 +1615,11 @@ namespace VEPROMS.CSLA.Library { get { - // The following line is used in UCF: this needs to be able to control a change in setting in UCF versus its use: - // This is a special case since the original format, using the value in BaseAll, is always 'false'. And the value - // should never be set in original volian plant format files, if the additional UCF checkoffs are to be used, this must - // be set in the UCF user interface. + // The following line is used in UCF (User Control of Format). + // This needs to be able to control a change in setting in UCF versus its use: + // - This is a special case since the original format, using the value in BaseAll, is always 'false'. And the value + // should never be set in original volian plant format files, if the additional UCF checkoffs are to be used, this must + // be set in the UCF user interface. if (PlantFormat.DoingUCFCheckOffs) return PlantFormat.DoingUCFCheckOffsUse; if (PlantFormat.IgnoreUCF) return LazyLoad(ref _CheckOffUCF, "@CheckOffUCF"); @@ -2886,6 +2922,15 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _OnlyBoldTopSect, "@OnlyBoldTopSect"); } } + // If the section number is null or all blanks, then use the SectionNumber.Pos to position the section title + private LazyLoad _UseNumPosWhenNumBlank; + public bool UseNumPosWhenNumBlank + { + get + { + return LazyLoad(ref _UseNumPosWhenNumBlank, "@UseNumPosWhenNumBlank"); + } + } private VE_Font _Font; public VE_Font Font { diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index afd8b824..04033a63 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -1983,7 +1983,7 @@ i = 0; plstr = plstr.Replace(token, string.Empty); //svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayText)); break; - case "{METASECTIONTITLE}": // This will print the top level section title (versus level above current) + case "{METASECTIONTITLE}": // This will print the top level section title (versus level above current) starting from a sub-section case "[METASECTIONTITLE]": if (section.MyParent.IsSection) { @@ -2000,6 +2000,21 @@ i = 0; else plstr = plstr.Replace(token, string.Empty); break; + case "{TOPSECTIONTITLE}": // This will print the top level section title + case "[TOPSECTIONTITLE]": + // get top most section: + { + ItemInfo top = section; + while (top.MyParent != null && !top.MyParent.IsProcedure) + { + top = top.MyParent; + } + if (top.IsSection) + plstr = SplitTitle(svgGroup, pageItem, top.DisplayText, section.ActiveFormat.PlantFormat.FormatData.SectData.SectionTitleLength, token, plstr, section.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumberAndTitleLength); + else + plstr = plstr.Replace(token, string.Empty); + } + break; case "{SECTIONLEVELNUMBER}": case "[SECTIONLEVELNUMBER]": // don't put out section title/number if doing SAMG facing pages @@ -2020,7 +2035,7 @@ i = 0; plstr = plstr.Substring(3); //svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.DisplayNumber))); break; - case "{METASECTIONNUMBER}": // This will print the top level section number + case "{METASECTIONNUMBER}": // This will print the top level section number when starting from a sub-section case "[METASECTIONNUMBER]": if (section.MyParent.IsSection) { @@ -2035,6 +2050,21 @@ i = 0; else plstr = plstr.Replace(token, string.Empty); break; + case "{TOPSECTIONNUMBER}": // This will print the top level section number + case "[TOPSECTIONNUMBER]": + // get top most section: + { + ItemInfo top = section; + while (top.MyParent != null && !top.MyParent.IsProcedure) + { + top = top.MyParent; + } + if (top.IsSection) + plstr = plstr.Replace(token, top.DisplayNumber); + else + plstr = plstr.Replace(token, string.Empty); + } + break; case "{UNITTEXT}": case "[UNITTEXT]": plstr = plstr.Replace(token, MySection.MyDocVersion.DocVersionConfig.Unit_Text); diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 8f441dfa..dea6c919 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -2338,7 +2338,8 @@ namespace Volian.Print.Library else { // Center the bottom message float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; - xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2; + //B2022-126 was using the wrong font definition to calaculate the centering position + xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * docstyle.End.Font.CharsToTwips)) / 2; xpos = Math.Max(xpos, XOffsetBox + (float)docstyle.Layout.LeftMargin); vlnText vttmp = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font); MyPageHelper.BottomMessage.Add(vttmp); @@ -6078,7 +6079,15 @@ namespace Volian.Print.Library { level = level <= 2 ? 1 : level - 1; if (level == 1) - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (level * (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos); + { + // Use the section number position for the section title when the section number is blank + if (formatInfo.PlantFormat.FormatData.SectData.SectionHeader.UseNumPosWhenNumBlank && MyTab != null && MyTab.Text.Trim().Length == 0) + { + XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + ((float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos); + } + else + XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (level * (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos); + } else if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) XOffset = (myTab == null ? 0 : myTab.XOffset) + ((float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos - (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos); else