mirror of
https://github.com/euphy/polargraphcontroller
synced 2025-01-09 19:55:16 +01:00
Update polargraphcontroller.pde
This commit is contained in:
parent
3bf418fa93
commit
eddaf3661a
@ -149,8 +149,8 @@ List<String> machineMessageLog = new ArrayList<String>();
|
|||||||
List<PreviewVector> previewCommandList = new ArrayList<PreviewVector>();
|
List<PreviewVector> previewCommandList = new ArrayList<PreviewVector>();
|
||||||
long lastCommandQueueHash = 0L;
|
long lastCommandQueueHash = 0L;
|
||||||
|
|
||||||
File lastImageDir = null;
|
File LastImageDir = null;
|
||||||
File lastPrefDir = null;
|
File LastPrefDir = null;
|
||||||
|
|
||||||
String lastCommand = "";
|
String lastCommand = "";
|
||||||
String lastDrawingCommand = "";
|
String lastDrawingCommand = "";
|
||||||
@ -1063,13 +1063,13 @@ void loadImageWithFileChooser()
|
|||||||
{
|
{
|
||||||
public void run() {
|
public void run() {
|
||||||
JFileChooser fc = new JFileChooser();
|
JFileChooser fc = new JFileChooser();
|
||||||
if (lastImageDir != null) fc.setCurrentDirectory(lastImageDir);
|
if (LastImageDir != null) fc.setCurrentDirectory(LastImageDir);
|
||||||
fc.setFileFilter(new ImageFileFilter());
|
fc.setFileFilter(new ImageFileFilter());
|
||||||
fc.setDialogTitle("Choose an image file...");
|
fc.setDialogTitle("Choose an image file...");
|
||||||
|
|
||||||
int returned = fc.showOpenDialog(frame);
|
int returned = fc.showOpenDialog(frame);
|
||||||
|
|
||||||
lastImageDir = fc.getCurrentDirectory();
|
LastImageDir = fc.getCurrentDirectory();
|
||||||
|
|
||||||
if (returned == JFileChooser.APPROVE_OPTION)
|
if (returned == JFileChooser.APPROVE_OPTION)
|
||||||
{
|
{
|
||||||
@ -1112,7 +1112,7 @@ void loadVectorWithFileChooser()
|
|||||||
public void run() {
|
public void run() {
|
||||||
JFileChooser fc = new JFileChooser();
|
JFileChooser fc = new JFileChooser();
|
||||||
|
|
||||||
if (lastImageDir != null) fc.setCurrentDirectory(lastImageDir);
|
if (LastImageDir != null) fc.setCurrentDirectory(LastImageDir);
|
||||||
|
|
||||||
fc.setFileFilter(new VectorFileFilter());
|
fc.setFileFilter(new VectorFileFilter());
|
||||||
|
|
||||||
@ -1120,7 +1120,7 @@ void loadVectorWithFileChooser()
|
|||||||
|
|
||||||
int returned = fc.showOpenDialog(frame);
|
int returned = fc.showOpenDialog(frame);
|
||||||
|
|
||||||
lastImageDir = fc.getCurrentDirectory();
|
LastImageDir = fc.getCurrentDirectory();
|
||||||
|
|
||||||
if (returned == JFileChooser.APPROVE_OPTION)
|
if (returned == JFileChooser.APPROVE_OPTION)
|
||||||
{
|
{
|
||||||
@ -1166,14 +1166,14 @@ void loadNewPropertiesFilenameWithFileChooser()
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
JFileChooser fc = new JFileChooser();
|
JFileChooser fc = new JFileChooser();
|
||||||
if (lastPrefDir != null) fc.setCurrentDirectory(lastPrefDir);
|
if (LastPrefDir != null) fc.setCurrentDirectory(LastPrefDir);
|
||||||
fc.setFileFilter(new PropertiesFileFilter());
|
fc.setFileFilter(new PropertiesFileFilter());
|
||||||
|
|
||||||
fc.setDialogTitle("Choose a config file...");
|
fc.setDialogTitle("Choose a config file...");
|
||||||
|
|
||||||
int returned = fc.showOpenDialog(frame);
|
int returned = fc.showOpenDialog(frame);
|
||||||
|
|
||||||
lastPrefDir = fc.getCurrentDirectory();
|
LastPrefDir = fc.getCurrentDirectory();
|
||||||
|
|
||||||
if (returned == JFileChooser.APPROVE_OPTION)
|
if (returned == JFileChooser.APPROVE_OPTION)
|
||||||
{
|
{
|
||||||
@ -1218,7 +1218,7 @@ void saveNewPropertiesFileWithFileChooser()
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
JFileChooser fc = new JFileChooser();
|
JFileChooser fc = new JFileChooser();
|
||||||
if (lastPrefDir != null) fc.setCurrentDirectory(lastPrefDir);
|
if (LastPrefDir != null) fc.setCurrentDirectory(LastPrefDir);
|
||||||
fc.setFileFilter(new PropertiesFileFilter());
|
fc.setFileFilter(new PropertiesFileFilter());
|
||||||
|
|
||||||
fc.setDialogTitle("Enter a config file name...");
|
fc.setDialogTitle("Enter a config file name...");
|
||||||
@ -1450,6 +1450,7 @@ Map<String, Float> unpackGCodeInstruction(String line) throws Exception {
|
|||||||
splitted[i] = splitted[i].replace(";", "");
|
splitted[i] = splitted[i].replace(";", "");
|
||||||
String axis = splitted[i].substring(0, 1);
|
String axis = splitted[i].substring(0, 1);
|
||||||
Float value = Float.parseFloat(splitted[i].substring(1));
|
Float value = Float.parseFloat(splitted[i].substring(1));
|
||||||
|
|
||||||
if ("X".equalsIgnoreCase(axis) || "Y".equalsIgnoreCase(axis) || "Z".equalsIgnoreCase(axis) || "G".equalsIgnoreCase(axis)) {
|
if ("X".equalsIgnoreCase(axis) || "Y".equalsIgnoreCase(axis) || "Z".equalsIgnoreCase(axis) || "G".equalsIgnoreCase(axis)) {
|
||||||
instruction.put(axis, value);
|
instruction.put(axis, value);
|
||||||
}
|
}
|
||||||
@ -1459,7 +1460,7 @@ Map<String, Float> unpackGCodeInstruction(String line) throws Exception {
|
|||||||
throw new 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());
|
throw new Exception("Exception while reading the lines from a gcode file: " + line + ", " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user