diff --git a/test/experiments/comprehensive_protocol/checklist.md b/test/experiments/comprehensive_protocol/checklist.md index ce6de37..5bb14ae 100644 --- a/test/experiments/comprehensive_protocol/checklist.md +++ b/test/experiments/comprehensive_protocol/checklist.md @@ -40,4 +40,183 @@ AdjustPH 写完了 Recrystallize 写完了 TakeSample - Hydrogenate \ No newline at end of file + Hydrogenate +4. 参数对齐 + +class PumpTransferProtocol(BaseModel): + from_vessel: str + to_vessel: str + volume: float + amount: str = "" + time: float = 0 + viscous: bool = False + rinsing_solvent: str = "air" + rinsing_volume: float = 5000 + rinsing_repeats: int = 2 + solid: bool = False + flowrate: float = 500 + transfer_flowrate: float = 2500 + +class SeparateProtocol(BaseModel): + purpose: str + product_phase: str + from_vessel: str + separation_vessel: str + to_vessel: str + waste_phase_to_vessel: str + solvent: str + solvent_volume: float + through: str + repeats: int + stir_time: float + stir_speed: float + settling_time: float + + +class EvaporateProtocol(BaseModel): + vessel: str + pressure: float + temp: float + time: float + stir_speed: float + + +class EvacuateAndRefillProtocol(BaseModel): + vessel: str + gas: str + repeats: int + +class AddProtocol(BaseModel): + vessel: str + reagent: str + volume: float + mass: float + amount: str + time: float + stir: bool + stir_speed: float + viscous: bool + purpose: str + +class CentrifugeProtocol(BaseModel): + vessel: str + speed: float + time: float 自创的 + temp: float + +class FilterProtocol(BaseModel): + vessel: str + filtrate_vessel: str + stir: bool + stir_speed: float + temp: float + continue_heatchill: bool + volume: float + +class HeatChillProtocol(BaseModel): + vessel: str + temp: float + time: float + + stir: bool + stir_speed: float + purpose: str + +class HeatChillStartProtocol(BaseModel): + vessel: str + temp: float 疑似没有 + purpose: str + +class HeatChillStopProtocol(BaseModel): + vessel: str 疑似没有 + +class StirProtocol(BaseModel): + stir_time: float + stir_speed: float + settling_time: float + +class StartStirProtocol(BaseModel): + vessel: str + stir_speed: float 疑似没有 + purpose: str + +class StopStirProtocol(BaseModel): + vessel: str 疑似没有 + +class TransferProtocol(BaseModel): + from_vessel: str + to_vessel: str + volume: float + amount: str = "" + time: float = 0 + viscous: bool = False + rinsing_solvent: str = "" + rinsing_volume: float = 0.0 + rinsing_repeats: int = 0 + solid: bool = False + +class CleanVesselProtocol(BaseModel): + vessel: str + solvent: str + volume: float + temp: float + repeats: int = 1 + +class DissolveProtocol(BaseModel): + vessel: str + solvent: str + volume: float + amount: str = "" + temp: float = 25.0 + time: float = 0.0 + stir_speed: float = 0.0 + +class FilterThroughProtocol(BaseModel): + from_vessel: str + to_vessel: str + filter_through: str + eluting_solvent: str = "" + eluting_volume: float = 0.0 疑似没有 + eluting_repeats: int = 0 + residence_time: float = 0.0 + +class RunColumnProtocol(BaseModel): + from_vessel: str + to_vessel: str + column: str + +class WashSolidProtocol(BaseModel): + vessel: str + solvent: str + volume: float + filtrate_vessel: str = "" + temp: float = 25.0 + stir: bool = False + stir_speed: float = 0.0 + time: float = 0.0 + repeats: int = 1 + +class AdjustPHProtocol(BaseModel): + vessel: str = Field(..., description="目标容器") + ph_value: float = Field(..., description="目标pH值") # 改为 ph_value + reagent: str = Field(..., description="酸碱试剂名称") + # 移除其他可选参数,使用默认值 <新写的,没问题> + +class ResetHandlingProtocol(BaseModel): + solvent: str = Field(..., description="溶剂名称") <新写的,没问题> + +class DryProtocol(BaseModel): + compound: str = Field(..., description="化合物名称") <新写的,没问题> + vessel: str = Field(..., description="目标容器") + +class RecrystallizeProtocol(BaseModel): + ratio: str = Field(..., description="溶剂比例(如 '1:1', '3:7')") + solvent1: str = Field(..., description="第一种溶剂名称") <新写的,没问题> + solvent2: str = Field(..., description="第二种溶剂名称") + vessel: str = Field(..., description="目标容器") + volume: float = Field(..., description="总体积 (mL)") + +class HydrogenateProtocol(BaseModel): + temp: str = Field(..., description="反应温度(如 '45 °C')") + time: str = Field(..., description="反应时间(如 '2 h')") <新写的,没问题> + vessel: str = Field(..., description="反应容器") \ No newline at end of file diff --git a/unilabos/registry/devices/work_station.yaml b/unilabos/registry/devices/work_station.yaml index 1df4382..5941645 100644 --- a/unilabos/registry/devices/work_station.yaml +++ b/unilabos/registry/devices/work_station.yaml @@ -2355,6 +2355,381 @@ workstation: title: initialize_device参数 type: object type: UniLabJsonCommand + AdjustPHProtocol: + feedback: {} + goal: + vessel: vessel + ph_value: ph_value + reagent: reagent + goal_default: + vessel: '' + ph_value: 7.0 + reagent: '' + handles: + input: + - data_key: vessel + data_source: handle + data_type: resource + handler_key: Vessel + label: Vessel + - data_key: reagent + data_source: handle + data_type: resource + handler_key: reagent + label: Reagent + output: + - data_key: vessel + data_source: executor + data_type: resource + handler_key: VesselOut + label: Vessel + result: {} + schema: + description: ROS Action AdjustPH 的 JSON Schema + properties: + feedback: + description: Action 反馈 - 执行过程中从服务器发送到客户端 + properties: + status: + type: string + progress: + type: number + required: + - status + - progress + title: AdjustPH_Feedback + type: object + goal: + description: Action 目标 - 从客户端发送到服务器 + properties: + vessel: + type: string + ph_value: + type: number + reagent: + type: string + required: + - vessel + - ph_value + - reagent + title: AdjustPH_Goal + type: object + result: + description: Action 结果 - 完成后从服务器发送到客户端 + properties: + message: + type: string + return_info: + type: string + success: + type: boolean + required: + - success + - message + - return_info + title: AdjustPH_Result + type: object + required: + - goal + title: AdjustPH + type: object + type: AdjustPH + ResetHandlingProtocol: + feedback: {} + goal: + solvent: solvent + goal_default: + solvent: '' + handles: + input: + - data_key: solvent + data_source: handle + data_type: resource + handler_key: solvent + label: Solvent + output: [] + result: {} + schema: + description: ROS Action ResetHandling 的 JSON Schema + properties: + feedback: + description: Action 反馈 - 执行过程中从服务器发送到客户端 + properties: + status: + type: string + progress: + type: number + required: + - status + - progress + title: ResetHandling_Feedback + type: object + goal: + description: Action 目标 - 从客户端发送到服务器 + properties: + solvent: + type: string + required: + - solvent + title: ResetHandling_Goal + type: object + result: + description: Action 结果 - 完成后从服务器发送到客户端 + properties: + message: + type: string + return_info: + type: string + success: + type: boolean + required: + - success + - message + - return_info + title: ResetHandling_Result + type: object + required: + - goal + title: ResetHandling + type: object + type: ResetHandling + DryProtocol: + feedback: {} + goal: + compound: compound + vessel: vessel + goal_default: + compound: '' + vessel: '' + handles: + input: + - data_key: vessel + data_source: handle + data_type: resource + handler_key: Vessel + label: Vessel + output: + - data_key: vessel + data_source: executor + data_type: resource + handler_key: VesselOut + label: Vessel + result: {} + schema: + description: ROS Action Dry 的 JSON Schema + properties: + feedback: + description: Action 反馈 - 执行过程中从服务器发送到客户端 + properties: + status: + type: string + progress: + type: number + required: + - status + - progress + title: Dry_Feedback + type: object + goal: + description: Action 目标 - 从客户端发送到服务器 + properties: + compound: + type: string + vessel: + type: string + required: + - compound + - vessel + title: Dry_Goal + type: object + result: + description: Action 结果 - 完成后从服务器发送到客户端 + properties: + message: + type: string + return_info: + type: string + success: + type: boolean + required: + - success + - message + - return_info + title: Dry_Result + type: object + required: + - goal + title: Dry + type: object + type: Dry + HydrogenateProtocol: + feedback: {} + goal: + temp: temp + time: time + vessel: vessel + goal_default: + temp: '' + time: '' + vessel: '' + handles: + input: + - data_key: vessel + data_source: handle + data_type: resource + handler_key: Vessel + label: Vessel + output: + - data_key: vessel + data_source: executor + data_type: resource + handler_key: VesselOut + label: Vessel + result: {} + schema: + description: ROS Action Hydrogenate 的 JSON Schema + properties: + feedback: + description: Action 反馈 - 执行过程中从服务器发送到客户端 + properties: + status: + type: string + progress: + type: number + required: + - status + - progress + title: Hydrogenate_Feedback + type: object + goal: + description: Action 目标 - 从客户端发送到服务器 + properties: + temp: + type: string + time: + type: string + vessel: + type: string + required: + - temp + - time + - vessel + title: Hydrogenate_Goal + type: object + result: + description: Action 结果 - 完成后从服务器发送到客户端 + properties: + message: + type: string + return_info: + type: string + success: + type: boolean + required: + - success + - message + - return_info + title: Hydrogenate_Result + type: object + required: + - goal + title: Hydrogenate + type: object + type: Hydrogenate + RecrystallizeProtocol: + feedback: {} + goal: + ratio: ratio + solvent1: solvent1 + solvent2: solvent2 + vessel: vessel + volume: volume + goal_default: + ratio: '' + solvent1: '' + solvent2: '' + vessel: '' + volume: 0.0 + handles: + input: + - data_key: vessel + data_source: handle + data_type: resource + handler_key: Vessel + label: Vessel + - data_key: solvent + data_source: handle + data_type: resource + handler_key: solvent1 + label: Solvent 1 + - data_key: solvent + data_source: handle + data_type: resource + handler_key: solvent2 + label: Solvent 2 + output: + - data_key: vessel + data_source: executor + data_type: resource + handler_key: VesselOut + label: Vessel + result: {} + schema: + description: ROS Action Recrystallize 的 JSON Schema + properties: + feedback: + description: Action 反馈 - 执行过程中从服务器发送到客户端 + properties: + status: + type: string + progress: + type: number + required: + - status + - progress + title: Recrystallize_Feedback + type: object + goal: + description: Action 目标 - 从客户端发送到服务器 + properties: + ratio: + type: string + solvent1: + type: string + solvent2: + type: string + vessel: + type: string + volume: + type: number + required: + - ratio + - solvent1 + - solvent2 + - vessel + - volume + title: Recrystallize_Goal + type: object + result: + description: Action 结果 - 完成后从服务器发送到客户端 + properties: + message: + type: string + return_info: + type: string + success: + type: boolean + required: + - success + - message + - return_info + title: Recrystallize_Result + type: object + required: + - goal + title: Recrystallize + type: object + type: Recrystallize module: unilabos.ros.nodes.presets.protocol_node:ROS2ProtocolNode status_types: {} type: ros2