BGE: Handle {} around ro values

BGE: Added an x-Location of end message for a section
Use x-location of end message for a section; tab format for sequential tabs at 4th level; hls tab spaces; indent in transition format 9
BGE: Use x-location of end message for a section
BGE: support for top continue messages that contain tab for continued step
resolve {Step Text} token in transition; modify code that processes transition format to use collection matches rather than search for ‘{‘
support AllUnits ro flag
support ‘{‘ and ‘}’ around ro value
top continue message with tab; location of top continue message in both AER/RNO columns for dual column; support indent in transition format during print
support two top continue messages (aer/rno) that can have different text; fix bug in splitting procedure title text if it contains hard spaces
This commit is contained in:
Kathy Ruffing 2014-04-29 13:12:10 +00:00
parent c62a63b151
commit f332618227
11 changed files with 167 additions and 46 deletions

View File

@ -81,6 +81,8 @@ namespace DataLoader
{ {
roval = roval.Substring(0, roval.IndexOf('\n')); roval = roval.Substring(0, roval.IndexOf('\n'));
} }
roval = roval.Replace("{", @"\{");
roval = roval.Replace("}", @"\}");
// add an annotation stating "Invalid Unit RO 'ROID'. Need an Item for this, so just add // add an annotation stating "Invalid Unit RO 'ROID'. Need an Item for this, so just add
// it to a list of 'invalid ros' so that calling method can add annotations to the Item. // it to a list of 'invalid ros' so that calling method can add annotations to the Item.
if (roval == "?") if (roval == "?")

View File

@ -428,6 +428,11 @@ namespace VEPROMS.CSLA.Library
itemInfo.ActiveSection = sectionInfo; itemInfo.ActiveSection = sectionInfo;
itemInfo.MyProcedure = procInfo; itemInfo.MyProcedure = procInfo;
itemInfo.MyDocVersion = docVersionInfo; itemInfo.MyDocVersion = docVersionInfo;
if (itemInfo.IsStep)
{
ItemInfo ip = itemParent as ItemInfo;
itemInfo.CombinedTab = (ip == null) ? itemInfo.MyTab.CleanText.Trim() : GetCombinedTab(itemInfo, ip.CombinedTab);
}
if (itemInfo.MyContent.ContentGridCount > 0) if (itemInfo.MyContent.ContentGridCount > 0)
itemInfo.MyContent.LoadNonCachedGrid(); itemInfo.MyContent.LoadNonCachedGrid();
if (itemInfo.MyContent.ContentPartCount > 0) if (itemInfo.MyContent.ContentPartCount > 0)
@ -500,6 +505,20 @@ namespace VEPROMS.CSLA.Library
// Console.WriteLine("Items: {0}", TimeSpan.FromTicks(ticksItems).TotalSeconds); // Console.WriteLine("Items: {0}", TimeSpan.FromTicks(ticksItems).TotalSeconds);
// Console.WriteLine("Transitions: {0}", TimeSpan.FromTicks(ticksTrans).TotalSeconds); // Console.WriteLine("Transitions: {0}", TimeSpan.FromTicks(ticksTrans).TotalSeconds);
//} //}
internal static string GetCombinedTab(ItemInfo itemInfo, string parTab)
{
string pTab = parTab == null ? "" : parTab;
string thisTab = itemInfo.MyTab.CleanText.Trim();
if (itemInfo.FormatStepData.NumberWithLevel) pTab = itemInfo.MyHLS.MyTab.CleanText.Trim();
// if the parent tab ends with a alphanumeric and this tab is alphanumeric, add a '.' to separate them
bool ms = pTab != "" && char.IsLetterOrDigit(pTab.TrimEnd()[pTab.Length - 1]); // parent tab ends with alphanumeric
bool mn = thisTab.TrimStart().Length > 0 && char.IsLetterOrDigit(thisTab.TrimStart()[0]);// this starts with alpha
if (ms && mn) pTab = pTab.TrimEnd() + ".";
// remove ending '.' (if this is a hls, don't remove the '.')
if (!itemInfo.IsHigh && thisTab.EndsWith(".")) thisTab = thisTab.Substring(0, thisTab.Length - 1);
return pTab + thisTab.Trim();
}
internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup) internal static void SetParentSectionAndDocVersion(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
{ {
if (itemInfo == null) return; if (itemInfo == null) return;
@ -509,6 +528,11 @@ namespace VEPROMS.CSLA.Library
// itemInfo.ActiveSection = (itemInfo as SectionInfo) ?? sectionInfo; // itemInfo.ActiveSection = (itemInfo as SectionInfo) ?? sectionInfo;
itemInfo.ActiveSection = sectionInfo; itemInfo.ActiveSection = sectionInfo;
itemInfo.MyDocVersion = docVersionInfo; itemInfo.MyDocVersion = docVersionInfo;
if (itemInfo.IsStep)
{
ItemInfo ip = itemParent as ItemInfo;
itemInfo.CombinedTab = (ip == null) ? itemInfo.MyTab.CleanText.Trim() : GetCombinedTab(itemInfo, ip.CombinedTab);
}
ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst; ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst;
//rofstinfo.docVer = docVersionInfo; //rofstinfo.docVer = docVersionInfo;
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo); ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo);
@ -2298,7 +2322,13 @@ namespace VEPROMS.CSLA.Library
return _MyHLS; return _MyHLS;
} }
} }
private string _CombinedTab = null;
public string CombinedTab
{
get { return _CombinedTab; }
set { _CombinedTab = value; }
}
private DocVersionInfo _MyDocVersion = null; private DocVersionInfo _MyDocVersion = null;
public DocVersionInfo MyDocVersion public DocVersionInfo MyDocVersion

