Skip to content

Commit c1aa396

Browse files
Revert "Updating"
This reverts commit 02b5cee.
1 parent 02b5cee commit c1aa396

116 files changed

Lines changed: 18 additions & 12110 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MTConnect.NET.sln

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{
117117
EndProject
118118
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Agent", "templates\mtconnect.net-agent\content\MTConnect.NET-Embedded-Agent\Agent.csproj", "{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}"
119119
EndProject
120-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTConnect.NET-XML-2", "libraries\MTConnect.NET-XML-2\MTConnect.NET-XML-2.csproj", "{A0B626A0-5AD5-4110-9BF6-147E304D1FE6}"
121-
EndProject
122120
Global
123121
GlobalSection(SolutionConfigurationPlatforms) = preSolution
124122
Debug|Any CPU = Debug|Any CPU
@@ -415,14 +413,6 @@ Global
415413
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Package|Any CPU.Build.0 = Debug|Any CPU
416414
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
417415
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3}.Release|Any CPU.Build.0 = Release|Any CPU
418-
{A0B626A0-5AD5-4110-9BF6-147E304D1FE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
419-
{A0B626A0-5AD5-4110-9BF6-147E304D1FE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
420-
{A0B626A0-5AD5-4110-9BF6-147E304D1FE6}.Docker|Any CPU.ActiveCfg = Debug|Any CPU
421-
{A0B626A0-5AD5-4110-9BF6-147E304D1FE6}.Docker|Any CPU.Build.0 = Debug|Any CPU
422-
{A0B626A0-5AD5-4110-9BF6-147E304D1FE6}.Package|Any CPU.ActiveCfg = Package|Any CPU
423-
{A0B626A0-5AD5-4110-9BF6-147E304D1FE6}.Package|Any CPU.Build.0 = Package|Any CPU
424-
{A0B626A0-5AD5-4110-9BF6-147E304D1FE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
425-
{A0B626A0-5AD5-4110-9BF6-147E304D1FE6}.Release|Any CPU.Build.0 = Release|Any CPU
426416
EndGlobalSection
427417
GlobalSection(SolutionProperties) = preSolution
428418
HideSolutionNode = FALSE
@@ -467,7 +457,6 @@ Global
467457
{A9DF36FC-4EF7-4BFB-B47D-F1C10227631A} = {FFF032D3-7446-4CAF-A3E3-CF9C4E1A5DCC}
468458
{24C98CF3-CC93-4696-A036-8FD1E16F2E7E} = {FFF032D3-7446-4CAF-A3E3-CF9C4E1A5DCC}
469459
{FF3FACB1-C470-4C7F-9A4B-F364BE1E32B3} = {D7873DF2-16DB-4B19-A100-C0089DF37488}
470-
{A0B626A0-5AD5-4110-9BF6-147E304D1FE6} = {B7CCD58C-A3F3-43BE-BBF8-2B20D118C39D}
471460
EndGlobalSection
472461
GlobalSection(ExtensibilityGlobals) = postSolution
473462
SolutionGuid = {CC13D3AD-18BF-4695-AB2A-087EF0885B20}

agent/MTConnect.NET-Agent/MTConnect.NET-Agent.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@
5959
<None Update="devices\okuma.xml">
6060
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
6161
</None>
62-
<None Update="devices\sodick.xml">
63-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
64-
</None>
6562
<None Update="README.md">
6663
<PackagePath>\</PackagePath>
6764
<Pack>True</Pack>

agent/MTConnect.NET-Agent/agent.config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# - Device Configuration -
2-
devices: devices/sodick.xml
2+
devices: devices
33

44
# - Processors -
55
processors:

agent/MTConnect.NET-Agent/devices/sodick.xml

Lines changed: 0 additions & 25 deletions
This file was deleted.

agent/MTConnect.NET-Applications-Agents/MTConnect.NET-Applications-Agents.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<ProjectReference Include="..\..\libraries\MTConnect.NET-JSON-cppagent\MTConnect.NET-JSON-cppagent.csproj" />
6565
<ProjectReference Include="..\..\libraries\MTConnect.NET-JSON\MTConnect.NET-JSON.csproj" />
6666
<ProjectReference Include="..\..\libraries\MTConnect.NET-Services\MTConnect.NET-Services.csproj" />
67-
<ProjectReference Include="..\..\libraries\MTConnect.NET-XML-2\MTConnect.NET-XML-2.csproj" />
67+
<ProjectReference Include="..\..\libraries\MTConnect.NET-XML\MTConnect.NET-XML.csproj" />
6868
<ProjectReference Include="..\Modules\MTConnect.NET-AgentModule-HttpAdapter\MTConnect.NET-AgentModule-HttpAdapter.csproj" />
6969
<ProjectReference Include="..\Modules\MTConnect.NET-AgentModule-HttpServer\MTConnect.NET-AgentModule-HttpServer.csproj" />
7070
<ProjectReference Include="..\Modules\MTConnect.NET-AgentModule-MqttAdapter\MTConnect.NET-AgentModule-MqttAdapter.csproj" />

examples/MTConnect.NET-Client-HTTP/MTConnect.NET-Client-HTTP.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
<ItemGroup>
1111
<ProjectReference Include="..\..\libraries\MTConnect.NET-HTTP\MTConnect.NET-HTTP.csproj" />
12-
<ProjectReference Include="..\..\libraries\MTConnect.NET-XML-2\MTConnect.NET-XML-2.csproj" />
12+
<ProjectReference Include="..\..\libraries\MTConnect.NET-JSON-cppagent\MTConnect.NET-JSON-cppagent.csproj" />
13+
<ProjectReference Include="..\..\libraries\MTConnect.NET-JSON\MTConnect.NET-JSON.csproj" />
14+
<ProjectReference Include="..\..\libraries\MTConnect.NET-XML\MTConnect.NET-XML.csproj" />
1315
</ItemGroup>
1416

1517
</Project>

examples/MTConnect.NET-Client-HTTP/Program.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,7 @@ static void DocumentClient()
2525

2626
client.ProbeReceived += (s, response) =>
2727
{
28-
var formatOptions = new List<KeyValuePair<string, string>>();
29-
formatOptions.Add(new KeyValuePair<string, string>("indentOutput", "true"));
30-
31-
var inputStream = ResponseDocumentFormatter.Format("XML", response, formatOptions).Content;
32-
if (inputStream != null)
33-
{
34-
inputStream.Seek(0, SeekOrigin.Begin);
35-
36-
var outputStream = new MemoryStream();
37-
inputStream.CopyTo(outputStream);
38-
var outputBytes = outputStream.ToArray();
39-
Console.WriteLine(System.Text.Encoding.UTF8.GetString(outputBytes));
40-
}
41-
42-
//foreach (var device in response.Devices) EntityFo;
43-
//foreach (var device in response.Devices) Console.WriteLine($"Device Received : {device.Uuid} : {device.Name}");
28+
foreach (var device in response.Devices) Console.WriteLine($"Device Received : {device.Uuid} : {device.Name}");
4429
};
4530

4631
client.CurrentReceived += (s, response) =>

libraries/MTConnect.NET-Common/Configurations/DeviceConfiguration.cs

Lines changed: 9 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,16 @@ public static IEnumerable<DeviceConfiguration> FromFile(string filePath, string
9393

9494
return devices;
9595
}
96-
}
97-
}
98-
99-
using (var contents = File.OpenRead(rootPath))
100-
{
101-
if (contents != null)
102-
{
103-
if (contents.Position > 0) contents.Seek(0, SeekOrigin.Begin);
104-
105-
// Read Single Entity Format
106-
var device = Formatters.EntityFormatter.CreateDevice(documentFormatterId, contents).Content;
107-
if (device != null)
96+
else
10897
{
109-
return new List<DeviceConfiguration> { new DeviceConfiguration(device, rootPath) };
98+
if (contents.Position > 0) contents.Seek(0, SeekOrigin.Begin);
99+
100+
// Read Single Entity Format
101+
var device = Formatters.EntityFormatter.CreateDevice(documentFormatterId, contents).Content;
102+
if (device != null)
103+
{
104+
return new List<DeviceConfiguration> { new DeviceConfiguration(device, rootPath) };
105+
}
110106
}
111107
}
112108
}
@@ -118,68 +114,6 @@ public static IEnumerable<DeviceConfiguration> FromFile(string filePath, string
118114
return null;
119115
}
120116

121-
///// <summary>
122-
///// Gets a list of Devices from the specified file (ex. devices.xml)
123-
///// </summary>
124-
///// <param name="filePath">The path to the Device Configuration file</param>
125-
//public static IEnumerable<DeviceConfiguration> FromFile(string filePath, string documentFormatterId)
126-
//{
127-
// // Set the Filename
128-
// var path = !string.IsNullOrEmpty(filePath) ? filePath : DefaultFilename;
129-
130-
// // Add Working directory (if path is not rooted)
131-
// var rootPath = path;
132-
// if (!System.IO.Path.IsPathRooted(rootPath))
133-
// {
134-
// rootPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path);
135-
// }
136-
137-
// if (!string.IsNullOrEmpty(rootPath))
138-
// {
139-
// try
140-
// {
141-
// if (File.Exists(rootPath))
142-
// {
143-
// using (var contents = File.OpenRead(rootPath))
144-
// {
145-
// if (contents != null)
146-
// {
147-
// if (contents.Position > 0) contents.Seek(0, SeekOrigin.Begin);
148-
149-
// // Read ResponseDocument Format
150-
// var devicesDocument = Formatters.ResponseDocumentFormatter.CreateDevicesResponseDocument(documentFormatterId, contents).Content;
151-
// if (devicesDocument != null && devicesDocument.Devices != null && devicesDocument.Devices.Count() > 0)
152-
// {
153-
// var devices = new List<DeviceConfiguration>();
154-
155-
// foreach (var device in devicesDocument.Devices)
156-
// {
157-
// devices.Add(new DeviceConfiguration(device, rootPath));
158-
// }
159-
160-
// return devices;
161-
// }
162-
// else
163-
// {
164-
// if (contents.Position > 0) contents.Seek(0, SeekOrigin.Begin);
165-
166-
// // Read Single Entity Format
167-
// var device = Formatters.EntityFormatter.CreateDevice(documentFormatterId, contents).Content;
168-
// if (device != null)
169-
// {
170-
// return new List<DeviceConfiguration> { new DeviceConfiguration(device, rootPath) };
171-
// }
172-
// }
173-
// }
174-
// }
175-
// }
176-
// }
177-
// catch { }
178-
// }
179-
180-
// return null;
181-
//}
182-
183117
#if NETCOREAPP1_0_OR_GREATER
184118

185119
/// <summary>

libraries/MTConnect.NET-HTTP/Clients/MTConnectHttpClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ private async Task Worker()
650650
{
651651
// Run Probe Request
652652
var probe = await GetProbeAsync(_stop.Token);
653-
if (probe != null && probe.Header != null)
653+
if (probe != null)
654654
{
655655
_lastResponse = UnixDateTime.Now;
656656
ResponseReceived?.Invoke(this, new EventArgs());
@@ -958,7 +958,7 @@ private void ProcessSampleDocument(IStreamsResponseDocument document, Cancellati
958958
private static IDevice ProcessDevice(IMTConnectDevicesHeader header, IDevice inputDevice)
959959
{
960960
var outputDevice = (Device)inputDevice;
961-
if (header != null) outputDevice.InstanceId = header.InstanceId;
961+
outputDevice.InstanceId = header.InstanceId;
962962

963963
// Add DataItems
964964
if (!inputDevice.DataItems.IsNullOrEmpty())
@@ -999,7 +999,7 @@ private static IDevice ProcessDevice(IMTConnectDevicesHeader header, IDevice inp
999999
private static IComponent ProcessComponent(IMTConnectDevicesHeader header, IComponent inputComponent)
10001000
{
10011001
var outputComponent = (Component)inputComponent;
1002-
if (header != null) outputComponent.InstanceId = header.InstanceId;
1002+
outputComponent.InstanceId = header.InstanceId;
10031003

10041004
// Add DataItems
10051005
if (!inputComponent.DataItems.IsNullOrEmpty())

libraries/MTConnect.NET-XML-2/Assets/ComponentConfigurationParameters/XmlComponentConfigurationParametersAsset.cs

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)