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
bdcd8b9a
Commit
bdcd8b9a
authored
Jun 15, 2020
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.升级 flyad 的吹膜模拟器,更多信息。
2.修复 当撞转向开关时间很短,只有1s, 追边测厚会出现一幅空的数据。 解决把 撞转向开关时间 的这段时间认为旋转架不动。 都归为 下圈数据
parent
ab051806
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
176 deletions
+13
-176
BlowingDetect.cs
...Y.Thick.Blowing/FLY.Thick.Blowing/Server/BlowingDetect.cs
+12
-175
thick_public
thick_public
+1
-1
No files found.
Project.FLY.Thick.Blowing/FLY.Thick.Blowing/Server/BlowingDetect.cs
View file @
bdcd8b9a
...
...
@@ -1627,81 +1627,6 @@ namespace FLY.Thick.Blowing.Server
}
}
/// <summary>
/// 计算出角度 -180~180 变速阶段
/// </summary>
/// <param name="dtEnd"></param>
/// <param name="dtStart"></param>
/// <param name="noStart">dtStart的信号</param>
/// <param name="dt">dt 在 [dtStart , dtEnd]</param>
/// <param name="renZiJiaPeriod">上一次两个限位的间距时间</param>
/// <param name="angle">角度</param>
/// <param name="direction">方向, 只有正向 与 反向</param>
void
LimitListCal_SpeedChange
(
DateTime
dtEnd
,
DateTime
dtStart
,
int
noStart
,
DateTime
dt
,
TimeSpan
renZiJiaPeriod
,
out
double
angle
,
out
Misc
.
DIRECTION
direction
)
{
//默认 dt 在 dtStart <= dt <= dtEnd, 出错不处理!!!
if
((
dt
<
dtStart
)
||
(
dt
>
dtEnd
))
{
throw
new
Exception
(
"(dt<dtStart)|| (dt>dtEnd) dt="
+
dt
.
ToString
()
+
" dtStart="
+
dtStart
.
ToString
()
+
" dtEnd="
+
dtEnd
.
ToString
());
}
TimeSpan
accDecTime
=
AccDecTime
;
if
((
dtEnd
-
dtStart
)
<
(
accDecTime
+
accDecTime
))
accDecTime
=
TimeSpan
.
FromTicks
((
dtEnd
-
dtStart
).
Ticks
/
2
);
DateTime
dtMid
=
dtStart
+
TimeSpan
.
FromTicks
((
dtEnd
-
dtStart
).
Ticks
/
2
);
if
(
noStart
==
0
)
{
if
(
dt
<
dtMid
)
direction
=
Misc
.
DIRECTION
.
BACKWARD
;
else
direction
=
Misc
.
DIRECTION
.
FORWARD
;
}
else
{
if
(
dt
<
dtMid
)
direction
=
Misc
.
DIRECTION
.
FORWARD
;
else
direction
=
Misc
.
DIRECTION
.
BACKWARD
;
}
double
dAngle
;
if
(
dt
<
(
dtStart
+
accDecTime
))
//减速
{
TimeSpan
ts
=
dt
-
dtStart
;
//已经过去时间
double
vStart
=
RAngle
/
renZiJiaPeriod
.
TotalSeconds
;
//开始速度 °/s
double
vEnd
=
0
;
//结束速度 °/s
double
a
=
(
vEnd
-
vStart
)
/
accDecTime
.
TotalSeconds
;
//加速度 °/s^2
double
vCurr
=
vStart
+
a
*
ts
.
TotalSeconds
;
//当前速度 //开始速度 °/s
dAngle
=
(
vStart
+
vCurr
)
/
2
*
ts
.
TotalSeconds
;
//总角度 °
}
else
if
(
dt
<
(
dtEnd
-
accDecTime
))
//停止
{
double
vStart
=
RAngle
/
renZiJiaPeriod
.
TotalSeconds
;
//开始速度 °/s
double
vEnd
=
0
;
//结束速度 °/s
double
a
=
(
vEnd
-
vStart
)
/
accDecTime
.
TotalSeconds
;
//加速度 °/s^2
dAngle
=
(
vStart
+
vEnd
)
/
2
*
accDecTime
.
TotalSeconds
;
//总角度 °
}
else
//加速
{
TimeSpan
ts
=
dtEnd
-
dt
;
double
vStart
=
0
;
//开始速度 °/s
double
vEnd
=
RAngle
/
renZiJiaPeriod
.
TotalSeconds
;
//结束速度 °/s
double
a
=
(
vEnd
-
vStart
)
/
accDecTime
.
TotalSeconds
;
//加速度 °/s^2
double
vCurr
=
vEnd
-
a
*
ts
.
TotalSeconds
;
//当前速度 //开始速度 °/s
dAngle
=
(
vEnd
+
vCurr
)
/
2
*
ts
.
TotalSeconds
;
//总角度 °
}
if
(
noStart
==
0
)
angle
=
-
RAngle
/
2
-
dAngle
;
else
angle
=
RAngle
/
2
+
dAngle
;
}
/// <summary>
/// 时间点查找旋转角度 -180~180
...
...
@@ -1720,7 +1645,6 @@ namespace FLY.Thick.Blowing.Server
DateTime
dt_start
;
DateTime
dt_end
;
int
no
;
//TODO,rotationCnt 还没处理!!!!!
switch
(
ret
)
{
...
...
@@ -1772,97 +1696,36 @@ namespace FLY.Thick.Blowing.Server
break
;
case
ListFindIndexResult
.
Past
:
//过去
{
if
(
mLimitList
[
0
].
no
==
0
)
no
=
1
;
else
no
=
0
;
dt_start
=
mDefaultTime
;
dt_end
=
mLimitList
[
0
].
dt_begin
;
no
=
(
mLimitList
[
0
].
no
==
0
)
?
1
:
0
;
rotationCnt
=
LimitIndexToRotationCnt
(-
1
);
inCV
=
true
;
LimitListCal_ConstantVelocity
(
dt_end
,
dt_start
,
no
,
dt
,
out
angle
,
out
direction
);
}
break
;
case
ListFindIndexResult
.
InCell
:
//TODO
{
dt_start
=
mLimitList
[
index
].
dt_begin
;
dt_end
=
mLimitList
[
index
].
dt_end
;
no
=
mLimitList
[
index
].
no
;
rotationCnt
=
LimitIndexToRotationCnt
(
index
);
DateTime
dtMid
=
dt_start
+
TimeSpan
.
FromTicks
((
dt_end
-
dt_start
).
Ticks
/
2
);
if
(
dt
<
dtMid
)
//以限位的中间时间为分界
{
rotationCnt
--;
}
TimeSpan
renZiJiaPeriod
;
if
(
index
>=
1
)
{
renZiJiaPeriod
=
mLimitList
[
index
].
dt_begin
-
mLimitList
[
index
-
1
].
dt_end
;
}
else
{
renZiJiaPeriod
=
mLimitList
[
index
].
dt_begin
-
mDefaultTime
;
}
inCV
=
false
;
LimitListCal_SpeedChange
(
dt_end
,
dt_start
,
no
,
dt
,
RenZiJiaPeriod
,
out
angle
,
out
direction
);
}
break
;
//case ListFindIndexResult.InCell:
//case ListFindIndexResult.MaybeInCell:
default
:
//case ListFindIndexResult.MaybeInCell:
{
dt_start
=
mLimitList
[
index
].
dt_begin
;
dt_end
=
dt_start
+
LimitSignTime
;
if
(
dt
>
dt_end
)
{
if
(
modifyparam
)
//基本不会发生!!!
{
LimitSignTime
=
dt
-
dt_start
+
TimeSpan
.
FromSeconds
(
5
);
dt_end
=
dt_start
+
LimitSignTime
;
}
else
{
dt_end
=
dt
;
}
}
//发生在 撞换向信号中间,
inCV
=
false
;
no
=
mLimitList
[
index
].
no
;
rotationCnt
=
LimitIndexToRotationCnt
(
index
);
DateTime
dtMid
=
dt_start
+
TimeSpan
.
FromTicks
((
dt_end
-
dt_start
).
Ticks
/
2
);
if
(
dt
<
dtMid
)
//以限位的中间时间为分界
if
(
no
==
0
)
{
rotationCnt
--;
angle
=
-
RAngle
/
2
;
direction
=
DIRECTION
.
FORWARD
;
}
TimeSpan
renZiJiaPeriod
;
if
(
index
>=
1
)
{
renZiJiaPeriod
=
mLimitList
[
index
].
dt_begin
-
mLimitList
[
index
-
1
].
dt_end
;
}
else
{
renZiJiaPeriod
=
mLimitList
[
index
].
dt_begin
-
mDefaultTime
;
else
{
angle
=
RAngle
/
2
;
direction
=
DIRECTION
.
BACKWARD
;
}
inCV
=
false
;
LimitListCal_SpeedChange
(
dt_end
,
dt_start
,
no
,
dt
,
RenZiJiaPeriod
,
out
angle
,
out
direction
);
}
break
;
}
}
#
region
RollList
查找
...
...
@@ -2152,33 +2015,7 @@ namespace FLY.Thick.Blowing.Server
public
delegate
void
ClearEventHandler
(
object
sender
);
public
event
ClearEventHandler
ClearEvent
;
//public BlowingDetect Clone()
//{
// BlowingDetect rdetect = new BlowingDetect();
// rdetect.mDefaultTime = mDefaultTime;
// foreach (RollCell r in mRollList)
// {
// rdetect.mRollList.Add(r.Clone());
// }
// foreach (LimitCell l in mLimitList)
// {
// rdetect.mLimitList.Add(l.Clone());
// }
// rdetect.RAngle = RAngle;
// rdetect.RollPerimeter = RollPerimeter;
// rdetect.RenZiJiaPeriod = RenZiJiaPeriod;
// rdetect.FilmLength = FilmLength;
// rdetect.RotationCnt = RotationCnt;
// //多余
// rdetect.DefaultRPeriod = DefaultRPeriod;
// rdetect.IsSign0Double = IsSign0Double;
// rdetect.IsSign1Double = IsSign1Double;
// rdetect.SignType = SignType;
// return rdetect;
//}
/// <summary>
/// 释放资源
/// </summary>
...
...
thick_public
@
582acd98
Subproject commit
88b4c13d3d404a1c744118f13918d63f2082d13a
Subproject commit
582acd98f8bb22d5ba23e7010615b7f1d63272b9
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