diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2023-09-14 19:29:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 19:29:36 +0200 |
commit | 98ed3b6db5f4e51961a161050cc31c66015116e8 (patch) | |
tree | 8bfd6d9bc8d6ed23b9eb0f889dd40b6c24fe8f92 /subprojects/frontend/src/xtext/XtextWebSocketClient.ts | |
parent | Merge pull request #38 from nagilooh/design-space-exploration (diff) | |
parent | Merge remote-tracking branch 'upstream/main' into partial-interpretation (diff) | |
download | refinery-98ed3b6db5f4e51961a161050cc31c66015116e8.tar.gz refinery-98ed3b6db5f4e51961a161050cc31c66015116e8.tar.zst refinery-98ed3b6db5f4e51961a161050cc31c66015116e8.zip |
Merge pull request #39 from kris7t/partial-interpretation
Implement partial interpretation based model generation
Diffstat (limited to 'subprojects/frontend/src/xtext/XtextWebSocketClient.ts')
-rw-r--r-- | subprojects/frontend/src/xtext/XtextWebSocketClient.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/subprojects/frontend/src/xtext/XtextWebSocketClient.ts b/subprojects/frontend/src/xtext/XtextWebSocketClient.ts index 6bb7eec8..280ac875 100644 --- a/subprojects/frontend/src/xtext/XtextWebSocketClient.ts +++ b/subprojects/frontend/src/xtext/XtextWebSocketClient.ts | |||
@@ -204,7 +204,7 @@ export default class XtextWebSocketClient { | |||
204 | 204 | ||
205 | get state() { | 205 | get state() { |
206 | this.stateAtom.reportObserved(); | 206 | this.stateAtom.reportObserved(); |
207 | return this.interpreter.state; | 207 | return this.interpreter.getSnapshot(); |
208 | } | 208 | } |
209 | 209 | ||
210 | get opening(): boolean { | 210 | get opening(): boolean { |
@@ -270,6 +270,12 @@ export default class XtextWebSocketClient { | |||
270 | return promise; | 270 | return promise; |
271 | } | 271 | } |
272 | 272 | ||
273 | setKeepAlive(keepAlive: boolean): void { | ||
274 | this.interpreter.send({ | ||
275 | type: keepAlive ? 'GENERATION_STARTED' : 'GENERATION_ENDED', | ||
276 | }); | ||
277 | } | ||
278 | |||
273 | private updateVisibility(): void { | 279 | private updateVisibility(): void { |
274 | this.interpreter.send(document.hidden ? 'TAB_HIDDEN' : 'TAB_VISIBLE'); | 280 | this.interpreter.send(document.hidden ? 'TAB_HIDDEN' : 'TAB_VISIBLE'); |
275 | } | 281 | } |
@@ -282,7 +288,10 @@ export default class XtextWebSocketClient { | |||
282 | log.debug('Creating WebSocket'); | 288 | log.debug('Creating WebSocket'); |
283 | 289 | ||
284 | (async () => { | 290 | (async () => { |
285 | const { webSocketURL } = await fetchBackendConfig(); | 291 | let { webSocketURL } = await fetchBackendConfig(); |
292 | if (webSocketURL === undefined) { | ||
293 | webSocketURL = `${window.origin.replace(/^http/, 'ws')}/xtext-service`; | ||
294 | } | ||
286 | this.openWebSocketWithURL(webSocketURL); | 295 | this.openWebSocketWithURL(webSocketURL); |
287 | })().catch((error) => { | 296 | })().catch((error) => { |
288 | log.error('Error while initializing connection', error); | 297 | log.error('Error while initializing connection', error); |