Sfoglia il codice sorgente

Update 'src/app/components/intersection-component/drawers/intersection-drawer.js'

To read GEO with intersection point
Essential changed (bug fixed): in "draw(e)" changed "e.attrs.genericObject.r" and "e.attrs.genericObject.s" to "e.attrs.genericObject.og1" and "e.attrs.genericObject.og2"  in
"if (e != undefined && e.attrs != undefined)":
  this.aggregatorA = this.getObjectAggregatorByGenericObject(e.attrs.genericObject.og1);
  this.aggregatorB = this.getObjectAggregatorByGenericObject(e.attrs.genericObject.og2);
leo 2 anni fa
parent
commit
4c122e9f40

+ 17 - 9
src/app/components/intersection-component/drawers/intersection-drawer.js

@@ -38,28 +38,36 @@ export class IntersectionDrawer extends Drawer {
 
   // @calledby ./app/core/drawers/stage.js! draw (e): this.drawer.draw(e);
   draw (e) {
-    if (e != undefined && e.attrs != undefined) {
-      this.aggregatorA = this.getObjectAggregatorByGenericObject(e.attrs.genericObject.r);
-      this.aggregatorB = this.getObjectAggregatorByGenericObject(e.attrs.genericObject.s);
+    var aux = "(debug - uncomment 'aux')"; //D console.log("intersection-drawer.js!draw(e): inicio");
+    try {
+    if (e != undefined && e.attrs != undefined) { //D aux += "1, "; //D
+      this.aggregatorA = this.getObjectAggregatorByGenericObject(e.attrs.genericObject.og1);
+      this.aggregatorB = this.getObjectAggregatorByGenericObject(e.attrs.genericObject.og2);
       this.drawByIntersectionPoints([e.attrs.genericObject]);
+      console.log("intersection-drawer.js!draw(e): final 1");
       return;
-      }
-    if (e == undefined || !this.isValidObject(e.target)) return;
-
+      } //D aux += "2, "; //D
+    if (e == undefined || !this.isValidObject(e.target)) {
+      console.log("intersection-drawer.js!draw(e): final 2");
+      return;
+      } //D aux += "3, "; //D
     const selectedTool = App.getSelectedTool();
     if (selectedTool != undefined && selectedTool.drawer != undefined && selectedTool.drawer.elementClass == ELEMENTS_CLASS.INTERSECTION_POINT) {
-      if (this.state == undefined || this.state == IntersectionDrawer.FIRST_OBJECT_STATE) {
+      //D aux += "4, ";
+      if (this.state == undefined || this.state == IntersectionDrawer.FIRST_OBJECT_STATE) { //D aux += "5, ";
         this.setFirstObject(e.target);
         this.setState(IntersectionDrawer.SECOND_OBJECT_STATE);
         }
-      else if (this.state == IntersectionDrawer.SECOND_OBJECT_STATE) {
+      else if (this.state == IntersectionDrawer.SECOND_OBJECT_STATE) { //D aux += "6, ";
         this.setSecondObject(e.target);
         this.drawPoint();
         this.reset();
         // this.clear();
         }
       }
-    }
+    } catch (error) { console.log("intersection-drawer.js!draw(e): " + error + "\n * " + aux); }
+    console.log("intersection-drawer.js!draw(e): final 3");
+    } // draw(e)
 
   setFirstObject (konvaObject) {
     const aggregator = this.getObjectAggregator(konvaObject);