!2330 开发:增加Erp解析板件数据测试用例

pull/2331/head
林三 1 year ago committed by ChenX
parent b4b9b066e7
commit fc256a9715

@ -24,3 +24,15 @@ test('板件到CADViewer2', () =>
expect(u.GetModelData(br)).toMatchSnapshot();
}
});
test('板件到CADViewer3', () =>
{
let d =
{ "file": [1, "Board", 10, 2, 100, 0, 1, 3, 71, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 99.22680412371145, 0, 9.0206185569231, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 99.22680412371145, 0, 9.0206185569231, 1], 0, 0, 1, 3, 500, 500, 18, true, "Polyline", 10, 2, 0, 0, 0, 7, 71, [1, 0, 0, 0, 0, 1, -2.220446049250313e-16, 0, 0, 2.220446049250313e-16, 1, 0, 0, 500, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, -848.5824742268046, -20.618556701474947, 1.1102230246251565e-13, 1], 0, 0, 1, 2, 4, [0, -500], 0, [500, -500], 0, [500, 0], 0, [0, 0], 0, true, 1, 3, 154.639175257732, 231.95876288659804, 18, true, "Polyline", 10, 2, 0, 0, 0, 7, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 154.639175257732, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, -983.8917525773198, -162.37113402106266, 0, 1], 0, 0, 1, 2, 4, [-88.65979381443285, -154.639175257732], 0, [231.95876288659804, -154.639175257732], 0, [231.95876288659804, 0], 0, [-88.65979381443285, 0], 0, true, 0, 3, 0, 0, 0, 0, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 234.53608247422667, -1.1102230246251565e-13, 150.7731958765108, 1], 3, 0, 0, 0, 0, 0, 11, 2, "背板", "", "", "", "", "", 0, 0, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 4, "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, 0, 0, null], "basePt": { "x": 99.22680412371145, "y": -18, "z": 9.0206185569231 }, "ucs": [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1] };
let brs = LoadBoardsFromFileData(d);
let u = new ErpParseData();
for (let br of brs)
{
expect(u.GetModelData(br)).toMatchSnapshot();
}
});

@ -1382,3 +1382,127 @@ CADDbBoard {
},
}
`;
exports[`板件到CADViewer3 1`] = `
CADDbBoard {
"BasePoint": Vector3 {
"x": 99.22680412371145,
"y": -18,
"z": 9.0206185569231,
},
"BoardName": "背板",
"Buls": Array [
0,
0,
0,
0,
0,
],
"CabName": "",
"Drillings": null,
"Grain": 0,
"H": 18,
"L": 500,
"Pts": Array [
Vector2 {
"x": 0,
"y": 0,
},
Vector2 {
"x": 500,
"y": 0,
},
Vector2 {
"x": 500,
"y": 500,
},
Vector2 {
"x": 0,
"y": 500,
},
Vector2 {
"x": 0,
"y": 0,
},
],
"SubBoardAssoc": null,
"SubBoardLocal": Array [
CADDbBoard {
"BasePoint": Vector3 {
"x": 234.53608247422667,
"y": -18.00000000000011,
"z": 150.7731958765108,
},
"BoardName": "",
"Buls": Array [
0,
0,
0,
0,
0,
],
"CabName": "",
"Drillings": null,
"Grain": 0,
"H": 18,
"L": 154.639175257732,
"Pts": Array [
Vector2 {
"x": -88.65979381443285,
"y": 0,
},
Vector2 {
"x": 231.95876288659804,
"y": 0,
},
Vector2 {
"x": 231.95876288659804,
"y": 154.639175257732,
},
Vector2 {
"x": -88.65979381443285,
"y": 154.639175257732,
},
Vector2 {
"x": -88.65979381443285,
"y": 0,
},
],
"SubBoardAssoc": null,
"SubBoardLocal": Array [],
"W": 231.95876288659804,
"XVec": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"YVec": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"ZVec": Vector3 {
"x": 0,
"y": -1,
"z": 0,
},
},
],
"W": 500,
"XVec": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"YVec": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"ZVec": Vector3 {
"x": 0,
"y": -1,
"z": 0,
},
}
`;

Loading…
Cancel
Save