Skip to content

Incorrect base path for intermediate children? #11

@umesh-timalsina

Description

@umesh-timalsina

Consider the following inheritance structure, where LED and SchottkyDiode inherit from for Diode.
image.

In the previous json exports, any contained child-node of LED would automatically point to Diode's children as its base (regardless of their level of their inheritance chain from FCO), which is the behavior of the node in WebGME. However, this behavior seem to have changed where now the export will also try to find the base node of the Diode if its not FCO. Snippet of the exports are provided here.

Previous Exports


      {
      "id": "c7b82794-099a-b4b1-e3ba-6438646b5004",
      >>>"path": "/9/x",
      "attributes": {
        "name": "Pin"
      },
      "attribute_meta": {},
      "pointers": {
        "base": "/9/0"
      },
      "pointer_meta": {},
      "registry": {
        "decorator": "ElectricCircuitsDecorator",
        "isAbstract": false,
        "position": {
          "x": 390,
          "y": 220
        }
      },
      "sets": {},
      "member_attributes": {},
      "member_registry": {},
      "children_meta": null,
      "children": []
    },
        {
      "id": "17f8ddd9-9d76-c704-1130-49e0c44a522a",
      "path": "/9/vH",
      "attributes": {
        "Ids": 0.000001,
        "Vt": 0.04,
        "Maxexp": 15,
        "R": 100000000,
        "T": 293.15,
        "name": "Diode"
      },
      ...
      ...
      "children": [
        {
          "id": "8f6490f1-3e37-2c48-a244-8fd96afbd77c",
          --- "path": "/9/vH/M",
          "attributes": {
            "name": "p"
          },
          "pointers": {
           >>> "base": "/9/x"
          },
        },
        {
          "id": "51346f7f-d98b-40f0-9deb-62c915f2f4c9",
          --- "path": "/9/vH/S",
          "attributes": {
            "name": "n"
          },
          "pointers": {
           >>> "base": "/9/x"
          },
        }
      ]
    },
   {
      "id": "314d3761-7f5a-5374-23e2-88644cf7b565",
      "path": "/9/NU",
      "attributes": {
        "color": "#FF0000",
        "name": "LED"
      },
      "attribute_meta": {
        "color": {
          "type": "string",
          "description": "The color of the LED"
        }
      },
      "pointers": {
        "base": "/9/vH"
      },
      "pointer_meta": {},
      "registry": {
        "position": {
          "x": 560,
          "y": 2260
        }
      },
      "sets": {},
      "member_attributes": {},
      "member_registry": {},
      "children_meta": {
        "/9/O": {
          "min": -1,
          "max": -1
        },
        "/9/0": {
          "min": -1,
          "max": -1
        },
        "/9/R": {
          "min": -1,
          "max": -1
        }
      },
      "children": [
        {
          "id": "a9d17a49-dc1b-b838-9096-4e5de2463033",
          "path": "/9/NU/M",
          "attributes": {},
          "attribute_meta": {},
          "pointers": {
            >>> "base": "/9/vH/M"
          },
        },
        {
          "id": "778185c7-3ba7-d480-af39-a34d9d4f1386",
          "path": "/9/NU/S",
          "attributes": {},
          "attribute_meta": {},
          "pointers": {
            >>> "base": "/9/vH/S"
          },
        }
      ]
    },

As it can be seen that the contained children of LED have contained children of Diode as their base pointers.

Current Exports


However, this is different with current exports, where the children of LED directly use Pin's path as their base pointer, which seems not to be the correct behavior. Where Pin is the base node for Diode's contained children.

 {
      "id": "c7b82794-099a-b4b1-e3ba-6438646b5004",
      >>> "path": "/9/x",
      "attributes": {
        "name": "Pin"
      },
      "attribute_meta": {},
      "pointers": {
        "base": "/9/0"
      },
      "pointer_meta": {},
      "registry": {
        "decorator": "ElectricCircuitsDecorator",
        "isAbstract": false,
        "position": {
          "x": 390,
          "y": 220
        }
      },
      "sets": {},
      "member_attributes": {},
      "member_registry": {},
      "children_meta": null,
      "children": []
    },
    {
      "id": "8012c8f8-ba5e-049e-076c-b59bdf31aeed",
      "path": "/9/RK",
      "attributes": {
        "color": "#FF0000",
        "name": "LED"
      },
      "attribute_meta": {
        "color": {
          "type": "string",
          "description": "The color of the LED"
        }
      },
    ...
    ...
      "children": [
        {
          "id": "6da863d8-d748-30e0-4154-54ae456967f2",
          "path": "/9/RK/6",
          "attributes": {},
          "attribute_meta": {},
          "pointers": {
            >>> "base": "/9/x"
          },
          "pointer_meta": {},
          "registry": {},
          "sets": {},
          "member_attributes": {},
          "member_registry": {},
          "children_meta": null,
          "children": []
        },
        {
          "id": "10b5d6d4-71d0-163c-eba2-75e1a7acd413",
          "path": "/9/RK/C",
          "attributes": {},
          "attribute_meta": {},
          "pointers": {
            >>> "base": "/9/x"
          },
          "pointer_meta": {},
          "registry": {},
          "sets": {},
          "member_attributes": {},
          "member_registry": {},
          "children_meta": null,
          "children": []
        }
      ]
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions