Moved ProtocolCore, SlotConfig and PortConfig to common\hardware\interfaces

This commit is contained in:
Thomas Wiedebusch
2023-04-26 13:16:32 +02:00
parent dc16f86930
commit cb72bc0352
46 changed files with 94 additions and 144 deletions
@@ -1,6 +1,6 @@
using System;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.EventArguments;
using Xylem.Common.Hardware.WaterMeter.MagFlux.DataPackages.MeasurementRecords;
using Xylem.Common.Hardware.WaterMeter.ProtocolCore.EventArguments;
namespace Xylem.Common.Hardware.WaterMeter.MagFlux.DataPackages.EventArguments
{
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Xylem.Common.Hardware.WaterMeter.ProtocolCore;
using Xylem.Common.Hardware.WaterMeter.ProtocolCore.EventArguments;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.EventArguments;
namespace Xylem.Common.Hardware.WaterMeter.MagFlux.DataPackages.EventArguments
{
@@ -46,10 +46,8 @@
<ItemGroup>
<Compile Include="CommunicationConfig.cs" />
<Compile Include="Const\MeterConfig.cs" />
<Compile Include="PortConfig.cs" />
<Compile Include="ProcessConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SlotConfig.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -1,63 +0,0 @@
using System;
using System.IO.Ports;
namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxConfig
{
/// <summary>
/// Collection of port settings
/// </summary>
public struct PortConfig
{
private String _portName;
/// <summary>
/// Assigns a port name and creates the serial port object
/// Port name e.g. "COM2"
/// </summary>
public String PortName
{
get =>
//if the serial port object does not exists
GetSerialPort() == null ? "NA" : _portName;
set
{
if (value == null) return;
_portName = value;
//create a serial port object
if (GetSerialPort() == null)
{
SetSerialPort(new SerialPort(value));
}
else
{
GetSerialPort().PortName = value;
}
}
}
/// <summary>
/// setup of port type from name (referenced as "Type" in config file)
/// </summary>
public String Type { get; set; }
private SerialPort _serialPort;
/// <summary>
/// using dotNets <see cref="GetSerialPort()"/> for connection
/// </summary>
public SerialPort GetSerialPort()
{
return _serialPort;
}
/// <summary>
/// using dotNets <see cref="GetSerialPort()"/> for connection
/// </summary>
private void SetSerialPort(SerialPort value)
{
_serialPort = value;
}
}
}
@@ -1,26 +0,0 @@
using System;
namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxConfig
{
/// <summary>
/// Container for port configuration
/// </summary>
public class SlotConfig
{
/// <summary>
/// Slot number
/// </summary>
public Int32 Slot { get; set; }
/// <summary>
/// Request port settings
/// </summary>
public PortConfig Request { get; set; }
/// <summary>
/// Streaming port settings
/// </summary>
public PortConfig Streaming { get; set; }
}
}
@@ -2,8 +2,8 @@
using modbus_master_csharp.Device;
using NLog;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore.EventArguments;
using Xylem.Common.Hardware.WaterMeter.ProtocolCore;
using Xylem.Common.Hardware.WaterMeter.ProtocolCore.EventArguments;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.EventArguments;
using Xylem.Common.Utils.Logging;
@@ -1,8 +1,8 @@
using System;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore.EventArguments;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.EventArguments;
using Xylem.Common.Hardware.WaterMeter.MagFlux.DataPackages.EventArguments;
using Xylem.Common.Hardware.WaterMeter.ProtocolCore;
using Xylem.Common.Hardware.WaterMeter.ProtocolCore.EventArguments;
namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol
{