From 71673da092f522d85f98bd3ab58bdea23b108373 Mon Sep 17 00:00:00 2001 From: martinjrobins Date: Fri, 8 Dec 2023 17:22:02 +0000 Subject: [PATCH] always ask for C1 in output --- frontend-v2/src/features/simulation/Simulations.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend-v2/src/features/simulation/Simulations.tsx b/frontend-v2/src/features/simulation/Simulations.tsx index ba821b1d..c789fb97 100644 --- a/frontend-v2/src/features/simulation/Simulations.tsx +++ b/frontend-v2/src/features/simulation/Simulations.tsx @@ -74,7 +74,7 @@ const getSimulateInput = ( for (const plot of simulation?.plots || []) { for (const y_axis of plot.y_axes) { const variable = variables?.find((v) => v.id === y_axis.variable); - if (variable && !outputs.includes(variable.name)) { + if (variable && !outputs.includes(variable.qname)) { outputs.push(variable.qname); } } @@ -85,6 +85,15 @@ const getSimulateInput = ( (v) => v.name === "time" || v.name === "t", ); outputs.push(timeVariable?.qname || "time"); + + // for some reason we need to ask for concentration or myokit produces a kink in the output + const alwaysAsk = ["PKCompartment.C1"]; + for (const v of alwaysAsk) { + const variable = variables?.find((vv) => vv.qname === v); + if (variable && !outputs.includes(variable.qname)) { + outputs.push(variable.qname); + } + } return { variables: simulateVariables, outputs,