Skip to content

Commit df1414c

Browse files
ndg63276Mark Williams
andauthored
LIMS-1856: Fix offset for plates (#973)
Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
1 parent 1138d0c commit df1414c

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

api/src/Page/Shipment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class Shipment extends Page
112112
// Container fields
113113
'DEWARID' => '\d+',
114114
'CAPACITY' => '\d+',
115-
'CONTAINERTYPE' => '([\w\-])+',
115+
'CONTAINERTYPE' => '([\s\w\-])+',
116116
'NAME' => '([\w\-])+',
117117
'SCHEDULEID' => '\d+',
118118
'SCREENID' => '\d+',
@@ -2748,7 +2748,7 @@ function _get_container_types()
27482748
$where .= ' AND ct.proposaltype = :1';
27492749
array_push($args, $this->arg('PROPOSALTYPE'));
27502750
}
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);
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, ct.dropOffsetX, ct.dropOffsetY FROM ContainerType ct WHERE $where", $args);
27522752
$this->_output(array('total' => count($rows), 'data' => $rows));
27532753
}
27542754

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/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

client/src/js/modules/types/mx/shipment/views/mx-container-add.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ const INITIAL_CONTAINER_TYPE = {
439439
NAME: null,
440440
WELLDROP: -1,
441441
WELLPERROW: null,
442+
DROPOFFSETX: null,
443+
DROPOFFSETY: null,
442444
}
443445
444446
export default {
@@ -567,7 +569,9 @@ export default {
567569
dropPerWellY: this.containerType['DROPPERWELLY'],
568570
dropWidth: this.containerType['DROPWIDTH'],
569571
wellDrop: this.containerType['WELLDROP'],
570-
wellPerRow: this.containerType['WELLPERROW']
572+
wellPerRow: this.containerType['WELLPERROW'],
573+
dropOffsetX: this.containerType['DROPOFFSETX'],
574+
dropOffsetY: this.containerType['DROPOFFSETY'],
571575
})
572576
573577
}

0 commit comments

Comments
 (0)