1
0
mirror of https://github.com/DarthAffe/OBD.NET.git synced 2025-12-12 08:48:30 +00:00

Small refactorings to make the code fit the code-style of the library

This commit is contained in:
Darth Affe 2018-04-04 20:34:21 +02:00
parent b4f7a3480e
commit b9da9787ba
8 changed files with 21 additions and 36 deletions

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace OBD.NET.Common.OBDData
namespace OBD.NET.Common.OBDData
{
public class PidsSupported01_20 : AbstractPidsSupported
{

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace OBD.NET.Common.OBDData
namespace OBD.NET.Common.OBDData
{
public class PidsSupported21_40 : AbstractPidsSupported
{

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace OBD.NET.Common.OBDData
namespace OBD.NET.Common.OBDData
{
public class PidsSupported41_60 : AbstractPidsSupported
{

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace OBD.NET.Common.OBDData
namespace OBD.NET.Common.OBDData
{
public class PidsSupported61_80 : AbstractPidsSupported
{

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace OBD.NET.Common.OBDData
namespace OBD.NET.Common.OBDData
{
public class PidsSupported81_A0 : AbstractPidsSupported
{

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace OBD.NET.Common.OBDData
namespace OBD.NET.Common.OBDData
{
public class PidsSupportedA1_C0 : AbstractPidsSupported
{

View File

@ -1,35 +1,34 @@
using System;
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OBD.NET.Common.OBDData
{
public abstract class AbstractPidsSupported : AbstractOBDData
{
public AbstractPidsSupported(byte pid, int length) : base(pid, length)
{
}
#region Properties & Fields
public int[] SupportedPids
{
get
{
List<int> supportedPids = new List<int>();
byte[] byteArray = new byte[] { D, C, B, A };
var bitArray = new BitArray(byteArray);
BitArray bitArray = new BitArray(new[] { D, C, B, A });
for (int i = 0x01; i <= 0x20; i++)
{
if (bitArray.Get(bitArray.Length - i))
{
supportedPids.Add(PID + i);
}
}
return supportedPids.ToArray();
}
}
#endregion
#region Constructors
public AbstractPidsSupported(byte pid, int length) : base(pid, length)
{ }
#endregion
}
}

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace OBD.NET.Common.OBDData
namespace OBD.NET.Common.OBDData
{
public class PidsSupportedC1_E0 : AbstractPidsSupported
{