289 lines
14 KiB
C#
289 lines
14 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Xml;
|
|
|
|
namespace fmtxml
|
|
{
|
|
public partial class FmtFileToXml
|
|
{
|
|
private void AddWCN1Fmt(ref FormatData fmtdata)
|
|
{
|
|
// Set a section title length
|
|
fmtdata.SectData.SectionTitleLength = 71;
|
|
|
|
fmtdata.ROData.UpRoAftrDash = "False";
|
|
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
|
|
|
|
// replace words
|
|
fmtdata.SectData.ReplaceStrData[0].ReplaceWith = @"\b \ul IF\ulnone \b0 ";
|
|
fmtdata.SectData.ReplaceStrData[2].ReplaceWith = @"{\par}\b \ul THEN\ulnone \b0 ";
|
|
fmtdata.SectData.ReplaceStrData[3].ReplaceWith = @"\b \ul WHEN\ulnone \b0 ";
|
|
fmtdata.SectData.ReplaceStrData[4].ReplaceWith = @"{\par}\b \ul AND\ulnone \b0 ";
|
|
fmtdata.SectData.ReplaceStrData[5].ReplaceWith = @"{\par}\b \ul OR\ulnone \b0 ";
|
|
|
|
|
|
// transdata
|
|
fmtdata.TransData.TransTypeData[4].TransFormat = @"{Sect Num}{First Step}";
|
|
|
|
// psi definition
|
|
fmtdata.ProcData.Psi = new PSI();
|
|
fmtdata.ProcData.Psi.x = 200;
|
|
fmtdata.ProcData.Psi.y = 129;
|
|
fmtdata.ProcData.Psi.Caption = "Wolf Creek Procedure Information";
|
|
fmtdata.ProcData.Psi.ButtonsOnBottom = "NO";
|
|
fmtdata.ProcData.Psi.font = "ARIAL";
|
|
fmtdata.ProcData.Psi.Labels = new PsiLabel[5];
|
|
fmtdata.ProcData.Psi.Labels[0].text = "Responsible Manager's Title:";
|
|
fmtdata.ProcData.Psi.Labels[0].Justify = "LEFT";
|
|
fmtdata.ProcData.Psi.Labels[0].x = 12;
|
|
fmtdata.ProcData.Psi.Labels[0].y = 11;
|
|
fmtdata.ProcData.Psi.Labels[0].width = 100;
|
|
fmtdata.ProcData.Psi.Labels[0].height = 8;
|
|
|
|
fmtdata.ProcData.Psi.Labels[1].text = "Use Category (Continuous/Reference):";
|
|
fmtdata.ProcData.Psi.Labels[1].Justify = "LEFT";
|
|
fmtdata.ProcData.Psi.Labels[1].x = 12;
|
|
fmtdata.ProcData.Psi.Labels[1].y = 36;
|
|
fmtdata.ProcData.Psi.Labels[1].width = 100;
|
|
fmtdata.ProcData.Psi.Labels[1].height = 8;
|
|
|
|
fmtdata.ProcData.Psi.Labels[2].text = "Administrative Controls Procedure (Yes/No):";
|
|
fmtdata.ProcData.Psi.Labels[2].Justify = "LEFT";
|
|
fmtdata.ProcData.Psi.Labels[2].x = 12;
|
|
fmtdata.ProcData.Psi.Labels[2].y = 62;
|
|
fmtdata.ProcData.Psi.Labels[2].width = 148;
|
|
fmtdata.ProcData.Psi.Labels[2].height = 8;
|
|
|
|
fmtdata.ProcData.Psi.Labels[3].text = "Management Oversight Evolution (Yes/No):";
|
|
fmtdata.ProcData.Psi.Labels[3].Justify = "LEFT";
|
|
fmtdata.ProcData.Psi.Labels[3].x = 12;
|
|
fmtdata.ProcData.Psi.Labels[3].y = 80;
|
|
fmtdata.ProcData.Psi.Labels[3].width = 144;
|
|
fmtdata.ProcData.Psi.Labels[3].height = 8;
|
|
|
|
fmtdata.ProcData.Psi.Labels[4].text = "Program Number:";
|
|
fmtdata.ProcData.Psi.Labels[4].Justify = "LEFT";
|
|
fmtdata.ProcData.Psi.Labels[4].x = 12;
|
|
fmtdata.ProcData.Psi.Labels[4].y = 97;
|
|
fmtdata.ProcData.Psi.Labels[4].width = 60;
|
|
fmtdata.ProcData.Psi.Labels[4].height = 8;
|
|
|
|
fmtdata.ProcData.Psi.Fields = new PsiField[5];
|
|
fmtdata.ProcData.Psi.Fields[0].name = "CLASSIFICATION";
|
|
fmtdata.ProcData.Psi.Fields[0].type = "TEXT";
|
|
fmtdata.ProcData.Psi.Fields[0].text = "";
|
|
fmtdata.ProcData.Psi.Fields[0].Length = 51;
|
|
fmtdata.ProcData.Psi.Fields[0].x = 12;
|
|
fmtdata.ProcData.Psi.Fields[0].y = 20;
|
|
fmtdata.ProcData.Psi.Fields[0].width = 180;
|
|
fmtdata.ProcData.Psi.Fields[0].height = 12;
|
|
|
|
fmtdata.ProcData.Psi.Fields[1].name = "USECATEGORY";
|
|
fmtdata.ProcData.Psi.Fields[1].type = "TEXT";
|
|
fmtdata.ProcData.Psi.Fields[1].text = "";
|
|
fmtdata.ProcData.Psi.Fields[1].Length = 21;
|
|
fmtdata.ProcData.Psi.Fields[1].x = 12;
|
|
fmtdata.ProcData.Psi.Fields[1].y = 44;
|
|
fmtdata.ProcData.Psi.Fields[1].width = 145;
|
|
fmtdata.ProcData.Psi.Fields[1].height = 12;
|
|
|
|
fmtdata.ProcData.Psi.Fields[2].name = "CLASSABBR";
|
|
fmtdata.ProcData.Psi.Fields[2].type = "TEXT";
|
|
fmtdata.ProcData.Psi.Fields[2].text = "";
|
|
fmtdata.ProcData.Psi.Fields[2].Length = 4;
|
|
fmtdata.ProcData.Psi.Fields[2].x = 160;
|
|
fmtdata.ProcData.Psi.Fields[2].y = 61;
|
|
fmtdata.ProcData.Psi.Fields[2].width = 28;
|
|
fmtdata.ProcData.Psi.Fields[2].height = 12;
|
|
|
|
fmtdata.ProcData.Psi.Fields[3].name = "MNGOSEVOL";
|
|
fmtdata.ProcData.Psi.Fields[3].type = "TEXT";
|
|
fmtdata.ProcData.Psi.Fields[3].text = "";
|
|
fmtdata.ProcData.Psi.Fields[3].Length = 4;
|
|
fmtdata.ProcData.Psi.Fields[3].x = 160;
|
|
fmtdata.ProcData.Psi.Fields[3].y = 80;
|
|
fmtdata.ProcData.Psi.Fields[3].width = 28;
|
|
fmtdata.ProcData.Psi.Fields[3].height = 12;
|
|
|
|
fmtdata.ProcData.Psi.Fields[4].name = "PROGNUMBER";
|
|
fmtdata.ProcData.Psi.Fields[4].type = "TEXT";
|
|
fmtdata.ProcData.Psi.Fields[4].text = "";
|
|
fmtdata.ProcData.Psi.Fields[4].Length = 4;
|
|
fmtdata.ProcData.Psi.Fields[4].x = 76;
|
|
fmtdata.ProcData.Psi.Fields[4].y = 96;
|
|
fmtdata.ProcData.Psi.Fields[4].width = 28;
|
|
fmtdata.ProcData.Psi.Fields[4].height = 12;
|
|
}
|
|
private void AddWCN2Fmt(ref FormatData fmtdata)
|
|
{
|
|
// the WCN2 tab for continuous HLS type had only 1 space after the period ('.'). The other
|
|
// tabs had two spaces. This tab type also uses the C0 macro to draw the lines above/below
|
|
// the number. Because it only had 1 space, the tab and lines were not matching the
|
|
// 16bit output. A space is added here to make the continuous HLS type match the number
|
|
// of spaces as other HLS tabs, and to make the printed output match that of 16bit.
|
|
fmtdata.StepData[9].TabData.Ident = fmtdata.StepData[9].TabData.Ident + " ";
|
|
fmtdata.StepData[9].TabData.IdentEdit = fmtdata.StepData[9].TabData.IdentEdit + " ";
|
|
fmtdata.StepData[9].TabData.RNOIdent = fmtdata.StepData[9].TabData.RNOIdent + " ";
|
|
fmtdata.StepData[9].TabData.RNOIdentEdit = fmtdata.StepData[9].TabData.RNOIdentEdit + " ";
|
|
fmtdata.ROData.UpRoAftrDash = "False";
|
|
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
|
|
}
|
|
private void AddWCNCKLFmt(ref FormatData fmtdata)
|
|
{
|
|
fmtdata.BoxData[3].End = 518;
|
|
fmtdata.BoxData[4].End = 518;
|
|
fmtdata.StepData[30].StepLayoutData.AlignWithParentTab = "True";
|
|
fmtdata.StepData[2].StepPrintData.Justify = "Center";
|
|
fmtdata.StepData[9].StepPrintData.Justify = "Center";
|
|
fmtdata.ROData.UpRoAftrDash = "False";
|
|
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
|
|
}
|
|
private void AddWCNBCKFmt(ref FormatData fmtdata)
|
|
{
|
|
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "485,216,144";
|
|
fmtdata.StepData[20].ColOverride = "86.4";
|
|
fmtdata.StepData[20].PageBreakOnStep = "False";
|
|
fmtdata.ROData.UpRoAftrDash = "False";
|
|
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
|
|
fmtdata.StepData[2].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
|
|
fmtdata.StepData[3].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
|
|
fmtdata.StepData[6].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
|
|
fmtdata.StepData[7].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
|
|
fmtdata.StepData[9].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
|
|
fmtdata.StepData[18].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
|
|
fmtdata.StepData[22].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
|
|
fmtdata.StepData[23].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
|
|
fmtdata.StepData[26].TabData.RNOIdent = @"\ul WOG ERG STEP:\ulnone ";
|
|
}
|
|
private void AddWCNOFBFmt(ref FormatData fmtdata)
|
|
{
|
|
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "495,216,144";
|
|
fmtdata.StepData[20].PageBreakOnStep = "False";
|
|
fmtdata.StepData[43].ColOverride = "86.4";
|
|
fmtdata.ROData.UpRoAftrDash = "False";
|
|
fmtdata.ROData.UpRoImmAftrDashSpace = "True";
|
|
|
|
// tabbing for hls types:
|
|
fmtdata.StepData[2].TabData.IdentEdit = @"STEP: {Section Prefix}{numeric}";
|
|
fmtdata.StepData[2].TabData.Ident = @"STEP: {Section Prefix}{numeric} ";
|
|
fmtdata.StepData[2].TabData.IdentAltPrint = @"STEP: {Section Prefix}{numeric}\STEP: {Section Prefix}{numeric}";
|
|
fmtdata.StepData[2].TabData.RNOIdentEdit = "STEP {Section Prefix}: ";
|
|
fmtdata.StepData[2].TabData.RNOIdent = "STEP: {Section Prefix} ";
|
|
fmtdata.StepData[2].TabData.IdentWid = "100";
|
|
fmtdata.StepData[3].TabData.IdentEdit = @"STEP: {Section Prefix}{numeric}";
|
|
fmtdata.StepData[3].TabData.Ident = @"STEP: {Section Prefix}{numeric} ";
|
|
fmtdata.StepData[3].TabData.IdentAltPrint = @"STEP: {Section Prefix}{numeric}\STEP: {Section Prefix}{numeric}";
|
|
fmtdata.StepData[3].TabData.RNOIdentEdit = "STEP {Section Prefix}: ";
|
|
fmtdata.StepData[3].TabData.RNOIdent = "STEP: {Section Prefix} ";
|
|
fmtdata.StepData[3].TabData.IdentWid = "100";
|
|
fmtdata.StepData[9].TabData.IdentEdit = @"STEP: {Section Prefix}{numeric}";
|
|
fmtdata.StepData[9].TabData.Ident = @"STEP: {Section Prefix}{numeric} ";
|
|
fmtdata.StepData[9].TabData.IdentAltPrint = @"STEP: {Section Prefix}{numeric}\STEP: {Section Prefix}{numeric}";
|
|
fmtdata.StepData[9].TabData.RNOIdentEdit = "STEP {Section Prefix}: ";
|
|
fmtdata.StepData[9].TabData.RNOIdent = "STEP: {Section Prefix} ";
|
|
fmtdata.StepData[9].TabData.IdentWid = "100";
|
|
fmtdata.StepData[18].TabData.IdentEdit = @"STEP: {Section Prefix}{numeric}";
|
|
fmtdata.StepData[18].TabData.Ident = @"STEP: {Section Prefix}{numeric} ";
|
|
fmtdata.StepData[18].TabData.IdentAltPrint = @"STEP: {Section Prefix}{numeric}\STEP: {Section Prefix}{numeric}";
|
|
fmtdata.StepData[18].TabData.RNOIdentEdit = "STEP {Section Prefix}: ";
|
|
fmtdata.StepData[18].TabData.RNOIdent = "STEP: {Section Prefix} ";
|
|
fmtdata.StepData[18].TabData.IdentWid = "100";
|
|
|
|
// tabbing for cautions/notes
|
|
// cautions:
|
|
fmtdata.StepData[6].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-CAUTION {LNK C/N Num} ";
|
|
fmtdata.StepData[6].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-CAUTION {LNK C/N Num} /STEP: {Section Prefix}{LNK Step Num}-CAUTION {LNK C/N Num} ";
|
|
fmtdata.StepData[6].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-CAUTION {LNK C/N Num} ";
|
|
// notes:
|
|
fmtdata.StepData[7].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[7].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} \STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[7].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[22].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[22].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} \STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[22].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[23].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[23].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} \STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[23].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[26].TabData.Ident = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[26].TabData.IdentAltPrint = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} \STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
fmtdata.StepData[26].TabData.RNOIdent = @"STEP: {Section Prefix}{LNK Step Num}-NOTE {LNK C/N Num} ";
|
|
}
|
|
|
|
}
|
|
public partial class FmtToXml
|
|
{
|
|
private void AddWCN1Page(ref PageStyles pgstyles)
|
|
{
|
|
// Attachments
|
|
pgstyles.PgStyles[1].Items[8].Row = 88;
|
|
pgstyles.PgStyles[1].Items[9].Row = 100;
|
|
|
|
// Attachments (Norton Editor)
|
|
pgstyles.PgStyles[4].Name = "Attachments (MSWord Section)";
|
|
pgstyles.PgStyles[4].Items[8].Row = 83;
|
|
pgstyles.PgStyles[4].Items[9].Row = 94;
|
|
pgstyles.PgStyles[4].Items[10].Row = 112;
|
|
|
|
// Figures
|
|
pgstyles.PgStyles[5].Items[9].Row = 101;
|
|
|
|
// Landscape Attachments (Norton Editor)
|
|
pgstyles.PgStyles[6].Name = "Landscape Attachments (MSWord Section)";
|
|
pgstyles.PgStyles[6].Items[8].Row = 83;
|
|
pgstyles.PgStyles[6].Items[9].Row = 94;
|
|
pgstyles.PgStyles[6].Items[10].Row = 112;
|
|
}
|
|
|
|
private void AddWCNBCKPage(ref PageStyles pgstyles)
|
|
{
|
|
pgstyles.PgStyles[0].Items[9].Col = 518;
|
|
}
|
|
|
|
private void AddWCNBCKDoc(ref DocStyles dcstyles)
|
|
{
|
|
dcstyles.DcStyles[0].ContTop = "";
|
|
dcstyles.DcStyles[0].ContTopHLS = 0;
|
|
dcstyles.DcStyles[2].PageWidth = 592;
|
|
dcstyles.DcStyles[3].PageWidth = 592;
|
|
dcstyles.DcStyles[4].PageWidth = 592;
|
|
}
|
|
private void AddWCN2Doc(ref DocStyles dcstyles)
|
|
{
|
|
dcstyles.DcStyles[1].PageLength = 660;
|
|
}
|
|
|
|
public void AddWCN1Doc(ref DocStyles dcstyles)
|
|
{
|
|
// Procedure Steps
|
|
dcstyles.DcStyles[0].FooterLen = 0; // was set to 12
|
|
// Attachments
|
|
dcstyles.DcStyles[1].PageLength = 606;
|
|
// remove the 'DontCountInTabOfCont' flag on the cover page so that page counts in the
|
|
// auto table of contents will be correct.
|
|
dcstyles.DcStyles[3].DocStructStyle.DocStyle = dcstyles.DcStyles[3].DocStructStyle.DocStyle.Replace(", DontCountInTabOfCont", "");
|
|
// Records
|
|
dcstyles.DcStyles[7].FooterLen = 0;
|
|
dcstyles.DcStyles[7].PageLength = 672; // same length as Procedure Steps section to fix End message placement
|
|
}
|
|
|
|
}
|
|
public partial class RtfToSvg
|
|
{
|
|
private void AddWCN2(XmlDocument myDoc)
|
|
{
|
|
XmlDocument xd = new XmlDocument();
|
|
// include the svg level so that the xmlns can be set to be the same as the generated document.
|
|
xd.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"><g id=\"B9\">" +
|
|
"<rect x=\"4\" y=\"-3\" width=\"352.5\" height=\"120\" fill=\"none\" stroke=\"black\" stroke-width=\"1.2\" />\r\n" +
|
|
"<line x1=\"4\" y1=\"21\" x2=\"355.5\" y2=\"21\" stroke-width=\"1.2\" />\r\n" +
|
|
"<line x1=\"4\" y1=\"45\" x2=\"355.5\" y2=\"45\" stroke-width=\"1.2\" />\r\n" +
|
|
"<line x1=\"4\" y1=\"69\" x2=\"355.5\" y2=\"69\" stroke-width=\"1.2\" />\r\n" +
|
|
"<line x1=\"4\" y1=\"93\" x2=\"355.5\" y2=\"93\" stroke-width=\"1.2\" />\r\n" +
|
|
"<line x1=\"263\" y1=\"-3\" x2=\"263\" y2=\"118\" stroke-width=\"1.2\" />\r\n" +
|
|
"</g></svg>");
|
|
myDoc.DocumentElement.AppendChild(myDoc.ImportNode(xd.DocumentElement.ChildNodes[0], true));
|
|
}
|
|
}
|
|
}
|