diff --git a/src/app/widgets/Visualizer/Notifications.js b/src/app/widgets/Visualizer/Notifications.js index 72a508293..030c979f4 100644 --- a/src/app/widgets/Visualizer/Notifications.js +++ b/src/app/widgets/Visualizer/Notifications.js @@ -44,36 +44,54 @@ const Notifications = ({ show, type, data, onDismiss, style, ...props }) => ( {type === NOTIFICATION_PROGRAM_ERROR && (
{i18n._('Error')}
+ {data && ( + {data} + )}
{i18n._('Click the Resume button to resume program execution.')}
)} {type === NOTIFICATION_M0_PROGRAM_PAUSE && (
{i18n._('M0 Program Pause')}
+ {data && ( + {data} + )}
{i18n._('Click the Resume button to resume program execution.')}
)} {type === NOTIFICATION_M1_PROGRAM_PAUSE && (
{i18n._('M1 Program Pause')}
+ {data && ( + {data} + )}
{i18n._('Click the Resume button to resume program execution.')}
)} {type === NOTIFICATION_M2_PROGRAM_END && (
{i18n._('M2 Program End')}
+ {data && ( + {data} + )}
{i18n._('Click the Stop button to stop program execution.')}
)} {type === NOTIFICATION_M30_PROGRAM_END && (
{i18n._('M30 Program End')}
+ {data && ( + {data} + )}
{i18n._('Click the Stop button to stop program execution.')}
)} {type === NOTIFICATION_M6_TOOL_CHANGE && (
{i18n._('M6 Tool Change')}
+ {data && ( + {data} + )}
{i18n._('Run a tool change macro to change the tool and adjust the Z-axis offset. Afterwards, click the Resume button to resume program execution.')} @@ -89,12 +107,18 @@ const Notifications = ({ show, type, data, onDismiss, style, ...props }) => ( {type === NOTIFICATION_M109_SET_EXTRUDER_TEMPERATURE && (
{i18n._('M109 Set Extruder Temperature')}
+ {data && ( + {data} + )}
{i18n._('Waiting for the target temperature to be reached...')}
)} {type === NOTIFICATION_M190_SET_HEATED_BED_TEMPERATURE && (
{i18n._('M190 Set Heated Bed Temperature')}
+ {data && ( + {data} + )}
{i18n._('Waiting for the target temperature to be reached...')}
)} diff --git a/src/app/widgets/Visualizer/index.jsx b/src/app/widgets/Visualizer/index.jsx index 3a72e332b..745d3d672 100644 --- a/src/app/widgets/Visualizer/index.jsx +++ b/src/app/widgets/Visualizer/index.jsx @@ -618,32 +618,39 @@ class VisualizerWidget extends PureComponent { }; if (hold) { - const { err, data } = { ...holdReason }; + const { err, data, msg } = { ...holdReason }; if (err) { notification.type = NOTIFICATION_PROGRAM_ERROR; - notification.data = err; + notification.data = msg; } else if (data === 'M0') { // M0 Program Pause notification.type = NOTIFICATION_M0_PROGRAM_PAUSE; + notification.data = msg; } else if (data === 'M1') { // M1 Program Pause notification.type = NOTIFICATION_M1_PROGRAM_PAUSE; + notification.data = msg; } else if (data === 'M2') { // M2 Program End notification.type = NOTIFICATION_M2_PROGRAM_END; + notification.data = msg; } else if (data === 'M30') { // M30 Program End notification.type = NOTIFICATION_M30_PROGRAM_END; + notification.data = msg; } else if (data === 'M6') { // M6 Tool Change notification.type = NOTIFICATION_M6_TOOL_CHANGE; + notification.data = msg; } else if (data === 'M109') { // M109 Set Extruder Temperature notification.type = NOTIFICATION_M109_SET_EXTRUDER_TEMPERATURE; + notification.data = msg; } else if (data === 'M190') { // M190 Set Heated Bed Temperature notification.type = NOTIFICATION_M190_SET_HEATED_BED_TEMPERATURE; + notification.data = msg; } }