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
d9662735
Commit
d9662735
authored
Nov 22, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flyad7_WPF 测试 TimeGridAdv
parent
ba757040
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
283 additions
and
473 deletions
+283
-473
FlyADClientAdv.cs
Project.FLY.FlyADBase/FlyADBase/FlyADClientAdv.cs
+1
-1
IFlyADClientAdv.cs
Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs
+1
-1
TimeGridAdvHelper.cs
Project.FLY.FlyADBase/FlyADBase/TimeGridAdvHelper.cs
+1
-1
BinConverter.cs
Project.FLY.FlyADBase/Flyad7_WPF/Converters/BinConverter.cs
+45
-0
BytesConverter.cs
...ect.FLY.FlyADBase/Flyad7_WPF/Converters/BytesConverter.cs
+55
-0
IO2BinConverter.cs
...ct.FLY.FlyADBase/Flyad7_WPF/Converters/IO2BinConverter.cs
+29
-0
MyConv.xaml
Project.FLY.FlyADBase/Flyad7_WPF/Converters/MyConv.xaml
+7
-0
DebugAppParam.cs
Project.FLY.FlyADBase/Flyad7_WPF/DebugAppParam.cs
+3
-2
Flyad7_WPF.csproj
Project.FLY.FlyADBase/Flyad7_WPF/Flyad7_WPF.csproj
+14
-0
MainWindow.xaml
Project.FLY.FlyADBase/Flyad7_WPF/MainWindow.xaml
+14
-10
MainWindow.xaml.cs
Project.FLY.FlyADBase/Flyad7_WPF/MainWindow.xaml.cs
+72
-198
Window1.xaml
Project.FLY.FlyADBase/Flyad7_WPF/Window1.xaml
+12
-0
Window1.xaml.cs
Project.FLY.FlyADBase/Flyad7_WPF/Window1.xaml.cs
+27
-0
Window_setAccess.xaml.cs
Project.FLY.FlyADBase/Flyad7_WPF/Window_setAccess.xaml.cs
+2
-1
thick_public.sln
thick_public.sln
+0
-259
No files found.
Project.FLY.FlyADBase/FlyADBase/FlyADClientAdv.cs
View file @
d9662735
...
@@ -445,7 +445,7 @@ namespace FlyADBase
...
@@ -445,7 +445,7 @@ namespace FlyADBase
/// </summary>
/// </summary>
/// <param name="gridAdvUnits"></param>
/// <param name="gridAdvUnits"></param>
/// <param name="dat"></param>
/// <param name="dat"></param>
public
void
ToGrid
(
List
<
GridAdvUnit
>
gridAdvUnits
,
out
int
[]
dat
)
public
void
ToGrid
(
IEnumerable
<
GridAdvUnit
>
gridAdvUnits
,
out
int
[]
dat
)
{
{
dat
=
mTimeGridAdvHelper
.
ToGrid
(
gridAdvUnits
,
PosOfGrid
,
SGrid
.
GRID_MAX_SIZE
);
dat
=
mTimeGridAdvHelper
.
ToGrid
(
gridAdvUnits
,
PosOfGrid
,
SGrid
.
GRID_MAX_SIZE
);
}
}
...
...
Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs
View file @
d9662735
...
@@ -129,7 +129,7 @@ namespace FlyADBase
...
@@ -129,7 +129,7 @@ namespace FlyADBase
/// </summary>
/// </summary>
/// <param name="gridAdvUnits"></param>
/// <param name="gridAdvUnits"></param>
/// <param name="dat"></param>
/// <param name="dat"></param>
void
ToGrid
(
List
<
GridAdvUnit
>
gridAdvUnits
,
out
int
[]
dat
);
void
ToGrid
(
IEnumerable
<
GridAdvUnit
>
gridAdvUnits
,
out
int
[]
dat
);
/// <summary>
/// <summary>
/// 动作完成
/// 动作完成
/// </summary>
/// </summary>
...
...
Project.FLY.FlyADBase/FlyADBase/TimeGridAdvHelper.cs
View file @
d9662735
...
@@ -515,7 +515,7 @@ namespace FlyADBase
...
@@ -515,7 +515,7 @@ namespace FlyADBase
/// <param name="posOfGrid"></param>
/// <param name="posOfGrid"></param>
/// <param name="gridLen"></param>
/// <param name="gridLen"></param>
/// <returns></returns>
/// <returns></returns>
public
int
[]
ToGrid
(
List
<
GridAdvUnit
>
gridAdvUnits
,
int
posOfGrid
,
int
gridLen
)
public
int
[]
ToGrid
(
IEnumerable
<
GridAdvUnit
>
gridAdvUnits
,
int
posOfGrid
,
int
gridLen
)
{
{
int
[]
grids_sum
=
new
int
[
gridLen
];
int
[]
grids_sum
=
new
int
[
gridLen
];
int
[]
grids_cnt
=
new
int
[
gridLen
];
int
[]
grids_cnt
=
new
int
[
gridLen
];
...
...
Project.FLY.FlyADBase/Flyad7_WPF/Converters/BinConverter.cs
0 → 100644
View file @
d9662735
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Data
;
namespace
Flyad7_WPF.Converters
{
public
class
BinConverter
:
IValueConverter
{
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
string
index_str
=
(
string
)
parameter
;
if
(!
int
.
TryParse
(
index_str
,
out
int
index
))
{
index
=
0
;
}
if
(
index
<
0
)
index
=
0
;
if
(
index
>
15
)
index
=
15
;
if
(!(
value
is
UInt16
))
return
null
;
UInt16
v
=
(
UInt16
)
value
;
if
(
Misc
.
MyBase
.
CHECKBIT
(
v
,
index
))
{
return
1
;
}
else
{
return
0
;
}
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
throw
new
NotImplementedException
();
}
}
}
Project.FLY.FlyADBase/Flyad7_WPF/Converters/BytesConverter.cs
0 → 100644
View file @
d9662735
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Data
;
namespace
Flyad7_WPF.Converters
{
public
class
BytesConverter
:
IValueConverter
{
#
region
IValueConverter
成员
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
System
.
Globalization
.
CultureInfo
culture
)
{
byte
[]
bs
=
(
byte
[])
value
;
string
str
=
""
;
for
(
int
i
=
0
;
i
<
bs
.
Length
;
i
++)
str
+=
bs
[
i
].
ToString
(
"X2"
);
return
str
;
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
System
.
Globalization
.
CultureInfo
culture
)
{
string
str
=
(
string
)
value
;
string
h
=
""
;
List
<
byte
>
bs
=
new
List
<
byte
>();
for
(
int
i
=
0
;
i
<
str
.
Length
;
i
++)
{
if
(
str
[
i
]
!=
' '
)
h
+=
str
[
i
];
if
(((
str
[
i
]
==
' '
)
&&
(
h
.
Length
!=
0
))
||
(
h
.
Length
>=
2
))
{
byte
b
=
0
;
if
(
byte
.
TryParse
(
h
,
System
.
Globalization
.
NumberStyles
.
AllowHexSpecifier
,
null
,
out
b
))
{
bs
.
Add
(
b
);
}
else
{
break
;
}
h
=
""
;
}
}
return
bs
.
ToArray
();
}
#
endregion
}
}
Project.FLY.FlyADBase/Flyad7_WPF/Converters/IO2BinConverter.cs
0 → 100644
View file @
d9662735
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Data
;
namespace
Flyad7_WPF.Converters
{
public
class
IO2BinConverter
:
IValueConverter
{
#
region
IValueConverter
成员
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
System
.
Globalization
.
CultureInfo
culture
)
{
UInt16
io
=
(
UInt16
)
value
;
string
str
=
System
.
Convert
.
ToString
(
io
,
2
);
return
str
.
PadLeft
(
16
,
'0'
);
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
System
.
Globalization
.
CultureInfo
culture
)
{
return
System
.
Convert
.
ToUInt16
((
string
)
value
,
2
);
}
#
endregion
}
}
Project.FLY.FlyADBase/Flyad7_WPF/Converters/MyConv.xaml
0 → 100644
View file @
d9662735
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Flyad7_WPF.Converters">
<local:BytesConverter x:Key="bytesconv"/>
<local:IO2BinConverter x:Key="io2bin"/>
<local:BinConverter x:Key="binConv"/>
</ResourceDictionary>
\ No newline at end of file
Project.FLY.FlyADBase/Flyad7_WPF/DebugAppParam.cs
View file @
d9662735
...
@@ -38,8 +38,8 @@ namespace Flyad7_WPF
...
@@ -38,8 +38,8 @@ namespace Flyad7_WPF
public
UInt32
HVelocity2
;
public
UInt32
HVelocity2
;
public
int
PosLen
;
public
int
PosLen
;
public
int
ADLag
;
public
int
ADLag
{
get
;
set
;
}
#
region
INotifyPropertyChanged
成员
#
region
INotifyPropertyChanged
成员
public
event
PropertyChangedEventHandler
PropertyChanged
;
public
event
PropertyChangedEventHandler
PropertyChanged
;
#
endregion
#
endregion
...
@@ -77,6 +77,7 @@ namespace Flyad7_WPF
...
@@ -77,6 +77,7 @@ namespace Flyad7_WPF
{
{
string
json
=
File
.
ReadAllText
(
file_path
);
string
json
=
File
.
ReadAllText
(
file_path
);
var
param
=
JsonConvert
.
DeserializeObject
<
DebugAppParamJsonDB
>(
json
);
var
param
=
JsonConvert
.
DeserializeObject
<
DebugAppParamJsonDB
>(
json
);
EPStr
=
param
.
EPStr
;
EPStr
=
param
.
EPStr
;
HasTimeGrid
=
param
.
HasTimeGrid
;
HasTimeGrid
=
param
.
HasTimeGrid
;
HasGrid
=
param
.
HasGrid
;
HasGrid
=
param
.
HasGrid
;
...
...
Project.FLY.FlyADBase/Flyad7_WPF/Flyad7_WPF.csproj
View file @
d9662735
...
@@ -73,8 +73,14 @@
...
@@ -73,8 +73,14 @@
</ApplicationDefinition>
</ApplicationDefinition>
<Compile
Include=
"AutoForwBackw.cs"
/>
<Compile
Include=
"AutoForwBackw.cs"
/>
<Compile
Include=
"AutoSync.cs"
/>
<Compile
Include=
"AutoSync.cs"
/>
<Compile
Include=
"Converters\BinConverter.cs"
/>
<Compile
Include=
"Converters\BytesConverter.cs"
/>
<Compile
Include=
"Converters\IO2BinConverter.cs"
/>
<Compile
Include=
"DebugAppParam.cs"
/>
<Compile
Include=
"DebugAppParam.cs"
/>
<Compile
Include=
"FlyADClientUI.cs"
/>
<Compile
Include=
"FlyADClientUI.cs"
/>
<Compile
Include=
"Window1.xaml.cs"
>
<DependentUpon>
Window1.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"Window_InitArea.xaml.cs"
>
<Compile
Include=
"Window_InitArea.xaml.cs"
>
<DependentUpon>
Window_InitArea.xaml
</DependentUpon>
<DependentUpon>
Window_InitArea.xaml
</DependentUpon>
</Compile>
</Compile>
...
@@ -87,6 +93,10 @@
...
@@ -87,6 +93,10 @@
<Compile
Include=
"Window_sync_graph.xaml.cs"
>
<Compile
Include=
"Window_sync_graph.xaml.cs"
>
<DependentUpon>
Window_sync_graph.xaml
</DependentUpon>
<DependentUpon>
Window_sync_graph.xaml
</DependentUpon>
</Compile>
</Compile>
<Page
Include=
"Converters\MyConv.xaml"
>
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
</Page>
<Page
Include=
"MainWindow.xaml"
>
<Page
Include=
"MainWindow.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
<SubType>
Designer
</SubType>
...
@@ -99,6 +109,10 @@
...
@@ -99,6 +109,10 @@
<DependentUpon>
MainWindow.xaml
</DependentUpon>
<DependentUpon>
MainWindow.xaml
</DependentUpon>
<SubType>
Code
</SubType>
<SubType>
Code
</SubType>
</Compile>
</Compile>
<Page
Include=
"Window1.xaml"
>
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
</Page>
<Page
Include=
"Window_InitArea.xaml"
>
<Page
Include=
"Window_InitArea.xaml"
>
<SubType>
Designer
</SubType>
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
<Generator>
MSBuild:Compile
</Generator>
...
...
Project.FLY.FlyADBase/Flyad7_WPF/MainWindow.xaml
View file @
d9662735
...
@@ -3,19 +3,23 @@
...
@@ -3,19 +3,23 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:flyadbase="clr-namespace:FlyADBase;assembly=FlyADBase"
xmlns:flyadbase="clr-namespace:FlyADBase;assembly=FlyADBase"
xmlns:local="clr-namespace:Flyad7_WPF"
xmlns:local="clr-namespace:Flyad7_WPF"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:Chr="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
xmlns:Chr="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
Title="MainWindow" Height="606" Width="1161">
Title="MainWindow" Height="606" Width="1161"
d:DataContext="{d:DesignInstance Type=flyadbase:FlyAD7}"
>
<Window.Resources>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Converters/MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="MOTORTYPE">
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="MOTORTYPE">
<ObjectDataProvider.MethodParameters>
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="flyadbase:MOTORTYPE" />
<x:Type TypeName="flyadbase:MOTORTYPE" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</ObjectDataProvider>
<local:IO2BinConverter x:Key="io2bin"></local:IO2BinConverter>
<local:BytesConverter x:Key="bytesconv">
</local:BytesConverter>
<Style TargetType="TextBlock" x:Key="TextBlockStyle_groupTitle">
<Style TargetType="TextBlock" x:Key="TextBlockStyle_groupTitle">
<Setter Property="FontSize" Value="16" />
<Setter Property="FontSize" Value="16" />
</Style>
</Style>
...
@@ -122,11 +126,11 @@
...
@@ -122,11 +126,11 @@
<StackPanel>
<StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_itemTitle}" Text="输入" />
<TextBlock Style="{StaticResource TextBlockStyle_itemTitle}" Text="输入" />
<TextBox Style="{StaticResource TextBoxStyle_itemContent}" Text="{Binding IStatus,
Converter={StaticResource ResourceKey=io2bin}}" IsEnabled="False" Width="121
" />
<TextBox Style="{StaticResource TextBoxStyle_itemContent}" Text="{Binding IStatus,
Mode=OneWay,Converter={StaticResource ResourceKey=io2bin}}" IsEnabled="False" Width="120
" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_itemTitle}" Text="输出" />
<TextBlock Style="{StaticResource TextBlockStyle_itemTitle}" Text="输出" />
<TextBox Style="{StaticResource TextBoxStyle_itemContent}" Text="{Binding OStatus,Converter={StaticResource ResourceKey=io2bin}}" IsEnabled="False" Width="120" />
<TextBox Style="{StaticResource TextBoxStyle_itemContent}" Text="{Binding OStatus,
Mode=OneWay,
Converter={StaticResource ResourceKey=io2bin}}" IsEnabled="False" Width="120" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource ButtonStyle}" Content="输出设置" Click="button_output_Click" />
<Button Style="{StaticResource ButtonStyle}" Content="输出设置" Click="button_output_Click" />
...
@@ -140,10 +144,10 @@
...
@@ -140,10 +144,10 @@
<Setter Property="Margin" Value="3"/>
<Setter Property="Margin" Value="3"/>
</Style>
</Style>
</StackPanel.Resources>
</StackPanel.Resources>
<Button Style="{StaticResource ButtonStyle_Bit}" x:Name="button_bit3" Content="
1
" Click="button_setbit_Click" />
<Button Style="{StaticResource ButtonStyle_Bit}" x:Name="button_bit3" Content="
{Binding OStatus,Converter={StaticResource binConv}, ConverterParameter=3}" Tag="3
" Click="button_setbit_Click" />
<Button Style="{StaticResource ButtonStyle_Bit}" x:Name="button_bit2" Content="
1
" Click="button_setbit_Click" />
<Button Style="{StaticResource ButtonStyle_Bit}" x:Name="button_bit2" Content="
{Binding OStatus,Converter={StaticResource binConv}, ConverterParameter=2}" Tag="2
" Click="button_setbit_Click" />
<Button Style="{StaticResource ButtonStyle_Bit}" x:Name="button_bit1" Content="1" Click="button_setbit_Click" />
<Button Style="{StaticResource ButtonStyle_Bit}" x:Name="button_bit1" Content="
{Binding OStatus,Converter={StaticResource binConv}, ConverterParameter=1}" Tag="
1" Click="button_setbit_Click" />
<Button Style="{StaticResource ButtonStyle_Bit}" x:Name="button_bit0" Content="
1
" Click="button_setbit_Click" />
<Button Style="{StaticResource ButtonStyle_Bit}" x:Name="button_bit0" Content="
{Binding OStatus,Converter={StaticResource binConv}, ConverterParameter=0}" Tag="0
" Click="button_setbit_Click" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</GroupBox>
</GroupBox>
...
...
Project.FLY.FlyADBase/Flyad7_WPF/MainWindow.xaml.cs
View file @
d9662735
This diff is collapsed.
Click to expand it.
Project.FLY.FlyADBase/Flyad7_WPF/Window1.xaml
0 → 100644
View file @
d9662735
<Window x:Class="Flyad7_WPF.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Flyad7_WPF"
mc:Ignorable="d"
Title="Window1" Height="450" Width="800">
<Grid>
</Grid>
</Window>
Project.FLY.FlyADBase/Flyad7_WPF/Window1.xaml.cs
0 → 100644
View file @
d9662735
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
namespace
Flyad7_WPF
{
/// <summary>
/// Window1.xaml 的交互逻辑
/// </summary>
public
partial
class
Window1
:
Window
{
public
Window1
()
{
InitializeComponent
();
}
}
}
Project.FLY.FlyADBase/Flyad7_WPF/Window_setAccess.xaml.cs
View file @
d9662735
using
System
;
using
Flyad7_WPF.Converters
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
...
thick_public.sln
deleted
100644 → 0
View file @
ba757040
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