Skip to content
Snippets Groups Projects
Commit 8e248f99 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

eod

parent 8e5c63d9
No related branches found
No related tags found
No related merge requests found
......@@ -178,22 +178,14 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
// };
Assembler.prototype._postGetStock = function(index, position, settings, exporter){
var json = {
index:index,
position: position
};
return exporter.addComment("get stock " + JSON.stringify(json));
return exporter.addComment("get stock " + JSON.stringify(index));
};
Assembler.prototype._postReleaseStock = function(index, position, settings, exporter){
var json = {
index:index,
position: position
};
var data = "";
data += exporter.rapidZ(position.z-settings.originPosition.z+settings.safeHeight, settings);
data += exporter.moveZ(position.z-settings.originPosition.z, settings);
data += exporter.addComment(JSON.stringify(json));
data += exporter.addComment(JSON.stringify(index));
data += exporter.moveZ(position.z-settings.originPosition.z+settings.safeHeight, settings);
data += exporter.rapidZ(settings.rapidHeight, settings);
return data;
......@@ -223,17 +215,18 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
});
};
Assembler.prototype.pickUpStock = function(index, position, speed, settings, callback){
Assembler.prototype.pickUpStock = function(index, speed, settings, callback){
_.each(this.stock, function(stock){
stock.show();
});
if (index.z%2 != 0) {//rotate on odd rows
this.components.frame.rotateTo(new THREE.Vector3(0, 0, Math.PI/2), speed, callback);
return;
}
this.components.frame.rotateTo(new THREE.Vector3(0, 0, 0), speed, callback);
};
Assembler.prototype.releaseStock = function(index, position, settings){
Assembler.prototype.releaseStock = function(index, settings){
lattice.showCellAtIndex(index);
_.each(this.stock, function(stock){
stock.hide();
......
......@@ -100,12 +100,12 @@ define(['underscore', 'cam', 'lattice'], function(_, cam, lattice){
if (line.substr(0,10) == "(get stock"){
var json = line.substr(11,line.length-12);
json = JSON.parse(json);
return machine.pickUpStock(json.index, json.position, this.animationSpeed, settings, callback);
return machine.pickUpStock(json, this.animationSpeed, settings, callback);
}
if (line.substr(0,2) == "({"){
var json = line.substr(1,line.length-2);
json = JSON.parse(json);
machine.releaseStock(json.index, json.position, settings);
machine.releaseStock(json, settings);
return callback();
}
if (line[0] == "F"){//speed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment