reformat project architecture for more extends
This commit is contained in:
@@ -7,22 +7,6 @@ namespace ModBus.Net
|
||||
public abstract string FormatAddress(string area, int address);
|
||||
}
|
||||
|
||||
public class AddressFormaterSimense : AddressFormater
|
||||
{
|
||||
public override string FormatAddress(string area, int address)
|
||||
{
|
||||
if (area.Length > 1 &&
|
||||
area.ToUpper().Substring(0,2) == "DB")
|
||||
{
|
||||
return area.ToUpper() + "." + "DB" + address;
|
||||
}
|
||||
else
|
||||
{
|
||||
return area.ToUpper() + address;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AddressFormaterBase : AddressFormater
|
||||
{
|
||||
public override string FormatAddress(string area, int address)
|
||||
@@ -30,12 +14,4 @@ namespace ModBus.Net
|
||||
return area + "." + address;
|
||||
}
|
||||
}
|
||||
|
||||
public class AddressFormaterNA200H : AddressFormater
|
||||
{
|
||||
public override string FormatAddress(string area, int address)
|
||||
{
|
||||
return area + address;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
<Compile Include="BaseUtility.cs" />
|
||||
<Compile Include="BaseMachine.cs" />
|
||||
<Compile Include="ComConnector.cs" />
|
||||
<Compile Include="Modbus\AddressFormaterModbus.cs" />
|
||||
<Compile Include="Modbus\AddressTranslatorModbus.cs" />
|
||||
<Compile Include="Modbus\ModbusMachine.cs" />
|
||||
<Compile Include="Modbus\ModbusProtocalLinkerBytesExtend.cs" />
|
||||
@@ -78,6 +79,7 @@
|
||||
<Compile Include="Modbus\ModbusProtocal.cs" />
|
||||
<Compile Include="Modbus\ModbusTcpProtocal.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Simense\AddressFormaterSimense.cs" />
|
||||
<Compile Include="Simense\AddressTranslatorSimense.cs" />
|
||||
<Compile Include="Simense\SimenseMachine.cs" />
|
||||
<Compile Include="Simense\SimenseProtocal.cs" />
|
||||
|
||||
24
Modbus.Net/ModBus.Net/Simense/AddressFormaterSimense.cs
Normal file
24
Modbus.Net/ModBus.Net/Simense/AddressFormaterSimense.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModBus.Net.Simense
|
||||
{
|
||||
public class AddressFormaterSimense : AddressFormater
|
||||
{
|
||||
public override string FormatAddress(string area, int address)
|
||||
{
|
||||
if (area.Length > 1 &&
|
||||
area.ToUpper().Substring(0, 2) == "DB")
|
||||
{
|
||||
return area.ToUpper() + "." + "DB" + address;
|
||||
}
|
||||
else
|
||||
{
|
||||
return area.ToUpper() + address;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user