|
@@ -2,7 +2,6 @@ package controller;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
import java.io.File;
|
|
|
-import java.io.FileNotFoundException;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
@@ -55,13 +54,13 @@ public class Export {
|
|
|
//comFolder changes the directory to the .exe on Windows or the binary file in MacOs. Not needed in Linux
|
|
|
String comFolder = "cd " + pathComma + settings.getOpenSCADPath() + pathComma;
|
|
|
//Line for the full non-conductive object
|
|
|
- String comLine = start + "openscad "+ (System.getProperty("os.name").toLowerCase().contains("mac")?"-W -n --args ":"") +"-o " + pathComma + System.getProperty("user.dir") + File.separator + "output.stl"+ pathComma + " ";
|
|
|
+ String comLine = start + "openscad "+ (System.getProperty("os.name").toLowerCase().contains("mac")?"-W -n --args ":"") +"-o " + pathComma + Main.olipPath + "output.stl"+ pathComma + " ";
|
|
|
//Line for all conductive parts
|
|
|
- String comLine2 = start + "openscad "+ (System.getProperty("os.name").toLowerCase().contains("mac")?"-W -n --args ":"") +"-o " + pathComma + System.getProperty("user.dir") + File.separator + "output_conductive.stl" + pathComma + " ";
|
|
|
+ String comLine2 = start + "openscad "+ (System.getProperty("os.name").toLowerCase().contains("mac")?"-W -n --args ":"") +"-o " + pathComma + Main.olipPath + "output_conductive.stl" + pathComma + " ";
|
|
|
//Line for the non-conductive part for cross-section view
|
|
|
- String comLine3 = start + "openscad "+ (System.getProperty("os.name").toLowerCase().contains("mac")?"-W -n --args ":"") +"-o " + pathComma + System.getProperty("user.dir") + File.separator + "output_crossSection.stl" + pathComma + " ";
|
|
|
+ String comLine3 = start + "openscad "+ (System.getProperty("os.name").toLowerCase().contains("mac")?"-W -n --args ":"") +"-o " + pathComma + Main.olipPath + "output_crossSection.stl" + pathComma + " ";
|
|
|
//Line for the conducive parts for cross-section view
|
|
|
- String comLine4 = start + "openscad "+ (System.getProperty("os.name").toLowerCase().contains("mac")?"-W -n --args ":"") +"-o " + pathComma + System.getProperty("user.dir") + File.separator + "output_crossSection_conductive.stl" + pathComma + " ";
|
|
|
+ String comLine4 = start + "openscad "+ (System.getProperty("os.name").toLowerCase().contains("mac")?"-W -n --args ":"") +"-o " + pathComma + Main.olipPath + "output_crossSection_conductive.stl" + pathComma + " ";
|
|
|
//Instructions that will be added to the .txt file
|
|
|
List<String> instructions = null;
|
|
|
//Specification of the selected object, used for the android app to show the correct shape
|
|
@@ -71,7 +70,7 @@ public class Export {
|
|
|
|
|
|
//If weight is selected...
|
|
|
if (settings.isWeight()) {
|
|
|
- tempFile = new File("weight.scad");
|
|
|
+ tempFile = new File(Main.olipPath + "weight.scad");
|
|
|
//Copy the .scad file
|
|
|
try {
|
|
|
InputStream in = Export.class.getResourceAsStream("/OpenSCADFiles/weight.scad");
|
|
@@ -89,16 +88,16 @@ public class Export {
|
|
|
}
|
|
|
//Add the necessary variables to the command line arguments
|
|
|
int walls = Math.round(settings.getWeight()/27);
|
|
|
- comLine += "-D numberSupports=" + walls + " -D conductive=false -D crossSection=false -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "weight.scad" + pathComma;
|
|
|
- comLine2+= "-D numberSupports=" + walls + " -D conductive=true -D crossSection=false -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "weight.scad" + pathComma;
|
|
|
- comLine3+= "-D numberSupports=" + walls + " -D conductive=false -D crossSection=true -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "weight.scad" + pathComma;
|
|
|
- comLine4+= "-D numberSupports=" + walls + " -D conductive=true -D crossSection=true -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "weight.scad" + pathComma;
|
|
|
+ comLine += "-D numberSupports=" + walls + " -D conductive=false -D crossSection=false -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine2+= "-D numberSupports=" + walls + " -D conductive=true -D crossSection=false -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine3+= "-D numberSupports=" + walls + " -D conductive=false -D crossSection=true -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine4+= "-D numberSupports=" + walls + " -D conductive=true -D crossSection=true -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
instructions = Instructions.getWeightInstruction();
|
|
|
android = Specifications.getWeightSpecs();
|
|
|
}
|
|
|
|
|
|
else if (settings.isAcceleration()) {
|
|
|
- tempFile = new File("acceleration.scad");
|
|
|
+ tempFile = new File(Main.olipPath + "acceleration.scad");
|
|
|
try {
|
|
|
InputStream in = Export.class.getResourceAsStream("/OpenSCADFiles/acceleration.scad");
|
|
|
OutputStream out = new FileOutputStream(tempFile);
|
|
@@ -115,16 +114,16 @@ public class Export {
|
|
|
}
|
|
|
|
|
|
double height = (settings.getAcceleration()<8?10:18);//TODO function from acceleration to wall height? linear? exponential? something else?
|
|
|
- comLine += "-D wallHeight=" + height + " -D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "acceleration.scad" + pathComma;
|
|
|
- comLine2+= "-D wallHeight=" + height + " -D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "acceleration.scad" + pathComma;
|
|
|
- comLine3+= "-D wallHeight=" + height + " -D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "acceleration.scad" + pathComma;
|
|
|
- comLine4+= "-D wallHeight=" + height + " -D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "acceleration.scad" + pathComma;
|
|
|
+ comLine += "-D wallHeight=" + height + " -D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine2+= "-D wallHeight=" + height + " -D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine3+= "-D wallHeight=" + height + " -D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine4+= "-D wallHeight=" + height + " -D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
instructions = Instructions.getAccelerationInstruction();
|
|
|
android = Specifications.getAccelerationSpecs();
|
|
|
}
|
|
|
|
|
|
else if (settings.isSqueeze()) {
|
|
|
- tempFile = new File("squeeze.scad");
|
|
|
+ tempFile = new File(Main.olipPath + "squeeze.scad");
|
|
|
try {
|
|
|
InputStream in = Export.class.getResourceAsStream("/OpenSCADFiles/squeeze.scad");
|
|
|
OutputStream out = new FileOutputStream(tempFile);
|
|
@@ -140,17 +139,17 @@ public class Export {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "squeeze.scad" + pathComma;
|
|
|
- comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "squeeze.scad" + pathComma;
|
|
|
- comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "squeeze.scad" + pathComma;
|
|
|
- comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "squeeze.scad" + pathComma;
|
|
|
+ comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
instructions = Instructions.getSqueezeInstruction();
|
|
|
android = Specifications.getSqueezeSpecs();
|
|
|
}
|
|
|
|
|
|
else if (settings.isTemperature()) {
|
|
|
if (settings.getTemperature() == Temp.OVER0) {
|
|
|
- tempFile = new File("iceMelting.scad");
|
|
|
+ tempFile = new File(Main.olipPath + "iceMelting.scad");
|
|
|
try {
|
|
|
InputStream in = Export.class.getResourceAsStream("/OpenSCADFiles/iceMelting.scad");
|
|
|
OutputStream out = new FileOutputStream(tempFile);
|
|
@@ -166,15 +165,15 @@ public class Export {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "iceMelting.scad" + pathComma;
|
|
|
- comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "iceMelting.scad" + pathComma;
|
|
|
- comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "iceMelting.scad" + pathComma;
|
|
|
- comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "iceMelting.scad" + pathComma;
|
|
|
+ comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
instructions = Instructions.getTemperatureMeltInstruction();
|
|
|
android = Specifications.getTemperatureMeltSpecs();
|
|
|
}
|
|
|
else {
|
|
|
- tempFile = new File("iceFreezing.scad");
|
|
|
+ tempFile = new File(Main.olipPath + "iceFreezing.scad");
|
|
|
try {
|
|
|
InputStream in = Export.class.getResourceAsStream("/OpenSCADFiles/iceFreezing.scad");
|
|
|
OutputStream out = new FileOutputStream(tempFile);
|
|
@@ -190,10 +189,10 @@ public class Export {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "iceFreezing.scad" + pathComma;
|
|
|
- comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "iceFreezing.scad" + pathComma;
|
|
|
- comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "iceFreezing.scad" + pathComma;
|
|
|
- comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "iceFreezing.scad" + pathComma;
|
|
|
+ comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
instructions = Instructions.getTemperatureFreezeInstruction();
|
|
|
android = Specifications.getTemperatureFreezeSpecs();
|
|
|
}
|
|
@@ -201,7 +200,7 @@ public class Export {
|
|
|
|
|
|
else if (settings.isTilt()) {
|
|
|
if (settings.getTilting().equals(Tilt.FLIP)) {
|
|
|
- tempFile = new File("flip.scad");
|
|
|
+ tempFile = new File(Main.olipPath + "flip.scad");
|
|
|
try {
|
|
|
InputStream in = Export.class.getResourceAsStream("/OpenSCADFiles/flip.scad");
|
|
|
OutputStream out = new FileOutputStream(tempFile);
|
|
@@ -217,16 +216,16 @@ public class Export {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "flip.scad" + pathComma;
|
|
|
- comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "flip.scad" + pathComma;
|
|
|
- comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "flip.scad" + pathComma;
|
|
|
- comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "flip.scad" + pathComma;
|
|
|
+ comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
instructions = Instructions.getFlipInstruction();
|
|
|
android = Specifications.getFlipSpecs();
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
- tempFile = new File("tilt.scad");
|
|
|
+ tempFile = new File(Main.olipPath + "tilt.scad");
|
|
|
try {
|
|
|
InputStream in = Export.class.getResourceAsStream("/OpenSCADFiles/tilt.scad");
|
|
|
OutputStream out = new FileOutputStream(tempFile);
|
|
@@ -242,10 +241,10 @@ public class Export {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "tilt.scad" + pathComma;
|
|
|
- comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "tilt.scad" + pathComma;
|
|
|
- comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "tilt.scad" + pathComma;
|
|
|
- comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + System.getProperty("user.dir") + File.separator + "tilt.scad" + pathComma;
|
|
|
+ comLine += "-D conductive=false -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine2+= "-D conductive=true -D crossSection=false -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine3+= "-D conductive=false -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
+ comLine4+= "-D conductive=true -D crossSection=true -D fillLater="+ settings.getFill() +" -D sizeScreen=" + settings.getSizeScreen() + " -D sizeFinger=" + settings.getSizeFinger() + " " + pathComma + tempFile.toString() + pathComma;
|
|
|
instructions = Instructions.getTiltInstruction();
|
|
|
android = Specifications.getTiltSpecs();
|
|
|
}
|
|
@@ -280,7 +279,7 @@ public class Export {
|
|
|
arguments[2] = (System.getProperty("os.name").contains("Linux")?"":comFolder) +
|
|
|
(System.getProperty("os.name").contains("Linux")?comLine.substring(3):comLine) +
|
|
|
comLine2 + comLine4 + comLine3;
|
|
|
-
|
|
|
+
|
|
|
//Run the command line
|
|
|
try {
|
|
|
Process p = Runtime.getRuntime().exec(arguments);
|
|
@@ -294,34 +293,34 @@ public class Export {
|
|
|
} catch (IOException e1) {
|
|
|
e1.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//Create the instructions .txt file
|
|
|
- Path file = Paths.get("instructions.txt");
|
|
|
+ Path file = Paths.get(Main.olipPath + "instructions.txt");
|
|
|
try {
|
|
|
Files.write(file, instructions, Charset.forName("UTF-8"));
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
//Create the objectSpecs.txt file
|
|
|
- Path output = Paths.get("objectSpecs.txt");
|
|
|
+ Path output = Paths.get(Main.olipPath + "objectSpecs.txt");
|
|
|
try {
|
|
|
Files.write(output, android, Charset.forName("UTF-8"));
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//Delete all created files after closing the programm. If you want permanent files, either use the "save object" button or copy the files before closing the programm.
|
|
|
- File f1 = new File(System.getProperty("user.dir") + File.separator + "output.stl");
|
|
|
+ File f1 = new File(Main.olipPath + "output.stl");
|
|
|
f1.deleteOnExit();
|
|
|
- File f2 = new File(System.getProperty("user.dir") + File.separator + "output_conductive.stl");
|
|
|
+ File f2 = new File(Main.olipPath + "output_conductive.stl");
|
|
|
f2.deleteOnExit();
|
|
|
- File f3 = new File(System.getProperty("user.dir") + File.separator + "output_crossSection.stl");
|
|
|
+ File f3 = new File(Main.olipPath + "output_crossSection.stl");
|
|
|
f3.deleteOnExit();
|
|
|
- File f4 = new File(System.getProperty("user.dir") + File.separator + "output_crossSection_conductive.stl");
|
|
|
+ File f4 = new File(Main.olipPath + "output_crossSection_conductive.stl");
|
|
|
f4.deleteOnExit();
|
|
|
- File f5 = new File(System.getProperty("user.dir") + File.separator + "instructions.txt");
|
|
|
+ File f5 = new File(Main.olipPath + "instructions.txt");
|
|
|
f5.deleteOnExit();
|
|
|
- File f6 = new File(System.getProperty("user.dir") + File.separator + "objectSpecs.txt");
|
|
|
+ File f6 = new File(Main.olipPath + "objectSpecs.txt");
|
|
|
f6.deleteOnExit();
|
|
|
|
|
|
//Delete the OpenSCAD file
|
|
@@ -334,16 +333,16 @@ public class Export {
|
|
|
*/
|
|
|
public static void saveFilesTo(File folder) {
|
|
|
try {
|
|
|
- File output = new File(new java.io.File( "." ).getCanonicalPath() + File.separator + "output.stl");
|
|
|
+ File output = new File(Main.olipPath + "output.stl");
|
|
|
Files.copy(output.toPath(), new File(folder.getAbsolutePath() + File.separator + "output.stl").toPath(), StandardCopyOption.REPLACE_EXISTING);
|
|
|
|
|
|
- File outputCond = new File(new java.io.File( "." ).getCanonicalPath() + File.separator + "output_conductive.stl");
|
|
|
+ File outputCond = new File(Main.olipPath + "output_conductive.stl");
|
|
|
Files.copy(outputCond.toPath(), new File(folder.getAbsolutePath() + File.separator + "output_conductive.stl").toPath(), StandardCopyOption.REPLACE_EXISTING);
|
|
|
|
|
|
- File instructions = new File(new java.io.File( "." ).getCanonicalPath() + File.separator + "instructions.txt");
|
|
|
+ File instructions = new File(Main.olipPath + "instructions.txt");
|
|
|
Files.copy(instructions.toPath(), new File(folder.getAbsolutePath() + File.separator + "instructions.txt").toPath(), StandardCopyOption.REPLACE_EXISTING);
|
|
|
|
|
|
- File android = new File(new java.io.File( "." ).getCanonicalPath() + File.separator + "objectSpecs.txt");
|
|
|
+ File android = new File(Main.olipPath + "objectSpecs.txt");
|
|
|
Files.copy(android.toPath(), new File(folder.getAbsolutePath() + File.separator + "objectSpecs.txt").toPath(), StandardCopyOption.REPLACE_EXISTING);
|
|
|
|
|
|
} catch (IOException e) {
|