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

Refactored data channels #504

Merged
merged 80 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
2efa9ab
Started implementation
rubenthoms Oct 26, 2023
fe563a4
Further implementation, switched to ReactQuery v5
rubenthoms Oct 27, 2023
46088c7
Further implementation
rubenthoms Oct 30, 2023
f797c2c
Improved performance of sumo access
HansKallekleiv Oct 31, 2023
389bdf1
Implemented new start screen logic, new components, adjustments
rubenthoms Oct 31, 2023
88289fc
Further implemented RealizationPicker
rubenthoms Nov 1, 2023
495a341
Further implementation
rubenthoms Nov 2, 2023
95c60a3
Added queries for response fetching
rubenthoms Nov 3, 2023
6c5ef89
Merge remote-tracking branch 'origin/main' into new-inplace-volumetrics
rubenthoms Nov 7, 2023
8d2ef78
Auto stash before merge of "new-inplace-volumetrics" and "origin/main"
rubenthoms Nov 7, 2023
2f62227
Further implementation
rubenthoms Nov 7, 2023
b2a85d6
Merge remote-tracking branch 'origin/main' into new-inplace-volumetrics
rubenthoms Nov 8, 2023
68e9ae9
Further adjustments
rubenthoms Nov 9, 2023
02e9018
Further implementation
rubenthoms Nov 12, 2023
b02fbff
Started changing channel patterns/naming
rubenthoms Nov 14, 2023
c50a21f
Started implementing new channel architecture
rubenthoms Nov 17, 2023
c22cb47
Next iteration
rubenthoms Nov 20, 2023
e9d239f
Adjusted GUI and added multi program support
rubenthoms Nov 21, 2023
875b06c
Multi-program support, and other adjustments
rubenthoms Nov 22, 2023
1a03b8f
Multiple adjustments and new implementations
rubenthoms Nov 23, 2023
5b49361
Improved matrix plotting
rubenthoms Nov 24, 2023
df5db8c
Removed old broadcast architecture, introduced and improved new one
rubenthoms Nov 24, 2023
fdbb336
Started adjusting visualization layer
rubenthoms Nov 28, 2023
0864c5b
Added unit to time series matrix module channel
rubenthoms Nov 28, 2023
353f157
Adjustments to data channel visualization and overall UX improvements
rubenthoms Nov 29, 2023
3e8434f
Improvements to visualization layer and expanded ts logic
rubenthoms Nov 30, 2023
2634a87
Adjusted channel framework
rubenthoms Dec 4, 2023
241e122
Merge remote-tracking branch 'equinor/main' into refactored-data-chan…
rubenthoms Dec 4, 2023
5390d17
Further adjustments
rubenthoms Dec 4, 2023
45f61d2
Naming adjustments and started using unit conversion
rubenthoms Dec 5, 2023
aee9b30
Minor bug fixes and started implementing data grid
rubenthoms Dec 5, 2023
a499dc3
Small fixes to DataGrid component
rubenthoms Dec 6, 2023
ee3b9ad
Implemented naming changes and started with plot utilities
rubenthoms Dec 6, 2023
084f1a9
Improvements and further implementation of Figure class
rubenthoms Dec 7, 2023
5133b74
Fixed old channel logic remainders, adjusted modules to new channels
rubenthoms Dec 8, 2023
b02c69a
More adjustments to TornadoChart
rubenthoms Dec 8, 2023
f84588a
Further adjustments and fixes
rubenthoms Dec 11, 2023
527e3c7
Removed unnecessary files, reverted changes
rubenthoms Dec 13, 2023
2aff58a
Removed/refactored code
rubenthoms Dec 13, 2023
8e483c0
Adjusted `ModuleChannel`
rubenthoms Dec 13, 2023
73402cb
Adjustments to data channel classes
rubenthoms Dec 13, 2023
1adc4a3
Removed unused function
rubenthoms Dec 13, 2023
8df4e81
Simplified `useChannelReceiver` hook
rubenthoms Dec 13, 2023
70ff095
Removed comments
rubenthoms Dec 13, 2023
efc8f2e
Touch device fixes
rubenthoms Dec 13, 2023
7351435
Further adjustments and removed unnecessary code
rubenthoms Dec 14, 2023
6c36f93
Merge remote-tracking branch 'equinor/main' into refactored-data-chan…
rubenthoms Dec 15, 2023
ef4f577
Fixed linting/ts issues
rubenthoms Dec 15, 2023
b254039
Started bug fixing
rubenthoms Dec 16, 2023
4ca1166
Merge remote-tracking branch 'equinor/main' into refactored-data-chan…
rubenthoms Dec 18, 2023
3ad5194
Further improvements/bug fixes
rubenthoms Dec 18, 2023
6206e10
Merge remote-tracking branch 'equinor/main' into refactored-data-chan…
rubenthoms Dec 18, 2023
fe7175d
Merge remote-tracking branch 'origin/main' into refactored-data-channels
rubenthoms Dec 19, 2023
22c126a
Further adjustments
rubenthoms Dec 19, 2023
747c824
Experiments to improve performance
rubenthoms Dec 19, 2023
f5b59db
Removed some performance experiments, fixed bugs
rubenthoms Jan 4, 2024
c036299
Merge remote-tracking branch 'equinor/main' into refactored-data-chan…
rubenthoms Jan 5, 2024
273b674
Fixed issues
rubenthoms Jan 5, 2024
d574dab
Bugfix
rubenthoms Jan 5, 2024
0804fe1
Removed unused utility function
rubenthoms Jan 5, 2024
4ede8fc
Removed experimental setting
rubenthoms Jan 5, 2024
ed58efa
Removed debug template
rubenthoms Jan 5, 2024
b1883c6
Reverted performance improvement due to unknown consequences
rubenthoms Jan 5, 2024
1a74889
Removed debug channels
rubenthoms Jan 5, 2024
cc31d96
Removed debug code
rubenthoms Jan 5, 2024
004a41f
Fixed conditional hook
rubenthoms Jan 5, 2024
3f2d85a
Fixed spelling and reverted unnecessary changes
rubenthoms Jan 5, 2024
bf7d58c
Fixed linting issues
rubenthoms Jan 5, 2024
7192e49
Merge remote-tracking branch 'equinor/main' into refactored-data-chan…
rubenthoms Jan 5, 2024
6ee518d
Bug fixes and improvements to SimulationTimeSeriesMatrix and DistPlot
rubenthoms Jan 12, 2024
345d34f
Fixed bug in data generator
rubenthoms Jan 18, 2024
bb268d7
Fixed issue with colormapping
rubenthoms Jan 18, 2024
ef276e4
Fixed introduced bug in SimulationTimeSeriesMatrix
rubenthoms Jan 18, 2024
ec4a12e
Adjusted according to review comments
rubenthoms Jan 18, 2024
9b9eba0
Merge branch 'main' into refactored-data-channels
rubenthoms Jan 18, 2024
2bf5486
Removed unused import
rubenthoms Jan 18, 2024
295d251
Adjusted according to review discussion
rubenthoms Jan 22, 2024
d7d5941
Fixed wrong import path
rubenthoms Jan 23, 2024
f0d7eff
Merge branch 'main' into refactored-data-channels
rubenthoms Jan 23, 2024
8b8d9ad
Replaced function arg deconstruction with options pattern
rubenthoms Jan 23, 2024
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
26 changes: 19 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
{
"configurations": [
"configurations": [
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"connect": { "host": "localhost", "port": 5678 },
"pathMappings": [
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"connect": { "host": "localhost", "port": 5678 },
"pathMappings": [{ "localRoot": "${workspaceFolder}/backend", "remoteRoot": "/home/appuser/backend" }]
"localRoot": "${workspaceFolder}/backend",
"remoteRoot": "/home/appuser/backend"
}
]
]
},
{
"name": "TS: Launch Chrome and Attach",
"request": "launch",
"type": "chrome",
"webRoot": "${workspaceFolder}/frontend",
"url": "http://localhost:8080"
}
]
}
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Webviz | FMU results visualization</title>
</head>
<body>
<body className="touch-none">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
Expand Down
260 changes: 0 additions & 260 deletions frontend/src/framework/Broadcaster.ts

