Commit 48f37511 authored by 潘栩锋's avatar 潘栩锋 🚴

修改 Range, BorderSearch, GetSample

parent 7b6f8b44
...@@ -4,6 +4,7 @@ using System.Linq; ...@@ -4,6 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.ComponentModel; using System.ComponentModel;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections;
namespace Misc namespace Misc
{ {
...@@ -372,6 +373,45 @@ namespace Misc ...@@ -372,6 +373,45 @@ namespace Misc
} }
/// <summary>
/// Range 比较器
/// </summary>
public class RangeEqualityComparer : IEqualityComparer<Range>
{
/// <summary>
///
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
public bool Equals(Range x, Range y)
{
if ((x.Begin == y.Begin) && (x.End == y.End))
{
return true;
}
else
return false;
}
/// <summary>
///
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public int GetHashCode(Range obj)
{
int hashCode = obj.Begin.GetHashCode();
int hashCode2 = obj.End.GetHashCode();
if (hashCode != hashCode2)
{
hashCode ^= hashCode2;
}
return hashCode;
}
}
public static class EListRange public static class EListRange
{ {
/// <summary> /// <summary>
......
...@@ -20,7 +20,6 @@ namespace FLY.Thick.Base.Server ...@@ -20,7 +20,6 @@ namespace FLY.Thick.Base.Server
#endregion #endregion
#region 属性,成员变量的代理 #region 属性,成员变量的代理
/// <summary> /// <summary>
/// 启动与否 /// 启动与否
/// </summary> /// </summary>
...@@ -58,7 +57,6 @@ namespace FLY.Thick.Base.Server ...@@ -58,7 +57,6 @@ namespace FLY.Thick.Base.Server
/// </summary> /// </summary>
public int Width { get; protected set; } public int Width { get; protected set; }
private int mid;
/// <summary> /// <summary>
/// 膜中间位置 单位 脉冲 /// 膜中间位置 单位 脉冲
/// </summary> /// </summary>
......
...@@ -350,7 +350,7 @@ namespace FLY.Thick.Base.Server ...@@ -350,7 +350,7 @@ namespace FLY.Thick.Base.Server
} }
else else
{ {
return null; return new Range();
} }
} }
/// <summary> /// <summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment