Commit 8bb1846e authored by amandaghassaei's avatar amandaghassaei

signals added correctly

parent 6f54f8c3
......@@ -298,12 +298,9 @@ define(['three', 'underscore', 'backbone', 'threeModel', 'appState', 'emSimLatti
}
if (data.lattice && data.lattice.signals){
var signalsData = [];
var cells = lattice.getCells();//todo problem
var cellsMin = lattice.get("cellsMin");
_.each(data.lattice.signals, function(signal){
var index = new THREE.Vector3(signal.index.x, signal.index.y, signal.index.z);
var json = _.omit(signal, "index");
index.sub(cellsMin);
signalsData.push({index: index, json:json});
});
emSimLattice.set("signalsData", signalsData);
......
......@@ -322,10 +322,12 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
signals.push(cell);
}
});
var cellsMin = lattice.get("cellsMin");
_.each(this.get("signalsData"), function(data){
var index = data.index;
var index = data.index.sub(cellsMin);
if (cells && cells[index.x] && cells[index.x][index.y] && cells[index.x][index.y][index.z]){
cells[index.x][index.y][index.z].setAsSignalGenerator(data.json)
cells[index.x][index.y][index.z].setAsSignalGenerator(data.json);
}
});
this.set("signalsData", []);
......
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