-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/new build simulators #489
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
base: feature/controller-updates
Are you sure you want to change the base?
Changes from 31 commits
43693cc
19fc1b7
aa0dcee
58c9324
5e409f4
18f282a
c3c1bde
1571508
b38f79a
7a28fd2
b8344b4
74ecc3c
13adefa
8ce4a6b
bf6f3d7
caee3d4
69f405a
5f05fa0
8161f72
b4a51f5
ac0c092
fb4dd2e
cdfe7cb
6f65909
aa10bd1
1577a0a
6677ff3
1aa7e30
6e196ae
784019c
8780cf0
24b1330
c6516c4
46bb76f
34fca1c
591b000
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { ClientSimulator } from "./ClientSimulator"; | ||
| import { LocalFileSimulator } from "./LocalFileSimulator"; | ||
| import { RemoteSimulator } from "./RemoteSimulator"; | ||
| import { | ||
| SimulatorParams, | ||
| RemoteSimulatorParams, | ||
| ClientSimulatorParams, | ||
| LocalFileSimulatorParams, | ||
| } from "./types"; | ||
|
|
||
| export const getSimulatorClassFromParams = (params?: SimulatorParams) => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: just for the record, a true "factory" would actually CREATE and return instances of these classes. Just for clarity of terminology, as this is sort of a meta-factory which is just finding out what kind of class to create. |
||
| if (!params || !params.fileName) { | ||
| return { simulatorClass: null, typedParams: null }; | ||
| } | ||
| if ("netConnectionSettings" in params) { | ||
| return { | ||
| simulatorClass: RemoteSimulator, | ||
| typedParams: params as RemoteSimulatorParams, | ||
| }; | ||
| } else if ("clientSimulatorImpl" in params) { | ||
| return { | ||
| simulatorClass: ClientSimulator, | ||
| typedParams: params as ClientSimulatorParams, | ||
| }; | ||
| } else if ("simulariumFile" in params) { | ||
| return { | ||
| simulatorClass: LocalFileSimulator, | ||
| typedParams: params as LocalFileSimulatorParams, | ||
| }; | ||
| } else { | ||
| return { simulatorClass: null, typedParams: null }; | ||
| } | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { NetConnectionParams, IClientSimulatorImpl } from "../simularium"; | ||
| import { ISimulariumFile } from "../simularium/ISimulariumFile"; | ||
|
|
||
| export interface BaseSimulatorParams { | ||
| fileName: string; | ||
| } | ||
|
|
||
| export interface RemoteSimulatorParams extends BaseSimulatorParams { | ||
| netConnectionSettings?: NetConnectionParams; | ||
| requestJson?: boolean; | ||
| prefetchFrames?: boolean; | ||
| } | ||
|
|
||
| export interface ClientSimulatorParams extends BaseSimulatorParams { | ||
|
||
| clientSimulatorImpl?: IClientSimulatorImpl; | ||
| } | ||
|
|
||
| export interface LocalFileSimulatorParams extends BaseSimulatorParams { | ||
| simulariumFile?: ISimulariumFile; | ||
| geoAssets?: { [key: string]: string }; | ||
| } | ||
|
|
||
| export type SimulatorParams = | ||
| | RemoteSimulatorParams | ||
| | ClientSimulatorParams | ||
| | LocalFileSimulatorParams; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick sanity check: this looks like something important, where the code wanted to know that there was a file in-flight? is it really ok to remove it and within scope of this PR? or is this dead code that was never used?