Minor bugfixes, some cosmetic fixes

Branch_1.5.0
Nathan Crawford 2008-01-02 02:59:15 +00:00
rodzic 9ef671fb88
commit 18f7763e1c
13 zmienionych plików z 400 dodań i 14 usunięć

Wyświetl plik

@ -466,6 +466,137 @@ namespace PesFile
public void saveDebugInfo()
{
System.IO.StreamWriter outfile = new System.IO.StreamWriter(System.IO.Path.ChangeExtension(_filename, ".txt"));
outfile.Write(getDebugInfo());
outfile.Close();
//string name = "";
//outfile.WriteLine("PES header");
//outfile.WriteLine("PES number:\t" + pesNum);
//for (int i = 0; i < pesHeader.Count; i++)
//{
// name = (i + 1).ToString();
// outfile.WriteLine(name + "\t" + pesHeader[i].ToString());
//}
//if (embOneHeader.Count > 0)
//{
// outfile.WriteLine("CEmbOne header");
// for (int i = 0; i < embOneHeader.Count; i++)
// {
// switch (i + 1)
// {
// case 22:
// name = "translate x";
// break;
// case 23:
// name = "translate y";
// break;
// case 24:
// name = "width";
// break;
// case 25:
// name = "height";
// break;
// default:
// name = (i + 1).ToString();
// break;
// }
// outfile.WriteLine(name + "\t" + embOneHeader[i].ToString());
// }
//}
//if (embPunchHeader.Count > 0)
//{
// outfile.WriteLine("CEmbPunch header");
// for (int i = 0; i < embPunchHeader.Count; i++)
// {
// switch (i + 1)
// {
// //case 22:
// // name = "translate x";
// // break;
// //case 23:
// // name = "translate y";
// // break;
// //case 24:
// // name = "width";
// // break;
// //case 25:
// // name = "height";
// // break;
// default:
// name = (i + 1).ToString();
// break;
// }
// outfile.WriteLine(name + "\t" + embPunchHeader[i].ToString());
// }
//}
//outfile.WriteLine("CSewSeg header");
//for (int i = 0; i < sewSegHeader.Count; i++)
//{
// switch (i + 1)
// {
// case 2:
// name = "start color";
// outfile.WriteLine(name + "\t" + sewSegHeader[i].ToString());
// break;
// case 3:
// name = "starting stitches";
// outfile.WriteLine(name + "\t" + sewSegHeader[i].ToString());
// break;
// case 4:
// name = "base x";
// outfile.WriteLine(name + "\t" + sewSegHeader[i].ToString());
// break;
// case 5:
// name = "base y";
// outfile.WriteLine(name + "\t" + sewSegHeader[i].ToString() + " (" + (sewSegHeader[i] + imageHeight).ToString() + ")");
// break;
// case 6:
// name = "start x";
// outfile.WriteLine(name + "\t" + sewSegHeader[i].ToString());
// break;
// case 7:
// name = "start y";
// outfile.WriteLine(name + "\t" + sewSegHeader[i].ToString() + " (" + (sewSegHeader[i] + imageHeight).ToString() + ")");
// break;
// default:
// name = (i + 1).ToString();
// outfile.WriteLine(name + "\t" + sewSegHeader[i].ToString());
// break;
// }
// //outfile.WriteLine(name + "\t" + csewsegHeader[i].ToString());
//}
//outfile.WriteLine("stitches start: " + startStitches.ToString());
//outfile.WriteLine("block info");
//outfile.WriteLine("number\tcolor\tstitches");
//for (int i = 0; i < this.blocks.Count; i++)
//{
// outfile.WriteLine((i + 1).ToString() + "\t" + blocks[i].colorIndex.ToString() + "\t" + blocks[i].stitchesTotal.ToString());
//}
//outfile.WriteLine("color table");
//outfile.WriteLine("number\ta\tb");
//for (int i = 0; i < colorTable.Count; i++)
//{
// outfile.WriteLine((i + 1).ToString() + "\t" + colorTable[i].a.ToString() + ", " + colorTable[i].b.ToString());
//}
//if (blocks.Count > 0)
//{
// outfile.WriteLine("Extended stitch debug info");
// for (int blocky = 0; blocky < blocks.Count; blocky++)
// {
// outfile.WriteLine("block " + (blocky + 1).ToString() + " start");
// for (int stitchy = 0; stitchy < blocks[blocky].stitches.Length; stitchy++)
// {
// outfile.WriteLine(blocks[blocky].stitches[stitchy].X.ToString() + ", " + blocks[blocky].stitches[stitchy].Y.ToString());
// }
// }
//}
//outfile.Close();
}
public string getDebugInfo()
{
System.IO.StringWriter outfile = new System.IO.StringWriter();
string name = "";
outfile.WriteLine("PES header");
outfile.WriteLine("PES number:\t" + pesNum);
@ -590,6 +721,7 @@ namespace PesFile
}
}
outfile.Close();
return outfile.ToString();
}
//public bool isReadyToUse()

