Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
248af6bc
Commit
248af6bc
authored
Nov 22, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GridAdv 调试完成
parent
d9662735
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
525 additions
and
220 deletions
+525
-220
FlyADClientAdv.cs
Project.FLY.FlyADBase/FlyADBase/FlyADClientAdv.cs
+6
-4
IFlyADClientAdv.cs
Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs
+3
-1
TimeGridAdvHelper.cs
Project.FLY.FlyADBase/FlyADBase/TimeGridAdvHelper.cs
+240
-119
DebugAppParam.cs
Project.FLY.FlyADBase/Flyad7_WPF/DebugAppParam.cs
+12
-47
Flyad7_WPF.csproj
Project.FLY.FlyADBase/Flyad7_WPF/Flyad7_WPF.csproj
+3
-0
MainWindow.xaml
Project.FLY.FlyADBase/Flyad7_WPF/MainWindow.xaml
+45
-20
MainWindow.xaml.cs
Project.FLY.FlyADBase/Flyad7_WPF/MainWindow.xaml.cs
+216
-29
No files found.
Project.FLY.FlyADBase/FlyADBase/FlyADClientAdv.cs
View file @
248af6bc
...
...
@@ -18,7 +18,7 @@ namespace FlyADBase
/// <summary>
/// 通过脉冲计算速度,不使用AD盒的输出
/// </summary>
public
bool
IsCalSpeed
{
get
;
set
;
}
=
true
;
public
bool
IsCalSpeed
{
get
;
set
;
}
//
= true;
private
int
gridsmooth
=
0
;
/// <summary>
...
...
@@ -97,7 +97,7 @@ namespace FlyADBase
Speed
=
speed
;
Speed2
=
speed2
;
}
},
TimeSpan
.
FromSeconds
(
0.5
));
},
TimeSpan
.
FromSeconds
(
1
));
}
private
void
FlyAD7_PropertyChanged1
(
object
sender
,
System
.
ComponentModel
.
PropertyChangedEventArgs
e
)
...
...
@@ -440,14 +440,16 @@ namespace FlyADBase
#
endregion
}
/// <summary>
/// 转为 grid 数据
/// </summary>
/// <param name="gridAdvUnits"></param>
/// <param name="dat"></param>
public
void
ToGrid
(
IEnumerable
<
GridAdvUnit
>
gridAdvUnits
,
out
int
[]
dat
)
/// <param name="adLag">测试功能,让ad值滞后</param>
public
void
ToGrid
(
IEnumerable
<
GridAdvUnit
>
gridAdvUnits
,
out
int
[]
dat
,
int
adLag
=
0
)
{
dat
=
mTimeGridAdvHelper
.
ToGrid
(
gridAdvUnits
,
PosOfGrid
,
SGrid
.
GRID_MAX_SIZE
);
dat
=
mTimeGridAdvHelper
.
ToGrid
(
gridAdvUnits
,
PosOfGrid
,
SGrid
.
GRID_MAX_SIZE
,
adLag
);
}
class
PushGridInfo
{
...
...
Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs
View file @
248af6bc
...
...
@@ -124,12 +124,14 @@ namespace FlyADBase
/// <param name="dat">grid 数据</param>
void
GetGrid
(
DIRECTION
direction
,
out
int
[]
dat
);
/// <summary>
/// 转为 grid 数据
/// </summary>
/// <param name="gridAdvUnits"></param>
/// <param name="dat"></param>
void
ToGrid
(
IEnumerable
<
GridAdvUnit
>
gridAdvUnits
,
out
int
[]
dat
);
/// <param name="adLag">测试功能 ad值滞后</param>
void
ToGrid
(
IEnumerable
<
GridAdvUnit
>
gridAdvUnits
,
out
int
[]
dat
,
int
adLag
);
/// <summary>
/// 动作完成
/// </summary>
...
...
Project.FLY.FlyADBase/FlyADBase/TimeGridAdvHelper.cs
View file @
248af6bc
This diff is collapsed.
Click to expand it.
Project.FLY.FlyADBase/Flyad7_WPF/DebugAppParam.cs
View file @
248af6bc
...
...
@@ -12,6 +12,7 @@ namespace Flyad7_WPF
public
class
DebugAppParam
:
INotifyPropertyChanged
{
public
string
EPStr
{
get
;
set
;
}
=
"192.168.251.10:20006"
;
public
bool
HasTimeGrid
{
get
;
set
;
}
...
...
@@ -30,12 +31,12 @@ namespace Flyad7_WPF
public
int
FB_Pos2
{
get
;
set
;
}
=
3000
;
public
UInt32
Velocity
;
public
UInt32
SVelocity
;
public
UInt32
ATime
;
public
UInt32
DTime
;
public
UInt32
HVelocity1
;
public
UInt32
HVelocity2
;
public
UInt32
Velocity
{
get
;
set
;
}
public
UInt32
SVelocity
{
get
;
set
;
}
public
UInt32
ATime
{
get
;
set
;
}
public
UInt32
DTime
{
get
;
set
;
}
public
UInt32
HVelocity1
{
get
;
set
;
}
public
UInt32
HVelocity2
{
get
;
set
;
}
public
int
PosLen
;
public
int
ADLag
{
get
;
set
;
}
...
...
@@ -46,52 +47,16 @@ namespace Flyad7_WPF
public
void
Save
()
{
try
{
DebugAppParamJsonDB
param
=
new
DebugAppParamJsonDB
()
{
EPStr
=
EPStr
,
HasTimeGrid
=
HasTimeGrid
,
HasGrid
=
HasGrid
,
HasGridAdv
=
HasGridAdv
,
HasCRC
=
HasCRC
,
FB_Pos1
=
FB_Pos1
,
FB_Pos2
=
FB_Pos2
};
File
.
WriteAllText
(
file_path
,
JsonConvert
.
SerializeObject
(
param
,
Formatting
.
Indented
));
}
catch
{
//异常,没有json 编码失败
}
Misc
.
SaveToXmlHepler
.
Save
(
file_path
,
this
);
}
string
file_path
=
"param.
json
"
;
string
file_path
=
"param.
xml
"
;
public
void
Load
()
{
try
{
if
(
File
.
Exists
(
file_path
))
{
string
json
=
File
.
ReadAllText
(
file_path
);
var
param
=
JsonConvert
.
DeserializeObject
<
DebugAppParamJsonDB
>(
json
);
EPStr
=
param
.
EPStr
;
HasTimeGrid
=
param
.
HasTimeGrid
;
HasGrid
=
param
.
HasGrid
;
HasGridAdv
=
param
.
HasGridAdv
;
HasCRC
=
param
.
HasCRC
;
FB_Pos1
=
param
.
FB_Pos1
;
FB_Pos2
=
param
.
FB_Pos2
;
}
}
catch
{
//异常,没有json 解码失败
}
Misc
.
SaveToXmlHepler
.
Load
(
file_path
,
this
);
}
}
public
class
DebugAppParamJsonDB
{
...
...
Project.FLY.FlyADBase/Flyad7_WPF/Flyad7_WPF.csproj
View file @
248af6bc
...
...
@@ -173,6 +173,9 @@
<Resource
Include=
"chip_128px_1093586_easyicon.net.ico"
/>
</ItemGroup>
<ItemGroup>
<PackageReference
Include=
"AutoMapper"
>
<Version>
9.0.0
</Version>
</PackageReference>
<PackageReference
Include=
"Costura.Fody"
>
<Version>
3.3.3
</Version>
</PackageReference>
...
...
Project.FLY.FlyADBase/Flyad7_WPF/MainWindow.xaml
View file @
248af6bc
...
...
@@ -326,14 +326,19 @@
<TabControl x:Name="tabControl" >
<TabItem Header="TimeGrid">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="141*"/>
<ColumnDefinition Width="524*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Name="stackpanel_graph">
<StackPanel Orientation="Horizontal" Name="stackpanel_graph"
Grid.ColumnSpan="2"
>
<CheckBox Content="接收TimeGrid" IsChecked="{Binding DataContext.HasTimeGrid,ElementName=grid_param}" VerticalAlignment="Center" Margin="3" />
</StackPanel>
<WindowsFormsHost Grid.Row="1">
<WindowsFormsHost Grid.Row="1"
Grid.ColumnSpan="2"
>
<Chr:Chart x:Name="chart2" />
</WindowsFormsHost>
</Grid>
...
...
@@ -366,10 +371,30 @@
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Name="stackpanel_graph_gridadv"
>
<StackPanel Name="stackpanel_graph_gridadv">
<StackPanel Orientation="Horizontal"
>
<CheckBox Content="接收GridAdv" IsChecked="{Binding DataContext.HasGridAdv,ElementName=grid_param}" VerticalAlignment="Center" Margin="3" />
<Button Padding="20,5" Margin="3" Content="保存GridAdv" Click="btnSaveGridAdvClick" />
<Button Padding="20,5" Margin="3" Content="读取GridAdv" Click="btnLoadGridAdvClick" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button Padding="20,5" Margin="3" Content="计算滞后" Click="btnCalAdLagClick" />
<TextBlock Margin="10,0">
当前相关性=<Run Text="{Binding CurrR, StringFormat={}{0:F4}, Mode=OneWay}"/>
</TextBlock>
<StackPanel>
<TextBlock Margin="10,0">
计算进度 AdLag=<Run Text="{Binding ProgressOfAdLag, Mode=OneWay}"/> | R=<Run Text="{Binding ProgressOfR, StringFormat={}{0:F4}, Mode=OneWay}"/>
</TextBlock>
<TextBlock Margin="10,0">
结果 AdLag=<Run Text="{Binding BestAdLag, Mode=OneWay}"/> | R=<Run Text="{Binding BestR, StringFormat={}{0:F4}, Mode=OneWay}"/>
</TextBlock>
</StackPanel>
</StackPanel>
</StackPanel>
<WindowsFormsHost Grid.Row="1">
<Chr:Chart x:Name="chart3" />
</WindowsFormsHost>
...
...
Project.FLY.FlyADBase/Flyad7_WPF/MainWindow.xaml.cs
View file @
248af6bc
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment