-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added locale as parameter and renamed Storage to Bridge
- Loading branch information
1 parent
46f27fa
commit cf53545
Showing
9 changed files
with
33 additions
and
33 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
Binary file not shown.
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
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,18 +1,18 @@ | ||
import ReactEngine from './visualisation/react/engine' | ||
import ReactFactory from './visualisation/react/factory' | ||
import WorkerProcessingEngine from './processing/worker_engine' | ||
import { VisualisationEngine, ProcessingEngine, Storage } from './types/modules' | ||
import { VisualisationEngine, ProcessingEngine, Bridge } from './types/modules' | ||
import CommandRouter from './command_router' | ||
|
||
export default class Assembly { | ||
visualisationEngine: VisualisationEngine | ||
processingEngine: ProcessingEngine | ||
router: CommandRouter | ||
|
||
constructor (worker: Worker, system: Storage) { | ||
constructor (worker: Worker, bridge: Bridge) { | ||
const sessionId = String(Date.now()) | ||
this.visualisationEngine = new ReactEngine(new ReactFactory()) | ||
this.router = new CommandRouter(system, this.visualisationEngine) | ||
this.router = new CommandRouter(bridge, this.visualisationEngine) | ||
this.processingEngine = new WorkerProcessingEngine(sessionId, worker, this.router) | ||
} | ||
} |
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
Binary file modified
BIN
+5 Bytes
(100%)
src/framework/processing/py/dist/port-0.0.0-py3-none-any.whl
Binary file not shown.
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
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,30 +1,29 @@ | ||
import './fonts.css' | ||
import './framework/styles.css' | ||
import Assembly from './framework/assembly' | ||
import { Storage } from './framework/types/modules' | ||
import LiveStorage from './live_storage' | ||
import FakeStorage from './fake_storage' | ||
import { Bridge } from './framework/types/modules' | ||
import LiveBridge from './live_bridge' | ||
import FakeBridge from './fake_bridge' | ||
|
||
const rootElement = document.getElementById('root') as HTMLElement | ||
|
||
const locale = 'en' | ||
const workerFile = new URL('./framework/processing/py_worker.js', import.meta.url) | ||
const worker = new Worker(workerFile) | ||
|
||
let assembly: Assembly | ||
|
||
const run = (system: Storage): void => { | ||
assembly = new Assembly(worker, system) | ||
const run = (bridge: Bridge, locale: string): void => { | ||
assembly = new Assembly(worker, bridge) | ||
assembly.visualisationEngine.start(rootElement, locale) | ||
assembly.processingEngine.start() | ||
} | ||
|
||
if (process.env.REACT_APP_BUILD!=='standalone' && process.env.NODE_ENV === 'production') { | ||
if (process.env.REACT_APP_BUILD !== 'standalone' && process.env.NODE_ENV === 'production') { | ||
// Setup embedded mode (requires to be embedded in iFrame) | ||
console.log('Initializing storage system') | ||
LiveStorage.create(window, run) | ||
console.log('Initializing bridge system') | ||
LiveBridge.create(window, run) | ||
} else { | ||
// Setup local development mode | ||
console.log('Running with fake storage') | ||
run(new FakeStorage()) | ||
console.log('Running with fake bridge') | ||
run(new FakeBridge(), 'en') | ||
} |
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