-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yngve S. Kristiansen
committed
Sep 26, 2024
1 parent
5a402b8
commit ad7302d
Showing
4 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ | |
<div> | ||
<ExperimentsView/> | ||
<EventView/> | ||
<RunDialog/> | ||
<!--RunDialog/--> | ||
</div> |
12 changes: 9 additions & 3 deletions
12
frontend/ert-gui-svelte/ert-gui-svelte/src/lib/RunDialog.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
|
||
<script lang="ts"> | ||
import { renderedEvents, experiments } from "../stores/store" | ||
import { renderedSnapshots } from "../stores/consolidatedSnapshots" | ||
</script> | ||
|
||
<div> | ||
TODO | ||
<div class="rundialog-container"> | ||
{#each $renderedSnapshots as sn} | ||
<div class="iteration-container"> | ||
{#each Object.entries(sn.snapshot.reals) as [real, rstate]} | ||
<div>iter-{sn.iteration}, realization{real} - {rstate.status}</div> | ||
{/each} | ||
</div> | ||
{/each} | ||
</div> |
18 changes: 18 additions & 0 deletions
18
frontend/ert-gui-svelte/ert-gui-svelte/src/stores/consolidatedSnapshots.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { writable, type Writable, get } from 'svelte/store' | ||
import type { Experiment, FullSnapshotEvent, SnapshotUpdateEvent } from '../types' | ||
import { merge } from "lodash" | ||
|
||
export const renderedSnapshots: Writable<any> = writable([]) | ||
|
||
const _consolidatedSnapshots: (SnapshotUpdateEvent | FullSnapshotEvent)[] = [] | ||
export const writeSnapshot = (event: SnapshotUpdateEvent | FullSnapshotEvent) => { | ||
// Find iteration | ||
const iter = event.iteration | ||
if (iter === _consolidatedSnapshots.length) { | ||
_consolidatedSnapshots.push(event) | ||
} else { | ||
merge(_consolidatedSnapshots[iter], event) | ||
} | ||
|
||
renderedSnapshots.set(_consolidatedSnapshots) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters