-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpython.ts
More file actions
60 lines (56 loc) · 1.54 KB
/
Copy pathpython.ts
File metadata and controls
60 lines (56 loc) · 1.54 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
/**
* Python/Pyodide related constants
*
* Note: PYODIDE_VERSION and PYODIDE_CDN_URL are now in dependencies.ts (generated)
*/
/**
* Code section headers used in generated Python code
*/
export const CODE_SECTIONS = {
IMPORTS: '# IMPORTS',
CODE_CONTEXT: '# CODE CONTEXT',
USER_DEFINED_CODE: '# USER-DEFINED CODE',
BLOCKS: '# BLOCKS',
NODE_ID_MAPPING: '# NODE ID MAPPING (for data extraction)',
NODE_NAME_MAPPING: '# NODE NAME MAPPING',
CONNECTIONS: '# CONNECTIONS',
EVENTS: '# EVENTS',
SIMULATION: '# SIMULATION',
RUN: '# RUN',
MAIN: '# MAIN'
} as const;
/**
* Category order for organizing blocks in formatted export
*/
export const BLOCK_CATEGORY_ORDER: string[] = [
'Sources',
'Dynamic',
'DAE',
'Algebraic',
'Logic',
'Discrete',
'FMI',
'Recording',
'Subsystem'
];
/**
* Block categories hidden when running on the Pyodide (in-browser) backend,
* configurable per distribution via `VITE_PYODIDE_HIDDEN_CATEGORIES`
* (comma-separated). Empty by default. Use this for categories whose blocks
* can't work in the browser sandbox (e.g. FMI/FMU blocks that drive an external
* .fmu through a native runtime) so they're only offered on a native backend.
*/
export const PYODIDE_HIDDEN_CATEGORIES: string[] = (
(import.meta.env.VITE_PYODIDE_HIDDEN_CATEGORIES as string | undefined) ?? ''
)
.split(',')
.map((c) => c.trim())
.filter(Boolean);
/**
* Timeout constants for Pyodide operations (in milliseconds)
*/
export const TIMEOUTS = {
SIMULATION: 300000, // 5 minutes
INIT: 120000, // 2 minutes
VALIDATION: 30000 // 30 seconds
} as const;