View File

@ -516,6 +516,7 @@ namespace VEPROMS.CSLA.Library
_AppendMethods.Add("{Sect Num}", AddTranGetSectionNumber); _AppendMethods.Add("{Sect Num}", AddTranGetSectionNumber);
_AppendMethods.Add("{Sect Number}", AddTranGetSectionNumber); // WCN2, tran type 6 _AppendMethods.Add("{Sect Number}", AddTranGetSectionNumber); // WCN2, tran type 6
_AppendMethods.Add("{Page Num}", AddPageNumber); _AppendMethods.Add("{Page Num}", AddPageNumber);
_AppendMethods.Add("{Step Text}", AddStepText);
} }
public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem, bool hasPageNum) public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem, bool hasPageNum)
{ {
@ -599,14 +600,20 @@ namespace VEPROMS.CSLA.Library
return "?"; return "?";
int startIndex = 0; int startIndex = 0;
int index = -1; int index = -1;
int rexIndex = -1;
string prefix = null; string prefix = null;
string prevToken = null; string prevToken = null;
bool lastAdded = false; bool lastAdded = false;
while ((index = tb._TransFormat.IndexOf("{", startIndex)) > -1) MatchCollection mc = Regex.Matches(tb._TransFormat, @"{(Proc Num|\?\.Proc Num|Proc Title|\?\.Proc Title|" +
@"First Step|Step Number|Last Step|\.|Sect Hdr|\?\.Sect Hdr|Sect Title|\?\.Sect Title|\?\.Sect Num|Sect Num|" +
@"Sect Number|Page Num|Step Text)}");
foreach (Match m in mc)
{ {
string tmppref = prefix; string tmppref = prefix;
prefix = null; prefix = null;
if (index > startIndex) prefix = tb._TransFormat.Substring(startIndex, index - startIndex); rexIndex = m.Index;
int rexEndToken = m.Index + m.Length - 1;
if (rexIndex > startIndex) prefix = tb._TransFormat.Substring(startIndex, rexIndex - startIndex);
if (prefix == null) prevToken = null; if (prefix == null) prevToken = null;
// if the last token did not add anything to the buffer, still want to put the text prefix in: // if the last token did not add anything to the buffer, still want to put the text prefix in:
if (!lastAdded && prefix == null) prefix = tmppref; if (!lastAdded && prefix == null) prefix = tmppref;
@ -615,20 +622,19 @@ namespace VEPROMS.CSLA.Library
tb.Append(prefix); tb.Append(prefix);
prefix = ""; prefix = "";
} }
int endtokn = tb._TransFormat.IndexOf("}", index); string token = tb._TransFormat.Substring(rexIndex, rexEndToken - rexIndex + 1);
string token = tb._TransFormat.Substring(index, endtokn - index + 1);
// we need to flag condition where the step number already has the section number in it. For example, Wolf Creek // we need to flag condition where the step number already has the section number in it. For example, Wolf Creek
// using WCN2, has some sections whose section number is 'D' and the step number is 'D1', or 'D2'. The resolved // using WCN2, has some sections whose section number is 'D' and the step number is 'D1', or 'D2'. The resolved
// transition text was coming out as 'DD1'. The format's HLS tab format contains '{Section Prefix}' whose implementation // transition text was coming out as 'DD1'. The format's HLS tab format contains '{Section Prefix}' whose implementation
// adds the section number to the tab. // adds the section number to the tab.
if (token.Contains("Sect Num") && tb._TransFormat.Length > endtokn + 1) if (token.Contains("Sect Num") && tb._TransFormat.Length > rexEndToken + 1)
{ {
int nxtTokenS = tb._TransFormat.IndexOf("{", endtokn); int nxtTokenS = tb._TransFormat.IndexOf("{", rexEndToken);
if (nxtTokenS > -1 && nxtTokenS == endtokn+1) // the {step} token has to immediately follow the section num token if (nxtTokenS > -1 && nxtTokenS == rexEndToken + 1) // the {step} token has to immediately follow the section num token
{ {
int nxtTokenE = tb._TransFormat.IndexOf("}", nxtTokenS); int nxtTokenE = tb._TransFormat.IndexOf("}", nxtTokenS);
string nxtToken = tb._TransFormat.Substring(nxtTokenS, nxtTokenE - nxtTokenS + 1); string nxtToken = tb._TransFormat.Substring(nxtTokenS, nxtTokenE - nxtTokenS + 1);
tb.SectNumWithStepNum = tb._ToItem.IsStep && nxtToken.Contains("Step") tb.SectNumWithStepNum = tb._ToItem.IsStep && nxtToken.Contains("Step")
&& tb._ToItem.MyHLS.FormatStepData.TabData.IdentPrint.Contains("{Section Prefix}"); && tb._ToItem.MyHLS.FormatStepData.TabData.IdentPrint.Contains("{Section Prefix}");
} }
} }
@ -648,7 +654,7 @@ namespace VEPROMS.CSLA.Library
} }
else else
tb.Append("\\" + token.Substring(0, token.Length - 1) + "\\}"); tb.Append("\\" + token.Substring(0, token.Length - 1) + "\\}");
startIndex = endtokn + 1; startIndex = rexEndToken + 1;
prevToken = token; prevToken = token;
if (startIndex >= tb._TransFormat.Length) break; if (startIndex >= tb._TransFormat.Length) break;
} }
@ -926,6 +932,13 @@ namespace VEPROMS.CSLA.Library
tb._UsedRangeAncestor = usedRangeAncestor; tb._UsedRangeAncestor = usedRangeAncestor;
return true; return true;
} }
private static bool AddStepText(TransitionBuilder tb)
{
tb.AppendPrefix();
string txt = tb._ToItem.MyContent.Text;
tb.Append(txt);
return true;
}
private static Dictionary<int, ItemInfo> GetAncestors(ItemInfo itemInfo) private static Dictionary<int, ItemInfo> GetAncestors(ItemInfo itemInfo)
{ {
Dictionary<int, ItemInfo> retval = new Dictionary<int,ItemInfo>(); Dictionary<int, ItemInfo> retval = new Dictionary<int,ItemInfo>();

View File

@ -720,6 +720,14 @@ namespace VEPROMS.CSLA.Library
return Message == null ? null : Message.Replace("\n","\r\n"); return Message == null ? null : Message.Replace("\n","\r\n");
} }
} }
private LazyLoad<float?> _Margin;
public float? Margin
{
get
{
return LazyLoad(ref _Margin, "@Margin");
}
}
#endregion #endregion
} }
#endregion #endregion

