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
4cc848b7
Commit
4cc848b7
authored
Mar 28, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TimeGridAdv2Event 可以通过查询获取
parent
e01f567c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
13 deletions
+59
-13
FlyADClientAdv.cs
Project.FLY.FlyADBase/FlyADBase/FlyADClientAdv.cs
+53
-11
TimeGridAdvHelper.cs
Project.FLY.FlyADBase/FlyADBase/TimeGridAdvHelper.cs
+6
-2
No files found.
Project.FLY.FlyADBase/FlyADBase/FlyADClientAdv.cs
View file @
4cc848b7
...
...
@@ -441,6 +441,48 @@ namespace FlyADBase
AD
=
ad
;
}
public
TimeGridAdv2EventArgs
GetTimeGridAdv2Event
(
DateTime
beginTime
)
{
//获取ad列表
var
adList
=
mTimeGridAdvHelper
.
GetAD
(
beginTime
);
if
(
adList
.
Count
()
==
0
)
return
null
;
DateTime
endTime
=
mTimeGridAdvHelper
.
NewestTime
;
int
adCnt
=
adList
.
Count
();
//获取pos
var
posList
=
mTimeGridAdvHelper
.
GetPos
(
mTimeGridAdvHelper
.
NewestTime
,
adList
.
Count
());
Misc
.
DIRECTION
direction
;
//判断运动方向
if
(
posList
.
Last
()
>
posList
.
First
())
{
//正向
direction
=
DIRECTION
.
FORWARD
;
}
else
{
direction
=
DIRECTION
.
BACKWARD
;
}
//机架修正
if
(
CorrectADs
!=
null
)
{
for
(
int
i
=
0
;
i
<
adList
.
Count
();
i
++)
{
adList
[
i
]
=
CorrectAD
(
posList
[
i
]
/
PosOfGrid
,
adList
[
i
]);
}
}
TimeGridAdv2EventArgs
eventArgs
=
new
TimeGridAdv2EventArgs
();
eventArgs
.
Direction
=
direction
;
eventArgs
.
EndTime
=
endTime
;
eventArgs
.
AdList
=
adList
;
eventArgs
.
PosList
=
posList
;
return
eventArgs
;
}
void
advPushTimeGrid
(
DateTime
end_dt
,
int
[]
datas
)
{
...
...
@@ -493,15 +535,7 @@ namespace FlyADBase
eventArgs
.
PosList
=
posList
;
eventArgs
.
Marker
=
marker
;
TimeGridAdv2Event
(
this
,
new
TimeGridAdv2EventArgs
()
{
Direction
=
direction
,
EndTime
=
reponse_endTime
,
AdList
=
adList
,
PosList
=
posList
,
Marker
=
marker
});
TimeGridAdv2Event
(
this
,
eventArgs
);
}
}
...
...
@@ -521,8 +555,16 @@ namespace FlyADBase
mTimeGridAdvHelper
.
AddDriveStatus
(
Now
,
DriveOrder
,
DriveStatus
,
Marker
);
if
(
DriveStatus
!=
DRIVE_MAN_STATUS
.
RUNNING
)
{
//检测 mTimeGridAdvHelper.AdPool 的 systick 是否 大于等于 Now
if
(
mTimeGridAdvHelper
.
NewestTime
>=
Now
)
{
IsTimeToPushTimeGridAdv
=
false
;
}
else
{
//通知 mTimeGridAdvHelper 下次触发 timegridadv
IsTimeToPushTimeGridAdv
=
true
;
}
}
}
...
...
Project.FLY.FlyADBase/FlyADBase/TimeGridAdvHelper.cs
View file @
4cc848b7
...
...
@@ -407,6 +407,10 @@ namespace FlyADBase
{
return
TimeGridAdvHelperExt
.
GetAD
(
ADPool
,
begin
,
end
,
out
reponse_endTime
);
}
public
List
<
int
>
GetAD
(
DateTime
begin
)
{
return
TimeGridAdvHelperExt
.
GetAD
(
ADPool
,
begin
);
}
public
List
<
int
>
GetPos
(
DateTime
end_dt
,
int
cnt
)
{
...
...
@@ -514,7 +518,7 @@ namespace FlyADBase
return
GetAD
(
adPool
,
begin
);
}
static
List
<
int
>
GetAD
(
List
<
DateTimeUnit3
>
adPool
,
DateTime
begin
)
public
static
List
<
int
>
GetAD
(
List
<
DateTimeUnit3
>
adPool
,
DateTime
begin
)
{
var
ts
=
TimeSpan
.
FromTicks
((
long
)(
ad_ts_ms
*
TimeSpan
.
TicksPerMillisecond
));
...
...
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