Skip to content

Commit

Permalink
feat: query provider classes and TimeSeriesData support (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
boweihan authored Feb 9, 2022
1 parent 1d0f1e9 commit 173f46a
Show file tree
Hide file tree
Showing 16 changed files with 530 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class IotConnector {
queries: this.queries,
request: this.request,
},
(dataStreams: DataStream[]) => {
({ dataStreams }) => {
this.dataStreams = bindStylesToDataStreams({ dataStreams, styleSettings: this.styleSettings });
}
);
Expand Down
39 changes: 39 additions & 0 deletions packages/core/src/app-kit-component-session.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { SiteWiseAssetModule } from '.';
import { IotAppKitDataModule } from './data-module/IotAppKitDataModule';
import { IoTAppKitComponentSession, DataModuleSession } from './interface.d';

/**
* Component session to manage component data module sessions.
* Contains a reference to sitewise data modules
*/
export class AppKitComponentSession implements IoTAppKitComponentSession {
public componentId: string;

public siteWiseTimeSeriesModule: IotAppKitDataModule;

public siteWiseAssetModule: SiteWiseAssetModule;

private sessions: DataModuleSession[] = [];

constructor({
componentId,
siteWiseTimeSeriesModule,
siteWiseAssetModule,
}: {
componentId: string;
siteWiseTimeSeriesModule: IotAppKitDataModule;
siteWiseAssetModule: SiteWiseAssetModule;
}) {
this.componentId = componentId;
this.siteWiseTimeSeriesModule = siteWiseTimeSeriesModule;
this.siteWiseAssetModule = siteWiseAssetModule;
}

attachDataModuleSession(session: DataModuleSession): void {
this.sessions.push(session);
}

close(): void {
this.sessions.forEach((session) => session.close());
}
}
Loading

0 comments on commit 173f46a

Please sign in to comment.