mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:47:07 +00:00
Handle planner sequence value for first line in prospect.
The next sequence to shoot is normally retrieved from the database via getSequence(), but it returns false if no sequences have been shot yet. In that case we use a default value of `1` to build the name of the planned line. Fixes #81 Fixes #82
This commit is contained in:
@@ -92,7 +92,7 @@ async function getLineName (client, projectId, payload) {
|
||||
const attempt = planned.filter(r => r.line == payload.line).concat(previous).length;
|
||||
const p = payload;
|
||||
const incr = p.lsp > p.fsp;
|
||||
const sequence = p.sequence;
|
||||
const sequence = p.sequence || 1;
|
||||
const line = p.line;
|
||||
return `${incr?"1":"2"}0${line}${attempt}${sequence.toString().padStart(3, "0")}S00000`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user