コード例 #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),
         }
コード例 #2
0
 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
         }
コード例 #3
0
 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
         }
コード例 #4
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'))
         }
コード例 #5
0
 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)
         }
コード例 #6
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]
         }
コード例 #7
0
ファイル: net.py プロジェクト: istr/schematic-file-converter
 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'))
         }
コード例 #8
0
 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)
     }
コード例 #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]
     }
コード例 #10
0
    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)
        }
コード例 #11
0
    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)
            }
コード例 #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
コード例 #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
コード例 #14
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
コード例 #15
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
コード例 #16
0
 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
コード例 #17
0
 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