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
78224741
Commit
78224741
authored
Nov 12, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化 FlyAD7 删除Backup_XXX 参数备份寄存器。 刚成功connect时,直接把参数写入到 设备。 参数以电脑为准。
parent
3c15e477
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
64 additions
and
187 deletions
+64
-187
FlyAD7.cs
Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs
+49
-16
FlyADClientAdv.cs
Project.FLY.FlyADBase/FlyADBase/FlyADClientAdv.cs
+5
-9
IFlyADClientAdv.cs
Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs
+5
-9
PgFlyAd.xaml
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml
+5
-24
PgFlyAd.xaml.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml.cs
+0
-33
FlyADServiceClient.cs
...LY.Thick.Base/FLY.Thick.Base/Client/FlyADServiceClient.cs
+0
-17
FLY.Thick.Base.csproj
Project.FLY.Thick.Base/FLY.Thick.Base/FLY.Thick.Base.csproj
+0
-5
IFlyADService.cs
...t.FLY.Thick.Base/FLY.Thick.Base/IService/IFlyADService.cs
+0
-15
FlyAdService.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Server/FlyAdService.cs
+0
-59
No files found.
Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs
View file @
78224741
...
...
@@ -332,7 +332,49 @@ namespace FlyADBase
ID
,
0xffffffff
,
SENSE_CONFIG
.
ADD
);
UpdateParam
();
if
(
IsReadParamFromDev
)
{
//读取全部参数!!!!!
//OBJ_SYS_DATA
CurrObjSys
.
GetValueEx
(
conn
,
FLYAD7_OBJ_INTERFACE
.
SYS_DATA_INTERFACE
.
ID
,
ID
,
FLYAD7_OBJ_INTERFACE
.
SYS_DATA_INTERFACE
.
GET_SYSPARAM
);
CurrObjSys
.
GetValueEx
(
conn
,
FLYAD7_OBJ_INTERFACE
.
SYS_DATA_INTERFACE
.
ID
,
ID
,
FLYAD7_OBJ_INTERFACE
.
SYS_DATA_INTERFACE
.
GET_ZERO_POS
);
//DRIVE_MAN
CurrObjSys
.
GetValueEx
(
conn
,
FLYAD7_OBJ_INTERFACE
.
DRIVE_MAN_INTERFACE
.
ID
,
ID
,
FLYAD7_OBJ_INTERFACE
.
DRIVE_MAN_INTERFACE
.
GET_DRIVEPARAM
);
}
else
{
//参数不保存在设备中, 保存在电脑。
//参数写入到设备。
NotifyPropertyChanged
(
nameof
(
MotorType
));
NotifyPropertyChanged
(
nameof
(
PosOfGrid
));
NotifyPropertyChanged
(
nameof
(
Ratio01
));
NotifyPropertyChanged
(
nameof
(
Ratio02
));
NotifyPropertyChanged
(
nameof
(
PosOffset
));
NotifyPropertyChanged
(
nameof
(
JogVelocity
));
}
CurrObjSys
.
GetValueEx
(
conn
,
FLYAD7_OBJ_INTERFACE
.
SYS_DATA_INTERFACE
.
ID
,
ID
,
FLYAD7_OBJ_INTERFACE
.
SYS_DATA_INTERFACE
.
GET_SYSINFO
);
isReadyGetState
=
false
;
isReadyGetPos1AD1
=
false
;
...
...
@@ -1837,15 +1879,6 @@ namespace FlyADBase
//不需要设置到 AD盒
bShieldSetValueEx
=
true
;
bool
ret
=
FlyAD7JsonDb
.
Load
(
jsonDbPath
,
this
);
//还没连到 AD盒前, 有比较正常的 默认值,不需要设置到AD盒
PosOfGrid
=
Backup_PosOfGrid
;
MotorType
=
Backup_MotorType
;
Ratio01
=
Backup_Ratio01
;
Ratio02
=
Backup_Ratio02
;
PosOffset
=
Backup_PosOffset
;
JogVelocity
=
Backup_JogVelocity
;
bShieldSetValueEx
=
false
;
...
...
@@ -1930,12 +1963,12 @@ namespace FlyADBase
public
bool
HasPosMaxMin
=
false
;
//备份参数
public
MOTORTYPE
Backup_
MotorType
=
MOTORTYPE
.
SERVO
;
public
UInt16
Backup_
PosOfGrid
=
10
;
public
UInt16
Backup_
Ratio01
=
4
;
public
UInt16
Backup_
Ratio02
=
1
;
public
Int16
Backup_
PosOffset
=
0
;
public
UInt32
Backup_JogVelocity
=
5
000
;
public
MOTORTYPE
MotorType
=
MOTORTYPE
.
SERVO
;
public
UInt16
PosOfGrid
=
10
;
public
UInt16
Ratio01
=
4
;
public
UInt16
Ratio02
=
1
;
public
Int16
PosOffset
=
0
;
public
UInt32
JogVelocity
=
1
000
;
/// <summary>
/// 硬件版本
...
...
Project.FLY.FlyADBase/FlyADBase/FlyADClientAdv.cs
View file @
78224741
...
...
@@ -45,15 +45,11 @@ namespace FlyADBase
/// </summary>
public
int
PosMax
{
get
;
set
;
}
=
8900
;
#
region
备份参数
public
MOTORTYPE
Backup_MotorType
{
get
;
set
;
}
=
MOTORTYPE
.
SERVO
;
public
UInt16
Backup_PosOfGrid
{
get
;
set
;
}
=
10
;
public
UInt16
Backup_Ratio01
{
get
;
set
;
}
=
4
;
public
UInt16
Backup_Ratio02
{
get
;
set
;
}
=
1
;
public
Int16
Backup_PosOffset
{
get
;
set
;
}
=
0
;
public
UInt32
Backup_JogVelocity
{
get
;
set
;
}
=
300
;
#
endregion
/// <summary>
/// 只要connect成功,获取systick被复位,都会从AD盒设备读取参数;
/// 否则, 设置参数 到 AD盒
/// </summary>
public
bool
IsReadParamFromDev
{
get
;
set
;
}
public
int
GridLen
=>
PosLen
/
PosOfGrid
;
/// <summary>
...
...
Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs
View file @
78224741
...
...
@@ -37,15 +37,11 @@ namespace FlyADBase
/// </summary>
double
Speed1Scale
{
get
;
}
#
region
备份参数
MOTORTYPE
Backup_MotorType
{
get
;
}
UInt16
Backup_PosOfGrid
{
get
;
}
UInt16
Backup_Ratio01
{
get
;
}
UInt16
Backup_Ratio02
{
get
;
}
Int16
Backup_PosOffset
{
get
;
}
UInt32
Backup_JogVelocity
{
get
;
}
#
endregion
/// <summary>
/// 只要connect成功,获取systick被复位,都会从AD盒设备读取参数;
/// 否则, 设置参数 到 AD盒
/// </summary>
bool
IsReadParamFromDev
{
get
;
set
;
}
/// <summary>
/// 机架总长
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml
View file @
78224741
...
...
@@ -63,9 +63,6 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="脉冲/数据格" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding PosOfGrid}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsPosOfGridModified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_PosOfGrid}"/>
</StackPanel>
</StackPanel>
...
...
@@ -76,20 +73,17 @@
<StackPanel Margin="{StaticResource ControlMargin}">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="电机类型" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsMotorTypeModified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_MotorType}"/>
</StackPanel>
<ComboBox Width="1
91" HorizontalAlignment="Left" MinHeight="40
">
<ComboBox Width="1
20" HorizontalAlignment="Left" MinHeight="{StaticResource FontSize.FieldContent}
">
<ComboBoxItem IsSelected="{Binding MotorType, Converter={StaticResource e2bconv}, ConverterParameter={x:Static common:MOTORTYPE.SERVO}}">
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" FontSize="
32
" Text="伺服"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" FontSize="
{StaticResource FontSize.FieldContent.Middle}
" Text="伺服"/>
</ComboBoxItem>
<ComboBoxItem IsSelected="{Binding MotorType, Converter={StaticResource e2bconv}, ConverterParameter={x:Static common:MOTORTYPE.VF0}}" >
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" FontSize="
32
" Text="变频器"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" FontSize="
{StaticResource FontSize.FieldContent.Middle}
" Text="变频器"/>
</ComboBoxItem>
<ComboBoxItem IsSelected="{Binding MotorType, Converter={StaticResource e2bconv}, ConverterParameter={x:Static common:MOTORTYPE.NULL}}" >
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" FontSize="
32
" Text="无"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" FontSize="
{StaticResource FontSize.FieldContent.Middle}
" Text="无"/>
</ComboBoxItem>
</ComboBox>
</StackPanel>
...
...
@@ -97,9 +91,6 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="电机脉冲" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Ratio01}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsRatio01Modified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_Ratio01}"/>
</StackPanel>
</StackPanel>
...
...
@@ -107,9 +98,6 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="编码脉冲" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Ratio02}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsRatio02Modified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_Ratio02}"/>
</StackPanel>
</StackPanel>
...
...
@@ -117,10 +105,6 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="原点脉冲" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding PosOffset}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsPosOffsetModified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_PosOffset}"/>
</StackPanel>
</StackPanel>
...
...
@@ -149,9 +133,6 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="手动速度" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding JogVelocity}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsJogVelocityModified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_JogVelocity}"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" >
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml.cs
View file @
78224741
...
...
@@ -55,24 +55,6 @@ namespace FLY.Thick.Base.UI
public
int
PosMax
{
get
;
set
;
}
#
endregion
#
region
备份参数
public
MOTORTYPE
Backup_MotorType
{
get
;
set
;
}
=
MOTORTYPE
.
SERVO
;
public
UInt16
Backup_PosOfGrid
{
get
;
set
;
}
=
10
;
public
UInt16
Backup_Ratio01
{
get
;
set
;
}
=
4
;
public
UInt16
Backup_Ratio02
{
get
;
set
;
}
=
1
;
public
Int16
Backup_PosOffset
{
get
;
set
;
}
=
0
;
public
UInt32
Backup_JogVelocity
{
get
;
set
;
}
=
300
;
#
endregion
#
region
备份参数
public
bool
IsMotorTypeModified
=>
MotorType
!=
Backup_MotorType
;
public
bool
IsPosOfGridModified
=>
PosOfGrid
!=
Backup_PosOfGrid
;
public
bool
IsRatio01Modified
=>
Ratio01
!=
Backup_Ratio01
;
public
bool
IsRatio02Modified
=>
Ratio02
!=
Backup_Ratio02
;
public
bool
IsPosOffsetModified
=>
PosOffset
!=
Backup_PosOffset
;
public
bool
IsJogVelocityModified
=>
JogVelocity
!=
Backup_JogVelocity
;
#
endregion
public
int
Version
{
get
;
set
;
}
public
int
HardwareVersion
{
get
;
set
;
}
...
...
@@ -168,13 +150,6 @@ namespace FLY.Thick.Base.UI
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
PosMin
),
this
,
nameof
(
PosMin
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
PosMax
),
this
,
nameof
(
PosMax
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
Backup_MotorType
),
this
,
nameof
(
Backup_MotorType
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
Backup_PosOfGrid
),
this
,
nameof
(
Backup_PosOfGrid
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
Backup_Ratio01
),
this
,
nameof
(
Backup_Ratio01
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
Backup_Ratio02
),
this
,
nameof
(
Backup_Ratio02
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
Backup_PosOffset
),
this
,
nameof
(
Backup_PosOffset
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
Backup_JogVelocity
),
this
,
nameof
(
Backup_JogVelocity
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
Verson
),
this
,
nameof
(
Version
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
HardwareVersion
),
this
,
nameof
(
HardwareVersion
));
...
...
@@ -216,14 +191,6 @@ namespace FLY.Thick.Base.UI
flyAdService
.
PosMin
=
this
.
PosMin
;
flyAdService
.
PosMax
=
this
.
PosMax
;
flyAdService
.
Backup_MotorType
=
this
.
MotorType
;
flyAdService
.
Backup_PosOfGrid
=
this
.
PosOfGrid
;
flyAdService
.
Backup_Ratio01
=
this
.
Ratio01
;
flyAdService
.
Backup_Ratio02
=
this
.
Ratio02
;
flyAdService
.
Backup_PosOffset
=
this
.
PosOffset
;
flyAdService
.
Backup_JogVelocity
=
this
.
JogVelocity
;
flyAdService
.
HardwareVersion
=
HardwareVersion
;
FLY
.
ControlLibrary
.
Window_Tip
.
Show
(
"应用成功"
,
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Client/FlyADServiceClient.cs
View file @
78224741
...
...
@@ -56,15 +56,6 @@ namespace FLY.Thick.Base.Client
public
int
PosMin
{
get
;
set
;
}
public
int
PosMax
{
get
;
set
;
}
#
region
备份参数
public
MOTORTYPE
Backup_MotorType
{
get
;
set
;
}
public
UInt16
Backup_PosOfGrid
{
get
;
set
;
}
public
UInt16
Backup_Ratio01
{
get
;
set
;
}
public
UInt16
Backup_Ratio02
{
get
;
set
;
}
public
Int16
Backup_PosOffset
{
get
;
set
;
}
public
UInt32
Backup_JogVelocity
{
get
;
set
;
}
#
endregion
public
int
Verson
{
get
;
set
;
}
public
int
HardwareVersion
{
get
;
set
;
}
...
...
@@ -111,14 +102,6 @@ namespace FLY.Thick.Base.Client
Call
(
nameof
(
GetGrid
),
new
{
direction
},
asyncDelegate
,
asyncContext
);
}
/// <summary>
/// 向AD盒获取数据
/// </summary>
public
void
UpdateParam
()
{
Call
(
nameof
(
UpdateParam
));
}
#
endregion
}
}
\ No newline at end of file
Project.FLY.Thick.Base/FLY.Thick.Base/FLY.Thick.Base.csproj
View file @
78224741
...
...
@@ -158,11 +158,6 @@
<Version>
3.3.1
</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None
Include=
"..\..\..\.editorconfig"
>
<Link>
.editorconfig
</Link>
</None>
</ItemGroup>
<ItemGroup>
<Folder
Include=
"OBJ_INTERFACE\"
/>
<Folder
Include=
"Server.OBJProxy\"
/>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/IService/IFlyADService.cs
View file @
78224741
...
...
@@ -31,15 +31,6 @@ namespace FLY.Thick.Base.IService
int
PosMin
{
get
;
set
;
}
int
PosMax
{
get
;
set
;
}
#
region
备份参数
MOTORTYPE
Backup_MotorType
{
get
;
set
;
}
UInt16
Backup_PosOfGrid
{
get
;
set
;
}
UInt16
Backup_Ratio01
{
get
;
set
;
}
UInt16
Backup_Ratio02
{
get
;
set
;
}
Int16
Backup_PosOffset
{
get
;
set
;
}
UInt32
Backup_JogVelocity
{
get
;
set
;
}
#
endregion
int
Verson
{
get
;
}
int
HardwareVersion
{
get
;
set
;
}
/// <summary>
...
...
@@ -68,11 +59,5 @@ namespace FLY.Thick.Base.IService
/// <param name="asyncContext"></param>
[
Call
(
typeof
(
GridInfo
))]
void
GetGrid
(
Misc
.
DIRECTION
direction
,
AsyncCBHandler
asyncDelegate
,
object
asyncContext
);
/// <summary>
/// 向AD盒获取数据
/// </summary>
void
UpdateParam
();
}
}
Project.FLY.Thick.Base/FLY.Thick.Base/Server/FlyAdService.cs
View file @
78224741
...
...
@@ -174,55 +174,6 @@ namespace FLY.Thick.Base.Server
}
}
public
MOTORTYPE
Backup_MotorType
{
get
{
return
(
MOTORTYPE
)
flyad
.
Backup_MotorType
;
}
set
{
flyad
.
Backup_MotorType
=
(
FlyADBase
.
MOTORTYPE
)
value
;
}
}
public
UInt16
Backup_PosOfGrid
{
get
{
return
flyad
.
Backup_PosOfGrid
;
}
set
{
flyad
.
Backup_PosOfGrid
=
value
;
}
}
public
UInt16
Backup_Ratio01
{
get
{
return
flyad
.
Backup_Ratio01
;
}
set
{
flyad
.
Backup_Ratio01
=
value
;
}
}
public
UInt16
Backup_Ratio02
{
get
{
return
flyad
.
Backup_Ratio02
;
}
set
{
flyad
.
Backup_Ratio02
=
value
;
}
}
public
Int16
Backup_PosOffset
{
get
{
return
flyad
.
Backup_PosOffset
;
}
set
{
flyad
.
Backup_PosOffset
=
value
;
}
}
public
UInt32
Backup_JogVelocity
{
get
{
return
flyad
.
Backup_JogVelocity
;
}
set
{
flyad
.
Backup_JogVelocity
=
value
;
}
}
public
int
Verson
{
get
{
return
flyad
.
Version
;
}
...
...
@@ -253,8 +204,6 @@ namespace FLY.Thick.Base.Server
if
(
type
.
GetProperty
(
e
.
PropertyName
)
!=
null
)
{
PropertyChanged
?.
Invoke
(
this
,
new
PropertyChangedEventArgs
(
e
.
PropertyName
));
}
//if(e.PropertyName )
}
/// <summary>
...
...
@@ -357,13 +306,5 @@ namespace FLY.Thick.Base.Server
};
asyncDelegate
(
asyncContext
,
p
);
}
/// <summary>
/// 向AD盒获取数据
/// </summary>
public
void
UpdateParam
()
{
flyad
.
UpdateParam
();
}
}
}
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