Commit bdcd8b9a authored by 潘栩锋's avatar 潘栩锋 🚴

1.升级 flyad 的吹膜模拟器,更多信息。

2.修复 当撞转向开关时间很短,只有1s, 追边测厚会出现一幅空的数据。 解决把 撞转向开关时间 的这段时间认为旋转架不动。 都归为 下圈数据
parent ab051806
......@@ -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>
......
Subproject commit 88b4c13d3d404a1c744118f13918d63f2082d13a
Subproject commit 582acd98f8bb22d5ba23e7010615b7f1d63272b9
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment