Skip to content

Commit

Permalink
LIMS-395: Display a warning on grid scans if no spots found or incomp…
Browse files Browse the repository at this point in the history
…lete PIA results
  • Loading branch information
Mark Williams committed Jun 13, 2023
1 parent 0623873 commit ccaebd1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
12 changes: 11 additions & 1 deletion client/src/js/modules/dc/views/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ define(['marionette',
bx: '.boxx',
by: '.boxy',
zoom: 'a.zoom',
warning: '.warning',
warningli: '.warning-li',

holder: '.holder h1',
},
Expand Down Expand Up @@ -68,6 +70,7 @@ define(['marionette',

this.gridplot = new GridPlot({ BL: this.model.get('BL'), ID: this.model.get('ID'), NUMIMG: this.model.get('NUMIMG'), parent: this.model, imagestatuses: this.getOption('imagestatuses') })
this.listenTo(this.gridplot, 'current', this.loadImage, this)
this.listenTo(this.gridplot, 'warning', this.loadWarning, this)
},

// should be an event
Expand All @@ -81,11 +84,18 @@ define(['marionette',
this.ui.val.text(val)
this.ui.img.text(number+1)
},

loadWarning: function(val) {
console.log('set warning', arguments)
this.ui.warning.text(val)
this.ui.warningli.show()
},


onShow: function() {
this.ui.holder.hide()
this.ui.zoom.hide()
this.ui.warningli.hide()

this.diviewer = new ImageViewer({ model: this.model, embed: true, readyText: 'Click on the grid to load a diffraction image' })
this.ui.di.append(this.diviewer.render().$el)
Expand Down Expand Up @@ -146,4 +156,4 @@ define(['marionette',

})

})
})
8 changes: 8 additions & 0 deletions client/src/js/modules/dc/views/gridplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ define(['jquery', 'marionette',
populatePIA: function() {
var d = this.distl.get('data')
var defaultPIA = 'pia_total_intensity'
var numberOfImages = this.grid.get('STEPS_X') * this.grid.get('STEPS_Y')
var dcAgeMinutes = this.getOption('parent').get('AGE')
if (d[0].length < 1) {
this.ui.ty.hide()
if (this.attachments.length) {
Expand All @@ -222,6 +224,12 @@ define(['jquery', 'marionette',
if (a) this.ui.ty2.val(a.get('DATACOLLECTIONFILEATTACHMENTID'))
this.loadAttachment()
}
} else if (d[0].length != numberOfImages && dcAgeMinutes < 5) {
this.trigger('warning', 'Per image analysis still ongoing');
} else if (d[0].length != numberOfImages) {
this.trigger('warning', 'Missing per image analysis');
} else if (Math.max(...d[0].map(o => o[1])) == 0) {
this.trigger('warning', 'Zero spots found');
}
},

Expand Down
3 changes: 2 additions & 1 deletion client/src/js/templates/dc/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ <h1 class="title"></h1>
Y: <span class="y"></span>
Z: <span class="z"></span>
</li>
<li class="warning-li"><i class="fa fa-warning"></i>Warning: <span class="warning"></span></li>
</ul>

<a href="#" class="button zoom"><i class="fa fa-search-plus"></i> <span>Enlarge</span></a>

<div class="holder">
<h1 title="Xray Centring Status and Results" class="xrc"><span><i class="fa fa-spinner fa-spin"></i></span></h1>
</div>
</div>
</div>

0 comments on commit ccaebd1

Please sign in to comment.