diff --git a/MTConnect.NET.sln b/MTConnect.NET.sln index 0da2558b..f8015683 100644 --- a/MTConnect.NET.sln +++ b/MTConnect.NET.sln @@ -74,7 +74,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-AgentProcesso EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-AgentModule-MqttRelay", "agent\Modules\MTConnect.NET-AgentModule-MqttRelay\MTConnect.NET-AgentModule-MqttRelay.csproj", "{CB2E7F5A-55D5-43BD-ABC8-145E8436BE88}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-AgentModule-HttpAdapter", "agent\Modules\MTConnect.NET-AgentModule-HttpAdapter\MTConnect.NET-AgentModule-HttpAdapter.csproj", "{2104A3F5-A157-4763-8B90-38CD103D93D8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-AgentModule-HttpClientAdapter", "agent\Modules\MTConnect.NET-AgentModule-HttpAdapter\MTConnect.NET-AgentModule-HttpClientAdapter.csproj", "{2104A3F5-A157-4763-8B90-38CD103D93D8}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-AgentModule-HttpServer", "agent\Modules\MTConnect.NET-AgentModule-HttpServer\MTConnect.NET-AgentModule-HttpServer.csproj", "{7025F1F6-F914-4830-8171-30872F184918}" EndProject @@ -98,7 +98,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Clients", "Clients", "{4558 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-Client-SHDR", "clients\MTConnect.NET-Client-SHDR\MTConnect.NET-Client-SHDR.csproj", "{3B6E6874-ADB2-4C59-9E65-C13693466920}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTConnect.NET-Client-HTTP", "clients\MTConnect.NET-Client-HTTP\MTConnect.NET-Client-HTTP.csproj", "{619557F6-A8D5-4995-9D96-0E3174221FC6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MTConnect.NET-Client-HTTP", "clients\MTConnect.NET-Client-HTTP\MTConnect.NET-Client-HTTP.csproj", "{619557F6-A8D5-4995-9D96-0E3174221FC6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0712EA0C-EC0D-42EE-9CDD-148893A018F8}" + ProjectSection(SolutionItems) = preProject + README.md = README.md + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/README.md b/README.md index c698dbce..c338d106 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,35 @@ Other features of MTConnect.NET : - Full client support for requesting data from any MTConnect Agent (Probe, Current, Sample Stream, Assets, etc.). See [Clients](https://github.com/TrakHound/MTConnect.NET/tree/master/src/MTConnect.NET-HTTP/Clients/Rest) for more information. - (In-Progress) [Models](https://github.com/TrakHound/MTConnect.NET/tree/master/src/MTConnect.NET-Models/Models) framework for setting and accessing data using an object model as opposed to DataItem ID's and Types +## Download + +- [Agent Releases](https://github.com/TrakHound/MTConnect.NET/releases) +- [Adapter Source](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/adapter/MTConnect.NET-Adapter) +- [Nuget](https://www.nuget.org/packages/MTConnect.NET#readme-body-tab) + +## Usage + +### Create Agent +```c# +using MTConnect.Agents; + +var agent = new MTConnectAgent(); +``` + +### Create Adapter +```c# +using MTConnect.Adapters; + +var adapter = new ShdrAdapter(); +``` + +### Create Client +```c# +using MTConnect.Clients; + +var client = new MTConnectHttpClient(); +``` + ## Agent Applications #### Recommended (Windows / Linux) diff --git a/agent/MTConnect.NET-Applications-Agents/MTConnect.NET-Applications-Agents.csproj b/agent/MTConnect.NET-Applications-Agents/MTConnect.NET-Applications-Agents.csproj index d4f06f76..520df97c 100644 --- a/agent/MTConnect.NET-Applications-Agents/MTConnect.NET-Applications-Agents.csproj +++ b/agent/MTConnect.NET-Applications-Agents/MTConnect.NET-Applications-Agents.csproj @@ -69,7 +69,7 @@ - + diff --git a/agent/MTConnect.NET-Applications-Agents/MTConnectAgentApplication.cs b/agent/MTConnect.NET-Applications-Agents/MTConnectAgentApplication.cs index 57cfb1fa..c04344d9 100644 --- a/agent/MTConnect.NET-Applications-Agents/MTConnectAgentApplication.cs +++ b/agent/MTConnect.NET-Applications-Agents/MTConnectAgentApplication.cs @@ -627,7 +627,7 @@ protected virtual void OnPrintHelpArguments() { } private void ModuleLoaded(object sender, IMTConnectAgentModule module) { - _applicationLogger.Debug($"[Application] : Module Loaded : " + module.GetType().Name); + _applicationLogger.Info($"[Application] : Module Loaded : " + module.GetType().Name); } private void ModuleLogReceived(object sender, MTConnectLogLevel logLevel, string message) @@ -648,7 +648,7 @@ private void ModuleLogReceived(object sender, MTConnectLogLevel logLevel, string private void ProcessorLoaded(object sender, IMTConnectAgentProcessor processor) { - _applicationLogger.Debug($"[Application] : Processor Loaded : " + processor.GetType().Name); + _applicationLogger.Info($"[Application] : Processor Loaded : " + processor.GetType().Name); } private void DevicesRequested(string deviceName) diff --git a/agent/MTConnect.NET-Applications-Agents/NLog.config b/agent/MTConnect.NET-Applications-Agents/NLog.config index 0856c1ae..84a8abad 100644 --- a/agent/MTConnect.NET-Applications-Agents/NLog.config +++ b/agent/MTConnect.NET-Applications-Agents/NLog.config @@ -6,6 +6,10 @@ + + + - - + - - - @@ -31,17 +31,17 @@ + + + - - - - - + + diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/MTConnect.NET-AgentModule-HttpAdapter.csproj b/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/MTConnect.NET-AgentModule-HttpClientAdapter.csproj similarity index 100% rename from agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/MTConnect.NET-AgentModule-HttpAdapter.csproj rename to agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/MTConnect.NET-AgentModule-HttpClientAdapter.csproj diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/Module.cs b/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/Module.cs index ce2db9cf..4e623bd9 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/Module.cs +++ b/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/Module.cs @@ -18,7 +18,7 @@ namespace MTConnect.Modules { public class Module : MTConnectAgentModule { - public const string ConfigurationTypeId = "http-adapter"; + public const string ConfigurationTypeId = "http-client"; private readonly Logger _clientLogger = LogManager.GetLogger("http-adapter-logger"); private readonly HttpClientConfiguration _configuration; diff --git a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs index 67f530ad..c8cb038a 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs +++ b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs @@ -20,7 +20,7 @@ namespace MTConnect { public class Module : MTConnectAgentModule { - public const string ConfigurationTypeId = "mqtt2-relay"; + public const string ConfigurationTypeId = "mqtt-relay"; private readonly MTConnectMqttServer _server; private readonly ModuleConfiguration _configuration; diff --git a/agent/Processors/MTConnect.NET-AgentProcessor-Python/MTConnectPythonProcessor.cs b/agent/Processors/MTConnect.NET-AgentProcessor-Python/MTConnectPythonProcessor.cs index 240b4340..e034f048 100644 --- a/agent/Processors/MTConnect.NET-AgentProcessor-Python/MTConnectPythonProcessor.cs +++ b/agent/Processors/MTConnect.NET-AgentProcessor-Python/MTConnectPythonProcessor.cs @@ -49,12 +49,16 @@ private void Load() lock (_lock) _functions.Clear(); var dir = GetDirectory(); - var files = Directory.GetFiles(dir, $"*{_defaultExtension}"); - if (!files.IsNullOrEmpty()) + if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); + if (Directory.Exists(dir)) { - foreach (var file in files) + var files = Directory.GetFiles(dir, $"*{_defaultExtension}"); + if (!files.IsNullOrEmpty()) { - LoadEngine(file); + foreach (var file in files) + { + LoadEngine(file); + } } } } diff --git a/libraries/MTConnect.NET-MQTT/MTConnectMqttServer.cs b/libraries/MTConnect.NET-MQTT/MTConnectMqttServer.cs index cd002842..a7daa8ba 100644 --- a/libraries/MTConnect.NET-MQTT/MTConnectMqttServer.cs +++ b/libraries/MTConnect.NET-MQTT/MTConnectMqttServer.cs @@ -48,7 +48,6 @@ public void Start() var response = _mtconnectAgent.GetDevicesResponseDocument(device.Uuid); if (response != null) { - Console.WriteLine($"Probe : {device.Uuid}"); if (ProbeReceived != null) ProbeReceived.Invoke(device, response); } } @@ -78,7 +77,6 @@ private async Task CurrentWorker() var response = _mtconnectAgent.GetDeviceStreamsResponseDocument(device.Uuid); if (response != null) { - Console.WriteLine($"Current : {device.Uuid}"); if (CurrentReceived != null) CurrentReceived.Invoke(device, response); } } @@ -108,7 +106,6 @@ private async Task SampleWorker() var response = _mtconnectAgent.GetDeviceStreamsResponseDocument(device.Uuid, _lastSequence, -1, 1000); // COUNT = 1000 ?? if (response != null && response.ObservationCount > 0) { - Console.WriteLine($"Sample : {device.Uuid} : {_lastSequence}"); if (SampleReceived != null) SampleReceived.Invoke(device, response); if (response.LastObservationSequence >= lastSequence) lastSequence = response.LastObservationSequence + 1; } @@ -132,8 +129,6 @@ private void DeviceAdded(object sender, IDevice device) var response = _mtconnectAgent.GetDevicesResponseDocument(device.Uuid); if (response != null) { - Console.WriteLine("Probe"); - if (ProbeReceived != null) ProbeReceived.Invoke(device, response); } }