Skip to content
Snippets Groups Projects
Commit b6d5047a authored by amandaghassaei's avatar amandaghassaei
Browse files

debugging, working with shopbot now

parent 848d45e2
Branches
No related tags found
No related merge requests found
...@@ -20,8 +20,8 @@ Assembler = Backbone.Model.extend({ ...@@ -20,8 +20,8 @@ Assembler = Backbone.Model.extend({
stock: null, stock: null,
stockPosition: new THREE.Vector3(20,0,0), stockPosition: new THREE.Vector3(20,0,0),
rapidSpeeds:{xy: 3, z: 1}, rapidSpeeds:{xy: 3, z: 2},//rapids at clearance height
feedRate:{xy: 0.1, z: 0.1} feedRate:{xy: 0.1, z: 0.1},//speed when heading towards assembly
}, },
initialize: function(options){ initialize: function(options){
...@@ -145,14 +145,18 @@ Assembler = Backbone.Model.extend({ ...@@ -145,14 +145,18 @@ Assembler = Backbone.Model.extend({
dmaGlobals.lattice.rasterCells(this._getOrder(this.get("camStrategy")), function(cell){ dmaGlobals.lattice.rasterCells(this._getOrder(this.get("camStrategy")), function(cell){
if (!cell) return; if (!cell) return;
data += exporter.rapidXY(stockPosition.x-wcs.x, stockPosition.y-wcs.y); data += exporter.rapidXY(stockPosition.x, stockPosition.y);
data += exporter.moveZ(stockHeight); data += exporter.rapidZ(stockPosition.z+0.5);
data += exporter.moveZ(rapidHeight); data += exporter.moveZ(stockPosition.z);
data += exporter.moveZ(stockPosition.z+0.5);
data += exporter.rapidZ(rapidHeight);
var cellPosition = cell.getPosition(); var cellPosition = cell.getPosition();
data += exporter.rapidXY(cellPosition.x-wcs.x, cellPosition.y-wcs.y); data += exporter.rapidXY(cellPosition.x-wcs.x, cellPosition.y-wcs.y);
data += exporter.moveZ(stockHeight); data += exporter.rapidZ(cellPosition.z-wcs.z+0.5);
data += exporter.moveZ(rapidHeight); data += exporter.moveZ(cellPosition.z-wcs.z);
data += exporter.moveZ(cellPosition.z-wcs.z+0.5);
data += exporter.rapidZ(rapidHeight);
data += "\n"; data += "\n";
}); });
......
...@@ -47,6 +47,10 @@ ShopbotExporter.prototype.rapidXY = function(x, y){ ...@@ -47,6 +47,10 @@ ShopbotExporter.prototype.rapidXY = function(x, y){
return this.addLine("J2", [x,y]); return this.addLine("J2", [x,y]);
}; };
ShopbotExporter.prototype.rapidZ = function(z){
return this.rapidXYZ("", "", z);
};
ShopbotExporter.prototype.moveXYZ = function(x, y, z){ ShopbotExporter.prototype.moveXYZ = function(x, y, z){
return this.addLine("M3", [x,y,z]); return this.addLine("M3", [x,y,z]);
}; };
......
...@@ -240,7 +240,8 @@ AppState = Backbone.Model.extend({ ...@@ -240,7 +240,8 @@ AppState = Backbone.Model.extend({
break; break;
case 68://d delete mode case 68://d delete mode
console.log(state); console.log(state);
if (dmaGlobals.lattice.get("cellMode") == "cell") this.set("deleteMode", state);//only for cell mode console.log(dmaGlobals.lattice.get("cellMode"));
if (this.get("cellMode") == "cell") this.set("deleteMode", state);//only for cell mode
else this.set("deleteMode", false); else this.set("deleteMode", false);
break; break;
case 69://e case 69://e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment