Update extension manager to ingest each module type. Add toolbar Manager.
This commit is contained in:
1 parent
a8340b9b69
commit
c42aa37d7f
9 files changed
+186
-85
No files matched your search
@@ -47,8 +47,6 @@ function appInit(appConfigOrFunc, defaultExtensions) {
|
||||
MeasurementService,
|
||||
]);
|
||||
|
||||
debugger;
|
||||
|
||||
/**
|
||||
* Example: [ext1, ext2, ext3]
|
||||
* Example2: [[ext1, config], ext2, [ext3, config]]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useContext, useEffect, useCallback } from 'react';
|
||||
import { displaySetManager } from '@ohif/core';
|
||||
import { displaySetManager, ToolBarManager } from '@ohif/core';
|
||||
import ViewModelContext from './ViewModelContext';
|
||||
import Compose from './Compose';
|
||||
|
||||
@@ -9,15 +9,21 @@ export default function ModeRoute({
|
||||
dataSourceName,
|
||||
extensionManager,
|
||||
}) {
|
||||
const { routes, sopClassHandlers, extensions } = mode;
|
||||
const { routes, sopClassHandlers, extensions, init } = mode;
|
||||
const dataSources = extensionManager.getDataSources(dataSourceName);
|
||||
|
||||
const toolbarManager = new ToolBarManager(extensionManager);
|
||||
|
||||
// TODO: For now assume one unique datasource.
|
||||
|
||||
const dataSource = dataSources[0];
|
||||
const route = routes[0];
|
||||
|
||||
route.init({ toolbarManager });
|
||||
|
||||
console.log(dataSource);
|
||||
|
||||
// Add toolbar state to the view model context?
|
||||
const { displaySetInstanceUids, setDisplaySetInstanceUids } = useContext(
|
||||
ViewModelContext
|
||||
);
|
||||
@@ -42,11 +48,9 @@ export default function ModeRoute({
|
||||
createDisplaySets();
|
||||
}, [mode, dataSourceName, location]);
|
||||
|
||||
// Deal with toolbar.
|
||||
|
||||
// Only handling one route per mode for now
|
||||
// You can test via http://localhost:3000/example-mode/dicomweb
|
||||
const layoutTemplateData = routes[0].layoutTemplate({ location });
|
||||
const layoutTemplateData = route.layoutTemplate({ location });
|
||||
const layoutTemplateModuleEntry = extensionManager.getModuleEntry(
|
||||
layoutTemplateData.id
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user