Browse Source

Workpieces shown correctly in visualization

anfeny 2 months ago
parent
commit
b34b2c206d

+ 2 - 2
dashboard/src/static/js/sim/components/workpiece.js

@@ -2,7 +2,7 @@
  * Class representing a circular (cilindrical in 3D) workpiece.
  */
 export class Workpiece {
-    constructor(x, y, color = "unknown", diameter = 25) {
+    constructor(x, y, color = "NONE", diameter = 25) {
         this.x = x;
         this.y = y;
         this.color = color;
@@ -10,7 +10,7 @@ export class Workpiece {
     }
 
     draw() {
-        if (this.color === "unknown") {
+        if (this.color === "NONE") {
             fill('rebeccapurple');
             ellipse(this.x, this.y, this.d, this.d);
             fill(255);

+ 0 - 1
dashboard/src/static/js/sim/index.js

@@ -94,7 +94,6 @@ socket.on('visualization_update', function (data) {
 
     // DSI
     if (data.topic.includes("dsi")) {
-        if (workpiece) workpiece.color = "unknown"; // reset color
         factory.deliveryStation.dsi.setWorkpiece(workpiece); // update workpiece
     }
     // DSO