Skip to content

Commit

Permalink
Also generate SVG when needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwatte committed Apr 1, 2012
1 parent 046d3f1 commit 11d1990
Show file tree
Hide file tree
Showing 5 changed files with 510 additions and 165 deletions.
30 changes: 30 additions & 0 deletions Gears/ExportForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions Gears/ExportForm.cs
Expand Up @@ -584,6 +584,7 @@ internal void getFileInfo(bool pinion, ref WorkFileInfo fi)
fi.directory = labelDirectory.Text;
fi.fileName = makeFileName(pinion, false);
fi.toothFileName = makeFileName(pinion, true);
fi.fileFormat = comboFileFormat.Text == "svg" ? FileFormat.svg : FileFormat.gCode;
}

internal bool getDimensions(ref Dimensions dim)
Expand Down Expand Up @@ -858,6 +859,18 @@ private void ExportForm_FormClosing(object sender, FormClosingEventArgs e)
{
SaveControls(new RegistrySave(@"\Software\Enchanted Age\Gear Generator\Export"));
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string pat = textBoxFileNamePattern.Text;
int i = pat.LastIndexOf('.');
if (i >= 0)
{
pat = pat.Substring(0, i);
}
pat = pat + "." + comboFileFormat.Text;
textBoxFileNamePattern.Text = pat;
}
}

public enum FaceMilling
Expand Down Expand Up @@ -898,6 +911,7 @@ public struct WorkFileInfo
public string directory;
public string fileName;
public string toothFileName;
public FileFormat fileFormat;
}

public struct GCodeWorkOrder
Expand All @@ -914,4 +928,10 @@ public struct GCodeWorkOrder
public int numTeeth;
}

public enum FileFormat
{
gCode,
svg
}

}

0 comments on commit 11d1990

Please sign in to comment.