Skip to content
Snippets Groups Projects
Commit f2700e9d authored by juanf's avatar juanf
Browse files

SSDM-1724 : Plate View (ongoing work)

SVN: 33916
parent d7af8d97
No related branches found
No related tags found
No related merge requests found
...@@ -42,9 +42,14 @@ function PlateController(sample) { ...@@ -42,9 +42,14 @@ function PlateController(sample) {
var _this = this; var _this = this;
$container.empty(); $container.empty();
$container.append("Loading Wells ..."); $container.append("Loading Wells ...");
mainController.serverFacade.searchContained(this._plateModel.sample.permId, function(contained) { if(this._plateModel.sample.contained) {
_this._plateModel.wells = contained; this._plateView.repaint($container);
_this._plateView.repaint($container); } else {
}); mainController.serverFacade.searchContained(this._plateModel.sample.permId, function(contained) {
_this._plateModel.sample.contained = contained;
_this._plateView.repaint($container);
});
}
} }
} }
\ No newline at end of file
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
function PlateModel(sample) { function PlateModel(sample) {
this.sample = sample; this.sample = sample;
this.wells = null;
var getRowsAndColsFromPlateSample = function(sample) { var getRowsAndColsFromPlateSample = function(sample) {
try { try {
...@@ -37,9 +36,9 @@ function PlateModel(sample) { ...@@ -37,9 +36,9 @@ function PlateModel(sample) {
this.getWell = function(rowNum, colNum) { this.getWell = function(rowNum, colNum) {
var wellIdentifier = this.sample.identifier + ":" + this.getAlphabetLabel(rowNum) + colNum; var wellIdentifier = this.sample.identifier + ":" + this.getAlphabetLabel(rowNum) + colNum;
for(var wellIdx = 0; wellIdx < this.wells.length; wellIdx++) { for(var wellIdx = 0; wellIdx < this.sample.contained.length; wellIdx++) {
if(this.wells[wellIdx].identifier === wellIdentifier) { if(this.sample.contained[wellIdx].identifier === wellIdentifier) {
var toReturn = this.wells[wellIdx]; var toReturn = this.sample.contained[wellIdx];
return toReturn; return toReturn;
} }
} }
......
...@@ -81,8 +81,6 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { ...@@ -81,8 +81,6 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) {
} }
this.filterSampleAndUpdate = function() { this.filterSampleAndUpdate = function() {
var newSample = jQuery.extend(true, {}, this.sample);
// //
// Used to remove the type label when rendering // Used to remove the type label when rendering
// //
...@@ -111,7 +109,7 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { ...@@ -111,7 +109,7 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) {
} }
} }
} }
selectedSampleTypesFilter(newSample, selectedSampleTypes); selectedSampleTypesFilter(this.sample, selectedSampleTypes);
// //
// Used to cut the tree // Used to cut the tree
...@@ -120,15 +118,16 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { ...@@ -120,15 +118,16 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) {
var parentsLimitFilter = function(sample, depthLimit) { var parentsLimitFilter = function(sample, depthLimit) {
if(sample.parents) { if(sample.parents) {
if(depthLimit === 0) { if(depthLimit === 0) {
sample.parents = null; sample.hideParents = true;
} else { } else {
sample.hideParents = false;
for(var i = 0; i < sample.parents.length; i++) { for(var i = 0; i < sample.parents.length; i++) {
parentsLimitFilter(sample.parents[i], (depthLimit - 1)); parentsLimitFilter(sample.parents[i], (depthLimit - 1));
} }
} }
} }
} }
parentsLimitFilter(newSample, parentsLimit); parentsLimitFilter(this.sample, parentsLimit);
// //
// Used to cut the tree // Used to cut the tree
...@@ -137,17 +136,18 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { ...@@ -137,17 +136,18 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) {
var childrenLimitFilter = function(sample, depthLimit) { var childrenLimitFilter = function(sample, depthLimit) {
if(sample.children) { if(sample.children) {
if(depthLimit === 0) { if(depthLimit === 0) {
sample.children = null; sample.hideChildren = true;
} else { } else {
sample.hideChildren = false;
for(var i = 0; i < sample.children.length; i++) { for(var i = 0; i < sample.children.length; i++) {
childrenLimitFilter(sample.children[i], (depthLimit - 1)); childrenLimitFilter(sample.children[i], (depthLimit - 1));
} }
} }
} }
} }
childrenLimitFilter(newSample, childrenLimit); childrenLimitFilter(this.sample, childrenLimit);
this._repaintGraph(newSample); this._repaintGraph(this.sample);
} }
this._addChildFor = function(permId) { this._addChildFor = function(permId) {
...@@ -359,10 +359,10 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { ...@@ -359,10 +359,10 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) {
NODES[sample.permId] = true; NODES[sample.permId] = true;
} }
if(sample.parents && !sample.hideGraphConnections) { if(sample.parents && !sample.hideGraphConnections && !sample.hideParents) {
sample.parents.forEach(addSampleNodes, rootPermId); sample.parents.forEach(addSampleNodes, rootPermId);
} }
if(sample.children && !sample.hideGraphConnections) { if(sample.children && !sample.hideGraphConnections && !sample.hideChildren) {
sample.children.forEach(addSampleNodes, rootPermId); sample.children.forEach(addSampleNodes, rootPermId);
} }
} }
...@@ -370,7 +370,7 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { ...@@ -370,7 +370,7 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) {
var EDGES = {}; var EDGES = {};
function addSampleEdges(sample) { function addSampleEdges(sample) {
if(sample.parents && !sample.hideGraphConnections) { if(sample.parents && !sample.hideGraphConnections && !sample.hideParents) {
for(var i=0; i < sample.parents.length; i++) { for(var i=0; i < sample.parents.length; i++) {
if(!EDGES[sample.parents[i].permId + ' -> ' + sample.permId]) { if(!EDGES[sample.parents[i].permId + ' -> ' + sample.permId]) {
g.addEdge(null, sample.parents[i].permId, sample.permId); g.addEdge(null, sample.parents[i].permId, sample.permId);
...@@ -379,7 +379,7 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { ...@@ -379,7 +379,7 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) {
} }
sample.parents.forEach(addSampleEdges); sample.parents.forEach(addSampleEdges);
} }
if(sample.children && !sample.hideGraphConnections) { if(sample.children && !sample.hideGraphConnections && !sample.hideChildren) {
for(var i=0; i < sample.children.length; i++) { for(var i=0; i < sample.children.length; i++) {
if(!EDGES[sample.permId + ' -> ' + sample.children[i].permId]) { if(!EDGES[sample.permId + ' -> ' + sample.children[i].permId]) {
g.addEdge(null, sample.permId, sample.children[i].permId); g.addEdge(null, sample.permId, sample.children[i].permId);
......
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