Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions api/src/Page/Sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ function _queue_all_sub_samples()
$this->_error('No containerid specified');
}

$args = array($this->proposalid, $this->arg('cid'), $this->arg('cid'), $this->arg('cid'));
$args = array($this->proposalid, $this->arg('cid'));
$where = ' AND c.containerid=:2 AND cq2.completedtimestamp IS NULL';

if ($this->has_arg('filter')) {
Expand All @@ -609,8 +609,14 @@ function _queue_all_sub_samples()
$where .= $filters[$this->arg('filter')];
}

$first_inner_select_where = ' AND s.containerid=:3';
$second_inner_select_where = ' AND s.containerid=:4';
if ($this->has_arg('LOCATION')) {
$where .= ' AND s.location=:' . (sizeof($args) + 1);
array_push($args, $this->arg('LOCATION'));
}

$first_inner_select_where = ' AND s.containerid=:' . (sizeof($args) + 1);
$second_inner_select_where = ' AND s.containerid=:' . (sizeof($args) + 2);
array_push($args, $this->arg('cid'), $this->arg('cid'));

$this->db->wait_rep_sync(true);
$ss_query_string = $this->get_sub_samples_query($where, $first_inner_select_where, $second_inner_select_where);
Expand Down
4 changes: 4 additions & 0 deletions client/src/css/partials/_imaging.scss
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,7 @@ input[name=gap] {
text-align: center;
box-sizing: content-box;
}

