mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 21:11:12 +00:00
fix and remove redundant info
This commit is contained in:
@@ -68,7 +68,7 @@ class VirtualHeatChill:
|
||||
return True
|
||||
|
||||
async def heat_chill(self, temp: float, time, stir: bool,
|
||||
stir_speed: float, purpose: str) -> bool:
|
||||
stir_speed: float, purpose: str, vessel: dict = {}) -> bool:
|
||||
"""Execute heat chill action - 🔧 修复:确保参数类型正确"""
|
||||
|
||||
# 🔧 关键修复:确保所有参数类型正确
|
||||
@@ -201,7 +201,7 @@ class VirtualHeatChill:
|
||||
|
||||
return True
|
||||
|
||||
async def heat_chill_start(self, temp: float, purpose: str) -> bool:
|
||||
async def heat_chill_start(self, temp: float, purpose: str, vessel: dict = {}) -> bool:
|
||||
"""Start continuous heat chill 🔄"""
|
||||
|
||||
# 🔧 添加类型转换
|
||||
@@ -257,7 +257,7 @@ class VirtualHeatChill:
|
||||
self.logger.info(f"✅ 持续温控已启动! {temp_emoji} {status_action}模式 🚀")
|
||||
return True
|
||||
|
||||
async def heat_chill_stop(self) -> bool:
|
||||
async def heat_chill_stop(self, vessel: dict = {}) -> bool:
|
||||
"""Stop heat chill 🛑"""
|
||||
|
||||
self.logger.info(f"🛑 停止温控:")
|
||||
|
||||
@@ -253,24 +253,6 @@ class VirtualMultiwayValve:
|
||||
# 删除debug日志:self.logger.debug(f"🌊 当前流路: {flow_path}")
|
||||
return flow_path
|
||||
|
||||
def get_info(self) -> dict:
|
||||
"""获取阀门详细信息 📊"""
|
||||
info = {
|
||||
"port": self.port,
|
||||
"max_positions": self.max_positions,
|
||||
"total_positions": self.total_positions,
|
||||
"current_position": self._current_position,
|
||||
"current_port": self.get_current_port(),
|
||||
"target_position": self._target_position,
|
||||
"status": self._status,
|
||||
"valve_state": self._valve_state,
|
||||
"flow_path": self.get_flow_path(),
|
||||
"position_map": self.position_map
|
||||
}
|
||||
|
||||
# 删除debug日志:self.logger.debug(f"📊 阀门信息: 位置={self._current_position}, 状态={self._status}, 端口={self.get_current_port()}")
|
||||
return info
|
||||
|
||||
def __str__(self):
|
||||
current_port = self.get_current_port()
|
||||
status_emoji = "✅" if self._status == "Idle" else "🔄" if self._status == "Busy" else "❌"
|
||||
@@ -313,9 +295,6 @@ if __name__ == "__main__":
|
||||
print(f"\n📋 可用位置: {valve.get_available_positions()}")
|
||||
print(f"🗺️ 端口映射: {valve.get_available_ports()}")
|
||||
|
||||
# 获取详细信息
|
||||
print(f"\n📊 详细信息: {valve.get_info()}")
|
||||
|
||||
# 测试切换功能
|
||||
print(f"\n🔄 智能切换测试:")
|
||||
print(f"当前位置: {valve._current_position}")
|
||||
|
||||
@@ -319,21 +319,6 @@ class VirtualSolidDispenser:
|
||||
def total_operations(self) -> int:
|
||||
return self._total_operations
|
||||
|
||||
def get_device_info(self) -> Dict[str, Any]:
|
||||
"""获取设备状态信息 📊"""
|
||||
info = {
|
||||
"device_id": self.device_id,
|
||||
"status": self._status,
|
||||
"current_reagent": self._current_reagent,
|
||||
"last_dispensed_amount": self._dispensed_amount,
|
||||
"total_operations": self._total_operations,
|
||||
"max_capacity": self.max_capacity,
|
||||
"precision": self.precision
|
||||
}
|
||||
|
||||
# self.logger.debug(f"📊 设备信息: 状态={self._status}, 试剂={self._current_reagent}, 加样量={self._dispensed_amount:.6f}g")
|
||||
return info
|
||||
|
||||
def __str__(self):
|
||||
status_emoji = "✅" if self._status == "Ready" else "🔄" if self._status == "Dispensing" else "❌" if self._status == "Error" else "🏠"
|
||||
return f"⚗️ VirtualSolidDispenser({status_emoji} {self.device_id}: {self._status}, 最后加样 {self._dispensed_amount:.3f}g)"
|
||||
@@ -380,8 +365,6 @@ async def test_solid_dispenser():
|
||||
mass="150 g" # 超过100g限制
|
||||
)
|
||||
print(f"📊 测试4结果: {result4}")
|
||||
|
||||
print(f"\n📊 最终设备信息: {dispenser.get_device_info()}")
|
||||
print(f"✅ === 测试完成 === 🎉")
|
||||
|
||||
|
||||
|
||||
@@ -380,22 +380,6 @@ class VirtualTransferPump:
|
||||
"""检查是否已满"""
|
||||
return self._current_volume >= (self.max_volume - 0.01) # 允许小量误差
|
||||
|
||||
# 调试和状态信息
|
||||
def get_pump_info(self) -> dict:
|
||||
"""获取泵的详细信息"""
|
||||
return {
|
||||
"device_id": self.device_id,
|
||||
"status": self._status,
|
||||
"position": self._position,
|
||||
"current_volume": self._current_volume,
|
||||
"max_volume": self.max_volume,
|
||||
"max_velocity": self._max_velocity,
|
||||
"mode": self.mode.name,
|
||||
"is_empty": self.is_empty(),
|
||||
"is_full": self.is_full(),
|
||||
"remaining_capacity": self.get_remaining_capacity()
|
||||
}
|
||||
|
||||
def __str__(self):
|
||||
return f"VirtualTransferPump({self.device_id}: {self._current_volume:.2f}/{self.max_volume} ml, {self._status})"
|
||||
|
||||
@@ -425,8 +409,6 @@ async def demo():
|
||||
result = await pump.set_position(0.0)
|
||||
print(f"Empty result: {result}")
|
||||
print(f"After emptying: {pump}")
|
||||
|
||||
print("\nPump info:", pump.get_pump_info())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user