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

小修改

parent 5d83800f
...@@ -29,5 +29,5 @@ namespace FObjBase ...@@ -29,5 +29,5 @@ namespace FObjBase
} }
} }
public delegate void AsyncCBHandler(object AsyncState, object retData); public delegate void AsyncCBHandler(object asyncContext, object retData);
} }
...@@ -23,6 +23,7 @@ namespace FlyADBase ...@@ -23,6 +23,7 @@ namespace FlyADBase
/// ///
/// </summary> /// </summary>
public int Marker { get; set; } public int Marker { get; set; }
public Misc.DIRECTION Direction { get; set; }
/// <summary> /// <summary>
/// 数据 /// 数据
/// </summary> /// </summary>
......
...@@ -429,7 +429,12 @@ namespace FlyADBase ...@@ -429,7 +429,12 @@ namespace FlyADBase
gridAdvUnit.ad = CorrectAD(gridAdvUnit.pos / PosOfGrid, gridAdvUnit.ad); gridAdvUnit.ad = CorrectAD(gridAdvUnit.pos / PosOfGrid, gridAdvUnit.ad);
} }
} }
TimeGridAdvEvent(this, new TimeGridAdvEventArgs() { Data = gridAdvUnits, Marker = pushGridInfo.marker }); TimeGridAdvEvent(this,
new TimeGridAdvEventArgs() {
Data = gridAdvUnits,
Marker = pushGridInfo.marker,
Direction = pushGridInfo.direction
});
} }
pushGridInfo = null; pushGridInfo = null;
......
...@@ -117,6 +117,7 @@ namespace FlyADBase ...@@ -117,6 +117,7 @@ namespace FlyADBase
/// <param name="grid_len">grid 长度</param> /// <param name="grid_len">grid 长度</param>
/// <param name="dat">grid 数据</param> /// <param name="dat">grid 数据</param>
void GetGrid(DIRECTION direction, int grid_start, int grid_len, out int[] dat); void GetGrid(DIRECTION direction, int grid_start, int grid_len, out int[] dat);
/// <summary> /// <summary>
/// 从正反缓存区, 获取全部grid数据 /// 从正反缓存区, 获取全部grid数据
/// </summary> /// </summary>
...@@ -132,6 +133,7 @@ namespace FlyADBase ...@@ -132,6 +133,7 @@ namespace FlyADBase
/// <param name="dat"></param> /// <param name="dat"></param>
/// <param name="adLag">测试功能 ad值滞后</param> /// <param name="adLag">测试功能 ad值滞后</param>
void ToGrid(IEnumerable<GridAdvUnit> gridAdvUnits, out int[] dat,int adLag); void ToGrid(IEnumerable<GridAdvUnit> gridAdvUnits, out int[] dat,int adLag);
/// <summary> /// <summary>
/// 动作完成 /// 动作完成
/// </summary> /// </summary>
......
...@@ -12,5 +12,9 @@ namespace Flyad7_WPF ...@@ -12,5 +12,9 @@ namespace Flyad7_WPF
/// </summary> /// </summary>
public partial class App : Application public partial class App : Application
{ {
public App()
{
App.Current.Properties["Container"] = UnityExt.Container;
}
} }
} }
...@@ -44,25 +44,25 @@ namespace Flyad7_WPF ...@@ -44,25 +44,25 @@ namespace Flyad7_WPF
public RelayCommand StartCmd { get; private set; } public RelayCommand StartCmd { get; private set; }
public RelayCommand StopCmd { get; private set; } public RelayCommand StopCmd { get; private set; }
public RelayCommand AnalyzeCmd { get; private set; }
List<IEnumerable<GridAdvUnit>> gridAdvUnits = new List<IEnumerable<GridAdvUnit>>(); List<IEnumerable<GridAdvUnit>> gridAdvUnits = new List<IEnumerable<GridAdvUnit>>();
public AutoGetGridAdv() public AutoGetGridAdv(FlyAD7 flyad)
{ {
this.flyad = flyad;
StartCmd = new RelayCommand(Start); StartCmd = new RelayCommand(Start);
StopCmd = new RelayCommand(Stop); StopCmd = new RelayCommand(Stop);
AnalyzeCmd = new RelayCommand(Analyze);
Load(); Load();
}
public void Init(FlyAD7 flyad)
{
this.PropertyChanged += AutoSave; this.PropertyChanged += AutoSave;
this.flyad = flyad;
} }
CancellationTokenSource cancellationTokenSource; CancellationTokenSource cancellationTokenSource;
public async void Start() async void Start()
{ {
if (IsRunning) if (IsRunning)
...@@ -159,7 +159,7 @@ namespace Flyad7_WPF ...@@ -159,7 +159,7 @@ namespace Flyad7_WPF
} }
} }
} }
public void Stop() void Stop()
{ {
if (!IsRunning) if (!IsRunning)
return; return;
...@@ -171,7 +171,12 @@ namespace Flyad7_WPF ...@@ -171,7 +171,12 @@ namespace Flyad7_WPF
cancellationTokenSource.Cancel(); cancellationTokenSource.Cancel();
} }
private void Analyze()
{
WdGridAdvAnalyze wd = new WdGridAdvAnalyze();
wd.Init();
wd.ShowDialog();
}
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
private bool isIgnoreSave; private bool isIgnoreSave;
...@@ -196,7 +201,7 @@ namespace Flyad7_WPF ...@@ -196,7 +201,7 @@ namespace Flyad7_WPF
{ {
try try
{ {
string json = Newtonsoft.Json.JsonConvert.SerializeObject(this); string json = Newtonsoft.Json.JsonConvert.SerializeObject(this, Formatting.Indented);
File.WriteAllText("autoGridAdv.json", json); File.WriteAllText("autoGridAdv.json", json);
} }
catch (Exception e ) catch (Exception e )
......
...@@ -124,7 +124,7 @@ namespace Flyad7_WPF ...@@ -124,7 +124,7 @@ namespace Flyad7_WPF
public double FilmVelocity { get; set; } public double FilmVelocity { get; set; }
public AutoSync() public AutoSync(FlyAD7 flyad)
{ {
ScanBegin = 484; ScanBegin = 484;
ScanWidth = 4000; ScanWidth = 4000;
...@@ -151,10 +151,10 @@ namespace Flyad7_WPF ...@@ -151,10 +151,10 @@ namespace Flyad7_WPF
Load(); Load();
Init(flyad);
} }
public void Init(IFlyADClient flyad) void Init(IFlyADClient flyad)
{ {
mFlyAD = flyad; mFlyAD = flyad;
Misc.BindingOperations.SetBinding(mFlyAD, new string[] { "Ratio02", "Ratio01" }, Misc.BindingOperations.SetBinding(mFlyAD, new string[] { "Ratio02", "Ratio01" },
......
...@@ -48,9 +48,6 @@ namespace Flyad7_WPF ...@@ -48,9 +48,6 @@ namespace Flyad7_WPF
public DebugAppParam() public DebugAppParam()
{ {
Load(); Load();
}
public void Init()
{
this.PropertyChanged += AutoSave; this.PropertyChanged += AutoSave;
} }
...@@ -60,7 +57,7 @@ namespace Flyad7_WPF ...@@ -60,7 +57,7 @@ namespace Flyad7_WPF
if (isIgnoreSave) if (isIgnoreSave)
return; return;
if (this.GetType().GetProperty(e.PropertyName).GetCustomAttributes(typeof(JsonPropertyAttribute), false).Count() > 0) //if (this.GetType().GetProperty(e.PropertyName).GetCustomAttributes(typeof(JsonPropertyAttribute), false).Count() > 0)
{ {
isIgnoreSave = true; isIgnoreSave = true;
await Task.Delay(5000);//Task.Yield(); await Task.Delay(5000);//Task.Yield();
...@@ -72,7 +69,7 @@ namespace Flyad7_WPF ...@@ -72,7 +69,7 @@ namespace Flyad7_WPF
{ {
try try
{ {
string json = JsonConvert.SerializeObject(this); string json = JsonConvert.SerializeObject(this, Formatting.Indented);
File.WriteAllText("param.json", json); File.WriteAllText("param.json", json);
} }
catch { catch {
......
...@@ -80,6 +80,15 @@ ...@@ -80,6 +80,15 @@
<Compile Include="DebugAppParam.cs" /> <Compile Include="DebugAppParam.cs" />
<Compile Include="FlyADClientUI.cs" /> <Compile Include="FlyADClientUI.cs" />
<Compile Include="GridAdvVm.cs" /> <Compile Include="GridAdvVm.cs" />
<Compile Include="UnityExt.cs" />
<Compile Include="WdConvolution\WdConvolution.xaml.cs">
<DependentUpon>WdConvolution.xaml</DependentUpon>
</Compile>
<Compile Include="WdConvolution\WdConvolutionVm.cs" />
<Compile Include="WdGridAdvAnalyze\WdGridAdvAnalyzeVm.cs" />
<Compile Include="WdGridAdvAnalyze\WdGridAdvAnalyze.xaml.cs">
<DependentUpon>WdGridAdvAnalyze.xaml</DependentUpon>
</Compile>
<Compile Include="Window1.xaml.cs"> <Compile Include="Window1.xaml.cs">
<DependentUpon>Window1.xaml</DependentUpon> <DependentUpon>Window1.xaml</DependentUpon>
</Compile> </Compile>
...@@ -111,6 +120,22 @@ ...@@ -111,6 +120,22 @@
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Page Include="WdConvolution\WdConvolution.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="WdConvolution\WdConvolutionStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="WdGridAdvAnalyze\WdGridAdvAnalyze.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="WdGridAdvAnalyze\WdGridAdvAnalyzeStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Window1.xaml"> <Page Include="Window1.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -175,9 +200,6 @@ ...@@ -175,9 +200,6 @@
<Resource Include="chip_128px_1093586_easyicon.net.ico" /> <Resource Include="chip_128px_1093586_easyicon.net.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper">
<Version>9.0.0</Version>
</PackageReference>
<PackageReference Include="Costura.Fody"> <PackageReference Include="Costura.Fody">
<Version>3.3.3</Version> <Version>3.3.3</Version>
</PackageReference> </PackageReference>
...@@ -186,6 +208,9 @@ ...@@ -186,6 +208,9 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="MathNet.Numerics">
<Version>4.9.0</Version>
</PackageReference>
<PackageReference Include="MvvmLightLibs"> <PackageReference Include="MvvmLightLibs">
<Version>5.4.1.1</Version> <Version>5.4.1.1</Version>
</PackageReference> </PackageReference>
...@@ -195,6 +220,12 @@ ...@@ -195,6 +220,12 @@
<PackageReference Include="PropertyChanged.Fody"> <PackageReference Include="PropertyChanged.Fody">
<Version>2.6.1</Version> <Version>2.6.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Unity">
<Version>5.11.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Core\" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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.
......
...@@ -22,112 +22,32 @@ namespace Flyad7_WPF ...@@ -22,112 +22,32 @@ namespace Flyad7_WPF
public RelayCommand LoadCmd { get; private set; } public RelayCommand LoadCmd { get; private set; }
public RelayCommand CalAdLagCmd { get; private set; } public RelayCommand CalAdLagCmd { get; private set; }
Chart chart3; Chart chart3 = null;
FlyAD7 flyad; FlyAD7 flyad;
int timeGridAdvIndex = 0; int timeGridAdvIndex = 0;
List<IEnumerable<GridAdvUnit>> gridAdvUnits = new List<IEnumerable<GridAdvUnit>>(); List<IEnumerable<GridAdvUnit>> gridAdvUnits = new List<IEnumerable<GridAdvUnit>>();
public GridAdvVm() public GridAdvVm(FlyAD7 flyad)
{ {
SaveCmd = new RelayCommand(Save); SaveCmd = new RelayCommand(Save);
LoadCmd = new RelayCommand(Load); LoadCmd = new RelayCommand(Load);
CalAdLagCmd = new RelayCommand(CalAdLag); CalAdLagCmd = new RelayCommand(CalAdLag);
}
public void Init(Chart chart3, FlyAD7 flyad)
{
this.chart3 = chart3;
this.flyad = flyad;
InitializeComponent4();
this.flyad = flyad;
flyad.TimeGridAdvEvent += flyad_TimeGridAdvEvent; flyad.TimeGridAdvEvent += flyad_TimeGridAdvEvent;
} }
public void Init(Chart chart)
void InitializeComponent4()
{ {
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); this.chart3 = chart;
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
//
// chart1
//
chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.BackColor = System.Drawing.Color.OldLace;
//chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom;
//chartArea1.BackSecondaryColor = System.Drawing.Color.White;
chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
chartArea1.Name = "Default";
chartArea1.ShadowColor = System.Drawing.Color.Transparent;
chartArea1.CursorX.IsUserEnabled = true;
chartArea1.CursorX.IsUserSelectionEnabled = true;
chartArea1.CursorX.SelectionColor = System.Drawing.SystemColors.Highlight;
chartArea1.CursorY.IsUserEnabled = true;
chartArea1.CursorY.IsUserSelectionEnabled = true;
chartArea1.CursorY.SelectionColor = System.Drawing.SystemColors.Highlight;
//对数坐标
//chartArea1.AxisY.IsLogarithmic = true;
//chartArea1.AxisY.LogarithmBase = Math.E;
chart3.ChartAreas.Add(chartArea1);
legend1.BackColor = System.Drawing.Color.Transparent;
legend1.Enabled = true;
legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
legend1.Alignment = System.Drawing.StringAlignment.Near;
legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Right;
legend1.IsDockedInsideChartArea = true;
legend1.DockedToChartArea = chartArea1.Name;
//legend1.IsTextAutoFit = false;
legend1.Name = "Default";
chart3.Legends.Add(legend1);
series1.Name = "Series 1";
series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105)))));
series1.BorderWidth = 3;
series1.ChartArea = chartArea1.Name;
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
series1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(65)))), ((int)(((byte)(140)))), ((int)(((byte)(240)))));
series1.Legend = legend1.Name;
series1.LegendText = "Series 1";
series1.ShadowColor = System.Drawing.Color.Black;
series1.ShadowOffset = 2;
series1.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int32;
series1.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int32;
chart3.Series.Add(series1);
series2.Name = "Series 2";
series2.BorderColor = System.Drawing.Color.Pink;
series2.BorderWidth = 3;
series2.ChartArea = chartArea1.Name;
series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
series2.Color = System.Drawing.Color.Red;
series2.Legend = legend1.Name;
series2.LegendText = "Series 2";
series2.ShadowColor = System.Drawing.Color.Black;
series2.ShadowOffset = 2;
series2.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int32;
series2.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int32;
chart3.Series.Add(series2);
//this.chart1.Location = new System.Drawing.Point(16, 32);
chart3.Name = "chart3";
chart3.BackColor = System.Drawing.Color.Transparent;
} }
#region timeGridAdv #region timeGridAdv
private async void flyad_TimeGridAdvEvent(object sender, TimeGridAdvEventArgs e) private async void flyad_TimeGridAdvEvent(object sender, TimeGridAdvEventArgs e)
{ {
if (chart3 == null)
return;
if (!HasGridAdv) if (!HasGridAdv)
return; return;
...@@ -152,6 +72,8 @@ namespace Flyad7_WPF ...@@ -152,6 +72,8 @@ namespace Flyad7_WPF
void DrawGridAdv(IEnumerable<GridAdvUnit> units, int adLag = 0) void DrawGridAdv(IEnumerable<GridAdvUnit> units, int adLag = 0)
{ {
if (chart3 == null)
return;
flyad.ToGrid(units, out int[] datas, adLag); flyad.ToGrid(units, out int[] datas, adLag);
//画图 //画图
timeGridAdvIndex++; timeGridAdvIndex++;
......
...@@ -399,6 +399,7 @@ ...@@ -399,6 +399,7 @@
<GroupBox x:Name="gbAutoGetGridAdv" Header="自动采集不同速度TimeGridAdv" d:DataContext="{d:DesignInstance Type=local:AutoGetGridAdv}" > <GroupBox x:Name="gbAutoGetGridAdv" Header="自动采集不同速度TimeGridAdv" d:DataContext="{d:DesignInstance Type=local:AutoGetGridAdv}" >
<StackPanel > <StackPanel >
<StackPanel Orientation="Horizontal" > <StackPanel Orientation="Horizontal" >
<Button Style="{StaticResource ButtonStyle}" Content="数据分析" Command="{Binding AnalyzeCmd}" />
<Button Style="{StaticResource ButtonStyle}" Content="开始" Command="{Binding StartCmd}" /> <Button Style="{StaticResource ButtonStyle}" Content="开始" Command="{Binding StartCmd}" />
<Button Style="{StaticResource ButtonStyle}" Content="停止" Command="{Binding StopCmd}" /> <Button Style="{StaticResource ButtonStyle}" Content="停止" Command="{Binding StopCmd}" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
......
...@@ -23,6 +23,7 @@ using System.Windows.Forms.DataVisualization.Charting; ...@@ -23,6 +23,7 @@ using System.Windows.Forms.DataVisualization.Charting;
using Microsoft.Win32; using Microsoft.Win32;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Unity;
namespace Flyad7_WPF namespace Flyad7_WPF
{ {
...@@ -31,6 +32,7 @@ namespace Flyad7_WPF ...@@ -31,6 +32,7 @@ namespace Flyad7_WPF
/// </summary> /// </summary>
public partial class MainWindow : Window,INotifyPropertyChanged public partial class MainWindow : Window,INotifyPropertyChanged
{ {
IUnityContainer Container;
FlyAD7 flyad; FlyAD7 flyad;
DebugAppParam param; DebugAppParam param;
AutoForwBackw autofb; AutoForwBackw autofb;
...@@ -43,28 +45,21 @@ namespace Flyad7_WPF ...@@ -43,28 +45,21 @@ namespace Flyad7_WPF
InitializeComponent(); InitializeComponent();
InitializeComponent2(); InitializeComponent2();
InitializeComponent3(); InitializeComponent3();
InitializeComponent4();
Init();
}
param = new DebugAppParam(); public void Init()
param.Init(); {
Container = App.Current.Properties["Container"] as IUnityContainer;
flyad = new FlyAD7(); param = Container.Resolve<DebugAppParam>();
Misc.BindingOperations.SetBinding(param, "HasCRC", flyad, "HasCRC"); flyad = Container.Resolve<FlyAD7>();
autofb = Container.Resolve<AutoForwBackw>();
autofb = new AutoForwBackw(flyad); flyad_clientui = Container.Resolve<FlyADClientUI>();
Misc.BindingOperations.SetBinding(param, "FB_Pos1", autofb, "FB_Pos1", Misc.BindingOperations.BindingMode.TwoWay); autoGetGridAdv = Container.Resolve<AutoGetGridAdv>();
Misc.BindingOperations.SetBinding(param, "FB_Pos2", autofb, "FB_Pos2", Misc.BindingOperations.BindingMode.TwoWay); mAutoSync = Container.Resolve<AutoSync>();
gridAdvVm = Container.Resolve<GridAdvVm>();
flyad_clientui = new FlyADClientUI(flyad); gridAdvVm.Init(chart3);
autoGetGridAdv = new AutoGetGridAdv();
autoGetGridAdv.Init(flyad);
mAutoSync = new AutoSync();
mAutoSync.Init(flyad);
gridAdvVm = new GridAdvVm();
gridAdvVm.Init(chart3, flyad);
Misc.BindingOperations.SetBinding(param, "HasGridAdv", gridAdvVm, "HasGridAdv",Misc.BindingOperations.BindingMode.TwoWay);
this.DataContext = flyad; this.DataContext = flyad;
...@@ -79,12 +74,9 @@ namespace Flyad7_WPF ...@@ -79,12 +74,9 @@ namespace Flyad7_WPF
flyad.TimeGridEvent += flyad_TimeGridEvent; flyad.TimeGridEvent += flyad_TimeGridEvent;
FObjBase.PollModule.Current.Start(); FObjBase.PollModule.Current.Start();
} }
/// <summary> /// <summary>
/// grid图 /// grid图
/// </summary> /// </summary>
...@@ -220,6 +212,87 @@ namespace Flyad7_WPF ...@@ -220,6 +212,87 @@ namespace Flyad7_WPF
this.chart2.BackColor = System.Drawing.Color.Transparent; this.chart2.BackColor = System.Drawing.Color.Transparent;
} }
void InitializeComponent4()
{
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
//
// chart1
//
chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.BackColor = System.Drawing.Color.OldLace;
//chartArea1.BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom;
//chartArea1.BackSecondaryColor = System.Drawing.Color.White;
chartArea1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
chartArea1.Name = "Default";
chartArea1.ShadowColor = System.Drawing.Color.Transparent;
chartArea1.CursorX.IsUserEnabled = true;
chartArea1.CursorX.IsUserSelectionEnabled = true;
chartArea1.CursorX.SelectionColor = System.Drawing.SystemColors.Highlight;
chartArea1.CursorY.IsUserEnabled = true;
chartArea1.CursorY.IsUserSelectionEnabled = true;
chartArea1.CursorY.SelectionColor = System.Drawing.SystemColors.Highlight;
//对数坐标
//chartArea1.AxisY.IsLogarithmic = true;
//chartArea1.AxisY.LogarithmBase = Math.E;
chart3.ChartAreas.Add(chartArea1);
legend1.BackColor = System.Drawing.Color.Transparent;
legend1.Enabled = true;
legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
legend1.Alignment = System.Drawing.StringAlignment.Near;
legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Right;
legend1.IsDockedInsideChartArea = true;
legend1.DockedToChartArea = chartArea1.Name;
//legend1.IsTextAutoFit = false;
legend1.Name = "Default";
chart3.Legends.Add(legend1);
series1.Name = "Series 1";
series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105)))));
series1.BorderWidth = 3;
series1.ChartArea = chartArea1.Name;
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
series1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(65)))), ((int)(((byte)(140)))), ((int)(((byte)(240)))));
series1.Legend = legend1.Name;
series1.LegendText = "Series 1";
series1.ShadowColor = System.Drawing.Color.Black;
series1.ShadowOffset = 2;
series1.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int32;
series1.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int32;
chart3.Series.Add(series1);
series2.Name = "Series 2";
series2.BorderColor = System.Drawing.Color.Pink;
series2.BorderWidth = 3;
series2.ChartArea = chartArea1.Name;
series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
series2.Color = System.Drawing.Color.Red;
series2.Legend = legend1.Name;
series2.LegendText = "Series 2";
series2.ShadowColor = System.Drawing.Color.Black;
series2.ShadowOffset = 2;
series2.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int32;
series2.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int32;
chart3.Series.Add(series2);
//this.chart1.Location = new System.Drawing.Point(16, 32);
chart3.Name = "chart3";
chart3.BackColor = System.Drawing.Color.Transparent;
}
#region grid #region grid
void flyad_GridEvent(object sender, MiniGridEventArgs e) void flyad_GridEvent(object sender, MiniGridEventArgs e)
{ {
......
...@@ -95,6 +95,8 @@ ...@@ -95,6 +95,8 @@
<sys:String x:Key="strMonth">Month</sys:String> <sys:String x:Key="strMonth">Month</sys:String>
<sys:String x:Key="strOrgInterval">OrgInterval</sys:String> <sys:String x:Key="strOrgInterval">OrgInterval</sys:String>
<sys:String x:Key="strGageLength">GageLength</sys:String> <sys:String x:Key="strGageLength">GageLength</sys:String>
<sys:String x:Key="strTimeGridAdv">TimeGridAdv</sys:String>
<sys:String x:Key="strAdLag">AdLag</sys:String>
<sys:String x:Key="strEncoder1Scale">Encoder1Scale</sys:String> <sys:String x:Key="strEncoder1Scale">Encoder1Scale</sys:String>
<sys:String x:Key="strEncoder2Scale">Encoder2Scale</sys:String> <sys:String x:Key="strEncoder2Scale">Encoder2Scale</sys:String>
<sys:String x:Key="strMmOfPulse">mm/Pulse</sys:String> <sys:String x:Key="strMmOfPulse">mm/Pulse</sys:String>
......
...@@ -99,6 +99,8 @@ ...@@ -99,6 +99,8 @@
<sys:String x:Key="strMonth">月</sys:String> <sys:String x:Key="strMonth">月</sys:String>
<sys:String x:Key="strOrgInterval">归零间隔</sys:String> <sys:String x:Key="strOrgInterval">归零间隔</sys:String>
<sys:String x:Key="strGageLength">机架长度</sys:String> <sys:String x:Key="strGageLength">机架长度</sys:String>
<sys:String x:Key="strTimeGridAdv">高级AD数据</sys:String>
<sys:String x:Key="strAdLag">AD滞后</sys:String>
<sys:String x:Key="strEncoder1Scale">编码器1比例</sys:String> <sys:String x:Key="strEncoder1Scale">编码器1比例</sys:String>
<sys:String x:Key="strEncoder2Scale">编码器2比例</sys:String> <sys:String x:Key="strEncoder2Scale">编码器2比例</sys:String>
<sys:String x:Key="strMmOfPulse">mm/脉冲</sys:String> <sys:String x:Key="strMmOfPulse">mm/脉冲</sys:String>
......
...@@ -36,7 +36,6 @@ namespace ThickTcpUiInWindow ...@@ -36,7 +36,6 @@ namespace ThickTcpUiInWindow
if (!serverep.Equals(value)) if (!serverep.Equals(value))
{ {
serverep = new IPEndPoint(value.Address, value.Port); serverep = new IPEndPoint(value.Address, value.Port);
NotifyPropertyChanged("ServerIPEP");
} }
} }
} }
...@@ -59,7 +58,6 @@ namespace ThickTcpUiInWindow ...@@ -59,7 +58,6 @@ namespace ThickTcpUiInWindow
if (!string.IsNullOrEmpty(value)) if (!string.IsNullOrEmpty(value))
{ {
_language = value; _language = value;
NotifyPropertyChanged("Language");
} }
} }
} }
......
...@@ -40,6 +40,10 @@ namespace FLY.Thick.Base.Client ...@@ -40,6 +40,10 @@ namespace FLY.Thick.Base.Client
/// </summary> /// </summary>
public int PosOfGrid { get; set; } = 10; public int PosOfGrid { get; set; } = 10;
/// <summary>
/// timeGridAdv 使能
/// </summary>
public bool IsTimeGridAdvEnabled { get; set; }
/// <summary> /// <summary>
/// ad 滞后量 ms /// ad 滞后量 ms
/// </summary> /// </summary>
...@@ -186,6 +190,7 @@ namespace FLY.Thick.Base.Client ...@@ -186,6 +190,7 @@ namespace FLY.Thick.Base.Client
{ {
poslength = PosLength, poslength = PosLength,
auto_org_interval = AutoOrgInterval, auto_org_interval = AutoOrgInterval,
isTimeGridAdvEnabled = IsTimeGridAdvEnabled,
adlag = ADLag, adlag = ADLag,
encoder1_mmpp = Encoder1_mmpp, encoder1_mmpp = Encoder1_mmpp,
...@@ -252,6 +257,7 @@ namespace FLY.Thick.Base.Client ...@@ -252,6 +257,7 @@ namespace FLY.Thick.Base.Client
PosLength = p.poslength; PosLength = p.poslength;
AutoOrgInterval = p.auto_org_interval; AutoOrgInterval = p.auto_org_interval;
PosOfGrid = p.posOfGrid; PosOfGrid = p.posOfGrid;
IsTimeGridAdvEnabled = p.isTimeGridAdvEnabled;
ADLag = p.adlag; ADLag = p.adlag;
Encoder1_mmpp = p.encoder1_mmpp; Encoder1_mmpp = p.encoder1_mmpp;
......
...@@ -14,6 +14,7 @@ namespace FLY.Thick.Base.IService ...@@ -14,6 +14,7 @@ namespace FLY.Thick.Base.IService
/// </summary> /// </summary>
int PosLength { get; set; } int PosLength { get; set; }
bool IsTimeGridAdvEnabled { get; set; }
int ADLag { get; set; } int ADLag { get; set; }
int PosOfGrid { get; } int PosOfGrid { get; }
......
...@@ -16,8 +16,9 @@ namespace FLY.Thick.Base.OBJ_INTERFACE ...@@ -16,8 +16,9 @@ namespace FLY.Thick.Base.OBJ_INTERFACE
public int auto_org_interval; public int auto_org_interval;
public double encoder1_mmpp; public double encoder1_mmpp;
public bool isTimeGridAdvEnabled;
public int adlag; public int adlag;
public int posOfGrid; public int posOfGrid;
public double speed1scale; public double speed1scale;
......
...@@ -52,6 +52,7 @@ namespace FLY.Thick.Base.Server.OBJProxy ...@@ -52,6 +52,7 @@ namespace FLY.Thick.Base.Server.OBJProxy
encoder1_mmpp = mInitparam.Encoder1_mmpp, encoder1_mmpp = mInitparam.Encoder1_mmpp,
speed1scale = mInitparam.Speed1Scale, speed1scale = mInitparam.Speed1Scale,
adlag = mInitparam.ADLag, adlag = mInitparam.ADLag,
isTimeGridAdvEnabled = mInitparam.IsTimeGridAdvEnabled,
posOfGrid = mInitparam.PosOfGrid, posOfGrid = mInitparam.PosOfGrid,
filmVSrc = mInitparam.FilmVSrc, filmVSrc = mInitparam.FilmVSrc,
...@@ -97,6 +98,7 @@ namespace FLY.Thick.Base.Server.OBJProxy ...@@ -97,6 +98,7 @@ namespace FLY.Thick.Base.Server.OBJProxy
var p = JsonConvert.DeserializeObject<INITPARAM_OBJ_INTERFACE.Pack_Params>(json); var p = JsonConvert.DeserializeObject<INITPARAM_OBJ_INTERFACE.Pack_Params>(json);
mInitparam.PosLength = p.poslength; mInitparam.PosLength = p.poslength;
mInitparam.IsTimeGridAdvEnabled = p.isTimeGridAdvEnabled;
mInitparam.ADLag = p.adlag; mInitparam.ADLag = p.adlag;
mInitparam.AutoOrgInterval = p.auto_org_interval; mInitparam.AutoOrgInterval = p.auto_org_interval;
mInitparam.Encoder2_mmpp= p.encoder2_mmpp; mInitparam.Encoder2_mmpp= p.encoder2_mmpp;
......
...@@ -18,5 +18,17 @@ using FLY.Thick.BulkDataModule; ...@@ -18,5 +18,17 @@ using FLY.Thick.BulkDataModule;
namespace FLY.Thick.Base.Server namespace FLY.Thick.Base.Server
{ {
/// <summary>
/// int 版的 ad->thick 准备淘汰
/// </summary>
/// <param name="ad"></param>
/// <returns></returns>
[Obsolete("准备 被 AD2ThkHandler 替代")]
public delegate int AD2ThickHandler(int ad); public delegate int AD2ThickHandler(int ad);
/// <summary>
/// double 版的 ad->thick
/// </summary>
/// <param name="ad"></param>
/// <returns></returns>
public delegate double AD2ThkHandler(int ad);
} }
...@@ -26,7 +26,12 @@ namespace FLY.Thick.Base.Server ...@@ -26,7 +26,12 @@ namespace FLY.Thick.Base.Server
public int PosOfGrid { get; set; } = 10; public int PosOfGrid { get; set; } = 10;
/// <summary> /// <summary>
/// ad 滞后量 ms /// timeGridAdv 使能
/// </summary>
public bool IsTimeGridAdvEnabled { get; set; }
/// <summary>
/// ad 滞后量 1.28ms
/// </summary> /// </summary>
public int ADLag { get; set; } public int ADLag { get; set; }
...@@ -197,6 +202,8 @@ namespace FLY.Thick.Base.Server ...@@ -197,6 +202,8 @@ namespace FLY.Thick.Base.Server
{ {
return new string[]{ return new string[]{
"PosLength", "PosLength",
"ADLag",
"IsTimeGridAdvEnabled",
"AutoOrgInterval", "AutoOrgInterval",
"VScan", "VScan",
......
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