format pxtparts.json to simplify integration with common packages

This commit is contained in:
Peli de Halleux 2018-10-04 10:22:51 -07:00
parent 236bda4e04
commit 22a60db57f

View File

@ -7,26 +7,66 @@
"height": 45, "height": 45,
"pinDistance": 15, "pinDistance": 15,
"pinLocations": [ "pinLocations": [
{"x": 0, "y": 0}, {
{"x": 30, "y": 45}, "x": 0,
{"x": 45, "y": 0}, "y": 0
{"x": 75, "y": 45} },
{
"x": 30,
"y": 45
},
{
"x": 45,
"y": 0
},
{
"x": 75,
"y": 45
}
] ]
}, },
"numberOfPins": 4, "numberOfPins": 4,
"pinDefinitions": [ "pinDefinitions": [
{"target": "P14", "style": "male", "orientation": "-Z"}, {
{"target": "ground", "style": "male", "orientation": "-Z"}, "target": "P14",
{"target": "P15", "style": "male", "orientation": "-Z"}, "style": "male",
{"target": "ground", "style": "male", "orientation": "-Z"} "orientation": "-Z"
},
{
"target": "ground",
"style": "male",
"orientation": "-Z"
},
{
"target": "P15",
"style": "male",
"orientation": "-Z"
},
{
"target": "ground",
"style": "male",
"orientation": "-Z"
}
], ],
"instantiation": { "instantiation": {
"kind": "singleton" "kind": "singleton"
}, },
"assembly": [ "assembly": [
{"part": true}, {
{"pinIndices": [0, 1]}, "part": true
{"pinIndices": [2, 3]} },
{
"pinIndices": [
0,
1
]
},
{
"pinIndices": [
2,
3
]
}
] ]
}, },
"microservo": { "microservo": {
@ -37,27 +77,63 @@
"height": 200, "height": 200,
"pinDistance": 10, "pinDistance": 10,
"pinLocations": [ "pinLocations": [
{"x": 30, "y": 5}, {
{"x": 37, "y": 5}, "x": 30,
{"x": 45, "y": 5} "y": 5
},
{
"x": 37,
"y": 5
},
{
"x": 45,
"y": 5
}
] ]
}, },
"numberOfPins": 3, "numberOfPins": 3,
"pinDefinitions": [ "pinDefinitions": [
{"target": {"pinInstantiationIdx": 0}, "style": "croc", "orientation": "+Z"}, {
{"target": "threeVolt", "style": "croc", "orientation": "+Z"}, "target": {
{"target": "ground", "style": "croc", "orientation": "+Z"} "pinInstantiationIdx": 0
},
"style": "croc",
"orientation": "+Z"
},
{
"target": "threeVolt",
"style": "croc",
"orientation": "+Z"
},
{
"target": "ground",
"style": "croc",
"orientation": "+Z"
}
], ],
"instantiation": { "instantiation": {
"kind": "function", "kind": "function",
"fullyQualifiedName": "pins.servoWritePin", "fullyQualifiedName": "pins.servoWritePin",
"argumentRoles": [ "argumentRoles": [
{"pinInstantiationIdx": 0, "partParameter": "name"} {
"pinInstantiationIdx": 0,
"partParameter": "name"
}
] ]
}, },
"assembly": [ "assembly": [
{"part": true, "pinIndices": [2]}, {
{"pinIndices": [0, 1]} "part": true,
"pinIndices": [
2
]
},
{
"pinIndices": [
0,
1
]
}
] ]
}, },
"neopixel": { "neopixel": {
@ -68,28 +144,66 @@
"height": 113, "height": 113,
"pinDistance": 9, "pinDistance": 9,
"pinLocations": [ "pinLocations": [
{"x": 10, "y": 0}, {
{"x": 19, "y": 0}, "x": 10,
{"x": 28, "y": 0} "y": 0
},
{
"x": 19,
"y": 0
},
{
"x": 28,
"y": 0
}
] ]
}, },
"numberOfPins": 3, "numberOfPins": 3,
"pinDefinitions": [ "pinDefinitions": [
{"target": {"pinInstantiationIdx": 0}, "style": "solder", "orientation": "+Z"}, {
{"target": "threeVolt", "style": "solder", "orientation": "+Z"}, "target": {
{"target": "ground", "style": "solder", "orientation": "+Z"} "pinInstantiationIdx": 0
},
"style": "solder",
"orientation": "+Z"
},
{
"target": "threeVolt",
"style": "solder",
"orientation": "+Z"
},
{
"target": "ground",
"style": "solder",
"orientation": "+Z"
}
], ],
"instantiation": { "instantiation": {
"kind": "function", "kind": "function",
"fullyQualifiedName": "neopixel.create", "fullyQualifiedName": "neopixel.create",
"argumentRoles": [ "argumentRoles": [
{"pinInstantiationIdx": 0, "partParameter": "pin"}, {
{"partParameter": "mode"} "pinInstantiationIdx": 0,
"partParameter": "pin"
},
{
"partParameter": "mode"
}
] ]
}, },
"assembly": [ "assembly": [
{"part": true, "pinIndices": [2]}, {
{"pinIndices": [0, 1]} "part": true,
"pinIndices": [
2
]
},
{
"pinIndices": [
0,
1
]
}
] ]
}, },
"ledmatrix": { "ledmatrix": {
@ -99,37 +213,137 @@
"height": 105, "height": 105,
"pinDistance": 15, "pinDistance": 15,
"pinLocations": [ "pinLocations": [
{"x": 0, "y": 0}, {
{"x": 15, "y": 0}, "x": 0,
{"x": 30, "y": 0}, "y": 0
{"x": 45, "y": 0}, },
{"x": 105, "y": 105}, {
{"x": 0, "y": 105}, "x": 15,
{"x": 15, "y": 105}, "y": 0
{"x": 30, "y": 105}, },
{"x": 45, "y": 105}, {
{"x": 60, "y": 0} "x": 30,
"y": 0
},
{
"x": 45,
"y": 0
},
{
"x": 105,
"y": 105
},
{
"x": 0,
"y": 105
},
{
"x": 15,
"y": 105
},
{
"x": 30,
"y": 105
},
{
"x": 45,
"y": 105
},
{
"x": 60,
"y": 0
}
] ]
}, },
"simulationBehavior": "ledmatrix", "simulationBehavior": "ledmatrix",
"numberOfPins": 10, "numberOfPins": 10,
"instantiation": {"kind": "singleton"}, "instantiation": {
"kind": "singleton"
},
"pinDefinitions": [ "pinDefinitions": [
{"target": "P6", "style": "male", "orientation": "-Z", "colorGroup": 0}, {
{"target": "P7", "style": "male", "orientation": "-Z", "colorGroup": 0}, "target": "P6",
{"target": "P8", "style": "male", "orientation": "-Z", "colorGroup": 0}, "style": "male",
{"target": "P9", "style": "male", "orientation": "-Z", "colorGroup": 0}, "orientation": "-Z",
{"target": "P10", "style": "male", "orientation": "-Z", "colorGroup": 0}, "colorGroup": 0
{"target": "P12", "style": "male", "orientation": "-Z", "colorGroup": 1}, },
{"target": "P13", "style": "male", "orientation": "-Z", "colorGroup": 1}, {
{"target": "P16", "style": "male", "orientation": "-Z", "colorGroup": 1}, "target": "P7",
{"target": "P19", "style": "male", "orientation": "-Z", "colorGroup": 1}, "style": "male",
{"target": "P20", "style": "male", "orientation": "-Z", "colorGroup": 1} "orientation": "-Z",
"colorGroup": 0
},
{
"target": "P8",
"style": "male",
"orientation": "-Z",
"colorGroup": 0
},
{
"target": "P9",
"style": "male",
"orientation": "-Z",
"colorGroup": 0
},
{
"target": "P10",
"style": "male",
"orientation": "-Z",
"colorGroup": 0
},
{
"target": "P12",
"style": "male",
"orientation": "-Z",
"colorGroup": 1
},
{
"target": "P13",
"style": "male",
"orientation": "-Z",
"colorGroup": 1
},
{
"target": "P16",
"style": "male",
"orientation": "-Z",
"colorGroup": 1
},
{
"target": "P19",
"style": "male",
"orientation": "-Z",
"colorGroup": 1
},
{
"target": "P20",
"style": "male",
"orientation": "-Z",
"colorGroup": 1
}
], ],
"assembly": [ "assembly": [
{"part": true}, {
{"pinIndices": [0, 1, 2, 3, 4]}, "part": true
{"pinIndices": [5, 6, 7, 8, 9]} },
{
"pinIndices": [
0,
1,
2,
3,
4
]
},
{
"pinIndices": [
5,
6,
7,
8,
9
]
}
] ]
}, },
"headphone": { "headphone": {
@ -140,18 +354,43 @@
"height": 180, "height": 180,
"pinDistance": 20, "pinDistance": 20,
"pinLocations": [ "pinLocations": [
{"x": 17, "y": 11}, {
{"x": 55, "y": 50} "x": 17,
"y": 11
},
{
"x": 55,
"y": 50
}
] ]
}, },
"pinDefinitions": [ "pinDefinitions": [
{"target": "P0", "style": "croc", "orientation": "Y"}, {
{"target": "ground", "style": "croc", "orientation": "Y"} "target": "P0",
"style": "croc",
"orientation": "Y"
},
{
"target": "ground",
"style": "croc",
"orientation": "Y"
}
], ],
"instantiation": {"kind": "singleton"}, "instantiation": {
"kind": "singleton"
},
"assembly": [ "assembly": [
{"part": true, "pinIndices": [0]}, {
{"pinIndices": [1]} "part": true,
"pinIndices": [
0
]
},
{
"pinIndices": [
1
]
}
] ]
}, },
"speaker": { "speaker": {
@ -162,18 +401,43 @@
"height": 500, "height": 500,
"pinDistance": 70, "pinDistance": 70,
"pinLocations": [ "pinLocations": [
{"x": 180, "y": 135}, {
{"x": 320, "y": 135} "x": 180,
"y": 135
},
{
"x": 320,
"y": 135
}
] ]
}, },
"pinDefinitions": [ "pinDefinitions": [
{"target": "P0", "style": "male", "orientation": "-Z"}, {
{"target": "ground", "style": "male", "orientation": "-Z"} "target": "P0",
"style": "male",
"orientation": "-Z"
},
{
"target": "ground",
"style": "male",
"orientation": "-Z"
}
], ],
"instantiation": {"kind": "singleton"}, "instantiation": {
"kind": "singleton"
},
"assembly": [ "assembly": [
{"part": true, "pinIndices": [0]}, {
{"pinIndices": [1]} "part": true,
"pinIndices": [
0
]
},
{
"pinIndices": [
1
]
}
] ]
} }
} }