Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hemei
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
潘栩锋
hemei
Commits
50133b5b
Commit
50133b5b
authored
Jun 12, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
还没整理 360程序
parent
12c0a20a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
36 deletions
+36
-36
BlowingDetect360Core.cs
...lowing360/FLY.Thick.Blowing360.UI/BlowingDetect360Core.cs
+7
-7
CalFilmLen360.cs
...Thick.Blowing360/FLY.Thick.Blowing360.UI/CalFilmLen360.cs
+9
-9
BlowingDetect360.cs
...lowing360/FLY.Thick.Blowing360/Server/BlowingDetect360.cs
+15
-15
BlowingDetect360Encoder.cs
...60/FLY.Thick.Blowing360/Server/BlowingDetect360Encoder.cs
+5
-5
No files found.
Project.FLY.Thick.Blowing360/FLY.Thick.Blowing360.UI/BlowingDetect360Core.cs
View file @
50133b5b
...
...
@@ -302,9 +302,9 @@ namespace FLY.Thick.Blowing360.UI
/// <returns></returns>
double
RollList_GetPosition
(
int
idx
,
DateTime
dt
)
{
DateTime
dt1
=
mRollList
[
idx
+
1
].
dt
;
DateTime
dt1
=
mRollList
[
idx
+
1
].
Time
;
double
position1
=
(
idx
+
1
)
*
RollPerimeter
;
DateTime
dt2
=
mRollList
[
idx
].
dt
;
DateTime
dt2
=
mRollList
[
idx
].
Time
;
double
position2
=
(
idx
)
*
RollPerimeter
;
return
(
position1
-
position2
)
*
(
dt
-
dt2
).
Ticks
/
(
dt1
-
dt2
).
Ticks
+
position2
;
...
...
@@ -316,8 +316,8 @@ namespace FLY.Thick.Blowing360.UI
/// <returns></returns>
double
RollList_GetVelocity
(
int
idx
)
{
DateTime
dt1
=
mRollList
[
idx
+
1
].
s
ysTime
;
DateTime
dt2
=
mRollList
[
idx
].
s
ysTime
;
DateTime
dt1
=
mRollList
[
idx
+
1
].
S
ysTime
;
DateTime
dt2
=
mRollList
[
idx
].
S
ysTime
;
return
RollPerimeter
/
1000
/
dt1
.
Subtract
(
dt2
).
TotalMinutes
;
}
...
...
@@ -330,9 +330,9 @@ namespace FLY.Thick.Blowing360.UI
DateTime
RollList_GetDateTime
(
int
idx
,
double
position
)
{
//TODO 经常出错,position 无限小,idx=0
DateTime
dt1
=
mRollList
[
idx
+
1
].
dt
;
DateTime
dt1
=
mRollList
[
idx
+
1
].
Time
;
double
position1
=
(
idx
+
1
)
*
RollPerimeter
;
DateTime
dt2
=
mRollList
[
idx
].
dt
;
DateTime
dt2
=
mRollList
[
idx
].
Time
;
double
position2
=
(
idx
)
*
RollPerimeter
;
return
dt2
.
Add
(
new
TimeSpan
((
long
)((
dt1
-
dt2
).
Ticks
*
(
position
-
position2
)
/
(
position1
-
position2
))));
...
...
@@ -393,7 +393,7 @@ namespace FLY.Thick.Blowing360.UI
for
(
int
i
=
mRollList
.
Count
-
1
;
i
>=
0
;
i
--)
{
if
(
dt
>=
mRollList
[
i
].
dt
)
if
(
dt
>=
mRollList
[
i
].
Time
)
{
//找到了
if
(
i
==
(
mRollList
.
Count
-
1
))
//这个是未来的时间点,还没发生!!!
...
...
Project.FLY.Thick.Blowing360/FLY.Thick.Blowing360.UI/CalFilmLen360.cs
View file @
50133b5b
...
...
@@ -283,15 +283,15 @@ namespace FLY.Thick.Blowing360.UI
for
(
int
i
=
0
;
i
<
mRollList
.
Count
();
i
++)
{
var
sysTime_min
=
mRollList
[
i
].
s
ysTime
-
filter_half
;
var
sysTime_max
=
mRollList
[
i
].
s
ysTime
+
filter_half
;
var
sysTime_min
=
mRollList
[
i
].
S
ysTime
-
filter_half
;
var
sysTime_max
=
mRollList
[
i
].
S
ysTime
+
filter_half
;
int
i_begin
=
0
;
int
i_end
=
mRollList
.
Count
()
-
1
;
for
(
int
j
=
i
;
j
>=
0
;
j
--)
{
if
(
mRollList
[
j
].
s
ysTime
<=
sysTime_min
)
if
(
mRollList
[
j
].
S
ysTime
<=
sysTime_min
)
{
//找到了
i_begin
=
j
;
...
...
@@ -301,7 +301,7 @@ namespace FLY.Thick.Blowing360.UI
for
(
int
j
=
i
;
j
<
mRollList
.
Count
();
j
++)
{
if
(
mRollList
[
j
].
s
ysTime
>=
sysTime_max
)
if
(
mRollList
[
j
].
S
ysTime
>=
sysTime_max
)
{
//找到了
i_end
=
j
;
...
...
@@ -320,13 +320,13 @@ namespace FLY.Thick.Blowing360.UI
}
}
TimeSpan
ts
=
mRollList
[
i_end
].
sysTime
-
mRollList
[
i_begin
].
s
ysTime
;
TimeSpan
ts
=
mRollList
[
i_end
].
SysTime
-
mRollList
[
i_begin
].
S
ysTime
;
double
minute
=
1.0
*
ts
.
Ticks
/
TimeSpan
.
TicksPerMinute
;
double
v
=
(
i_end
-
i_begin
)
*
mCurrRDetect
.
RollPerimeter
/
1000
/
minute
;
VelocityValues
.
Add
(
new
TimeValue
()
{
Time
=
mRollList
[
i
].
dt
,
Time
=
mRollList
[
i
].
Time
,
Value
=
v
});
}
...
...
@@ -757,15 +757,15 @@ namespace FLY.Thick.Blowing360.UI
if
(
param
.
mRollList
.
Count
()
==
0
)
{
param
.
mRollList
.
Add
(
new
RollCell
()
{
dt
=
dt
});
param
.
mRollList
.
Add
(
new
RollCell
()
{
Time
=
dt
});
}
else
{
while
((
dt
-
param
.
mRollList
.
Last
().
dt
).
TotalMinutes
*
v
>
(
param
.
RollPerimeter
/
1000
))
while
((
dt
-
param
.
mRollList
.
Last
().
Time
).
TotalMinutes
*
v
>
(
param
.
RollPerimeter
/
1000
))
{
param
.
mRollList
.
Add
(
new
RollCell
()
{
dt
=
param
.
mRollList
.
Last
().
dt
+
TimeSpan
.
FromMinutes
((
param
.
RollPerimeter
/
1000
)
/
v
)
Time
=
param
.
mRollList
.
Last
().
Time
+
TimeSpan
.
FromMinutes
((
param
.
RollPerimeter
/
1000
)
/
v
)
});
}
}
...
...
Project.FLY.Thick.Blowing360/FLY.Thick.Blowing360/Server/BlowingDetect360.cs
View file @
50133b5b
...
...
@@ -521,8 +521,8 @@ namespace FLY.Thick.Blowing360.Server
mRollList
.
RAdd
(
new
RollCell
()
{
dt
=
dt
,
s
ysTime
=
sysTime
Time
=
dt
,
S
ysTime
=
sysTime
});
...
...
@@ -598,15 +598,15 @@ namespace FLY.Thick.Blowing360.Server
{
if
(
mRollList
.
Count
>
1
)
{
DateTime
sysTime1
=
mRollList
[
mRollList
.
Count
-
1
].
s
ysTime
;
DateTime
sysTime1
=
mRollList
[
mRollList
.
Count
-
1
].
S
ysTime
;
int
cnt
=
5
;
if
(
cnt
>
mRollList
.
Count
)
cnt
=
mRollList
.
Count
;
DateTime
sysTime2
=
mRollList
[
mRollList
.
Count
-
cnt
].
s
ysTime
;
DateTime
sysTime2
=
mRollList
[
mRollList
.
Count
-
cnt
].
S
ysTime
;
TimeSpan
ts_last
=
TimeSpan
.
FromTicks
((
sysTime1
-
sysTime2
).
Ticks
/
(
cnt
-
1
));
//5次的平均滤波, 使用AD盒的时间算出来的时间差,最准
DateTime
sysTime11
=
mRollList
[
mRollList
.
Count
-
(
cnt
-
1
)].
s
ysTime
;
DateTime
sysTime11
=
mRollList
[
mRollList
.
Count
-
(
cnt
-
1
)].
S
ysTime
;
//因为没有使用AD盒的时间,所以可以用DateTime.Now 比较
...
...
@@ -624,7 +624,7 @@ namespace FLY.Thick.Blowing360.Server
FilmVelocity
=
RollPerimeter
/
1000.0
/
ts_max
.
TotalMinutes
;
BufTotalTime
=
DateTime
.
Now
-
mRollList
[
0
].
dt
;
BufTotalTime
=
DateTime
.
Now
-
mRollList
[
0
].
Time
;
}
}
/// <summary>
...
...
@@ -634,7 +634,7 @@ namespace FLY.Thick.Blowing360.Server
{
if
(
mRollList
.
Count
>
0
)
{
DateTime
dt
=
mRollList
[
mRollList
.
Count
-
1
].
dt
;
DateTime
dt
=
mRollList
[
mRollList
.
Count
-
1
].
Time
;
TimeSpan
ts
=
DateTime
.
Now
-
dt
;
if
(
ts
.
TotalMinutes
>
1
)
//1min
{
...
...
@@ -975,9 +975,9 @@ namespace FLY.Thick.Blowing360.Server
/// <returns></returns>
double
RollList_GetPosition
(
int
idx
,
DateTime
dt
)
{
DateTime
dt1
=
mRollList
[
idx
+
1
].
dt
;
DateTime
dt1
=
mRollList
[
idx
+
1
].
Time
;
double
position1
=
(
idx
+
1
)
*
RollPerimeter
;
DateTime
dt2
=
mRollList
[
idx
].
dt
;
DateTime
dt2
=
mRollList
[
idx
].
Time
;
double
position2
=
(
idx
)
*
RollPerimeter
;
return
(
position1
-
position2
)
*
(
dt
-
dt2
).
Ticks
/
(
dt1
-
dt2
).
Ticks
+
position2
;
...
...
@@ -989,8 +989,8 @@ namespace FLY.Thick.Blowing360.Server
/// <returns></returns>
double
RollList_GetVelocity
(
int
idx
)
{
DateTime
dt1
=
mRollList
[
idx
+
1
].
s
ysTime
;
DateTime
dt2
=
mRollList
[
idx
].
s
ysTime
;
DateTime
dt1
=
mRollList
[
idx
+
1
].
S
ysTime
;
DateTime
dt2
=
mRollList
[
idx
].
S
ysTime
;
return
RollPerimeter
/
1000
/
dt1
.
Subtract
(
dt2
).
TotalMinutes
;
}
...
...
@@ -1003,9 +1003,9 @@ namespace FLY.Thick.Blowing360.Server
DateTime
RollList_GetDateTime
(
int
idx
,
double
position
)
{
//TODO 经常出错,position 无限小,idx=0
DateTime
dt1
=
mRollList
[
idx
+
1
].
dt
;
DateTime
dt1
=
mRollList
[
idx
+
1
].
Time
;
double
position1
=
(
idx
+
1
)
*
RollPerimeter
;
DateTime
dt2
=
mRollList
[
idx
].
dt
;
DateTime
dt2
=
mRollList
[
idx
].
Time
;
double
position2
=
(
idx
)
*
RollPerimeter
;
return
dt2
.
Add
(
new
TimeSpan
((
long
)((
dt1
-
dt2
).
Ticks
*
(
position
-
position2
)
/
(
position1
-
position2
))));
...
...
@@ -1066,7 +1066,7 @@ namespace FLY.Thick.Blowing360.Server
for
(
int
i
=
mRollList
.
Count
-
1
;
i
>=
0
;
i
--)
{
if
(
dt
>=
mRollList
[
i
].
dt
)
if
(
dt
>=
mRollList
[
i
].
Time
)
{
//找到了
if
(
i
==
(
mRollList
.
Count
-
1
))
//这个是未来的时间点,还没发生!!!
...
...
@@ -1327,7 +1327,7 @@ namespace FLY.Thick.Blowing360.Server
{
var
p
=
new
GetRollListReponse
();
p
.
datas
=
mRollList
.
FindAll
(
r
=>
r
.
dt
>=
begin
);
p
.
datas
=
mRollList
.
FindAll
(
r
=>
r
.
Time
>=
begin
);
asyncDelegate
(
asyncContext
,
p
);
}
...
...
Project.FLY.Thick.Blowing360/FLY.Thick.Blowing360/Server/BlowingDetect360Encoder.cs
View file @
50133b5b
...
...
@@ -330,8 +330,8 @@ namespace FLY.Thick.Blowing360.Server
mRollList
.
RAdd
(
new
RollCell
()
{
dt
=
dt
,
s
ysTime
=
sysTime
Time
=
dt
,
S
ysTime
=
sysTime
});
}
}
...
...
@@ -612,15 +612,15 @@ namespace FLY.Thick.Blowing360.Server
//更新当前速度
if
(
lastRollTime
!=
mRollList
.
Last
().
dt
)
if
(
lastRollTime
!=
mRollList
.
Last
().
Time
)
{
lastRollTime
=
mRollList
.
Last
().
dt
;
lastRollTime
=
mRollList
.
Last
().
Time
;
int
lastIndex
=
mRollList
.
Count
()
-
1
;
double
v
=
FilmVelocity
;
//计算3秒内均值
for
(
int
index
=
mRollList
.
Count
()
-
2
;
index
>=
0
;
index
--)
{
DateTime
firstTime
=
mRollList
[
index
].
dt
;
DateTime
firstTime
=
mRollList
[
index
].
Time
;
TimeSpan
ts
=
lastRollTime
-
firstTime
;
int
interval
=
lastIndex
-
index
;
double
m
=
RollPerimeter
*
interval
/
1000.0
;
...
...
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