feat: state sync service and hanging protocol updates to preserve state (#3131)
* feat: Add state sync and use it to remember viewport grid info fix: Version updates Fixes for toggling MPR mode Fix the display when the interleaved load module fails Fix the memory of the state to restore correctly PR fixes for the state sync service PR fixes PR fixes PR fixes Added a hack warning to remove volumeDeactivate Fixes for TMTV colormap setting Fix the casing Missed renames fix: tests not running due to variance in ordering Reverting some fixes to change case PR changes - mostly comments and minor improvements fix: All display sets were being updated on drag and drop PR fixes - mostly renames PR fixes Test support for OHIF, for HP branch test: Add at least a minimal set of automated tests for hanging protocols Docs PR fixes Merge fixes DOCS updates Add an example of the mn hanging protocol PR fixes PR fixes PR fixes * Fix the drag and drop PR fixes * PR changes - update default keys for next/previous stage * fix: Was storing the custom viewport grid too aggressively Caused by a PR change misspelling a variable
This commit is contained in:
1 parent
b7fff77e17
commit
803f638401
87 files changed
+3413
-1919
No files matched your search
@@ -63,7 +63,7 @@ export default class CustomizationService extends PubSubService {
|
||||
|
||||
modeCustomizations: Record<string, Customization> = {};
|
||||
globalCustomizations: Record<string, Customization> = {};
|
||||
configuration: UICustomizationConfiguration;
|
||||
configuration: CustomizationConfiguration;
|
||||
|
||||
constructor({ configuration, commandsManager }) {
|
||||
super(EVENTS);
|
||||
@@ -97,36 +97,6 @@ export default class CustomizationService extends PubSubService {
|
||||
this.modeCustomizations = {};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} interaction - can be undefined to run nothing
|
||||
* @param {*} extraOptions to include in the commands run
|
||||
*/
|
||||
recordInteraction(
|
||||
interaction: Customization | void,
|
||||
extraOptions?: Record<string, unknown>
|
||||
): void {
|
||||
if (!interaction) return;
|
||||
const commandsManager = this.commandsManager;
|
||||
const { commands = [] } = interaction;
|
||||
|
||||
commands.forEach(({ commandName, commandOptions, context }) => {
|
||||
if (commandName) {
|
||||
commandsManager.runCommand(
|
||||
commandName,
|
||||
{
|
||||
interaction,
|
||||
...commandOptions,
|
||||
...extraOptions,
|
||||
},
|
||||
context
|
||||
);
|
||||
} else {
|
||||
console.warn('No command name supplied in', interaction);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public getModeCustomizations(): Record<string, Customization> {
|
||||
return this.modeCustomizations;
|
||||
}
|
||||
@@ -145,6 +115,23 @@ export default class CustomizationService extends PubSubService {
|
||||
});
|
||||
}
|
||||
|
||||
/** This is the preferred getter for all customizations,
|
||||
* getting mode customizations first and otherwise global customizations.
|
||||
*
|
||||
* @param customizationId - the customization id to look for
|
||||
* @param defaultValue - is the default value to return. Note this value
|
||||
* may have been extended with any customizationType extensions provided,
|
||||
* so you cannot just use `|| defaultValue`
|
||||
* @return A customization to use if one is found, or the default customization,
|
||||
* both enhanced with any customizationType inheritance (see applyType)
|
||||
*/
|
||||
public getCustomization(
|
||||
customizationId: string,
|
||||
defaultValue?: Customization
|
||||
): Customization | void {
|
||||
return this.getModeCustomization(customizationId, defaultValue);
|
||||
}
|
||||
|
||||
/** Mode customizations are changes to the behaviour of the extensions
|
||||
* when running in a given mode. Reset clears mode customizations.
|
||||
* Note that global customizations over-ride mode customizations.
|
||||
@@ -168,12 +155,17 @@ export default class CustomizationService extends PubSubService {
|
||||
);
|
||||
}
|
||||
|
||||
/** Applies any inheritance due to UI Type customization */
|
||||
/**
|
||||
* Applies any inheritance due to UI Type customization.
|
||||
* This will look for customizationType in the customization object
|
||||
* and if that is found, will assign all iterable values from that
|
||||
* type into the new type, allowing default behaviour to be configured.
|
||||
*/
|
||||
public applyType(customization: Customization): Customization {
|
||||
if (!customization) return customization;
|
||||
const { customizationType } = customization;
|
||||
if (!customizationType) return customization;
|
||||
const parent = this.getModeCustomization(customizationType);
|
||||
const parent = this.getCustomization(customizationType);
|
||||
return parent
|
||||
? Object.assign(Object.create(parent), customization)
|
||||
: customization;
|
||||
|
||||
@@ -29,27 +29,31 @@ const match = (
|
||||
let requiredFailed = false;
|
||||
let score = 0;
|
||||
|
||||
// Allow for matching against current or prior specifically
|
||||
const prior = options?.studies?.[1];
|
||||
const current = options?.studies?.[0];
|
||||
const instance = (metadataInstance.images || metadataInstance.others)?.[0];
|
||||
const fromSrc = {
|
||||
prior,
|
||||
current,
|
||||
instance,
|
||||
...options,
|
||||
options,
|
||||
metadataInstance,
|
||||
};
|
||||
|
||||
rules.forEach(rule => {
|
||||
const { attribute } = rule;
|
||||
const { attribute, from = 'metadataInstance' } = rule;
|
||||
// Do not use the custom attribute from the metadataInstance since it is subject to change
|
||||
if (customAttributeRetrievalCallbacks.hasOwnProperty(attribute)) {
|
||||
readValues[attribute] = customAttributeRetrievalCallbacks[
|
||||
attribute
|
||||
].callback(metadataInstance, options);
|
||||
].callback.call(rule, metadataInstance, options);
|
||||
} else {
|
||||
readValues[attribute] =
|
||||
metadataInstance[attribute] ??
|
||||
((metadataInstance.images || metadataInstance.others || [])[0] || {})[
|
||||
attribute
|
||||
];
|
||||
fromSrc[from]?.[attribute] ?? instance?.[attribute];
|
||||
}
|
||||
|
||||
console.log(
|
||||
'Test',
|
||||
attribute,
|
||||
readValues[attribute],
|
||||
JSON.stringify(rule.constraint)
|
||||
);
|
||||
// Format the constraint as required by Validate.js
|
||||
const testConstraint = {
|
||||
[attribute]: rule.constraint,
|
||||
@@ -70,6 +74,14 @@ const match = (
|
||||
errorMessages = ['Something went wrong during validation.', e];
|
||||
}
|
||||
|
||||
console.log(
|
||||
'Test',
|
||||
`${from}.${attribute}`,
|
||||
readValues[attribute],
|
||||
JSON.stringify(rule.constraint),
|
||||
!errorMessages
|
||||
);
|
||||
|
||||
if (!errorMessages) {
|
||||
// If no errorMessages were returned, then validation passed.
|
||||
|
||||
|
||||
@@ -117,8 +117,7 @@ const studyMatchDisplaySets = [displaySet3, displaySet2, displaySet1];
|
||||
|
||||
function checkHpsBestMatch(hps) {
|
||||
hps.run({ studies: [studyMatch], displaySets: studyMatchDisplaySets });
|
||||
const { hpAlreadyApplied, viewportMatchDetails } = hps.getMatchDetails();
|
||||
expect(hpAlreadyApplied).toMatchObject(new Map([[0, false]]));
|
||||
const { viewportMatchDetails } = hps.getMatchDetails();
|
||||
expect(viewportMatchDetails.size).toBe(1);
|
||||
expect(viewportMatchDetails.get(0)).toMatchObject({
|
||||
viewportOptions: {
|
||||
@@ -131,9 +130,11 @@ function checkHpsBestMatch(hps) {
|
||||
// ds2 fails to match required and ds3 fails to match an optional.
|
||||
displaySetsInfo: [
|
||||
{
|
||||
SeriesInstanceUID: 'ds1',
|
||||
displaySetInstanceUID: 'displaySet1',
|
||||
displaySetOptions: {},
|
||||
displaySetOptions: {
|
||||
id: 'displaySetSelector',
|
||||
options: {},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -191,14 +192,6 @@ describe('HangingProtocolService', () => {
|
||||
it('matches best image match', () => {
|
||||
checkHpsBestMatch(hangingProtocolService);
|
||||
});
|
||||
|
||||
it('uses services manager', () => {
|
||||
hangingProtocolService.run({
|
||||
studies: [studyMatch],
|
||||
displaySets: studyMatchDisplaySets,
|
||||
});
|
||||
expect(mockedFunction).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large.
Load diff
@@ -81,6 +81,16 @@ export default class ProtocolEngine {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* finds the match results against the given display set or
|
||||
* study instance by testing the given rules against this, and using
|
||||
* the provided options for testing.
|
||||
*
|
||||
* @param {*} metaData to match against as primary value
|
||||
* @param {*} rules to apply
|
||||
* @param {*} options are additional values that can be used for matching
|
||||
* @returns
|
||||
*/
|
||||
findMatch(metaData, rules, options) {
|
||||
return HPMatcher.match(
|
||||
metaData,
|
||||
@@ -109,7 +119,7 @@ export default class ProtocolEngine {
|
||||
let rules = protocol.protocolMatchingRules.slice();
|
||||
if (!rules || !rules.length) {
|
||||
console.warn(
|
||||
'ProtocolEngine::findMatchByStudy no matching rules - specify protocolMatchingRules',
|
||||
'ProtocolEngine::findMatchByStudy no matching rules - specify protocolMatchingRules for',
|
||||
protocol.id
|
||||
);
|
||||
return;
|
||||
|
||||
@@ -14,6 +14,41 @@ validate.validators.doesNotEqual = function(value, options, key) {
|
||||
}
|
||||
};
|
||||
|
||||
// Ignore case contains.
|
||||
// options testValue MUST be in lower case already, otherwise it won't match
|
||||
validate.validators.containsI = function (value, options, key) {
|
||||
const testValue = options?.value ?? options;
|
||||
if (Array.isArray(value)) {
|
||||
if (
|
||||
value.some(
|
||||
item => !validate.validators.containsI(item.toLowerCase(), options, key)
|
||||
)
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
return `No item of ${value.join(',')} contains ${JSON.stringify(
|
||||
testValue
|
||||
)}`;
|
||||
}
|
||||
if (Array.isArray(testValue)) {
|
||||
if (
|
||||
testValue.some(
|
||||
subTest => !validate.validators.containsI(value, subTest, key)
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
return `${key} must contain at least one of ${testValue.join(',')}`;
|
||||
}
|
||||
if (
|
||||
testValue &&
|
||||
value.indexOf &&
|
||||
value.toLowerCase().indexOf(testValue) === -1
|
||||
) {
|
||||
return key + 'must contain any case of' + testValue;
|
||||
}
|
||||
};
|
||||
|
||||
validate.validators.contains = function(value, options, key) {
|
||||
const testValue = options?.value ?? options;
|
||||
if (Array.isArray(value)) {
|
||||
|
||||
@@ -3,9 +3,10 @@ import validate from './validator.js';
|
||||
describe('validator', () => {
|
||||
const attributeMap = {
|
||||
str: 'string',
|
||||
upper: 'UPPER',
|
||||
num: 3,
|
||||
nullValue: null,
|
||||
list: ['abc', 'def'],
|
||||
list: ['abc', 'def', 'GHI'],
|
||||
};
|
||||
|
||||
const options = {
|
||||
@@ -35,6 +36,37 @@ describe('validator', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('containsI', () => {
|
||||
it('returns match any list contains case insensitive', () => {
|
||||
expect(
|
||||
validate(attributeMap, { upper: { containsI: ['bye', 'pre'] } }, [
|
||||
options,
|
||||
])
|
||||
).not.toBeUndefined();
|
||||
expect(
|
||||
validate(attributeMap, { list: { containsI: 'hi' } }, [options])
|
||||
).toBeUndefined();
|
||||
expect(
|
||||
validate(attributeMap, { list: { containsI: ['hi', 'bye'] } }, [
|
||||
options,
|
||||
])
|
||||
).toBeUndefined();
|
||||
expect(
|
||||
validate(attributeMap, { list: { containsI: ['bye', 'hi'] } }, [
|
||||
options,
|
||||
])
|
||||
).toBeUndefined();
|
||||
expect(
|
||||
validate(attributeMap, { list: { containsI: ['ig', 'hi'] } }, [options])
|
||||
).toBeUndefined();
|
||||
expect(
|
||||
validate(attributeMap, { upper: { containsI: ['bye', 'per'] } }, [
|
||||
options,
|
||||
])
|
||||
).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('equals', () => {
|
||||
it('returned undefined on equals', () => {
|
||||
expect(
|
||||
|
||||
@@ -519,9 +519,14 @@ class MeasurementService extends PubSubService {
|
||||
let measurement = {};
|
||||
try {
|
||||
const sourceMappings = this.mappings[source.uid];
|
||||
const { toMeasurementSchema } = sourceMappings.find(
|
||||
const sourceMapping = sourceMappings.find(
|
||||
mapping => mapping.annotationType === annotationType
|
||||
);
|
||||
if (!sourceMapping) {
|
||||
console.log('No source mapping', source);
|
||||
return;
|
||||
}
|
||||
const { toMeasurementSchema } = sourceMapping;
|
||||
|
||||
/* Convert measurement */
|
||||
measurement = toMeasurementSchema(sourceAnnotationDetail);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import log from './../log.js';
|
||||
import Services from '../types/Services';
|
||||
import CommandsManager from '../classes/CommandsManager';
|
||||
|
||||
export default class ServicesManager {
|
||||
public services: Services = {};
|
||||
|
||||
constructor(commandsManager) {
|
||||
constructor(commandsManager: CommandsManager) {
|
||||
this._commandsManager = commandsManager;
|
||||
this.services = {};
|
||||
this.registeredServiceNames = [];
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import StateSyncService from './StateSyncService';
|
||||
import log from '../../log';
|
||||
|
||||
jest.mock('../../log.js', () => ({
|
||||
info: jest.fn(),
|
||||
warn: jest.fn(),
|
||||
error: jest.fn(),
|
||||
}));
|
||||
|
||||
const extensionManager = {};
|
||||
|
||||
describe('StateSyncService.ts', () => {
|
||||
let stateSyncService;
|
||||
|
||||
let configuration;
|
||||
|
||||
beforeEach(() => {
|
||||
log.warn.mockClear();
|
||||
jest.clearAllMocks();
|
||||
configuration = {};
|
||||
stateSyncService = new StateSyncService({
|
||||
configuration,
|
||||
});
|
||||
});
|
||||
|
||||
describe('init', () => {
|
||||
it('init succeeds', () => {
|
||||
stateSyncService.init(extensionManager);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,80 @@
|
||||
import { PubSubService } from '../_shared/pubSubServiceInterface';
|
||||
import { ExtensionManager } from '../../extensions';
|
||||
|
||||
const EVENTS = {};
|
||||
|
||||
type Obj = Record<string, unknown>;
|
||||
|
||||
type StateConfig = {
|
||||
/** clearOnModeExit defines state configuraion that is cleared automatically on
|
||||
* exiting a mode. This clearing occurs after the mode onModeExit,
|
||||
* so it is possible to preserve desired state during exit to be restored
|
||||
* later.
|
||||
*/
|
||||
clearOnModeExit?: boolean;
|
||||
};
|
||||
|
||||
type States = {
|
||||
[key: string]: Obj;
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
export default class StateSyncService extends PubSubService {
|
||||
public static REGISTRATION = {
|
||||
name: 'stateSyncService',
|
||||
create: ({ configuration = {}, commandsManager }) => {
|
||||
return new StateSyncService({ configuration, commandsManager });
|
||||
},
|
||||
};
|
||||
|
||||
extensionManager: ExtensionManager;
|
||||
configuration: Obj;
|
||||
registeredStateSets: {
|
||||
[id: string]: StateConfig;
|
||||
} = {};
|
||||
state: States = {};
|
||||
|
||||
constructor({ configuration }) {
|
||||
super(EVENTS);
|
||||
this.configuration = configuration || {};
|
||||
}
|
||||
|
||||
public init(extensionManager: ExtensionManager): void { }
|
||||
|
||||
public register(id: string, config: StateConfig): void {
|
||||
this.registeredStateSets[id] = config;
|
||||
this.store({ [id]: {} });
|
||||
}
|
||||
|
||||
public getState(): Record<string, Obj> {
|
||||
// TODO - return a proxy to this which is not writable in dev mode
|
||||
return this.state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores all the new state values contained in states.
|
||||
*
|
||||
* @param states - is an object containing replacement values to store
|
||||
* @returns
|
||||
*/
|
||||
public store(states: States): States {
|
||||
Object.keys(states).forEach(stateKey => {
|
||||
if (!this.registeredStateSets[stateKey]) {
|
||||
throw new Error(`No state ${stateKey} registered`);
|
||||
}
|
||||
});
|
||||
this.state = { ...this.state, ...states };
|
||||
return states;
|
||||
}
|
||||
|
||||
public onModeExit(): void {
|
||||
const toReduce = {};
|
||||
for (const [key, value] of Object.entries(this.registeredStateSets)) {
|
||||
if (value.clearOnModeExit) {
|
||||
toReduce[key] = {};
|
||||
}
|
||||
}
|
||||
this.store(toReduce);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import StateSyncService from './StateSyncService';
|
||||
|
||||
export default StateSyncService;
|
||||
@@ -1,4 +1,6 @@
|
||||
import merge from 'lodash.merge';
|
||||
import { CommandsManager } from '../../classes';
|
||||
import { ExtensionManager } from '../../extensions';
|
||||
import { PubSubService } from '../_shared/pubSubServiceInterface';
|
||||
|
||||
const EVENTS = {
|
||||
@@ -16,37 +18,31 @@ export default class ToolbarService extends PubSubService {
|
||||
},
|
||||
};
|
||||
|
||||
constructor(commandsManager) {
|
||||
buttons: Record<string, unknown> = {};
|
||||
state: {
|
||||
primaryToolId: string;
|
||||
toggles: Record<string, boolean>;
|
||||
groups: Record<string, unknown>;
|
||||
} = { primaryToolId: 'WindowLevel', toggles: {}, groups: {} };
|
||||
buttonSections: Record<string, unknown> = {
|
||||
/**
|
||||
* primary: ['Zoom', 'Wwwc'],
|
||||
* secondary: ['Length', 'RectangleRoi']
|
||||
*/
|
||||
};
|
||||
_commandsManager: CommandsManager;
|
||||
extensionManager: ExtensionManager;
|
||||
|
||||
constructor(commandsManager: CommandsManager) {
|
||||
super(EVENTS);
|
||||
this._commandsManager = commandsManager;
|
||||
//
|
||||
this.buttons = {};
|
||||
this.unsubscriptions = []; // if tools need to unsubscribe from events
|
||||
this.buttonSections = {
|
||||
/**
|
||||
* primary: ['Zoom', 'Wwwc'],
|
||||
* secondary: ['Length', 'RectangleRoi']
|
||||
*/
|
||||
};
|
||||
|
||||
// TODO: Do we need to track per context? Or do we allow for a mixed
|
||||
// definition that adapts based on context?
|
||||
this.state = {
|
||||
primaryToolId: 'WindowLevel',
|
||||
toggles: {
|
||||
/* id: true/false */
|
||||
},
|
||||
groups: {
|
||||
/* track most recent click per group...? */
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
init(extensionManager) {
|
||||
public init(extensionManager: ExtensionManager): void {
|
||||
this.extensionManager = extensionManager;
|
||||
}
|
||||
|
||||
reset() {
|
||||
public reset(): void {
|
||||
this.unsubscriptions.forEach(unsub => unsub());
|
||||
this.state = {
|
||||
primaryToolId: 'WindowLevel',
|
||||
@@ -69,7 +65,7 @@ export default class ToolbarService extends PubSubService {
|
||||
* used for calling the specified interaction. That is, the command is
|
||||
* called with {...commandOptions,...options}
|
||||
*/
|
||||
recordInteraction(interaction, options) {
|
||||
recordInteraction(interaction, options?: Record<string, unknown>) {
|
||||
if (!interaction) return;
|
||||
const commandsManager = this._commandsManager;
|
||||
const { groupId, itemId, interactionType, commands } = interaction;
|
||||
@@ -181,6 +177,15 @@ export default class ToolbarService extends PubSubService {
|
||||
return [this.state.primaryToolId, ...Object.keys(this.state.toggles)];
|
||||
}
|
||||
|
||||
/** Sets the toggle state of a button to the isActive state */
|
||||
public setActive(id: string, isActive: boolean): void {
|
||||
if (isActive) {
|
||||
this.state.toggles[id] = true;
|
||||
} else {
|
||||
delete this.state.toggles[id];
|
||||
}
|
||||
}
|
||||
|
||||
setButton(id, button) {
|
||||
if (this.buttons[id]) {
|
||||
this.buttons[id] = merge(this.buttons[id], button);
|
||||
|
||||
@@ -12,6 +12,7 @@ class ViewportGridService extends PubSubService {
|
||||
return new ViewportGridService();
|
||||
},
|
||||
};
|
||||
public static EVENTS = EVENTS;
|
||||
|
||||
serviceImplementation = {};
|
||||
|
||||
@@ -25,8 +26,6 @@ class ViewportGridService extends PubSubService {
|
||||
setActiveViewportIndex: setActiveViewportIndexImplementation,
|
||||
setDisplaySetsForViewport: setDisplaySetsForViewportImplementation,
|
||||
setDisplaySetsForViewports: setDisplaySetsForViewportsImplementation,
|
||||
setCachedLayout: setCachedLayoutImplementation,
|
||||
restoreCachedLayout: restoreCachedLayoutImplementation,
|
||||
setLayout: setLayoutImplementation,
|
||||
reset: resetImplementation,
|
||||
onModeExit: onModeExitImplementation,
|
||||
@@ -51,12 +50,6 @@ class ViewportGridService extends PubSubService {
|
||||
if (resetImplementation) {
|
||||
this.serviceImplementation._reset = resetImplementation;
|
||||
}
|
||||
if (setCachedLayoutImplementation) {
|
||||
this.serviceImplementation._setCachedLayout = setCachedLayoutImplementation;
|
||||
}
|
||||
if (restoreCachedLayoutImplementation) {
|
||||
this.serviceImplementation._restoreCachedLayout = restoreCachedLayoutImplementation;
|
||||
}
|
||||
if (onModeExitImplementation) {
|
||||
this.serviceImplementation._onModeExit = onModeExitImplementation;
|
||||
}
|
||||
@@ -70,8 +63,11 @@ class ViewportGridService extends PubSubService {
|
||||
|
||||
public setActiveViewportIndex(index) {
|
||||
this.serviceImplementation._setActiveViewportIndex(index);
|
||||
const state = this.getState();
|
||||
const viewportId = state.viewports[index]?.viewportOptions?.viewportId;
|
||||
this._broadcastEvent(this.EVENTS.ACTIVE_VIEWPORT_INDEX_CHANGED, {
|
||||
viewportIndex: index,
|
||||
viewportId,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -97,8 +93,20 @@ class ViewportGridService extends PubSubService {
|
||||
this.serviceImplementation._setDisplaySetsForViewports(viewports);
|
||||
}
|
||||
|
||||
public setLayout({ numCols, numRows }) {
|
||||
this.serviceImplementation._setLayout({ numCols, numRows });
|
||||
/**
|
||||
*
|
||||
* @param numCols, numRows - the number of columns and rows to apply
|
||||
* @param findOrCreateViewport is a function which takes the
|
||||
* index position of the viewport, the position id, and a set of
|
||||
* options that is initially provided as {} (eg to store intermediate state)
|
||||
* The function returns a viewport object to use at the given position.
|
||||
*/
|
||||
public setLayout({ numCols, numRows, findOrCreateViewport = undefined }) {
|
||||
this.serviceImplementation._setLayout({
|
||||
numCols,
|
||||
numRows,
|
||||
findOrCreateViewport,
|
||||
});
|
||||
}
|
||||
|
||||
public reset() {
|
||||
@@ -115,14 +123,6 @@ class ViewportGridService extends PubSubService {
|
||||
this.serviceImplementation._onModeExit();
|
||||
}
|
||||
|
||||
public setCachedLayout({ cacheId, cachedLayout }) {
|
||||
this.serviceImplementation._setCachedLayout({ cacheId, cachedLayout });
|
||||
}
|
||||
|
||||
public restoreCachedLayout(cacheId) {
|
||||
this.serviceImplementation._restoreCachedLayout(cacheId);
|
||||
}
|
||||
|
||||
public set(state) {
|
||||
this.serviceImplementation._set(state);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import UserAuthenticationService from './UserAuthenticationService';
|
||||
import CustomizationService from './CustomizationService';
|
||||
|
||||
import Services from '../types/Services';
|
||||
import StateSyncService from './StateSyncService';
|
||||
import PanelService from './PanelService';
|
||||
|
||||
export {
|
||||
@@ -24,6 +25,7 @@ export {
|
||||
MeasurementService,
|
||||
ServicesManager,
|
||||
CustomizationService,
|
||||
StateSyncService,
|
||||
UIDialogService,
|
||||
UIModalService,
|
||||
UINotificationService,
|
||||
|
||||
Reference in new issue
Block a user