B2018-146 Added logic to keep the Right Margin consistent in Background Text for WCN

This commit is contained in:
Rich 2018-11-09 18:43:09 +00:00
parent a6ecdda3d6
commit 0714394480
2 changed files with 38 additions and 6 deletions

View File

@ -5677,7 +5677,7 @@ namespace Volian.Print.Library
}
int? bxIndx = itemInfo.FormatStepData.StepLayoutData.STBoxindex;
float? colOvrd = itemInfo.FormatStepData.ColOverride;
if (itemInfo.IsBackgroundStep())
if (itemInfo.IsBackgroundStep())//WolfCreekBackgroundFormat && IsHigh||IsNote||IsCaution or ImplicitOR
{
int adj = 2;
if (myTab != null)
@ -5693,7 +5693,11 @@ namespace Volian.Print.Library
}
}
XOffset += (itemInfo.FormatStepData.Font.CharsToTwips * adj); // indent 2 characters for background steps
Width -= (itemInfo.FormatStepData.Font.CharsToTwips * adj); // Adjust width by 2 characters
// B2018-146 Adjust the width to match the HLS Right Margin.
//if (itemInfo.ActiveFormat.Name.StartsWith("WCN")) -- Not needed since IsBackgroundStep
Width = this.MyHighLevelParagraph.Width + this.MyHighLevelParagraph.XOffset - this.XOffset;
//else
// Width -= (itemInfo.FormatStepData.Font.CharsToTwips * adj); // Adjust width by 2 characters
return;
}
else if (itemInfo.FormatStepData.UseOldTemplate && itemInfo.IsInTemplate() &&
@ -5709,6 +5713,10 @@ namespace Volian.Print.Library
XOffset = (float)colOvrd;
else
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
// B2018-146 Adjust the width to match the HLS Right Margin.
if(itemInfo.IsPartOfBackgroundStep())
//if(itemInfo.ActiveFormat.Name.StartsWith("WCN"))
Width = this.MyHighLevelParagraph.Width + this.MyHighLevelParagraph.XOffset - this.XOffset;
return;
}
else if (itemInfo.IsParagraph &&
@ -5728,7 +5736,12 @@ namespace Volian.Print.Library
//Adjuust Indent for Wolf Creek Background format flag
float indentBG1 = itemInfo.IsPartOfBackgroundStep() ? itemInfo.FormatStepData.Font.CharsToTwips * 2 : 0;
XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + indentBG1;
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - indentBG1;
// B2018-146 Adjust the width to match the HLS Right Margin.
if (itemInfo.IsPartOfBackgroundStep())
//if (itemInfo.ActiveFormat.Name.StartsWith("WCN"))
Width = this.MyHighLevelParagraph.XOffset + this.MyHighLevelParagraph.Width - XOffset;
else
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - indentBG1;
}
return;
}
@ -5742,7 +5755,13 @@ namespace Volian.Print.Library
XOffset += delta;
// B2018-036: set the width of (background/deviation/alarms/etc) steps that have a tab
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || !UseTemplateWidthOrXOff(itemInfo.MyParent))
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - delta;
{
// B2018-146 Adjust the width to match the HLS Right Margin.
if (itemInfo.IsBackgroundStepOrChild())
Width = this.MyHighLevelParagraph.Width + this.MyHighLevelParagraph.XOffset - this.XOffset;
else
Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - delta;
}
}
else
{
@ -6036,6 +6055,9 @@ namespace Volian.Print.Library
myTab.XOffset += tabWidth - myTab.TabAlign;
if (myTab.MyMacro != null && myTab.MyMacro.XOffset != 0) myTab.MyMacro.XOffset += tabWidth - myTab.TabAlign;
}
// B2018-146 Adjust the width to match the HLS Right Margin.
if (itemInfo.IsBackgroundStepOrChild())
Width = this.MyHighLevelParagraph.Width + this.MyHighLevelParagraph.XOffset - this.XOffset;
}
}
}
@ -6098,7 +6120,6 @@ namespace Volian.Print.Library
else
widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride == null ? null :
(float?)ToInt(itemInfo.FormatStepData.WidthOverride, maxRNO);
// Calvert subheaders in valve lists - the text gets centered, so the width is the width
// of the page (also, don't do this for alarms, thus the !SpecialCaseCalvert Alarms, since
// alarms use Caution1 as the annunciator):

View File

@ -160,7 +160,18 @@ namespace Volian.Print.Library
public float Width
{
get { return _Width; }
set { _Width = value; }
set
{
// Debug B2018-146 - Check to see what is setting the width
//if (this is vlnParagraph && (this as vlnParagraph).MyItemInfo.InList(1986333, 1986334, 1986335))
// Console.WriteLine("here");
//if (this is vlnParagraph)
//if ((this as vlnParagraph).MyItemInfo.InList(1986333))
//Console.WriteLine("{0} Width {1} Right {2} Right Margin {3}", (this as vlnParagraph).MyItemInfo.ItemID, value,
//value + this.XOffset, (this as vlnParagraph).MyItemInfo.MyDocStyle.Layout.PageWidth -
//(this as vlnParagraph).MyItemInfo.MyDocStyle.Layout.LeftMargin);
_Width = value;
}
}
protected float _Height;
public virtual float Height