-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_packets_panelize.py
More file actions
108 lines (76 loc) · 2.31 KB
/
server_packets_panelize.py
File metadata and controls
108 lines (76 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
from typing import TypedDict, List, Literal, NotRequired
"""
Types used for communication between the client and server.
Mirrors frontend `networking/packetTypes.ts`.
"""
# -----------------------------
# Incoming Request Types
# -----------------------------
class Vec2(TypedDict):
x: float
y: float
class FabSpec(TypedDict):
count: Vec2
step: Vec2
viaHoleDiameter: float
biteHoleDiameter: float
fabRailHoleDiameter: float
class Layer(TypedDict):
side: str
type: str
class FileTextLayer(TypedDict):
layer: Layer
content: str
name: str
class PanelizeStartRequest(TypedDict):
endpoint: Literal["panelizeStart"]
fileTextLayers: List[FileTextLayer]
fabSpec: FabSpec
boardOutlineD: str
gerberOrigin: Vec2
vias: List[Vec2]
biteHoles: List[Vec2]
fabRailHoles: List[Vec2]
pads: List[List[Vec2]]
padsSoldermask: List[List[Vec2]]
svgCopperTop: str
svgCopperBottom: str
soldermaskTop: str
soldermaskBottom: str
vcut: str
class PanelizeProgressRequest(TypedDict):
endpoint: Literal["panelizeProgress"]
jobId: str
class PCBArtifactRequest(TypedDict):
endpoint: Literal["pcbArtifact"]
jobId: str
uploadToFabHouse: NotRequired[bool]
# -----------------------------
# Outgoing Response Types
# -----------------------------
class PanelizeStartResponseResult(TypedDict):
jobId: str
class PanelizeStartResponseError(TypedDict):
message: str
class PanelizeStartResponse(TypedDict):
endpoint: Literal["panelizeStart"]
error: NotRequired[PanelizeStartResponseError]
result: NotRequired[PanelizeStartResponseResult]
class PanelizeProgressResponseError(TypedDict):
message: str
class PanelizeProgressResponseResult(TypedDict):
progress: float
completed: NotRequired[bool]
class PanelizeProgressResponse(TypedDict):
endpoint: Literal["panelizeProgress"]
error: NotRequired[PanelizeProgressResponseError]
result: NotRequired[PanelizeProgressResponseResult]
class PCBArtifactResponseResult(TypedDict):
zipFile: str
fabricationUrl: NotRequired[str]
class PCBArtifactResponseError(TypedDict):
message: str
class PCBArtifactResponse(TypedDict):
endpoint: Literal["pcbArtifact"]
error: NotRequired[PCBArtifactResponseError]
result: NotRequired[PCBArtifactResponseResult]