Commit b6d4f719 LN

灯条测试问题修改

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