diff --git a/client/src/js/modules/dc/views/grid.js b/client/src/js/modules/dc/views/grid.js index b16b0f11f..22fa7a35f 100644 --- a/client/src/js/modules/dc/views/grid.js +++ b/client/src/js/modules/dc/views/grid.js @@ -37,6 +37,8 @@ define(['marionette', bx: '.boxx', by: '.boxy', zoom: 'a.zoom', + warning: '.warning', + warningli: '.warning-li', holder: '.holder h1', }, @@ -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 @@ -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) @@ -146,4 +156,4 @@ define(['marionette', }) -}) \ No newline at end of file +}) diff --git a/client/src/js/modules/dc/views/gridplot.js b/client/src/js/modules/dc/views/gridplot.js index e03a6bad2..e441511e2 100644 --- a/client/src/js/modules/dc/views/gridplot.js +++ b/client/src/js/modules/dc/views/gridplot.js @@ -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) { @@ -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'); } }, diff --git a/client/src/js/templates/dc/grid.html b/client/src/js/templates/dc/grid.html index ad91449ea..2bef78fec 100644 --- a/client/src/js/templates/dc/grid.html +++ b/client/src/js/templates/dc/grid.html @@ -25,6 +25,7 @@

Y: Z: +
  • Warning:
  • Enlarge @@ -32,4 +33,4 @@

    - \ No newline at end of file +