View File

@ -410,11 +410,19 @@ namespace Volian.Controls.Library
// if it turns out that if ro's have any embedded unicode characters this needs expanded, such as /u8209? (hard hyphen) // if it turns out that if ro's have any embedded unicode characters this needs expanded, such as /u8209? (hard hyphen)
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:(ReferencedObject|Transition[^:]*?):.*?\[END>"); string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:(ReferencedObject|Transition[^:]*?):.*?\[END>");
MatchCollection matches = Regex.Matches(text, lookFor); MatchCollection matches = Regex.Matches(text, lookFor);
string prevValue = null;
for (int i = matches.Count - 1; i >= 0; i--) for (int i = matches.Count - 1; i >= 0; i--)
{ {
Match m = matches[i]; Match m = matches[i];
if (m != null && m.Groups.Count > 6 && m.Groups[6].ToString() == "ReferencedObject") if (m != null && m.Groups.Count > 6 && m.Groups[6].ToString() == "ReferencedObject")
{ {
// if previous processed (next ro) was found, then see if it has an 'and' between it and the previous
if (prevValue != null)
{
int endIndx = m.Index + m.Length;
string tr = text.Substring(endIndx).Replace(@"\v0","").TrimStart();
if (!tr.ToUpper().StartsWith("AND")) prevValue = null;
}
System.Text.RegularExpressions.Group g = m.Groups[3]; System.Text.RegularExpressions.Group g = m.Groups[3];
string beforeRO = StaticStripRtfCommands(text.Substring(0, g.Index)); string beforeRO = StaticStripRtfCommands(text.Substring(0, g.Index));
string afterRO = StaticStripRtfCommands(text.Substring(g.Index + g.Length)); string afterRO = StaticStripRtfCommands(text.Substring(g.Index + g.Length));
@ -425,7 +433,8 @@ namespace Volian.Controls.Library
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, _MyItemInfo.MyDocVersion); bool isSetpoint=myROFst.IsSetpointDB(dbid, _MyItemInfo.MyDocVersion);
string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO, isSetpoint); string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO, isSetpoint, prevValue);
if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits) prevValue = newvalue;
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);
if (g.ToString() != newvalue) if (g.ToString() != newvalue)
@ -1240,13 +1249,14 @@ namespace Volian.Controls.Library
// string spaces = @" \u160?"; // string spaces = @" \u160?";
// return (spaces.IndexOf(ch) >= 0); // return (spaces.IndexOf(ch) >= 0);
//} //}
private string DoROFormatFlags(string roText, string beforeRO, string afterRO, bool isSetpoint) private string DoROFormatFlags(string roText, string beforeRO, string afterRO, bool isSetpoint, string prevValue)
{ {
string rtnstr = roText; string rtnstr = roText;
// The RO text is being changed to match it's context. Since it is changed in reverse order, the text before the RO // The RO text is being changed to match it's context. Since it is changed in reverse order, the text before the RO
// should ignore other RO text. // should ignore other RO text.
beforeRO = Regex.Replace(beforeRO, @"\<START\].*?#Link:Refer.*?\[END\>", ""); // Remove any RO Values. beforeRO = Regex.Replace(beforeRO, @"\<START\].*?#Link:Refer.*?\[END\>", ""); // Remove any RO Values.
beforeRO = Regex.Replace(beforeRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments beforeRO = Regex.Replace(beforeRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments
string allUnitAfterRo = afterRO;
afterRO = Regex.Replace(afterRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments afterRO = Regex.Replace(afterRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments
// Underline all ROs, values and Units // Underline all ROs, values and Units
@ -1330,26 +1340,19 @@ namespace Volian.Controls.Library
//In a sequence of RO values, the unit appears with every value //In a sequence of RO values, the unit appears with every value
//(e.g., "25 gpm and 30 gpm" vs. "25 and 30 gpm") //(e.g., "25 gpm and 30 gpm" vs. "25 and 30 gpm")
//if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits) if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits && prevValue != null)
//{ {
// int idx = rtnstr.LastIndexOf(' '); string units = null;
// if (idx > 0) Match m = Regex.Match(prevValue, "[^0-9]");
// { if (m.Success)
// StringBuilder sb = new StringBuilder(); {
// string lastunit = rtnstr.Substring(idx); // RO unit including preceeding space units = prevValue.Substring(m.Index);
// int idx2 = rtnstr.IndexOf(lastunit); if (rtnstr.EndsWith(units))
// int si = 0; {
// while (idx2 < idx) rtnstr = rtnstr.Replace(units, "");
// { }
// sb.Append(rtnstr.Substring(si, idx2 - si)); }
// si = idx2 + lastunit.Length; }
// idx2 = rtnstr.IndexOf(lastunit, si);
// }
// sb.Append(rtnstr.Substring(si));
// rtnstr = sb.ToString();
// }
//}
return rtnstr; return rtnstr;
} }
/// <summary> /// <summary>

View File

@ -1087,6 +1087,8 @@ namespace Volian.Controls.Library
SelectionLength = 0; SelectionLength = 0;
linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 "); linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 ");
linkValue = linkValue.Replace("\\u916?", "\\f1\\u916?\\f0 "); linkValue = linkValue.Replace("\\u916?", "\\f1\\u916?\\f0 ");
linkValue = linkValue.Replace(@"{", @"\{");
linkValue = linkValue.Replace(@"}", @"\}");
SelectedRtf = @"{\rtf1\ansi"+FontTable+@"{\colortbl ;\red255\green0\blue0;}\v"+FontSize+@" <START]\v0\cf1 " + linkValue + @"\cf0\v " + linkUrl + @"[END>\v0 }"; SelectedRtf = @"{\rtf1\ansi"+FontTable+@"{\colortbl ;\red255\green0\blue0;}\v"+FontSize+@" <START]\v0\cf1 " + linkValue + @"\cf0\v " + linkUrl + @"[END>\v0 }";
this.SelectionLength = 0; this.SelectionLength = 0;
this.SelectionStart = position; this.SelectionStart = position;

View File

@ -32,13 +32,18 @@ namespace Volian.Print.Library
get { return _CheckListBoxes; } get { return _CheckListBoxes; }
set { _CheckListBoxes = value; } set { _CheckListBoxes = value; }
} }
private vlnText _TopMessage; private vlnText _TopMessage;
public vlnText TopMessage public vlnText TopMessage
{ {
get { return _TopMessage; } get { return _TopMessage; }
set { _TopMessage = value; } set { _TopMessage = value; }
} }
private vlnText _TopMessageR; // Added if there are 2 messages, in AER AND RNO (for BGE)
public vlnText TopMessageR
{
get { return _TopMessageR; }
set { _TopMessageR = value; }
}
private vlnText _BottomMessage; private vlnText _BottomMessage;
public vlnText BottomMessage public vlnText BottomMessage
{ {
@ -387,6 +392,11 @@ namespace Volian.Print.Library
TopMessage.ToPdf(cb, 0, ref tmp, ref tmp); TopMessage.ToPdf(cb, 0, ref tmp, ref tmp);
TopMessage = null; // Only output it once. TopMessage = null; // Only output it once.
} }
if (TopMessageR != null)
{
TopMessageR.ToPdf(cb, 0, ref tmp, ref tmp);
TopMessageR = null; // Only output it once.
}
if (BottomMessage != null) if (BottomMessage != null)
{ {
BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp); BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp);
@ -1617,9 +1627,9 @@ namespace Volian.Print.Library
indx += m.Length - 1; indx += m.Length - 1;
width++; width++;
} }
else else
{ {
m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]"); m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]"); // 3 char unicode, for example \u160? (hardspace)
if (m.Success) if (m.Success)
{ {
indx += m.Length - 1; indx += m.Length - 1;
@ -1627,11 +1637,20 @@ namespace Volian.Print.Library
} }
else else
{ {
m = Regex.Match(text.Substring(indx), @"^\\[^ ]*? "); m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]");
if (m.Success) if (m.Success)
{ {
indx += m.Length - 1; indx += m.Length - 1;
rtfprefix = AdjustRtfPrefix(rtfprefix, m.Value); width++;
}
else
{
m = Regex.Match(text.Substring(indx), @"^\\[^ ]*? ");
if (m.Success)
{
indx += m.Length - 1;
rtfprefix = AdjustRtfPrefix(rtfprefix, m.Value);
}
} }
} }
} }

View File

@ -1044,11 +1044,29 @@ namespace Volian.Print.Library
DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart);
if (EmptyTopMostPart) yPageStart += SixLinesPerInch; if (EmptyTopMostPart) yPageStart += SixLinesPerInch;
myMsg = docstyle.Continue.Top.Message; myMsg = docstyle.Continue.Top.Message;
MyPageHelper.TopMessageR = null;
if (myMsg != null && myMsg != "") if (myMsg != null && myMsg != "")
{ {
yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message
if (myMsg.IndexOf(@"%sR") > -1) // KBR NEEDS MUCH MORE WORK, i.e. substep tabs concatenated onto step tabs, AER vs RNO if (myMsg.IndexOf(@"%sR") > -1)
myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.MyTab.Text); {
ItemInfo myAer = MyItemInfo.IsHigh?MyItemInfo:MyItemInfo.MyParent;
if (MyItemInfo.IsInRNO)
{
if (MyItemInfo.IsNote || MyItemInfo.IsCaution)
myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.MyParent.CombinedTab);
else
myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.CombinedTab);
float xor = MyTopRNO.MyTab.XOffset;
MyPageHelper.TopMessageR = new vlnText(cb, this, myMsg, myMsg, xor, yTopMargin + 0.1F, docstyle.Continue.Top.Font);
// get aer message, go up parent until find aer and use its combined tab:
myAer = MyItemInfo;
while (myAer.IsInRNO) myAer = myAer.MyParent;
}
myMsg = docstyle.Continue.Top.Message.Replace(@"%sR", myAer.CombinedTab);
}
if (myMsg.IndexOf(@"%s") > -1)
myMsg = myMsg.Replace(@"%s", MyItemInfo.MyParent.CombinedTab);
if (myMsg.IndexOf(@"%3d") > -1) if (myMsg.IndexOf(@"%3d") > -1)
myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString()); myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString());
if (myMsg.IndexOf(@"%d") > -1) if (myMsg.IndexOf(@"%d") > -1)
@ -1188,20 +1206,28 @@ namespace Volian.Print.Library
{ {
msg_yLocation = yTopMargin - (float)(docstyle.End.Flag * SixLinesPerInch); msg_yLocation = yTopMargin - (float)(docstyle.End.Flag * SixLinesPerInch);
} }
if (docstyle.End.Flag < 0) // Adjust this many lines down the page.
{
float adjMsgY = (float)(-docstyle.End.Flag * SixLinesPerInch);
if (msg_yLocation - adjMsgY > docstyle.Layout.FooterLength) msg_yLocation = msg_yLocation - adjMsgY;
}
if (myMsg.Contains("{Section Number}")) myMsg = myMsg.Replace("{Section Number}", MyItemInfo.ActiveSection.DisplayNumber); if (myMsg.Contains("{Section Number}")) myMsg = myMsg.Replace("{Section Number}", MyItemInfo.ActiveSection.DisplayNumber);
//jcb code //jcb code
//if (myMsg.Contains("%-8s")) //if (myMsg.Contains("%-8s"))
// myMsg = myMsg.Replace("%-8s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(8)); // myMsg = myMsg.Replace("%-8s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(8));
if (myMsg.Contains("%-12s")) if (myMsg.Contains("%-12s"))
myMsg = myMsg.Replace("%-12s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(12)); myMsg = myMsg.Replace("%-12s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(12));
//end jb code float xpos = 0;
// center the message. if ((docstyle.End.Margin ?? 0) != 0)
float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin;
float centerpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2; else
centerpos = Math.Max(centerpos, XOffsetBox + (float)docstyle.Layout.LeftMargin); {
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, centerpos, msg_yLocation, docstyle.End.Font); float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin;
MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height)); xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2;
xpos = Math.Max(xpos, XOffsetBox + (float)docstyle.Layout.LeftMargin);
MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height));
}
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font);
} }
} }
if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2},{3}", MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, MyItemInfo.ItemID, yLocalypagestart, yPageStart); if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2},{3}", MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, MyItemInfo.ItemID, yLocalypagestart, yPageStart);
@ -2603,6 +2629,7 @@ namespace Volian.Print.Library
stText = stText.Replace(@"\ulnone ", ""); stText = stText.Replace(@"\ulnone ", "");
stText = stText.Replace(@"\ulnone", ""); stText = stText.Replace(@"\ulnone", "");
} }
if (stText.Contains("{IND}")) stText = stText.Replace("{IND}", "\x5");
if (itemInfo.IsSection && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Level0Big && itemInfo.MyParent.IsProcedure) if (itemInfo.IsSection && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Level0Big && itemInfo.MyParent.IsProcedure)
myFont = new System.Drawing.Font(myFont.FontFamily, 14, myFont.Style | FontStyle.Bold); myFont = new System.Drawing.Font(myFont.FontFamily, 14, myFont.Style | FontStyle.Bold);
_RtfSB.Append(AddFontTable(myFont)); _RtfSB.Append(AddFontTable(myFont));

