浏览代码

Add check for loading visualization image

anfeny 8 月之前
父节点
当前提交
bab5e1ccf9
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      dashboard/src/static/js/sim/index.js
  2. 0 0
      simulator/utils/trace_compare.py

+ 3 - 2
dashboard/src/static/js/sim/index.js

@@ -32,8 +32,9 @@ function setup() {
     const canvas = createCanvas(baseWidth, baseHeight);
     canvas.parent(canvasContainer);
 
-    factoryImg.resize(1920 / (2 * scaleFactor), 1432 / (2*scaleFactor)); // half the original size
-
+    if (factoryImg) {
+        factoryImg.resize(1920 / (2 * scaleFactor), 1432 / (2 * scaleFactor)); // half the original size
+    }
     factory = new Factory(baseHeight, baseWidth, scaleFactor); // contains all components
 }
 

+ 0 - 0
simulator/utils/trace_compare.py