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

FLYAD7_WPF, FLYAD7_Simulation_WPF 使用 propertychanged2.fody

parent 0777d850
......@@ -11,128 +11,33 @@ namespace FLYAD7_Simulation_Wpf
{
public class FlyADClientUI : INotifyPropertyChanged
{
private int position;
public int Position
{
get { return position; }
set
{
if (position != value)
{
position = value;
PropertyChanged.Notify(this, "Position");
}
}
}
private int speed;
public int Speed
{
get { return speed; }
set
{
if (speed != value)
{
speed = value;
PropertyChanged.Notify(this, "Speed");
}
}
}
private int position2;
public int Position2
{
get { return position2; }
set
{
if (position2 != value)
{
position = value;
PropertyChanged.Notify(this, "Position2");
}
}
}
private int speed2;
public int Speed2
{
get { return speed2; }
set
{
if (speed2 != value)
{
speed = value;
PropertyChanged.Notify(this, "Speed2");
}
}
}
public int Position { get; set; }
private int ad;
public int AD
{
get { return ad; }
set
{
if (ad != value)
{
ad = value;
PropertyChanged.Notify(this, "AD");
}
}
}
private UInt16 istatus;
public UInt16 IStatus
{
get { return istatus; }
set
{
if (istatus != value)
{
istatus = value;
PropertyChanged.Notify(this, "IStatus");
}
}
}
public int Speed { get; set; }
private UInt16 ostatus = 0xf;
public UInt16 OStatus
{
get { return ostatus; }
set
{
if (ostatus != value)
{
ostatus = value;
PropertyChanged.Notify(this, "OStatus");
}
}
}
private double timespan1ms;
public double TimeSpan1ms
{
get { return timespan1ms; }
set
{
if (timespan1ms != value)
{
timespan1ms = value;
PropertyChanged.Notify(this, "TimeSpan1ms");
}
}
}
int surplus = 8000;
public int Surplus
{
get { return surplus; }
set
{
if (surplus != value)
{
surplus = value;
PropertyChanged.Notify(this, "Surplus");
}
}
}
public int Position2 { get; set; }
public int Speed2 { get; set; }
public int AD { get; set; }
public UInt16 IStatus { get; set; }
public UInt16 OStatus { get; set; } = 0xf;
public double TimeSpan1ms { get; set; }
public int Surplus { get; set; } = 8000;
private DispatcherTimer timer = new DispatcherTimer();
private FLYAD7 flyad;
public FlyADClientUI(FLYAD7 flyad)
......

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.168
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flyad7_WPF", "Flyad7_WPF\Flyad7_WPF.csproj", "{FC6014B3-1105-4F08-B1D1-1F1398C999AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLYAD7_Simulation_Wpf", "FLYAD7_Simulation_Wpf\FLYAD7_Simulation_Wpf.csproj", "{8B4BD389-49FB-48DC-8F40-4C1BA668BDAB}"
......@@ -13,7 +15,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.Simulation", "FLY.Simul
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.Simulation.Flyad7", "FLY.Simulation.Flyad7\FLY.Simulation.Flyad7.csproj", "{AE180A75-FAFA-4C5E-8767-0A26447936B6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.ModbusModule", "..\Project.FLY.ModbusModule\FLY.ModbusModule\FLY.ModbusModule.csproj", "{6D4B9BDA-2A66-4583-B244-758BC4213D9F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.ModbusModule", "..\Project.FLY.ModbusModule\FLY.ModbusModule\FLY.ModbusModule.csproj", "{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Misc", "..\Project.FLY.Misc\MISC\Misc.csproj", "{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}"
EndProject
......@@ -102,16 +104,16 @@ Global
{AE180A75-FAFA-4C5E-8767-0A26447936B6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{AE180A75-FAFA-4C5E-8767-0A26447936B6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{AE180A75-FAFA-4C5E-8767-0A26447936B6}.Release|x86.ActiveCfg = Release|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Debug|x86.ActiveCfg = Debug|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Release|Any CPU.Build.0 = Release|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6D4B9BDA-2A66-4583-B244-758BC4213D9F}.Release|x86.ActiveCfg = Release|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Debug|x86.ActiveCfg = Debug|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Release|Any CPU.Build.0 = Release|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8E19C40F-CE7F-4982-BD90-4EB4E9E04E34}.Release|x86.ActiveCfg = Release|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EE61AC6-5269-4F0F-B8FA-4334FE4A678F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
......@@ -176,4 +178,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CC160EA9-7336-4902-8485-5BF918EE8F68}
EndGlobalSection
EndGlobal
......@@ -5,6 +5,7 @@ using System.Text;
using System.ComponentModel;
using FlyADBase;
using Misc;
using System.Windows.Threading;
namespace Flyad7_WPF
{
......@@ -14,48 +15,14 @@ namespace Flyad7_WPF
public class AutoForwBackw : INotifyPropertyChanged
{
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
DispatcherTimer timer = new DispatcherTimer();
FlyAD7 flyad;
public bool FB_Enable { get; set; }
private bool fbenable = false;
public bool FB_Enable
{
get { return fbenable; }
set
{
if (fbenable != value)
{
fbenable = value;
PropertyChanged.Notify(this, "FB_Enable");
}
}
}
private int fb_pos1 = 1000;
private int fb_pos2 = 3000;
public int FB_Pos1
{
get { return fb_pos1; }
set
{
if (fb_pos1 != value)
{
fb_pos1 = value;
PropertyChanged.Notify(this, "FB_Pos1");
}
}
}
public int FB_Pos2
{
get { return fb_pos2; }
set
{
if (fb_pos2 != value)
{
fb_pos2 = value;
PropertyChanged.Notify(this, "FB_Pos2");
}
}
}
public int FB_Pos1 { get; set; } = 1000;
public int FB_Pos2 { get; set; } = 3000;
public AutoForwBackw(FlyAD7 flyad)
{
......@@ -84,7 +51,7 @@ namespace Flyad7_WPF
}
void FB_init()
{
timer.Interval = 1000;
timer.Interval = TimeSpan.FromSeconds(1);
timer.Tick += new EventHandler(timer_Tick);
FB_Enable = false;
this.PropertyChanged += new PropertyChangedEventHandler(MainWindow_PropertyChanged);
......
......@@ -10,104 +10,21 @@ namespace Flyad7_WPF
public class DebugAppParam : INotifyPropertyChanged
{
private string epstr = "192.168.251.10:20006";
public string EPStr
{
get
{
return epstr;
}
set
{
if (epstr != value)
{
epstr = value;
PropertyChanged.Notify(this, "EPStr");
}
}
}
private bool hastg = false;
public bool HasTimeGrid
{
get
{
return hastg;
}
set
{
if (hastg != value)
{
hastg = value;
PropertyChanged.Notify(this, "HasTimeGrid");
}
}
}
private bool hasGrid = false;
public bool HasGrid
{
get { return hasGrid; }
set
{
if (hasGrid != value)
{
hasGrid = value;
PropertyChanged.Notify(this, "HasGrid");
}
}
}
public string EPStr { get; set; }
private bool hasGridAdv = false;
public bool HasGridAdv
{
get { return hasGridAdv; }
set
{
if (hasGridAdv != value)
{
hasGridAdv = value;
PropertyChanged.Notify(this, "HasGridAdv");
}
}
}
private bool hascrc = false;
public bool HasCRC
{
get { return hascrc; }
set
{
if (hascrc != value)
{
hascrc = value;
PropertyChanged.Notify(this, "HasCRC");
}
}
}
public bool HasTimeGrid { get; set; }
private int fb_pos1 = 1000;
private int fb_pos2 = 3000;
public int FB_Pos1
{
get { return fb_pos1; }
set
{
if (fb_pos1 != value)
{
fb_pos1 = value;
PropertyChanged.Notify(this, "FB_Pos1");
}
}
}
public int FB_Pos2
{
get { return fb_pos2; }
set
{
if (fb_pos2 != value)
{
fb_pos2 = value;
PropertyChanged.Notify(this, "FB_Pos2");
}
}
}
public bool HasGrid { get; set; }
public bool HasGridAdv { get; set; }
public bool HasCRC { get; set; }
public int FB_Pos1 { get; set; } = 1000;
public int FB_Pos2 { get; set; } = 3000;
public UInt32 Velocity;
public UInt32 SVelocity;
......
......@@ -10,90 +10,18 @@ namespace Flyad7_WPF
{
public class FlyADClientUI : INotifyPropertyChanged
{
private DateTime now;
public DateTime Now
{
get
{
return now;
}
set
{
if (now != value)
{
now = value;
PropertyChanged.Notify(this, "Now");
}
}
}
public DateTime Now { get; set; }
private int position;
public int Position
{
get { return position; }
set
{
if (position != value)
{
position = value;
PropertyChanged.Notify(this, "Position");
}
}
}
private int speed;
public int Speed
{
get { return speed; }
set
{
if (speed != value)
{
speed = value;
PropertyChanged.Notify(this, "Speed");
}
}
}
private int position2;
public int Position2
{
get { return position2; }
set
{
if (position2 != value)
{
position2 = value;
PropertyChanged.Notify(this, "Position2");
}
}
}
private int speed2;
public int Speed2
{
get { return speed2; }
set
{
if (speed2 != value)
{
speed2 = value;
PropertyChanged.Notify(this, "Speed2");
}
}
}
public int Position { get; set; }
public int Speed { get; set; }
public int Position2 { get; set; }
public int Speed2 { get; set; }
private int ad;
public int AD
{
get { return ad; }
set
{
if (ad != value)
{
ad = value;
PropertyChanged.Notify(this, "AD");
}
}
}
public int AD { get; set; }
private DispatcherTimer timer = new DispatcherTimer();
private FlyAD7 flyad;
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\PropertyChanged2.Fody.2.6.0\build\PropertyChanged2.Fody.props" Condition="Exists('..\packages\PropertyChanged2.Fody.2.6.0\build\PropertyChanged2.Fody.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
......@@ -16,6 +17,8 @@
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
......@@ -43,6 +46,9 @@
<ApplicationIcon>chip_128px_1093586_easyicon.net.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="PropertyChanged2, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ee3ee20bcf148ddd, processorArchitecture=MSIL">
<HintPath>..\packages\PropertyChanged2.Fody.2.6.0\lib\net40\PropertyChanged2.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
......@@ -131,6 +137,7 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......@@ -154,7 +161,20 @@
<ItemGroup>
<Resource Include="chip_128px_1093586_easyicon.net.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="FodyWeavers.xml">
<SubType>Designer</SubType>
</Resource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.3.3.5\build\Fody.targets" Condition="Exists('..\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('..\packages\Fody.3.3.5\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.3.5\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\PropertyChanged2.Fody.2.6.0\build\PropertyChanged2.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\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.
<Target Name="BeforeBuild">
......
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanged2 />
</Weavers>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="PropertyChanged2" minOccurs="0" maxOccurs="1" type="xs:anyType" />
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<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