Commit b6d4f719 LN

灯条测试问题修改

1 个父辈 c2617b00
......@@ -90,12 +90,10 @@ namespace DeviceLibrary
}
private void Run()
{
return;
Task.Run(() => {
try
{
var p1 = RobotManage.mainMachine.Config.Middle_P1;
var p1_speed = RobotManage.mainMachine.Config.Middle_P1_speed;
var axis = RobotManage.mainMachine.Middle_Axis;
while (ok)
{
......
......@@ -48,7 +48,7 @@ namespace DeviceLibrary
{
LogUtil.error("LED灯初始化成功");
rgbLedInitOk = true;
ledRgbTimer = new System.Threading.Timer(new TimerCallback(RgbLedProcess), null, 0, 1000);
ledRgbTimer = new System.Threading.Timer(new TimerCallback(RgbLedProcess), null, 0, 500);
GC.KeepAlive(ledRgbTimer);
msg = "";
return true;
......@@ -75,11 +75,11 @@ namespace DeviceLibrary
}
if (lastColor != "" && lastColor.Equals(color.Name.ToString()))
{
return;
//return;
}
else
{
LogUtil.info(Name + " ShowColor " + lastS + "=" + lastColor);
{
LogUtil.info(Name + " oldColor :" + lastS + "=" + lastColor + " , ShowColor " + lastState + "=" + color.Name.ToString());
}
//if (lastColor.Equals("yellowL")||lastColor.Equals("greenL"))
//{
......@@ -89,29 +89,31 @@ namespace DeviceLibrary
lastS = lastState;
//rGB_Controller.CloseLed();
rGB_Controller.ShowColor(color);
lastColor = color.Name.ToString();
lastColor = color.Name.ToString();
}
catch (Exception ex) { LogUtil.error("ShowColror " + color + ", " + lastState + "出错:" + ex.ToString()); }
}
public void ShowYellowLight()
public void ShowYellowLight(string s= "storeOut")
{
if (lastColor.Equals("yellowL"))
if (!lastColor.Equals("yellowL"))
{
return;
LogUtil.info(Name + " oldColor :" + lastS + "=" + lastColor + " , ShowColor " + s + "=yellowL" );
}
lastS = s;
lastColor = "yellowL";
//rGB_Controller.CloseLed();
rGB_Controller.ShowYellowLight();
}
public void ShowGreenLight()
public void ShowGreenLight(string s= "storeIn")
{
if (lastColor.Equals("greenL"))
if (!lastColor.Equals("greenL"))
{
return;
LogUtil.info(Name + " oldColor :" + lastS + "=" + lastColor + " , ShowColor " + s + "=yellowL");
}
lastColor = "greenL";
lastS = s;
//rGB_Controller.CloseLed();
rGB_Controller.ShowGreenLight();
}
......@@ -141,8 +143,11 @@ namespace DeviceLibrary
//出入库 绿闪 黄闪
if (StoreMoveInfo.MoveStep >= MoveStep.StoreOut10)
{
inOut = true;
}
else if (StringMoveInfo.MoveStep >= MoveStep.StringReelPut && StringMoveInfo.MoveStep <= MoveStep.StringReelPut_05)
{
inOut = true;
}
else if (StoreMoveInfo.MoveStep >= MoveStep.StoreIn01)
{
......@@ -152,21 +157,21 @@ namespace DeviceLibrary
{
inPut = true;
}
else if (StringMoveInfo.MoveStep >= MoveStep.StringReelPut && StringMoveInfo.MoveStep <= MoveStep.StringReelPut_05)
{
inOut = true;
}else if (!ClampMoveInfo.IsStep(MoveStep.Wait))
{
inPut = true;
}
if (ClampMoveInfo.IsStep(MoveStep.ReelClamp_10) && (!RobotManage.InoutDebugMode) && (!ClampMoveInfo.MoveParam.IsNg))
{
scanCode = true;
}
if(StoreMoveInfo.IsStep(MoveStep.Wait)&&ClampMoveInfo.IsStep(MoveStep.Wait)&& StringMoveInfo.IsStep(MoveStep.Wait))
{
}
if (ResetMoveInfo.IsStep(MoveStep.H14_HomeReset))
{
waitTake = true;
}
else if (h != null && h.Value )
else if (ClampMoveInfo.IsStep(MoveStep.NGOUT_03))
{
waitTake = true;
}
......@@ -175,7 +180,7 @@ namespace DeviceLibrary
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW) || isInSuddenDown)
{
//红色: 急停,
ShowColor(Color.Red, "suddenStop");
ShowColor(Color.Red, "suddenStop");
}
else if (runStatus == RunStatus.Stop)
{
......@@ -189,37 +194,37 @@ namespace DeviceLibrary
{
}
}
}
else if (scanCode)
{
//蓝色: 扫码检测
ShowColor(Color.Blue, "scanCode");
ShowColor(Color.Blue, "scanCode");
}
else if (waitTake)
{
//暂停等待料盘拿走
//白色: 等待用户响应(等待取走盘等),
//蓝色: 扫码检测
ShowColor(Color.White, "waitTask");
}
//出入库 绿闪 黄闪
else if (inOut)
{
////流动黄: 出库,
ShowYellowLight();
lastS = "storeOut";
LogUtil.info(Name + " ShowColor " + lastS + "=" + lastColor);
//lastS = "storeOut";
//LogUtil.info(Name + " ShowColor " + lastS + "=" + lastColor);
}
else if (inPut)
{
ShowGreenLight();
lastS = "storeIn";
LogUtil.info(Name + " ShowColor " + lastS + "=" + lastColor);
}
else if (waitTake)
{
//暂停等待料盘拿走
//白色: 等待用户响应(等待取走盘等),
//蓝色: 扫码检测
ShowColor(Color.White, "waitTask");
//lastS = "storeIn";
//LogUtil.info(Name + " ShowColor " + lastS + "=" + lastColor);
}
else if (hasAlarm)
{
//紫色: 异常,
ShowColor(Color.Purple, "hasAlarm");
ShowColor(Color.Purple, "hasAlarm");
} //温度超限
//else if (IsTHoutRange())
......@@ -238,7 +243,7 @@ namespace DeviceLibrary
else
{
//待机 蓝绿
ShowColor(Color.FromArgb(0, 255, 64), "waiting");
ShowColor(Color.FromArgb(0, 255, 64), "waiting");
}
}
}
......
......@@ -207,13 +207,13 @@ namespace TheMachine
private void btnYellow_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.ShowYellowLight();
RobotManage.mainMachine.ShowYellowLight("test");
}
private void btnGree_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.ShowGreenLight();
RobotManage.mainMachine.ShowGreenLight("test");
}
private void btnChangeColor_Click(object sender, EventArgs e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!