diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index ab305b92..7dd4f9b0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -3593,11 +3593,28 @@ namespace VEPROMS.CSLA.Library return _TemplateColumnMode ?? -1; } } - public bool IsInTemplate() + public bool IsInTemplate() // is this step defined by template, i.e. included in template list { if (IsStep && FormatStepData.MyFormat.PlantFormat.FormatData.TopTemplateTypes != null && FormatStepData.MyFormat.PlantFormat.FormatData.TopTemplateTypes.ContainsKey((int)MyContent.Type - 20001)) return true; return false; } + public bool IsWithInSingleColumnTemplate() // is this step within a step defined by a 'single-column' template item + { + if (IsStep && FormatStepData.MyFormat.PlantFormat.FormatData.TopTemplateTypes != null) + { + ItemInfo tmp = this; + while (tmp.IsStep) + { + if (tmp.TemplateIndex > 0) + { + if (FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tmp.TemplateIndex].nocolm==0) return true; + return false; + } + tmp = tmp.MyParent; + } + } + return false; + } public int GetSmartTemplateTopLevelIndxOfThisType(int oftype) // used for inserting steps { if (FormatStepData == null) return -1; diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index e74de300..24ca8661 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -100,16 +100,16 @@ namespace Volian.Print.Library if (childItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) { // if this template element has a -1 for row, print it (if = 0 this is a heading for edit - // and not printed). if this template element has a width of 0, then also print it, + // and not printed). if this template element has a width of > 0, then also print it, // these are headings and should be printed). This was added for Calvert Alarm (BGEALN) format for - // DEVICE/SETPOINT (row=-1), and for POSSIBLE CAUSES, AUTOMATIC ACTIONS, etc (width=0) + // DEVICE/SETPOINT (row=-1), and for POSSIBLE CAUSES, AUTOMATIC ACTIONS, etc (width>0) // find the indexes into the template for this item. The index must be for the HLS this is // or this is under. int tindx = childItemInfo.TemplateIndex; if (tindx == -1) xoff = (float)childItemInfo.MyDocStyle.Layout.LeftMargin; else if (childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row < 0 || - childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].width == 0) + childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].width > 0) { // move down for the 'POSSIBLE CAUSES'. To know it's that step type, check // the column field in template. -1 represents staying on same row but using @@ -1304,7 +1304,7 @@ namespace Volian.Print.Library string HLSTabTextForContMsg = MyHighLevelParagraph.MyItemInfo.MyTab.CleanText + " " + MyHighLevelParagraph.MyItemInfo.MyContent.Text; int len = (HLSTabTextForContMsg.Length - 10) * 6; HLSTabTextForContMsg = @"\ul\b " + MyHighLevelParagraph.MyItemInfo.MyTab.CleanText.Trim() + @" \b0\ulnone \b " + MyHighLevelParagraph.MyItemInfo.MyContent.Text + @"\b0"; - MyPageHelper.TopMessageR = new vlnText(cb, this, HLSTabTextForContMsg, HLSTabTextForContMsg, (float)docstyle.Layout.PageWidth - len, yTopMargin + 0.1F, docstyle.Continue.Top.Font); + MyPageHelper.TopMessageR = new vlnText(cb, this, HLSTabTextForContMsg, HLSTabTextForContMsg, MyHighLevelParagraph.MyTab.XOffset, yTopMargin + 0.1F, docstyle.Continue.Top.Font); if (subTab != null && MyItemInfo.StepLevel > 2) { float ybot = yTopMargin + (4 * SixLinesPerInch); @@ -2710,7 +2710,8 @@ namespace Volian.Print.Library { bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER"); vlnParagraph hls1 = MyParent; - while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent; + if (!formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) + while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent; float colR = float.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]); float xLowerLimit = (aerTableOrFigure && hls1.PartsLeft != null && hls1.PartsLeft.Count > 0) ? hls1.PartsLeft[0].XOffset : hls1.XOffset; float xUpperLimit = 0; @@ -2725,8 +2726,14 @@ namespace Volian.Print.Library // the around the right margin, i.e. 'hls xoffset' + 'location of rno (colR) * columnmode' + 'width of rno' xUpperLimit = hls1.XOffset + hls1.Width + colR * itemInfo.ColumnMode; + // If a table is within the alarm section and its parent is a template item is single column + // adjust the xoffset so that the table is centered around center of page + bool ctrCalvertAlarmTbl = false; + if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) + ctrCalvertAlarmTbl = MyItemInfo.IsWithInSingleColumnTemplate(); + float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[itemInfo.ColumnMode]); - if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) + if (ctrCalvertAlarmTbl || formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) XOffset = leftMargin + (pageWidth - leftMargin - Width) / 2; else { diff --git a/PROMS/fmtxml/PlantSpecific_Calvert.cs b/PROMS/fmtxml/PlantSpecific_Calvert.cs index a46ee61a..f4bea6ce 100644 --- a/PROMS/fmtxml/PlantSpecific_Calvert.cs +++ b/PROMS/fmtxml/PlantSpecific_Calvert.cs @@ -9,7 +9,7 @@ namespace fmtxml { private void AddBGEALNfmt(ref FormatData fmtdata) { - fmtdata.TPL = "0, 0, 0, 0, 0, 0, title\n1, 1, 65, 10,-19, -32768,\n2, 42, 0, 26, -1, 0,DEVICE\n2, 42, 27, 31, -1, 0,SETPOINT\n2, 42, 0, 0, 0, 0,POSSIBLE CAUSES\n2, 42, 0, 0, 0, 0,AUTOMATIC ACTIONS\n2, 42, 0, 0, 12294, 5186, CONDITION RESPONSE\n2, 42, 0, 0, 0, 0,ANNUNCIATOR COMPENSATORY ACTIONS\n2, 42, 0, 0, 0, 0,REFERENCES\n\n"; + fmtdata.TPL = "0, 0, 0, 0, 0, 0, title\n1, 1, 65, 10,-19, -32768,\n2, 42, 0, 26, -1, 0,DEVICE\n2, 42, 27, 31, -1, 0,SETPOINT\n2, 42, 0, 77, 0, 0,POSSIBLE CAUSES\n2, 42, 0, 77, 0, 0,AUTOMATIC ACTIONS\n2, 42, 0, 0, 12294, 5186, CONDITION RESPONSE\n2, 42, 0, 77, 0, 0,ANNUNCIATOR COMPENSATORY ACTIONS\n2, 42, 0, 77, 0, 0,REFERENCES\n\n"; fmtdata.SectData.StepSectionData.StpSectLayData.CautionNoteOrder = "7,6,22"; // Note,Caution,Warning fmtdata.SectData.StepSectionData.CompressHPSub = "False"; fmtdata.SectData.StepSectionData.CompressPropSubSup = "True";