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

mm support for shopbot

parent a1cb19dc
No related branches found
No related tags found
No related merge requests found
...@@ -82,6 +82,10 @@ ShopbotExporter.prototype.convertToInches = function(mm){ ...@@ -82,6 +82,10 @@ ShopbotExporter.prototype.convertToInches = function(mm){
return mm*0.0393701; return mm*0.0393701;
}; };
ShopbotExporter.prototype.convertToMM = function(inches){
return inches*25.4;
};
ShopbotExporter.prototype.simulate = function(line, machine, wcs, callback){ ShopbotExporter.prototype.simulate = function(line, machine, wcs, callback){
if (line == "'get stock"){ if (line == "'get stock"){
...@@ -114,9 +118,11 @@ ShopbotExporter.prototype._simulateGetPosition = function(line, speed, machine, ...@@ -114,9 +118,11 @@ ShopbotExporter.prototype._simulateGetPosition = function(line, speed, machine,
if (item[item.length-1] == ",") data[i] = item.substring(0, item.length - 1) if (item[item.length-1] == ",") data[i] = item.substring(0, item.length - 1)
} }
if (line[1] == 3){ if (line[1] == 3){
machine.moveTo(data[1], data[2], data[3], speed, wcs, callback); if (dmaGlobals.lattice.get("units") == "inches") machine.moveTo(data[1], data[2], data[3], speed, wcs, callback);
else machine.moveTo(this.convertToMM(data[1]), this.convertToMM(data[2]), this.convertToMM(data[3]), speed, wcs, callback);
} else { } else {
machine.moveTo(data[1], data[2], "", speed, wcs, callback); if (dmaGlobals.lattice.get("units") == "inches") machine.moveTo(data[1], data[2], "", speed, wcs, callback);
else return machine.moveTo(this.convertToMM(data[1]), this.convertToMM(data[2]), "", speed, wcs, callback);
} }
} else if (line[1] == "S"){ } else if (line[1] == "S"){
return callback(); return callback();
......
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