View File

@ -90,6 +90,7 @@ public struct DocStyle
public bool CBNoOverrideSpace; // Added for farley pagination of bottomcontinue message public bool CBNoOverrideSpace; // Added for farley pagination of bottomcontinue message
public VE_Font ContStyle; // Style of continue messages public VE_Font ContStyle; // Style of continue messages
public short EndFlag; // Does end statement exist for this type public short EndFlag; // Does end statement exist for this type
public float EndMargin; // Added for BGE - need to position the end message (differs for single vs dual column)
public VE_Font EndStyle; // Style of end message at end of page public VE_Font EndStyle; // Style of end message at end of page
public string ContTop; // Message at top of page public string ContTop; // Message at top of page
public string ContBottom; // Message at bottom of page public string ContBottom; // Message at bottom of page
@ -1073,6 +1074,7 @@ namespace fmtxml
{ {
dc.EndString = null; dc.EndString = null;
dc.EndFlag = 0; dc.EndFlag = 0;
dc.EndMargin = 0;
} }
if (offst[3] != 0) dc.FinalMsg = DoReplaceTokens(GetAsciiStringUntilNull(brFmt)); if (offst[3] != 0) dc.FinalMsg = DoReplaceTokens(GetAsciiStringUntilNull(brFmt));
else dc.FinalMsg = null; else dc.FinalMsg = null;

