Commit 096db404 authored by 潘栩锋's avatar 潘栩锋 🚴

修复 限制分区序号范围,解决之前的 org_thicks[boltindex] 溢出问题

parent 4eb6fa2a
......@@ -116,17 +116,17 @@ namespace FLY.Thick.Blowing.Server
/// <summary>
/// 自定义 转向信号 输入口序号 从0开始 默认9-1
/// </summary>
public int InNo_Limit0 { get; set; } = FlyADIODefine.Instance.InNo_Limit0;
public int InNo_Limit0 { get; set; } = 9 - 1;
/// <summary>
/// 自定义 转向信号 输入口序号 从0开始 默认10-1
/// </summary>
public int InNo_Limit1 { get; set; } = FlyADIODefine.Instance.InNo_Limit1;
public int InNo_Limit1 { get; set; } = 10 - 1;
/// <summary>
/// 自定义 辊速度 输入口序号 从0开始 默认11-1
/// </summary>
public int InNo_Roll { get; set; } = FlyADIODefine.Instance.InNo_Roll;
public int InNo_Roll { get; set; } = 11 - 1;
#endregion
#region 状态
......@@ -1729,8 +1729,8 @@ namespace FLY.Thick.Blowing.Server
/// </summary>
/// <param name="a">与0°的偏移, 0~180</param>
/// <param name="dt">时间点</param>
/// <param name="angle0">上面的膜对应的膜角度</param>
/// <param name="angle1">下面的膜对应的膜角度</param>
/// <param name="angle0">上面的膜对应的膜角度 [0~360)</param>
/// <param name="angle1">下面的膜对应的膜角度 [0~360)</param>
/// <param name="direction">人字架正转?反转? FIX, 停止!</param>
/// <param name="rotationCnt">扫描次数</param>
/// <param name="inCV">在恒速阶段</param>
......
......@@ -226,7 +226,12 @@ namespace FLY.Thick.BlowingScan.Server
}
}
/// <summary>
/// 角度转分区序号, 角度范围[0~360°)
/// </summary>
/// <param name="a">膜泡角度[0~360°)</param>
/// <param name="orgboltno">复位区号</param>
/// <returns></returns>
int GetBoltIndexFromAngle(double a, int orgboltno)
{
int boltno1st = 1;
......@@ -235,8 +240,11 @@ namespace FLY.Thick.BlowingScan.Server
boltindex += orgboltno - boltno1st;
if (boltindex >= nbolts)
boltindex -= nbolts;
//100%确保输出的序号在有效范围内
while (boltindex < 0)
boltindex += nbolts;//正常情况不会调用
while (boltindex>=nbolts)
boltindex -= nbolts;//极端情况,a=360.2°, 这个会调用2次
return boltindex;
}
......@@ -1137,7 +1145,7 @@ namespace FLY.Thick.BlowingScan.Server
int pos = i * posOfGrid + posOfGrid / 2;//一个grid的中间脉冲,也就是大概而已
double thk = double.NaN;
if (Misc.MyBase.ISVALIDATA(dat[idx]))
if (!double.IsNaN(dat[idx]))
thk = Ad2Thk(dat[idx]) * 2;
pos -= scaninfocell.beginPos;//膜上面的位置
......@@ -1525,7 +1533,7 @@ namespace FLY.Thick.BlowingScan.Server
if (double.IsNaN(avg))//平均值不合法!!!!
return false;
if (avg < 500)//值太小!!!
if (avg < 5)//小于5um ,太小!!!
return false;
List<EquationCell> equationlist = new List<EquationCell>();
......@@ -1699,7 +1707,7 @@ namespace FLY.Thick.BlowingScan.Server
{
//失败,删除!!!
for (int i = 0; i < scaninfo.thks.Count(); i++)
scaninfo.thks[i] = Misc.MyBase.NULL_VALUE;
scaninfo.thks[i] = double.NaN;
}
scaninfo.lockbm = true;
return true;
......
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