This file was deleted.

36 changes: 36 additions & 0 deletions frontend/src/framework/DataChannelTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export type { ModuleChannelContentDefinition } from "./internal/DataChannels/ModuleChannelContent";
export type { ModuleChannelDefinition } from "./internal/DataChannels/ModuleChannel";
export type { ModuleChannelReceiverDefinition } from "./internal/DataChannels/ModuleChannelReceiver";
export type { DataGenerator, ModuleChannelContentMetaData } from "./internal/DataChannels/ModuleChannelContent";
export type { ChannelReceiverChannelContent } from "./internal/DataChannels/hooks/useChannelReceiver";

export enum KeyKind {
TimestampMs = "timestamp-ms",
Realization = "realization",
GridIndex = "grid-index",
GridIJK = "grid-ijk",
MeasuredDepth = "measured-depth",
}

export enum KeyType {
Number = "number",
NumberTriplet = "number-triplet",
}

export interface KeyKindToKeyTypeMapping {
[KeyKind.TimestampMs]: KeyType.Number;
[KeyKind.Realization]: KeyType.Number;
[KeyKind.GridIndex]: KeyType.Number;
[KeyKind.GridIJK]: KeyType.NumberTriplet;
[KeyKind.MeasuredDepth]: KeyType.Number;
}

