Skip to content

Commit

Permalink
Update 6.3.2
Browse files Browse the repository at this point in the history
- Updated ReadMe files
- Added DotNet CLI template project
  • Loading branch information
PatrickRitchie committed May 2, 2024
1 parent 4740f36 commit a980444
Show file tree
Hide file tree
Showing 17 changed files with 384 additions and 41 deletions.
13 changes: 13 additions & 0 deletions MTConnect.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-Client-SHDR",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-Agent-Embedded", "examples\MTConnect.NET-Agent-Embedded\MTConnect.NET-Agent-Embedded.csproj", "{24C98CF3-CC93-4696-A036-8FD1E16F2E7E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{D7873DF2-16DB-4B19-A100-C0089DF37488}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Agent", "templates\mtconnect.net-agent\content\MTConnect.NET-Embedded-Agent\Agent.csproj", "{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -401,6 +405,14 @@ Global
{24C98CF3-CC93-4696-A036-8FD1E16F2E7E}.Package|Any CPU.Build.0 = Debug|Any CPU
{24C98CF3-CC93-4696-A036-8FD1E16F2E7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24C98CF3-CC93-4696-A036-8FD1E16F2E7E}.Release|Any CPU.Build.0 = Release|Any CPU
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Docker|Any CPU.ActiveCfg = Debug|Any CPU
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Docker|Any CPU.Build.0 = Debug|Any CPU
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Package|Any CPU.ActiveCfg = Debug|Any CPU
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Package|Any CPU.Build.0 = Debug|Any CPU
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -444,6 +456,7 @@ Global
{5F1E0B6F-FFD6-4E6C-88BF-B9B0F5574BDE} = {FFF032D3-7446-4CAF-A3E3-CF9C4E1A5DCC}
{A9DF36FC-4EF7-4BFB-B47D-F1C10227631A} = {FFF032D3-7446-4CAF-A3E3-CF9C4E1A5DCC}
{24C98CF3-CC93-4696-A036-8FD1E16F2E7E} = {FFF032D3-7446-4CAF-A3E3-CF9C4E1A5DCC}
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3} = {D7873DF2-16DB-4B19-A100-C0089DF37488}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CC13D3AD-18BF-4695-AB2A-087EF0885B20}
Expand Down
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![MTConnect.NET](https://github.com/TrakHound/MTConnect.NET/actions/workflows/dotnet.yml/badge.svg)](https://github.com/TrakHound/MTConnect.NET/actions/workflows/dotnet.yml)

> 12/4/2023 : Version 6.0 Released with new Agent, Adapter, & SysML Import
> 5/1/2024 : Version 6.4 Released with new Agent, Adapter, & SysML Import
## Download
<table>
Expand Down Expand Up @@ -95,17 +95,31 @@ A live demo of the MTConnect Gateway HTTP Agent (AspNetCore) application is runn

## Agents

#### Module Agent Application
A preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/agent/MTConnect.NET-Agent) & [Library](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/agent/MTConnect.NET-Applications-Agents) to build an Agent is available and supports:
#### Embedded Agent Application
An MTConnect Agent can be embedded into an application where the DataSource(s) can be read and the MTConnect Agent can be combined into the same application. This eliminates the need to transfer data from an Adapter to an Agent (typically using the SHDR protocol).

##### Option #1 : [DotNet Template](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0)
```
dotnet new mtconnect.net-agent
```

##### Option #2 : [Nuget Package](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0)
```
dotnet add package MTConnect.NET-Applications-Agents
```

#### Standalone Agent Application
A standalone preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/agent/MTConnect.NET-Agent) ready to download is available and supports:
- Modular architecture
- HTTP Server Module
- SHDR Adapter Module(s)
- SHDR Adapter Module
- MQTT Broker Module
- MQTT Relay Module
- etc.
- Easy Windows Installer
- Linux Compatible
- Run as a Windows Service
- Transform input data using Python scripts
- Extensible configuration file and monitors for changes

#### Agent Classes
Expand All @@ -114,7 +128,7 @@ A preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/ve

## Adapters

