Changed how ROFSTLookup object was obtained based on correct DocVersion

Added code to support other variations of how unit information is entered into text
This commit is contained in:
Rich 2014-02-07 17:41:59 +00:00
parent 8de1e073ee
commit 2cf8e67bd7

View File

@ -220,9 +220,18 @@ namespace Volian.Controls.Library
text = DoReplaceWords2(text); text = DoReplaceWords2(text);
if (_MyItemInfo != null) if (_MyItemInfo != null)
{ {
text = DoSearchAndReplace(text, "<U-ID>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ID); text = Regex.Replace(text, @"\<U\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)ID)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)NAME)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Name, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)TEXT)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Text, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)NUMBER)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER ID)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_ID, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER NAME)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_Name, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER TEXT)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_Text, RegexOptions.IgnoreCase);
text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER NUMBER)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_Number, RegexOptions.IgnoreCase);
//text = DoSearchAndReplace(text, "<U-ID>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ID);
text = text.Replace(@"<S\u8209?ID>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID); text = text.Replace(@"<S\u8209?ID>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID);
text = text.Replace("<U>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number); //text = text.Replace("<U>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number);
} }
// Adjust RO display // Adjust RO display
if (ROsShouldBeAdjusted) if (ROsShouldBeAdjusted)
@ -356,7 +365,7 @@ namespace Volian.Controls.Library
int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16);
int rodbid = int.Parse(myMatch.Groups[3].Value); int rodbid = int.Parse(myMatch.Groups[3].Value);
ROFstInfo myROFst = _MyItemInfo.MyDocVersion.GetROFst(rodbid); ROFstInfo myROFst = _MyItemInfo.MyDocVersion.GetROFst(rodbid);
bool isSetpoint=myROFst.IsSetpointDB(dbid); bool isSetpoint=myROFst.IsSetpointDB(dbid, _MyItemInfo.MyDocVersion);
string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO, isSetpoint); string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO, isSetpoint);
newvalue = DoROReplaceWords(_MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList, newvalue, _MyItemInfo.IsHigh); newvalue = DoROReplaceWords(_MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList, newvalue, _MyItemInfo.IsHigh);
if (isSetpoint) newvalue = ReplaceSpaceWithHardspace(newvalue); if (isSetpoint) newvalue = ReplaceSpaceWithHardspace(newvalue);
@ -1719,7 +1728,7 @@ namespace Volian.Controls.Library
int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16);
int rodbid = int.Parse(myMatch.Groups[3].Value); int rodbid = int.Parse(myMatch.Groups[3].Value);
ROFstInfo myROFst = myDocVersion.GetROFst(rodbid); ROFstInfo myROFst = myDocVersion.GetROFst(rodbid);
return myROFst.IsSetpointDB(dbid); return myROFst.IsSetpointDB(dbid, myDocVersion);
} }
return false; return false;
} }