Commit fa888d67 几米阳光

代码修改

1 个父辈 c00f7091
...@@ -477,14 +477,14 @@ namespace URSoldering.Common ...@@ -477,14 +477,14 @@ namespace URSoldering.Common
/// </summary> /// </summary>
/// <param name="bytes"></param> /// <param name="bytes"></param>
/// <returns></returns> /// <returns></returns>
public static string byteToHexStr(byte[] bytes) public static string byteToHexStr(byte[] bytes,string spilt)
{ {
string returnStr = ""; string returnStr = "";
if (bytes != null) if (bytes != null)
{ {
for (int i = 0; i < bytes.Length; i++) for (int i = 0; i < bytes.Length; i++)
{ {
returnStr += bytes[i].ToString("X2"); returnStr += bytes[i].ToString("X2")+spilt;
} }
} }
return returnStr; return returnStr;
......
...@@ -29,7 +29,6 @@ namespace URSoldering.DeviceLibrary ...@@ -29,7 +29,6 @@ namespace URSoldering.DeviceLibrary
public bool RobotReset() public bool RobotReset()
{ {
alarmType = AlarmType.None; alarmType = AlarmType.None;
mainTimer.Enabled = false; mainTimer.Enabled = false;
ledTimer.Enabled = false; ledTimer.Enabled = false;
...@@ -70,7 +69,6 @@ namespace URSoldering.DeviceLibrary ...@@ -70,7 +69,6 @@ namespace URSoldering.DeviceLibrary
KNDIOMove(IO_Type.WaitSingle, IO_VALUE.LOW); KNDIOMove(IO_Type.WaitSingle, IO_VALUE.LOW);
KNDIOMove(IO_Type.DeviceRunON, IO_VALUE.LOW); KNDIOMove(IO_Type.DeviceRunON, IO_VALUE.LOW);
IsInProcess = false; IsInProcess = false;
ledTimer.Enabled = true; ledTimer.Enabled = true;
mainTimer.Enabled = true; mainTimer.Enabled = true;
...@@ -86,7 +84,6 @@ namespace URSoldering.DeviceLibrary ...@@ -86,7 +84,6 @@ namespace URSoldering.DeviceLibrary
LogUtil.error(RobotName + WarnMsg); LogUtil.error(RobotName + WarnMsg);
IsInSuddendown = true; IsInSuddendown = true;
Alarm(AlarmType.SuddenStop); Alarm(AlarmType.SuddenStop);
} }
private bool IsInProcess = false; private bool IsInProcess = false;
protected override void mainTimer_Elapsed(object sender, ElapsedEventArgs e) protected override void mainTimer_Elapsed(object sender, ElapsedEventArgs e)
...@@ -136,7 +133,6 @@ namespace URSoldering.DeviceLibrary ...@@ -136,7 +133,6 @@ namespace URSoldering.DeviceLibrary
} }
else if (Status.Equals(RobotStatus.LineMove)) else if (Status.Equals(RobotStatus.LineMove))
{ {
} }
} }
}catch(Exception ex) }catch(Exception ex)
...@@ -178,7 +174,6 @@ namespace URSoldering.DeviceLibrary ...@@ -178,7 +174,6 @@ namespace URSoldering.DeviceLibrary
} }
} }
private void StopMove() private void StopMove()
{ {
KNDIOMove(IO_Type.DeviceRunON, IO_VALUE.LOW); KNDIOMove(IO_Type.DeviceRunON, IO_VALUE.LOW);
......
...@@ -73,9 +73,6 @@ namespace URSoldering.DeviceLibrary ...@@ -73,9 +73,6 @@ namespace URSoldering.DeviceLibrary
IsInWait = false; IsInWait = false;
WaitList = new List<WaitResultInfo>(); WaitList = new List<WaitResultInfo>();
} }
public List<WaitResultInfo> WaitList = new List<WaitResultInfo>(); public List<WaitResultInfo> WaitList = new List<WaitResultInfo>();
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -46,12 +46,12 @@ namespace URSoldering.DeviceLibrary ...@@ -46,12 +46,12 @@ namespace URSoldering.DeviceLibrary
wait.IsEnd = false; wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitShuoKe(int slvAddr, bool isR) public static WaitResultInfo WaitSendWire(int MScends,bool isR)
{ {
WaitResultInfo wait = new WaitResultInfo(); WaitResultInfo wait = new WaitResultInfo();
wait.ShuoKeISReverse = isR; wait.ShuoKeISReverse = isR;
wait.WaitType = 5; wait.WaitType = 5;
wait.SlvAddr = (byte)slvAddr; wait.TimeMSeconds = MScends;
wait.IsEnd = false; wait.IsEnd = false;
return wait; return wait;
} }
...@@ -91,7 +91,7 @@ namespace URSoldering.DeviceLibrary ...@@ -91,7 +91,7 @@ namespace URSoldering.DeviceLibrary
} }
} }
/// <summary> /// <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压机原点返回完成 /// 11=等待IAI压机伺服ON,12=等待IAI伺服到待机点,13=等待IAI伺服程序运行OK,14=等待IAI压机原点返回完成
/// </summary> /// </summary>
public int WaitType { get; set; } public int WaitType { get; set; }
...@@ -237,7 +237,6 @@ namespace URSoldering.DeviceLibrary ...@@ -237,7 +237,6 @@ namespace URSoldering.DeviceLibrary
Home_5_ToOrg = 105, Home_5_ToOrg = 105,
/// <summary> /// <summary>
/// 阻挡气缸上升 /// 阻挡气缸上升
/// </summary> /// </summary>
...@@ -285,7 +284,6 @@ namespace URSoldering.DeviceLibrary ...@@ -285,7 +284,6 @@ namespace URSoldering.DeviceLibrary
///焊接结束处理: 流水线倒转,等待流水线入料口信号 ///焊接结束处理: 流水线倒转,等待流水线入料口信号
/// </summary> /// </summary>
BUSY06_WaitInSingle = 1106, BUSY06_WaitInSingle = 1106,
} }
/// <summary> /// <summary>
/// 焊接点的时间记录 /// 焊接点的时间记录
......
...@@ -105,7 +105,6 @@ namespace URSoldering.DeviceLibrary ...@@ -105,7 +105,6 @@ namespace URSoldering.DeviceLibrary
WarnMsg = "连接UR机器人失败"; WarnMsg = "连接UR机器人失败";
} }
}); });
//SendWireManager.Init();
SolderingManager.Init(RobotConfig.JBC_Soldering_Port, RobotConfig.JBC_Soldering_Num); SolderingManager.Init(RobotConfig.JBC_Soldering_Port, RobotConfig.JBC_Soldering_Num);
SendWireManager.Init(RobotConfig.JBC_SendWire_Port); SendWireManager.Init(RobotConfig.JBC_SendWire_Port);
...@@ -312,44 +311,35 @@ namespace URSoldering.DeviceLibrary ...@@ -312,44 +311,35 @@ namespace URSoldering.DeviceLibrary
/// </summary> /// </summary>
private static void CheckSendWireAlarm() private static void CheckSendWireAlarm()
{ {
//preCheckSendWireTime = DateTime.Now; preCheckSendWireTime = DateTime.Now;
////如果休眠了不需要处理 //如果休眠了不需要处理
//if (RobotBean.KNDIOValue(IO_Type.SendWireLock).Equals(IO_VALUE.HIGH)) if (SendWireManager.IsAlarm())
//{ {
// //停止送丝器 SendWireManager.Reset();
// SendWireManager.SuddownStop(RobotConfig.SendWire_Slv); if (SendWireManager.IsAlarm())
// WarnMsg = "送丝报警:卡丝"; {
// Alarm(AlarmType.SendWireAlarm); //停止送丝器
// LogUtil.error(RobotName + WarnMsg); SendWireManager.StopSend();
// ISAlarmAndOk = false; WarnMsg = "送丝器报警";
//} Alarm(AlarmType.SendWireAlarm);
//else if (RobotBean.KNDIOValue(IO_Type.SendWireNoWire).Equals(IO_VALUE.HIGH)) LogUtil.error(RobotName + WarnMsg);
//{ }
// //停止送丝器 }
// SendWireManager.SuddownStop(RobotConfig.SendWire_Slv); else
// WarnMsg = "送丝报警:没有锡丝"; {
// Alarm(AlarmType.SendWireAlarm); if (alarmType.Equals(AlarmType.SendWireAlarm) && IsInSudden.Equals(false) && IsNoAir.Equals(false))
// LogUtil.error(RobotName + WarnMsg); {
// ISAlarmAndOk = false; TimeSpan span = DateTime.Now - lastSendWireOkTime;
//} int needSeconds = ConfigAppSettings.GetIntValue(Setting_Init.SendWireRecoverSeconds);
//else if (span.TotalSeconds > needSeconds)
//{ {
// if (alarmType.Equals(AlarmType.SendWireAlarm) && IsInSudden.Equals(false) && IsNoAir.Equals(false)) WarnMsg = "";
// { alarmType = AlarmType.None;
// if (ISAlarmAndOk) WarnMsg = "";
// { LogUtil.info(RobotName + "送丝器已恢复超过【" + needSeconds + "】秒,消除送丝器报警!");
// TimeSpan span = DateTime.Now - lastSendWireOkTime; }
// int needSeconds=ConfigAppSettings.GetIntValue(Setting_Init.SendWireRecoverSeconds); }
// if (span.TotalSeconds > needSeconds) }
// {
// WarnMsg = "";
// alarmType = AlarmType.None;
// WarnMsg = "";
// LogUtil.info(RobotName + "送丝器已恢复超过【" + needSeconds + "】秒,消除送丝器报警!");
// }
// }
// }
//}
} }
/// <summary> /// <summary>
/// 卡丝恢复功能,只有手动点了才会继续 /// 卡丝恢复功能,只有手动点了才会继续
...@@ -358,28 +348,24 @@ namespace URSoldering.DeviceLibrary ...@@ -358,28 +348,24 @@ namespace URSoldering.DeviceLibrary
/// <returns></returns> /// <returns></returns>
public static bool SendWireRecover(bool isNext) public static bool SendWireRecover(bool isNext)
{ {
//if (RobotBean.KNDIOValue(IO_Type.SendWireLock).Equals(IO_VALUE.HIGH)) if (SendWireManager.IsAlarm())
//{ {
// LogUtil.info(RobotName + "卡丝恢复失败:仍在卡丝中!"); LogUtil.info(RobotName + "卡丝恢复失败,仍在报警中!");
//} }
//else if (RobotBean.KNDIOValue(IO_Type.SendWireNoWire).Equals(IO_VALUE.HIGH)) else
//{ {
// LogUtil.info(RobotName + "卡丝恢复失败:仍在无丝中!"); if (alarmType.Equals(AlarmType.SendWireAlarm) && IsInSudden.Equals(false) && IsNoAir.Equals(false))
//} {
//else if (WeldMoveStep.moveType.Equals(MoveType.Weld) && (isNext.Equals(false)))
//{ {
// if (alarmType.Equals(AlarmType.SendWireAlarm) && IsInSudden.Equals(false) && IsNoAir.Equals(false)) LogUtil.info(RobotName + "开始卡丝恢复,重新此焊点的焊接 !");
// { WeldMoveStep.NextMoveStep(MoveStep.Wait);
// if (WeldMoveStep.moveType.Equals(MoveType.Weld) && (isNext.Equals(false))) }
// { lastSendWireOkTime = DateTime.Now;
// LogUtil.info(RobotName + "开始卡丝恢复,重新此焊点的焊接 !"); LogUtil.info(RobotName + "开始卡丝恢复!");
// WeldMoveStep.NextMoveStep(MoveStep.Wait); return true;
// } }
// lastSendWireOkTime = DateTime.Now; }
// LogUtil.info(RobotName + "开始卡丝恢复!");
// return true;
// }
//}
return false; return false;
} }
/// <summary>IsNeedMsg /// <summary>IsNeedMsg
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
using URSoldering.LoadCSVLibrary; using URSoldering.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading; using System.Threading;
namespace URSoldering.DeviceLibrary namespace URSoldering.DeviceLibrary
...@@ -310,8 +308,8 @@ namespace URSoldering.DeviceLibrary ...@@ -310,8 +308,8 @@ namespace URSoldering.DeviceLibrary
int speed = (int)WeldMoveStep.CurrPoint.startSendWireSpeed * SendWireXiShu; int speed = (int)WeldMoveStep.CurrPoint.startSendWireSpeed * SendWireXiShu;
WeldLog(" 慢速送丝,速度:" + speed + " :" + time.ToString() + "秒"); WeldLog(" 慢速送丝,速度:" + speed + " :" + time.ToString() + "秒");
SendWireManager.SendWire( time, speed); SendWireManager.SendWire( time, speed);
int ms = (int)(time * 1000); int ms = (int)(time * 1000+100);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitTime(ms)); WeldMoveStep.WaitList.Add(WaitResultInfo.WaitSendWire(ms,false));
} }
else else
{ {
...@@ -327,8 +325,8 @@ namespace URSoldering.DeviceLibrary ...@@ -327,8 +325,8 @@ namespace URSoldering.DeviceLibrary
if (time > 0) if (time > 0)
{ {
SendWireManager.SendWire( time, speed); SendWireManager.SendWire( time, speed);
int ms = (int)(time * 1000); int ms = (int)(time * 1000+100);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitTime(ms)); WeldMoveStep.WaitList.Add(WaitResultInfo.WaitSendWire(ms,false));
} }
} }
public static void SolderingDown(bool isWait) public static void SolderingDown(bool isWait)
...@@ -416,7 +414,7 @@ namespace URSoldering.DeviceLibrary ...@@ -416,7 +414,7 @@ namespace URSoldering.DeviceLibrary
{ {
if (span.TotalMilliseconds < wait.TimeMSeconds) if (span.TotalMilliseconds < wait.TimeMSeconds)
{ {
NotOkMsg = "时间["+wait.TimeMSeconds+"]毫秒"; NotOkMsg = "时间[" + wait.TimeMSeconds + "]毫秒";
isOk = false; isOk = false;
break; break;
} }
...@@ -476,55 +474,32 @@ namespace URSoldering.DeviceLibrary ...@@ -476,55 +474,32 @@ namespace URSoldering.DeviceLibrary
{ {
if (WeldMoveStep.ResetCount < 3) if (WeldMoveStep.ResetCount < 3)
{ {
//判断是否报警 isAlarm = SendWireManager.IsAlarm();
preCheckSendWireTime = DateTime.Now; preCheckSendWireTime = DateTime.Now;
//如果休眠了不需要处理
string msg = "";
//if (RobotBean.KNDIOValue(IO_Type.SendWireLock).Equals(IO_VALUE.HIGH))
//{
// //停止送丝器
// SendWireManager.StopSend();
// msg = " 卡丝";
// isAlarm = true;
//}
//else if (RobotBean.KNDIOValue(IO_Type.SendWireNoWire).Equals(IO_VALUE.HIGH))
//{
// //停止送丝器
// SendWireManager.StopSend();
// msg = "没有锡丝";
// isAlarm = true;
//}
if (isAlarm) if (isAlarm)
{ {
SendWireManager.StopSend();
WeldMoveStep.ResetCount++; WeldMoveStep.ResetCount++;
SendWireManager.Reset();
//反向送丝 //反向送丝
int speed = ConfigAppSettings.GetIntValue(Setting_Init.ReverseSendWireSpeed) * SendWireXiShu; int speed = ConfigAppSettings.GetIntValue(Setting_Init.ReverseSendWireSpeed) * SendWireXiShu;
double times = (double)ConfigAppSettings.GetNumValue(Setting_Init.ReverseSendWireTime); double time = (double)ConfigAppSettings.GetNumValue(Setting_Init.ReverseSendWireTime);
if (speed.Equals(0) || times <= 0) if (speed.Equals(0) || time <= 0)
{ {
isAlarm = false; isAlarm = false;
LogUtil.error("焊接中第【" + WeldMoveStep.ResetCount + "】次 检测到" + msg + ", 速度【" + speed + "】时间【" + times + "】配置不完整,不反转处理"); LogUtil.error("焊接中第【" + WeldMoveStep.ResetCount + "】次 检测到送丝器报警, 速度【" + speed + "】时间【" + times + "】配置不完整,不反转处理");
} }
else else
{ {
LogUtil.error("焊接中第【" + WeldMoveStep.ResetCount + "】次 检测到" + msg + ", 开始反向送丝,速度【" + speed + "】时间【" + times + "】"); LogUtil.error("焊接中第【" + WeldMoveStep.ResetCount + "】次 检测到送丝器报警, 开始反向送丝,速度【" + speed + "】时间【" + times + "】");
//WeldMoveStep.LastSetpTime = DateTime.Now; WeldMoveStep.LastSetpTime = DateTime.Now;
//WeldMoveStep.WaitList.Clear(); WeldMoveStep.WaitList.Clear();
////设置速度
//SendWireManager.SetMoveSpeed(RobotConfig.SendWire_Slv, speed);
//int shuokeRel = (int)times * speed; SendWireManager.SendWireBack(time, speed);
//if (shuokeRel < 0) int ms = (int)((time * 1000) + 100);
//{ WeldMoveStep.WaitList.Add(WaitResultInfo.WaitSendWire(ms, false));
// shuokeRel = 0 - shuokeRel;
//}
//SendWireManager.RelativeMove(RobotConfig.SendWire_Slv, shuokeRel);
////硕科步进驱动走对应的相对位置
//WeldMoveStep.WaitList.Add(WaitResultInfo.WaitShuoKe(RobotConfig.SendWire_Slv, true));
//Thread.Sleep(100);
//SendWireManager.GetStatus(RobotConfig.SendWire_Slv);
isOk = false; isOk = false;
} }
} }
...@@ -533,15 +508,13 @@ namespace URSoldering.DeviceLibrary ...@@ -533,15 +508,13 @@ namespace URSoldering.DeviceLibrary
if (wait.ShuoKeISReverse.Equals(false) && isAlarm.Equals(false)) if (wait.ShuoKeISReverse.Equals(false) && isAlarm.Equals(false))
{ {
//if (!SendWireManager.IsMoveEnd(wait.SlvAddr, WeldMoveStep.LastSetpTime)) if (span.TotalMilliseconds < wait.TimeMSeconds)
//{ {
// NotOkMsg = "送丝结束"; NotOkMsg = "送丝时间[" + wait.TimeMSeconds + "]毫秒";
// isOk = false; isOk = false;
// SendWireManager.GetStatus(wait.SlvAddr); break;
}
// break; else if (WeldMoveStep.OneWaitOk)
//}
//else if (WeldMoveStep.OneWaitOk)
{ {
isOk = true; isOk = true;
break; break;
...@@ -549,25 +522,19 @@ namespace URSoldering.DeviceLibrary ...@@ -549,25 +522,19 @@ namespace URSoldering.DeviceLibrary
} }
else if (wait.ShuoKeISReverse.Equals(true) && isAlarm.Equals(false)) else if (wait.ShuoKeISReverse.Equals(true) && isAlarm.Equals(false))
{ {
//if (!SendWireManager.IsMoveEnd(wait.SlvAddr, WeldMoveStep.LastSetpTime)) if (span.TotalMilliseconds < wait.TimeMSeconds)
//{ {
// NotOkMsg = "送丝反转"; NotOkMsg = "送丝时间[" + wait.TimeMSeconds + "]毫秒";
// isOk = false; isOk = false;
// //TimeSpan getStatusSpan = DateTime.Now - preGetStatusTime; break;
// //if (getStatusSpan.TotalSeconds >= 1) }
// //{ else
// // preGetStatusTime = DateTime.Now; {
// //SendWireManager.GetStatus(wait.SlvAddr); //反转已经停止,直接重新运行次步骤
// //} //MoveStep step = (MoveStep)((int)WeldMoveStep.moveStep - 1);
// break; LogUtil.info(RobotName + " 送丝反转结束,重新开始当前焊点焊接");
//} WeldMoveStep.NextMoveStep(MoveStep.Wait);
//else }
//{
// //反转已经停止,直接重新运行次步骤
// //MoveStep step = (MoveStep)((int)WeldMoveStep.moveStep - 1);
// LogUtil.info(RobotName + " 送丝反转结束,重新开始当前焊点焊接");
// WeldMoveStep.NextMoveStep(MoveStep.Wait);
//}
} }
} }
else if (wait.WaitType == 6) else if (wait.WaitType == 6)
......
...@@ -16,10 +16,6 @@ namespace URSoldering.DeviceLibrary ...@@ -16,10 +16,6 @@ namespace URSoldering.DeviceLibrary
/// 平均焊接时间 /// 平均焊接时间
/// </summary> /// </summary>
public TimeSpan WeldTime = new TimeSpan(0); public TimeSpan WeldTime = new TimeSpan(0);
//public SProgramInfo getProgram()
// {
// return SProgramManager.getByPartNum(PartNumber);
// }
/// <summary> /// <summary>
/// 电路板ID /// 电路板ID
/// </summary> /// </summary>
...@@ -195,43 +191,18 @@ namespace URSoldering.DeviceLibrary ...@@ -195,43 +191,18 @@ namespace URSoldering.DeviceLibrary
public double RobotRY { get; set; } public double RobotRY { get; set; }
public double RobotRZ { get; set; } public double RobotRZ { get; set; }
///// <summary>
///// x坐标
///// </summary>
//public double PositionX { get; set; }
///// <summary>
///// y坐标
///// </summary>
//public double PositionY { get; set; }
///// <summary>
///// u坐标
///// </summary>
//public double PositionU { get; set; }
///// <summary>
///// z坐标
///// </summary>
//public double PositionZ { get; set; }
///// <summary>
///// 手臂方向,2=左臂L,1=右臂R
///// </summary>
//public int HandDirection { get; set; }
/// <summary> /// <summary>
/// 预热温度 /// 预热温度
/// </summary> /// </summary>
public int preheatTemperature { get; set; } public int preheatTemperature { get; set; }
/// <summary> /// <summary>
/// 预热温度上限 /// 预热温度上限
/// </summary> /// </summary>
public int preheatTemperatureMax { get; set; } public int preheatTemperatureMax { get; set; }
/// <summary> /// <summary>
/// 预热温度下限 /// 预热温度下限
/// </summary> /// </summary>
public int preheatTemperatureMin { get; set; } public int preheatTemperatureMin { get; set; }
/// <summary> /// <summary>
/// 预热时间(秒) /// 预热时间(秒)
/// </summary> /// </summary>
...@@ -284,28 +255,5 @@ namespace URSoldering.DeviceLibrary ...@@ -284,28 +255,5 @@ namespace URSoldering.DeviceLibrary
/// </summary> /// </summary>
public int ClearTime { get; set; } public int ClearTime { get; set; }
//public string HandValue
//{
// get
// {
// if (HandDirection == 0)
// {
// return "自动";
// }
// else if (HandDirection == 1)
// {
// return "右臂";
// }
// else if (HandDirection == 2)
// {
// return "左臂";
// }
// return "";
// }
// set
// {
// }
//}
} }
} }
...@@ -111,13 +111,6 @@ namespace URSoldering.DeviceLibrary ...@@ -111,13 +111,6 @@ namespace URSoldering.DeviceLibrary
{ {
board.orgType = 1; board.orgType = 1;
} }
////如果未添加程序,自动添加
//if (board.getProgram() == null)
//{
// SProgramManager.addDefaultProgram(board.PartNumber,board.boardLength,board.boardWidth);
//}
boardList.Add(board); boardList.Add(board);
} }
if (isUpdate) if (isUpdate)
......
...@@ -12,8 +12,6 @@ namespace URSoldering.DeviceLibrary ...@@ -12,8 +12,6 @@ namespace URSoldering.DeviceLibrary
{ {
public class RobotBean public class RobotBean
{ {
//public string MesIp = ConfigAppSettings.GetValue(Setting_Init.Mes_IP);
//public int MesPort = ConfigAppSettings.GetIntValue(Setting_Init.Mes_Port);
/// <summary> /// <summary>
/// 报警或者警告信息 /// 报警或者警告信息
/// </summary> /// </summary>
...@@ -25,10 +23,6 @@ namespace URSoldering.DeviceLibrary ...@@ -25,10 +23,6 @@ namespace URSoldering.DeviceLibrary
public static RobotConfig baseConfig = null; public static RobotConfig baseConfig = null;
public bool IsInSuddendown = false; public bool IsInSuddendown = false;
/// <summary> /// <summary>
/// 是否是排料模式,排料模式不扫码,工位不绑定条码,后面工位判断没有条码不需要工作
/// </summary>
//public bool IsOutWareMode = false;
/// <summary>
/// 不扫码工作 /// 不扫码工作
/// </summary> /// </summary>
public bool NoCodeWork = false; public bool NoCodeWork = false;
......
...@@ -38,14 +38,6 @@ namespace URSoldering.DeviceLibrary ...@@ -38,14 +38,6 @@ namespace URSoldering.DeviceLibrary
SolderingRobot = new URSolderingRobot((SolderingRobotConfig)robotConfig); SolderingRobot = new URSolderingRobot((SolderingRobotConfig)robotConfig);
} }
//else if (robotType.Equals(RobotType.RivetingRobot))
//{
// RivetingRobot = new RivetingRobotBean((RivetingRobotConfig)robotConfig);
//}
//else if (robotType.Equals(RobotType.ScrewRobot))
//{
// ScrewRobot = new ScrewRobotBean((ScrewRobotConfig)robotConfig);
//}
LogUtil.info(LOGGER, "加载配置完成!"); LogUtil.info(LOGGER, "加载配置完成!");
return robotConfig; return robotConfig;
...@@ -68,7 +60,6 @@ namespace URSoldering.DeviceLibrary ...@@ -68,7 +60,6 @@ namespace URSoldering.DeviceLibrary
{ {
//位置配置到文件中 //位置配置到文件中
string appPath = Application.StartupPath; string appPath = Application.StartupPath;
string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Robot_ConfigPath); string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Robot_ConfigPath);
bool result = CSVConfigReader.SaveConfig(configFile, config); bool result = CSVConfigReader.SaveConfig(configFile, config);
if (!result) if (!result)
...@@ -81,7 +72,6 @@ namespace URSoldering.DeviceLibrary ...@@ -81,7 +72,6 @@ namespace URSoldering.DeviceLibrary
LOGGER.Error("出错:", ex); LOGGER.Error("出错:", ex);
} }
} }
} }
} }
...@@ -2,12 +2,8 @@ ...@@ -2,12 +2,8 @@
using log4net; using log4net;
using URSoldering.Common; using URSoldering.Common;
using System; using System;
using System.Collections.Generic;
using System.IO.Ports; using System.IO.Ports;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace URSoldering.DeviceLibrary namespace URSoldering.DeviceLibrary
{ {
...@@ -36,20 +32,7 @@ namespace URSoldering.DeviceLibrary ...@@ -36,20 +32,7 @@ namespace URSoldering.DeviceLibrary
private static string CMD_StartBackSend = "0010WSFD00000"; private static string CMD_StartBackSend = "0010WSFD00000";
private static string CMD_StopSend = "0010WSSD00000"; private static string CMD_StopSend = "0010WSSD00000";
private static string CMD_Reset = "0010WECV00001"; private static string CMD_Reset = "0010WECV00001";
//private static string CMD_Reset = "0010WCTP00000";
//private static string CMD_WriteMode = "02 57 4D 4F 44 30 30 30 30 32 03 22";
//private static string CMD_SetSpeed = "02 57 53 50 44 30 30 31 31 30 03 21";
//private static string CMD_SetSendLength = "02 57 4C 45 4E 30 31 31 30 30 03 21";
//private static string CMD_GetSpeed = "02 52 53 50 44 03 14";
//private static string CMD_GetSendLength = "02 52 4C 45 4E 03 14";
//private static string CMD_GetStatus = "02 52 54 45 53 03 11";
//private static string CMD_StartForwardSend = "02 57 53 46 44 30 30 30 30 31 03 36";
//private static string CMD_StartBackSend = "02 57 53 46 44 30 30 30 30 30 03 37";
/// <summary>
/// 初始化
/// </summary>
/// <returns></returns>
public static bool Init(string port) public static bool Init(string port)
{ {
if (sb == null) if (sb == null)
...@@ -155,6 +138,23 @@ namespace URSoldering.DeviceLibrary ...@@ -155,6 +138,23 @@ namespace URSoldering.DeviceLibrary
} }
return data; return data;
} }
public static bool IsAlarm()
{
int error = ReadPortError();
if (error > 0)
{
return true;
}
return false;
}
public static void SendWireBack(double time, int speed)
{
setSpeed(speed);
double length = (time * speed);
setLength(length);
StartBSend();
}
public static void SendWire(double time, int speed) public static void SendWire(double time, int speed)
{ {
setSpeed(speed); setSpeed(speed);
...@@ -225,7 +225,7 @@ namespace URSoldering.DeviceLibrary ...@@ -225,7 +225,7 @@ namespace URSoldering.DeviceLibrary
} }
message[message.Length - 1] = (byte)0x03; message[message.Length - 1] = (byte)0x03;
ushort bcc = 0; ushort bcc = 0;
SerialBean.CalculateBCC(message, message.Length, out bcc); AcSerialBean.CalculateBCC(message, message.Length, out bcc);
/** /**
* 读命令返回值包含数据域 * 读命令返回值包含数据域
...@@ -247,54 +247,11 @@ namespace URSoldering.DeviceLibrary ...@@ -247,54 +247,11 @@ namespace URSoldering.DeviceLibrary
{ {
data = new byte[messageAll.Length - 5]; data = new byte[messageAll.Length - 5];
} }
string str = SerialBean.byteToHexStr(messageAll); string str = AcSerialBean.byteToHexStr(messageAll," ");
LogUtil.info(" 【"+commandText+"】 转换后【"+str+"】"); LogUtil.debug(" JBC送丝器【"+commandText+"】 转换后【"+str+"】");
//data = new byte[messageAll.Length];
sb.SendCommand(messageAll, ref data, 100, out isOk); sb.SendCommand(messageAll, ref data, 100, out isOk);
//string rawMsg = Encoding.ASCII.GetString(data, 100, data.Length);
return data; return data;
} }
//private static byte[] parseCommand(string commandText, out bool isOk)
//{
// if (sb == null)
// {
// isOk = false;
// return null;
// }
// byte[] message = new byte[commandText.Length + 2];
// message[0] = (byte)2;
// for (int i = 1; i < commandText.Length + 1; i++)
// {
// message[i] = (byte)commandText[i - 1];
// }
// message[message.Length - 1] = (byte)3;
// ushort bcc = 0;
// SerialBean.CalculateBCC(message, message.Length, out bcc);
// /**
// * 读命令返回值包含数据域
// * 写命令返回值不包含数据域
// */
// byte[] data = null;
// byte[] messageAll = new byte[message.Length + 1];
// message.CopyTo(messageAll, 0);
// messageAll[messageAll.Length - 1] = (byte)bcc;
// if ("R".Equals(commandText.Substring(0, 1)))
// {
// data = new byte[messageAll.Length + 5];
// }
// else
// {
// data = new byte[messageAll.Length - 5];
// }
// sb.SendCommand(messageAll, ref data, 2, out isOk);
// string rawMsg = Encoding.ASCII.GetString(data, 0, data.Length);
// return data;
//}
public static string GetErrorStr(int error) public static string GetErrorStr(int error)
{ {
string errMsg = ""; string errMsg = "";
......
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using URSoldering.Common; using URSoldering.Common;
using System.IO.Ports; using System.IO.Ports;
using log4net; using log4net;
......
...@@ -3,16 +3,9 @@ using log4net; ...@@ -3,16 +3,9 @@ using log4net;
using URSoldering.Common; using URSoldering.Common;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using URSoldering.Common.util; using URSoldering.Common.util;
using System.IO; using System.IO;
...@@ -931,10 +924,6 @@ namespace URSoldering.Client ...@@ -931,10 +924,6 @@ namespace URSoldering.Client
/// <param name="e"></param> /// <param name="e"></param>
private void dgvList_CellValueChanged(object sender, DataGridViewCellEventArgs e) private void dgvList_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{ {
/**
* 当单元格数据改变时(XY值)
* 调用改变图片上的点方法
*/
if (this.txtBoardWidth.Text.Trim() != "" && this.txtBoardLength.Text.Trim() != "") if (this.txtBoardWidth.Text.Trim() != "" && this.txtBoardLength.Text.Trim() != "")
{ {
loadPictureBoxSize(); loadPictureBoxSize();
...@@ -1216,110 +1205,64 @@ namespace URSoldering.Client ...@@ -1216,110 +1205,64 @@ namespace URSoldering.Client
} }
private void RovotMove(URPointValue point)
private void btnXAdd_Click(object sender, EventArgs e)
{ {
if (isAuto == false) if (isAuto == false)
{ {
MessageBox.Show("请先切换到自动模式!"); MessageBox.Show("请先切换到自动模式!");
return; return;
} }
URRobotControl.MoveTo(point);
}
private void btnXAdd_Click(object sender, EventArgs e)
{
URPointValue point = GetCurrRobotPoint(); URPointValue point = GetCurrRobotPoint();
point.Y += StepValue; point.Y += StepValue;
URRobotControl.MoveTo(point); RovotMove(point);
} }
private void btnXDel_Click(object sender, EventArgs e) private void btnXDel_Click(object sender, EventArgs e)
{ {
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
URPointValue point = GetCurrRobotPoint(); URPointValue point = GetCurrRobotPoint();
point.Y -= StepValue; point.Y -= StepValue;
URRobotControl.MoveTo(point); RovotMove(point);
} }
private void btnYDel_Click(object sender, EventArgs e) private void btnYDel_Click(object sender, EventArgs e)
{ {
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
URPointValue point = GetCurrRobotPoint(); URPointValue point = GetCurrRobotPoint();
point.X -= StepValue; point.X -= StepValue;
URRobotControl.MoveTo(point); RovotMove(point);
} }
private void btnYAdd_Click(object sender, EventArgs e) private void btnYAdd_Click(object sender, EventArgs e)
{ {
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
URPointValue point = GetCurrRobotPoint(); URPointValue point = GetCurrRobotPoint();
point.X += StepValue; point.X += StepValue;
URRobotControl.MoveTo(point); RovotMove(point);
} }
private void btnZAdd_Click(object sender, EventArgs e) private void btnZAdd_Click(object sender, EventArgs e)
{ {
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
URPointValue point = GetCurrRobotPoint(); URPointValue point = GetCurrRobotPoint();
point.Z += StepValue; point.Z += StepValue;
URRobotControl.MoveTo(point); RovotMove(point);
} }
private void btnZDel_Click(object sender, EventArgs e) private void btnZDel_Click(object sender, EventArgs e)
{ {
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
URPointValue point = GetCurrRobotPoint(); URPointValue point = GetCurrRobotPoint();
point.Z -= StepValue; point.Z -= StepValue;
URRobotControl.MoveTo(point); RovotMove(point);
} }
private void btnUAdd_Click(object sender, EventArgs e) private void btnUAdd_Click(object sender, EventArgs e)
{ {
//if (isAuto == false)
//{
// MessageBox.Show("请先切换到自动模式!");
// return;
//}
//double x = FormUtil.getDoubleValue(txtRobotX);
//double y = FormUtil.getDoubleValue(txtRobotY);
//double u = FormUtil.getDoubleValue(txtRobotU);
//double z = FormUtil.getDoubleValue(txtRobotZ);
//int hand =GetHand();
//u+=StepValue;
//URRobotControl.MoveTo(x, y, z, u, isfast, hand,AfterMove);
} }
private void btnUDel_Click(object sender, EventArgs e) private void btnUDel_Click(object sender, EventArgs e)
{ {
//if (isAuto == false)
//{
// MessageBox.Show("请先切换到自动模式!");
// return;
//}
//double x = FormUtil.getDoubleValue(txtRobotX);
//double y = FormUtil.getDoubleValue(txtRobotY);
//double u = FormUtil.getDoubleValue(txtRobotU);
//double z = FormUtil.getDoubleValue(txtRobotZ);
//int hand =GetHand();
//u-=StepValue;
//URRobotControl.MoveTo(x, y, z, u, isfast, hand,AfterMove);
} }
private void dgvList_DragEnter(object sender, DragEventArgs e) private void dgvList_DragEnter(object sender, DragEventArgs e)
...@@ -1486,9 +1429,11 @@ namespace URSoldering.Client ...@@ -1486,9 +1429,11 @@ namespace URSoldering.Client
private void btnSendWire_Click(object sender, EventArgs e) private void btnSendWire_Click(object sender, EventArgs e)
{ {
//匀速运动 double speed = FormUtil.getDoubleValue(txtSpeed);
int speed = FormUtil.GetIntValue(txtSpeed) * WeldRobotBean.SendWireXiShu; double length = FormUtil.getDoubleValue(txtSendWireLength);
//SendWireManager.VolMove(WeldRobotBean.RobotConfig.SendWire_Slv, speed); SendWireManager.setLength(length);
SendWireManager.setSpeed(speed);
SendWireManager.StartFSend();
} }
private void btnStopSend_Click(object sender, EventArgs e) private void btnStopSend_Click(object sender, EventArgs e)
...@@ -1498,26 +1443,19 @@ namespace URSoldering.Client ...@@ -1498,26 +1443,19 @@ namespace URSoldering.Client
private void btnWUp_Click(object sender, EventArgs e) private void btnWUp_Click(object sender, EventArgs e)
{ {
if (btnWUp.Text.Equals("送丝上升")) if (btnWUp.Text.Equals("烙铁上升"))
{ {
WeldRobotBean.SolderingUp(false); WeldRobotBean.SolderingUp(false);
btnWUp.Text = "送丝下降"; btnWUp.Text = "烙铁下降";
} }
else else
{ {
WeldRobotBean.SolderingDown(false); WeldRobotBean.SolderingDown(false);
btnWUp.Text = "送丝上升"; btnWUp.Text = "烙铁上升";
} }
} }
private void btnWDown_Click(object sender, EventArgs e)
{
//RobotBean.KNDIOMove(IO_Type.SendWire_Up, IO_VALUE.LOW);
//RobotBean.KNDIOMove(IO_Type.SendWire_Down, IO_VALUE.HIGH);
}
private void btnSetClear1_Click(object sender, EventArgs e) private void btnSetClear1_Click(object sender, EventArgs e)
{ {
URPointValue point = GetCurrRobotPoint(); URPointValue point = GetCurrRobotPoint();
...@@ -1577,24 +1515,16 @@ namespace URSoldering.Client ...@@ -1577,24 +1515,16 @@ namespace URSoldering.Client
private void btnStopDown_Click(object sender, EventArgs e) private void btnStopDown_Click(object sender, EventArgs e)
{ {
//if (btnStopDown.Text.Equals("阻挡气缸下降")) if (btnStopDown.Text.Equals("送丝清洗端"))
//{ {
// RobotBean.KNDIOMove(IO_Type.StopCylinder_Down, IO_VALUE.HIGH); WeldRobotBean.SendWireClear(false );
// RobotBean.KNDIOMove(IO_Type.StopCylinder_Up, IO_VALUE.LOW); btnStopDown.Text = "送丝工作端";
// btnStopDown.Text = "阻挡气缸上升";
//}
//else
//{
// RobotBean.KNDIOMove(IO_Type.StopCylinder_Down, IO_VALUE.LOW);
// RobotBean.KNDIOMove(IO_Type.StopCylinder_Up, IO_VALUE.HIGH);
// btnStopDown.Text = "阻挡气缸下降";
//}
} }
else
private void btnStopUp_Click(object sender, EventArgs e)
{ {
//RobotBean.KNDIOMove(IO_Type.StopCylinder_Down, IO_VALUE.LOW); WeldRobotBean.SendWireWork(false);
//RobotBean.KNDIOMove(IO_Type.StopCylinder_Up, IO_VALUE.HIGH); btnStopDown.Text = "送丝清洗端";
}
} }
private void btnPositionTest_Click(object sender, EventArgs e) private void btnPositionTest_Click(object sender, EventArgs e)
......
using log4net; using log4net;
using URSoldering.Common;
using URSoldering.Common.util;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
namespace URSoldering.Client namespace URSoldering.Client
...@@ -123,8 +116,6 @@ namespace URSoldering.Client ...@@ -123,8 +116,6 @@ namespace URSoldering.Client
lvi.ImageIndex = i; lvi.ImageIndex = i;
lvi.Text = point.pointName; lvi.Text = point.pointName;
//lvi.SubItems.Add(name);
//lvi.SubItems.Add(point.preheatTemperature.ToString());
lvi.SubItems.Add(point.weldTemperature.ToString()); lvi.SubItems.Add(point.weldTemperature.ToString());
lvi.SubItems.Add((point.startSendWireSpeed * point.startSendWireTime).ToString()); lvi.SubItems.Add((point.startSendWireSpeed * point.startSendWireTime).ToString());
lvi.SubItems.Add((point.sendWireTime * point.sendWireSpeed).ToString()); lvi.SubItems.Add((point.sendWireTime * point.sendWireSpeed).ToString());
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using URSoldering.Common;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
namespace URSoldering.Client namespace URSoldering.Client
...@@ -41,18 +35,9 @@ namespace URSoldering.Client ...@@ -41,18 +35,9 @@ namespace URSoldering.Client
{ {
cmbBoardList.SelectedIndex = 0; cmbBoardList.SelectedIndex = 0;
} }
} }
int preIndex = -1;
private void cmbBoardList_SelectedIndexChanged(object sender, EventArgs e) private void cmbBoardList_SelectedIndexChanged(object sender, EventArgs e)
{ {
//if (cmbBoardList.Text != "" && cmbBoardList.SelectedIndex >= 0 && (!cmbBoardList.SelectedIndex.Equals(preIndex)))
//{
// preIndex = cmbBoardList.SelectedIndex;
// string partNum = cmbBoardList.Text;
// Dictionary<int, BoardInfo> boardMap = BoardManager.GetBoardMapByPartNum(partNum);
//}
} }
private void btnBack_Click(object sender, EventArgs e) private void btnBack_Click(object sender, EventArgs e)
...@@ -80,7 +65,5 @@ namespace URSoldering.Client ...@@ -80,7 +65,5 @@ namespace URSoldering.Client
this.Close(); this.Close();
} }
} }
} }
using HalconDotNet; using HalconDotNet;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
using URSoldering.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using URSoldering.Common; using URSoldering.Common;
......
using HalconDotNet; 
using URSoldering.Common; using URSoldering.Common;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
using URSoldering.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
......
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
using URSoldering.Common;
namespace URSoldering.Client namespace URSoldering.Client
{ {
public partial class FrmDebugMenu : FrmBase public partial class FrmDebugMenu : FrmBase
......
...@@ -484,11 +484,11 @@ namespace URSoldering.Client ...@@ -484,11 +484,11 @@ namespace URSoldering.Client
// //
this.txtSendWireLength.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtSendWireLength.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtSendWireLength.Location = new System.Drawing.Point(608, 440); this.txtSendWireLength.Location = new System.Drawing.Point(608, 440);
this.txtSendWireLength.MaxLength = 10; this.txtSendWireLength.MaxLength = 6;
this.txtSendWireLength.Name = "txtSendWireLength"; this.txtSendWireLength.Name = "txtSendWireLength";
this.txtSendWireLength.Size = new System.Drawing.Size(67, 23); this.txtSendWireLength.Size = new System.Drawing.Size(67, 23);
this.txtSendWireLength.TabIndex = 260; this.txtSendWireLength.TabIndex = 260;
this.txtSendWireLength.Text = "3"; this.txtSendWireLength.Text = "10";
// //
// btnTestSend // btnTestSend
// //
...@@ -517,11 +517,11 @@ namespace URSoldering.Client ...@@ -517,11 +517,11 @@ namespace URSoldering.Client
// //
this.txtSpeed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtSpeed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtSpeed.Location = new System.Drawing.Point(608, 403); this.txtSpeed.Location = new System.Drawing.Point(608, 403);
this.txtSpeed.MaxLength = 10; this.txtSpeed.MaxLength = 6;
this.txtSpeed.Name = "txtSpeed"; this.txtSpeed.Name = "txtSpeed";
this.txtSpeed.Size = new System.Drawing.Size(67, 23); this.txtSpeed.Size = new System.Drawing.Size(67, 23);
this.txtSpeed.TabIndex = 254; this.txtSpeed.TabIndex = 254;
this.txtSpeed.Text = "3"; this.txtSpeed.Text = "10";
// //
// btnStopSend // btnStopSend
// //
......
...@@ -4,14 +4,7 @@ using URSoldering.Common; ...@@ -4,14 +4,7 @@ using URSoldering.Common;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using UserFromControl; using UserFromControl;
using URSoldering.LoadCSVLibrary; using URSoldering.LoadCSVLibrary;
...@@ -221,8 +214,8 @@ namespace URSoldering.Client ...@@ -221,8 +214,8 @@ namespace URSoldering.Client
private void btnSendWire_Click(object sender, EventArgs e) private void btnSendWire_Click(object sender, EventArgs e)
{ {
int speed = FormUtil.GetIntValue(txtSpeed); double speed = FormUtil.getDoubleValue(txtSpeed);
int length = FormUtil.GetIntValue(txtSendWireLength); double length = FormUtil.getDoubleValue(txtSendWireLength);
SendWireManager.setLength(length); SendWireManager.setLength(length);
SendWireManager.setSpeed(speed); SendWireManager.setSpeed(speed);
SendWireManager.StartFSend(); SendWireManager.StartFSend();
......
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using URSoldering.Common; using URSoldering.Common;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
......
...@@ -3,24 +3,8 @@ using log4net; ...@@ -3,24 +3,8 @@ using log4net;
using URSoldering.Common; using URSoldering.Common;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
using System; using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using URSoldering.Common.util;
using System.IO;
using System.Drawing.Drawing2D;
using URSoldering.LoadCSVLibrary;
using System.Threading.Tasks;
using System.Timers;
using HalconDotNet;
namespace URSoldering.Client namespace URSoldering.Client
{ {
...@@ -135,9 +119,6 @@ namespace URSoldering.Client ...@@ -135,9 +119,6 @@ namespace URSoldering.Client
MessageBox.Show("请先切换到自动模式!"); MessageBox.Show("请先切换到自动模式!");
return; return;
} }
//RobotBean.KNDIOMove(IO_Type.SendWire_Down, IO_VALUE.LOW);
//RobotBean.KNDIOMove(IO_Type.SendWire_Up, IO_VALUE.HIGH);
URPointValue point = WeldRobotBean.HomePoint; URPointValue point = WeldRobotBean.HomePoint;
URRobotControl.MoveTo(point); URRobotControl.MoveTo(point);
} }
......
...@@ -29,12 +29,14 @@ ...@@ -29,12 +29,14 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtRevice = new System.Windows.Forms.TextBox();
this.btnSend = new System.Windows.Forms.Button();
this.txtSend = new System.Windows.Forms.TextBox();
this.btnReset = new System.Windows.Forms.Button(); this.btnReset = new System.Windows.Forms.Button();
this.btnStop = new System.Windows.Forms.Button(); this.btnStop = new System.Windows.Forms.Button();
this.txtPortError = new System.Windows.Forms.TextBox(); this.txtPortError = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.btnReadError = new System.Windows.Forms.Button(); this.btnReadError = new System.Windows.Forms.Button();
this.lblMsg = new System.Windows.Forms.Label();
this.btnCloseForm = new System.Windows.Forms.Button(); this.btnCloseForm = new System.Windows.Forms.Button();
this.btnStartBack = new System.Windows.Forms.Button(); this.btnStartBack = new System.Windows.Forms.Button();
this.txtLength = new System.Windows.Forms.TextBox(); this.txtLength = new System.Windows.Forms.TextBox();
...@@ -47,9 +49,7 @@ ...@@ -47,9 +49,7 @@
this.txtSoldingCom = new System.Windows.Forms.TextBox(); this.txtSoldingCom = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.btnOpenSold = new System.Windows.Forms.Button(); this.btnOpenSold = new System.Windows.Forms.Button();
this.txtSend = new System.Windows.Forms.TextBox(); this.lblMsg = new System.Windows.Forms.Label();
this.btnSend = new System.Windows.Forms.Button();
this.txtRevice = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -77,11 +77,42 @@ ...@@ -77,11 +77,42 @@
this.groupBox1.Controls.Add(this.btnOpenSold); this.groupBox1.Controls.Add(this.btnOpenSold);
this.groupBox1.Location = new System.Drawing.Point(36, 36); this.groupBox1.Location = new System.Drawing.Point(36, 36);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(678, 402); this.groupBox1.Size = new System.Drawing.Size(678, 388);
this.groupBox1.TabIndex = 0; this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "送丝测试"; this.groupBox1.Text = "送丝测试";
// //
// txtRevice
//
this.txtRevice.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtRevice.Location = new System.Drawing.Point(37, 347);
this.txtRevice.Name = "txtRevice";
this.txtRevice.Size = new System.Drawing.Size(376, 23);
this.txtRevice.TabIndex = 302;
this.txtRevice.Text = "0";
this.txtRevice.Visible = false;
//
// btnSend
//
this.btnSend.Location = new System.Drawing.Point(296, 309);
this.btnSend.Name = "btnSend";
this.btnSend.Size = new System.Drawing.Size(117, 35);
this.btnSend.TabIndex = 301;
this.btnSend.Text = "发送";
this.btnSend.UseVisualStyleBackColor = true;
this.btnSend.Visible = false;
this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
//
// txtSend
//
this.txtSend.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtSend.Location = new System.Drawing.Point(37, 313);
this.txtSend.Name = "txtSend";
this.txtSend.Size = new System.Drawing.Size(210, 23);
this.txtSend.TabIndex = 300;
this.txtSend.Text = "WMOD00002";
this.txtSend.Visible = false;
//
// btnReset // btnReset
// //
this.btnReset.Location = new System.Drawing.Point(440, 240); this.btnReset.Location = new System.Drawing.Point(440, 240);
...@@ -130,17 +161,6 @@ ...@@ -130,17 +161,6 @@
this.btnReadError.UseVisualStyleBackColor = true; this.btnReadError.UseVisualStyleBackColor = true;
this.btnReadError.Click += new System.EventHandler(this.btnReadError_Click_1); this.btnReadError.Click += new System.EventHandler(this.btnReadError_Click_1);
// //
// lblMsg
//
this.lblMsg.AutoSize = true;
this.lblMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMsg.ForeColor = System.Drawing.Color.Red;
this.lblMsg.Location = new System.Drawing.Point(629, 14);
this.lblMsg.Name = "lblMsg";
this.lblMsg.Size = new System.Drawing.Size(65, 19);
this.lblMsg.TabIndex = 283;
this.lblMsg.Text = "急停未开";
//
// btnCloseForm // btnCloseForm
// //
this.btnCloseForm.Location = new System.Drawing.Point(541, 315); this.btnCloseForm.Location = new System.Drawing.Point(541, 315);
...@@ -254,33 +274,16 @@ ...@@ -254,33 +274,16 @@
this.btnOpenSold.UseVisualStyleBackColor = true; this.btnOpenSold.UseVisualStyleBackColor = true;
this.btnOpenSold.Click += new System.EventHandler(this.btnOpenSold_Click); this.btnOpenSold.Click += new System.EventHandler(this.btnOpenSold_Click);
// //
// txtSend // lblMsg
//
this.txtSend.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtSend.Location = new System.Drawing.Point(37, 321);
this.txtSend.Name = "txtSend";
this.txtSend.Size = new System.Drawing.Size(210, 23);
this.txtSend.TabIndex = 300;
this.txtSend.Text = "WMOD00002";
//
// btnSend
//
this.btnSend.Location = new System.Drawing.Point(296, 309);
this.btnSend.Name = "btnSend";
this.btnSend.Size = new System.Drawing.Size(117, 35);
this.btnSend.TabIndex = 301;
this.btnSend.Text = "发送";
this.btnSend.UseVisualStyleBackColor = true;
this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
//
// txtRevice
// //
this.txtRevice.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblMsg.AutoSize = true;
this.txtRevice.Location = new System.Drawing.Point(37, 362); this.lblMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtRevice.Name = "txtRevice"; this.lblMsg.ForeColor = System.Drawing.Color.Red;
this.txtRevice.Size = new System.Drawing.Size(376, 23); this.lblMsg.Location = new System.Drawing.Point(629, 14);
this.txtRevice.TabIndex = 302; this.lblMsg.Name = "lblMsg";
this.txtRevice.Text = "0"; this.lblMsg.Size = new System.Drawing.Size(65, 19);
this.lblMsg.TabIndex = 283;
this.lblMsg.Text = "急停未开";
// //
// FrmSendWire // FrmSendWire
// //
......
...@@ -20,11 +20,6 @@ namespace URSoldering.Client ...@@ -20,11 +20,6 @@ namespace URSoldering.Client
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
{
}
private void btnStopSend_Click(object sender, EventArgs e) private void btnStopSend_Click(object sender, EventArgs e)
{ {
SendWireManager.StopSend(); SendWireManager.StopSend();
...@@ -141,14 +136,6 @@ namespace URSoldering.Client ...@@ -141,14 +136,6 @@ namespace URSoldering.Client
private void btnSend_Click(object sender, EventArgs e) private void btnSend_Click(object sender, EventArgs e)
{ {
string msg = "";
string str = "02 30 30 31 30 57 53 46 44 30 30 30 30 31 03 37 ";
byte[] data = SerialBean.StringToByte(str);
if (data != null && data.Length > 0)
{
msg = Encoding.ASCII.GetString(data, 1, data.Length - 3);
}
txtRevice.Text = ""; txtRevice.Text = "";
string text = txtSend.Text; string text = txtSend.Text;
bool isOk = false; bool isOk = false;
......
...@@ -272,7 +272,6 @@ namespace URSoldering.Client ...@@ -272,7 +272,6 @@ namespace URSoldering.Client
this.Controls.Add(this.groupBox6); this.Controls.Add(this.groupBox6);
this.Name = "FrmSoldDebug"; this.Name = "FrmSoldDebug";
this.Text = "烙铁调试"; this.Text = "烙铁调试";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
this.Load += new System.EventHandler(this.FrmMain_Load); this.Load += new System.EventHandler(this.FrmMain_Load);
this.groupBox6.ResumeLayout(false); this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout(); this.groupBox6.PerformLayout();
......
using log4net; using log4net;
using URSoldering.Common;
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using UserFromControl;
namespace URSoldering.Client namespace URSoldering.Client
{ {
...@@ -37,9 +27,6 @@ namespace URSoldering.Client ...@@ -37,9 +27,6 @@ namespace URSoldering.Client
SoldStatus(false); SoldStatus(false);
} }
} }
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
{
}
private void btnStopSend_Click(object sender, EventArgs e) private void btnStopSend_Click(object sender, EventArgs e)
{ {
......
...@@ -20,7 +20,6 @@ namespace URSoldering.Client ...@@ -20,7 +20,6 @@ namespace URSoldering.Client
public partial class FrmWork : FrmBase public partial class FrmWork : FrmBase
{ {
private static string VideoCameraName = ConfigAppSettings.GetValue(Setting_Init.VideoCameraName); private static string VideoCameraName = ConfigAppSettings.GetValue(Setting_Init.VideoCameraName);
//private static string CodeCameraName = ConfigAppSettings.GetValue(Setting_Init.CodeCameraName);
private URSolderingRobot Robot = null; private URSolderingRobot Robot = null;
public FrmWork() public FrmWork()
{ {
......
using URSoldering.DeviceLibrary; using URSoldering.DeviceLibrary;
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
namespace URSoldering.Client namespace URSoldering.Client
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!