Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMS-121: Allow use of VMXm Gridboxes and Cartridges #732

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions api/src/Page/Sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1351,8 +1351,10 @@ function _update_sample_components($initial, $final, $amounts, $crystalid)

function _add_sample()
{
if (!$this->has_arg('prop'))
$this->_error('No proposal specified');
if (!$this->has_arg('prop')) {
$this->_output(array());
return;
}

// Register entire container
if ($this->has_arg('collection')) {
Expand Down
Binary file added client/src/images/block-4_no_labels_470x470.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/images/cartridge_no_labels_470x470.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/images/gridbox_no_labels_470x470.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ export default {
// This is the current logic to determine the plate type
// Anything other than Box, Puck or PCRStrip
// TODO - get container types from data base
let is_plate = ['box', 'puck', 'pcrstrip', 'block-4', null].indexOf(containerType) == -1 && containerType.indexOf('puck') == -1
let puckTypes = ['cartridge', 'box', 'puck', 'pcrstrip', 'block-4']
let is_plate = containerType !== null && (!puckTypes.some(v => containerType.includes(v)))

return is_plate
},
Expand Down
42 changes: 35 additions & 7 deletions client/src/js/modules/shipment/components/puck-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,38 @@ export default {
}
},
data() {
let sampleCentres, sampleRadius, sampleHighlightRadius
if (this.container.capacity === "4") {
let sampleCentres, sampleRadius, sampleHighlightRadius, containerImage
if (this.container.containerType === "VMXm-Cartridge") {
sampleCentres = [
[200, 150],
[320, 150],
[200, 270],
[320, 270],
[235, 75],
[235, 155],
[235, 235],
[235, 315],
[235, 395],
]
sampleRadius = 35
sampleHighlightRadius = 30
containerImage = '/assets/images/cartridge_no_labels_470x470.png'
} else if (this.container.containerType === "VMXm-GridBox") {
sampleCentres = [
[315, 310],
[315, 160],
[155, 160],
[155, 310],
]
sampleRadius = 50
sampleHighlightRadius = 19
containerImage = '/assets/images/gridbox_no_labels_470x470.png'
} else if (this.container.capacity === "4") {
sampleCentres = [
[152.5, 152.5],
[317.5, 152.5],
[152.5, 317.5],
[317.5, 317.5],
]
sampleRadius = 75
sampleHighlightRadius = 60
containerImage = '/assets/images/block-4_no_labels_470x470.png'
} else {
sampleCentres = [
[235, 157],
Expand All @@ -81,6 +103,7 @@ export default {
]
sampleRadius = 44
sampleHighlightRadius = 35
containerImage = '/assets/images/puck_no_labels_470x470.png'
}
return {
// Define geometry of puck locations
Expand All @@ -91,7 +114,7 @@ export default {
// Centre coordinates of puck 470x470 pixels
// Changing the background image would require changing the centres
centres: sampleCentres,
puckImage: '/assets/images/puck_no_labels_470x470.png',
puckImage: containerImage,
// Holders for svg elements used in updates
graphic: null, // Holder for svg puck graphic
labels: null, // Holder for text labels
Expand Down Expand Up @@ -147,6 +170,11 @@ export default {
.append('svg')
.attr('viewBox', viewBox.join(','))
.attr('preserveAspectRatio', 'xMaxYMax meet')
// Add the background image
svg.append('image')
.attr('href', this.puckImage)
.attr('width', 470)
.attr('height', 470)
// Chart area
this.graphic = svg.append('g')
this.labels = svg.append('g')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default {
geometry.drops.w = this.containerType.DROPWIDTH
geometry.well = this.containerType.WELLDROP
geometry.columns = this.containerType.WELLPERROW
geometry.containerType = this.containerType.NAME
return geometry
},
selectedDrops() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ const INITIAL_CONTAINER_TYPE = {
DROPPERWELLY: null,
DROPHEIGHT: null,
DROPWIDTH: null,
NAME: null,
WELLDROP: -1,
WELLPERROW: null,
}
Expand Down Expand Up @@ -506,8 +507,9 @@ export default {
this.CONTAINERTYPE = type.get('NAME')
const nameToLower = this.CONTAINERTYPE.toLowerCase()
this.containerType = Object.assign(INITIAL_CONTAINER_TYPE, type.toJSON())
const puckTypes = ['cartridge', 'box', 'puck', 'block-4']

if (nameToLower.includes('puck') || nameToLower.includes('block')) {
if (puckTypes.some(v => nameToLower.includes(v))) {
this.plateType = 'puck'
} else if (nameToLower.includes('pcrstrip')) {
this.plateType = 'pcr'
Expand Down
Loading