Skip to content

Commit

Permalink
[MI-1390] fix job line color on finish
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiabeluli committed Mar 1, 2024
1 parent 2ae4797 commit 9e9cb46
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/app/widgets/Visualizer/GCodeVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class GCodeVisualizer {
return this;
}

render({ vertices, frames, spindleSpeeds, isLaser = false, spindleChanges }, colorArray) {
render({ vertices, frames, spindleSpeeds, isLaser = false, spindleChanges }, colorArray, savedColors) {
this.vertices = new THREE.Float32BufferAttribute(vertices, 3);
this.frames = frames;
this.spindleSpeeds = spindleSpeeds;
this.isLaser = isLaser;
this.spindleChanges = spindleChanges;
this.colors = colorArray;
this.colors = savedColors;
const defaultColor = new THREE.Color(this.theme.get(CUTTING_PART));
this.countdown = 16;
this.frameDifferences = Array(16).fill(null);
Expand Down
9 changes: 5 additions & 4 deletions src/app/widgets/Visualizer/Visualizer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,9 @@ class Visualizer extends Component {
pubsub.subscribe('visualizer:updateposition', (_, data) => {
this.updateCuttingToolPosition(data, { forceUpdateAllAxes: true });
}),
pubsub.subscribe('colors:load', (_, colorArray) => {
this.handleSceneRender(this.vizualization, colorArray, this.renderCallback);
pubsub.subscribe('colors:load', (_, data) => {
const { colorArray, savedColors } = data;
this.handleSceneRender(this.vizualization, colorArray, savedColors, this.renderCallback);
})
];
this.pubsubTokens = this.pubsubTokens.concat(tokens);
Expand Down Expand Up @@ -1671,7 +1672,7 @@ class Visualizer extends Component {
this.updateScene();
}

handleSceneRender(vizualization, colorArray, callback) {
handleSceneRender(vizualization, colorArray, savedColors, callback) {
const { controllerType, fileType, workPosition } = this.props;
const workspaceMode = store.get('workspace.mode', WORKSPACE_MODE.DEFAULT);

Expand All @@ -1681,7 +1682,7 @@ class Visualizer extends Component {
return;
}

const obj = this.visualizer.render(vizualization, colorArray);
const obj = this.visualizer.render(vizualization, colorArray, savedColors);
obj.name = '';
this.group.add(obj);

Expand Down
3 changes: 1 addition & 2 deletions src/app/workers/colors.response.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pubsub from 'pubsub-js';

export const colorsResponse = ({ data }) => {
const { colorArray } = data;
// Handle file load
pubsub.publish('colors:load', colorArray);
pubsub.publish('colors:load', data);
};
3 changes: 2 additions & 1 deletion src/app/workers/colors.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ onmessage = function({ data }) {
const colorArray = getColorTypedArray(colors, motionColor);

const message = {
colorArray: colorArray
colorArray: colorArray,
savedColors: savedColors
};

postMessage(message);
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gSender",
"version": "1.4.4",
"version": "1.4.4-RC1",
"productName": "gSender",
"description": "CNC Milling Controller",
"author": {
Expand Down

0 comments on commit 9e9cb46

Please sign in to comment.