Skip to content

Commit

Permalink
Upgrade packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
randy-armstrong committed Apr 18, 2024
1 parent 71ae8eb commit e50090e
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 58 deletions.
21 changes: 21 additions & 0 deletions Opc.Ua.ModelCompiler/ModelCompilerApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,27 @@ private static void LoadNodeSet(FileInfo file, Dictionary<string, NodeSetInfo> n
{
SystemContext context = new SystemContext();
Opc.Ua.Export.UANodeSet nodeset = Opc.Ua.Export.UANodeSet.Read(istrm);

context.NamespaceUris = new NamespaceTable();

if (nodeset.NamespaceUris != null)
{
foreach (var item in nodeset.NamespaceUris)
{
context.NamespaceUris.GetIndexOrAppend(item);
}
}

context.ServerUris = new StringTable();

if (nodeset.ServerUris != null)
{
foreach (var item in nodeset.ServerUris)
{
context.ServerUris.GetIndexOrAppend(item);
}
}

var collection = new NodeStateCollection();

try
Expand Down
19 changes: 15 additions & 4 deletions Opc.Ua.ModelCompiler/ModelDesignerValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ public void ValidateCoreModel(IList<string> designFilePaths, string identifierFi

if (!String.IsNullOrEmpty(ModelPublicationDate))
{
var dt = DateTime.Parse(ModelPublicationDate, null, DateTimeStyles.None);
var dt = DateTime.Parse(ModelPublicationDate, CultureInfo.InvariantCulture, DateTimeStyles.None);
dictionary.TargetPublicationDate = new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0, DateTimeKind.Utc);
dictionary.TargetPublicationDateSpecified = true;
}
Expand All @@ -1181,7 +1181,7 @@ public void ValidateCoreModel(IList<string> designFilePaths, string identifierFi

if (ns.Value != dictionary.TargetNamespace)
{
DateTime? pd = (ns.PublicationDate != null) ? DateTime.Parse(ns.PublicationDate, null, DateTimeStyles.None) : null;
DateTime? pd = (ns.PublicationDate != null) ? DateTime.Parse(ns.PublicationDate, CultureInfo.InvariantCulture, DateTimeStyles.None) : null;

var requiredModel = new Export.ModelTableEntry()
{
Expand Down Expand Up @@ -1435,7 +1435,7 @@ public void ValidateModel(IList<string> designFilePaths, string identifierFilePa

if (!String.IsNullOrEmpty(ModelPublicationDate))
{
var dt = DateTime.Parse(ModelPublicationDate, null, DateTimeStyles.None);
var dt = DateTime.Parse(ModelPublicationDate, CultureInfo.InvariantCulture, DateTimeStyles.None);
targetModel.TargetPublicationDate = new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0, DateTimeKind.Utc);
targetModel.TargetPublicationDateSpecified = true;
}
Expand Down Expand Up @@ -1465,7 +1465,7 @@ public void ValidateModel(IList<string> designFilePaths, string identifierFilePa
ns.FilePath = dependency.FilePath;
}

DateTime? pd = (ns.PublicationDate != null) ? DateTime.Parse(ns.PublicationDate, null, DateTimeStyles.None) : null;
DateTime? pd = (ns.PublicationDate != null) ? DateTime.Parse(ns.PublicationDate, CultureInfo.InvariantCulture, DateTimeStyles.None) : null;

var requiredModel = new Export.ModelTableEntry()
{
Expand Down Expand Up @@ -2521,7 +2521,18 @@ private IDictionary<object, IdInfo> LoadIdentifiersFromStream2(ModelDesign dicti
/// </summary>
private void LoadIdentifiersFromFile2(ModelDesign dictionary, string filePath)
{
if (String.IsNullOrEmpty(filePath) || !File.Exists(filePath))
{
throw new FileNotFoundException("The identifier file does not exist.", filePath);
}

var file = new FileInfo(filePath);

if (!file.Directory.Exists)
{
file.Directory.Create();
}

IDictionary<object, IdInfo> uniqueIdentifiers;

using (var istrm = File.Open(file.FullName, FileMode.Open))
Expand Down
2 changes: 1 addition & 1 deletion Opc.Ua.ModelCompiler/Opc.Ua.ModelCompiler.Debug.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="31.0.2" />
<PackageReference Include="CsvHelper" Version="31.0.4" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.14" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.14" />
Expand Down
4 changes: 2 additions & 2 deletions Opc.Ua.ModelCompiler/Opc.Ua.ModelCompiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="31.0.2" />
<PackageReference Include="CsvHelper" Version="31.0.4" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.14" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core" Version="1.5.373.121" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core" Version="1.5.374.36" />
</ItemGroup>

</Project>
100 changes: 51 additions & 49 deletions Opc.Ua.ModelCompiler/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
{
if (System.Diagnostics.Debugger.IsAttached)
{
string[] args2 = {
"compile",
"-d2",
@"D:\Work\OPC\UA-ModelCompiler\Opc.Ua.ModelCompiler\Design.v105\StandardTypes.xml",
"-d2",
@"D:\Work\OPC\UA-ModelCompiler\Opc.Ua.ModelCompiler\Design.v105\UA Core Services.xml",
"-version",
"v105",
"-exclude",
"Draft",
"-c",
@"D:\Work\OPC\UA-ModelCompiler\Opc.Ua.ModelCompiler\CSVs\StandardTypes.csv",
"-o2",
@"D:\Work\OPC\nodesets\v105\Schema\",
"-stack",
@"D:\Work\OPC\nodesets\v105\DotNet\",
"-ansic",
@"D:\Work\OPC\nodesets\v105\AnsiC\",
"-mv",
"1.05.03",
"-pd",
"2023-11-15"
};
//string[] args2 = {
// "compile",
// "-d2",
// @"D:\Work\OPC\UA-ModelCompiler\Opc.Ua.ModelCompiler\Design.v105\StandardTypes.xml",
// "-d2",
// @"D:\Work\OPC\UA-ModelCompiler\Opc.Ua.ModelCompiler\Design.v105\UA Core Services.xml",
// "-version",
// "v105",
// "-exclude",
// "Draft",
// "-c",
// @"D:\Work\OPC\UA-ModelCompiler\Opc.Ua.ModelCompiler\CSVs\StandardTypes.csv",
// "-o2",
// @"D:\Work\OPC\nodesets\v105\Schema\",
// "-stack",
// @"D:\Work\OPC\nodesets\v105\DotNet\",
// "-ansic",
// @"D:\Work\OPC\nodesets\v105\AnsiC\",
// "-mv",
// "1.05.03",
// "-pd",
// "2023-11-15"
//};

//string[] args2 = {
// "compile",
Expand Down Expand Up @@ -109,19 +109,19 @@
//};

//string[] args2 = {
// "compile",
// "-d2",
// @"D:\Work\OPC\UA-ModelCompiler\Opc.Ua.ModelCompiler\Design.v105\I4AAS.DigitalNameplate.xml",
// "-d2",
// @"D:\Work\OPC\UA-ModelCompiler\Opc.Ua.ModelCompiler\Design.v105\I4AAS.IRDI.References.xml",
// "-version",
// "v105",
// "-exclude",
// "Draft",
// "-c",
// @"D:\Work\OPC\UA-ModelCompiler\Opc.Ua.ModelCompiler\CSVs\I4AAS.csv",
// "-o2",
// @"D:\Work\OPC\UA-ModelCompiler\Tests\DemoModel\I4AAS"
//"compile",
//"-d2",
//@"I4AAS.DigitalNameplate.xml",
//"-d2",
//@"I4AAS.IRDI.References.xml",
//"-version",
//"v105",
//"-exclude",
//"Draft",
//"-c",
//@"I4AAS.csv",
//"-o2",
//@"I4AAS"
//};

//string[] args2 = {
Expand All @@ -143,26 +143,28 @@
//string[] args2 = {
// "compile",
// "-d2",
// @"D:\Work\OPC\UA-ModelCompiler\StructuresWithArrays.Nodeset2\StructuresWithArrays.Nodeset2.xml,StructuresWithArrays,StructuresWithArrays",
// @"D:\Work\OPC\UA-ModelCompiler-Public\Opc.Ua.ModelCompiler\Design.v105\XMLFile1.xml",
// "-cg",
// @"D:\Work\OPC\UA-ModelCompiler-Public\Tests\DemoModel\Models\TestsModel.csv",
// "-version",
// "v105",
// "-exclude",
// "Draft",
// "-o2",
// @"D:\Work\OPC\UA-ModelCompiler\Tests\DemoModel\Models"
// @"D:\Work\OPC\UA-ModelCompiler-Public\Tests\DemoModel\Models"
//};

//string[] args2 = {
// "compile-nodesets",
// "-input",
// @"D:\Work\OPC\nodesets\v105\",
// "-o2",
// @"D:\Work\OPC\UA-ModelCompiler\Tests\DemoModel\Models",
// "-uri",
// @"http://opcfoundation.org/UA/Machinery/",
// "-prefix",
// "UAModel.Machinery",
//};
string[] args2 = {
"compile-nodesets",
"-input",
@"D:\Work\OPC\UA-ModelCompiler-Public\NodeSet",
"-o2",
@"D:\Work\OPC\UA-ModelCompiler-Public\Tests\DemoModel\Models",
"-uri",
@"http://limula.ch/SensingModule/",
"-prefix",
"UAModel.SensingModule",
};

ModelCompilerApplication.Run(args2);
return;
Expand Down
4 changes: 2 additions & 2 deletions Tests/DemoModel/DemoModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core" Version="1.5.373.121" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.373.121" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core" Version="1.5.374.36" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.374.36" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit e50090e

Please sign in to comment.