-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added 2.2 DataItems & Components - Added support for Device and Asset Hash property (this replaces the MD5 ChangeId property previously used) - Added ImageFile configuration - Added ComponentConfigurationParameters Asset - Fixed a few minor issues found during updating
- Loading branch information
1 parent
0099cc5
commit 4b07b66
Showing
57 changed files
with
1,510 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...T-Common/Assets/ComponentConfigurationParameters/ComponentConfigurationParametersAsset.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (c) 2023 TrakHound Inc., All Rights Reserved. | ||
// TrakHound Inc. licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
using System.Xml.Serialization; | ||
|
||
namespace MTConnect.Assets.ComponentConfigurationParameters | ||
{ | ||
/// <summary> | ||
/// Set of parameters that govern the functionality of the related Component | ||
/// </summary> | ||
[XmlRoot("ComponentConfigurationParameters")] | ||
public class ComponentConfigurationParametersAsset : Asset | ||
{ | ||
public const string TypeId = "ComponentConfigurationParameters"; | ||
|
||
|
||
/// <summary> | ||
/// Destinations organizes one or more Destination elements. | ||
/// </summary> | ||
[XmlArray("ParameterSets")] | ||
[XmlArrayItem("ParameterSet", typeof(ParameterSet))] | ||
[JsonPropertyName("parameterSets")] | ||
public List<ParameterSet> ParameterSets { get; set; } | ||
|
||
[XmlIgnore] | ||
public bool ParameterSetsSpecified => !ParameterSets.IsNullOrEmpty(); | ||
|
||
|
||
public ComponentConfigurationParametersAsset() | ||
{ | ||
Type = TypeId; | ||
} | ||
|
||
|
||
protected override IAsset OnProcess(Version mtconnectVersion) | ||
{ | ||
if (mtconnectVersion != null && mtconnectVersion >= MTConnectVersions.Version22) | ||
{ | ||
return this; | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public override AssetValidationResult IsValid(Version mtconnectVersion) | ||
{ | ||
var message = ""; | ||
var result = true; | ||
|
||
if (ParameterSets.IsNullOrEmpty()) | ||
{ | ||
message = "At least one ParameterSet is Required"; | ||
result = false; | ||
} | ||
|
||
return new AssetValidationResult(result, message); | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
src/MTConnect.NET-Common/Assets/ComponentConfigurationParameters/Parameter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright (c) 2023 TrakHound Inc., All Rights Reserved. | ||
// TrakHound Inc. licenses this file to you under the MIT license. | ||
|
||
using System.Text.Json.Serialization; | ||
using System.Xml; | ||
using System.Xml.Serialization; | ||
|
||
namespace MTConnect.Assets.ComponentConfigurationParameters | ||
{ | ||
/// <summary> | ||
/// Property defining a configuration of a Component | ||
/// </summary> | ||
public class Parameter | ||
{ | ||
/// <summary> | ||
/// Internal identifier, register, or address. | ||
/// </summary> | ||
[XmlAttribute("identifier")] | ||
[JsonPropertyName("identifier")] | ||
public string Identifier { get; set; } | ||
|
||
/// <summary> | ||
/// Descriptive name. | ||
/// </summary> | ||
[XmlAttribute("name")] | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Minimal allowed value. | ||
/// </summary> | ||
[XmlAttribute("minimum")] | ||
[JsonPropertyName("minimum")] | ||
public string Minimum { get; set; } | ||
|
||
/// <summary> | ||
/// Maximum allowed value. | ||
/// </summary> | ||
[XmlAttribute("maximum")] | ||
[JsonPropertyName("maximum")] | ||
public string Maximum { get; set; } | ||
|
||
/// <summary> | ||
/// Nominal value. | ||
/// </summary> | ||
[XmlAttribute("nominal")] | ||
[JsonPropertyName("nominal")] | ||
public string Nominal { get; set; } | ||
|
||
/// <summary> | ||
/// Configured value. | ||
/// </summary> | ||
[XmlAttribute("value")] | ||
[JsonPropertyName("value")] | ||
public string Value { get; set; } | ||
|
||
/// <summary> | ||
/// Engineering units. Units SHOULD be SI or MTConnect Units(See UnitEnum). | ||
/// </summary> | ||
[XmlAttribute("units")] | ||
[JsonPropertyName("units")] | ||
public string Units { get; set; } | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/MTConnect.NET-Common/Assets/ComponentConfigurationParameters/ParameterSet.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) 2023 TrakHound Inc., All Rights Reserved. | ||
// TrakHound Inc. licenses this file to you under the MIT license. | ||
|
||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
using System.Xml; | ||
using System.Xml.Serialization; | ||
|
||
namespace MTConnect.Assets.ComponentConfigurationParameters | ||
{ | ||
/// <summary> | ||
/// Set of parameters defining the configuration of a Component | ||
/// </summary> | ||
public class ParameterSet | ||
{ | ||
/// <summary> | ||
/// Set of parameters defining the configuration of a Component | ||
/// </summary> | ||
[XmlAttribute("name")] | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Destinations organizes one or more Destination elements. | ||
/// </summary> | ||
[XmlArray("Parameters")] | ||
[XmlArrayItem("Parameter", typeof(Parameter))] | ||
[JsonPropertyName("parameters")] | ||
public List<ParameterSet> Parameters { get; set; } | ||
|
||
[XmlIgnore] | ||
public bool ParametersSpecified => !Parameters.IsNullOrEmpty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.