348 lines
12 KiB
C#
348 lines
12 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Xml;
|
|
|
|
namespace fmtxml
|
|
{
|
|
public partial class FmtFileToXml
|
|
{
|
|
private void AddTuecfmt(ref FormatData fmtdata) // Comanche Peak
|
|
{
|
|
fmtdata.PrintData.PrintCommonForZeroUnit = "True";
|
|
// SectionNumber
|
|
fmtdata.SectData.SectionNumber.Pos = 0;
|
|
fmtdata.SectData.SectionNumber.Just = "PSLeft";
|
|
fmtdata.SectData.SectionNumber.Font.FontFamily = "Prestige Elite Tall";
|
|
fmtdata.SectData.SectionNumber.Font.FontSize = "10";
|
|
fmtdata.SectData.SectionNumber.Font.FontStyle = "None";
|
|
fmtdata.SectData.SectionNumber.Font.CPI = "12";
|
|
// SectionHeader
|
|
fmtdata.SectData.SectionHeader.Pos = 19;
|
|
fmtdata.SectData.SectionHeader.Just = "PSLeft";
|
|
fmtdata.SectData.SectionHeader.Font.FontFamily = "Prestige Elite Tall";
|
|
fmtdata.SectData.SectionHeader.Font.FontSize = "10";
|
|
fmtdata.SectData.SectionHeader.Font.FontStyle = "Underline";
|
|
fmtdata.SectData.SectionHeader.Font.CPI = "12";
|
|
// StepSectionData
|
|
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTableEdit = "426,198,120"; //"426,192,120";
|
|
fmtdata.SectData.StepSectionData.StpSectLayData.WidSTablePrint = "426,198,120"; //"426,192,120";
|
|
fmtdata.SectData.StepSectionData.StpSectLayData.ShowSectionTitles = "True";
|
|
// High Level Step
|
|
fmtdata.StepData[2].TabData.Ident = " {numeric} ";
|
|
// Imediate Action High Level Step
|
|
fmtdata.StepData[3].TabData.Ident = "{!C0}{numeric} ";
|
|
// Caution
|
|
fmtdata.StepData[6].OneLineBeforeTab = "True";
|
|
// Note
|
|
fmtdata.StepData[7].OneLineBeforeTab = "True";
|
|
// Continuous Action High Level Step
|
|
fmtdata.StepData[9].TabData.Ident = "*{numeric} ";
|
|
// LossOfAC - still working on this
|
|
fmtdata.StepData[18].ColOverride = "38";
|
|
fmtdata.StepData[18].ColOverrideEdit = "38";
|
|
fmtdata.StepData[18].WidthOverride = "438,198,120"; //"438,192,120";
|
|
fmtdata.StepData[18].WidthOverrideEdit = "438,198,120"; //"438,192,120";
|
|
fmtdata.StepData[18].StepEditData.TypeMenu.MenuItem = "Symptoms and Entry Step";
|
|
fmtdata.StepData[18].TabData.IdentEdit = "{numeric}) ";
|
|
fmtdata.StepData[18].TabData.Ident = "{numeric}) ";
|
|
fmtdata.StepData[18].TabData.RNOIdentEdit = " ";
|
|
//fmtdata.StepData[18].TabData.Justify = "Left";
|
|
// Caution 2
|
|
fmtdata.StepData[21].ParentType = "Base";
|
|
// Paragraph
|
|
fmtdata.StepData[24].StepEditData.TypeMenu.MenuItem = "Indented Paragraph";
|
|
fmtdata.StepData[24].TabData.IdentEdit = "{!.+?}{!.+?}"; // {!.+?} gets replaced with a space in PROMS
|
|
fmtdata.StepData[24].TabData.Ident = "{!.+?}{!.+?}";
|
|
fmtdata.StepData[24].TabData.RNOIdent = "{!.+?}{!.+?}";
|
|
fmtdata.StepData[24].TabData.RNOIdentEdit = "{!.+?}{!.+?}";
|
|
// High5
|
|
fmtdata.StepData[41].ColOverride = "20";
|
|
fmtdata.StepData[41].ColOverrideEdit = "20";
|
|
fmtdata.StepData[41].WidthOverride = "456,198,120"; //"456,192,120";
|
|
fmtdata.StepData[41].WidthOverrideEdit = "456,198,120"; //"456,192,120";
|
|
fmtdata.StepData[41].StepEditData.TypeMenu.MenuItem = "Unnumbered High Level Step";
|
|
}
|
|
private void AddTuecfmtOVR(ref FormatData fmtdata) // Comanche Peak - override after inheritance
|
|
{
|
|
// Note
|
|
fmtdata.StepData[7].Inactive = "False";
|
|
// Note 1
|
|
fmtdata.StepData[22].Inactive = "True";
|
|
// Note 2
|
|
fmtdata.StepData[23].Inactive = "True";
|
|
// Note 3
|
|
fmtdata.StepData[26].Inactive = "True";
|
|
// Note 4
|
|
fmtdata.StepData[28].Inactive = "True";
|
|
// Note 5
|
|
fmtdata.StepData[32].Inactive = "True";
|
|
}
|
|
|
|
private void AddTuecDevfmt(ref FormatData fmtdata) // Comanche Peak
|
|
{
|
|
fmtdata.StepData[40].NoSpaceMultipleRNOs = true;
|
|
}
|
|
|
|
//private void AddCPLOverridefmt(ref FormatData fmtdata)
|
|
//{
|
|
// fmtdata.BoxData[1].BXLLC = "-12345"; //this will put in a null string
|
|
// fmtdata.BoxData[1].BXULC = "-12345"; //this will put in a null string
|
|
// fmtdata.BoxData[1].BXVert = "-12345"; //this will put in a null string
|
|
// fmtdata.BoxData[1].BXURC = "-12345"; //this will put in a null string
|
|
// fmtdata.BoxData[1].BXULC = "-12345"; //this will put in a null string
|
|
//}
|
|
|
|
}
|
|
public partial class FmtToXml
|
|
{
|
|
private void AddTUECPage(ref PageStyles pgstyles)
|
|
{
|
|
// Procedure Steps
|
|
pgstyles.PgStyles[0].Items[2].Token = "UNIT {UNITNUMBER}";
|
|
// Cover Page
|
|
pgstyles.PgStyles[1].Items[3].Token = "UNIT {UNITNUMBER}";
|
|
// Cover Page with ECC Stamp
|
|
pgstyles.PgStyles[2].Items[3].Token = "UNIT {UNITNUMBER}";
|
|
// Introduction & Appendix Pages
|
|
pgstyles.PgStyles[3].Items[3].Token = "UNIT {UNITNUMBER}";
|
|
//Cover Page with Small Stamp
|
|
pgstyles.PgStyles[4].Items[3].Token = "UNIT {UNITNUMBER}";
|
|
|
|
// we need to add one new pgstyle
|
|
// expand the pgstyles.PgStyles array by one;
|
|
int numstyles = pgstyles.PgStyles.Length; // number of current PgStyles
|
|
numstyles += 1; // adding one more page styles
|
|
PageStyle[] pgs = new PageStyle[numstyles];
|
|
PageStyle ps;// new PageStyle();
|
|
// copy existing page lists
|
|
for (int i = 0; i < numstyles - 1; i++)
|
|
{
|
|
ps = new PageStyle();
|
|
ps = pgstyles.PgStyles[i];
|
|
pgs[i] = ps;
|
|
}
|
|
// Attachmet (Step Editor)
|
|
ps = new PageStyle();
|
|
ps.Name = "Attachmet (Step Editor)";
|
|
ps.Index = 5;
|
|
|
|
PSItem[] Fpsitms = null;
|
|
Fpsitms = new PSItem[10];
|
|
|
|
PSItem pi = new PSItem();
|
|
pi.Token = "{DRAFTPAGE}{REFERENCEPAGE}{MASTERPAGE}{SAMPLEPAGE}";
|
|
pi.Row = 12;
|
|
pi.Col = -3;
|
|
pi.Justify = "PSCenter";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.FontStyle = "None";
|
|
pi.Style.CPI = "12";
|
|
Fpsitms[0] = pi;
|
|
|
|
pi = new PSItem();
|
|
pi.Token = "{HEADER1}";
|
|
pi.Row = 24;
|
|
pi.Col = -18;
|
|
pi.Justify = "PSLeft";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.FontStyle = "None";
|
|
pi.Style.CPI = "12";
|
|
Fpsitms[1] = pi;
|
|
|
|
pi = new PSItem();
|
|
pi.Token = "{EOPNUM}";
|
|
pi.Row = 48;
|
|
pi.Col = 447;
|
|
pi.Justify = "PSCenter";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.CPI = "12";
|
|
pi.Style.FontStyle = "None";
|
|
Fpsitms[2] = pi;
|
|
|
|
pi = new PSItem();
|
|
pi.Token = "UNIT {UNITNUMBER}";
|
|
pi.Row = 48;
|
|
pi.Col = 339;
|
|
pi.Justify = "PSCenter";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.CPI = "12";
|
|
pi.Style.FontStyle = "None";
|
|
Fpsitms[3] = pi;
|
|
|
|
pi = new PSItem();
|
|
pi.Token = "{PROCTITLE}";
|
|
pi.Row = 84;
|
|
pi.Col = 129;
|
|
pi.Justify = "PSCenter";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.CPI = "12";
|
|
pi.Style.FontStyle = "None";
|
|
Fpsitms[4] = pi;
|
|
|
|
pi = new PSItem();
|
|
pi.Token = "REVISION NO. {REV}";
|
|
pi.Row = 84;
|
|
pi.Col = 339;
|
|
pi.Justify = "PSCenter";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.CPI = "12";
|
|
pi.Style.FontStyle = "None";
|
|
Fpsitms[5] = pi;
|
|
|
|
pi = new PSItem();
|
|
pi.Token = "PAGE {PAGE} OF {OF}";
|
|
pi.Row = 84;
|
|
pi.Col = 447;
|
|
pi.Justify = "PSCenter";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.CPI = "12";
|
|
pi.Style.FontStyle = "Bold";
|
|
Fpsitms[6] = pi;
|
|
|
|
pi = new PSItem();
|
|
pi.Token = "{BOX1}";
|
|
pi.Row = 96;
|
|
pi.Col = -18;
|
|
pi.Justify = "PSLeft";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.CPI = "12";
|
|
pi.Style.FontStyle = "None";
|
|
Fpsitms[7] = pi;
|
|
|
|
pi = new PSItem();
|
|
pi.Token = "{SECTIONLEVELNUMBER}";
|
|
pi.Row = 120;
|
|
pi.Col = 244;
|
|
pi.Justify = "PSCenter";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.CPI = "12";
|
|
pi.Style.FontStyle = "Underline";
|
|
Fpsitms[8] = pi;
|
|
|
|
pi = new PSItem();
|
|
pi.Token = "PAGE {DOCCURPAGE} OF {DOCTOTPAGE}";
|
|
pi.Row = 130;
|
|
pi.Col = 244;
|
|
pi.Justify = "PSCenter";
|
|
pi.Style = new VE_Font();
|
|
pi.Style.FontFamily = "Prestige Elite Tall";
|
|
pi.Style.FontSize = "10";
|
|
pi.Style.CPI = "12";
|
|
pi.Style.FontStyle = "None";
|
|
Fpsitms[9] = pi;
|
|
|
|
ps.Items = Fpsitms;
|
|
pgs[numstyles - 1] = ps;
|
|
|
|
pgstyles.PgStyles = pgs; // save new pagelist
|
|
|
|
}
|
|
private void AddTUCEDOC(ref DocStyles dcstyles)
|
|
{
|
|
// we need to add one new docsyles
|
|
// expand the dcstyles.DcStyle array by one;
|
|
int numstyles = dcstyles.DcStyles.Length; // number of current docstyles
|
|
numstyles += 2; // adding one more docstyles
|
|
DocStyle[] dcs = new DocStyle[numstyles];
|
|
for (int i = 0; i < numstyles-2; i++)
|
|
{
|
|
DocStyle dc = new DocStyle();
|
|
dc = dcstyles.DcStyles[i];
|
|
dcs[i] = dc;
|
|
if (i+1 == numstyles - 2)
|
|
{
|
|
dc = new DocStyle();
|
|
dc = dcstyles.DcStyles[0]; // insert a new section by copying the first one
|
|
dcs[i+1] = dc;
|
|
dc = new DocStyle();
|
|
dc = dcstyles.DcStyles[0]; // insert a new section by copying the first one
|
|
dcs[i+2] = dc;
|
|
}
|
|
}
|
|
dcstyles.DcStyles = dcs;
|
|
//"Procedure Steps"
|
|
dcstyles.DcStyles[0].oldtonew = 1;
|
|
dcstyles.DcStyles[0].CancelSectTitle = true;
|
|
dcstyles.DcStyles[0].CBLoc = 2;
|
|
// Cover Page
|
|
dcstyles.DcStyles[1].PageLength = 620;
|
|
// Cover Page with ECC Stamp
|
|
dcstyles.DcStyles[2].PageLength = 620;
|
|
// Introduction & Appendix Pages
|
|
dcstyles.DcStyles[3].PageLength = 640;
|
|
dcstyles.DcStyles[3].PageWidth = 564;
|
|
// Cover Page with Small Stamp
|
|
dcstyles.DcStyles[4].PageLength = 620;
|
|
// Purpose and Entry - step editor
|
|
dcstyles.DcStyles[5].Name = "Purpose and Entry";
|
|
dcstyles.DcStyles[5].Index = 5;
|
|
dcstyles.DcStyles[5].pagestyle = 3;
|
|
dcstyles.DcStyles[5].oldtonew = 2;
|
|
dcstyles.DcStyles[5].CancelSectTitle = false;
|
|
dcstyles.DcStyles[5].TopMargin = 120;
|
|
dcstyles.DcStyles[5].PageLength = 640;
|
|
dcstyles.DcStyles[5].LeftMargin = 78;
|
|
dcstyles.DcStyles[5].EndFlag = 0;
|
|
dcstyles.DcStyles[5].EndString = null;
|
|
dcstyles.DcStyles[5].CBLoc = 2;
|
|
// Attachment (Step Editor)
|
|
dcstyles.DcStyles[6].Name = "Attachment (Step Editor)";
|
|
dcstyles.DcStyles[6].Index = 6;
|
|
dcstyles.DcStyles[6].pagestyle = 5;
|
|
dcstyles.DcStyles[6].oldtonew = 4;
|
|
dcstyles.DcStyles[6].CancelSectTitle = true;
|
|
dcstyles.DcStyles[6].TopMargin = 150;
|
|
dcstyles.DcStyles[6].PageLength = 564;
|
|
dcstyles.DcStyles[6].LeftMargin = 60;
|
|
dcstyles.DcStyles[6].EndFlag = 0;
|
|
dcstyles.DcStyles[6].EndString = null;
|
|
dcstyles.DcStyles[6].CBLoc = 2;
|
|
}
|
|
}
|
|
public partial class RtfToSvg
|
|
{
|
|
private void AddTUEC(XmlDocument myDoc)
|
|
{
|
|
XmlDocument xdNew = new XmlDocument();
|
|
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C0\">" +
|
|
"<ellipse cx=\"6\" cy=\"-3.2\" rx=\"11.1\" ry=\"11.1\" fill=\"none\" stroke=\"black\" stroke-width=\"1.9\" />" +
|
|
"</g></svg>");
|
|
|
|
myDoc.DocumentElement.ReplaceChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true), myDoc.DocumentElement.ChildNodes[12]);
|
|
|
|
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C2\">" +
|
|
"<rect x=\"-16.15\" y=\"-7.05\" width=\"8.5\" height=\"8.5\" fill=\"none\" stroke=\"black\" stroke-width=\"0.85\" />" +
|
|
"</g></svg>");
|
|
|
|
myDoc.DocumentElement.ReplaceChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true), myDoc.DocumentElement.ChildNodes[9]);
|
|
|
|
xdNew.LoadXml("<svg xmlns=\"http://www.w3.org/2000/svg\"> <g id=\"C4\">" +
|
|
"<rect x=\"-16.15\" y=\"-7.05\" width=\"8.5\" height=\"8.5\" fill=\"none\" stroke=\"black\" stroke-width=\"0.85\" />" +
|
|
"<rect x=\"245.15\" y=\"-7.05\" width=\"8.5\" height=\"8.5\" fill=\"none\" stroke=\"black\" stroke-width=\"0.85\" />" +
|
|
"</g></svg>");
|
|
|
|
myDoc.DocumentElement.ReplaceChild(myDoc.ImportNode(xdNew.DocumentElement.ChildNodes[0], true), myDoc.DocumentElement.ChildNodes[11]);
|
|
|
|
}
|
|
}
|
|
}
|