From f73d9b1af50533d8ba3862b574d929ababdbc94c Mon Sep 17 00:00:00 2001 From: John Date: Thu, 23 Apr 2015 17:06:26 +0000 Subject: [PATCH] Better formatting of text for RO Summary report. Also handle degree and delta characters --- .../Config/ROFSTLookup.cs | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 180b1936..5a81ad76 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -473,7 +473,7 @@ namespace VEPROMS.CSLA.Library // Return the RO Title in a list of strings // The last item in the list is the actual RO title, the items preceding it are the // titles of the groups and sub-groups containing the RO - public List GetROTitleAndGroupPath(string ROID, bool reportMissingROs) + public List GetROTitleAndGroupPath(string ROID, bool reportMissingROs, bool convertCaretToDelta) { List titlePath = new List(); rochild roc = GetRoChild12(ROID); @@ -482,10 +482,17 @@ namespace VEPROMS.CSLA.Library string tmp = roc.title; if (roc.appid != "") if (roc.title.Contains(roc.appid)) - tmp = roc.title.Replace(roc.appid, string.Format("<{0}>", roc.appid)).Trim(); - else - tmp = string.Format("[{0}] {1}", roc.appid, roc.title); - titlePath.Add(tmp); + //tmp = roc.title.Replace(roc.appid, string.Format("<{0}>", roc.appid)).Trim(); + // remove the setpoint ID (appid) from the title string and always put the sepoint ID + // at the beginning of the report line item. + tmp = roc.title.Replace(roc.appid, "").Trim(); + //else + tmp = string.Format("[{0}] {1}", roc.appid, tmp); + tmp = tmp.Replace("`", "\u00B0"); //degree + tmp = tmp.Replace("\xF8", "\u00B0"); //degree + if (convertCaretToDelta) + tmp = tmp.Replace("^", "\u0394"); // delta + titlePath.Add(tmp); do { string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); @@ -500,22 +507,22 @@ namespace VEPROMS.CSLA.Library return titlePath; } - public List GetROTitleAndGroupPathForSummary(string ROID) - { - List titlePath = new List(); - rochild roc = GetRoChild(ROID); - string tmp = roc.title.Replace(roc.appid, string.Format("<{0}>",roc.appid)).Trim(); - titlePath.Add(tmp); - do - { - string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); - roc = GetRoChild(parent); - if (roc.ID > 0) - titlePath.Add(roc.title); - } while (roc.ID > 0); - titlePath.Reverse(); - return titlePath; - } + //public List GetROTitleAndGroupPathForSummary(string ROID) + //{ + // List titlePath = new List(); + // rochild roc = GetRoChild(ROID); + // string tmp = roc.title.Replace(roc.appid, string.Format("<{0}>",roc.appid)).Trim(); + // titlePath.Add(tmp); + // do + // { + // string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); + // roc = GetRoChild(parent); + // if (roc.ID > 0) + // titlePath.Add(roc.title); + // } while (roc.ID > 0); + // titlePath.Reverse(); + // return titlePath; + //} public DateTime GetRoFSTdts() { return MyDocVersionInfo.DocVersionAssociations[0].MyROFst.DTS;