Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ConfigurationTool/Checks/History.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ public async Task GetHistoryReadConfig(CancellationToken token)
{
await PopulateNodes(token);
await ReadNodeData(token);
bool oldHistory = Config.History.Enabled;
bool oldHistoryData = Config.History.Data;
Config.History.Enabled = true;
Config.History.Data = true;

var historizingStates = nodeList.Where(node =>
(node is UAVariable variable) && !variable.IsProperty && variable.FullAttributes.ShouldReadHistory(Config))
.Select(node => new VariableExtractionState(this, (UAVariable)node, true, true, true)).ToList();
Config.History.Enabled = oldHistory;
Config.History.Data = oldHistoryData;

var stateMap = historizingStates.ToDictionary(state => state.SourceId);

Expand Down
3 changes: 2 additions & 1 deletion Extractor/Config/CogniteConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ You should have received a copy of the GNU General Public License
using Cognite.Extensions;
using Cognite.Extractor.Common;
using Cognite.Extractor.Utils;
using Cognite.Extractor.Utils.Unstable.Configuration;
using CogniteSdk.DataModels;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Cognite.OpcUa.Config
{
public class CognitePusherConfig : CogniteConfig, IPusherConfig
public class CognitePusherConfig : BaseCogniteConfig, IPusherConfig
{
/// <summary>
/// Data set to use for new objects. Requires the capability datasets:read if external-id is used.
Expand Down
12 changes: 4 additions & 8 deletions Extractor/Config/FullConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public FullConfig() : base()
/// <summary>
/// Configuration for writing to CDF.
/// </summary>
public CognitePusherConfig? Cognite { get; set; }
public CognitePusherConfig Cognite { get; set; } = null!;
/// <summary>
/// Configuration for how data should be extracted.
/// </summary>
Expand Down Expand Up @@ -108,13 +108,9 @@ public override void GenerateDefaults()
Source ??= new SourceConfig();
Logger ??= new UALoggerConfig();
Metrics ??= new UAMetricsConfig();
if (Cognite != null)
{
if (Cognite.CdfChunking == null) Cognite.CdfChunking = new ChunkingConfig();
if (Cognite.CdfThrottling == null) Cognite.CdfThrottling = new ThrottlingConfig();
if (Cognite.CdfRetries == null) Cognite.CdfRetries = new RetryConfig();
if (Cognite.SdkLogging == null) Cognite.SdkLogging = new SdkLoggingConfig();
}
Cognite ??= new CognitePusherConfig();
if (Cognite.CdfChunking == null) Cognite.CdfChunking = new ChunkingConfig();
if (Cognite.CdfThrottling == null) Cognite.CdfThrottling = new ThrottlingConfig();
Extraction ??= new ExtractionConfig();
Events ??= new EventConfig();
FailureBuffer ??= new FailureBufferConfig();
Expand Down
Loading
Loading