feat(hp): add onStageChange callback (#5165)
This commit is contained in:
parent
c2b75e1a50
commit
4bddd53fcd
@ -1064,6 +1064,11 @@ export default class HangingProtocolService extends PubSubService {
|
||||
throw new Error(`Can't find applicable stage ${protocol.id} ${options?.stageIndex}`);
|
||||
}
|
||||
this.stageIndex = stage as number;
|
||||
|
||||
if (this.protocol?.callbacks?.onStageChange) {
|
||||
this._commandsManager.run(this.protocol.callbacks.onStageChange);
|
||||
}
|
||||
|
||||
this._updateViewports(options);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
@ -293,6 +293,8 @@ export type ProtocolNotifications = {
|
||||
// and all viewport data includes a designated display set. This command
|
||||
// will run on every stage's initial layout.
|
||||
onViewportDataInitialized?: Command[];
|
||||
// This set of commands is executed before the stage change is applied
|
||||
onStageChange?: Command[];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user