Beispiel #1
0
 def json(self):
     """ Return the design attributes as JSON """
     return {
         "annotations" : [a.json() for a in self.annotations],
         "metadata" : self.metadata.json(),
         "attributes" : stringify_attributes(self.attributes),
         }
 def json(self):
     """ Return a component as JSON """
     return {
         "symbols": [s.json() for s in self.symbols],
         "attributes": stringify_attributes(self.attributes),
         "name": self.name
         }
 def json(self):
     """ Return a component as JSON """
     return {
         "symbols": [s.json() for s in self.symbols],
         "attributes": stringify_attributes(self.attributes),
         "name": self.name
         }
 def json(self):
     """ Return a net as JSON """
     return {
         "net_id": self.net_id,
         "attributes": stringify_attributes(self.attributes),
         "annotations": [ann.json() for ann in self.annotations],
         "points": sorted([point.json() for point in self.points.values()],
                          key=lambda point : point.get('point_id'))
         }
 def json(self):
     """ Return a component as JSON """
     return {
         "instance_id" : self.instance_id,
         "library_id" : self.library_id,
         "symbol_index" : self.symbol_index,
         "symbol_attributes":[s.json() for s in self.symbol_attributes],
         "attributes" : stringify_attributes(self.attributes)
         }
 def json(self):
     """ Return a trace as JSON """
     return {
         "trace_id": self.trace_id,
         "p1": self.p1.json(),
         "p2": self.p2.json(),
         "attributes": stringify_attributes(self.attributes),
         "annotations": [ann.json() for ann in self.annotations]
         }
Beispiel #7
0
 def json(self):
     """ Return a net as JSON """
     return {
         "net_id": self.net_id,
         "attributes": stringify_attributes(self.attributes),
         "annotations": [ann.json() for ann in self.annotations],
         "points": sorted([point.json() for point in self.points.values()],
                          key=lambda point : point.get('point_id'))
         }
 def json(self):
     """ Return a component as JSON """
     return {
         "instance_id": self.instance_id,
         "library_id": self.library_id,
         "symbol_index": self.symbol_index,
         "symbol_attributes": [s.json() for s in self.symbol_attributes],
         "attributes": stringify_attributes(self.attributes)
     }
Beispiel #9
0
 def json(self):
     """ Return a trace as JSON """
     return {
         "trace_id": self.trace_id,
         "p1": self.p1.json(),
         "p2": self.p2.json(),
         "attributes": stringify_attributes(self.attributes),
         "annotations": [ann.json() for ann in self.annotations]
     }
    def json(self):
        """ Return the body as JSON """

        return {
            "x": int(self.x),
            "y": int(self.y),
            "rotation": self.rotation,
            "flip": self.flip,
            "layer": self.layer,
            "attributes": stringify_attributes(self.attributes)
        }
    def json(self):
        """ Return the body as JSON """

        return {
            "x": int(self.x),
            "y": int(self.y),
            "rotation": self.rotation,
            "flip": self.flip,
            "layer": self.layer,
            "attributes" : stringify_attributes(self.attributes)
            }
Beispiel #12
0
 def json(self):
     """ Return a pin as JSON """
     ret = {
         "pin_number": self.pin_number,
         "p": self.p.json(),
         "shapes": [s.json() for s in self.shapes],
         "attributes": stringify_attributes(self.attributes),
         "styles": self.styles,
     }
     if self.label is not None:
         ret["label"] = self.label.json()
     return ret
Beispiel #13
0
 def json(self):
     """ Return a pin as JSON """
     ret = {
         "pin_number": self.pin_number,
         "p1": self.p1.json(),
         "p2": self.p2.json(),
         "attributes": stringify_attributes(self.attributes),
         "styles": self.styles,
     }
     if self.label is not None:
         ret["label"] = self.label.json()
     return ret
 def json(self):
     """ Return a pin as JSON """
     ret = {
         "pin_number": self.pin_number,
         "p": self.p.json(),
         "shapes": [s.json() for s in self.shapes],
         "attributes": stringify_attributes(self.attributes),
         "styles": self.styles,
         }
     if self.label is not None:
         ret["label"] = self.label.json()
     return ret
 def json(self):
     """ Return a pin as JSON """
     ret = {
         "pin_number": self.pin_number,
         "p1": self.p1.json(),
         "p2": self.p2.json(),
         "attributes": stringify_attributes(self.attributes),
         "styles": self.styles,
         }
     if self.label is not None:
         ret["label"] = self.label.json()
     return ret
 def json(self):
     """ Return a component as JSON """
     json = {
         "instance_id" : self.instance_id,
         "library_id" : self.library_id,
         "symbol_index" : self.symbol_index,
         "symbol_attributes":[s.json() for s in self.symbol_attributes],
         "footprint_index" : self.footprint_index,
         "footprint_attributes":[s.json() for s in self.footprint_attributes],
         "gen_obj_attributes":[s.json() for s in self.gen_obj_attributes],
         "attributes" : stringify_attributes(self.attributes)
         }
     if self.footprint_pos is not None:
         json["footprint_pos"] = self.footprint_pos.json()
     return json
 def json(self):
     """ Return a component as JSON """
     json = {
         "instance_id": self.instance_id,
         "library_id": self.library_id,
         "symbol_index": self.symbol_index,
         "symbol_attributes": [s.json() for s in self.symbol_attributes],
         "footprint_index": self.footprint_index,
         "footprint_attributes":
         [s.json() for s in self.footprint_attributes],
         "gen_obj_attributes": [s.json() for s in self.gen_obj_attributes],
         "attributes": stringify_attributes(self.attributes)
     }
     if self.footprint_pos is not None:
         json["footprint_pos"] = self.footprint_pos.json()
     return json