support for PROC.INI “RO’s” and convert dashes to non-breaking dashes, fix for Fortran format numbers

removed the space from “Procedure Number” for the get profile of ProcedureNumber
Added Unit Specific logic
This commit is contained in:
2011-09-22 19:54:03 +00:00
parent bf8ee98a53
commit e9865f3250
4 changed files with 55 additions and 15 deletions

View File

@@ -233,7 +233,7 @@ namespace VEPROMS.CSLA.Library
if (rochld.children != null)
{
foreach (rochild child in rochld.children)
if (child.roid.ToUpper() == ROID16)
if (child.roid.ToUpper() == ROID16 || (child.roid.EndsWith("0041") && ROID16.EndsWith("0000")))
return child.value;
// if there isn't a specific match for multi-return values, default to the first child.
return rochld.children[0].value;
@@ -919,6 +919,7 @@ namespace VEPROMS.CSLA.Library
#region FortranFormat
public static string ConvertFortranFormatToScienctificNotation(string str)
{
str = str.Replace(@"\u8209?", "-");
string retval = Regex.Replace(str, "([+-]?)([0-9]+)[.]([0-9]*?)0*E([+-]?[0-9]+)", new MatchEvaluator(FixFortranNumber));
retval = Regex.Replace(retval, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript
retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript
@@ -926,7 +927,7 @@ namespace VEPROMS.CSLA.Library
}
private static string FixFortranNumber(Match match)
{
StringBuilder sb = new StringBuilder(match.Groups[1].Value);
StringBuilder sb = new StringBuilder(match.Groups[1].Value.Replace("-",@"\u8209?"));
if (match.Groups[3].Length == 0) // Nothing to the right of the decimal
if (match.Groups[2].Value != "1") // Other than "1", multiply it times 10 raised to a power
sb.Append(match.Groups[2].Value + "x10");
@@ -935,7 +936,7 @@ namespace VEPROMS.CSLA.Library
else // A number with a decimal point
sb.Append(match.Groups[2].Value + "." + match.Groups[3].Value + "x10");
// Add the exponent as superscript
return sb.ToString() + "\\up2 " + match.Groups[4].Value + "\\up0 ";
return sb.ToString() + "\\up2 " + match.Groups[4].Value.Replace("-",@"\u8209?") + "\\up0 ";
}
#endregion
}