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
8e4fb00b
Commit
8e4fb00b
authored
Nov 26, 2024
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AD盒程序更新为 V8
parent
2e5c3d78
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
161 additions
and
129 deletions
+161
-129
BaseStyle.xaml
...Y.ControlLibrary/FLY.ControlLibrary/Themes/BaseStyle.xaml
+2
-1
FLYAD7_OBJ_INTERFACE.cs
Project.FLY.FlyADBase/FlyADBase/FLYAD7_OBJ_INTERFACE.cs
+23
-23
FlyAD7.cs
Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs
+47
-39
FlyADBase.csproj
Project.FLY.FlyADBase/FlyADBase/FlyADBase.csproj
+1
-1
IFlyADClient.cs
Project.FLY.FlyADBase/FlyADBase/IFlyADClient.cs
+0
-5
IFlyADClientAdv.cs
Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs
+5
-0
TimeGridAdvHelper.cs
Project.FLY.FlyADBase/FlyADBase/TimeGridAdvHelper.cs
+31
-15
PgFlyAd.xaml
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml
+1
-4
PgFlyAd.xaml.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml.cs
+1
-3
PgGageInfo.xaml.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgGageInfo.xaml.cs
+3
-2
GageInfoServiceClient.cs
...Thick.Base/FLY.Thick.Base/Client/GageInfoServiceClient.cs
+7
-11
IFlyADService.cs
...t.FLY.Thick.Base/FLY.Thick.Base/IService/IFlyADService.cs
+7
-2
IGageInfoService.cs
...LY.Thick.Base/FLY.Thick.Base/IService/IGageInfoService.cs
+5
-3
FlyAdService.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Server/FlyAdService.cs
+22
-20
GM_GageInfo.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Server/GM_GageInfo.cs
+6
-0
No files found.
Project.FLY.ControlLibrary/FLY.ControlLibrary/Themes/BaseStyle.xaml
View file @
8e4fb00b
...
...
@@ -9,7 +9,8 @@
<Thickness x:Key="ControlMargin">5</Thickness>
<!--Microsoft Sans Serif-->
<FontFamily x:Key="FontFamily.Field">Microsoft Sans Serif</FontFamily>
<!--<FontFamily x:Key="FontFamily.Field">Microsoft Sans Serif</FontFamily>-->
<FontFamily x:Key="FontFamily.Field">Microsoft YaHei</FontFamily>
<!--<FontFamily x:Key="FontFamily.Field">YouYuan</FontFamily>-->
</ResourceDictionary>
\ No newline at end of file
Project.FLY.FlyADBase/FlyADBase/FLYAD7_OBJ_INTERFACE.cs
View file @
8e4fb00b
...
...
@@ -263,7 +263,7 @@ namespace FLYAD7_OBJ_INTERFACE
if
(
value
.
Count
()
<
(
1
))
return
false
;
int
idx
=
0
;
status
=
(
SYNC_STATUS
)
value
[
idx
];
idx
++;
return
true
;
...
...
@@ -634,7 +634,7 @@ namespace FLYAD7_OBJ_INTERFACE
{
buf
.
Add
((
byte
)
'I'
);
}
else
else
{
buf
.
Add
((
byte
)
'N'
);
}
...
...
@@ -643,7 +643,7 @@ namespace FLYAD7_OBJ_INTERFACE
}
public
override
bool
TryParse
(
byte
[]
value
)
{
if
(
value
.
Count
()
<
(
2
+
4
+
1
))
if
(
value
.
Count
()
<
(
2
+
4
+
1
))
return
false
;
int
idx
=
0
;
idx
+=
2
;
...
...
@@ -1320,7 +1320,7 @@ namespace FLYAD7_OBJ_INTERFACE
#
endregion
#
region
Pack
public
class
Pack_PushPos1
public
class
Pack_PushPos1
{
public
int
pos1
;
public
int
speed1
;
...
...
@@ -1512,7 +1512,7 @@ namespace FLYAD7_OBJ_INTERFACE
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public
virtual
bool
TryParse
(
byte
[]
value
,
out
int
cnt
)
public
virtual
bool
TryParse
(
byte
[]
value
,
out
int
cnt
)
{
cnt
=
2
;
int
idx
=
0
;
...
...
@@ -1534,7 +1534,7 @@ namespace FLYAD7_OBJ_INTERFACE
}
return
true
;
}
}
}
public
class
Pack_PushStatus
...
...
@@ -1552,7 +1552,7 @@ namespace FLYAD7_OBJ_INTERFACE
List
<
byte
>
buf
=
new
List
<
byte
>();
buf
.
Add
((
byte
)
order
);
buf
.
Add
((
byte
)
status
);
return
buf
.
ToArray
();
}
/// <summary>
...
...
@@ -1572,7 +1572,7 @@ namespace FLYAD7_OBJ_INTERFACE
#
endregion
}
public
class
Pack_PushGrid
public
class
Pack_PushGrid
{
public
Misc
.
DIRECTION
direction
;
...
...
@@ -1610,7 +1610,7 @@ namespace FLYAD7_OBJ_INTERFACE
public
virtual
bool
TryParse
(
byte
[]
value
,
out
int
cnt
)
{
cnt
=
5
;
if
(
value
.
Length
<
cnt
)
return
false
;
int
idx
=
0
;
...
...
@@ -1678,7 +1678,7 @@ namespace FLYAD7_OBJ_INTERFACE
public
bool
TryParse_version
(
byte
[]
value
,
out
int
version
)
{
version
=
1
;
if
(!
base
.
TryParse
(
value
))
if
(!
base
.
TryParse
(
value
))
return
false
;
int
idx
=
8
;
int
cnt
=
8
+
4
;
...
...
@@ -1687,7 +1687,7 @@ namespace FLYAD7_OBJ_INTERFACE
version
=
2
;
systick
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
return
true
;
return
true
;
}
#
endregion
}
...
...
@@ -1732,7 +1732,7 @@ namespace FLYAD7_OBJ_INTERFACE
idx
+=
4
;
return
true
;
}
public
bool
TryParse_version
(
byte
[]
value
,
out
int
version
)
public
bool
TryParse_version
(
byte
[]
value
,
out
int
version
)
{
version
=
1
;
if
(!
base
.
TryParse
(
value
))
...
...
@@ -1752,7 +1752,7 @@ namespace FLYAD7_OBJ_INTERFACE
idx
+=
4
;
systick
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
return
true
;
return
true
;
}
#
endregion
}
...
...
@@ -1840,7 +1840,7 @@ namespace FLYAD7_OBJ_INTERFACE
/// <returns></returns>
public
override
bool
TryParse
(
byte
[]
value
,
out
int
cnt
)
{
if
(!
base
.
TryParse
(
value
,
out
cnt
))
if
(!
base
.
TryParse
(
value
,
out
cnt
))
return
false
;
int
idx
=
cnt
;
...
...
@@ -1906,7 +1906,7 @@ namespace FLYAD7_OBJ_INTERFACE
int
cnt
=
2
+
1
+
4
+
4
;
if
(
value
.
Length
<
cnt
)
return
false
;
mode
=
value
[
idx
];
idx
++;
systick
=
BitConverter
.
ToInt32
(
value
,
idx
);
...
...
@@ -1948,7 +1948,7 @@ namespace FLYAD7_OBJ_INTERFACE
public
byte
[]
ToBytes
()
{
List
<
byte
>
buf
=
new
List
<
byte
>();
buf
.
AddRange
(
base
.
ToBytes
());
...
...
@@ -1959,7 +1959,7 @@ namespace FLYAD7_OBJ_INTERFACE
return
buf
.
ToArray
();
}
public
override
bool
TryParse
(
byte
[]
value
)
public
override
bool
TryParse
(
byte
[]
value
)
{
int
cnt
;
return
TryParse
(
value
,
out
cnt
);
...
...
@@ -1967,23 +1967,23 @@ namespace FLYAD7_OBJ_INTERFACE
}
public
override
bool
TryParse
(
byte
[]
value
,
out
int
cnt
)
{
if
(!
base
.
TryParse
(
value
,
out
cnt
))
if
(!
base
.
TryParse
(
value
,
out
cnt
))
return
false
;
int
idx
=
cnt
;
cnt
+=
(
4
+
4
);
cnt
+=
(
4
+
4
);
if
(
value
.
Length
<
cnt
)
return
false
;
marker
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
idx
+=
4
;
systick
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
return
true
;
}
public
virtual
bool
TryParse_version
(
byte
[]
value
,
out
int
version
)
public
virtual
bool
TryParse_version
(
byte
[]
value
,
out
int
version
)
{
version
=
1
;
...
...
@@ -1996,7 +1996,7 @@ namespace FLYAD7_OBJ_INTERFACE
if
(
value
.
Length
<
cnt
)
return
true
;
version
=
2
;
marker
=
BitConverter
.
ToInt32
(
value
,
idx
);
...
...
@@ -2004,7 +2004,7 @@ namespace FLYAD7_OBJ_INTERFACE
systick
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
return
true
;
return
true
;
}
#
endregion
...
...
Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs
View file @
8e4fb00b
...
...
@@ -47,13 +47,6 @@ namespace FlyADBase
/// </summary>
public
int
ConnectCnt
{
get
;
private
set
;
}
/// <summary>
/// CRC
/// </summary>
public
bool
HasCRC
{
get
;
set
;
}
/// <summary>
/// 已经从AD盒获取全部当前数据
/// </summary>
...
...
@@ -504,11 +497,6 @@ namespace FlyADBase
void
FlyAD7_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
if
(
e
.
PropertyName
==
nameof
(
HasCRC
))
{
if
(
conn
!=
null
)
conn
.
HasCRC
=
HasCRC
;
}
if
(
bShieldSetValueEx
)
return
;
...
...
@@ -1334,7 +1322,7 @@ namespace FlyADBase
}
conn
=
CurrObjSys
.
Connect_to_Another_OBJSys
(
LocalEP
,
ID
);
conn
.
HasCRC
=
HasCRC
;
conn
.
HasCRC
=
false
;
}
/// <summary>
...
...
@@ -1349,7 +1337,7 @@ namespace FlyADBase
}
conn
=
CurrObjSys
.
Connect_to_Another_OBJSys
(
LocalEP
,
ID
);
conn
.
HasCRC
=
HasCRC
;
conn
.
HasCRC
=
false
;
}
#
endregion
...
...
@@ -1761,19 +1749,34 @@ namespace FlyADBase
class
FlyAD7JsonDb
{
static
Mapper
Mapper
{
get
;
}
=
new
AutoMapper
.
Mapper
(
new
MapperConfiguration
(
c
=>
{
c
.
CreateMap
<
FlyAD7
,
FlyAD7JsonDb
>().
ReverseMap
();
}));
public
static
void
Save
(
string
jsonDbPath
,
FlyAD7
src
)
{
if
(
string
.
IsNullOrEmpty
(
jsonDbPath
))
return
;
var
p
=
FlyAD7JsonDb
.
Mapper
.
Map
<
FlyAD7JsonDb
>(
src
);
FlyAD7JsonDb
jsonDb
=
new
FlyAD7JsonDb
()
{
Addr
=
src
.
Addr
,
GridSmooth
=
src
.
GridSmooth
,
ADLag
=
src
.
ADLag
,
PosMin
=
src
.
PosMin
,
PosMax
=
src
.
PosMax
,
HasPosMaxMin
=
src
.
HasPosMaxMin
,
HardwareVersion
=
src
.
HardwareVersion
,
IsDevParamValid
=
src
.
IsDevParamValid
,
MotorType
=
src
.
MotorType
,
PosOfGrid
=
src
.
PosOfGrid
,
Ratio01
=
src
.
Ratio01
,
Ratio02
=
src
.
Ratio02
,
PosOffset
=
src
.
PosOffset
,
JogVelocity
=
src
.
JogVelocity
};
try
{
File
.
WriteAllText
(
jsonDbPath
,
JsonConvert
.
SerializeObject
(
p
,
Formatting
.
Indented
));
File
.
WriteAllText
(
jsonDbPath
,
JsonConvert
.
SerializeObject
(
jsonDb
,
Formatting
.
Indented
));
}
catch
{
...
...
@@ -1790,8 +1793,24 @@ namespace FlyADBase
if
(
File
.
Exists
(
jsonDbPath
))
{
string
json
=
File
.
ReadAllText
(
jsonDbPath
);
var
p
=
JsonConvert
.
DeserializeObject
<
FlyAD7JsonDb
>(
json
);
Mapper
.
Map
(
p
,
src
);
FlyAD7JsonDb
jsonDb
=
JsonConvert
.
DeserializeObject
<
FlyAD7JsonDb
>(
json
);
src
.
Addr
=
jsonDb
.
Addr
;
src
.
GridSmooth
=
jsonDb
.
GridSmooth
;
src
.
ADLag
=
jsonDb
.
ADLag
;
src
.
PosMin
=
jsonDb
.
PosMin
;
src
.
PosMax
=
jsonDb
.
PosMax
;
src
.
HasPosMaxMin
=
jsonDb
.
HasPosMaxMin
;
src
.
HardwareVersion
=
jsonDb
.
HardwareVersion
;
src
.
IsDevParamValid
=
jsonDb
.
IsDevParamValid
;
src
.
MotorType
=
jsonDb
.
MotorType
;
src
.
PosOfGrid
=
jsonDb
.
PosOfGrid
;
src
.
Ratio01
=
jsonDb
.
Ratio01
;
src
.
Ratio02
=
jsonDb
.
Ratio02
;
src
.
PosOffset
=
jsonDb
.
PosOffset
;
src
.
JogVelocity
=
jsonDb
.
JogVelocity
;
return
true
;
}
}
...
...
@@ -1802,7 +1821,6 @@ namespace FlyADBase
return
false
;
}
public
string
Addr
=
"192.168.251.10:20006"
;
public
bool
HasCRC
=
false
;
public
int
GridSmooth
=
0
;
public
int
ADLag
=
0
;
public
int
PosMin
=
0
;
...
...
@@ -1846,7 +1864,7 @@ namespace FlyADBase
/// </summary>
class
SysTickContext
{
Int32
systick_1st
=
0
;
int
systick_1st
=
0
;
DateTime
dt_1st
=
DateTime
.
MinValue
;
public
event
Action
BeReseted
;
public
void
Reset
()
...
...
@@ -1872,30 +1890,20 @@ namespace FlyADBase
}
int
ms
=
systick
-
systick_1st
;
if
((
ms
<
-
1000
)
||
//时间被提前
(
ms
>
1000
*
60
*
3
))
//记录与新的timemark 相差3分钟,太大了,重新生成 timemark 与 dt 的关系
if
(
Math
.
Abs
(
ms
)
>
2000
)
{
//时间偏差太大,重新生成 timemark 与 dt 的关系
//被复位了
BeReseted
?.
Invoke
();
dt_1st
=
DateTime
.
Now
;
//毫秒级别取整
long
tick
=
dt_1st
.
Ticks
%
TimeSpan
.
TicksPerMillisecond
;
dt_1st
-=
TimeSpan
.
FromTicks
(
tick
);
systick_1st
=
systick
;
return
dt_1st
;
Reset
();
return
ToDateTime
(
systick
);
}
DateTime
dt
=
dt_1st
.
AddMilliseconds
(
ms
);
systick_1st
=
systick
;
dt_1st
=
dt
;
//if (Math.Abs((DateTime.Now-dt).TotalSeconds) > 5000)//滞后5s,异常
//{
// //修正
// dt = DateTime.Now;
// dt_1st = dt;
//}
return
dt
;
}
}
...
...
Project.FLY.FlyADBase/FlyADBase/FlyADBase.csproj
View file @
8e4fb00b
...
...
@@ -80,7 +80,7 @@
<Version>
10.1.1
</Version>
</PackageReference>
<PackageReference
Include=
"NLog"
>
<Version>
4.6.8
</Version>
<Version>
5.1.0
</Version>
</PackageReference>
<PackageReference
Include=
"PropertyChanged.Fody"
>
<Version>
4.1.0
</Version>
...
...
Project.FLY.FlyADBase/FlyADBase/IFlyADClient.cs
View file @
8e4fb00b
...
...
@@ -22,11 +22,6 @@ namespace FlyADBase
/// </summary>
int
ConnectCnt
{
get
;
}
/// <summary>
/// CRC 校正
/// </summary>
bool
HasCRC
{
get
;
set
;
}
/// <summary>
/// 连接
/// </summary>
...
...
Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs
View file @
8e4fb00b
...
...
@@ -120,6 +120,11 @@ namespace FlyADBase
/// 以timegrid 为单位,推送数据
/// </summary>
event
TimeGridAdv2EventHandler
TimeGridAdv2Event
;
TimeGridAdv2EventArgs
GetTimeGridAdv2Event
(
DateTime
beginTime
);
void
Save
();
bool
Load
();
}
/// <summary>
...
...
Project.FLY.FlyADBase/FlyADBase/TimeGridAdvHelper.cs
View file @
8e4fb00b
...
...
@@ -98,12 +98,30 @@ namespace FlyADBase
}
void
LimitPool
()
{
LimitSimplePool
(
ADPool
);
//LimitSimplePool_PosPool();
LimitSimplePool
(
PosPool
,
1.5
);
LimitSimplePool
(
Pos2Pool
,
1.5
);
LimitSimplePool
(
DriveStatusPool
,
1.5
);
LimitSimplePool
(
IStatusPool
,
1.5
);
if
(
NewestTime
==
DateTime
.
MinValue
)
return
;
if
(
ADPool
.
Count
()
==
0
)
return
;
//限制的时间
var
limitTime_ad
=
NewestTime
-
TimeSpan
.
FromMinutes
(
1
);
if
(
limitTime_ad
-
ADPool
.
First
().
dt
<
TimeSpan
.
FromMinutes
(
0.2
))
{
//比限定的多了0.2min 才会动作
return
;
}
//限制的时间
var
limitTime_other
=
NewestTime
-
TimeSpan
.
FromMinutes
(
1.5
);
LimitSimplePool
(
ADPool
,
limitTime_ad
);
LimitSimplePool
(
PosPool
,
limitTime_other
);
LimitSimplePool
(
Pos2Pool
,
limitTime_other
);
LimitSimplePool
(
DriveStatusPool
,
limitTime_other
);
LimitSimplePool
(
IStatusPool
,
limitTime_other
);
}
/// <summary>
...
...
@@ -112,12 +130,9 @@ namespace FlyADBase
/// <typeparam name="T">IDateTimeUnit</typeparam>
/// <param name="pool">缓存区</param>
/// <param name="cap_min">缓存区容量单位min</param>
void
LimitSimplePool
<
T
>(
List
<
T
>
pool
,
double
cap_min
=
1
)
where
T
:
IDateTimeUnit
{
if
(
NewestTime
==
DateTime
.
MinValue
)
return
;
void
LimitSimplePool
<
T
>(
List
<
T
>
pool
,
DateTime
limitTime
)
where
T
:
IDateTimeUnit
{
//限制的时间
var
limitTime
=
NewestTime
-
TimeSpan
.
FromMinutes
(
cap_min
);
//删除Pos 数据池
int
removeCnt
=
0
;
for
(
int
i
=
0
;
i
<
pool
.
Count
();
i
++)
...
...
@@ -614,16 +629,17 @@ namespace FlyADBase
for
(
int
i
=
0
;
i
<
adPool
.
Count
();
i
++)
{
int
idx
=
adPool
.
Count
()
-
1
-
i
;
var
adCell
=
adPool
[
idx
];
//当前缓存区包,每个数据的时间间隔
//TimeSpan curr_ad_ts;
//计算这个包每个数据的时间间隔
DateTime
actTime
=
ad
Pool
[
idx
]
.
dt
;
//从缓存区获取数据的时间
DateTime
actTime
=
ad
Cell
.
dt
;
//从缓存区获取数据的时间
for
(
int
j
=
0
;
j
<
ad
Pool
[
idx
]
.
datas
.
Count
();
j
++)
for
(
int
j
=
0
;
j
<
ad
Cell
.
datas
.
Count
();
j
++)
{
int
idx2
=
ad
Pool
[
idx
]
.
datas
.
Count
()
-
1
-
j
;
int
ad
=
ad
Pool
[
idx
]
.
datas
[
idx2
];
int
idx2
=
ad
Cell
.
datas
.
Count
()
-
1
-
j
;
int
ad
=
ad
Cell
.
datas
[
idx2
];
actTime
-=
TimeSpan
.
FromMilliseconds
(
1
);
//导出数据时间累加
while
(
idealTime
>
actTime
)
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml
View file @
8e4fb00b
...
...
@@ -51,10 +51,7 @@
</StackPanel>
</StackPanel>
<WrapPanel Orientation="Horizontal">
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="CRC" />
<ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding HasCRC}"/>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" >
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="脉冲/数据格" />
<StackPanel Orientation="Horizontal">
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml.cs
View file @
8e4fb00b
...
...
@@ -39,7 +39,7 @@ namespace FLY.Thick.Base.UI
{
public
event
PropertyChangedEventHandler
PropertyChanged
;
#
region
参数
public
bool
HasCRC
{
get
;
set
;
}
public
IPEndPoint
EP
{
get
;
set
;
}
public
UInt16
PosOfGrid
{
get
;
set
;
}
public
MOTORTYPE
MotorType
{
set
;
get
;
}
...
...
@@ -131,7 +131,6 @@ namespace FLY.Thick.Base.UI
this
.
flyAdService
=
flyAdService
;
this
.
gageService
=
gageService
;
this
.
initParamService
=
initParamService
;
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
HasCRC
),
this
,
nameof
(
HasCRC
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
Addr
),
()
=>
{
EP
=
Misc
.
StringConverter
.
ToIPEndPoint
(
this
.
flyAdService
.
Addr
);
...
...
@@ -174,7 +173,6 @@ namespace FLY.Thick.Base.UI
if
(!
WdPassword
.
Authorize
(
"FlyAd"
))
return
;
flyAdService
.
HasCRC
=
this
.
HasCRC
;
flyAdService
.
Addr
=
this
.
EP
.
ToString
();
flyAdService
.
PosOfGrid
=
this
.
PosOfGrid
;
flyAdService
.
MotorType
=
this
.
MotorType
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgGageInfo.xaml.cs
View file @
8e4fb00b
...
...
@@ -472,14 +472,15 @@ namespace FLY.Thick.Base.UI
}
void
button_start_Click
(
object
sender
,
RoutedEventArgs
e
)
{
if
(
gageInfo
.
IsRunning
)
gage
Info
.
Stop
(
);
gage
Service
.
StartP2
(
Base
.
Common
.
STARTP2_MODE
.
STOP
);
else
{
if
(!
WdPassword
.
Authorize
(
"GageInfo"
))
return
;
gageInfo
.
Start
();
gageInfo
.
Start
(
gageInfo
.
Velocity
);
}
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Client/GageInfoServiceClient.cs
View file @
8e4fb00b
...
...
@@ -49,23 +49,19 @@ namespace FLY.Thick.Base.Client
/// </summary>
public
bool
IsRunning
{
get
;
set
;
}
/// <summary>
/// 数据录制,记下来回扫描的AD值数组
/// </summary>
public
void
Start
()
{
Call
(
nameof
(
Start
));
public
uint
Velocity
{
get
;
set
;
}
}
public
void
Stop
()
{
Call
(
nameof
(
Stop
));
}
[
Call
(
typeof
(
GetGageInfoResponse
))]
public
void
GetGageInfo
(
int
idx
,
AsyncCBHandler
asyncDelegate
,
object
asyncContext
)
{
Call
(
nameof
(
GetGageInfo
),
new
{
idx
=
idx
},
asyncDelegate
,
asyncContext
);
}
public
void
Start
(
uint
velocity
)
{
Call
(
nameof
(
Start
),
new
{
velocity
});
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base/IService/IFlyADService.cs
View file @
8e4fb00b
...
...
@@ -14,7 +14,6 @@ namespace FLY.Thick.Base.IService
public
interface
IFlyADService
:
INotifyPropertyChanged
{
#
region
参数
bool
HasCRC
{
get
;
set
;
}
string
Addr
{
get
;
set
;
}
UInt16
PosOfGrid
{
get
;
set
;
}
int
PosLen
{
get
;
}
...
...
@@ -24,7 +23,7 @@ namespace FLY.Thick.Base.IService
Int16
PosOffset
{
set
;
get
;
}
//脉冲平移
UInt32
JogVelocity
{
set
;
get
;
}
int
GridSmooth
{
get
;
set
;
}
int
ADLag
{
get
;
set
;
}
bool
HasPosMaxMin
{
get
;
set
;
}
int
PosMin
{
get
;
set
;
}
...
...
@@ -32,6 +31,12 @@ namespace FLY.Thick.Base.IService
int
Verson
{
get
;
}
int
HardwareVersion
{
get
;
set
;
}
/// <summary>
/// 参数保存
/// </summary>
void
Apply
();
/// <summary>
/// 获取序列码
/// </summary>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/IService/IGageInfoService.cs
View file @
8e4fb00b
...
...
@@ -10,6 +10,10 @@ namespace FLY.Thick.Base.IService
{
public
interface
IGageInfoService
:
INotifyPropertyChanged
{
/// <summary>
/// 录制时的速度
/// </summary>
UInt32
Velocity
{
get
;
}
/// <summary>
/// 机架总长,脉冲
/// </summary>
...
...
@@ -44,9 +48,7 @@ namespace FLY.Thick.Base.IService
/// <summary>
/// 数据录制,记下来回扫描的AD值数组
/// </summary>
void
Start
();
void
Stop
();
void
Start
(
UInt32
velocity
);
[
Call
(
typeof
(
GetGageInfoResponse
))]
void
GetGageInfo
(
int
idx
,
AsyncCBHandler
asyncDelegate
,
object
asyncContext
);
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Server/FlyAdService.cs
View file @
8e4fb00b
...
...
@@ -21,15 +21,6 @@ namespace FLY.Thick.Base.Server
const
int
MARKNO_PUSH_ACCESS
=
2
;
#
endregion
public
bool
HasCRC
{
get
{
return
flyad
.
HasCRC
;
}
set
{
flyad
.
HasCRC
=
value
;
}
}
public
string
Addr
{
get
...
...
@@ -38,7 +29,8 @@ namespace FLY.Thick.Base.Server
}
set
{
if
(
flyad
.
Addr
!=
value
)
{
if
(
flyad
.
Addr
!=
value
)
{
flyad
.
Connect
(
value
);
}
}
...
...
@@ -132,10 +124,11 @@ namespace FLY.Thick.Base.Server
}
}
public
int
ADLag
public
int
ADLag
{
get
{
return
flyad
.
ADLag
;
}
set
{
set
{
flyad
.
ADLag
=
value
;
}
}
...
...
@@ -164,23 +157,25 @@ namespace FLY.Thick.Base.Server
}
}
public
int
Verson
public
int
Verson
{
get
{
return
flyad
.
Version
;
}
}
public
int
HardwareVersion
{
public
int
HardwareVersion
{
get
{
return
flyad
.
HardwareVersion
;
}
set
{
set
{
flyad
.
HardwareVersion
=
value
;
}
}
FlyAD7
flyad
;
IFlyADClientAdv
flyad
;
AD2ThkHandler
ad2thk
;
public
FlyAdService
()
{
}
public
void
Init
(
FlyAD7
flyad
,
AD2ThkHandler
func_Ad2Thk
)
public
void
Init
(
IFlyADClientAdv
flyad
,
AD2ThkHandler
func_Ad2Thk
)
{
ad2thk
=
func_Ad2Thk
;
...
...
@@ -191,11 +186,18 @@ namespace FLY.Thick.Base.Server
private
void
Flyad_PropertyChanged
(
object
sender
,
System
.
ComponentModel
.
PropertyChangedEventArgs
e
)
{
var
type
=
typeof
(
FlyAdService
);
if
(
type
.
GetProperty
(
e
.
PropertyName
)
!=
null
)
{
if
(
type
.
GetProperty
(
e
.
PropertyName
)
!=
null
)
{
PropertyChanged
?.
Invoke
(
this
,
new
PropertyChangedEventArgs
(
e
.
PropertyName
));
}
}
/// <summary>
/// 保存参数
/// </summary>
public
void
Apply
()
{
flyad
.
Save
();
}
/// <summary>
/// 获取序列码
/// </summary>
...
...
@@ -279,7 +281,7 @@ namespace FLY.Thick.Base.Server
/// <param name="asyncDelegate"></param>
/// <param name="asyncContext"></param>
[
Call
(
typeof
(
GridInfo
))]
public
void
GetGrid
(
Misc
.
DIRECTION
direction
,
AsyncCBHandler
asyncDelegate
,
object
asyncContext
)
public
void
GetGrid
(
Misc
.
DIRECTION
direction
,
AsyncCBHandler
asyncDelegate
,
object
asyncContext
)
{
flyad
.
GetGrid
(
direction
,
out
int
[]
dat
);
double
[]
thks
=
null
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Server/GM_GageInfo.cs
View file @
8e4fb00b
...
...
@@ -247,6 +247,12 @@ namespace FLY.Thick.Base.Server
asyncDelegate
(
asyncContext
,
reponse
);
}
public
void
Start
(
uint
velocity
)
{
Velocity
=
velocity
;
Start
();
}
}
public
class
GageInfoJsonDb
{
...
...
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