Wyświetl plik

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.1.44")]
[assembly: AssemblyFileVersion("1.0.1.44")]
[assembly: AssemblyVersion("1.0.1.46")]
[assembly: AssemblyFileVersion("1.0.1.46")]

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.2.1.57")]
[assembly: AssemblyFileVersion("1.2.1.57")]
[assembly: AssemblyVersion("1.2.1.60")]
[assembly: AssemblyFileVersion("1.2.1.60")]

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -57,6 +57,12 @@
<Compile Include="frmSettingsDialog.Designer.cs">
<DependentUpon>frmSettingsDialog.cs</DependentUpon>
</Compile>
<Compile Include="frmTextbox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmTextbox.Designer.cs">
<DependentUpon>frmTextbox.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmMain.resx">
@ -67,6 +73,10 @@
<SubType>Designer</SubType>
<DependentUpon>frmSettingsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmTextbox.resx">
<SubType>Designer</SubType>
<DependentUpon>frmTextbox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>

Wyświetl plik

@ -44,9 +44,9 @@ namespace embroideryReader
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rotateLeftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rotateRightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.checkForUpdateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveDebugInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -58,6 +58,7 @@ namespace embroideryReader
this.printDocument1 = new System.Drawing.Printing.PrintDocument();
this.printDialog1 = new System.Windows.Forms.PrintDialog();
this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
this.showDebugInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.panel2.SuspendLayout();
this.statusStrip1.SuspendLayout();
@ -181,15 +182,9 @@ namespace embroideryReader
this.viewToolStripMenuItem.Size = new System.Drawing.Size(41, 20);
this.viewToolStripMenuItem.Text = "View";
//
// refreshToolStripMenuItem
//
this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
this.refreshToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.refreshToolStripMenuItem.Text = "Refresh";
this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
//
// rotateLeftToolStripMenuItem
//
this.rotateLeftToolStripMenuItem.Enabled = false;
this.rotateLeftToolStripMenuItem.Name = "rotateLeftToolStripMenuItem";
this.rotateLeftToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.rotateLeftToolStripMenuItem.Text = "Rotate left";
@ -197,16 +192,26 @@ namespace embroideryReader
//
// rotateRightToolStripMenuItem
//
this.rotateRightToolStripMenuItem.Enabled = false;
this.rotateRightToolStripMenuItem.Name = "rotateRightToolStripMenuItem";
this.rotateRightToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.rotateRightToolStripMenuItem.Text = "Rotate right";
this.rotateRightToolStripMenuItem.Click += new System.EventHandler(this.rotateRightToolStripMenuItem_Click);
//
// refreshToolStripMenuItem
//
this.refreshToolStripMenuItem.Enabled = false;
this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
this.refreshToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.refreshToolStripMenuItem.Text = "Reset";
this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.checkForUpdateToolStripMenuItem,
this.saveDebugInfoToolStripMenuItem,
this.showDebugInfoToolStripMenuItem,
this.toolStripSeparator1,
this.aboutToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
@ -284,6 +289,14 @@ namespace embroideryReader
this.printPreviewDialog1.Name = "printPreviewDialog1";
this.printPreviewDialog1.Visible = false;
//
// showDebugInfoToolStripMenuItem
//
this.showDebugInfoToolStripMenuItem.Enabled = false;
this.showDebugInfoToolStripMenuItem.Name = "showDebugInfoToolStripMenuItem";
this.showDebugInfoToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.showDebugInfoToolStripMenuItem.Text = "Show debug info";
this.showDebugInfoToolStripMenuItem.Click += new System.EventHandler(this.showDebugInfoToolStripMenuItem_Click);
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -295,8 +308,8 @@ namespace embroideryReader
this.MainMenuStrip = this.menuStrip1;
this.Name = "frmMain";
this.Text = "Form1";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.panel2.ResumeLayout(false);
@ -338,6 +351,7 @@ namespace embroideryReader
private System.Windows.Forms.ToolStripMenuItem refreshToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem rotateLeftToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem rotateRightToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem showDebugInfoToolStripMenuItem;
}
}

