- Fixed Header for EquipmentWBlank

- Aligned Tables properly
- Skip Section Title
- Calculated Table Width
- Fixed ChangeBar logic
- Added Text and Debug layers
- Adedd debug output to PDF
- Changed Paginate logic
- Adedd debug output to PDF
- Move GetParagraphHeight
- Added GetTableWidth
- Added ChangeBar Properties
- Added Debug and Text layers
Removed fixed override color for SVG
Removed simple PageBreak
This commit is contained in:
Rich
2010-05-25 16:15:26 +00:00
parent 9cc6174ad1
commit b00005780b
7 changed files with 249 additions and 54 deletions

View File

@@ -105,6 +105,10 @@ namespace Volian.Print.Library
private int COL_WID_ADJ = 6; // adjusts for incorrect use of WidSTable when breaking a line (it breaks 6 chars too short)
public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff,float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo)
{
//int[] problemIDs = { 871, 877 };
//List<int> lProblemIDs = new List<int>( problemIDs );
//if (lProblemIDs.Contains(itemInfo.ItemID))
// Console.WriteLine("Found Item {0}", itemInfo.ItemID);
MyParent = parent;
MyContentByte = cb;
MyItemInfo = itemInfo;
@@ -140,20 +144,38 @@ namespace Volian.Print.Library
//yoff += 2 * _SixLinesPerInch;
}
YTop = yoff;
if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && itemInfo.MyHeader.Text != "")
yoff += SetHeader(this, cb, itemInfo, formatInfo);
if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null)
// if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && itemInfo.MyHeader.Text != "") // EquipmentWBlank uses an empty string
yoff += SetHeader(this, cb, itemInfo, formatInfo);
YOffset = yoff;
AddMacros(itemInfo, mytab);
if (mytab != null) mytab.YOffset = yoff;
if (myCB != null) myCB.YOffset = yoff;
Rtf = GetRtf(itemInfo);
if (itemInfo.IsTablePart)
{
Width = GetTableWidth(cb, IParagraph);
vlnParagraph hls = MyParent;
bool aerTable = itemInfo.FormatStepData.Type.Contains("AER");
while (hls.MyParent != null)
{
if (aerTable && hls.MyItemInfo.IsHigh) break;
hls = hls.MyParent;
}
XOffset = hls.XOffset + hls.Width / 2 - Width / 2;
if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin)
XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
}
//if (MyItemInfo.ItemID == 117)
//{
// Rtf = Rtf.Replace("3 psig", @"3\'A0psig");
// //Console.WriteLine("'{0}'", Rtf);
//}
yoff += Height;
yoff += AdjustForBlankLines();
if (!itemInfo.IsStepSection) // Don't add any lines for the Section Title
{
yoff += Height;
yoff += AdjustForBlankLines();
}
float yOffRight = yoff;
float RnoOffset = ToPrint(formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColRTable, maxRNO);
if (rnoLevel < maxRNO && itemInfo.RNOs != null) yOffRight= ChildrenRight.Add(cb, itemInfo.RNOs, XOffset + RnoOffset, YTop, YTop, rnoLevel + 1, maxRNO, formatInfo);
@@ -207,6 +229,9 @@ namespace Volian.Print.Library
}
// HLP Change bar flags in format file:
//<ChangeBarData ChangeBarMessage="UserId" FixedChangeColumn="88" AbsoluteFixedChangeColumn="True" ContinuousChangeBars="True" ChgBarMessageFromEdit="True" ChangeBarToRNOSep="True" />
// Locations: With Text, Outside Box, AER on Left RNO on Right, To The Left of Text
// Text: Date & Change ID, Revision Number, Change ID, None, Custom (use input data)
// Flag AERChgBarMsgRNOChgBarNoMsg and AERMsgRNONoMsg are NOT Used in 16-bit.
private vlnChangeBar DoChangeBar(ItemInfo itemInfo, float xoff, float yoff, int maxRNO, FormatInfo formatInfo, vlnChangeBar myCB)
{
// find column for the change bar based on format flags - this is code from 16-bit
@@ -235,6 +260,29 @@ namespace Volian.Print.Library
ProcedureConfig.PrintChangeBarText pcbt = itemInfo.PrintChangeBarText;
string pcbum1 = itemInfo.PrintChangeBarUsrMsg1;
string pcbum2 = itemInfo.PrintChangeBarUsrMsg2;
// Now get the text.
// This is only the User Change Bar Message from the docversion config. Any other data is determined
// during printing, i.e. item or page specific.
//if (cbd.MyChangeBarText == DocVersionConfig.PrintChangeBarText.ChgID || cbd.MyChangeBarText == DocVersionConfig.PrintChangeBarText.DateChgID)
//{
// cbd.MyChangeBarMessage = myItemInfo.UserID;
// string mydts = null;
// if (changeBarData.ChgBarMessageFromEdit)
// {
// StepInfo si = (StepInfo)myItemInfo;
// if (si != null)
// {
// StepConfig sc = si.MyConfig as StepConfig;
// if (sc != null && sc.Step_MultipleChangeID != null) cbd.MyChangeBarMessage = sc.Step_MultipleChangeID;
// }
// }
// if (cbd.MyChangeBarText == DocVersionConfig.PrintChangeBarText.DateChgID) cbd.MyChangeBarMessage = cbd.MyChangeBarMessage + @"\" + myItemInfo.DTS.Date.ToString();
//}
//else if (cbd.MyChangeBarText == DocVersionConfig.PrintChangeBarText.RevNum)
//{
// //TODO
//}
//myCB = new vlnChangeBar(this, XOffset + Width + 5, yoff); // xoff varies depending on type of change bar
myCB = new vlnChangeBar(this, (float) itemInfo.MyDocStyle.Layout.LeftMargin+(col*_CharsToTwips), yoff);
return myCB;
@@ -242,16 +290,16 @@ namespace Volian.Print.Library
private int ChangeBarLocation(float c, vlnParagraph paragraph, FormatInfo formatInfo, int maxRNO)
{
int fixChgColumn = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData.FixedChangeColumn ?? 0;
int fixedChgCol = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData.FixedChangeColumn ?? 0;
int cols = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS ?? 0;
int colr = ToPrint(formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColRTable, maxRNO);
if (fixChgColumn < -10 || fixChgColumn >= 0)
return ((fixChgColumn > 0)? fixChgColumn :
(fixChgColumn == 0) ? (int)c + 1 :
(c > cols + colr + COL_WID_ADJ) ? - fixChgColumn :
if (fixedChgCol < -10 || fixedChgCol >= 0)
return ((fixedChgCol > 0) ? fixedChgCol :
(fixedChgCol == 0) ? (int)c + 1 :
(c > cols + colr + COL_WID_ADJ) ? -fixedChgCol :
AERLeftChangeBarLocation(formatInfo));
else
return (fixChgColumn + (((c < cols + Width + colr) || TableTest()
return (fixedChgCol + (((c < cols + Width + colr) || TableTest()
|| MyItemInfo.IsCaution || MyItemInfo.IsNote) ? 0 : cols+colr)); // || (GetColumnMode() == 0)) ? 0 : cols + colr));
/* Change bars to left of text -- ColS+WidS+ColR is the end of RNO col*/
}