export interface DataElement<TKeyType extends KeyType> {
key: KeyTypeToTypeScriptTypeMapping[TKeyType];
value: number;
}

type KeyTypeToTypeScriptTypeMapping = {
[KeyType.Number]: number;
[KeyType.NumberTriplet]: [number, number, number];
};
12 changes: 3 additions & 9 deletions frontend/src/framework/GuiMessageBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import React from "react";
import { isDevMode } from "@lib/utils/devMode";
import { Point } from "@lib/utils/geometry";

import { GlobalCursor } from "./internal/GlobalCursor";

export enum DrawerContent {
ModuleSettings = "ModuleSettings",
ModulesList = "ModulesList",
Expand All @@ -19,6 +17,7 @@ export enum GuiState {
ActiveModuleInstanceId = "activeModuleInstanceId",
DataChannelConnectionLayerVisible = "dataChannelConnectionLayerVisible",
DevToolsVisible = "devToolsVisible",
EditDataChannelConnections = "editDataChannelConnections",
}

export enum GuiEvent {
Expand Down Expand Up @@ -56,7 +55,7 @@ export type GuiEventPayloads = {
};
[GuiEvent.HighlightDataChannelConnectionRequest]: {
moduleInstanceId: string;
dataChannelName: string;
receiverIdString: string;
};
[GuiEvent.DataChannelOriginPointerDown]: {
moduleInstanceId: string;
Expand All @@ -73,6 +72,7 @@ type GuiStateValueTypes = {
[GuiState.ActiveModuleInstanceId]: string;
[GuiState.DataChannelConnectionLayerVisible]: boolean;
[GuiState.DevToolsVisible]: boolean;
[GuiState.EditDataChannelConnections]: boolean;
};

const defaultStates: Map<GuiState, any> = new Map();
Expand All @@ -88,21 +88,15 @@ export class GuiMessageBroker {
private _eventListeners: Map<GuiEvent, Set<(event: any) => void>>;
private _stateSubscribers: Map<GuiState, Set<(state: any) => void>>;
private _storedValues: Map<GuiState, any>;
private _globalCursor: GlobalCursor;

constructor() {
this._eventListeners = new Map();
this._stateSubscribers = new Map();
this._storedValues = defaultStates;
this._globalCursor = new GlobalCursor();

this.loadPersistentStates();
}

getGlobalCursor(): GlobalCursor {
return this._globalCursor;
}

private loadPersistentStates() {
persistentStates.forEach((state) => {
const value = localStorage.getItem(state);
Expand Down
Loading