Update polargraphcontroller.pde

This commit is contained in:
Luboš Jeřábek 2016-03-29 16:21:25 +02:00
parent 3bf418fa93
commit eddaf3661a
1 changed files with 251 additions and 250 deletions

View File

@ -149,8 +149,8 @@ List<String> machineMessageLog = new ArrayList<String>();
List<PreviewVector> previewCommandList = new ArrayList<PreviewVector>();
long lastCommandQueueHash = 0L;
File lastImageDir = null;
File lastPrefDir = null;
File LastImageDir = null;
File LastPrefDir = null;
String lastCommand = "";
String lastDrawingCommand = "";
@ -1063,13 +1063,13 @@ void loadImageWithFileChooser()
{
public void run() {
JFileChooser fc = new JFileChooser();
if (lastImageDir != null) fc.setCurrentDirectory(lastImageDir);
if (LastImageDir != null) fc.setCurrentDirectory(LastImageDir);
fc.setFileFilter(new ImageFileFilter());
fc.setDialogTitle("Choose an image file...");
int returned = fc.showOpenDialog(frame);
lastImageDir = fc.getCurrentDirectory();
LastImageDir = fc.getCurrentDirectory();
if (returned == JFileChooser.APPROVE_OPTION)
{
@ -1112,7 +1112,7 @@ void loadVectorWithFileChooser()
public void run() {
JFileChooser fc = new JFileChooser();
if (lastImageDir != null) fc.setCurrentDirectory(lastImageDir);
if (LastImageDir != null) fc.setCurrentDirectory(LastImageDir);
fc.setFileFilter(new VectorFileFilter());
@ -1120,7 +1120,7 @@ void loadVectorWithFileChooser()
int returned = fc.showOpenDialog(frame);
lastImageDir = fc.getCurrentDirectory();
LastImageDir = fc.getCurrentDirectory();
if (returned == JFileChooser.APPROVE_OPTION)
{
@ -1166,14 +1166,14 @@ void loadNewPropertiesFilenameWithFileChooser()
public void run()
{
JFileChooser fc = new JFileChooser();
if (lastPrefDir != null) fc.setCurrentDirectory(lastPrefDir);
if (LastPrefDir != null) fc.setCurrentDirectory(LastPrefDir);
fc.setFileFilter(new PropertiesFileFilter());
fc.setDialogTitle("Choose a config file...");
int returned = fc.showOpenDialog(frame);
lastPrefDir = fc.getCurrentDirectory();
LastPrefDir = fc.getCurrentDirectory();
if (returned == JFileChooser.APPROVE_OPTION)
{
@ -1218,7 +1218,7 @@ void saveNewPropertiesFileWithFileChooser()
public void run()
{
JFileChooser fc = new JFileChooser();
if (lastPrefDir != null) fc.setCurrentDirectory(lastPrefDir);
if (LastPrefDir != null) fc.setCurrentDirectory(LastPrefDir);
fc.setFileFilter(new PropertiesFileFilter());
fc.setDialogTitle("Enter a config file name...");
@ -1450,6 +1450,7 @@ Map<String, Float> unpackGCodeInstruction(String line) throws Exception {
splitted[i] = splitted[i].replace(";", "");
String axis = splitted[i].substring(0, 1);
Float value = Float.parseFloat(splitted[i].substring(1));
if ("X".equalsIgnoreCase(axis) || "Y".equalsIgnoreCase(axis) || "Z".equalsIgnoreCase(axis) || "G".equalsIgnoreCase(axis)) {
instruction.put(axis, value);
}
@ -1459,7 +1460,7 @@ Map<String, Float> unpackGCodeInstruction(String line) throws Exception {
throw new Exception();
}
}
catch (Exception e) {
catch (Exception e) {
throw new Exception("Exception while reading the lines from a gcode file: " + line + ", " + e.getMessage());
}