This commit is contained in:
Kathy Ruffing 2012-11-27 15:04:55 +00:00
parent 9922a676a6
commit 2acba689bf
7 changed files with 81 additions and 28 deletions

View File

@ -34,6 +34,7 @@ namespace fmtxml
private StatusStrip statusStrip1;
private ToolStripStatusLabel tsslStatus;
private Button btnRtfToSvg;
private Button btnWestinghouse;
/// <summary>
/// Required designer variable.
/// </summary>
@ -100,6 +101,7 @@ namespace fmtxml
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.tsslStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.btnRtfToSvg = new System.Windows.Forms.Button();
this.btnWestinghouse = new System.Windows.Forms.Button();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
@ -296,10 +298,21 @@ namespace fmtxml
this.btnRtfToSvg.Text = "Convert Genmac RTF to SVG (GenMac One Step)";
this.btnRtfToSvg.Click += new System.EventHandler(this.btnRtfToSvg_Click);
//
// btnWestinghouse
//
this.btnWestinghouse.Location = new System.Drawing.Point(387, 224);
this.btnWestinghouse.Name = "btnWestinghouse";
this.btnWestinghouse.Size = new System.Drawing.Size(164, 26);
this.btnWestinghouse.TabIndex = 21;
this.btnWestinghouse.Text = "Copy Westinghouse Fmt Gen";
this.btnWestinghouse.UseVisualStyleBackColor = true;
this.btnWestinghouse.Click += new System.EventHandler(this.btnWestinghouse_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
this.ClientSize = new System.Drawing.Size(631, 570);
this.Controls.Add(this.btnWestinghouse);
this.Controls.Add(this.btnRtfToSvg);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.btnBrowseResult);
@ -473,34 +486,33 @@ namespace fmtxml
foreach (FileInfo fi in fis) fi.Delete();
}
private void btnMergeFmtPagDoc_Click(object sender, EventArgs e)
{
ClearResults(tbResultPath.Text);
DateTime tStart = DateTime.Now;
MyStatus = "Merging...";
// get all of the generated xml format files in the fmt_xml directory and merge
// the fmt/doc/pag & subformats into one file.
DirectoryInfo di = new DirectoryInfo("fmt_xml");
//testDirectoryInfo di = new DirectoryInfo("E:\\proms.net\\exe\\fmtxml");
FileInfo[] fis = di.GetFiles("*f.xml");
ClearListBox();
foreach (FileInfo fi in fis)
{
// see if all three, format, doc & pag exist - if not, print error,
// if so, process
string docname = "fmt_xml\\" + fi.Name.Substring(0, fi.Name.Length - 5) + "p.xml";
string pagname = "fmt_xml\\" + fi.Name.Substring(0, fi.Name.Length - 5) + "d.xml";
if (File.Exists(docname) && File.Exists(pagname))
{
AddFileToListBox(fi);
EntireFormat ef = new EntireFormat("fmt_xml\\" + fi.Name, tbResultPath.Text);
}
else
Console.WriteLine("For {0}, page or document file does not exist.", fi.Name);
}
MyStatus = string.Format("DONE Merging Formats {0:F3} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - tStart.Ticks).TotalSeconds);
MessageBox.Show("DONE Merging Formats - Results are in " + tbResultPath.Text + @"fmtall'");
}
private void btnMergeFmtPagDoc_Click(object sender, EventArgs e)
{
ClearResults(tbResultPath.Text);
DateTime tStart = DateTime.Now;
MyStatus = "Merging...";
// get all of the generated xml format files in the fmt_xml directory and merge
// the fmt/doc/pag & subformats into one file.
DirectoryInfo di = new DirectoryInfo("fmt_xml");
//testDirectoryInfo di = new DirectoryInfo("E:\\proms.net\\exe\\fmtxml");
FileInfo[] fis = di.GetFiles("*f.xml");
ClearListBox();
foreach (FileInfo fi in fis)
{
// see if all three, format, doc & pag exist - if not, print error,
// if so, process
string docname = "fmt_xml\\" + fi.Name.Substring(0, fi.Name.Length - 5) + "p.xml";
string pagname = "fmt_xml\\" + fi.Name.Substring(0, fi.Name.Length - 5) + "d.xml";
if (File.Exists(docname) && File.Exists(pagname))
{
AddFileToListBox(fi);
EntireFormat ef = new EntireFormat("fmt_xml\\" + fi.Name, tbResultPath.Text);
}
else
Console.WriteLine("For {0}, page or document file does not exist.", fi.Name);
}
}
private void ClearResults(string path)
{
@ -565,6 +577,47 @@ namespace fmtxml
}
MessageBox.Show("DONE converting GenMac RTF files to drawing svg - Results are in " + tbResultPath.Text + @"genmacall");
}
private void btnWestinghouse_Click(object sender, EventArgs e)
{
DateTime tStart = DateTime.Now;
if (File.Exists("wst1all.xml"))
{
FileInfo fi1 = new FileInfo("wst1all.xml");
fi1.CopyTo(tbResultPath.Text + @"fmtall\wst1all.xml", true);
}
if (File.Exists("wst2all.xml"))
{
FileInfo fi2 = new FileInfo("wst2all.xml");
fi2.CopyTo(tbResultPath.Text + @"fmtall\wst2all.xml", true);
}
if (File.Exists("wstcklall.xml"))
{
FileInfo fi2 = new FileInfo("wstcklall.xml");
fi2.CopyTo(tbResultPath.Text + @"fmtall\wstcklall.xml", true);
}
if (File.Exists("wst1.svg"))
{
FileInfo fi1 = new FileInfo("wst1.svg");
fi1.CopyTo(tbResultPath.Text + @"genmacall\wst1.svg", true);
}
if (File.Exists("wst2.svg"))
{
FileInfo fi2 = new FileInfo("wst2.svg");
fi2.CopyTo(tbResultPath.Text + @"genmacall\wst2.svg", true);
}
if (File.Exists("wstckl.svg"))
{
FileInfo fi2 = new FileInfo("wstckl.svg");
fi2.CopyTo(tbResultPath.Text + @"genmacall\wstckl.svg", true);
}
MyStatus = string.Format("Copied Westinghouse Format/Genmac {0:F3} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - tStart.Ticks).TotalSeconds);
MessageBox.Show("DONE Copy Westinghouse Format/Genmac - Results are in " + tbResultPath.Text + @"fmtall' and 'genmacall'");
}
// old code:
//private void button5_Click(object sender, System.EventArgs e)
//{

BIN
PROMS/fmtxml/WST1all.xml Normal file

Binary file not shown.

BIN
PROMS/fmtxml/WST2all.xml Normal file

Binary file not shown.

BIN
PROMS/fmtxml/WSTCKLall.xml Normal file

Binary file not shown.

BIN
PROMS/fmtxml/wst1.svg Normal file

Binary file not shown.

BIN
PROMS/fmtxml/wst2.svg Normal file

Binary file not shown.

BIN
PROMS/fmtxml/wstckl.svg Normal file

Binary file not shown.