Commit 82e6d241 几米阳光

调试修改

1 个父辈 7892e735
......@@ -26,10 +26,11 @@ namespace URSoldering.DeviceLibrary
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitEpson()
public static WaitResultInfo WaitRobotPoint(URPointValue point)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 3;
wait.UrPoint = point;
wait.IsEnd = false;
return wait;
}
......@@ -43,16 +44,16 @@ namespace URSoldering.DeviceLibrary
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitSendWire(int MScends,bool isR)
public static WaitResultInfo WaitSendWire(int MScends, bool isR)
{
WaitResultInfo wait = new WaitResultInfo();
wait.ShuoKeISReverse = isR;
wait.WaitType = 5;
wait.WaitType = 5;
wait.TimeMSeconds = MScends;
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitEpsonRun()
public static WaitResultInfo WaitRobotRun()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 6;
......@@ -88,7 +89,7 @@ namespace URSoldering.DeviceLibrary
}
}
/// <summary>
/// 等待结果,1=IO运动,2=时间 ,3=机器人运动OK,4=温度设置结束,5=送丝结束,6=等待爱普生机器人连接
/// 等待结果,1=IO运动,2=时间 ,3=机器人运动OK,4=温度设置结束,5=送丝结束,6=等待机器人连接完成
/// 11=等待IAI压机伺服ON,12=等待IAI伺服到待机点,13=等待IAI伺服程序运行OK,14=等待IAI压机原点返回完成
/// </summary>
public int WaitType { get; set; }
......@@ -129,6 +130,10 @@ namespace URSoldering.DeviceLibrary
/// 是否已经完成
/// </summary>
public bool IsEnd { get; set; }
/// <summary>
/// 机器人坐标
/// </summary>
public URPointValue UrPoint { get; set; }
}
public enum MoveType
{
......
......@@ -32,11 +32,15 @@ namespace URSoldering.DeviceLibrary
/// <summary>
/// 烙铁报警
/// </summary>
SolderingAlarm=40,
SolderingAlarm = 40,
/// <summary>
/// 送丝器报警
/// </summary>
SendWireAlarm=50,
SendWireAlarm = 50,
/// <summary>
/// 机械臂报警
/// </summary>
RobotError = 60,
}
}
......@@ -57,7 +57,7 @@ namespace URSoldering.DeviceLibrary
private static bool IsFree = false;
private static DateTime BeginFreeTime = DateTime.Now;
private static bool SolderSleep = false;
static WeldRobotBean()
{
mainTimer = new System.Timers.Timer();
......@@ -66,15 +66,16 @@ namespace URSoldering.DeviceLibrary
mainTimer.Elapsed += mainTimer_Elapsed;
mainTimer.Enabled = false;
LoadPoint(Clear1Point, Setting_Init.Soldering_Clear1Point);
LoadPoint(Clear2Point, Setting_Init.Soldering_Clear2Point);
LoadPoint(HomePoint, Setting_Init.Soldering_HomePoint);
LoadPoint(RobotMin, Setting_Init.Soldering_RobotMin);
LoadPoint(RobotMax, Setting_Init.Soldering_RobotMax);
Clear1Point = LoadPoint(Setting_Init.Soldering_Clear1Point);
Clear2Point = LoadPoint(Setting_Init.Soldering_Clear2Point);
HomePoint = LoadPoint(Setting_Init.Soldering_HomePoint);
RobotMin = LoadPoint(Setting_Init.Soldering_RobotMin);
RobotMax = LoadPoint(Setting_Init.Soldering_RobotMax);
}
private static void LoadPoint(URPointValue p, string configStr)
private static URPointValue LoadPoint( string configStr)
{
URPointValue p = new URPointValue();
string configP = ConfigAppSettings.GetValue(configStr);
if (String.IsNullOrEmpty(configP))
{
......@@ -84,6 +85,8 @@ namespace URSoldering.DeviceLibrary
{
p = URPointValue.ToObject(configP);
}
return p;
}
public static SolderingRobotConfig RobotConfig = null;
......@@ -171,19 +174,19 @@ namespace URSoldering.DeviceLibrary
LogUtil.info(RobotName + "开始启动:JBC送丝器没有连接上");
return "JBC送丝器没有连接上!";
}
if (URRobotControl.IsRun)
{
URPointValue lastPoint = URRobotControl.GetLastPosition();
TimeSpan span = lastPoint.UpdateTime - DateTime.Now; ;
if (span.TotalSeconds <= 60 && (lastPoint.Z != 0) && (lastPoint.X != 0))
{
string msg = CheckEpsonPoint(lastPoint);
if (!msg.Equals(""))
{
return msg;
}
}
}
//if (URRobotControl.IsRun)
//{
// URPointValue lastPoint = URRobotControl.GetLastPosition();
// TimeSpan span = lastPoint.UpdateTime - DateTime.Now; ;
// if (span.TotalSeconds <= 60 && (lastPoint.Z != 0) && (lastPoint.X != 0))
// {
// string msg = CheckEpsonPoint(lastPoint);
// if (!msg.Equals(""))
// {
// return msg;
// }
// }
//}
IsInSudden = false;
IsNoAir = false;
//开始运行
......@@ -216,8 +219,7 @@ namespace URSoldering.DeviceLibrary
//烙铁温度=0,烙铁上升,送丝上升,机器复位
SolderingUp(false);
SendWireWork(false);
//硕科 停止
SendWireManager.StopSend();
SolderingManager.Release();
}
......@@ -286,6 +288,7 @@ namespace URSoldering.DeviceLibrary
{
CheckSendWireAlarm();
}
CheckRobotAlarm();
}
catch (Exception ex)
{
......@@ -293,6 +296,30 @@ namespace URSoldering.DeviceLibrary
}
IsTimerProcess = false;
}
private static void CheckRobotAlarm()
{
if (alarmType.Equals(AlarmType.RobotError))
{
return;
}
if (URRobotControl.WarnMsg.Equals(""))
{
if (URRobotControl.IsRun.Equals(false))
{
WarnMsg = "机械臂连接断开";
LogUtil.error("检测到" + WarnMsg);
Alarm(AlarmType.RobotError);
}
}
else
{
WarnMsg = URRobotControl.WarnMsg;
LogUtil.error("检测到" + WarnMsg);
Alarm(AlarmType.RobotError);
}
}
//烙铁停止休眠
private static void StopSleep()
{
......@@ -342,24 +369,22 @@ namespace URSoldering.DeviceLibrary
}
}
/// <summary>
/// 卡丝恢复功能,只有手动点了才会继续
/// </summary>
/// <param name="isNext">是否继续下一个焊点,true=继续下一个,false=次焊点重新开始送丝</param>
/// <returns></returns>
public static bool SendWireRecover(bool isNext)
/// 卡丝恢复功能,只有手动点了才会继续,当前焊点会重新焊接
/// </summary>
public static bool SendWireRecover()
{
if (SendWireManager.IsAlarm())
{
LogUtil.info(RobotName + "卡丝恢复失败,仍在报警中!");
}
}
else
{
if (alarmType.Equals(AlarmType.SendWireAlarm) && IsInSudden.Equals(false) && IsNoAir.Equals(false))
{
if (WeldMoveStep.moveType.Equals(MoveType.Weld) && (isNext.Equals(false)))
{
if (WeldMoveStep.moveType.Equals(MoveType.Weld))
{
LogUtil.info(RobotName + "开始卡丝恢复,重新此焊点的焊接 !");
WeldMoveStep.NextMoveStep(MoveStep.Wait);
WeldMoveStep.NextMoveStep(MoveStep.Wait);
}
lastSendWireOkTime = DateTime.Now;
LogUtil.info(RobotName + "开始卡丝恢复!");
......@@ -468,7 +493,7 @@ namespace URSoldering.DeviceLibrary
if (alarmType.Equals(AlarmType.IoSingleTimeOut))
{
}
else if (alarmType.Equals(AlarmType.SuddenStop) || alarmType.Equals(AlarmType.NoAirCheck))
else if (alarmType.Equals(AlarmType.SuddenStop) || alarmType.Equals(AlarmType.NoAirCheck)||alarm.Equals(AlarmType.RobotError))
{
if (alarmType.Equals(AlarmType.SuddenStop))
{
......@@ -497,7 +522,7 @@ namespace URSoldering.DeviceLibrary
WeldMoveStep.NextMoveStep(MoveStep.Home_Reset);
SolderingUp(true);
SendWireWork(true);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitEpsonRun());
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitRobotRun());
return "";
}
public static void GoHomeProcess()
......@@ -577,19 +602,13 @@ namespace URSoldering.DeviceLibrary
}
private static void MoveToPoint(WeldPointInfo p, bool IsHigh)
{
//SendWireDown();
////判断需要抬起的高度
//double limZ = URRobotControl.Robot_LIM_Z;
//double ZValue = p.PositionZ;
//string gaoStr = IsHigh ? "高" : "低";
////WeldLog("移动到焊点【" + WeldMoveStep.CurrPoint.pointName + "】: X:" + p.PositionX + " Y: " + p.PositionY + " U:" + p.PositionU + " Z: " + ZValue + " ,limitZ: " + limZ);
//URRobotControl.MoveTo(p.PositionX, p.PositionY, ZValue, p.PositionU, isHighSpeed, p.HandDirection, limZ,AfterMove);
//WeldMoveStep.WaitList.Add(WaitResultInfo.WaitEpson());
}
SendWireWork(true);
SolderingDown(true);
URPointValue point = new URPointValue(p.RobotX, p.RoobtY, p.RobotZ, p.RobotRX, p.RobotRY, p.RobotRZ);
WeldLog("移动到焊点【" + WeldMoveStep.CurrPoint.pointName + "】:" + point.ToShowStr());
URRobotControl.MoveTo(point, isHighSpeed);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitRobotPoint(point));
}
private static void MoveToOrg()
{
SolderingUp(true);
......@@ -597,8 +616,8 @@ namespace URSoldering.DeviceLibrary
if (HomePoint.X != 0 && HomePoint.Y != 0 && HomePoint.Z != 0 )
{
WeldLog("送丝上升,机械臂走到待机点 ");
URRobotControl.MoveTo(HomePoint);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitEpson());
URRobotControl.MoveTo(HomePoint,isHighSpeed);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitRobotPoint(HomePoint));
}
}
private static void SendWireUpToClear1()
......@@ -610,32 +629,18 @@ namespace URSoldering.DeviceLibrary
if (Clear1Point.X != 0 && Clear1Point.Y != 0 && Clear1Point.Z != 0)
{
WeldLog("送丝上升,打开清洗装置,机械臂走到清洗点1 ");
URRobotControl.MoveTo(Clear1Point);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitEpson());
URRobotControl.MoveTo(Clear1Point, isHighSpeed);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitRobotPoint(Clear1Point));
}
}
private static void MoveToClear2(int mSenconds)
{
{
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitTime(mSenconds));
if (Clear2Point.X != 0 && Clear2Point.Y != 0 && Clear2Point.Z != 0)
{
//double limZ = URRobotControl.Robot_LIM_Z;
//double preZValue = URRobotControl.LastSendPoint.Z;
//if (URRobotControl.LastSendPoint.UpdateTime < URRobotControl.GetLastPosition().UpdateTime)
//{
// preZValue = URRobotControl.GetLastPosition().Z;
//}
//if (preZValue < EpsonClearZ2)
//{
// preZValue = EpsonClearZ2;
//}
//limZ = preZValue + 1;
WeldLog("机械臂走到清洗点2 ,打开清洗装置,清洗时间:"+mSenconds+" ");
//WeldLog("机械臂走到清洗点2 : X:" + EpsonClearX2 + " Y: " + EpsonClearY2 + " U:" + EpsonClearU2 + " Z: " + EpsonClearZ2 + " ");
URRobotControl.MoveTo(Clear2Point);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitEpson());
WeldLog("机械臂走到清洗点2 ,打开清洗装置,清洗时间:" + mSenconds + " ");
URRobotControl.MoveTo(Clear2Point, isHighSpeed);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitRobotPoint(Clear1Point));
}
}
//更新原点
......
......@@ -199,16 +199,12 @@ namespace URSoldering.DeviceLibrary
{
SetPreTemp(true, false);
}
LogUtil.info(" 新焊点【" + WeldMoveStep.CurrPoint.pointName + "】预热" + WeldMoveStep.CurrPoint.preheatTemperature+"度,送丝下降,移动机械臂");
LogUtil.info(" 新焊点【" + WeldMoveStep.CurrPoint.pointName + "】预热" + WeldMoveStep.CurrPoint.preheatTemperature + "度,送丝下降,移动机械臂");
MoveToPoint(WeldMoveStep.CurrPoint, false);
WorkCountManager.AddWeldPint();
//第一个点并且送丝下降到位时,可以预送丝
//if (WeldMoveStep.IsFirstPoint().Equals(false) && RobotBean.KNDIOValue(IO_Type.SendWire_Down).Equals(IO_VALUE.HIGH))
if (WeldMoveStep.IsFirstPoint().Equals(false) )
{
WeldMoveStep.IsSlowSendWire = true;
SlowSendWire();
}
WorkCountManager.AddWeldPint();
WeldMoveStep.IsSlowSendWire = true;
SlowSendWire();
}
private static void PointEndPross()
{
......@@ -426,17 +422,17 @@ namespace URSoldering.DeviceLibrary
}
else if (wait.WaitType == 3)
{
//if (URRobotControl.MoveOKTime() < WeldMoveStep.LastSetpTime)
//{
// NotOkMsg = "机械臂移动到位";
// isOk = false;
// break;
//}
//else if (WeldMoveStep.OneWaitOk)
//{
// isOk = true;
// break;
//}
if (URRobotControl.MoveOK(wait.UrPoint, WeldMoveStep.LastSetpTime))
{
NotOkMsg = "机械臂移动到位";
isOk = false;
break;
}
else if (WeldMoveStep.OneWaitOk)
{
isOk = true;
break;
}
}
else if (wait.WaitType == 4)
{
......
......@@ -29,7 +29,7 @@ namespace URSoldering.DeviceLibrary
public BoardInfo currBoard;
public List<WeldPointInfo> weldPointList = new List<WeldPointInfo>();
public int CurrPointIndex = 0;
/// <summary>
/// 当前焊点信息
/// </summary>
......
......@@ -131,8 +131,7 @@ namespace URSoldering.DeviceLibrary
}
public static bool ShuddenOK()
{
return true;
{
if (!baseConfig.RobotDIList.ContainsKey(IO_Type.SuddenStop_Single))
{
return false;
......
......@@ -74,7 +74,7 @@ namespace URSoldering.DeviceLibrary
{
if (IsRun)
{
return "正常连接中";
return "机器人正常连接中";
}
else
{
......@@ -83,17 +83,17 @@ namespace URSoldering.DeviceLibrary
TimeSpan span = DateTime.Now - PreStartTime;
if (span.TotalMilliseconds > StartTimeOutSeconds)
{
return "启动超时";
return "机器人启动超时";
}
else
{
return "启动中";
return "机器人启动中";
}
}
else
{
return "未连接";
return "机器人未连接";
}
}
}
......@@ -156,6 +156,7 @@ namespace URSoldering.DeviceLibrary
}
}
WarnMsg = "";
IsRun = false;
PreStartTime = DateTime.Now;
startCount++;
......@@ -201,10 +202,10 @@ namespace URSoldering.DeviceLibrary
if (span.TotalSeconds > 30)
{
preCheckTime = DateTime.Now;
//判断500在连接上,则获取状态
//判断500在连接上,则获取急停状态
if (controlTcp.IsConnected())
{
controlTcp.sendLine(CMD_robotMode);
controlTcp.sendLine(CMD_Safetymode);
}
else
{
......@@ -269,7 +270,10 @@ namespace URSoldering.DeviceLibrary
{
//Connected: Universal Robots Dashboard Server
message = message.Replace("\n", "");
LogUtil.URSInfo(LogName + "收到数据:" + message);
if (IsRun.Equals(false))
{
LogUtil.URSInfo(LogName + "收到数据:" + message);
}
if (message.ToLower().IndexOf(REV_PowerOn) >= 0)
{
SendCMD(CMD_brakeRelease, 1000);
......@@ -299,50 +303,96 @@ namespace URSoldering.DeviceLibrary
private static void StatusProcess(string message)
{
string msg = message.ToLower().Replace(REV_RobotMode + ": ", "").ToUpper().Trim();
if (msg.Equals(URStatus.POWER_ON))
if (!IsRun)
{
SendCMD(CMD_brakeRelease, 1000);
}
else if (msg.Equals(URStatus.RUNNING) || msg.Equals(URStatus.IDLE))
{
WarnMsg = "";
if (IsRun.Equals(false))
if (msg.Equals(URStatus.POWER_ON))
{
SendCMD(CMD_brakeRelease, 1000);
}
else if (msg.Equals(URStatus.RUNNING) || msg.Equals(URStatus.IDLE))
{
WarnMsg = "";
LogUtil.URSInfo(LogName + " 当前状态:" + msg + ",机器人连接成功!");
LogUtil.info(LogName + " 当前状态:" + msg + ",机器人连接成功!");
IsRun = true;
reconnectTimer.Enabled = true;
}
else
{
if (!IsTimeOut(message))
{
LogUtil.URSInfo(LogName + "当前状态:" + msg + ",发送打开命令" + CMD_powerOn);
SendCMD(CMD_powerOn, 1000);
}
else
{
WarnMsg = "机器人状态[" + msg + "],启动超时";
StopRobot();
IsRun = false;
}
}
}
else
{
if (!IsTimeOut(message))
if (msg.Equals(URStatus.POWER_ON))
{
SendCMD(CMD_brakeRelease, 1000);
}
else if (msg.Equals(URStatus.RUNNING) || msg.Equals(URStatus.IDLE))
{
LogUtil.URSInfo(LogName + "当前状态:" + msg + ",发送打开命令" + CMD_powerOn);
SendCMD(CMD_powerOn, 1000);
}
else
{
WarnMsg = "机器人状态[" + msg + "],尝试自动复位";
LogUtil.info(LogName + WarnMsg);
IsRun = false;
IsStartConnect = true;
PreStartTime = DateTime.Now;
SendCMD(CMD_powerOn, 500);
}
}
}
private static void SafetymodeProcess(string message)
{
string msg = message.ToLower().Replace(REV_SafetyMode + ": ", "").ToUpper().Trim();
if (msg.Equals(URStatus.SFETY_POWER_OFF) || msg.Equals(URStatus.ROBOT_EMERGENCY_STOP))
if (!IsRun)
{
if (!IsTimeOut(message))
if (msg.Equals(URStatus.SFETY_POWER_OFF) || msg.Equals(URStatus.ROBOT_EMERGENCY_STOP))
{
WarnMsg = "机器人急停中[" + msg + "],请先打开急停";
SendCMD(CMD_Safetymode, 1000);
if (!IsTimeOut(message))
{
WarnMsg = "机器人急停中[" + msg + "],请先打开急停";
SendCMD(CMD_Safetymode, 1000);
}
else
{
WarnMsg = "机器人急停中[" + msg + "],启动超时";
StopRobot();
IsRun = false;
}
}
else
{
WarnMsg = "机器人急停中[" + msg + "],启动超时";
IsRun = false;
SendCMD(CMD_robotMode, 500);
}
}
else
}else
{
SendCMD(CMD_robotMode, 500);
if (msg.Equals(URStatus.SFETY_POWER_OFF))
{
WarnMsg = "机器人急停中[" + msg + "],请复位";
LogUtil.info(LogName + WarnMsg);
StopRobot();
} else if (msg.Equals(URStatus.ROBOT_EMERGENCY_STOP)){
WarnMsg = "机器人急停中[" + msg + "],请复位";
LogUtil.info(LogName + WarnMsg);
StopRobot();
}
else
{
SendCMD(CMD_robotMode, 500);
}
}
}
private static bool IsTimeOut(string status)
......@@ -379,7 +429,7 @@ namespace URSoldering.DeviceLibrary
public static void StopRobot()
{
try
{
{
IsStartConnect = false;
reconnectTimer.Enabled = false;
stopTcp();
......@@ -402,22 +452,63 @@ namespace URSoldering.DeviceLibrary
public static void LockAxis()
{
}
/// <summary>
/// 移动到指定的坐标
/// </summary>
/// <param name="point"></param>
public static bool MoveTo(URPointValue point)
public static void MoveTo(URPointValue point, bool isHigh)
{
//movep(p[0.062, -0.030, 0.325, 0.0299, 2.2263, 2.2171], a = 1.2, v = 0.25, r = 0)
LogUtil.info(LogName + "试图移动到:"+point.ToShowStr());
//movej([0, 1.57, -1.57, 3.14, -1.57, 1.57],a = 1.4, v = 1.05, t = 0, r = 0)
string x = Math.Round(point.X / 1000F, 5).ToString();
string y= Math.Round(point.Y / 1000F, 5).ToString();
string y = Math.Round(point.Y / 1000F, 5).ToString();
string z = Math.Round(point.Z / 1000F, 5).ToString();
string moveCmd = "movep(p[" +x+ spiltStr +y+ spiltStr + z+ spiltStr + point.RX + spiltStr + point.RY + spiltStr + point.RZ + "],a=0.1, v=0.1, r=0)";
URRobotClient.LastMoveCMD = moveCmd;
return true;
string moveCmd = "movep(p[" + x + spiltStr + y + spiltStr + z + spiltStr + point.RX + spiltStr + point.RY + spiltStr + point.RZ + "],a=0.1, v=0.1, r=0)";
if (isHigh)
{
moveCmd = "movep(p[" + x + spiltStr + y + spiltStr + z + spiltStr + point.RX + spiltStr + point.RY + spiltStr + point.RZ + "],a=1.0, v=1.0, r=0)";
}
if (!URRobotClient.LastMoveCMD.Equals(""))
{
LogUtil.info(LogName + "试图移动到" + point.ToShowStr() + ",清除上次未发送指令:【" + URRobotClient.LastMoveCMD + "】");
URRobotClient.LastMoveCMD = "";
}
else
{
LogUtil.info(LogName + "试图移动到:" + point.ToShowStr());
}
URRobotClient.LastMoveCMD = moveCmd;
}
public static void MoveTo(URPointValue point)
{
MoveTo(point, false);
}
public static bool MoveOK(URPointValue point,DateTime moveTime)
{
URPointValue lastPoint = GetLastPosition();
if (lastPoint.UpdateTime > moveTime)
{
if (IsSamePoint(point, lastPoint))
{
return true;
}
}return false;
}
private static bool IsSamePoint(URPointValue p1,URPointValue p2)
{
if (p1 == null && p2 == null)
{
return false;
}
double xCha = Math.Abs(p1.X - p2.X);
double yCha = Math.Abs(p1.Y - p2.Y);
double zCha = Math.Abs(p1.Z - p2.Z);
double rxCha = Math.Abs(p1.RX - p2.RX);
double ryCha = Math.Abs(p1.RY - p2.RY);
double rzCha = Math.Abs(p1.RZ - p2.RZ);
if (xCha < 1 && yCha < 1 && zCha < 1 && rxCha < 0.001 && ryCha < 0.001 && rzCha < 0.001)
{
return true;
}
return false;
}
/// <summary>
/// 获取机器人最后一次获取的坐标
......
......@@ -101,82 +101,5 @@ namespace URSoldering.LoadCSVLibrary
#region 焊接IO
///// <summary>
///// DI DO 焊接阻挡下降端 StopCylinder_Down 焊接阻挡下降端 X03 DI-03
///// </summary>
//public static string StopCylinder_Down = "StopCylinder_Down";
///// <summary>
///// DI DO 焊接阻挡上升端 StopCylinder_Up 焊接阻挡上升端 X04 DI-04
///// </summary>
//public static string StopCylinder_Up = "StopCylinder_Up";
///// <summary>
///// DI DO 送丝气缸下降端 SendWire_Down 送丝气缸下降端 X05 DI-05
///// </summary>
//public static string SendWire_Down = "SendWire_Down";
///// <summary>
///// DI DO 送丝气缸上升端 SendWire_Up 送丝气缸上升端 X06 DI-06
///// </summary>
//public static string SendWire_Up = "SendWire_Up";
///// <summary>
///// DI 焊丝堵 SendWireNoWire 焊丝堵 X07 DI-07
///// </summary>
//public static string SendWireNoWire = "SendWireNoWire";
///// <summary>
///// DI 焊丝缺 SendWireLock 焊丝缺 X08 DI-08
///// </summary>
//public static string SendWireLock = "SendWireLock";
///// <summary>
///// DI 流水线入口检测 LineInCheck 流水线入口检测 X09 DI-09
///// </summary>
//public static string LineInCheck = "LineInCheck";
///// <summary>
///// DI 流水线焊接检测 LineWeldCheck 流水线焊接检测 X10 DI-10
///// </summary>
//public static string LineWeldCheck = "LineWeldCheck";
///// <summary>
///// DI 流水线出口检测 LineOutCheck 流水线出口检测 X11 DI-11
///// </summary>
//public static string LineOutCheck = "LineOutCheck";
///// <summary>
///// DI EpsonReady X14 DI-14
///// </summary>
//public static string EpsonReady = "EpsonReady";
///// <summary>
///// DI EpsonRunning X15 DI-15
///// </summary>
//public static string EpsonRunning = "EpsonRunning";
///// <summary>
///// DI EpsonAlarm X16 DI-16
///// </summary>
//public static string EpsonAlarm = "EpsonAlarm";
///// <summary>
///// DO 洗焊吹气启动SOL ClearWeldingSQL 洗焊吹气启动SOL Y05 DO-05
///// </summary>
//public static string ClearWeldingSQL = "ClearWeldingSQL";
///// <summary>
///// DO 流水线启动 LineStart 流水线启动 Y06 DO-06
///// </summary>
//public static string LineStart = "LineStart";
///// <summary>
///// DO EpsonStart Y09 DO-09
///// </summary>
//public static string EpsonStart = "EpsonStart";
///// <summary>
///// DO EpsonStop Y10 DO-10
///// </summary>
//public static string EpsonStop = "EpsonStop";
///// <summary>
///// DO EpsonReset Y11 DO-11
///// </summary>
//public static string EpsonReset = "EpsonReset";
#endregion
}
}
\ No newline at end of file
......@@ -31,8 +31,8 @@
<add key="Board_ConfigPath" value="\RobotConfig\config\boardData.txt" />
<add key="Program_ConfigPath" value="\RobotConfig\config\sprogram.txt" />
<add key="Default_BoardID" value="56" />
<add key="Board_Origin_X" value="-67.29" />
<add key="Board_Origin_Y" value="-436.62" />
<add key="Board_Origin_X" value="-105.1" />
<add key="Board_Origin_Y" value="-386.33" />
<!--机器人抬起高点设置-->
<add key="Soldering_LIM_Z" value="500" />
<!--程序图片路径-->
......@@ -47,16 +47,15 @@
<add key="ReverseSendWireTime" value="3" />
<add key="ISDebug" value="1" />
<!--机器人是否高速运行-->
<add key="Robot_IsHigh" value="1" />
<add key="Soldering_Clear1Point" value="{&quot;UpdateTime&quot;:&quot;2018-07-28T14:42:04.5888384+08:00&quot;,&quot;X&quot;:-67.28,&quot;Y&quot;:-436.62,&quot;Z&quot;:293.7,&quot;RX&quot;:2.7394,&quot;RY&quot;:0.0599,&quot;RZ&quot;:0.0708}" />
<add key="Soldering_Clear2Point" value="{&quot;UpdateTime&quot;:&quot;2018-07-28T14:42:06.1809687+08:00&quot;,&quot;X&quot;:-67.29,&quot;Y&quot;:-436.62,&quot;Z&quot;:293.68,&quot;RX&quot;:2.7394,&quot;RY&quot;:0.06,&quot;RZ&quot;:0.0708}" />
<add key="Soldering_HomePoint" value="{&quot;UpdateTime&quot;:&quot;2018-07-28T14:42:02.1180802+08:00&quot;,&quot;X&quot;:-67.29,&quot;Y&quot;:-436.62,&quot;Z&quot;:293.66,&quot;RX&quot;:2.7395,&quot;RY&quot;:0.0599,&quot;RZ&quot;:0.0707}" />
<add key="Robot_IsHigh" value="0" />
<add key="Soldering_Clear1Point" value="{&quot;UpdateTime&quot;:&quot;2018-07-31T11:08:06.3302415+08:00&quot;,&quot;X&quot;:-116.02,&quot;Y&quot;:-386.34,&quot;Z&quot;:337.33,&quot;RX&quot;:1.2962,&quot;RY&quot;:-2.423,&quot;RZ&quot;:0.2115}" />
<add key="Soldering_Clear2Point" value="{&quot;UpdateTime&quot;:&quot;2018-07-31T11:08:15.289551+08:00&quot;,&quot;X&quot;:-105.12,&quot;Y&quot;:-386.31,&quot;Z&quot;:337.37,&quot;RX&quot;:1.2963,&quot;RY&quot;:-2.423,&quot;RZ&quot;:0.2119}" />
<add key="Soldering_HomePoint" value="{&quot;UpdateTime&quot;:&quot;2018-07-31T11:07:51.9477967+08:00&quot;,&quot;X&quot;:-116.01,&quot;Y&quot;:-386.34,&quot;Z&quot;:367.11,&quot;RX&quot;:1.2962,&quot;RY&quot;:-2.4233,&quot;RZ&quot;:0.2117}" />
<add key="Soldering_RobotMin" value="{&quot;UpdateTime&quot;:&quot;2018-07-28T14:37:09.4700739+08:00&quot;,&quot;X&quot;:0.0,&quot;Y&quot;:0.0,&quot;Z&quot;:0.0,&quot;RX&quot;:0.0,&quot;RY&quot;:0.0,&quot;RZ&quot;:0.0}" />
<add key="Soldering_RobotMax" value="{&quot;UpdateTime&quot;:&quot;2018-07-28T14:37:09.4700739+08:00&quot;,&quot;X&quot;:0.0,&quot;Y&quot;:0.0,&quot;Z&quot;:0.0,&quot;RX&quot;:0.0,&quot;RY&quot;:0.0,&quot;RZ&quot;:0.0}" />
<add key="Config_Pwd" value="123456" />
</appSettings>
<log4net>
<appender name="defaultAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/URSolderingClient.log" />
<appendToFile value="true" />
......@@ -96,7 +95,6 @@
<level value="Info" />
<appender-ref ref="defaultAppender" />
</logger>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
......
......@@ -101,11 +101,7 @@ namespace URSoldering.Client
timer1.Elapsed += timer_Elapsed;
timer1.Start();
//timer2.Start();
if (RobotBean.ShuddenOK().Equals(false))
{
// MessageBox.Show("急停未开!");
}
else
if (RobotBean.ShuddenOK() )
{
//this.btnWDown.Enabled = true;
this.btnWUp.Enabled = true;
......@@ -113,7 +109,7 @@ namespace URSoldering.Client
if (!SendWireManager.IsRun)
{
//SendWireManager.Init(WeldRobotBean.RobotConfig.JBC_SendWire_Port);
SendWireManager.Init(WeldRobotBean.RobotConfig.JBC_SendWire_Port);
}
if (SendWireManager.IsRun) {
......@@ -432,20 +428,11 @@ namespace URSoldering.Client
double ry = FormUtil.getDoubleValue(lblRobotRY);
double rz = FormUtil.getDoubleValue(lblRobotRZ);
return new URPointValue(x, y, z, rx, ry, rz);
}
/// <summary>
/// 移动测试
/// </summary>
private bool isfast = false;
}
private void MoveTest(int rowIndex)
{
//if (isAuto == false)
//{
// MessageBox.Show("请先切换到自动模式!");
// return;
//}
RovotMove(GetRowPoint(rowIndex));
URRobotControl.MoveTo(GetRowPoint(rowIndex));
}
private void UpdateRow(int rowIndex)
......@@ -1023,17 +1010,13 @@ namespace URSoldering.Client
}
private void btnGoHome_Click(object sender, EventArgs e)
{
if (!SureMoveRobot())
{
return;
}
{
WeldRobotBean.SendWireWork(false);
WeldRobotBean.SolderingUp(false);
URPointValue point = WeldRobotBean.HomePoint;
if (point.X != 0 && point.Y != 0 && point.Z!=0)
{
URRobotControl.MoveTo(point);
RovotMove(point);
}
else
{
......@@ -1091,26 +1074,26 @@ namespace URSoldering.Client
}
private void 保存焊点ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (m_MouseDownPoint == null || m_MouseDownPoint.X == 0 || m_MouseDownPoint.Y == 0)
{
MessageBox.Show("请点击要保存的焊点");
return;
}
double x = 0;
double y = 0;
GetPicPoint(out x, out y);
LogUtil.info("新增焊点:X【" + m_MouseDownPoint.X + "】Y【" + m_MouseDownPoint.Y + "】,坐标X【" + x + "】坐标Y【" + y + "】");
double z = FormUtil.getDoubleValue(txtRobotZ);
URPointValue point = new URPointValue(x, y, z, FormUtil.getDoubleValue(lblRobotRX), FormUtil.getDoubleValue(lblRobotRY), FormUtil.getDoubleValue(lblRobotRZ));
//判断原点的Z轴
if (z > URRobotControl.Robot_LIM_Z)
{
MessageBox.Show("保存失败,焊点Z坐标("+z+")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
return;
}
AddNewPoint(point);
//if (m_MouseDownPoint == null || m_MouseDownPoint.X == 0 || m_MouseDownPoint.Y == 0)
//{
// MessageBox.Show("请点击要保存的焊点");
// return;
//}
//double x = 0;
//double y = 0;
//GetPicPoint(out x, out y);
//LogUtil.info("新增焊点:X【" + m_MouseDownPoint.X + "】Y【" + m_MouseDownPoint.Y + "】,坐标X【" + x + "】坐标Y【" + y + "】");
//double z = FormUtil.getDoubleValue(txtRobotZ);
//URPointValue point = new URPointValue(x, y, z, FormUtil.getDoubleValue(lblRobotRX), FormUtil.getDoubleValue(lblRobotRY), FormUtil.getDoubleValue(lblRobotRZ));
////判断原点的Z轴
//if (z > URRobotControl.Robot_LIM_Z)
//{
// MessageBox.Show("保存失败,焊点Z坐标("+z+")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
// return;
//}
//AddNewPoint(point);
liUpdateTime_LinkClicked(null, null);
//liUpdateTime_LinkClicked(null, null);
}
......@@ -1186,10 +1169,7 @@ namespace URSoldering.Client
grfx.Dispose();
}
}
private void 移动到此处ToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void RovotMove(URPointValue point)
{
......@@ -1519,12 +1499,7 @@ namespace URSoldering.Client
MoveTest(dgvList.SelectedRows[0].Index);
}
}
private void tckSpeed_Scroll(object sender, EventArgs e)
{
}
private void chbIsSafe_CheckedChanged(object sender, EventArgs e)
{
if (chbIsSafe.Checked)
......
......@@ -35,10 +35,7 @@ namespace URSoldering.Client
this.btnProduct = new System.Windows.Forms.Button();
this.btnWelding = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.btnAutoEdit = new System.Windows.Forms.Button();
this.btnTongji = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btnCom = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
......@@ -67,7 +64,7 @@ namespace URSoldering.Client
this.btnDebug.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDebug.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDebug.ForeColor = System.Drawing.Color.White;
this.btnDebug.Location = new System.Drawing.Point(497, 301);
this.btnDebug.Location = new System.Drawing.Point(384, 208);
this.btnDebug.Name = "btnDebug";
this.btnDebug.Size = new System.Drawing.Size(107, 81);
this.btnDebug.TabIndex = 2;
......@@ -113,50 +110,16 @@ namespace URSoldering.Client
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel1.BackgroundImage")));
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.panel1.Controls.Add(this.btnAutoEdit);
this.panel1.Controls.Add(this.btnTongji);
this.panel1.Controls.Add(this.btnExit);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.btnDebug);
this.panel1.Controls.Add(this.btnProduct);
this.panel1.Controls.Add(this.btnWelding);
this.panel1.Controls.Add(this.btnCom);
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(861, 453);
this.panel1.TabIndex = 15;
//
// btnAutoEdit
//
this.btnAutoEdit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(186)))), ((int)(((byte)(118)))), ((int)(((byte)(159)))));
this.btnAutoEdit.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnAutoEdit.BackgroundImage")));
this.btnAutoEdit.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnAutoEdit.FlatAppearance.BorderSize = 0;
this.btnAutoEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAutoEdit.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAutoEdit.ForeColor = System.Drawing.Color.White;
this.btnAutoEdit.Location = new System.Drawing.Point(384, 211);
this.btnAutoEdit.Name = "btnAutoEdit";
this.btnAutoEdit.Size = new System.Drawing.Size(222, 81);
this.btnAutoEdit.TabIndex = 14;
this.btnAutoEdit.UseVisualStyleBackColor = false;
//
// btnTongji
//
this.btnTongji.BackColor = System.Drawing.Color.Transparent;
this.btnTongji.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnTongji.BackgroundImage")));
this.btnTongji.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.btnTongji.FlatAppearance.BorderSize = 0;
this.btnTongji.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTongji.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTongji.ForeColor = System.Drawing.Color.White;
this.btnTongji.Location = new System.Drawing.Point(416, 16);
this.btnTongji.Name = "btnTongji";
this.btnTongji.Size = new System.Drawing.Size(222, 81);
this.btnTongji.TabIndex = 13;
this.btnTongji.UseVisualStyleBackColor = false;
this.btnTongji.Visible = false;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Transparent;
......@@ -173,21 +136,6 @@ namespace URSoldering.Client
this.button1.TabIndex = 13;
this.button1.UseVisualStyleBackColor = true;
//
// btnCom
//
this.btnCom.BackColor = System.Drawing.Color.Transparent;
this.btnCom.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnCom.BackgroundImage")));
this.btnCom.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.btnCom.FlatAppearance.BorderSize = 0;
this.btnCom.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCom.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCom.ForeColor = System.Drawing.Color.White;
this.btnCom.Location = new System.Drawing.Point(384, 301);
this.btnCom.Name = "btnCom";
this.btnCom.Size = new System.Drawing.Size(107, 81);
this.btnCom.TabIndex = 5;
this.btnCom.UseVisualStyleBackColor = false;
//
// FrmMenu
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......@@ -212,9 +160,6 @@ namespace URSoldering.Client
private System.Windows.Forms.Button btnDebug;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnTongji;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btnCom;
private System.Windows.Forms.Button btnAutoEdit;
}
}
\ No newline at end of file
此文件的差异太大,无法显示。
......@@ -100,19 +100,7 @@ namespace URSoldering.Client
URPointValue point = GetCurrRobotPoint();
ConfigAppSettings.SaveValue(Setting_Init.BOARD_ORIGIN_X, point.X.ToString());
ConfigAppSettings.SaveValue(Setting_Init.BOARD_ORIGIN_Y, point.Y.ToString());
}
private void btnGoHome_Click(object sender, EventArgs e)
{
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
URPointValue point = WeldRobotBean.HomePoint;
URRobotControl.MoveTo(point);
}
}
private void btnSaveHome_Click(object sender, EventArgs e)
{
URPointValue point = GetCurrRobotPoint();
......
......@@ -636,23 +636,23 @@ namespace URSoldering.Client
private void btnSendWireRecover_Click(object sender, EventArgs e)
{
bool isNext = true;
if (WeldRobotBean.IsNeedMsg())
{
DialogResult result = MessageBox.Show("消除卡丝报警后是否继续焊接?\r\n选择是:继续焊接\r\n选择否:当前焊点重新焊接", "提示",
MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result.Equals(DialogResult.Yes))
{
isNext = true;
}
else
{
isNext = false;
}
}
//bool isNext = true;
//if (WeldRobotBean.IsNeedMsg())
//{
// DialogResult result = MessageBox.Show("消除卡丝报警后是否继续焊接?\r\n选择是:继续焊接\r\n选择否:当前焊点重新焊接", "提示",
// MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
// if (result.Equals(DialogResult.Yes))
// {
// isNext = true;
// }
// else
// {
// isNext = false;
// }
//}
//显示提示框,是跳过当前焊点还是从新开始送丝
WeldRobotBean.SendWireRecover(isNext);
WeldRobotBean.SendWireRecover( );
}
private void btnClear_Click(object sender, EventArgs e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!