Commit 22f07d8c authored by 潘栩锋's avatar 潘栩锋 🚴

添加检测 FObjSys 添加检测 OBJ ID 是否唯一功能

parent d2745d61
......@@ -66,6 +66,26 @@ namespace FObjBase
Objs.Add(obj, new List<Sense>());
}
/// <summary>
/// 检测 全部Obj 的ID 是否都唯一
/// </summary>
/// <returns></returns>
public bool CheckObjIDUnique()
{
for (int i = 0; i < Objs.Count(); i++)
{
var kv1 = Objs.ElementAt(i);
for (int j = i + 1; j < Objs.Count(); j++)
{
var kv2 = Objs.ElementAt(j);
if (kv1.Key.ID == kv2.Key.ID)
{
return false;
}
}
}
return true;
}
/// <summary>
/// 对外发送消息
/// </summary>
/// <param name="s1">远端对应的连接代理 </param>
......@@ -620,6 +640,7 @@ namespace FObjBase
{
try
{
KeyValuePair<IFObj, List<Sense>> obj_kv = Objs.First(obj => obj.Key.ID == objid);
return obj_kv.Key;
}
......
......@@ -105,6 +105,7 @@ namespace FObjBase
/// </summary>
public class FObj : IFObj
{
public FObj()
{
ID = 0;
......@@ -116,6 +117,10 @@ namespace FObjBase
this.objsys_idx = objsys_idx;
CurrObjSys.ObjAdd(this);
}
public override string ToString()
{
return $@"[{ID}] {GetType().Name}";
}
#region IFObj 成员
private int objsys_idx=0;
......
......@@ -307,7 +307,7 @@
<sys:String x:Key="strCSCorr">机架修正</sys:String>
<sys:String x:Key="strCSGetSample">获取样品</sys:String>
<sys:String x:Key="strCSRunning">运行至..</sys:String>
<sys:String x:Key="strCSDisconnetced">连接断开</sys:String>
<sys:String x:Key="strCSDisconnected">连接断开</sys:String>
<sys:String x:Key="strCSGageInfo">机架信息</sys:String>
<sys:String x:Key="strCSPause">暂停</sys:String>
<sys:String x:Key="strCSAutoScan">自动扫描</sys:String>
......
......@@ -8,6 +8,8 @@ using FObjBase;
using FLY.Thick.Base.IService;
using FLY.Thick.Base.OBJ_INTERFACE;
using FLY.Thick.Base.Common;
using PropertyChanged;
namespace FLY.Thick.Base.Client
{
public class GetSampleService : FObj, IGetSampleService
......@@ -20,395 +22,187 @@ namespace FLY.Thick.Base.Client
mServerID = GETSAMPLE_OBJ_INTERFACE.ID;
for (int i = 0; i < Samples.Count(); i++)
Samples[i] = new SampleCell();
{
SampleCell sampleCell = new SampleCell();
sampleCell.Index = i;
Samples[i] = sampleCell;
}
for (int i = 0; i < Features.Count(); i++)
Features[i] = new SampleFeature();
Features[0] = new SampleFeature() { Name = "正向" };
Features[1] = new SampleFeature() { Name = "反向" };
}
public class SampleCell : ISampleCell
{
private bool enable;
public int Index { get; set; }
/// <summary>
/// 使能
/// </summary>
public bool Enable
{
get { return enable; }
set
{
if (enable != value)
{
enable = value;
NotifyPropertyChanged("Enable");
}
}
}
public bool Enable { get; set; }
private bool justForCheck;
/// <summary>
/// 参数:只检查不标定
/// </summary>
public bool JustForCheck
{
get { return justForCheck; }
set {
if (justForCheck != value)
{
justForCheck = value;
NotifyPropertyChanged("JustForCheck");
}
}
}
public bool JustForCheck { get; set; }
private int orgad;
/// <summary>
/// 原始AD值
/// </summary>
public int OrgAD
{
get { return orgad; }
set
{
if (this.orgad != value)
{
this.orgad = value;
NotifyPropertyChanged("OrgAD");
}
}
}
private int position;
public int OrgAD { get; set; }
/// <summary>
/// 位置
/// </summary>
public int Position
{
get { return position; }
set
{
if (position != value)
{
position = value;
NotifyPropertyChanged("Position");
}
}
}
private int ad;
public int Position { get; set; }
/// <summary>
/// 状态:当前测量的AD值
/// </summary>
public int AD
{
get { return ad; }
set
{
if (ad != value)
{
ad = value;
NotifyPropertyChanged("AD");
}
}
}
private int sampleValue;
public int AD { get; set; }
/// <summary>
/// 状态:当前测量的AD值 对应的 样品值
/// </summary>
public int SampleValue
{
get
{
return sampleValue;
}
set
{
if (sampleValue != value)
{
sampleValue = value;
NotifyPropertyChanged("SampleValue");
}
}
}
#region INotifyPropertyChanged 成员
protected void NotifyPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public int SampleValue { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
#endregion
}
public class SampleFeature : ISampleFeature
{
private bool enable = false;
public string Name { get; set; }
/// <summary>
/// 使能
/// </summary>
public bool Enable
{
get { return enable; }
set
{
if (enable != value)
{
enable = value;
NotifyPropertyChanged("Enable");
}
}
}
private int startpos;
public bool Enable { get; set; }
/// <summary>
/// 开始位置
/// </summary>
public int StartPos
{
get { return startpos; }
set
{
if (startpos != value)
{
startpos = value;
NotifyPropertyChanged("StartPos");
}
}
}
private int endpos;
public int StartPos { get; set; }
/// <summary>
/// 结束位置
/// </summary>
public int EndPos
{
get { return endpos; }
set
{
if (endpos != value)
{
endpos = value;
NotifyPropertyChanged("EndPos");
}
}
}
public int EndPos { get; set; }
private double maxRelevancy = -1;
/// <summary>
/// 状态:相似度必须高于0.8,失败-1
/// </summary>
public double MaxRelevancy
{
get { return maxRelevancy; }
set
{
if (maxRelevancy != value)
{
maxRelevancy = value;
NotifyPropertyChanged("MaxRelevancy");
}
}
}
public double MaxRelevancy { get; set; } = -1;
private int maxOffset;
/// <summary>
/// 状态:最大相似度对应的偏移
/// </summary>
public int MaxOffset
{
get { return maxOffset; }
set
{
if (maxOffset != value)
{
maxOffset = value;
NotifyPropertyChanged("MaxOffset");
}
}
}
public int MaxOffset { get; set; }
private int[] scanData;
/// <summary>
/// 状态:扫描数据,从扫描数据提取的相似的一段
/// 它的单位是 grid, 需要 posOfGrid, 转换为 pos
/// 开始位置是 StartPos - Search
/// </summary>
public int[] ScanData
{
get
{
return scanData;
}
set
{
scanData = value;
NotifyPropertyChanged("ScanData");
}
}
#region INotifyPropertyChanged 成员
protected void NotifyPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
[DoNotCheckEquality]
public int[] ScanData { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
#endregion
}
#region IGetSampleService 成员
private bool enable;
public bool Enable
{
get { return enable; }
set
{
if (enable != value)
{
enable = value;
NotifyPropertyChanged("Enable");
}
}
}
private int interval;
public int Interval
{
get { return interval; }
set
{
if (interval != value)
{
interval = value;
NotifyPropertyChanged("Interval");
}
}
}
private UInt32 velocity;
public UInt32 Velocity
{
get { return velocity; }
set
{
if (velocity != value)
{
velocity = value;
NotifyPropertyChanged("Velocity");
}
}
}
private int range;
public int Range
{
get { return range; }
set
{
if (range != value)
{
range = value;
NotifyPropertyChanged("Range");
}
}
}
//滤波移动窗口
private int window;
/// <summary>
/// 滤波移动窗口
/// 参数:使能
/// </summary>
public int Window
{
get { return window; }
set
{
if (window != value)
{
window = value;
NotifyPropertyChanged("Window");
}
}
}
public bool Enable { get; set; }
/// <summary>
/// 参数:间隔
/// </summary>
public int Interval { get; set; }
//样品点
private ISampleCell[] samples = new ISampleCell[3];
/// <summary>
/// 样品点
/// 采样计数
/// </summary>
public ISampleCell[] Samples
{
get { return samples; }
}
public int Timer { get; set; }
/// <summary>
/// 参数:速度
/// </summary>
public UInt32 Velocity { get; set; }
/// <summary>
/// 参数:样品点范围
/// </summary>
public int Range { get; set; }
private int search;
public int Search
{
get { return search; }
set
{
if (search != value)
{
search = value;
NotifyPropertyChanged("Search");
}
}
}
private ISampleFeature[] features = new ISampleFeature[2];
/// <summary>
/// 相识度 0 正, 1 反
/// 滤波窗口
/// </summary>
public ISampleFeature[] Features
{
get { return features; }
}
public int Window { get; set; }
/// <summary>
/// 样品
/// </summary>
public ISampleCell[] Samples { get; } = new ISampleCell[3];
/// <summary>
/// 查找公差
/// </summary>
public int Search { get; set; }
/// <summary>
/// 特征 相识度 0 正, 1 反
/// </summary>
public ISampleFeature[] Features { get; } = new ISampleFeature[2];
private int posOfGrid = 10;
/// <summary>
/// 状态:从flyad7 得到的。 用于绘制图
/// </summary>
public int PosOfGrid
{
get { return posOfGrid; }
set
{
if (posOfGrid != value)
{
posOfGrid = value;
NotifyPropertyChanged("PosOfGrid");
}
}
}
public int PosOfGrid { get; set; } = 10;
/// <summary>
///
/// </summary>
public void Apply()
{
GETSAMPLE_OBJ_INTERFACE.Pack_Params p = new GETSAMPLE_OBJ_INTERFACE.Pack_Params();
p.enable = Enable;
p.interval = Interval;
p.velocity = Velocity;
p.range = Range;
p.window = Window;
p.samples = new GETSAMPLE_OBJ_INTERFACE.Pack_Params_SampleCell[Samples.Count()];
GETSAMPLE_OBJ_INTERFACE.Pack_Params p = new GETSAMPLE_OBJ_INTERFACE.Pack_Params
{
enable = Enable,
interval = Interval,
velocity = Velocity,
range = Range,
window = Window,
samples = new GETSAMPLE_OBJ_INTERFACE.Pack_Params_SampleCell[Samples.Count()],
search = Search,
features = new GETSAMPLE_OBJ_INTERFACE.Pack_Params_SampleFeature[Features.Count()]
};
for (int i = 0; i < Samples.Count(); i++)
{
p.samples[i] = new GETSAMPLE_OBJ_INTERFACE.Pack_Params_SampleCell();
p.samples[i].enable = Samples[i].Enable;
p.samples[i].justForCheck = Samples[i].JustForCheck;
p.samples[i].orgad = Samples[i].OrgAD;
p.samples[i].position = Samples[i].Position;
p.samples[i] = new GETSAMPLE_OBJ_INTERFACE.Pack_Params_SampleCell
{
enable = Samples[i].Enable,
justForCheck = Samples[i].JustForCheck,
orgad = Samples[i].OrgAD,
position = Samples[i].Position
};
}
p.search = Search;
p.features = new GETSAMPLE_OBJ_INTERFACE.Pack_Params_SampleFeature[Features.Count()];
for (int i = 0; i < Features.Count(); i++)
{
p.features[i] = new GETSAMPLE_OBJ_INTERFACE.Pack_Params_SampleFeature();
p.features[i].enable = Features[i].Enable;
p.features[i].startpos = Features[i].StartPos;
p.features[i].endpos = Features[i].EndPos;
p.features[i] = new GETSAMPLE_OBJ_INTERFACE.Pack_Params_SampleFeature
{
enable = Features[i].Enable,
startpos = Features[i].StartPos,
endpos = Features[i].EndPos
};
}
//获取所有数据,设置推送
......@@ -426,13 +220,7 @@ namespace FLY.Thick.Base.Client
#region INotifyPropertyChanged 成员
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
}
}
#endregion
public override void Dispose()
......
......@@ -20,446 +20,156 @@ namespace FLY.Thick.Base.Client
}
#region 属性,成员变量的代理
private int poslen = 8900;//扫描架长
/// <summary>
/// 扫描架长
/// </summary>
public int PosLength
{
get { return poslen; }
set
{
poslen = value;
NotifyPropertyChanged("PosLength");
}
}
private int autoOriginInterval = 10;//自动归原点的间隔
public int PosLength { get; set; } = 8900;
/// <summary>
/// 自动归原点间距
/// </summary>
public int AutoOrgInterval
{
get { return autoOriginInterval; }
set
{
if (autoOriginInterval != value)
{
autoOriginInterval = value;
NotifyPropertyChanged("AutoOrgInterval");
}
}
}
public int AutoOrgInterval { get; set; } = 30;
private int posofgrid = 10;
/// <summary>
/// 从 flyad7 获取的
/// </summary>
public int PosOfGrid
{
get { return posofgrid; }
set
{
if (posofgrid != value)
{
posofgrid = value;
NotifyPropertyChanged("PosOfGrid");
}
}
}
private int adlag = 0;
public int PosOfGrid { get; set; } = 10;
/// <summary>
/// ad 滞后量 ms
/// </summary>
public int ADLag
{
get { return adlag; }
set
{
if (adlag != value)
{
adlag = value;
NotifyPropertyChanged("ADLag");
}
}
}
public int ADLag { get; set; } = 0;
private double _encoder1_mmpp = 0.1;
/// <summary>
/// 编码器1 mm/pulse
/// </summary>
public double Encoder1_mmpp
{
get { return _encoder1_mmpp; }
set
{
if (_encoder1_mmpp != value)
{
_encoder1_mmpp = value;
NotifyPropertyChanged("Encoder1_mmpp");
}
}
}
public double Encoder1_mmpp { get; set; } = 0.1;
private double speed1Scale = 1;
/// <summary>
/// 设置的速度,与 实际速度比例
/// </summary>
public double Speed1Scale
{
get { return speed1Scale; }
set
{
if (speed1Scale != value)
{
speed1Scale = value;
NotifyPropertyChanged("Speed1Scale");
}
}
}
public double Speed1Scale { get; set; } =1;
private FilmVSRC filmVSrc = FilmVSRC.ROUND;
/// <summary>
/// 线速度来源
/// </summary>
public FilmVSRC FilmVSrc
{
get
{
return filmVSrc;
}
set
{
if (filmVSrc != value)
{
filmVSrc = value;
NotifyPropertyChanged("FilmVSrc");
}
}
}
private int filmVThreshold = 5;
public FilmVSRC FilmVSrc { get; set; } = FilmVSRC.ROUND;
/// <summary>
/// 最小线速度 m/min
/// </summary>
public int FilmVThreshold
{
get
{
return filmVThreshold;
}
set
{
if (filmVThreshold != value)
{
filmVThreshold = value;
NotifyPropertyChanged("FilmVThreshold");
}
}
}
private double _encoder2_mmpp = 0.1;
public int FilmVThreshold { get; set; } = 5;
/// <summary>
/// 编码器2 mm/pulse
/// </summary>
public double Encoder2_mmpp
{
get { return _encoder2_mmpp; }
set
{
if (_encoder2_mmpp != value)
{
_encoder2_mmpp = value;
NotifyPropertyChanged("Encoder2_mmpp");
}
}
}
public double Encoder2_mmpp { get; set; } = 0.1;
private float _encoder2_comp = 1;
/// <summary>
/// 编码器2 放大
/// </summary>
public float Encoder2_comp
{
get { return _encoder2_comp; }
set
{
if (_encoder2_comp != value)
{
_encoder2_comp = value;
NotifyPropertyChanged("Encoder2_comp");
}
}
}
private double mmOfR = 314;
public float Encoder2_comp { get; set; } = 1;
/// <summary>
/// //1圈多少mm
/// </summary>
public double MmOfR
{
get
{
return mmOfR;
}
set
{
if (mmOfR != value)
{
mmOfR = value;
NotifyPropertyChanged("MmOfR");
}
}
}
public double MmOfR { get; set; } = 314;
private DATAVALIDSRC dataValidSrc = DATAVALIDSRC.VALID;
/// <summary>
/// 数据有效源
/// </summary>
public DATAVALIDSRC DataValidSrc
{
get { return dataValidSrc; }
set
{
if (dataValidSrc != value)
{
dataValidSrc = value;
NotifyPropertyChanged("DataValidSrc");
}
}
}
public DATAVALIDSRC DataValidSrc { get; set; } = DATAVALIDSRC.VALID;
private bool autof1f3 = false;
/// <summary>
/// 当数据有效状态改变,自动按F1,F3
/// </summary>
public bool AutoF1F3
{
get { return autof1f3; }
set
{
if (autof1f3 != value)
{
autof1f3 = value;
NotifyPropertyChanged("AutoF1F3");
}
}
}
public bool AutoF1F3 { get; set; }
private int restartdelay = 5;
/// <summary>
/// 当数据有效状态 无效->有效 ,等待多久重新扫描 ,单位s
/// </summary>
public int ReStartDelay
{
get { return restartdelay; }
set
{
if (restartdelay != value)
{
restartdelay = value;
NotifyPropertyChanged("ReStartDelay");
}
}
}
public int ReStartDelay { get; set; } = 5;
#region 速度
private UInt32 velocity_scan = 8000;
/// <summary>
/// 扫描时速度
/// </summary>
public UInt32 VScan
{
get { return velocity_scan; }
set
{
if (velocity_scan != value)
{
velocity_scan = value;
NotifyPropertyChanged("VScan");
}
}
}
private UInt32 velocity_jog = 5000;
public UInt32 VScan { get; set; } = 8000;
/// <summary>
/// 调试时速度,向前走,向后走
/// </summary>
public UInt32 VJOG
{
get { return velocity_jog; }
set
{
if (velocity_jog != value)
{
velocity_jog = value;
NotifyPropertyChanged("VJOG");
}
}
}
public UInt32 VJOG { get; set; } = 5000;
private UInt32 velocity_accuracy = 3000;
/// <summary>
/// 精确速度 Velocity Of Accuracy 如: 机架修正, 样品取样, 机架信息获取
/// </summary>
public UInt32 VAccuracy
{
get
{
return velocity_accuracy;
}
set
{
if (velocity_accuracy != value)
{
velocity_accuracy = value;
NotifyPropertyChanged("VAccuracy");
}
}
}
public UInt32 VAccuracy { get; set; } = 3000;
private UInt32 sv = 500;
/// <summary>
/// 开始速度 Start Velocity
/// </summary>
public UInt32 SVelocity
{
get { return sv; }
set
{
if (sv != value)
{
sv = value;
NotifyPropertyChanged("SVelocity");
}
}
}
public UInt32 SVelocity { get; set; } = 500;
private UInt32 atime = 200;
/// <summary>
/// 加速时间
/// </summary>
public UInt32 ATime
{
get { return atime; }
set
{
if (atime != value)
{
atime = value;
NotifyPropertyChanged("ATime");
}
}
}
private UInt32 dtime = 200;
public UInt32 ATime { get; set; } = 200;
/// <summary>
/// 减速时间
/// </summary>
public UInt32 DTime
{
get { return dtime; }
set
{
if (dtime != value)
{
dtime = value;
NotifyPropertyChanged("DTime");
}
}
}
private UInt32 hv1 = 5000;
public UInt32 DTime { get; set; } = 200;
/// <summary>
/// 归0速度1
/// </summary>
public UInt32 HVelocity1
{
get { return hv1; }
set
{
if (hv1 != value)
{
hv1 = value;
NotifyPropertyChanged("HVelocity1");
}
}
}
private UInt32 hv2 = 1000;
public UInt32 HVelocity1 { get; set; } = 5000;
/// <summary>
/// 归0速度2
/// </summary>
public UInt32 HVelocity2
{
get { return hv2; }
set
{
if (hv2 != value)
{
hv2 = value;
NotifyPropertyChanged("HVelocity2");
}
}
}
public UInt32 HVelocity2 { get; set; } = 1000;
#endregion
private bool hasProfileSample = false;
/// <summary>
/// 有按样标定硬件
/// </summary>
public bool HasProfileSample
{
get
{
return hasProfileSample;
}
set
{
if (hasProfileSample != value)
{
hasProfileSample = value;
NotifyPropertyChanged("HasProfileSample");
}
}
}
public bool HasProfileSample { get; set; }
private bool hashold = false;
/// <summary>
/// 有小托辊
/// </summary>
public bool HasHold
{
get
{
return hashold;
}
set
{
if (hashold != value)
{
hashold = value;
NotifyPropertyChanged("HasHold");
}
}
}
public bool HasHold { get; set; }
#endregion
#region INotifyPropertyChanged 成员
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
}
}
#endregion
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.5.13\build\PropertyChanged2.Fody.props" Condition="Exists('..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.5.13\build\PropertyChanged2.Fody.props')" />
<Import Project="..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.6.0\build\PropertyChanged2.Fody.props" Condition="Exists('..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.6.0\build\PropertyChanged2.Fody.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -39,8 +39,8 @@
</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="PropertyChanged2, Version=2.5.13.0, Culture=neutral, PublicKeyToken=ee3ee20bcf148ddd, processorArchitecture=MSIL">
<HintPath>..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.5.13\lib\net40\PropertyChanged2.dll</HintPath>
<Reference Include="PropertyChanged2, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ee3ee20bcf148ddd, processorArchitecture=MSIL">
<HintPath>..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.6.0\lib\net40\PropertyChanged2.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
......@@ -203,13 +203,13 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\..\Project.FLY.Thick.Normal\packages\Fody.3.2.13\build\Fody.targets" Condition="Exists('..\..\..\Project.FLY.Thick.Normal\packages\Fody.3.2.13\build\Fody.targets')" />
<Import Project="..\..\..\Project.FLY.Thick.Normal\packages\Fody.3.3.5\build\Fody.targets" Condition="Exists('..\..\..\Project.FLY.Thick.Normal\packages\Fody.3.3.5\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\Project.FLY.Thick.Normal\packages\Fody.3.2.13\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\Project.FLY.Thick.Normal\packages\Fody.3.2.13\build\Fody.targets'))" />
<Error Condition="!Exists('..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.5.13\build\PropertyChanged2.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.5.13\build\PropertyChanged2.Fody.props'))" />
<Error Condition="!Exists('..\..\..\Project.FLY.Thick.Normal\packages\Fody.3.3.5\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\Project.FLY.Thick.Normal\packages\Fody.3.3.5\build\Fody.targets'))" />
<Error Condition="!Exists('..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.6.0\build\PropertyChanged2.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\Project.FLY.Thick.Normal\packages\PropertyChanged2.Fody.2.6.0\build\PropertyChanged2.Fody.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanged2 />
</Weavers>
</Weavers>
\ No newline at end of file
......@@ -11,6 +11,7 @@ using Misc;
using FObjBase;
using FlyADBase;
using FLY.Thick.Base.IService;
using PropertyChanged;
namespace FLY.Thick.Base.Server
{
......@@ -19,109 +20,37 @@ namespace FLY.Thick.Base.Server
/// </summary>
public class SampleCell:ISampleCell, ISaveToXml
{
private bool enable;
/// <summary>
/// 参数:使能
/// </summary>
public bool Enable{
get{
return enable;
}
set{
if(enable != value)
{
enable = value;
NotifyPropertyChanged("Enable");
}
}
}
public bool Enable { get; set; }
private bool justForCheck;
/// <summary>
/// 参数:只检查不标定
/// </summary>
public bool JustForCheck
{
get { return justForCheck; }
set {
if (justForCheck != value) {
justForCheck = value;
NotifyPropertyChanged("JustForCheck");
}
}
}
public bool JustForCheck { get; set; }
private int orgad;
/// <summary>
/// 参数:原始AD值
/// </summary>
public int OrgAD
{
get{
return orgad;
}
set{
if(orgad !=value)
{
orgad = value;
NotifyPropertyChanged("OrgAD");
}
}
}
private int position;
public int OrgAD { get; set; }
/// <summary>
/// 参数:位置
/// </summary>
public int Position
{
get
{
return position;
}
set
{
if (position != value)
{
position = value;
NotifyPropertyChanged("Position");
}
}
}
private int ad;
public int Position { get; set; }
/// <summary>
/// 状态:当前测量的AD值
/// </summary>
public int AD
{
get { return ad; }
set {
if (ad != value)
{
ad = value;
NotifyPropertyChanged("AD");
}
}
}
public int AD { get; set; }
private int sampleValue;
/// <summary>
/// 状态:当前测量的AD值 对应的 样品值
/// </summary>
public int SampleValue {
get{
return sampleValue;
}
set
{
if(sampleValue!=value)
{
sampleValue = value;
NotifyPropertyChanged("SampleValue");
}
}
}
public int SampleValue { get; set; }
/// <summary>
/// 状态:方向 ,GSample 计算赋值的!!!
......@@ -148,13 +77,6 @@ namespace FLY.Thick.Base.Server
#region INotifyPropertyChanged 成员
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
}
}
#endregion
......@@ -164,126 +86,44 @@ namespace FLY.Thick.Base.Server
/// </summary>
public class SampleFeature : ISampleFeature, ISaveToXml
{
private bool enable;
/// <summary>
/// 参数:使能
/// </summary>
public bool Enable
{
get
{
return enable;
}
set
{
if (enable != value)
{
enable = value;
NotifyPropertyChanged("Enable");
}
}
}
public bool Enable { get; set; }
private int startpos;
/// <summary>
/// 参数:开始位置
/// </summary>
public int StartPos
{
get
{
return startpos;
}
set
{
if (startpos != value)
{
startpos = value;
NotifyPropertyChanged("StartPos");
}
}
}
public int StartPos { get; set; }
private int endpos;
/// <summary>
/// 参数:结束位置
/// </summary>
public int EndPos
{
get
{
return endpos;
}
set
{
if (endpos != value)
{
endpos = value;
NotifyPropertyChanged("EndPos");
}
}
}
public int EndPos { get; set; }
private double maxRelevancy = -1;
/// <summary>
/// 状态:相似度必须高于0.8,失败-1
/// </summary>
public double MaxRelevancy {
get { return maxRelevancy; }
set {
if (maxRelevancy != value)
{
maxRelevancy = value;
NotifyPropertyChanged("MaxRelevancy");
}
}
}
public double MaxRelevancy { get; set; } = -1;
private int maxOffset;
/// <summary>
/// 状态:最大相似度对应的偏移
/// </summary>
public int MaxOffset
{
get { return maxOffset; }
set
{
if (maxOffset != value)
{
maxOffset = value;
NotifyPropertyChanged("MaxOffset");
}
}
}
public int MaxOffset { get; set; }
private int[] scanData;
/// <summary>
/// 状态:扫描数据,从扫描数据提取的相似的一段
/// 它的单位是 grid, 需要 posOfGrid, 转换为 pos
/// 开始位置是 StartPos - Search
/// </summary>
public int[] ScanData
{
get
{
return scanData;
}
set
{
scanData = value;
NotifyPropertyChanged("ScanData");
}
}
/// <summary>
/// 状态:扫描数据,从扫描数据提取的相似的一段
/// 它的单位是 grid, 需要 posOfGrid, 转换为 pos
/// 开始位置是 StartPos - Search
/// </summary>
[DoNotCheckEquality]
public int[] ScanData { get; set; }
public SampleFeature()
{
Enable = false;
}
#region ISaveToXml 成员
public string[] GetSavePropertyNames()
......@@ -299,13 +139,7 @@ namespace FLY.Thick.Base.Server
#region INotifyPropertyChanged 成员
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
}
}
#endregion
}
......@@ -315,177 +149,62 @@ namespace FLY.Thick.Base.Server
public class GSample : IGetSampleService, Misc.ISaveToXml
{
#region IGetSampleService 接口
private bool enable;
/// <summary>
/// 参数:使能
/// </summary>
public bool Enable
{
get
{
return enable;
}
set
{
if (enable != value)
{
enable = value;
NotifyPropertyChanged("Enable");
}
}
}
public bool Enable { get; set; }
private int interval;
/// <summary>
/// 参数:间隔
/// </summary>
public int Interval
{
get
{
return interval;
}
set
{
if (interval != value)
{
interval = value;
NotifyPropertyChanged("Interval");
}
}
}
private int timer;
public int Interval { get; set; }
/// <summary>
/// 采样计数
/// </summary>
public int Timer
{
get { return timer; }
protected set {
timer = value;
NotifyPropertyChanged("Timer");
}
}
private UInt32 velocity;
public int Timer { get; set; }
/// <summary>
/// 参数:速度
/// </summary>
public UInt32 Velocity
{
get
{
return velocity;
}
set
{
if (velocity != value)
{
velocity = value;
NotifyPropertyChanged("Velocity");
}
}
}
private int range;
public UInt32 Velocity { get; set; }
/// <summary>
/// 参数:样品点范围
/// </summary>
public int Range
{
get
{
return range;
}
set
{
if (range != value)
{
range = value;
NotifyPropertyChanged("Range");
}
}
}
public int Range { get; set; }
private int window;
/// <summary>
/// 滤波窗口
/// </summary>
public int Window
{
get
{
return window;
}
set
{
if (window != value)
{
window = value;
NotifyPropertyChanged("Window");
}
}
}
private ISampleCell[] samples = new ISampleCell[3];
public ISampleCell[] Samples
{
get {
return samples;
}
}
public int Window { get; set; }
/// <summary>
/// 样品
/// </summary>
public ISampleCell[] Samples { get; } = new ISampleCell[3];
private int search;
/// <summary>
/// 查找公差
/// </summary>
public int Search
{
get
{
return search;
}
set
{
if (search != value)
{
search = value;
NotifyPropertyChanged("Search");
}
}
}
private ISampleFeature[] features = new ISampleFeature[2];
public int Search { get; set; }
/// <summary>
/// 相识度 0 正, 1 反
/// 特征 相识度 0 正, 1 反
/// </summary>
public ISampleFeature[] Features
{
get { return features; }
}
public ISampleFeature[] Features { get; } = new ISampleFeature[2];
private int posOfGrid = 10;
/// <summary>
/// 状态:从flyad7 得到的。 用于绘制图
/// </summary>
public int PosOfGrid
{
get { return posOfGrid; }
set {
if (posOfGrid != value)
{
posOfGrid = value;
NotifyPropertyChanged("PosOfGrid");
}
}
}
public int PosOfGrid { get; set; } = 10;
#endregion
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fody" version="3.2.13" targetFramework="net40" developmentDependency="true" />
<package id="PropertyChanged2.Fody" version="2.5.13" targetFramework="net40" />
<package id="Fody" version="3.3.5" targetFramework="net40" developmentDependency="true" />
<package id="PropertyChanged2.Fody" version="2.6.0" targetFramework="net40" />
</packages>
\ No newline at end of file
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