#### Modular Adapter Application
#### Standalone Modular Adapter Application
A preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/adapter/MTConnect.NET-Adapter) & [Library](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/adapter/MTConnect.NET-Applications-Adapter) to build an Adapter is available and supports:
- Modular architecture
- SHDR Module (export data to an MTConnect Agent using the SHDR protocol)
Expand Down
58 changes: 29 additions & 29 deletions agent/MTConnect.NET-Agent/agent.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,32 @@ modules:
- path: styles/favicon.ico
location: favicon.ico

- http-server: # - Add HTTP Server module
port: 5001
indentOutput: true
documentFormat: xml
accept:
text/xml: xml
application/json: json
responseCompression:
- gzip
- br
tls:
# pfx:
# certificatePath: c:\test-cert\trakhound.pfx
# certificatePassword: trakhound
pem:
certificateAuthority: c:\test-cert\rootCA.crt
certificatePath: c:\test-cert\trakhound.crt
privateKeyPath: c:\test-cert\trakhound.key
privateKeyPassword: trakhound
files:
- path: schemas
location: schemas
- path: styles
location: styles
- path: styles/favicon.ico
location: favicon.ico
# - http-server: # - Add HTTP Server module
# port: 5001
# indentOutput: true
# documentFormat: xml
# accept:
# text/xml: xml
# application/json: json
# responseCompression:
# - gzip
# - br
# tls:
# # pfx:
# # certificatePath: c:\test-cert\trakhound.pfx
# # certificatePassword: trakhound
# pem:
# certificateAuthority: c:\test-cert\rootCA.crt
# certificatePath: c:\test-cert\trakhound.crt
# privateKeyPath: c:\test-cert\trakhound.key
# privateKeyPassword: trakhound
# files:
# - path: schemas
# location: schemas
# - path: styles
# location: styles
# - path: styles/favicon.ico
# location: favicon.ico

# - mqtt-broker: # - Add MQTT Broker module (Document Structure)
# port: 1883
Expand Down Expand Up @@ -114,16 +114,16 @@ modules:

- shdr-adapter: # - Add SHDR Adapter module for Device = Okuma and Port = 7878
deviceKey: Okuma
hostname: localhost
# hostname: localhost
port: 7878
heartbeat: 1000
reconnectInterval: 1000
connectionTimeout: 1000

