const commandsModule = ({ servicesManager, commandsManager }) => {
const {
MeasurementService,
HangingProtocolService,
UINotificationService,
} = servicesManager.services;
const actions = {
displayNotification: ({ text, title, type }) => {
UINotificationService.show({
title: title,
message: text,
type: type,
});
},
clearMeasurements: () => {
MeasurementService.clear();
nextStage: () => {
// next stage in hanging protocols
HangingProtocolService.nextProtocolStage();
previousStage: () => {
HangingProtocolService.previousProtocolStage();
};
const definitions = {
clearMeasurements: {
commandFn: actions.clearMeasurements,
storeContexts: [],
options: {},
displayNotification: {
commandFn: actions.displayNotification,
nextStage: {
commandFn: actions.nextStage,
previousStage: {
commandFn: actions.previousStage,
return {
actions,
definitions,
defaultContext: 'DEFAULT',
export default commandsModule;