namespace RobotNet10.RobotApp.Modules;
///
/// Interface cho Lift Module - Module điều khiển nâng hạ
///
public interface ILiftModule
{
///
/// Nâng lên (lift up)
///
Task LiftUpAsync(CancellationToken cancellationToken = default);
///
/// Hạ xuống (lift down)
///
Task LiftDownAsync(CancellationToken cancellationToken = default);
///
/// Dừng nâng/hạ ngay lập tức (khi đang di chuyển)
///
Task LiftStopAsync(CancellationToken cancellationToken = default);
///
/// Di chuyển đến vị trí cụ thể
///
/// Vị trí target (encoder counts)
Task LiftToPositionAsync(int position, CancellationToken cancellationToken = default);
///
/// Lấy vị trí hiện tại
///
Task GetCurrentPositionAsync(CancellationToken cancellationToken = default);
///
/// Kiểm tra module đã homed chưa
///
Task IsHomedAsync(CancellationToken cancellationToken = default);
///
/// Thực hiện homing thủ công (nếu cần gọi lại sau khi fault hoặc thay đổi cơ khí)
///
Task HomeAsync(CancellationToken cancellationToken = default);
///
/// Chuyển chiều cao (m) sang vị trí encoder. Dùng cho action liftCameraByHeight.
///
/// Chiều cao theo mét (trong khoảng MinHeightM..MaxHeightM từ config)
/// Vị trí encoder tương ứng
int GetPositionFromHeightM(double heightM);
bool Enable { get; }
///
/// Kiểm tra module đã sẵn sàng chưa (initialized và homed)
///
bool IsReady { get; }
///
/// Lấy trạng thái hiện tại của module
///
LiftModuleState State { get; }
LiftPosition Position { get; }
}
public enum LiftPosition
{
Bottom,
Middle,
Top,
}
///
/// Trạng thái của Lift Module
///
public enum LiftModuleState
{
Uninitialized,
Initializing,
Homing,
Ready,
Moving,
Error
}