-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
791dcec
commit 2011c8d
Showing
7 changed files
with
160 additions
and
16 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
26 changes: 26 additions & 0 deletions
26
adapter/Modules/MTConnect.NET-AdapterModule-SHDR/README.md
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,26 @@ | ||
![MTConnect.NET Logo](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/dev/img/mtconnect-net-03-md.png) | ||
|
||
# MTConnect SHDR Adapter Module | ||
|
||
## Description | ||
This Adapter Module implements the SHDR Protocol to send data to an MTConnect Agent | ||
|
||
## Configuration | ||
```yaml | ||
- shdr: | ||
port: 7878 | ||
deviceKey: M12346 | ||
``` | ||
* `port` - The port number to read from. | ||
|
||
* `deviceKey` - The UUID or Name of the Device to send data for. | ||
|
||
|
||
## Contribution / Feedback | ||
- Please use the [Issues](https://github.com/TrakHound/MTConnect.NET/issues) tab to create issues for specific problems that you may encounter | ||
- Please feel free to use the [Pull Requests](https://github.com/TrakHound/MTConnect.NET/pulls) tab for any suggested improvements to the source code | ||
- For any other questions or feedback, please contact TrakHound directly at **[email protected]**. | ||
|
||
## License | ||
This application and it's source code is licensed under the [MIT License](https://choosealicense.com/licenses/mit/) and is free to use. |
15 changes: 15 additions & 0 deletions
15
clients/MTConnect.NET-Client-HTTP/MTConnect.NET-Client-HTTP.csproj
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,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>MTConnect.NET_Client_HTTP</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\libraries\MTConnect.NET-HTTP\MTConnect.NET-HTTP.csproj" /> | ||
<ProjectReference Include="..\..\libraries\MTConnect.NET-XML\MTConnect.NET-XML.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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 @@ | ||
namespace MTConnect.Clients.HTTP | ||
{ | ||
internal class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
DocumentClient(); | ||
EntityClient(); | ||
|
||
Console.ReadLine(); | ||
} | ||
|
||
static void DocumentClient() | ||
{ | ||
var client = new MTConnectHttpClient("localhost", 5000); | ||
|
||
client.ProbeReceived += (s, response) => | ||
{ | ||
Console.WriteLine(response.Devices.Count()); | ||
}; | ||
|
||
client.CurrentReceived += (s, response) => | ||
{ | ||
Console.WriteLine(response.Streams.Count()); | ||
}; | ||
|
||
client.SampleReceived += (s, response) => | ||
{ | ||
Console.WriteLine(response.Streams.Count()); | ||
}; | ||
|
||
client.AssetsReceived += (s, response) => | ||
{ | ||
Console.WriteLine(response.Assets.Count()); | ||
}; | ||
|
||
client.Start(); | ||
} | ||
|
||
static void EntityClient() | ||
{ | ||
var client = new MTConnectHttpClient("localhost", 5000); | ||
|
||
client.DeviceReceived += (s, device) => | ||
{ | ||
Console.WriteLine(device.Uuid); | ||
}; | ||
|
||
client.ObservationReceived += (s, observation) => | ||
{ | ||
Console.WriteLine(observation.Uuid); | ||
}; | ||
|
||
client.AssetReceived += (s, asset) => | ||
{ | ||
Console.WriteLine(asset.Uuid); | ||
}; | ||
|
||
client.Start(); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,19 +1,29 @@ | ||
using MTConnect.Shdr; | ||
|
||
var client = new ShdrClient("localhost", 7878); | ||
client.Connected += (s, e) => | ||
namespace MTConnect.Clients.SHDR | ||
{ | ||
Console.WriteLine("Connection Established"); | ||
}; | ||
client.ProtocolReceived += (s, line) => | ||
{ | ||
Console.WriteLine(line); | ||
}; | ||
client.Disconnected += (s, e) => | ||
{ | ||
Console.WriteLine("Disconnected"); | ||
}; | ||
client.Start(); | ||
internal class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var client = new ShdrClient("localhost", 7878); | ||
client.Connected += (s, e) => | ||
{ | ||
Console.WriteLine("Connection Established"); | ||
}; | ||
client.ProtocolReceived += (s, line) => | ||
{ | ||
Console.WriteLine(line); | ||
}; | ||
client.Disconnected += (s, e) => | ||
{ | ||
Console.WriteLine("Disconnected"); | ||
}; | ||
client.Start(); | ||
|
||
Console.ReadLine(); | ||
|
||
client.Stop(); | ||
client.Stop(); | ||
} | ||
} | ||
} |