Fixed Slicing.
Normal behaviour is sliced gcode will be placed in same folder as the stl.
This commit is contained in:
parent
ca0463b4c0
commit
0dacfcdf8d
2 changed files with 22 additions and 3 deletions
|
|
@ -443,6 +443,13 @@ def gcodeFileCommand(filename, target):
|
|||
name, _ = os.path.splitext(filename)
|
||||
gcode_name = name + ".gco"
|
||||
|
||||
if "path" in data and data["path"]:
|
||||
gcode_name = fileManager.join_path(target, data["path"], gcode_name)
|
||||
else:
|
||||
path, _ = fileManager.split_path(target, filename)
|
||||
if path:
|
||||
gcode_name = fileManager.join_path(target, path, gcode_name)
|
||||
|
||||
# prohibit overwriting the file that is currently being printed
|
||||
currentOrigin, currentFilename = _getCurrentFile()
|
||||
if currentFilename == gcode_name and currentOrigin == target and (printer.is_printing() or printer.is_paused()):
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ $(function() {
|
|||
|
||||
self.target = undefined;
|
||||
self.file = undefined;
|
||||
self.path = undefined;
|
||||
self.data = undefined;
|
||||
|
||||
self.defaultSlicer = undefined;
|
||||
|
|
@ -34,16 +35,23 @@ $(function() {
|
|||
];
|
||||
self.afterSlicing = ko.observable("none");
|
||||
|
||||
self.show = function(target, file, force) {
|
||||
self.show = function(target, file, force, path) {
|
||||
if (!self.enableSlicingDialog() && !force) {
|
||||
return;
|
||||
}
|
||||
|
||||
var filename = file.substr(0, file.lastIndexOf("."));
|
||||
if (filename.lastIndexOf("/") != 0) {
|
||||
path = path || filename.substr(0, filename.lastIndexOf("/"));
|
||||
filename = filename.substr(filename.lastIndexOf("/") + 1);
|
||||
}
|
||||
|
||||
self.requestData();
|
||||
self.target = target;
|
||||
self.file = file;
|
||||
self.title(_.sprintf(gettext("Slicing %(filename)s"), {filename: self.file}));
|
||||
self.gcodeFilename(self.file.substr(0, self.file.lastIndexOf(".")));
|
||||
self.path = path;
|
||||
self.title(_.sprintf(gettext("Slicing %(filename)s"), {filename: filename}));
|
||||
self.gcodeFilename(filename);
|
||||
self.printerProfile(self.printerProfiles.currentProfile());
|
||||
self.afterSlicing("none");
|
||||
$("#slicing_configuration_dialog").modal("show");
|
||||
|
|
@ -149,6 +157,10 @@ $(function() {
|
|||
gcode: gcodeFilename
|
||||
};
|
||||
|
||||
if (self.path != undefined) {
|
||||
data["path"] = self.path;
|
||||
}
|
||||
|
||||
if (self.afterSlicing() == "print") {
|
||||
data["print"] = true;
|
||||
} else if (self.afterSlicing() == "select") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue