namespace AGVNavigationCore.Models
{
///
/// AGV 제어 명령 클래스 (실제 AGV 제어용)
/// Predict() 메서드가 반환하는 다음 동작 명령
///
public class AGVCommand
{
/// 모터 명령 (정지/전진/후진)
public MotorCommand Motor { get; set; }
/// 마그넷 위치 (직진/왼쪽/오른쪽)
public MagnetPosition Magnet { get; set; }
/// 속도 레벨 (저속/중속/고속)
public SpeedLevel Speed { get; set; }
/// 명령 이유 메세지- (디버깅/로깅용)
public string Message { get; set; }
/// 명령 이유- (디버깅/로깅용)
public eAGVCommandReason Reason { get; set; }
/// 방향 전환 명령 여부 (180도 Left Turn 등)
public bool IsTurn { get; set; }
///
/// 생성자
///
public AGVCommand(MotorCommand motor, MagnetPosition magnet, SpeedLevel speed, eAGVCommandReason reason, string reasonmessage = "")
{
Motor = motor;
Magnet = magnet;
Speed = speed;
Reason = reason;
Message = reasonmessage;
}
///
/// 기본 생성자
///
public AGVCommand()
{
Motor = MotorCommand.Stop;
Magnet = MagnetPosition.S;
Speed = SpeedLevel.L;
Message = "";
Reason = eAGVCommandReason.Normal;
}
public override string ToString()
{
return $"Motor:{Motor}, Magnet:{Magnet}, Speed:{Speed},Reason:{Reason}" +
(string.IsNullOrEmpty(Message) ? "" : $" ({Message})");
}
}
}