View File

@ -15,7 +15,14 @@ namespace fmtxml
fmtdata.SectData.SectionHeader.Level0Big = "True"; fmtdata.SectData.SectionHeader.Level0Big = "True";
fmtdata.SectData.StepSectionData.StpSectLayData.ColS = 30; fmtdata.SectData.StepSectionData.StpSectLayData.ColS = 30;
fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = "0,192,126"; fmtdata.SectData.StepSectionData.StpSectLayData.ColRTable = "0,192,126";
fmtdata.SectData.StepSectionData.SequentialTabFormat[4].TabFormat = "{seq})";
fmtdata.SectData.StepSectionData.SequentialTabFormat[4].PrintTabFormat = "{seq})";
fmtdata.TransData.UseSpecificTransitionModifier = "true"; fmtdata.TransData.UseSpecificTransitionModifier = "true";
fmtdata.StepData[2].TabData.Ident = " {numeric}. ";
fmtdata.StepData[2].TabData.IdentEdit = " {numeric}. ";
fmtdata.StepData[2].TabData.RNOIdent = " . ";
fmtdata.StepData[2].TabData.RNOIdentEdit = " . ";
fmtdata.StepData[6].SeparateBox = "True"; fmtdata.StepData[6].SeparateBox = "True";
//fmtdata.StepData[6].MatchUpRNO = "False"; //fmtdata.StepData[6].MatchUpRNO = "False";
fmtdata.StepData[7].SeparateBox = "True"; fmtdata.StepData[7].SeparateBox = "True";
@ -26,6 +33,7 @@ namespace fmtxml
fmtdata.TransData.TransTypeData[4].TransFormat = @"{Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}"; fmtdata.TransData.TransTypeData[4].TransFormat = @"{Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}";
fmtdata.TransData.TransTypeData[5].TransFormat = @"{Proc Num}, \ul {Proc Title}\ulnone , {Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}"; fmtdata.TransData.TransTypeData[5].TransFormat = @"{Proc Num}, \ul {Proc Title}\ulnone , {Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}";
fmtdata.TransData.TransTypeData[6].TransFormat = @"{Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}{Page Num}"; fmtdata.TransData.TransTypeData[6].TransFormat = @"{Sect Num}, \ul {Sect Title}\ulnone , Step {First Step}{Page Num}";
fmtdata.TransData.TransTypeData[9].TransFormat = @"{Proc Num} {IND}\ul {Proc Title}\ulnone ";
fmtdata.TransData.TransTypeData[10].TransFormat = @"{First Step}, \ul {Step Text}\ulnone {Page Num}"; fmtdata.TransData.TransTypeData[10].TransFormat = @"{First Step}, \ul {Step Text}\ulnone {Page Num}";
} }
private void AddBGEEOPOverridefmt(ref FormatData fmtdata) private void AddBGEEOPOverridefmt(ref FormatData fmtdata)
@ -84,9 +92,11 @@ namespace fmtxml
dcstyles.DcStyles[0].TopMargin = 96; dcstyles.DcStyles[0].TopMargin = 96;
dcstyles.DcStyles[1].PageLength = 600; dcstyles.DcStyles[1].PageLength = 600;
dcstyles.DcStyles[1].PageWidth = 552; dcstyles.DcStyles[1].PageWidth = 552;
dcstyles.DcStyles[1].EndMargin = 206;
dcstyles.DcStyles[2].CBMargin = 96; dcstyles.DcStyles[2].CBMargin = 96;
dcstyles.DcStyles[2].CBMarginR = 335; dcstyles.DcStyles[2].CBMarginR = 335;
dcstyles.DcStyles[2].CBLoc = 1; dcstyles.DcStyles[2].CBLoc = 1;
dcstyles.DcStyles[2].EndMargin = 75;
dcstyles.DcStyles[2].PageWidth = 552; dcstyles.DcStyles[2].PageWidth = 552;
dcstyles.DcStyles[2].CenterLineX = 240; dcstyles.DcStyles[2].CenterLineX = 240;
dcstyles.DcStyles[2].CenterLineYTop = 647; dcstyles.DcStyles[2].CenterLineYTop = 647;

View File

@ -239,6 +239,11 @@
<xsl:value-of select="../EndFlag"/> <xsl:value-of select="../EndFlag"/>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
<xsl:if test="../EndMargin != 'empty'">
<xsl:attribute name="Margin">
<xsl:value-of select="../EndMargin"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="Message"> <xsl:attribute name="Message">
<xsl:value-of select="../EndString"/> <xsl:value-of select="../EndString"/>
</xsl:attribute> </xsl:attribute>