Wyświetl plik

@ -169,6 +169,10 @@ namespace embroideryReader
saveDebugInfoToolStripMenuItem.Enabled = true;
printPreviewToolStripMenuItem.Enabled = true;
printToolStripMenuItem.Enabled = true;
rotateLeftToolStripMenuItem.Enabled = true;
rotateRightToolStripMenuItem.Enabled = true;
refreshToolStripMenuItem.Enabled = true;
showDebugInfoToolStripMenuItem.Enabled = true;
panel2.Select();
}
else
@ -178,6 +182,10 @@ namespace embroideryReader
saveDebugInfoToolStripMenuItem.Enabled = false;
printPreviewToolStripMenuItem.Enabled = false;
printToolStripMenuItem.Enabled = false;
rotateLeftToolStripMenuItem.Enabled = false;
rotateRightToolStripMenuItem.Enabled = false;
refreshToolStripMenuItem.Enabled = false;
showDebugInfoToolStripMenuItem.Enabled = false;
}
}
@ -468,7 +476,7 @@ namespace embroideryReader
private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
{
if (design.getStatus() == PesFile.statusEnum.Ready)
if (design != null && design.getStatus() == PesFile.statusEnum.Ready)
{
//this.Text = System.IO.Path.GetFileName(filename) + " - Embroidery Reader";
//sizePanel2();
@ -536,5 +544,25 @@ namespace embroideryReader
panel1.Height = temp2;
panel1.Invalidate();
}
private void showDebugInfoToolStripMenuItem_Click(object sender, EventArgs e)
{
if (design != null)
{
try
{
frmTextbox theform = new frmTextbox();
theform.showText(design.getDebugInfo());
}
catch (Exception ex)
{
MessageBox.Show("There was an error while saving debug info:" + Environment.NewLine + ex.ToString());
}
}
else
{
MessageBox.Show("No design loaded.");
}
}
}
}

Wyświetl plik

@ -0,0 +1,58 @@
namespace embroideryReader
{
partial class frmTextbox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Location = new System.Drawing.Point(0, 0);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox1.Size = new System.Drawing.Size(305, 351);
this.textBox1.TabIndex = 0;
//
// frmTextbox
//
this.ClientSize = new System.Drawing.Size(305, 351);
this.Controls.Add(this.textBox1);
this.Name = "frmTextbox";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
}
}

Wyświetl plik

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace embroideryReader
{
public partial class frmTextbox : Form
{
public frmTextbox()
{
InitializeComponent();
}
public void showText(string text)
{
textBox1.Text = text;
this.Show();
}
}
}

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Plik binarny nie jest wyświetlany.