From 09973f0dbe4ca3ad421f26f6fe3218a6d60a9b63 Mon Sep 17 00:00:00 2001 From: asylves1 Date: Wed, 24 Jul 2024 15:18:37 -0400 Subject: [PATCH 01/11] rough working version --- .../calibrate-ciemss/calibrate-operation.ts | 1 + .../tera-calibrate-ciemss-drilldown.vue | 10 +++- .../tera-calibrate-node-ciemss.vue | 59 ++++++++++++++++++- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/calibrate-operation.ts b/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/calibrate-operation.ts index 7a857ebf44..1d4d0447eb 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/calibrate-operation.ts +++ b/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/calibrate-operation.ts @@ -7,6 +7,7 @@ export interface CalibrationOperationStateCiemss extends BaseState { chartConfigs: string[][]; mapping: CalibrateMap[]; simulationsInProgress: string[]; + lossValues?: any; inProgressCalibrationId: string; inProgressPreForecastId: string; diff --git a/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/tera-calibrate-ciemss-drilldown.vue b/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/tera-calibrate-ciemss-drilldown.vue index e11669b70c..6032d3dd88 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/tera-calibrate-ciemss-drilldown.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/tera-calibrate-ciemss-drilldown.vue @@ -374,13 +374,15 @@ const runCalibrate = async () => { const messageHandler = (event: ClientEvent) => { lossValues.push({ iter: lossValues.length, loss: event.data.loss }); - if (drilldownLossPlot.value) { renderLossGraph(drilldownLossPlot.value, lossValues, { width: previewChartWidth.value, height: 120 }); } + const state = props.node.state; + state.lossValues = lossValues; + emit('update-state', state); }; const onSelection = (id: string) => { @@ -484,6 +486,8 @@ watch( if (props.node.active) { selectedOutputId.value = props.node.active; + const state = props.node.state; + // Fetch saved intermediate state const simulationObj = await getSimulation(selectedRunId.value); if (simulationObj?.updates) { @@ -497,9 +501,11 @@ watch( height: 120 }); } + + state.lossValues = lossValues; + emit('update-state', state); } - const state = props.node.state; runResult.value = await getRunResultCSV(state.forecastId, 'result.csv'); runResultSummary.value = await getRunResultCSV(state.forecastId, 'result_summary.csv'); diff --git a/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/tera-calibrate-node-ciemss.vue b/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/tera-calibrate-node-ciemss.vue index 25a57f2ad6..5fbcef80e9 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/tera-calibrate-node-ciemss.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/calibrate-ciemss/tera-calibrate-node-ciemss.vue @@ -1,6 +1,10 @@