From b427d24b63388fb19062120e4ff6c489a30582c8 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 21 May 2015 17:57:07 +0000 Subject: [PATCH] Allow for multi-line step designators --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 2ac3afc0..d1446de3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2246,6 +2246,25 @@ namespace VEPROMS.CSLA.Library return ConvertToDisplayText(str,false); } } + // Used in Comanche Peak EOP and Flex formats for step designators. Will allow a hard return to be used that that caution type. + // need to use the SameRowAsParentMultiLines format flag in that step type. + // regular DisplayText will convert the hard return to a semi-colon. + public string MulitLineStepDesignatorDisplayText + { + get + { + string str = MyContent.Text; + if (MyDocVersion != null) + { + str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number); + } + else + { + _MyLog.WarnFormat("Disconnected Data - ItemID = {0}", ItemID); + } + return ConvertToMulitLineStepDesignatorDisplayText(str); + } + } public string DisplayText { get @@ -2293,6 +2312,19 @@ namespace VEPROMS.CSLA.Library } //get { return ConvertToDisplayText(MyContent.Number); } } + // for step designators (a redefined caution type used in Comanche Peak with the SameRowAsParentMultiLines format flag) + // we what to allow for a hard return to allow for multiple designator lines - jsj 5/21/2015 + public static string ConvertToMulitLineStepDesignatorDisplayText(string txt) + { + string retval = txt; + retval = StripRtfFormatting(retval); + retval = StripLinks(retval); + retval = ReplaceSpecialCharacters(retval); + retval = retval.Replace("\u2011", "-"); + retval = retval.Replace("\r\n", @"\line"); + retval = retval.Replace("\n", @"\line"); + return retval; + } public static string ConvertToDisplayText(string txt) { return ConvertToDisplayText(txt, true); @@ -2505,6 +2537,13 @@ namespace VEPROMS.CSLA.Library return ActiveFormat.PlantFormat.FormatData.StepDataList[FormatStepType].SameRowAsParent; } } + public bool SameRowAsParentMultiLines + { + get + { + return ActiveFormat.PlantFormat.FormatData.StepDataList[FormatStepType].SameRowAsParentMultiLines; + } + } public string WidthOverride { get