Commit 4d447988 authored by Amanda Ghassaei's avatar Amanda Ghassaei

fixes

parent dc278a7f
...@@ -145,7 +145,7 @@ define(['underscore', 'cam', 'lattice', 'three'], function(_, cam, lattice, THRE ...@@ -145,7 +145,7 @@ define(['underscore', 'cam', 'lattice', 'three'], function(_, cam, lattice, THRE
}; };
GCodeExporter.prototype._isMoveCommand = function(line){ GCodeExporter.prototype._isMoveCommand = function(line){
return line.substr(0,3) == "G01" || line.substr(0,2) == "G0"; return line.substr(0,2) == "G1" || line.substr(0,2) == "G0" || line.substr(0,3) == "G01";
}; };
GCodeExporter.prototype._simulateMove = function(line, speed, machine, settings, callback){ GCodeExporter.prototype._simulateMove = function(line, speed, machine, settings, callback){
......
...@@ -137,17 +137,15 @@ define(['underscore', 'backbone', 'socketio', 'machineState', 'cam'], ...@@ -137,17 +137,15 @@ define(['underscore', 'backbone', 'socketio', 'machineState', 'cam'],
if (data == "" || data == '\n' || data == "\r") return; if (data == "" || data == '\n' || data == "\r") return;
serialComm.set("lastMessageReceived", data, {silent:true}); serialComm.set("lastMessageReceived", data, {silent:true});
serialComm.trigger("change:lastMessageReceived"); serialComm.trigger("change:lastMessageReceived");
console.log(data);
try { try {
var json = JSON.parse(data); var json = JSON.parse(data);
console.log(json);
if (json.r && json.r.sr){ if (json.r && json.r.sr){
serialComm.getMachineState().setPosition(json.r.sr); serialComm.getMachineState().setPosition(json.r.sr);
} else if (json.sr){ } else if (json.sr){
serialComm.getMachineState().setPosition(json.sr); serialComm.getMachineState().setPosition(json.sr);
} }
} catch(err) { } catch(err) {
console.warn(err); // console.warn(err);
} }
}); });
...@@ -178,7 +176,7 @@ define(['underscore', 'backbone', 'socketio', 'machineState', 'cam'], ...@@ -178,7 +176,7 @@ define(['underscore', 'backbone', 'socketio', 'machineState', 'cam'],
}); });
socket.on("errorMsg", function(data){ socket.on("errorMsg", function(data){
console.log(data); console.warn(data);
serialComm.set("error", data.error); serialComm.set("error", data.error);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment