reformat project architecture for more extends

This commit is contained in:
parallelbgls@outlook.com
2015-09-23 16:24:14 +08:00
parent 45a02e7003
commit 3db6db2e15
3 changed files with 26 additions and 24 deletions

View File

@@ -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;
}
}
}

View File

@@ -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" />

View 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;
}
}
}
}