Commit a18a98ac authored by 潘栩锋's avatar 潘栩锋 🚴

1

parent 85bd2cb3
...@@ -272,4 +272,11 @@ ...@@ -272,4 +272,11 @@
<Geometry x:Key="Geometry_ruler"> <Geometry x:Key="Geometry_ruler">
M703.3856 34.440533l289.621333 289.621334a34.133333 34.133333 0 0 1 0 48.264533L365.4656 999.867733a34.133333 34.133333 0 0 1-48.264533 0L27.579733 710.2464a34.133333 34.133333 0 0 1 0-48.298667L655.086933 34.474667a34.133333 34.133333 0 0 1 48.298667 0zM606.8224 179.2l-48.264533 48.264533 96.529066 96.5632 48.298667-48.264533-96.5632-96.5632z m-193.092267 193.092267l-48.264533 48.264533 96.5632 96.5632 48.264533-48.264533-96.5632-96.5632z m-193.092266 193.092266L172.373333 613.6832l96.5632 96.5632 48.264534-48.298667-96.5632-96.529066zM510.293333 275.797333l-48.264533 48.264534 193.058133 193.092266 48.298667-48.264533L510.293333 275.797333z m-193.092266 193.092267L268.936533 517.12l193.092267 193.092267 48.264533-48.298667-193.092266-193.058133z M703.3856 34.440533l289.621333 289.621334a34.133333 34.133333 0 0 1 0 48.264533L365.4656 999.867733a34.133333 34.133333 0 0 1-48.264533 0L27.579733 710.2464a34.133333 34.133333 0 0 1 0-48.298667L655.086933 34.474667a34.133333 34.133333 0 0 1 48.298667 0zM606.8224 179.2l-48.264533 48.264533 96.529066 96.5632 48.298667-48.264533-96.5632-96.5632z m-193.092267 193.092267l-48.264533 48.264533 96.5632 96.5632 48.264533-48.264533-96.5632-96.5632z m-193.092266 193.092266L172.373333 613.6832l96.5632 96.5632 48.264534-48.298667-96.5632-96.529066zM510.293333 275.797333l-48.264533 48.264534 193.058133 193.092266 48.298667-48.264533L510.293333 275.797333z m-193.092266 193.092267L268.936533 517.12l193.092267 193.092267 48.264533-48.298667-193.092266-193.058133z
</Geometry> </Geometry>
<Geometry x:Key="Geometry_clipboard-arrow-left">
M16,15H12V18L7,13L12,8V11H16M12,3A1,1 0 0,1 13,4A1,1 0 0,1 12,5A1,1 0 0,1 11,4A1,1 0 0,1 12,3M19,3H14.82C14.4,1.84 13.3,1 12,1C10.7,1 9.6,1.84 9.18,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3Z
</Geometry>
</ResourceDictionary> </ResourceDictionary>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="24" Height="24"><Path Data="M16,15H12V18L7,13L12,8V11H16M12,3A1,1 0 0,1 13,4A1,1 0 0,1 12,5A1,1 0 0,1 11,4A1,1 0 0,1 12,3M19,3H14.82C14.4,1.84 13.3,1 12,1C10.7,1 9.6,1.84 9.18,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3Z" /></Canvas>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="24" Height="24"><Path Data="M2,6V8H14V6H2M2,10V12H11V10H2M14.17,10.76L12.76,12.17L15.59,15L12.76,17.83L14.17,19.24L17,16.41L19.83,19.24L21.24,17.83L18.41,15L21.24,12.17L19.83,10.76L17,13.59L14.17,10.76M2,14V16H11V14H2Z" /></Canvas>
\ No newline at end of file
using System;
namespace Misc
{
public class CopyIgnoreAttribute : Attribute
{
}
}
\ No newline at end of file
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
<Compile Include="CRC.cs" /> <Compile Include="CRC.cs" />
<Compile Include="DATARANGE.cs" /> <Compile Include="DATARANGE.cs" />
<Compile Include="Debug.cs" /> <Compile Include="Debug.cs" />
<Compile Include="IgnoreAttribute.cs" />
<Compile Include="ITDParam.cs" /> <Compile Include="ITDParam.cs" />
<Compile Include="Log.cs" /> <Compile Include="Log.cs" />
<Compile Include="PropertiesManager.cs" /> <Compile Include="PropertiesManager.cs" />
......
...@@ -84,21 +84,24 @@ namespace Misc ...@@ -84,21 +84,24 @@ namespace Misc
foreach (PropertyInfo propertyInfo in t.GetProperties()) foreach (PropertyInfo propertyInfo in t.GetProperties())
{ {
if (propertyInfo.CanWrite) //忽略不复制!!!
{ if (propertyInfo.GetCustomAttributes(typeof(CopyIgnoreAttribute), false).Count() > 0)
propertyInfo.SetValue(dest, propertyInfo.GetValue(src, null), null); continue;
}
else
{
//ICopiable //ICopiable
if (propertyInfo.PropertyType.IsSubclassOf(typeof(ICopiable))) //if (propertyInfo.PropertyType.IsSubclassOf(typeof(ICopiable)))
if(typeof(ICopiable).IsAssignableFrom(propertyInfo.PropertyType))
{ {
ICopiable copiable = propertyInfo.GetValue(dest, null) as ICopiable; ICopiable copiable = propertyInfo.GetValue(dest, null) as ICopiable;
copiable.Copy(propertyInfo.GetValue(src, null)); copiable.Copy(propertyInfo.GetValue(src, null));
} }
else if(propertyInfo.CanWrite)
{
propertyInfo.SetValue(dest, propertyInfo.GetValue(src, null), null);
} }
} }
} }
} }
/// <summary> /// <summary>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <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')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...@@ -12,6 +13,8 @@ ...@@ -12,6 +13,8 @@
<AssemblyName>FLY.Thick.Base</AssemblyName> <AssemblyName>FLY.Thick.Base</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -36,6 +39,9 @@ ...@@ -36,6 +39,9 @@
</ApplicationIcon> </ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <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>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
...@@ -188,7 +194,23 @@ ...@@ -188,7 +194,23 @@
<Name>FLY.Thick.BulkDataModule</Name> <Name>FLY.Thick.BulkDataModule</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="FodyWeavers.xml">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <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')" />
<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'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- 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. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
......
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<PropertyChanged2 />
</Weavers>
...@@ -20,269 +20,105 @@ namespace FLY.Thick.Base.Server ...@@ -20,269 +20,105 @@ namespace FLY.Thick.Base.Server
#endregion #endregion
#region 属性,成员变量的代理 #region 属性,成员变量的代理
//启动与否
private bool enable;
/// <summary> /// <summary>
/// 启动与否 /// 启动与否
/// </summary> /// </summary>
public bool Enable public bool Enable { get; set; }
{
get
{
return enable;
}
set
{
if (enable != value)
{
enable = value;
NotifyPropertyChanged("Enable");
}
}
}
bool isbreakdetect = true;
/// <summary> /// <summary>
/// 边界拐点检测,找到的边界更加精确 /// 边界拐点检测,找到的边界更加精确
/// </summary> /// </summary>
public bool IsBreakDetect public bool IsBreakDetect { get; set; } = true;
{
get
{
return isbreakdetect;
}
set
{
if (isbreakdetect != value)
{
isbreakdetect = value;
NotifyPropertyChanged("IsBreakDetect");
}
}
}
protected Range[] border = new Range[2] { new Range(), new Range() }; protected Range[] border = new Range[2] { new Range(), new Range() };
private Range valid = new Range();
/// <summary> /// <summary>
/// 有限范围 /// 有限范围
/// </summary> /// </summary>
public Range Valid public Range Valid { get; } = new Range();
{
get
{
return valid;
}
}
/// <summary> /// <summary>
/// 边界 /// 边界
/// </summary> /// </summary>
public Range Border_Backw public Range Border_Forw { get { return border[0]; } }
{ /// <summary>
get /// 边界
{ /// </summary>
return border[1]; public Range Border_Backw { get { return border[1]; } }
}
}
public Range Border_Forw
{
get
{
return border[0];
}
}
/// <summary>
/// 膜范围
/// </summary>
public Range Border = new Range(); public Range Border = new Range();
private int width;
/// <summary> /// <summary>
/// 当前膜宽,测量出来的,单位是 脉冲 /// 当前膜宽,测量出来的,单位是 脉冲
/// </summary> /// </summary>
public int Width public int Width { get; protected set; }
{
get { return width; }
protected set {
if (width != value)
{
width = value;
NotifyPropertyChanged("Width");
}
}
}
private int mid; private int mid;
/// <summary> /// <summary>
/// 膜中间位置 单位 脉冲 /// 膜中间位置 单位 脉冲
/// </summary> /// </summary>
public int Mid public int Mid { get; protected set; }
{
get { return mid; }
protected set
{
if (mid != value)
{
mid = value;
NotifyPropertyChanged("Mid");
}
}
}
bool tempADBySet = false;
/// <summary> /// <summary>
/// 手动设置温修AD值 /// 手动设置温修AD值
/// </summary> /// </summary>
public bool TempADBySet public bool TempADBySet { get; set; }
{
get {
return tempADBySet;
}
set {
if (tempADBySet != value) {
tempADBySet = value;
NotifyPropertyChanged("TempADBySet");
}
}
}
private int currtempad=50000;
/// <summary> /// <summary>
/// 温修AD值 /// 温修AD值
/// </summary> /// </summary>
public int CurrTempAD public int CurrTempAD { get; set; } = 50000;
{
get
{
return currtempad;
}
set
{
if (currtempad != value)
{
currtempad = value;
NotifyPropertyChanged("CurrTempAD");
}
}
}
private int tempad=50000;
/// <summary> /// <summary>
/// 温修AD值 /// 温修AD值
/// </summary> /// </summary>
public int TempAD public int TempAD { get; set; } = 50000;
{
get
{
return tempad;
}
set
{
if (tempad != value)
{
tempad = value;
NotifyPropertyChanged("TempAD");
}
}
}
private int temprange;
/// <summary> /// <summary>
/// AD超过了范围, 就认为开始找到边界 /// AD超过了范围, 就认为开始找到边界
/// </summary> /// </summary>
public int TempRange public int TempRange { get; set; }
{
get
{
return temprange;
}
set
{
if (temprange != value)
{
temprange = value;
NotifyPropertyChanged("TempRange");
}
}
}
private int n;
/// <summary> /// <summary>
/// 有滤波器,只有非空的连续N个pos以上,才开始算边界开始 /// 有滤波器,只有非空的连续N个pos以上,才开始算边界开始
/// </summary> /// </summary>
public int N public int N { get; set; }
{
get
{
return n;
}
set
{
n = value;
NotifyPropertyChanged("N");
}
}
private int sensorwidth;
/// <summary> /// <summary>
/// 探头直径,单位脉冲, 膜宽 = 边界范围 - 探头直径 /// 探头直径,单位脉冲, 膜宽 = 边界范围 - 探头直径
/// </summary> /// </summary>
public int SensorWidth { public int SensorWidth { get; set; }
get
{
return sensorwidth;
}
set
{
if(sensorwidth != value)
{
sensorwidth = value;
NotifyPropertyChanged("SensorWidth");
}
}
}
private int n2;
/// <summary> /// <summary>
/// 找到边界后,再往内缩N2个脉冲,防止边界找得不准的问题。 /// 找到边界后,再往内缩N2个脉冲,防止边界找得不准的问题。
/// </summary> /// </summary>
public int N2 public int N2 { get; set; }
{
get
{
return n2;
}
set
{
n2 = value;
NotifyPropertyChanged("N2");
}
}
private int n3;
/// <summary> /// <summary>
/// 记录两个边界以后扫描,以它们再外扩N3个脉冲,作为扫描范围 /// 记录两个边界以后扫描,以它们再外扩N3个脉冲,作为扫描范围
/// </summary> /// </summary>
public int N3 public int N3 { get; set; }
{
get
{
return n3;
}
set
{
n3 = value;
NotifyPropertyChanged("N3");
}
}
private int[] datas = null;
/// <summary> /// <summary>
/// 用于调试, 进入到边界查找的数据 /// 用于调试, 进入到边界查找的数据
/// </summary> /// </summary>
public int[] Datas public int[] Datas { get; set; } = null;
{
get { return datas; }
protected set {
datas = value;
}
}
#endregion #endregion
...@@ -390,8 +226,8 @@ namespace FLY.Thick.Base.Server ...@@ -390,8 +226,8 @@ namespace FLY.Thick.Base.Server
//反向找到边界 //反向找到边界
isBackFindOut = true; isBackFindOut = true;
} }
int min=valid.Begin; int min=Valid.Begin;
int max=valid.End; int max=Valid.End;
if(isForwFindOut && isBackFindOut) if(isForwFindOut && isBackFindOut)
{ {
...@@ -415,11 +251,11 @@ namespace FLY.Thick.Base.Server ...@@ -415,11 +251,11 @@ namespace FLY.Thick.Base.Server
//} //}
//范围限制 //范围限制
if (min < valid.Begin) if (min < Valid.Begin)
min = valid.Begin; min = Valid.Begin;
if (max > valid.End) if (max > Valid.End)
max = valid.End; max = Valid.End;
posBegin = min; posBegin = min;
posEnd = max; posEnd = max;
} }
......
<?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" />
</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