MCPcopy Create free account

hub / github.com/Tong89/smartNode / functions

Functions1,201 in github.com/Tong89/smartNode

Method_relay_can_carry_request
(self, relay_id, required_rate, req)
backend/core.py:1183
Method_release_time_slot
(self, req_id)
backend/core.py:810
Method_reserve_time_slot
(self, resource_type, resource_id, start_time, end_time, req_id, bandwidth=0)
backend/core.py:807
Function_reset_rate_limiter
Clear the global sliding-window rate limiter before every test.
tests/test_api_errors.py:42
Method_resource_busy_by_other
(self, resource_type, resource_id, req_id)
backend/core.py:1177
Method_simulation_loop
仿真主循环
backend/core.py:586
Function_snapshot_loop
Background thread: periodically publishes a full situation snapshot. ``engine_ref_getter`` is a zero-argument callable that returns the
backend/stream.py:84
Function_startLinkAnimation
* 启动链路流动动画循环。 * 通过持续调用 requestRender 驱动 Cesium 在 requestRenderMode 下不断重绘, * 同时利用 PolylineGlowMaterialProperty 的自发光效果模拟数据流动感。 * 每帧递增 _li
frontend/app.js:880
Function_startPolling
* 启动 2 秒轮询回退(在 SSE 不可用时使用)。
frontend/app.js:461
Function_stopLinkAnimation
* 停止链路流动动画循环(当无活跃传输链路时调用)。
frontend/app.js:931
Function_submit_batch
顺序提交一批请求,收集所有返回结果。
tests/load/test_stress_engine.py:98
Function_submit_n
在一个线程中提交 n 次请求,收集结果或异常。
tests/test_concurrency.py:51
Method_validate_time_window
⭐ 新增:校验时间窗口是否满足传输需求
backend/core.py:1377
FunctionactivateScenario
(name)
frontend/app.js:1312
FunctionactiveRequestsForScene
()
frontend/app.js:147
Methodactive_beam_count
当前活跃波束数。
backend/comms/beam_pointing.py:359
Functionadd_api_headers
(response)
backend/api.py:90
Methodallocate
分配��个活跃波束槽位,更新当前指向。 Parameters ---------- beam_key : str 波束唯一标识(如请求 ID 或 ``"<station>-<target>"``)。 azimu
backend/comms/beam_pointing.py:480
Methodantipodal
()
tests/test_perf_benchmarks.py:247
FunctionapiUrl
(path)
frontend/app.js:311
FunctionapplyReqFilters
()
frontend/app.js:515
Methodas_dict
(self)
backend/config.py:157
Functionauth_login
账号密码登录,签发 access/refresh JWT。
backend/api.py:1516
Functionauth_refresh
用 refresh token 换取新的 access token。
backend/api.py:1532
Methodavailable_beam_slots
剩余可用波束槽位数。
backend/comms/beam_pointing.py:365
Methodbad_worker
()
tests/test_concurrency.py:324
MethodbaseUrl
Current base URL (without trailing slash).
frontend/src/api/client.ts:75
FunctionbeforeUnmount
()
frontend/app.js:256
Functionbench_engine
不启动后台线程的固定种子引擎,模块作用域,避免重复初始化开销。
tests/test_perf_benchmarks.py:97
Functionbench_geo2_pos
第二个 GEO 中继星位置(多跳链路使用)。
tests/test_perf_benchmarks.py:91
Functionbench_geo_pos
固定 GEO 中继星位置。
tests/test_perf_benchmarks.py:85
Functionbench_gs_ka
Ka 天线地面站。
tests/test_perf_benchmarks.py:73
Functionbench_gs_x
X 天线地面站。
tests/test_perf_benchmarks.py:79
Functionbench_sat_pos
固定卫星位置(lat/lon/alt)。
tests/test_perf_benchmarks.py:67
Functionbuild_raw_image_engine
场景 2:RAW_IMAGE 仅直连场景引擎。 RAW_IMAGE 的 allowed_links=["direct"],中继路径必须被忽略。 本场景验证提交后的 transmission_method 仅为 "direct" 或请求处于等待(无链路时)。
tests/fixtures/scenarios.py:88
Functionbuild_relay_exhausted_engine
场景 3:中继带宽耗尽场景引擎。 预先手动填满 GEO 中继的带宽占用,使后续低优先级请求因 BANDWIDTH_EXCEEDED 被拒绝。
tests/fixtures/scenarios.py:97
Functionbuild_task_cmd_engine
场景 1:TASK_CMD 立即接受场景引擎。 TASK_CMD 属于 immediate=True 类型,_evaluate_request 会直接返回 (True, "指令类型立即接受")。 本场景验证无需任何链路可见、立即进入 accepted 状态。
tests/fixtures/scenarios.py:79
Functionbuild_timeout_engine
场景 4:等待超时场景引擎。 创建引擎后推进超过 max_delay 的时间,使 accepted 状态的请求触发 TIMEOUT_WAIT 拒绝。 本场景通过极短的 max_delay 快速触发超时。
tests/fixtures/scenarios.py:120
Methodburst_submit
高频提交 TASK_CMD 请求,制造峰值并发压力。
tests/load/locustfile.py:157
Methodcan_use_ground_station
(gs_id)
backend/scheduling/strategy.py:36
Methodcan_use_ground_station
(gs_id)
backend/scheduling/qos.py:311
Methodcan_use_satellite
()
backend/scheduling/strategy.py:33
Methodcan_use_satellite
()
backend/scheduling/qos.py:306
Methodcheck
校验对目标 (azimuth, elevation) 的波束指向请求。 Parameters ---------- azimuth_deg : float 目标方位角(度),相对天线法线方向。 elevatio
backend/comms/beam_pointing.py:372
Methodcheck_health
轮询健康检查接口,监控系统在高负载下的响应能力。
tests/load/locustfile.py:125
Methodcheck_resource_utilization
轮询资源利用率接口,采集基线数据。
tests/load/locustfile.py:143
Methodcheck_system_info
轮询系统信息接口,监控统计计数。
tests/load/locustfile.py:138
Functionclient
将干净引擎注入 api.app,返回 Flask test_client。 通过替换 api.simulation_engine 避免全局状态污染;测试结束后恢复原始引擎。
tests/test_api_integration.py:47
Functionclient
将干净引擎注入 api.app,返回 Flask test_client。 测试结束后恢复原始引擎,避免全局状态污染。
tests/test_api.py:47
FunctioncompareMetricClass
(delta)
frontend/app.js:1381
FunctioncomputeCoverageRadius
* 根据卫星/中继高度和最小仰角计算地面覆盖半径(米)。 * * 几何关系(球形地球): * R_E — 地球半径 6371 km * h — 卫星高度(米) * ε — 最小仰角(度) * * 天底
frontend/app.js:1088
Methodconstructor
( message: string, public readonly status?: number, public readonly isTimeout = false, )
frontend/src/api/client.ts:51
Methodconstructor
(baseUrl?: string, defaultTimeoutMs = DEFAULT_TIMEOUT_MS)
frontend/src/api/client.ts:69
Functiondata
()
frontend/app.js:31
FunctiondataTypeOptions
()
frontend/app.js:172
Functiondecorator
(fn)
backend/ratelimit.py:52
Functiondecorator
(fn)
backend/rbac.py:25
FunctiondeleteScenario
(name)
frontend/app.js:1340
FunctiondestroyViewer
()
frontend/src/composables/use-cesium-scene.ts:462
FunctiondrawLink
* @deprecated 由 upsertLink 取代,保留仅供外部可能调用的场景兼容。 * 直接新建一个 polyline 实体(不索引,不复用)。
frontend/app.js:955
FunctiondrawRequestLinks
* @deprecated 由 updateRequestLinks 取代。
frontend/app.js:971
Functionengine
()
tests/test_store.py:15
Methodengine
(self)
tests/test_rate_calc.py:316
Functionengine_no_threads
使用固定种子、不启动后台线程的引擎,适合纯功能单测。
tests/conftest.py:40
Functionengine_seeded
与 engine_no_threads 相同,但以工厂默认参数创建,供需要两个独立实例的测试使用。
tests/conftest.py:49
Functionerr
(code, message=None, http_status=None, details=None)
backend/envelope.py:39
FunctionexportScenario
(format: 'json' | 'yaml' = 'json')
frontend/src/api/endpoints.ts:176
Functionextract_request_snapshot
从请求字典中提取黄金快照所需的字段子集(排除时间戳等易变字段)。 Args: req_dict: TransmissionRequest.to_dict() 的返回值 Returns: 包含核心稳定字段的字典,用于黄金比对
tests/fixtures/scenarios.py:129
Functionextract_stats_snapshot
从引擎统计中提取黄金快照所需的计数字段(排除浮点利用率等非确定字段)。 Args: stats: engine.stats 字典 Returns: 包含请求计数的稳定字典,用于黄金比对
tests/fixtures/scenarios.py:147
Functionfavicon
返回空favicon避免404错误
backend/api.py:1626
FunctionfetchCurrentScenario
()
frontend/src/api/endpoints.ts:154
FunctionfetchJson
(path, options = {})
frontend/app.js:315
FunctionfetchSnapshotAt
(t: number)
frontend/src/api/endpoints.ts:144
Functionflask_client
注入干净引擎(seed=0, autostart=False)的 Flask test_client。 替换 api.simulation_engine 后在函数作用域内运行测试,测试结束后恢复原始引擎, 保证测试间无状态污染。适合 API 集成测试中只需 client、不需直接操
tests/conftest.py:59
Functionflask_client_engine
与 flask_client 相同,但同时暴露底层引擎,供需要断言引擎内部状态的测试使用。 Yields: (client, engine): Flask test_client 与对应的 SimulationEngine 实例。
tests/conftest.py:119
Methodforget
(self, req_id)
backend/scheduling/handover.py:28
FunctionformatDuration
(seconds)
frontend/app.js:1448
FunctionformatMetricValue
(value)
frontend/app.js:1388
FunctionformatProgress
(progress)
frontend/app.js:1455
FunctionformatTime
(seconds)
frontend/app.js:1460
Methodfrom_dict
(cls, d: dict)
backend/models.py:23
Methodfrom_dict
(cls, d: dict)
backend/models.py:63
Methodfrom_json
从 JSON 字符串反序列化场景字典。
backend/scenario.py:218
Methodfrom_tle
由 TLE 两行根数创建传播器;若 sgp4 不可用则需提供 orbital_elements 回退。
backend/physics/propagator.py:293
Functionfrontend_assets
(filename)
backend/api.py:1511
Functionfrontend_index
()
backend/api.py:1506
FunctionganttBarClass
(evt)
frontend/app.js:1429
FunctionganttBarStyle
(evt)
frontend/app.js:1422
FunctionganttBarTooltip
(evt)
frontend/app.js:1433
FunctionganttGroups
()
frontend/app.js:214
FunctionganttHover
(evt)
frontend/app.js:1440
FunctionganttLeave
()
frontend/app.js:1444
FunctionganttRangeSpan
()
frontend/app.js:199
FunctionganttTimeRange
()
frontend/app.js:193
FunctionganttTimeTicks
()
frontend/app.js:203
FunctionganttToPct
* 将仿真时刻转换为时间轴上的百分比位置。
frontend/app.js:1416
FunctiongeoRelayCount
()
frontend/app.js:168
FunctiongeoRelays
()
frontend/app.js:130
Functionget_all_requests_with_background
获取所有请求(包括背景任务)- 用于资源时间线可视化
backend/api.py:274
Functionget_all_transmission_requests
获取所有用户传输请求(不包括背景任务)
backend/api.py:178
← previousnext →401–500 of 1,201, ranked by callers