Skip to content

Commit a847545

Browse files
ndg63276Mark Williams
andauthored
LIMS-1833: Fix XPDF DC view (#963)
Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
1 parent f12d356 commit a847545

File tree

7 files changed

+34
-14
lines changed

7 files changed

+34
-14
lines changed

client/src/js/modules/dc/views/dc.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,19 @@ define(['marionette',
4242
this.strat = null
4343
this.ap = null
4444
this.dp = null
45+
this.showStrategies = true
46+
this.showProcessing = true
47+
this.setProcessingVars()
4548
},
46-
49+
50+
setProcessingVars: function() {
51+
const hasProcessing = this.model.get('AXISRANGE') > 0 || this.model.get('DCT') === "Serial Fixed" || this.model.get('DCT') === "Serial Jet"
52+
const isCharacterization = this.model.get('DCT') === "Characterization"
53+
const hasStrategies = this.model.get('AXISRANGE') > 0 && this.model.get('OVERLAP') != 0
54+
this.showStrategies = isCharacterization || hasStrategies
55+
this.showProcessing = isCharacterization || (!hasStrategies && hasProcessing)
56+
},
57+
4758
onShow: function() {
4859
// element not always available at this point?
4960
var w = 0.175*$(window).width()*0.95
@@ -62,17 +73,13 @@ define(['marionette',
6273
// edit.create('COMMENTS', 'text')
6374

6475
this.imagestatus = new (this.getOption('imageStatusItem'))({ ID: this.model.get('ID'), TYPE: this.model.get('DCT'), statuses: this.getOption('imagestatuses'), el: this.$el })
65-
const isCharacterization = this.model.get('DCT') === "Characterization"
66-
const hasStrategies = this.model.get('AXISRANGE') > 0 && this.model.get('OVERLAP') != 0
67-
const hasProcessing = this.model.get('AXISRANGE') > 0 || this.model.get('DCT') === "Serial Fixed" || this.model.get('DCT') === "Serial Jet"
68-
const showStrategies = isCharacterization || hasStrategies
69-
const showProcessing = isCharacterization || (!hasStrategies && hasProcessing)
70-
if (!showStrategies) this.ui.strat.hide()
71-
if (!showProcessing) {
76+
if (!this.showStrategies) this.ui.strat.hide()
77+
if (!this.showProcessing) {
7278
this.ui.ap.hide();
7379
this.ui.dp.hide();
7480
}
75-
this.apstatus = new (this.getOption('apStatusItem'))({ ID: this.model.get('ID'), showStrategies: showStrategies, showProcessing: showProcessing, statuses: this.getOption('apstatuses'), el: this.$el })
81+
82+
this.apstatus = new (this.getOption('apStatusItem'))({ ID: this.model.get('ID'), showStrategies: this.showStrategies, showProcessing: this.showProcessing, statuses: this.getOption('apstatuses'), el: this.$el })
7683
this.listenTo(this.apstatus, 'status', this.updateAP, this)
7784
this.apmessagestatus = new (this.getOption('apMessageStatusItem'))({ ID: this.model.get('ID'), statuses: this.getOption('apmessagestatuses'), el: this.$el })
7885

client/src/js/modules/types/gen/dc/dc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ define([
2121
'click a.dd': utils.signHandler,
2222
},
2323

24+
setProcessingVars: function() {},
25+
2426
associateSample: function(e) {
2527
e.preventDefault()
2628
app.dialog.show(new AssocSampleView({ model: this.model }))
@@ -52,4 +54,4 @@ define([
5254

5355
})
5456

55-
})
57+
})

client/src/js/modules/types/pow/dc/dc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ define([
1818
'click a.assoc': 'associateSample',
1919
'click a.dd': utils.signHandler,
2020
},
21-
21+
22+
setProcessingVars: function() {},
23+
2224
showPlot: function(e) {
2325
e.preventDefault()
2426
app.dialog.show(new DialogView({ title: '1D Plot', view: new DatPlotLarge({ parent: this.model }), autoSize: true }))
@@ -31,4 +33,4 @@ define([
3133

3234
})
3335

34-
})
36+
})

client/src/js/modules/types/saxs/dc/dc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ define([
1818
'click a.dd': utils.signHandler,
1919
'click .holder h1.dp': 'loadAP',
2020
},
21-
21+
22+
setProcessingVars: function() {},
23+
2224
showDiff: function(e) {
2325
e.preventDefault()
2426
this.$el.find('.diffraction a').eq(0).trigger('click')

client/src/js/modules/types/sm/dc/dc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ define([
88
apStatusItem: APStatusItem,
99
template: Template,
1010

11+
setProcessingVars: function() {},
12+
1113
loadAP: function(e) {
1214
if (!this.ap) {
1315
this.ap = new DCAutoIntegrationView({ id: this.model.get('ID'), dcPurgedProcessedData: this.model.get('PURGEDPROCESSEDDATA'), el: this.$el.find('div.autoproc') })

client/src/js/modules/types/tomo/dc/dc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ define([
55
return DCItemView.extend({
66
template: template,
77
plotView: null,
8+
9+
setProcessingVars: function() {},
10+
811
})
912

10-
})
13+
})

client/src/js/modules/types/xpdf/dc/dc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ define([
2929
params: '.params'
3030
},
3131

32+
setProcessingVars: function() {},
33+
3234
onDomRefresh: function() {
3335
var params = JSON.parse(this.model.get('SCANPARAMS'))
3436
if(params != null){

0 commit comments

Comments
 (0)