- shdr-adapter: # - Add SHDR Adapter module for Device = Mazak and Port = 7879
deviceKey: Mazak
hostname: localhost
port: 7878
# hostname: localhost
port: 7879
heartbeat: 1000
reconnectInterval: 1000
connectionTimeout: 1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This Agent Module writes data to an **External** MQTT Broker
```yaml
- mqtt-relay:
server: localhost
port: 7878
port: 1883
topic: enterprise/site/area/line/cell/MTConnect
topicStructure: Document
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This Agent Module writes data to an **External** MQTT Broker
```yaml
- mqtt-relay:
server: localhost
port: 7878
port: 1883
topic: enterprise/site/area/line/cell/MTConnect
topicStructure: Document
```
Expand Down
13 changes: 13 additions & 0 deletions agent/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Standalone MTConnect Agent
> https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/agent/MTConnect.NET-Agent
A standalone preconfigured application ready to download is available and supports:
- Modular architecture
- HTTP Server Module
- SHDR Adapter Module
- MQTT Broker Module
- MQTT Relay Module
- etc.
- Easy Windows Installer
- Linux Compatible
- Run as a Windows Service
- Transform input data using Python scripts
- Extensible configuration file and monitors for changes

# Embedded MTConnect Agent
An MTConnect Agent can be embedded into an application where the DataSource(s) can be read and the MTConnect Agent can be combined into the same application. This eliminates the need to transfer data from an Adapter to an Agent (typically using the SHDR protocol).

Expand Down
4 changes: 2 additions & 2 deletions build/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Reflection;

[assembly: AssemblyVersion("6.3.1")]
[assembly: AssemblyFileVersion("6.3.1")]
[assembly: AssemblyVersion("6.3.2")]
[assembly: AssemblyFileVersion("6.3.2")]
[assembly: AssemblyCompany("TrakHound Inc.")]
[assembly: AssemblyCopyright("Copyright (c) 2024 TrakHound Inc., All Rights Reserved.")]
4 changes: 2 additions & 2 deletions examples/MTConnect.NET-Agent-Embedded/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class ModuleConfiguration
// This is the module that runs your code
public class Module : MTConnectInputAgentModule
{
public const string ConfigurationTypeId = "demo"; // This must match the module section in the 'agent.config.yaml' file
public const string DefaultId = "Demo Module"; // The ID is mainly just used for logging.
public const string ConfigurationTypeId = "datasource"; // This must match the module section in the 'agent.config.yaml' file
public const string DefaultId = "DataSource Module"; // The ID is mainly just used for logging.
private readonly ModuleConfiguration _configuration;


Expand Down
2 changes: 1 addition & 1 deletion examples/MTConnect.NET-Agent-Embedded/agent.config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
modules:

- demo:
- datasource:
deviceUuid: 7E647B2D-C6A3-40BF-9CE9-FB09834850C9
deviceName: dev-001
serialNumber: 123456
Expand Down
45 changes: 45 additions & 0 deletions templates/mtconnect.net-agent/MTConnect-NET-Agent-Template.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- The package metadata. Fill in the properties marked as TODO below -->
<!-- Follow the instructions on https://learn.microsoft.com/en-us/nuget/create-packages/package-authoring-best-practices -->
<PackageId>MTConnect.NET-Agent-Template</PackageId>
<PackageVersion>1.0.4</PackageVersion>
<Title>MTConnect.NET Agent Template</Title>
<Authors>trakhound</Authors>
<Description>Template to create an embedded MTConnect Agent using the MTConnect.NET project</Description>
<PackageTags>mtconnect agent dotnet</PackageTags>
<PackageProjectUrl>www.TrakHound.com</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/TrakHound/MTConnect.NET/version-6.0/img/mtconnect-net-03-nuget.png</PackageIconUrl>
<PackageLicenceExpression>MIT</PackageLicenceExpression>
<RepositoryUrl>https://github.com/TrakHound/MTConnect.NET</RepositoryUrl>

<!-- Keep package type as 'Template' to show the package as a template package on nuget.org and make your template available in dotnet new search.-->
<PackageType>Template</PackageType>
<TargetFramework>net8.0</TargetFramework>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<NoDefaultExcludes>true</NoDefaultExcludes>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup>
<LocalizeTemplates>false</LocalizeTemplates>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.TemplateEngine.Tasks" Version="*" PrivateAssets="all" IsImplicitlyDefined="true"/>
</ItemGroup>

<ItemGroup>
<Content Include="content\**\*" Exclude="content\**\bin\**;content\**\obj\**" />
<Compile Remove="**\*" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
41 changes: 41 additions & 0 deletions templates/mtconnect.net-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# MTConnect.NET-Agent-Template
An MTConnect Agent can be embedded into an application where the DataSource(s) can be read and the MTConnect Agent can be combined into the same application. This eliminates the need to transfer data from an Adapter to an Agent (typically using the SHDR protocol).

## Setup

#### Install Template
Use the **[dotnet CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/)** to install the MTConnect.NET-Agent-Template using the below command:
```
dotnet new install MTConnect.NET-Agent-Template
```

#### Create New Project
This will create a new project using the template in the current working directory
```
dotnet new mtconnect.net-agent
```

## Build & Develop

#### dotnet CLI
Use the **[dotnet CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/)** to build the project using the below command:
```
dotnet build -c:Debug
```

#### Run
```
dotnet run -c:Debug
```

## Create Installer
Use the **[dotnet CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/)** to build the project using the *Release** configuration using the below command:
```
dotnet build -c:Release
```

#### Install InnoSetup (if not already installed)
information - https://jrsoftware.org/isinfo.php
download - https://jrsoftware.org/isdl.php#stable


Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "TrakHound Inc.",
"classifications": [ "Common", "Console" ],
"identity": "MTConnect.NET-Agent-Template",
"name": "Template to create an embedded MTConnect Agent using the MTConnect.NET project",
"shortName": "mtconnect.net-agent",
"sourceName":"MTConnect.NET-Agent-Template",
"tags": {
"language": "C#",
"type": "project"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetFrameworks>net8.0</TargetFrameworks>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetFrameworks>net461;net48;net6.0;net7.0;net8.0</TargetFrameworks>
<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<AssemblyName>agent</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MTConnect.NET-Applications-Agents" Version="6.3.1-beta" />
</ItemGroup>

<ItemGroup>
<None Update="agent.config.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading

0 comments on commit a980444

Please sign in to comment.