Skip to content

Commit

Permalink
Fixed issue with initial load of Agent Device observations
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickRitchie committed Dec 11, 2023
1 parent 0d43e93 commit fd9291a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ public void StartAgent(IAgentApplicationConfiguration configuration, bool verbos

_observationBuffer = observationBuffer;
}
else
{
_observationBuffer = new MTConnectObservationBuffer(configuration);
}

if (!configuration.Durable || initializeDataItems)
{
Expand Down
6 changes: 4 additions & 2 deletions libraries/MTConnect.NET-Common/Agents/MTConnectAgentBroker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ public MTConnectAgentBroker(
long instanceId = 0,
long deviceModelChangeTime = 0,
bool initializeAgentDevice = true
) : base(uuid, instanceId, deviceModelChangeTime, initializeAgentDevice)
) : base(uuid, instanceId, deviceModelChangeTime, false)
{
var config = new AgentConfiguration();
_observationBuffer = observationBuffer != null ? observationBuffer : new MTConnectObservationBuffer(config);
_assetBuffer = assetBuffer != null ? assetBuffer : new MTConnectAssetBuffer(config);
_assetBuffer.AssetRemoved += AssetRemovedFromBuffer;
InitializeAgentDevice(initializeAgentDevice);
}

public MTConnectAgentBroker(
Expand All @@ -197,12 +198,13 @@ public MTConnectAgentBroker(
long instanceId = 0,
long deviceModelChangeTime = 0,
bool initializeAgentDevice = true
) : base(configuration, uuid, instanceId, deviceModelChangeTime, initializeAgentDevice)
) : base(configuration, uuid, instanceId, deviceModelChangeTime, false)
{
var config = configuration != null ? configuration : new AgentConfiguration();
_observationBuffer = observationBuffer != null ? observationBuffer : new MTConnectObservationBuffer(config);
_assetBuffer = assetBuffer != null ? assetBuffer : new MTConnectAssetBuffer(config);
_assetBuffer.AssetRemoved += AssetRemovedFromBuffer;
InitializeAgentDevice(initializeAgentDevice);
}

#endregion
Expand Down

0 comments on commit fd9291a

Please sign in to comment.