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
caed97dd
Commit
caed97dd
authored
May 24, 2023
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发现问题 AD盒.B2 当网络很慢,ADLag 操作会异常
parent
53387cb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
FlyAd2021B2Adv.cs
Project.FLY.FlyADBase/FlyAd2021.B2/FlyAd2021B2Adv.cs
+10
-4
TimeGridAdvHelper.cs
Project.FLY.FlyADBase/FlyAd2021.B2/TimeGridAdvHelper.cs
+6
-2
No files found.
Project.FLY.FlyADBase/FlyAd2021.B2/FlyAd2021B2Adv.cs
View file @
caed97dd
...
...
@@ -254,7 +254,10 @@ namespace FlyADBase
}
//数据滞后
TimeGridAdvHelperExt
.
AdLagCorr
(
dataList
,
ref
endTime
,
ADLag
,
AD2Lag
);
if
(!
TimeGridAdvHelperExt
.
AdLagCorr
(
dataList
,
ref
endTime
,
ADLag
,
AD2Lag
))
{
throw
new
Exception
(
"数据量太少,无法滞后修正"
);
}
...
...
@@ -354,9 +357,12 @@ namespace FlyADBase
var
dataList
=
mTimeGridAdvHelper
.
GetData
(
lastGridTime
);
var
endTime
=
mTimeGridAdvHelper
.
NewestTime
;
//滞后修正
TimeGridAdvHelperExt
.
AdLagCorr
(
dataList
,
ref
endTime
,
ADLag
,
AD2Lag
);
//数据滞后
if
(!
TimeGridAdvHelperExt
.
AdLagCorr
(
dataList
,
ref
endTime
,
ADLag
,
AD2Lag
))
{
throw
new
Exception
(
"数据量太少,无法滞后修正"
);
}
//获取grid图
TimeGridAdvHelperExt
.
ToGrid
(
dataList
,
PosOfGrid
,
GridLen
,
...
...
Project.FLY.FlyADBase/FlyAd2021.B2/TimeGridAdvHelper.cs
View file @
caed97dd
...
...
@@ -591,13 +591,16 @@ namespace FlyADBase
/// <param name="dataPool"></param>
/// <param name="ad1Lag"></param>
/// <param name="ad2Lag"></param>
public
static
void
AdLagCorr
(
List
<
DateTimeUnit5
>
dataPool
,
ref
DateTime
endTime
,
int
ad1Lag
,
int
ad2Lag
)
public
static
bool
AdLagCorr
(
List
<
DateTimeUnit5
>
dataPool
,
ref
DateTime
endTime
,
int
ad1Lag
,
int
ad2Lag
)
{
int
lag
=
Math
.
Max
(
ad1Lag
,
ad2Lag
);
if
(
lag
==
0
)
return
;
return
true
;
int
endIdx
=
dataPool
.
Count
()
-
1
-
lag
;
if
(
endIdx
<
0
)
return
false
;
int
removeCnt
=
lag
;
for
(
int
i
=
0
;
i
<
endIdx
;
i
++)
{
...
...
@@ -624,6 +627,7 @@ namespace FlyADBase
dataPool
.
RemoveRange
(
endIdx
+
1
,
removeCnt
);
endTime
-=
TimeSpan
.
FromMilliseconds
(
removeCnt
);
}
return
true
;
}
/// <summary>
/// 获取平均速度, 单位 脉冲/min
...
...
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