feat: 加入了调试器
docs: 完善了文档
这个提交包含在:
@ -24,6 +24,7 @@ class ReadingGuardSource(str, Enum):
|
||||
DEVICE_PEAK = "device_peak"
|
||||
DEVICE_FREQUENCY = "device_frequency"
|
||||
MANUAL = "manual"
|
||||
PEAK_OCR = "peak_ocr"
|
||||
|
||||
|
||||
class ReadingGuardConfig(BaseModel):
|
||||
|
||||
@ -50,3 +50,48 @@ class AnalyzeMeasurementResponse(BaseModel):
|
||||
uncertainty_mps: Optional[float] = None
|
||||
theoretical_velocity_mps: Optional[float] = None
|
||||
details: Dict[str, Any] = Field(default_factory=dict)
|
||||
|
||||
|
||||
class PeakMonitorState(str, Enum):
|
||||
IDLE = "idle"
|
||||
RISING = "rising"
|
||||
PEAK_TRIGGERED = "peak_triggered"
|
||||
COOLDOWN = "cooldown"
|
||||
|
||||
|
||||
class PeakMonitorStartRequest(BaseModel):
|
||||
experiment: str = "cn.edu.muc.lxy.phyexp.voicespeed"
|
||||
drop_ratio: float = Field(default=0.05, gt=0, le=0.5)
|
||||
cooldown_ratio: float = Field(default=0.30, gt=0, le=0.8)
|
||||
|
||||
|
||||
class PeakMonitorResponse(BaseModel):
|
||||
running: bool
|
||||
state: PeakMonitorState = PeakMonitorState.IDLE
|
||||
current_peak: Optional[float] = None
|
||||
peak_max: Optional[float] = None
|
||||
ocr_reading: Optional[float] = None
|
||||
pending_field: Optional[str] = None
|
||||
peak_index: int = 0
|
||||
trend: str = "flat"
|
||||
|
||||
|
||||
class DebugMenuItem(BaseModel):
|
||||
label: str
|
||||
action: str
|
||||
method: str = "GET"
|
||||
endpoint: str
|
||||
description: str = ""
|
||||
|
||||
|
||||
class DebugMenuResponse(BaseModel):
|
||||
experiment: str
|
||||
title: str
|
||||
description: str = ""
|
||||
items: List[DebugMenuItem]
|
||||
|
||||
|
||||
class DebugStatusResponse(BaseModel):
|
||||
experiment: str
|
||||
debug_providers: Dict[str, List[str]]
|
||||
oscilloscope: Optional[Dict[str, Any]] = None
|
||||
|
||||
在新工单中引用
屏蔽一个用户