Skip to content

Commit

Permalink
Fixed issue with Normal Condition clearing based on NativeCode
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickRitchie committed Dec 10, 2023
1 parent cd61163 commit 0add24b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -753,11 +753,11 @@ protected bool UpdateCurrentCondition(string deviceUuid, IDataItem dataItem, IOb
{
existingHash = StringFunctions.ToMD5HashBytes(existingObservations.Select(o => o.ChangeId).ToArray());

var conditionLevel = observation.GetValue(ValueKeys.Level);
var conditionLevelValue = observation.GetValue(ValueKeys.Level);
var conditionLevel = conditionLevelValue.ConvertEnum<ConditionLevel>();
var nativeCode = observation.GetValue(ValueKeys.NativeCode);

if (!(conditionLevel == ConditionLevel.NORMAL.ToString() && string.IsNullOrEmpty(nativeCode)) &&
conditionLevel != ConditionLevel.UNAVAILABLE.ToString())
if (!(conditionLevel == ConditionLevel.NORMAL && string.IsNullOrEmpty(nativeCode)) && conditionLevel != ConditionLevel.UNAVAILABLE)
{
var i = 0;
foreach (var existingObservation in existingObservations)
Expand Down

0 comments on commit 0add24b

Please sign in to comment.