..
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using AGVControl.Models;
|
||||
using System;
|
||||
|
||||
namespace AGVControl
|
||||
{
|
||||
@@ -9,6 +10,48 @@ namespace AGVControl
|
||||
public string Reason { get; set; }
|
||||
public AGVActionReasonCode ReasonCode { get; set; }
|
||||
public AGVMoveState MoveState { get; set; } // RUN 또는 STOP
|
||||
}
|
||||
public AgvSpeed? MoveSpeed { get; set; }
|
||||
public AgvRunDirection? MoveDiv { get; set; }
|
||||
public UInt32 Idx { get; set; }
|
||||
public bool Changed { 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user