using AGVControl.Models; using System; namespace AGVControl { public class AGVActionPrediction { public AgvDir Direction { get; set; } public RFIDPoint NextRFID { get; set; } public string Reason { get; set; } public AGVActionReasonCode ReasonCode { get; set; } public AGVMoveState MoveState { get; set; } // RUN 또는 STOP public AgvSpeed? MoveSpeed { get; set; } public AgvSts? MoveDiv { get; set; } public UInt32 Idx { get; set; } public bool Changed { get; set; } public DateTime CreateTime { get; set; } // override object.Equals public bool Equals(AGVActionPrediction obj) { // null 체크 if (obj == null) return false; // 참조가 같으면 true if (ReferenceEquals(this, obj)) return true; // 핵심 속성들만 비교 (Idx, Changed 제외) if (obj.Direction != this.Direction) return false; if (obj.ReasonCode != this.ReasonCode) return false; if (obj.MoveState != this.MoveState) return false; if (obj.MoveSpeed != this.MoveSpeed) return false; if (obj.MoveDiv != this.MoveDiv) return false; // NextRFID 비교 (null 체크 포함) if (obj.NextRFID == null || this.NextRFID == null) { if (obj.NextRFID != this.NextRFID) return false; // 하나만 null이면 false } else { if (obj.NextRFID.Value != this.NextRFID.Value) return false; } // Reason 비교 (null 체크 포함) if (obj.Reason == null || this.Reason == null) { if (obj.Reason != this.Reason) return false; // 하나만 null이면 false } else { if (obj.Reason != this.Reason) return false; } return true; } } }