diff --git a/js/cam/Cam.js b/js/cam/Cam.js index 23d7c507942010406a3cd392cd0bd87a5f37e3e6..340b9d4f4a40191dfe96f4b79a0323a6acda80c6 100644 --- a/js/cam/Cam.js +++ b/js/cam/Cam.js @@ -78,7 +78,7 @@ define(['underscore', 'three', 'backbone', 'appState', 'latticeCAM', 'threeModel // this._setNeedsPostProcessing); // this.listenTo(appState, "change:stockSimulationPlaying", this._stockSimulation); -// this.listenTo(lattice, "change:partType", this._updatePartType); + this.listenTo(lattice, "change:partType", this._updatePartType); this.listenTo(appState, "change:cellMode", this._updateCellMode); this.listenTo(this, "change:machineName", this.selectMachine); diff --git a/js/cam/assemblers/Assembler.js b/js/cam/assemblers/Assembler.js index 47e7453ee0cef7c063fafd15b8a0124262b7b678..48289100b439a242b6a3f0aed8d4889b0f5f3a6f 100644 --- a/js/cam/assemblers/Assembler.js +++ b/js/cam/assemblers/Assembler.js @@ -197,6 +197,12 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', ' stock.setMode(); }); }; + + Assembler.prototype.updatePartType = function(){//message from cam + _.each(this.stock, function(stock){ + stock.updatePartType(); + }); + }; Assembler.prototype.pickUpStock = function(){ _.each(this.stock, function(stock){ diff --git a/js/cam/assemblers/StockComponent.js b/js/cam/assemblers/StockComponent.js index 8fb6fa23d64fefae9c40f2462c1a319eabd9d678..ff315a36ee185ecd9c12e0c4128be2e579e6b1c2 100644 --- a/js/cam/assemblers/StockComponent.js +++ b/js/cam/assemblers/StockComponent.js @@ -52,6 +52,10 @@ define(['underscore', 'cam', 'three', 'component', 'lattice'], function(_, cam, this.cell.setMode(); }; + StockComponent.prototype.updatePartType = function(){//message from cam + this.cell.destroyParts(); + this.setMode(); + }; //helper