-
-
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.
- Loading branch information
1 parent
6fdc255
commit 29025f5
Showing
21 changed files
with
582 additions
and
76 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
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
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
73 changes: 73 additions & 0 deletions
73
src/MTConnect.NET-Common/Assets/RawMaterials/RawMaterialAsset.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,73 @@ | ||
// 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; | ||
|
||
namespace MTConnect.Assets.RawMaterials | ||
{ | ||
public partial class RawMaterialAsset | ||
{ | ||
public const string TypeId = "RawMaterial"; | ||
|
||
|
||
public RawMaterialAsset() | ||
{ | ||
Type = TypeId; | ||
} | ||
|
||
|
||
//protected override IAsset OnProcess(Version mtconnectVersion) | ||
//{ | ||
// if (mtconnectVersion != null && mtconnectVersion >= MTConnectVersions.Version18) | ||
// { | ||
// return this; | ||
// } | ||
|
||
// return null; | ||
//} | ||
|
||
//public override AssetValidationResult IsValid(Version mtconnectVersion) | ||
//{ | ||
// var message = ""; | ||
// var result = true; | ||
|
||
// if (string.IsNullOrEmpty(Form)) | ||
// { | ||
// message = "Form property is Required"; | ||
// result = false; | ||
// } | ||
// else | ||
// { | ||
// if (Material != null && string.IsNullOrEmpty(Material.Type)) | ||
// { | ||
// message = "Material Type property is Required"; | ||
// result = false; | ||
// } | ||
// } | ||
|
||
// return new AssetValidationResult(result, message); | ||
//} | ||
|
||
//public override string GenerateHash() | ||
//{ | ||
// return GenerateHash(this); | ||
//} | ||
|
||
//public static string GenerateHash(FileAsset asset) | ||
//{ | ||
// if (asset != null) | ||
// { | ||
// var ids = new List<string>(); | ||
|
||
// ids.Add(ObjectExtensions.GetHashPropertyString(asset).ToSHA1Hash()); | ||
|
||
// // Need to include CuttingItems | ||
|
||
// return StringFunctions.ToSHA1Hash(ids.ToArray()); | ||
// } | ||
|
||
// return null; | ||
//} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright (c) 2023 TrakHound Inc., All Rights Reserved. | ||
// TrakHound Inc. licenses this file to you under the MIT license. | ||
|
||
using System.Text.RegularExpressions; | ||
|
||
namespace MTConnect | ||
{ | ||
public class Millimeter3D | ||
{ | ||
private static readonly Regex _regex = new Regex(@"([0-9\.]*) ([0-9\.]*) ([0-9\.]*)"); | ||
|
||
|
||
public double X { get; set; } | ||
|
||
public double Y { get; set; } | ||
|
||
public double Z { get; set; } | ||
|
||
|
||
public Millimeter3D(double x, double y, double z) | ||
{ | ||
X = x; | ||
Y = y; | ||
Z = z; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $"{X} {Y} {Z}"; | ||
} | ||
|
||
public static Millimeter3D FromString(string input) | ||
{ | ||
if (!string.IsNullOrEmpty(input)) | ||
{ | ||
var match = _regex.Match(input); | ||
if (match.Success) | ||
{ | ||
double x = 0; | ||
double y = 0; | ||
double z = 0; | ||
|
||
if (match.Groups[1].Success) x = match.Groups[1].Value.ToDouble(); | ||
if (match.Groups[2].Success) y = match.Groups[2].Value.ToDouble(); | ||
if (match.Groups[3].Success) z = match.Groups[3].Value.ToDouble(); | ||
|
||
return new Millimeter3D(x, y, z); | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
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.