Skip to content

Commit 0580ece

Browse files
authored
Merge pre-release/2025-R4.1 into master (#982)
* LIMS-1856: Fix offset for plates (#973) * LIMS-1839: Fix fast_dp radiation damage plots (#964) * LIMS-1814: Add min images filter to summary page (#966) * LIMS-1804: Make barcode be required for new plates (#969) * LIMS-1802: Improvements to Add Shipment page (#972) * LIMS-1784: Add drawing for Cryo EM Puck (#970)
1 parent 1138d0c commit 0580ece

File tree

14 files changed

+190
-54
lines changed

14 files changed

+190
-54
lines changed

api/src/Page/DC.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,15 +1621,15 @@ function _rd($aid, $id)
16211621
INNER JOIN autoproc ap ON aps.autoprocid = ap.autoprocid
16221622
INNER JOIN autoprocprogram app ON api.autoprocprogramid = app.autoprocprogramid
16231623
INNER JOIN autoprocprogramattachment appa ON appa.autoprocprogramid = app.autoprocprogramid
1624-
WHERE api.datacollectionid = :1 AND api.autoprocprogramid=:2 AND appa.filetype LIKE 'Log'", array($id, $aid));
1624+
WHERE api.datacollectionid = :1 AND api.autoprocprogramid=:2 AND appa.filename='xdsstat.log'", array($id, $aid));
16251625

16261626
if (!sizeof($info))
1627-
$this->_error('The specified auto processing doesnt exist');
1627+
$this->_error('The xdsstat.log file doesnt exist');
16281628
else
16291629
$info = $info[0];
16301630
$this->db->close();
16311631

1632-
$file = $info['FILEPATH'] . '/xdsstat.log';
1632+
$file = $info['FILEPATH'] . '/' . $info['FILENAME'];
16331633

16341634
$rows = array();
16351635
if (file_exists($file)) {

api/src/Page/Processing.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class Processing extends Page {
3838
'rmeas' => '[\d\.]+',
3939
'cchalf' => '[\d\.]+',
4040
'ccanom' => '[\d\.]+',
41+
'images' => '\d+',
4142
'username' => '(\w|\s|\-|\.)+',
4243
'cloudrunid' => '(\w|\-)+',
4344
'AUTOPROCPROGRAMATTACHMENTID' => '\d+',
@@ -338,7 +339,7 @@ function _results_for_visit() {
338339

339340
$args = array($info[0]['SESSIONID']);
340341

341-
$where = 'dc.sessionid=:1 AND dc.overlap = 0 AND dc.axisrange > 0 AND dc.numberOfImages > 150 AND app.processingstatus = 1';
342+
$where = 'dc.sessionid=:1 AND dc.overlap = 0 AND dc.axisrange > 0 AND app.processingstatus = 1';
342343

343344
if ($this->has_arg('pipeline')) {
344345
$st = sizeof($args);
@@ -388,6 +389,12 @@ function _results_for_visit() {
388389
array_push($args, $this->arg('ccanom'));
389390
}
390391

392+
if ($this->has_arg('images')) {
393+
$st = sizeof($args);
394+
$where .= " AND dc.numberOfImages >= :" . ($st + 1);
395+
array_push($args, $this->arg('images'));
396+
}
397+
391398
if ($this->has_arg('s')) {
392399
$st = sizeof($args);
393400
$where .= " AND (CONCAT(dc.imageprefix,'_',dc.datacollectionnumber) LIKE CONCAT('%',:" . ($st + 1) . ",'%') OR smp.name LIKE CONCAT('%',:" . ($st + 2) . ",'%'))";

api/src/Page/Shipment.php

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class Shipment extends Page
9898
'LASTMINUTEBEAMTIME' => '1?|Yes|No',
9999
'DEWARGROUPING' => '.*',
100100
'EXTRASUPPORTREQUIREMENT' => '.*',
101+
'ONSITEUSERS' => '.*',
101102
'MULTIAXISGONIOMETRY' => '1?|Yes|No',
102103
'ENCLOSEDHARDDRIVE' => '1?|Yes|No',
103104
'ENCLOSEDTOOLS' => '1?|Yes|No',
@@ -112,7 +113,7 @@ class Shipment extends Page
112113
// Container fields
113114
'DEWARID' => '\d+',
114115
'CAPACITY' => '\d+',
115-
'CONTAINERTYPE' => '([\w\-])+',
116+
'CONTAINERTYPE' => '([\s\w\-])+',
116117
'NAME' => '([\w\-])+',
117118
'SCHEDULEID' => '\d+',
118119
'SCREENID' => '\d+',
@@ -165,6 +166,7 @@ class Shipment extends Page
165166
'LASTMINUTEBEAMTIME',
166167
'DEWARGROUPING',
167168
'EXTRASUPPORTREQUIREMENT',
169+
'ONSITEUSERS',
168170
'MULTIAXISGONIOMETRY',
169171
'ENCLOSEDHARDDRIVE',
170172
'ENCLOSEDTOOLS',
@@ -406,7 +408,9 @@ function _get_shipments()
406408
$extra_json = json_decode($s['EXTRA'], true);
407409
if (is_null($extra_json)) {
408410
$extra_json = array();
409-
foreach ($this->extra_arg_list as $arg) {
411+
}
412+
foreach ($this->extra_arg_list as $arg) {
413+
if (!array_key_exists($arg, $extra_json)) {
410414
$extra_json[$arg] = "";
411415
}
412416
}
@@ -2581,27 +2585,36 @@ function _add_container()
25812585
$pipeline = $this->has_arg('PROCESSINGPIPELINEID') ? $this->arg('PROCESSINGPIPELINEID') : null;
25822586
$source = $this->has_arg('SOURCE') ? $this->arg('SOURCE') : null;
25832587

2584-
$this->db->pq(
2585-
"INSERT INTO container (containerid,dewarid,code,bltimestamp,capacity,containertype,scheduleid,screenid,ownerid,requestedimagerid,comments,barcode,experimenttype,storagetemperature,containerregistryid,prioritypipelineid,source)
2586-
VALUES (s_container.nextval,:1,:2,CURRENT_TIMESTAMP,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,IFNULL(:15,CURRENT_USER)) RETURNING containerid INTO :id",
2587-
array($this->arg('DEWARID'), $this->arg('NAME'), $cap, $this->arg('CONTAINERTYPE'), $sch, $scr, $own, $rid, $com, $bar, $ext, $tem, $crid, $pipeline, $source)
2588-
);
2588+
try {
2589+
$this->db->pq(
2590+
"INSERT INTO container (containerid,dewarid,code,bltimestamp,capacity,containertype,scheduleid,screenid,ownerid,requestedimagerid,comments,barcode,experimenttype,storagetemperature,containerregistryid,prioritypipelineid,source)
2591+
VALUES (s_container.nextval,:1,:2,CURRENT_TIMESTAMP,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,IFNULL(:15,CURRENT_USER)) RETURNING containerid INTO :id",
2592+
array($this->arg('DEWARID'), $this->arg('NAME'), $cap, $this->arg('CONTAINERTYPE'), $sch, $scr, $own, $rid, $com, $bar, $ext, $tem, $crid, $pipeline, $source)
2593+
);
25892594

2590-
$cid = $this->db->id();
2595+
$cid = $this->db->id();
25912596

2592-
if ($this->has_arg('SCHEDULEID')) {
2593-
$sh = $this->app->container['imagingShared'];
2594-
$sh->_generate_schedule(array(
2595-
'CONTAINERID' => $cid,
2596-
'SCHEDULEID' => $this->arg('SCHEDULEID'),
2597-
));
2598-
}
2597+
if ($this->has_arg('SCHEDULEID')) {
2598+
$sh = $this->app->container['imagingShared'];
2599+
$sh->_generate_schedule(array(
2600+
'CONTAINERID' => $cid,
2601+
'SCHEDULEID' => $this->arg('SCHEDULEID'),
2602+
));
2603+
}
25992604

2600-
if ($this->has_arg('AUTOMATED')) {
2601-
$this->db->pq("INSERT INTO containerqueue (containerid, personid) VALUES (:1, :2)", array($cid, $this->user->personId));
2602-
}
2605+
if ($this->has_arg('AUTOMATED')) {
2606+
$this->db->pq("INSERT INTO containerqueue (containerid, personid) VALUES (:1, :2)", array($cid, $this->user->personId));
2607+
}
2608+
2609+
$this->_output(array('CONTAINERID' => $cid));
26032610

2604-
$this->_output(array('CONTAINERID' => $cid));
2611+
} catch (Exception $e) {
2612+
if ($e->getCode() == 1062) {
2613+
$this->_error('Barcode is not unique. Please enter a different barcode.', 409);
2614+
} else {
2615+
$this->_error('An unexpected error occurred.', 500);
2616+
}
2617+
}
26052618
}
26062619

26072620

@@ -2748,7 +2761,7 @@ function _get_container_types()
27482761
$where .= ' AND ct.proposaltype = :1';
27492762
array_push($args, $this->arg('PROPOSALTYPE'));
27502763
}
2751-
$rows = $this->db->pq("SELECT ct.containerTypeId, name, ct.proposalType, ct.capacity, ct.wellPerRow, ct.dropPerWellX, ct.dropPerWellY, ct.dropHeight, ct.dropWidth, ct.wellDrop FROM ContainerType ct WHERE $where", $args);
2764+
$rows = $this->db->pq("SELECT ct.containerTypeId, name, ct.proposalType, ct.capacity, ct.wellPerRow, ct.dropPerWellX, ct.dropPerWellY, ct.dropHeight, ct.dropWidth, ct.wellDrop, ct.dropOffsetX, ct.dropOffsetY FROM ContainerType ct WHERE $where", $args);
27522765
$this->_output(array('total' => count($rows), 'data' => $rows));
27532766
}
27542767

@@ -3117,6 +3130,7 @@ function _add_shipment()
31173130
}
31183131
$dewar_grouping = $this->has_arg('DEWARGROUPING') ? $this->arg('DEWARGROUPING') : '';
31193132
$extra_support_requirement = $this->has_arg('EXTRASUPPORTREQUIREMENT') ? $this->arg('EXTRASUPPORTREQUIREMENT') : '';
3133+
$onsite_users = $this->has_arg('ONSITEUSERS') ? $this->arg('ONSITEUSERS') : '';
31203134
$multi_axis_goniometry = null;
31213135
if ($this->has_arg('MULTIAXISGONIOMETRY')) {
31223136
$multi_axis_goniometry = $this->arg('MULTIAXISGONIOMETRY') ? "Yes" : "No";
@@ -3131,6 +3145,7 @@ function _add_shipment()
31313145
"LASTMINUTEBEAMTIME" => $last_minute_beamtime,
31323146
"DEWARGROUPING" => $dewar_grouping,
31333147
"EXTRASUPPORTREQUIREMENT" => $extra_support_requirement,
3148+
"ONSITEUSERS" => $onsite_users,
31343149
"MULTIAXISGONIOMETRY" => $multi_axis_goniometry
31353150
);
31363151

8.31 KB
Loading

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

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ define(['backbone',
3737
'change @ui.maxrmeas': 'changeRmeas',
3838
'change @ui.mincchalf': 'changeCCHalf',
3939
'change @ui.minccanom': 'changeCCAnom',
40+
'change @ui.minimages': 'changeImages',
4041
},
4142

4243
ui: {
@@ -48,19 +49,25 @@ define(['backbone',
4849
maxrmeas: 'input[name=maxrmeas]',
4950
mincchalf: 'input[name=mincchalf]',
5051
minccanom: 'input[name=minccanom]',
52+
minimages: 'input[name=minimages]',
5153
},
5254

5355
initialize: function(options) {
5456
this.visit = options.model.get('VISIT')
5557
},
5658

59+
updateData: function() {
60+
this.collection.state['currentPage'] = 1
61+
this.collection.fetch()
62+
},
63+
5764
changePipeline: function() {
5865
if (this.ui.pipeline.val()) {
5966
this.collection.queryParams.pipeline = this.ui.pipeline.val()
6067
} else {
6168
delete this.collection.queryParams.pipeline
6269
}
63-
this.collection.fetch()
70+
this.updateData()
6471
},
6572

6673
showSpaceGroups: async function() {
@@ -75,7 +82,7 @@ define(['backbone',
7582
} else {
7683
delete this.collection.queryParams.spacegroup
7784
}
78-
this.collection.fetch()
85+
this.updateData()
7986
},
8087

8188
changeResolution: function() {
@@ -84,7 +91,7 @@ define(['backbone',
8491
} else {
8592
delete this.collection.queryParams.resolution
8693
}
87-
this.collection.fetch()
94+
this.updateData()
8895
},
8996

9097
changeCompleteness: function() {
@@ -93,7 +100,7 @@ define(['backbone',
93100
} else {
94101
delete this.collection.queryParams.completeness
95102
}
96-
this.collection.fetch()
103+
this.updateData()
97104
},
98105

99106
changeAnomCompleteness: function() {
@@ -102,7 +109,7 @@ define(['backbone',
102109
} else {
103110
delete this.collection.queryParams.anomcompleteness
104111
}
105-
this.collection.fetch()
112+
this.updateData()
106113
},
107114

108115
changeRmeas: function() {
@@ -111,7 +118,7 @@ define(['backbone',
111118
} else {
112119
delete this.collection.queryParams.rmeas
113120
}
114-
this.collection.fetch()
121+
this.updateData()
115122
},
116123

117124
changeCCHalf: function() {
@@ -120,7 +127,7 @@ define(['backbone',
120127
} else {
121128
delete this.collection.queryParams.cchalf
122129
}
123-
this.collection.fetch()
130+
this.updateData()
124131
},
125132

126133
changeCCAnom: function() {
@@ -129,7 +136,16 @@ define(['backbone',
129136
} else {
130137
delete this.collection.queryParams.ccanom
131138
}
132-
this.collection.fetch()
139+
this.updateData()
140+
},
141+
142+
changeImages: function() {
143+
if (this.ui.minimages.val()) {
144+
this.collection.queryParams.images = this.ui.minimages.val()
145+
} else {
146+
delete this.collection.queryParams.images
147+
}
148+
this.updateData()
133149
},
134150

135151
onRender: function() {

client/src/js/modules/shipment/components/plate-view.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ export default {
136136
for (let i = 0; i < this.container.drops.x; ++i) {
137137
if (dropIndex !== this.wellIndex) {
138138
drops.push({
139-
x: this.cell.padding + this.dropWidth * i,
140-
y: this.cell.padding + this.dropHeight * j,
139+
x: this.cell.padding + this.dropWidth * i + this.container.drops.offsetx * this.cell.width,
140+
y: this.cell.padding + this.dropHeight * j + this.container.drops.offsety * this.cell.height,
141141
})
142142
}
143143
dropIndex += 1

client/src/js/modules/shipment/components/puck-view.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@ export default {
7272
sampleRadius = 50
7373
sampleHighlightRadius = 19
7474
containerImage = '/assets/images/gridbox_no_labels_470x470.png'
75+
} else if (this.container.containerType === "Cryo-EM Puck") {
76+
sampleCentres = [
77+
[295, 78],
78+
[392, 172],
79+
[399, 278],
80+
[290, 395],
81+
[180, 395],
82+
[71, 278],
83+
[78, 172],
84+
[175, 78],
85+
[288, 182],
86+
[295, 290],
87+
[175, 290],
88+
[182, 182],
89+
]
90+
sampleRadius = 50
91+
sampleHighlightRadius = 40
92+
containerImage = '/assets/images/cryoem_puck_no_labels_470x470.png'
7593
} else if (this.container.capacity === "4") {
7694
sampleCentres = [
7795
[152.5, 152.5],

client/src/js/modules/shipment/views/shipment.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ define(['marionette',
373373
this.edit.create("SCHEDULINGRESTRICTIONS", 'text')
374374
this.edit.create("LASTMINUTEBEAMTIME", 'select', { data: {'Yes': 'Yes', 'No': 'No'}})
375375
this.edit.create("DEWARGROUPING", 'select', { data: {'Yes': 'Yes', 'No': 'No', 'Don\'t mind': 'Don\'t mind'}})
376-
this.edit.create("EXTRASUPPORTREQUIREMENT", 'text');
376+
this.edit.create("EXTRASUPPORTREQUIREMENT", 'text', { placeholder: 'No' });
377+
this.edit.create("ONSITEUSERS", 'text', { placeholder: 'No' });
377378
this.edit.create("MULTIAXISGONIOMETRY", 'select', { data: {'Yes': 'Yes', 'No': 'No'}})
378379

379380
this.updateGUI()

client/src/js/modules/shipment/views/shipmentadd.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ define(['marionette', 'views/form',
6464
'change @ui.safetylevel': 'changeSafetyLevel',
6565
'change @ui.dynamic': 'updateFirstExp',
6666
'change @ui.longwavelengthsel': 'updateLongWavelength',
67+
'change @ui.extrasupportsel': 'updateExtraSupport',
68+
'change @ui.onsiteusersel': 'updateOnsiteUser',
6769
},
6870

6971
ui: {
@@ -82,6 +84,8 @@ define(['marionette', 'views/form',
8284
safetylevel: 'select[name=SAFETYLEVEL]',
8385
longwavelengthsel: 'select[name=LONGWAVELENGTH]',
8486
longwavelengthli: '.longwavelength',
87+
extrasupportsel: 'select[name=EXTRASUPPORTYESNO]',
88+
onsiteusersel: 'select[name=ONSITEUSERYESNO]',
8589
},
8690

8791
addLC: function(e) {
@@ -168,6 +172,22 @@ define(['marionette', 'views/form',
168172
}
169173
},
170174

175+
updateExtraSupport: function() {
176+
if (this.ui.extrasupportsel.val() === 'No') {
177+
this.$el.find(".extrasupportdetail").hide()
178+
} else {
179+
this.$el.find(".extrasupportdetail").show()
180+
}
181+
},
182+
183+
updateOnsiteUser: function() {
184+
if (this.ui.onsiteusersel.val() === 'No') {
185+
this.$el.find(".onsiteuserdetail").hide()
186+
} else {
187+
this.$el.find(".onsiteuserdetail").show()
188+
}
189+
},
190+
171191
isIndustrialProposal: function() {
172192
industrial_codes = app.options.get('industrial_prop_codes')
173193
return industrial_codes.includes(app.prop.slice(0,2))
@@ -216,6 +236,8 @@ define(['marionette', 'views/form',
216236
this.$el.find('li.d .floated').append(new FCodes({ collection: this.fcodes, dewars: this.dewars }).render().el)
217237

218238
this.$el.find(".remoteform").hide()
239+
this.$el.find(".extrasupportdetail").hide()
240+
this.$el.find(".onsiteuserdetail").hide()
219241
this.$el.find(".remoteormailin").hide()
220242

221243
this.checkFCodes()

client/src/js/modules/types/mx/samples/valid-container-graphic.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ export default {
9494
geometry.drops.y = this.containerType.DROPPERWELLY
9595
geometry.drops.h = this.containerType.DROPHEIGHT
9696
geometry.drops.w = this.containerType.DROPWIDTH
97+
geometry.drops.offsetx = this.containerType.DROPOFFSETX
98+
geometry.drops.offsety = this.containerType.DROPOFFSETY
9799
geometry.well = this.containerType.WELLDROP
98100
geometry.columns = this.containerType.WELLPERROW
99101
geometry.containerType = this.containerType.NAME

0 commit comments

Comments
 (0)