.plate-max-width {
max-width: 700px;
}
52 changes: 39 additions & 13 deletions client/src/js/modules/imaging/views/queuecontainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ define(['marionette',

'modules/imaging/models/plan',
'modules/imaging/collections/plans',
'modules/shipment/views/plate',

'collections/beamlinesetups',

Expand All @@ -27,6 +28,7 @@ define(['marionette',
SubSamples,
TableView, table, FilterView, utils,
DiffractionPlan, DiffractionPlans,
PlateView,
BeamlineSetups,
template, pointemplate, gridtemplate, xfetemplate,
VMXiPoint, VMXiGrid, VMXiXFE,
Expand Down Expand Up @@ -365,6 +367,7 @@ define(['marionette',

this.filterablecollection = options.collection.fullCollection// || options.collection
this.shadowCollection = this.filterablecollection.clone()
this.selectedPos = null

this.listenTo(this.filterablecollection, 'add', function (model, collection, options) {
this.shadowCollection.add(model, options)
Expand All @@ -387,19 +390,19 @@ define(['marionette',
_filter: function() {
var id = this.selected()
this.trigger('selected:change', id, this.selectedName())
if (id) {
if (id || this.selectedPos) {
var self = this
this.filterablecollection.reset(this.shadowCollection.filter(function(m) {
if (id === 'region') {
return m.get('X2') && m.get('Y2')

return m.get('X2') && m.get('Y2') && (self.selectedPos == null || m.get('LOCATION') == self.selectedPos)
} else if (id === 'point') {
return m.get('X') && m.get('Y') && !m.get('X2')
}
else if (id === 'auto') {
return m.get('SOURCE') == 'auto'

return m.get('X') && m.get('Y') && !m.get('X2') && (self.selectedPos == null || m.get('LOCATION') == self.selectedPos)
} else if (id === 'auto') {
return m.get('SOURCE') == 'auto' && (self.selectedPos == null || m.get('LOCATION') == self.selectedPos)
} else if (id === 'manual') {
return m.get('SOURCE') == 'manual'
return m.get('SOURCE') == 'manual' && (self.selectedPos == null || m.get('LOCATION') == self.selectedPos)
} else if (!isNaN(self.selectedPos)) {
return m.get('LOCATION') == self.selectedPos
}
}), {reindex: false})
} else {
Expand Down Expand Up @@ -517,6 +520,7 @@ define(['marionette',
qfilt: '.qfilt',
afilt: '.afilt',
rimg: '.image',
plate: '.plate',
},

events: {
Expand Down Expand Up @@ -577,6 +581,10 @@ define(['marionette',
data.filter = current.attr('id')
}

if (this.avtypeselector.selectedPos) {
data.LOCATION = this.avtypeselector.selectedPos
}

var self = this
this.$el.addClass('loading');
Backbone.ajax({
Expand Down Expand Up @@ -778,7 +786,6 @@ define(['marionette',
},

initialize: function() {
this._lastSample = null
this._subsamples_ready = []

this.platetypes = new PlateTypes()
Expand Down Expand Up @@ -878,7 +885,7 @@ define(['marionette',
},

selectSample: function() {
this.subsamples.at(0).set({ isSelected: true })
if (this.subsamples.length) this.subsamples.at(0).set({ isSelected: true })
},

refreshQSubSamples: function() {
Expand All @@ -889,8 +896,8 @@ define(['marionette',

selectSubSample: function() {
var ss = this.subsamples.findWhere({ isSelected: true })
var s = ss.get('BLSAMPLEID')
if (s !== this._lastSample) {
if (ss) {
var s = ss.get('BLSAMPLEID')
this.imagess.reset(this.subsamples.fullCollection.where({ BLSAMPLEID: s }))
var i = this.inspectionimages.findWhere({ BLSAMPLEID: s })
this.image.setModel(i)
Expand Down Expand Up @@ -992,12 +999,31 @@ define(['marionette',
})

this.qsmps.show(this.table2)

this.plateView = new PlateView({ collection: this.subsamples.fullCollection, type: this.type, inspectionimages: this.inspectionimages })
this.listenTo(this.plateView, 'dropClicked', this.filterByLocation, this)
this.plate.show(this.plateView)
},

onShow: function() {
this.rimg.show(this.image)
},

filterByLocation: function(pos) {
let newPos = this.avtypeselector.selectedPos != pos
this.avtypeselector.selectedPos = null
this.avtypeselector._filter()
_.map(this.subsamples.fullCollection.where({ isSelected: true }), function(ss) {
ss.set({ isSelected: false })
})
if (newPos) {
this.avtypeselector.selectedPos = pos
this.avtypeselector._filter()
}
this.selectSample()

},

})

})
3 changes: 2 additions & 1 deletion client/src/js/modules/shipment/views/plate.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ define(['marionette', 'backbone', 'utils', 'backbone-validation'], function(Mari

this.trigger('plate:select')
if (drop) drop.set('isSelected', true)
this.trigger('dropClicked', pos)
this.drawPlate()
}
},
Expand Down Expand Up @@ -187,7 +188,7 @@ define(['marionette', 'backbone', 'utils', 'backbone-validation'], function(Mari
var did = (k*this.pt.get('drop_per_well_x'))+j
if (this.pt.get('well_drop') > -1) {
if (did == this.pt.get('well_drop')) continue
if (did > this.pt.get('well_drop')) did--;
if (did > this.pt.get('well_drop')) did--;
}

var sampleid = i*this.pt.dropTotal()+did+1
Expand Down
8 changes: 4 additions & 4 deletions client/src/js/templates/imaging/queuecontainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>Prepare Container for Data Collection</h1>
<ul>
<li>
<span class="label">Container</span>
<span class="NAME"><%-NAME%></span>
<span class="NAME"><a href="/containers/cid/<%-CONTAINERID%>"><%-NAME%></a></span>
</li>

<li>
Expand All @@ -28,6 +28,8 @@ <h1>Prepare Container for Data Collection</h1>
</ul>
</div>

<div class="plate plate-max-width"></div>

<h2>Available Samples</h2>
<div class="filter">
<span class="r">
Expand All @@ -38,9 +40,7 @@ <h2>Available Samples</h2>
<li><label><input type="checkbox" name="nodata" /> Without Data</label></li>
<li><label><input type="checkbox" name="notcompleted" /> Not Completed</label></li>
</ul>
</div>
<div class="filter">
<div class="filter filter-nohide afilt"></div>
<span class="filter filter-nohide afilt"></span>
</div>
<div class="asamples"></div>
</div>
Expand Down
Loading