Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency Cognite.Simulator.Utils to 1.0.0-beta-008 #17

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Connector/Connector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cognite.Simulator.Utils" Version="1.0.0-beta-006" />
<PackageReference Include="Cognite.Simulator.Utils" Version="1.0.0-beta-008" />
</ItemGroup>

<!-- Uncomment below to use libraries built locally -->
Expand Down
2 changes: 1 addition & 1 deletion Connector/Dwsim/DwsimClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
string propsDll = Path.Combine(config.Automation.DwsimInstallationPath, "DWSIM.FlowsheetBase.dll");
Assembly assembly = Assembly.LoadFrom(propsDll);
ResourceManager rm = new ResourceManager("DWSIM.FlowsheetBase.Properties", assembly);
_propMap = rm.GetResourceSet(CultureInfo.InvariantCulture, true, false)

Check warning on line 57 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'source' in 'IEnumerable<DictionaryEntry> Enumerable.Cast<DictionaryEntry>(IEnumerable source)'.

Check warning on line 57 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / build

The type 'string?' cannot be used as type parameter 'TKey' in the generic type or method 'Enumerable.ToDictionary<TSource, TKey, TElement>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>)'. Nullability of type argument 'string?' doesn't match 'notnull' constraint.

Check warning on line 57 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in value of type 'Dictionary<string?, string?>' doesn't match target type 'Dictionary<string, string>'.

Check warning on line 57 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Possible null reference argument for parameter 'source' in 'IEnumerable<DictionaryEntry> Enumerable.Cast<DictionaryEntry>(IEnumerable source)'.

Check warning on line 57 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

The type 'string?' cannot be used as type parameter 'TKey' in the generic type or method 'Enumerable.ToDictionary<TSource, TKey, TElement>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>)'. Nullability of type argument 'string?' doesn't match 'notnull' constraint.

Check warning on line 57 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Nullability of reference types in value of type 'Dictionary<string?, string?>' doesn't match target type 'Dictionary<string, string>'.

Check warning on line 57 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Possible null reference argument for parameter 'source' in 'IEnumerable<DictionaryEntry> Enumerable.Cast<DictionaryEntry>(IEnumerable source)'.

Check warning on line 57 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

The type 'string?' cannot be used as type parameter 'TKey' in the generic type or method 'Enumerable.ToDictionary<TSource, TKey, TElement>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>)'. Nullability of type argument 'string?' doesn't match 'notnull' constraint.

Check warning on line 57 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Nullability of reference types in value of type 'Dictionary<string?, string?>' doesn't match target type 'Dictionary<string, string>'.
.Cast<DictionaryEntry>().ToDictionary(x => x.Key.ToString(), x => x.Value.ToString());

Check warning on line 58 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in return type of 'lambda expression' doesn't match the target delegate 'Func<DictionaryEntry, string?>' (possibly because of nullability attributes).

Check warning on line 58 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 58 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Nullability of reference types in return type of 'lambda expression' doesn't match the target delegate 'Func<DictionaryEntry, string?>' (possibly because of nullability attributes).

Check warning on line 58 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Dereference of a possibly null reference.

Check warning on line 58 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Nullability of reference types in return type of 'lambda expression' doesn't match the target delegate 'Func<DictionaryEntry, string?>' (possibly because of nullability attributes).

Check warning on line 58 in Connector/Dwsim/DwsimClient.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Dereference of a possibly null reference.
_unitConverter = new UnitConverter(config.Automation.DwsimInstallationPath);
}

Expand Down Expand Up @@ -128,7 +128,7 @@

Dictionary<string, SimulatorValueItem> result = new Dictionary<string, SimulatorValueItem>();

var routine = new DwsimRoutine(routineRev, model, Server, inputData, _propMap, _unitConverter);
var routine = new DwsimRoutine(routineRev, model, Server, inputData, _propMap, _unitConverter, _logger);

result = routine.PerformSimulation();
return Task.FromResult(result);
Expand Down
6 changes: 4 additions & 2 deletions Connector/Dwsim/DwsimRoutine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

using Cognite.Simulator.Utils;
using CogniteSdk.Alpha;
using Microsoft.Extensions.Logging;

namespace Connector;

Expand All @@ -33,8 +34,9 @@
dynamic interf,
Dictionary<string, SimulatorValueItem> inputData,
Dictionary<string, string> propMap,
UnitConverter units) :
base(routineRevision, inputData)
UnitConverter units,
ILogger logger) :
base(routineRevision, inputData, logger)
{
_model = model;
_interface = interf;
Expand Down Expand Up @@ -263,11 +265,11 @@

private (string Name, string Property) GetObjectNameAndProperty(Dictionary<string, string> arguments)
{
if (!arguments.TryGetValue("objectProperty", out string objectProperty))

Check warning on line 268 in Connector/Dwsim/DwsimRoutine.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

Check warning on line 268 in Connector/Dwsim/DwsimRoutine.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Converting null literal or possible null value to non-nullable type.

Check warning on line 268 in Connector/Dwsim/DwsimRoutine.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Converting null literal or possible null value to non-nullable type.
{
throw new SimulationException($"Set error: Object property not defined");
}
if (!arguments.TryGetValue("objectName", out string objectName))

Check warning on line 272 in Connector/Dwsim/DwsimRoutine.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

Check warning on line 272 in Connector/Dwsim/DwsimRoutine.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Converting null literal or possible null value to non-nullable type.

Check warning on line 272 in Connector/Dwsim/DwsimRoutine.cs

View workflow job for this annotation

GitHub Actions / common / build-installer

Converting null literal or possible null value to non-nullable type.
{
throw new SimulationException($"Set error: Object name not defined");
}
Expand Down
10 changes: 10 additions & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ extractor:
image: logo.png

versions:
"1.0.0-alpha-121":
description: Multiple improvements
changelog:
added:
- "**Breaking** deleted model-library.state-store-interval configuration option. Use model-library.library-update-interval instead."
- "Added more debug logs on simulation routine base methods."
- "Increased default refresh interval for the model library and routine library to 10 seconds."
- "Increased the default timeout for the soft restart of the connector to 10 seconds after the failure."
fixed:
- "Fixed the issue where error during startup was being swallowed and connector would not be re-started after."
"1.0.0-alpha-120":
description: Minor improvements
changelog:
Expand Down
Loading