Commit fa888d67 几米阳光

代码修改

1 个父辈 c00f7091
......@@ -477,14 +477,14 @@ namespace URSoldering.Common
/// </summary>
/// <param name="bytes"></param>
/// <returns></returns>
public static string byteToHexStr(byte[] bytes)
public static string byteToHexStr(byte[] bytes,string spilt)
{
string returnStr = "";
if (bytes != null)
{
for (int i = 0; i < bytes.Length; i++)
{
returnStr += bytes[i].ToString("X2");
returnStr += bytes[i].ToString("X2")+spilt;
}
}
return returnStr;
......
......@@ -28,8 +28,7 @@ namespace URSoldering.DeviceLibrary
}
public bool RobotReset()
{
{
alarmType = AlarmType.None;
mainTimer.Enabled = false;
ledTimer.Enabled = false;
......@@ -69,8 +68,7 @@ namespace URSoldering.DeviceLibrary
KNDIOMove(IO_Type.AlarmSingle, IO_VALUE.LOW);
KNDIOMove(IO_Type.WaitSingle, IO_VALUE.LOW);
KNDIOMove(IO_Type.DeviceRunON, IO_VALUE.LOW);
IsInProcess = false;
ledTimer.Enabled = true;
mainTimer.Enabled = true;
......@@ -85,8 +83,7 @@ namespace URSoldering.DeviceLibrary
WarnMsg = "收到急停信号,设备急停";
LogUtil.error(RobotName + WarnMsg);
IsInSuddendown = true;
Alarm(AlarmType.SuddenStop);
Alarm(AlarmType.SuddenStop);
}
private bool IsInProcess = false;
protected override void mainTimer_Elapsed(object sender, ElapsedEventArgs e)
......@@ -135,8 +132,7 @@ namespace URSoldering.DeviceLibrary
BusyProcess();
}
else if (Status.Equals(RobotStatus.LineMove))
{
{
}
}
}catch(Exception ex)
......@@ -177,8 +173,7 @@ namespace URSoldering.DeviceLibrary
LogUtil.error(LOGGER, "IOTimeOutProcess出错:" + ex.ToString());
}
}
private void StopMove()
{
KNDIOMove(IO_Type.DeviceRunON, IO_VALUE.LOW);
......
......@@ -72,10 +72,7 @@ namespace URSoldering.DeviceLibrary
LastSetpTime = DateTime.Now;
IsInWait = false;
WaitList = new List<WaitResultInfo>();
}
public List<WaitResultInfo> WaitList = new List<WaitResultInfo>();
}
public List<WaitResultInfo> WaitList = new List<WaitResultInfo>();
}
}
\ No newline at end of file
......@@ -46,12 +46,12 @@ namespace URSoldering.DeviceLibrary
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitShuoKe(int slvAddr, bool isR)
public static WaitResultInfo WaitSendWire(int MScends,bool isR)
{
WaitResultInfo wait = new WaitResultInfo();
wait.ShuoKeISReverse = isR;
wait.WaitType = 5;
wait.SlvAddr = (byte)slvAddr;
wait.WaitType = 5;
wait.TimeMSeconds = MScends;
wait.IsEnd = false;
return wait;
}
......@@ -91,7 +91,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; }
......@@ -236,8 +236,7 @@ namespace URSoldering.DeviceLibrary
Home_4_ToClear2 = 104,
Home_5_ToOrg = 105,
/// <summary>
/// 阻挡气缸上升
/// </summary>
......@@ -284,8 +283,7 @@ namespace URSoldering.DeviceLibrary
/// <summary>
///焊接结束处理: 流水线倒转,等待流水线入料口信号
/// </summary>
BUSY06_WaitInSingle = 1106,
BUSY06_WaitInSingle = 1106,
}
/// <summary>
/// 焊接点的时间记录
......
......@@ -104,8 +104,7 @@ namespace URSoldering.DeviceLibrary
{
WarnMsg = "连接UR机器人失败";
}
});
//SendWireManager.Init();
});
SolderingManager.Init(RobotConfig.JBC_Soldering_Port, RobotConfig.JBC_Soldering_Num);
SendWireManager.Init(RobotConfig.JBC_SendWire_Port);
......@@ -311,45 +310,36 @@ namespace URSoldering.DeviceLibrary
/// 检测送丝错误
/// </summary>
private static void CheckSendWireAlarm()
{
//preCheckSendWireTime = DateTime.Now;
////如果休眠了不需要处理
//if (RobotBean.KNDIOValue(IO_Type.SendWireLock).Equals(IO_VALUE.HIGH))
//{
// //停止送丝器
// SendWireManager.SuddownStop(RobotConfig.SendWire_Slv);
// WarnMsg = "送丝报警:卡丝";
// Alarm(AlarmType.SendWireAlarm);
// LogUtil.error(RobotName + WarnMsg);
// ISAlarmAndOk = false;
//}
//else if (RobotBean.KNDIOValue(IO_Type.SendWireNoWire).Equals(IO_VALUE.HIGH))
//{
// //停止送丝器
// SendWireManager.SuddownStop(RobotConfig.SendWire_Slv);
// WarnMsg = "送丝报警:没有锡丝";
// Alarm(AlarmType.SendWireAlarm);
// LogUtil.error(RobotName + WarnMsg);
// ISAlarmAndOk = false;
//}
//else
//{
// if (alarmType.Equals(AlarmType.SendWireAlarm) && IsInSudden.Equals(false) && IsNoAir.Equals(false))
// {
// if (ISAlarmAndOk)
// {
// 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 + "】秒,消除送丝器报警!");
// }
// }
// }
//}
{
preCheckSendWireTime = DateTime.Now;
//如果休眠了不需要处理
if (SendWireManager.IsAlarm())
{
SendWireManager.Reset();
if (SendWireManager.IsAlarm())
{
//停止送丝器
SendWireManager.StopSend();
WarnMsg = "送丝器报警";
Alarm(AlarmType.SendWireAlarm);
LogUtil.error(RobotName + WarnMsg);
}
}
else
{
if (alarmType.Equals(AlarmType.SendWireAlarm) && IsInSudden.Equals(false) && IsNoAir.Equals(false))
{
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>
/// 卡丝恢复功能,只有手动点了才会继续
......@@ -358,28 +348,24 @@ namespace URSoldering.DeviceLibrary
/// <returns></returns>
public static bool SendWireRecover(bool isNext)
{
//if (RobotBean.KNDIOValue(IO_Type.SendWireLock).Equals(IO_VALUE.HIGH))
//{
// LogUtil.info(RobotName + "卡丝恢复失败:仍在卡丝中!");
//}
//else if (RobotBean.KNDIOValue(IO_Type.SendWireNoWire).Equals(IO_VALUE.HIGH))
//{
// LogUtil.info(RobotName + "卡丝恢复失败:仍在无丝中!");
//}
//else
//{
// if (alarmType.Equals(AlarmType.SendWireAlarm) && IsInSudden.Equals(false) && IsNoAir.Equals(false))
// {
// if (WeldMoveStep.moveType.Equals(MoveType.Weld) && (isNext.Equals(false)))
// {
// LogUtil.info(RobotName + "开始卡丝恢复,重新此焊点的焊接 !");
// WeldMoveStep.NextMoveStep(MoveStep.Wait);
// }
// lastSendWireOkTime = DateTime.Now;
// LogUtil.info(RobotName + "开始卡丝恢复!");
// return true;
// }
//}
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)))
{
LogUtil.info(RobotName + "开始卡丝恢复,重新此焊点的焊接 !");
WeldMoveStep.NextMoveStep(MoveStep.Wait);
}
lastSendWireOkTime = DateTime.Now;
LogUtil.info(RobotName + "开始卡丝恢复!");
return true;
}
}
return false;
}
/// <summary>IsNeedMsg
......
using URSoldering.Common;
using URSoldering.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Threading;
namespace URSoldering.DeviceLibrary
......@@ -310,8 +308,8 @@ namespace URSoldering.DeviceLibrary
int speed = (int)WeldMoveStep.CurrPoint.startSendWireSpeed * SendWireXiShu;
WeldLog(" 慢速送丝,速度:" + speed + " :" + time.ToString() + "秒");
SendWireManager.SendWire( time, speed);
int ms = (int)(time * 1000);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitTime(ms));
int ms = (int)(time * 1000+100);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitSendWire(ms,false));
}
else
{
......@@ -327,8 +325,8 @@ namespace URSoldering.DeviceLibrary
if (time > 0)
{
SendWireManager.SendWire( time, speed);
int ms = (int)(time * 1000);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitTime(ms));
int ms = (int)(time * 1000+100);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitSendWire(ms,false));
}
}
public static void SolderingDown(bool isWait)
......@@ -416,7 +414,7 @@ namespace URSoldering.DeviceLibrary
{
if (span.TotalMilliseconds < wait.TimeMSeconds)
{
NotOkMsg = "时间["+wait.TimeMSeconds+"]毫秒";
NotOkMsg = "时间[" + wait.TimeMSeconds + "]毫秒";
isOk = false;
break;
}
......@@ -476,55 +474,32 @@ namespace URSoldering.DeviceLibrary
{
if (WeldMoveStep.ResetCount < 3)
{
//判断是否报警
isAlarm = SendWireManager.IsAlarm();
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)
{
SendWireManager.StopSend();
WeldMoveStep.ResetCount++;
SendWireManager.Reset();
//反向送丝
int speed = ConfigAppSettings.GetIntValue(Setting_Init.ReverseSendWireSpeed) * SendWireXiShu;
double times = (double)ConfigAppSettings.GetNumValue(Setting_Init.ReverseSendWireTime);
if (speed.Equals(0) || times <= 0)
double time = (double)ConfigAppSettings.GetNumValue(Setting_Init.ReverseSendWireTime);
if (speed.Equals(0) || time <= 0)
{
isAlarm = false;
LogUtil.error("焊接中第【" + WeldMoveStep.ResetCount + "】次 检测到" + msg + ", 速度【" + speed + "】时间【" + times + "】配置不完整,不反转处理");
LogUtil.error("焊接中第【" + WeldMoveStep.ResetCount + "】次 检测到送丝器报警, 速度【" + speed + "】时间【" + times + "】配置不完整,不反转处理");
}
else
{
LogUtil.error("焊接中第【" + WeldMoveStep.ResetCount + "】次 检测到" + msg + ", 开始反向送丝,速度【" + speed + "】时间【" + times + "】");
//WeldMoveStep.LastSetpTime = DateTime.Now;
//WeldMoveStep.WaitList.Clear();
////设置速度
//SendWireManager.SetMoveSpeed(RobotConfig.SendWire_Slv, speed);
//int shuokeRel = (int)times * speed;
//if (shuokeRel < 0)
//{
// shuokeRel = 0 - shuokeRel;
//}
LogUtil.error("焊接中第【" + WeldMoveStep.ResetCount + "】次 检测到送丝器报警, 开始反向送丝,速度【" + speed + "】时间【" + times + "】");
WeldMoveStep.LastSetpTime = DateTime.Now;
WeldMoveStep.WaitList.Clear();
//SendWireManager.RelativeMove(RobotConfig.SendWire_Slv, shuokeRel);
////硕科步进驱动走对应的相对位置
//WeldMoveStep.WaitList.Add(WaitResultInfo.WaitShuoKe(RobotConfig.SendWire_Slv, true));
//Thread.Sleep(100);
//SendWireManager.GetStatus(RobotConfig.SendWire_Slv);
SendWireManager.SendWireBack(time, speed);
int ms = (int)((time * 1000) + 100);
WeldMoveStep.WaitList.Add(WaitResultInfo.WaitSendWire(ms, false));
isOk = false;
}
}
......@@ -533,15 +508,13 @@ namespace URSoldering.DeviceLibrary
if (wait.ShuoKeISReverse.Equals(false) && isAlarm.Equals(false))
{
//if (!SendWireManager.IsMoveEnd(wait.SlvAddr, WeldMoveStep.LastSetpTime))
//{
// NotOkMsg = "送丝结束";
// isOk = false;
// SendWireManager.GetStatus(wait.SlvAddr);
// break;
//}
//else if (WeldMoveStep.OneWaitOk)
if (span.TotalMilliseconds < wait.TimeMSeconds)
{
NotOkMsg = "送丝时间[" + wait.TimeMSeconds + "]毫秒";
isOk = false;
break;
}
else if (WeldMoveStep.OneWaitOk)
{
isOk = true;
break;
......@@ -549,25 +522,19 @@ namespace URSoldering.DeviceLibrary
}
else if (wait.ShuoKeISReverse.Equals(true) && isAlarm.Equals(false))
{
//if (!SendWireManager.IsMoveEnd(wait.SlvAddr, WeldMoveStep.LastSetpTime))
//{
// NotOkMsg = "送丝反转";
// isOk = false;
// //TimeSpan getStatusSpan = DateTime.Now - preGetStatusTime;
// //if (getStatusSpan.TotalSeconds >= 1)
// //{
// // preGetStatusTime = DateTime.Now;
// //SendWireManager.GetStatus(wait.SlvAddr);
// //}
// break;
//}
//else
//{
// //反转已经停止,直接重新运行次步骤
// //MoveStep step = (MoveStep)((int)WeldMoveStep.moveStep - 1);
// LogUtil.info(RobotName + " 送丝反转结束,重新开始当前焊点焊接");
// WeldMoveStep.NextMoveStep(MoveStep.Wait);
//}
if (span.TotalMilliseconds < wait.TimeMSeconds)
{
NotOkMsg = "送丝时间[" + wait.TimeMSeconds + "]毫秒";
isOk = false;
break;
}
else
{
//反转已经停止,直接重新运行次步骤
//MoveStep step = (MoveStep)((int)WeldMoveStep.moveStep - 1);
LogUtil.info(RobotName + " 送丝反转结束,重新开始当前焊点焊接");
WeldMoveStep.NextMoveStep(MoveStep.Wait);
}
}
}
else if (wait.WaitType == 6)
......@@ -595,11 +562,11 @@ namespace URSoldering.DeviceLibrary
{
if (NotOkMsg.Equals(""))
{
WarnMsg = "等待超时[" + WeldMoveStep.moveType + "][" + WeldMoveStep.moveStep + "][" + NotOkMsg + "]已等待[" + Math.Round(span.TotalMinutes, 1) + "]分钟";
WarnMsg = "等待超时[" + WeldMoveStep.moveType + "][" + WeldMoveStep.moveStep + "][" + NotOkMsg + "]已等待[" + Math.Round(span.TotalMinutes, 1) + "]分钟";
}
else
{
WarnMsg = "等待超时[" + WeldMoveStep.moveType + "][" + WeldMoveStep.moveStep + "]已等待[" + Math.Round(span.TotalMinutes, 1) + "]分钟,";
WarnMsg = "等待超时[" + WeldMoveStep.moveType + "][" + WeldMoveStep.moveStep + "]已等待[" + Math.Round(span.TotalMinutes, 1) + "]分钟,";
foreach (WaitResultInfo wait in list)
{
WarnMsg = WarnMsg + "\r\n" + wait.ToStr();
......@@ -618,7 +585,7 @@ namespace URSoldering.DeviceLibrary
else
{
WeldMoveStep.EndStepWait();
}
}
}
private static void WeldLog(string str)
......
......@@ -16,10 +16,6 @@ namespace URSoldering.DeviceLibrary
/// 平均焊接时间
/// </summary>
public TimeSpan WeldTime = new TimeSpan(0);
//public SProgramInfo getProgram()
// {
// return SProgramManager.getByPartNum(PartNumber);
// }
/// <summary>
/// 电路板ID
/// </summary>
......@@ -194,44 +190,19 @@ namespace URSoldering.DeviceLibrary
public double RobotRX { get; set; }
public double RobotRY { 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>
public int preheatTemperature { get; set; }
/// <summary>
/// 预热温度上限
/// </summary>
public int preheatTemperatureMax { get; set; }
/// <summary>
/// 预热温度下限
/// </summary>
public int preheatTemperatureMin { get; set; }
public int preheatTemperatureMin { get; set; }
/// <summary>
/// 预热时间(秒)
/// </summary>
......@@ -284,28 +255,5 @@ namespace URSoldering.DeviceLibrary
/// </summary>
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
{
board.orgType = 1;
}
////如果未添加程序,自动添加
//if (board.getProgram() == null)
//{
// SProgramManager.addDefaultProgram(board.PartNumber,board.boardLength,board.boardWidth);
//}
boardList.Add(board);
}
if (isUpdate)
......
......@@ -12,8 +12,6 @@ namespace URSoldering.DeviceLibrary
{
public class RobotBean
{
//public string MesIp = ConfigAppSettings.GetValue(Setting_Init.Mes_IP);
//public int MesPort = ConfigAppSettings.GetIntValue(Setting_Init.Mes_Port);
/// <summary>
/// 报警或者警告信息
/// </summary>
......@@ -25,10 +23,6 @@ namespace URSoldering.DeviceLibrary
public static RobotConfig baseConfig = null;
public bool IsInSuddendown = false;
/// <summary>
/// 是否是排料模式,排料模式不扫码,工位不绑定条码,后面工位判断没有条码不需要工作
/// </summary>
//public bool IsOutWareMode = false;
/// <summary>
/// 不扫码工作
/// </summary>
public bool NoCodeWork = false;
......
......@@ -38,14 +38,6 @@ namespace URSoldering.DeviceLibrary
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, "加载配置完成!");
return robotConfig;
......@@ -68,7 +60,6 @@ namespace URSoldering.DeviceLibrary
{
//位置配置到文件中
string appPath = Application.StartupPath;
string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Robot_ConfigPath);
bool result = CSVConfigReader.SaveConfig(configFile, config);
if (!result)
......@@ -80,8 +71,7 @@ namespace URSoldering.DeviceLibrary
{
LOGGER.Error("出错:", ex);
}
}
}
}
}

using log4net;
using URSoldering.Common;
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System;
using System.IO.Ports;
using System.Reflection;
namespace URSoldering.DeviceLibrary
{
......@@ -36,20 +32,7 @@ namespace URSoldering.DeviceLibrary
private static string CMD_StartBackSend = "0010WSFD00000";
private static string CMD_StopSend = "0010WSSD00000";
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)
{
if (sb == null)
......@@ -155,6 +138,23 @@ namespace URSoldering.DeviceLibrary
}
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)
{
setSpeed(speed);
......@@ -225,7 +225,7 @@ namespace URSoldering.DeviceLibrary
}
message[message.Length - 1] = (byte)0x03;
ushort bcc = 0;
SerialBean.CalculateBCC(message, message.Length, out bcc);
AcSerialBean.CalculateBCC(message, message.Length, out bcc);
/**
* 读命令返回值包含数据域
......@@ -247,54 +247,11 @@ namespace URSoldering.DeviceLibrary
{
data = new byte[messageAll.Length - 5];
}
string str = SerialBean.byteToHexStr(messageAll);
LogUtil.info(" 【"+commandText+"】 转换后【"+str+"】");
//data = new byte[messageAll.Length];
sb.SendCommand(messageAll, ref data, 100, out isOk);
//string rawMsg = Encoding.ASCII.GetString(data, 100, data.Length);
string str = AcSerialBean.byteToHexStr(messageAll," ");
LogUtil.debug(" JBC送丝器【"+commandText+"】 转换后【"+str+"】");
sb.SendCommand(messageAll, ref data, 100, out isOk);
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)
{
string errMsg = "";
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using URSoldering.Common;
using System.IO.Ports;
using log4net;
......
......@@ -70,6 +70,12 @@
this.lblOriginX = new System.Windows.Forms.Label();
this.lblOriginY = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lblRobotRZ = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.lblRobotRY = new System.Windows.Forms.Label();
this.lblRobotRX = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.lblSpeed = new System.Windows.Forms.Label();
this.panel3 = new System.Windows.Forms.Panel();
this.btnPositionTest = new System.Windows.Forms.Button();
......@@ -79,12 +85,18 @@
this.btnStopDown = new System.Windows.Forms.Button();
this.btnGoHome = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.txtRobotZ = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtSpeed = new System.Windows.Forms.TextBox();
this.btnStopSend = new System.Windows.Forms.Button();
this.btnSendWire = new System.Windows.Forms.Button();
this.tckSpeed = new System.Windows.Forms.TrackBar();
this.txtRobotY = new System.Windows.Forms.Label();
this.btnWUp = new System.Windows.Forms.Button();
this.txtRobotX = new System.Windows.Forms.Label();
this.btnChange = new System.Windows.Forms.Button();
this.label12 = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.dgvList = new System.Windows.Forms.DataGridView();
......@@ -133,18 +145,8 @@
this.btnSStop = new System.Windows.Forms.Button();
this.btnWStop = new System.Windows.Forms.Button();
this.label14 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.txtRobotX = new System.Windows.Forms.Label();
this.txtRobotY = new System.Windows.Forms.Label();
this.lblRobotRZ = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.txtRobotZ = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.lblRobotRX = new System.Windows.Forms.Label();
this.lblRobotRY = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.txtSendWireLength = new System.Windows.Forms.TextBox();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picYDel)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picYAdd)).BeginInit();
......@@ -197,7 +199,7 @@
//
this.picYDel.BackColor = System.Drawing.Color.Transparent;
this.picYDel.Image = ((System.Drawing.Image)(resources.GetObject("picYDel.Image")));
this.picYDel.Location = new System.Drawing.Point(204, 51);
this.picYDel.Location = new System.Drawing.Point(187, 51);
this.picYDel.Name = "picYDel";
this.picYDel.Size = new System.Drawing.Size(45, 45);
this.picYDel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -210,7 +212,7 @@
//
this.picYAdd.BackColor = System.Drawing.Color.Transparent;
this.picYAdd.Image = ((System.Drawing.Image)(resources.GetObject("picYAdd.Image")));
this.picYAdd.Location = new System.Drawing.Point(126, 51);
this.picYAdd.Location = new System.Drawing.Point(109, 51);
this.picYAdd.Name = "picYAdd";
this.picYAdd.Size = new System.Drawing.Size(45, 45);
this.picYAdd.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -223,7 +225,7 @@
//
this.picXAdd.BackColor = System.Drawing.Color.Transparent;
this.picXAdd.Image = ((System.Drawing.Image)(resources.GetObject("picXAdd.Image")));
this.picXAdd.Location = new System.Drawing.Point(164, 11);
this.picXAdd.Location = new System.Drawing.Point(147, 11);
this.picXAdd.Name = "picXAdd";
this.picXAdd.Size = new System.Drawing.Size(45, 45);
this.picXAdd.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -236,7 +238,7 @@
//
this.picXDel.BackColor = System.Drawing.Color.Transparent;
this.picXDel.Image = ((System.Drawing.Image)(resources.GetObject("picXDel.Image")));
this.picXDel.Location = new System.Drawing.Point(164, 91);
this.picXDel.Location = new System.Drawing.Point(147, 91);
this.picXDel.Name = "picXDel";
this.picXDel.Size = new System.Drawing.Size(45, 45);
this.picXDel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -249,7 +251,7 @@
//
this.picZDel.BackColor = System.Drawing.Color.Transparent;
this.picZDel.Image = ((System.Drawing.Image)(resources.GetObject("picZDel.Image")));
this.picZDel.Location = new System.Drawing.Point(55, 94);
this.picZDel.Location = new System.Drawing.Point(38, 74);
this.picZDel.Name = "picZDel";
this.picZDel.Size = new System.Drawing.Size(45, 45);
this.picZDel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -262,20 +264,21 @@
//
this.picUDel.BackColor = System.Drawing.Color.Transparent;
this.picUDel.Image = ((System.Drawing.Image)(resources.GetObject("picUDel.Image")));
this.picUDel.Location = new System.Drawing.Point(76, 3);
this.picUDel.Location = new System.Drawing.Point(59, -17);
this.picUDel.Name = "picUDel";
this.picUDel.Size = new System.Drawing.Size(45, 45);
this.picUDel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picUDel.TabIndex = 321;
this.picUDel.TabStop = false;
this.toolTip1.SetToolTip(this.picUDel, "逆时针旋转");
this.picUDel.Visible = false;
this.picUDel.Click += new System.EventHandler(this.btnUDel_Click);
//
// picZAdd
//
this.picZAdd.BackColor = System.Drawing.Color.Transparent;
this.picZAdd.Image = ((System.Drawing.Image)(resources.GetObject("picZAdd.Image")));
this.picZAdd.Location = new System.Drawing.Point(55, 49);
this.picZAdd.Location = new System.Drawing.Point(38, 29);
this.picZAdd.Name = "picZAdd";
this.picZAdd.Size = new System.Drawing.Size(45, 45);
this.picZAdd.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -288,13 +291,14 @@
//
this.picUAdd.BackColor = System.Drawing.Color.Transparent;
this.picUAdd.Image = ((System.Drawing.Image)(resources.GetObject("picUAdd.Image")));
this.picUAdd.Location = new System.Drawing.Point(30, 3);
this.picUAdd.Location = new System.Drawing.Point(13, -17);
this.picUAdd.Name = "picUAdd";
this.picUAdd.Size = new System.Drawing.Size(45, 45);
this.picUAdd.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picUAdd.TabIndex = 319;
this.picUAdd.TabStop = false;
this.toolTip1.SetToolTip(this.picUAdd, "顺时针旋转");
this.picUAdd.Visible = false;
this.picUAdd.Click += new System.EventHandler(this.btnUAdd_Click);
//
// contextMenuStrip2
......@@ -582,6 +586,8 @@
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.txtSendWireLength);
this.groupBox2.Controls.Add(this.lblRobotRZ);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.label8);
......@@ -617,10 +623,64 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "机器人实时坐标";
//
// lblRobotRZ
//
this.lblRobotRZ.AutoSize = true;
this.lblRobotRZ.Location = new System.Drawing.Point(135, 106);
this.lblRobotRZ.Name = "lblRobotRZ";
this.lblRobotRZ.Size = new System.Drawing.Size(15, 17);
this.lblRobotRZ.TabIndex = 324;
this.lblRobotRZ.Text = "0";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(99, 106);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(35, 17);
this.label7.TabIndex = 321;
this.label7.Text = "RZ:";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(99, 33);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(36, 17);
this.label8.TabIndex = 319;
this.label8.Text = "RX:";
//
// lblRobotRY
//
this.lblRobotRY.AutoSize = true;
this.lblRobotRY.Location = new System.Drawing.Point(136, 69);
this.lblRobotRY.Name = "lblRobotRY";
this.lblRobotRY.Size = new System.Drawing.Size(15, 17);
this.lblRobotRY.TabIndex = 323;
this.lblRobotRY.Text = "0";
//
// lblRobotRX
//
this.lblRobotRX.AutoSize = true;
this.lblRobotRX.Location = new System.Drawing.Point(135, 33);
this.lblRobotRX.Name = "lblRobotRX";
this.lblRobotRX.Size = new System.Drawing.Size(15, 17);
this.lblRobotRX.TabIndex = 322;
this.lblRobotRX.Text = "0";
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(99, 69);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(35, 17);
this.label16.TabIndex = 320;
this.label16.Text = "RY:";
//
// lblSpeed
//
this.lblSpeed.AutoSize = true;
this.lblSpeed.Location = new System.Drawing.Point(182, 114);
this.lblSpeed.Location = new System.Drawing.Point(182, 123);
this.lblSpeed.Name = "lblSpeed";
this.lblSpeed.Size = new System.Drawing.Size(95, 17);
this.lblSpeed.TabIndex = 315;
......@@ -637,16 +697,16 @@
this.panel3.Controls.Add(this.picUDel);
this.panel3.Controls.Add(this.picZAdd);
this.panel3.Controls.Add(this.picUAdd);
this.panel3.Location = new System.Drawing.Point(246, 46);
this.panel3.Location = new System.Drawing.Point(258, 46);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(287, 138);
this.panel3.Size = new System.Drawing.Size(250, 138);
this.panel3.TabIndex = 259;
//
// btnPositionTest
//
this.btnPositionTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnPositionTest.FlatAppearance.BorderSize = 0;
this.btnPositionTest.Location = new System.Drawing.Point(564, 145);
this.btnPositionTest.Location = new System.Drawing.Point(545, 145);
this.btnPositionTest.Name = "btnPositionTest";
this.btnPositionTest.Size = new System.Drawing.Size(100, 35);
this.btnPositionTest.TabIndex = 318;
......@@ -670,7 +730,7 @@
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(698, 115);
this.lblMsg.Location = new System.Drawing.Point(676, 152);
this.lblMsg.Name = "lblMsg";
this.lblMsg.Size = new System.Drawing.Size(65, 19);
this.lblMsg.TabIndex = 260;
......@@ -680,7 +740,7 @@
//
this.btnSavePoint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSavePoint.FlatAppearance.BorderSize = 0;
this.btnSavePoint.Location = new System.Drawing.Point(769, 115);
this.btnSavePoint.Location = new System.Drawing.Point(778, 146);
this.btnSavePoint.Name = "btnSavePoint";
this.btnSavePoint.Size = new System.Drawing.Size(68, 32);
this.btnSavePoint.TabIndex = 30;
......@@ -693,11 +753,11 @@
//
this.btnStopDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnStopDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStopDown.Location = new System.Drawing.Point(564, 57);
this.btnStopDown.Location = new System.Drawing.Point(545, 57);
this.btnStopDown.Name = "btnStopDown";
this.btnStopDown.Size = new System.Drawing.Size(100, 35);
this.btnStopDown.TabIndex = 317;
this.btnStopDown.Text = "阻挡气缸上升";
this.btnStopDown.Text = "送丝工作端";
this.btnStopDown.UseVisualStyleBackColor = true;
this.btnStopDown.Click += new System.EventHandler(this.btnStopDown_Click);
//
......@@ -705,7 +765,7 @@
//
this.btnGoHome.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnGoHome.FlatAppearance.BorderSize = 0;
this.btnGoHome.Location = new System.Drawing.Point(564, 101);
this.btnGoHome.Location = new System.Drawing.Point(545, 101);
this.btnGoHome.Name = "btnGoHome";
this.btnGoHome.Size = new System.Drawing.Size(100, 35);
this.btnGoHome.TabIndex = 35;
......@@ -719,32 +779,59 @@
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label5.Location = new System.Drawing.Point(696, 34);
this.label5.Location = new System.Drawing.Point(677, 25);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(97, 17);
this.label5.TabIndex = 276;
this.label5.Text = "送丝速度/毫米:";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtRobotZ
//
this.txtRobotZ.AutoSize = true;
this.txtRobotZ.Location = new System.Drawing.Point(36, 106);
this.txtRobotZ.Name = "txtRobotZ";
this.txtRobotZ.Size = new System.Drawing.Size(15, 17);
this.txtRobotZ.TabIndex = 26;
this.txtRobotZ.Text = "0";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(12, 106);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(27, 17);
this.label13.TabIndex = 7;
this.label13.Text = "Z:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 33);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(28, 17);
this.label1.TabIndex = 1;
this.label1.Text = "X:";
//
// txtSpeed
//
this.txtSpeed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
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(797, 31);
this.txtSpeed.MaxLength = 10;
this.txtSpeed.Location = new System.Drawing.Point(778, 22);
this.txtSpeed.MaxLength = 6;
this.txtSpeed.Name = "txtSpeed";
this.txtSpeed.Size = new System.Drawing.Size(40, 23);
this.txtSpeed.Size = new System.Drawing.Size(66, 23);
this.txtSpeed.TabIndex = 275;
this.txtSpeed.Text = "3";
this.txtSpeed.Text = "10";
//
// btnStopSend
//
this.btnStopSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnStopSend.Enabled = false;
this.btnStopSend.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStopSend.Location = new System.Drawing.Point(769, 66);
this.btnStopSend.Location = new System.Drawing.Point(769, 92);
this.btnStopSend.Name = "btnStopSend";
this.btnStopSend.Size = new System.Drawing.Size(71, 34);
this.btnStopSend.Size = new System.Drawing.Size(75, 34);
this.btnStopSend.TabIndex = 274;
this.btnStopSend.Text = "停止送丝";
this.btnStopSend.UseVisualStyleBackColor = true;
......@@ -755,9 +842,9 @@
this.btnSendWire.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSendWire.Enabled = false;
this.btnSendWire.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSendWire.Location = new System.Drawing.Point(695, 66);
this.btnSendWire.Location = new System.Drawing.Point(676, 92);
this.btnSendWire.Name = "btnSendWire";
this.btnSendWire.Size = new System.Drawing.Size(71, 34);
this.btnSendWire.Size = new System.Drawing.Size(75, 34);
this.btnSendWire.TabIndex = 273;
this.btnSendWire.Text = "开始送丝";
this.btnSendWire.UseVisualStyleBackColor = true;
......@@ -774,31 +861,58 @@
this.tckSpeed.Value = 3;
this.tckSpeed.ValueChanged += new System.EventHandler(this.tckSpeed_ValueChanged);
//
// txtRobotY
//
this.txtRobotY.AutoSize = true;
this.txtRobotY.Location = new System.Drawing.Point(37, 69);
this.txtRobotY.Name = "txtRobotY";
this.txtRobotY.Size = new System.Drawing.Size(15, 17);
this.txtRobotY.TabIndex = 22;
this.txtRobotY.Text = "0";
//
// btnWUp
//
this.btnWUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnWUp.Enabled = false;
this.btnWUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnWUp.Location = new System.Drawing.Point(564, 13);
this.btnWUp.Location = new System.Drawing.Point(545, 13);
this.btnWUp.Name = "btnWUp";
this.btnWUp.Size = new System.Drawing.Size(100, 35);
this.btnWUp.TabIndex = 254;
this.btnWUp.Text = "送丝上升";
this.btnWUp.Text = "烙铁上升";
this.btnWUp.UseVisualStyleBackColor = true;
this.btnWUp.Click += new System.EventHandler(this.btnWUp_Click);
//
// txtRobotX
//
this.txtRobotX.AutoSize = true;
this.txtRobotX.Location = new System.Drawing.Point(36, 33);
this.txtRobotX.Name = "txtRobotX";
this.txtRobotX.Size = new System.Drawing.Size(15, 17);
this.txtRobotX.TabIndex = 20;
this.txtRobotX.Text = "0";
//
// btnChange
//
this.btnChange.FlatAppearance.BorderSize = 0;
this.btnChange.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnChange.Location = new System.Drawing.Point(246, 13);
this.btnChange.Location = new System.Drawing.Point(258, 13);
this.btnChange.Name = "btnChange";
this.btnChange.Size = new System.Drawing.Size(287, 32);
this.btnChange.Size = new System.Drawing.Size(250, 32);
this.btnChange.TabIndex = 31;
this.btnChange.Text = "切换到自动模式(&M)";
this.btnChange.UseVisualStyleBackColor = true;
this.btnChange.Click += new System.EventHandler(this.btnChange_Click);
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(10, 69);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(27, 17);
this.label12.TabIndex = 3;
this.label12.Text = "Y:";
//
// label25
//
this.label25.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
......@@ -1300,113 +1414,27 @@
this.label14.Text = "条形码";
this.label14.Visible = false;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(15, 69);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(27, 17);
this.label12.TabIndex = 3;
this.label12.Text = "Y:";
//
// txtRobotX
//
this.txtRobotX.AutoSize = true;
this.txtRobotX.Location = new System.Drawing.Point(41, 33);
this.txtRobotX.Name = "txtRobotX";
this.txtRobotX.Size = new System.Drawing.Size(15, 17);
this.txtRobotX.TabIndex = 20;
this.txtRobotX.Text = "0";
//
// txtRobotY
//
this.txtRobotY.AutoSize = true;
this.txtRobotY.Location = new System.Drawing.Point(42, 69);
this.txtRobotY.Name = "txtRobotY";
this.txtRobotY.Size = new System.Drawing.Size(15, 17);
this.txtRobotY.TabIndex = 22;
this.txtRobotY.Text = "0";
//
// lblRobotRZ
//
this.lblRobotRZ.AutoSize = true;
this.lblRobotRZ.Location = new System.Drawing.Point(127, 106);
this.lblRobotRZ.Name = "lblRobotRZ";
this.lblRobotRZ.Size = new System.Drawing.Size(15, 17);
this.lblRobotRZ.TabIndex = 324;
this.lblRobotRZ.Text = "0";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(17, 106);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(27, 17);
this.label13.TabIndex = 7;
this.label13.Text = "Z:";
//
// txtRobotZ
//
this.txtRobotZ.AutoSize = true;
this.txtRobotZ.Location = new System.Drawing.Point(41, 106);
this.txtRobotZ.Name = "txtRobotZ";
this.txtRobotZ.Size = new System.Drawing.Size(15, 17);
this.txtRobotZ.TabIndex = 26;
this.txtRobotZ.Text = "0";
// label6
//
// label16
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label6.Location = new System.Drawing.Point(676, 58);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(97, 17);
this.label6.TabIndex = 326;
this.label6.Text = "送丝长度/毫米:";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(91, 69);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(35, 17);
this.label16.TabIndex = 320;
this.label16.Text = "RY:";
// txtSendWireLength
//
// lblRobotRX
//
this.lblRobotRX.AutoSize = true;
this.lblRobotRX.Location = new System.Drawing.Point(127, 33);
this.lblRobotRX.Name = "lblRobotRX";
this.lblRobotRX.Size = new System.Drawing.Size(15, 17);
this.lblRobotRX.TabIndex = 322;
this.lblRobotRX.Text = "0";
//
// lblRobotRY
//
this.lblRobotRY.AutoSize = true;
this.lblRobotRY.Location = new System.Drawing.Point(128, 69);
this.lblRobotRY.Name = "lblRobotRY";
this.lblRobotRY.Size = new System.Drawing.Size(15, 17);
this.lblRobotRY.TabIndex = 323;
this.lblRobotRY.Text = "0";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(91, 33);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(36, 17);
this.label8.TabIndex = 319;
this.label8.Text = "RX:";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(91, 106);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(35, 17);
this.label7.TabIndex = 321;
this.label7.Text = "RZ:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(15, 33);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(28, 17);
this.label1.TabIndex = 1;
this.label1.Text = "X:";
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(777, 55);
this.txtSendWireLength.MaxLength = 6;
this.txtSendWireLength.Name = "txtSendWireLength";
this.txtSendWireLength.Size = new System.Drawing.Size(67, 23);
this.txtSendWireLength.TabIndex = 325;
this.txtSendWireLength.Text = "10";
//
// FrmBoardInfo
//
......@@ -1570,5 +1598,7 @@
private System.Windows.Forms.Label txtRobotY;
private System.Windows.Forms.Label txtRobotX;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtSendWireLength;
}
}
\ No newline at end of file
......@@ -2,17 +2,10 @@
using log4net;
using URSoldering.Common;
using URSoldering.DeviceLibrary;
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.Text;
using System.Threading;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using URSoldering.Common.util;
using System.IO;
......@@ -930,11 +923,7 @@ namespace URSoldering.Client
/// <param name="sender"></param>
/// <param name="e"></param>
private void dgvList_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
/**
* 当单元格数据改变时(XY值)
* 调用改变图片上的点方法
*/
{
if (this.txtBoardWidth.Text.Trim() != "" && this.txtBoardLength.Text.Trim() != "")
{
loadPictureBoxSize();
......@@ -1216,110 +1205,64 @@ namespace URSoldering.Client
}
private void btnXAdd_Click(object sender, EventArgs e)
private void RovotMove(URPointValue point)
{
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
}
URRobotControl.MoveTo(point);
}
private void btnXAdd_Click(object sender, EventArgs e)
{
URPointValue point = GetCurrRobotPoint();
point.Y += StepValue;
URRobotControl.MoveTo(point);
RovotMove(point);
}
private void btnXDel_Click(object sender, EventArgs e)
{
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
{
URPointValue point = GetCurrRobotPoint();
point.Y -= StepValue;
URRobotControl.MoveTo(point);
RovotMove(point);
}
private void btnYDel_Click(object sender, EventArgs e)
{
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
{
URPointValue point = GetCurrRobotPoint();
point.X -= StepValue;
URRobotControl.MoveTo(point);
RovotMove(point);
}
private void btnYAdd_Click(object sender, EventArgs e)
{
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
{
URPointValue point = GetCurrRobotPoint();
point.X += StepValue;
URRobotControl.MoveTo(point);
RovotMove(point);
}
private void btnZAdd_Click(object sender, EventArgs e)
{
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
{
URPointValue point = GetCurrRobotPoint();
point.Z += StepValue;
URRobotControl.MoveTo(point);
RovotMove(point);
}
private void btnZDel_Click(object sender, EventArgs e)
{
if (isAuto == false)
{
MessageBox.Show("请先切换到自动模式!");
return;
}
{
URPointValue point = GetCurrRobotPoint();
point.Z -= StepValue;
URRobotControl.MoveTo(point);
RovotMove(point);
}
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)
{
//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)
......@@ -1486,9 +1429,11 @@ namespace URSoldering.Client
private void btnSendWire_Click(object sender, EventArgs e)
{
//匀速运动
int speed = FormUtil.GetIntValue(txtSpeed) * WeldRobotBean.SendWireXiShu;
//SendWireManager.VolMove(WeldRobotBean.RobotConfig.SendWire_Slv, speed);
double speed = FormUtil.getDoubleValue(txtSpeed);
double length = FormUtil.getDoubleValue(txtSendWireLength);
SendWireManager.setLength(length);
SendWireManager.setSpeed(speed);
SendWireManager.StartFSend();
}
private void btnStopSend_Click(object sender, EventArgs e)
......@@ -1498,25 +1443,18 @@ namespace URSoldering.Client
private void btnWUp_Click(object sender, EventArgs e)
{
if (btnWUp.Text.Equals("送丝上升"))
if (btnWUp.Text.Equals("烙铁上升"))
{
WeldRobotBean.SolderingUp(false);
btnWUp.Text = "送丝下降";
btnWUp.Text = "烙铁下降";
}
else
{
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)
{
......@@ -1577,24 +1515,16 @@ namespace URSoldering.Client
private void btnStopDown_Click(object sender, EventArgs e)
{
//if (btnStopDown.Text.Equals("阻挡气缸下降"))
//{
// RobotBean.KNDIOMove(IO_Type.StopCylinder_Down, IO_VALUE.HIGH);
// RobotBean.KNDIOMove(IO_Type.StopCylinder_Up, IO_VALUE.LOW);
// btnStopDown.Text = "阻挡气缸上升";
//}
//else
//{
// RobotBean.KNDIOMove(IO_Type.StopCylinder_Down, IO_VALUE.LOW);
// RobotBean.KNDIOMove(IO_Type.StopCylinder_Up, IO_VALUE.HIGH);
// btnStopDown.Text = "阻挡气缸下降";
//}
}
private void btnStopUp_Click(object sender, EventArgs e)
{
//RobotBean.KNDIOMove(IO_Type.StopCylinder_Down, IO_VALUE.LOW);
//RobotBean.KNDIOMove(IO_Type.StopCylinder_Up, IO_VALUE.HIGH);
if (btnStopDown.Text.Equals("送丝清洗端"))
{
WeldRobotBean.SendWireClear(false );
btnStopDown.Text = "送丝工作端";
}
else
{
WeldRobotBean.SendWireWork(false);
btnStopDown.Text = "送丝清洗端";
}
}
private void btnPositionTest_Click(object sender, EventArgs e)
......
using log4net;
using URSoldering.Common;
using URSoldering.Common.util;
using log4net;
using URSoldering.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.IO;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Reflection;
using System.Windows.Forms;
namespace URSoldering.Client
......@@ -50,7 +43,7 @@ namespace URSoldering.Client
//chValue.Text = "预热温度"; //设置列标题
//chValue.Width = 80; //设置列宽度
//chValue.TextAlign = HorizontalAlignment.Left; //设置列的对齐方式
//this.listPoint.Columns.Add(chValue); //将列头添加到ListView控件。
//this.listPoint.Columns.Add(chValue); //将列头添加到ListView控件。
ColumnHeader chStatus = new ColumnHeader();
chStatus.Text = "焊接温度"; //设置列标题
chStatus.Width = 80; //设置列宽度
......@@ -122,9 +115,7 @@ namespace URSoldering.Client
ListViewItem lvi = new ListViewItem();
lvi.ImageIndex = i;
lvi.Text = point.pointName;
//lvi.SubItems.Add(name);
//lvi.SubItems.Add(point.preheatTemperature.ToString());
lvi.Text = point.pointName;
lvi.SubItems.Add(point.weldTemperature.ToString());
lvi.SubItems.Add((point.startSendWireSpeed * point.startSendWireTime).ToString());
lvi.SubItems.Add((point.sendWireTime * point.sendWireSpeed).ToString());
......
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.Common;
using System.Collections.Generic;
using System.Windows.Forms;
using URSoldering.DeviceLibrary;
namespace URSoldering.Client
......@@ -40,19 +34,10 @@ namespace URSoldering.Client
if (liaohaoList.Count > 0)
{
cmbBoardList.SelectedIndex = 0;
}
}
int preIndex = -1;
}
}
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)
......@@ -79,8 +64,6 @@ namespace URSoldering.Client
}
this.Close();
}
}
}
using HalconDotNet;
using URSoldering.DeviceLibrary;
using URSoldering.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using URSoldering.DeviceLibrary;
using System;
using System.Windows.Forms;
using URSoldering.Common;
......
using HalconDotNet;

using URSoldering.Common;
using URSoldering.DeviceLibrary;
using URSoldering.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using URSoldering.DeviceLibrary;
using System;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
......
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.Common;
using System;
using URSoldering.DeviceLibrary;
namespace URSoldering.Client
{
public partial class FrmDebugMenu : FrmBase
......
......@@ -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.Location = new System.Drawing.Point(608, 440);
this.txtSendWireLength.MaxLength = 10;
this.txtSendWireLength.MaxLength = 6;
this.txtSendWireLength.Name = "txtSendWireLength";
this.txtSendWireLength.Size = new System.Drawing.Size(67, 23);
this.txtSendWireLength.TabIndex = 260;
this.txtSendWireLength.Text = "3";
this.txtSendWireLength.Text = "10";
//
// btnTestSend
//
......@@ -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.Location = new System.Drawing.Point(608, 403);
this.txtSpeed.MaxLength = 10;
this.txtSpeed.MaxLength = 6;
this.txtSpeed.Name = "txtSpeed";
this.txtSpeed.Size = new System.Drawing.Size(67, 23);
this.txtSpeed.TabIndex = 254;
this.txtSpeed.Text = "3";
this.txtSpeed.Text = "10";
//
// btnStopSend
//
......
......@@ -3,15 +3,8 @@
using URSoldering.Common;
using URSoldering.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Collections.Generic;
using System.Reflection;
using System.Windows.Forms;
using UserFromControl;
using URSoldering.LoadCSVLibrary;
......@@ -221,8 +214,8 @@ namespace URSoldering.Client
private void btnSendWire_Click(object sender, EventArgs e)
{
int speed = FormUtil.GetIntValue(txtSpeed);
int length = FormUtil.GetIntValue(txtSendWireLength);
double speed = FormUtil.getDoubleValue(txtSpeed);
double length = FormUtil.getDoubleValue(txtSendWireLength);
SendWireManager.setLength(length);
SendWireManager.setSpeed(speed);
SendWireManager.StartFSend();
......
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.Diagnostics;
using System.IO;
using System;
using System.Windows.Forms;
using URSoldering.Common;
using URSoldering.DeviceLibrary;
......
......@@ -2,25 +2,9 @@
using log4net;
using URSoldering.Common;
using URSoldering.DeviceLibrary;
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.Text;
using System.Threading;
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;
using System;
using System.Reflection;
using System.Windows.Forms;
namespace URSoldering.Client
{
......@@ -134,10 +118,7 @@ namespace URSoldering.Client
{
MessageBox.Show("请先切换到自动模式!");
return;
}
//RobotBean.KNDIOMove(IO_Type.SendWire_Down, IO_VALUE.LOW);
//RobotBean.KNDIOMove(IO_Type.SendWire_Up, IO_VALUE.HIGH);
}
URPointValue point = WeldRobotBean.HomePoint;
URRobotControl.MoveTo(point);
}
......
......@@ -29,12 +29,14 @@
private void InitializeComponent()
{
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.btnStop = new System.Windows.Forms.Button();
this.txtPortError = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.btnReadError = new System.Windows.Forms.Button();
this.lblMsg = new System.Windows.Forms.Label();
this.btnCloseForm = new System.Windows.Forms.Button();
this.btnStartBack = new System.Windows.Forms.Button();
this.txtLength = new System.Windows.Forms.TextBox();
......@@ -47,9 +49,7 @@
this.txtSoldingCom = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.btnOpenSold = new System.Windows.Forms.Button();
this.txtSend = new System.Windows.Forms.TextBox();
this.btnSend = new System.Windows.Forms.Button();
this.txtRevice = new System.Windows.Forms.TextBox();
this.lblMsg = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
......@@ -77,11 +77,42 @@
this.groupBox1.Controls.Add(this.btnOpenSold);
this.groupBox1.Location = new System.Drawing.Point(36, 36);
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.TabStop = false;
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
//
this.btnReset.Location = new System.Drawing.Point(440, 240);
......@@ -130,17 +161,6 @@
this.btnReadError.UseVisualStyleBackColor = true;
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
//
this.btnCloseForm.Location = new System.Drawing.Point(541, 315);
......@@ -254,33 +274,16 @@
this.btnOpenSold.UseVisualStyleBackColor = true;
this.btnOpenSold.Click += new System.EventHandler(this.btnOpenSold_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, 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
// lblMsg
//
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, 362);
this.txtRevice.Name = "txtRevice";
this.txtRevice.Size = new System.Drawing.Size(376, 23);
this.txtRevice.TabIndex = 302;
this.txtRevice.Text = "0";
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 = "急停未开";
//
// FrmSendWire
//
......
......@@ -19,12 +19,7 @@ namespace URSoldering.Client
}
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)
{
SendWireManager.StopSend();
......@@ -140,15 +135,7 @@ namespace URSoldering.Client
}
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 = "";
string text = txtSend.Text;
bool isOk = false;
......
......@@ -271,8 +271,7 @@ namespace URSoldering.Client
this.ClientSize = new System.Drawing.Size(750, 450);
this.Controls.Add(this.groupBox6);
this.Name = "FrmSoldDebug";
this.Text = "烙铁调试";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
this.Text = "烙铁调试";
this.Load += new System.EventHandler(this.FrmMain_Load);
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
......
using log4net;
using URSoldering.Common;
using log4net;
using URSoldering.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Forms;
using UserFromControl;
using System;
using System.Reflection;
using System.Windows.Forms;
namespace URSoldering.Client
{
......@@ -36,10 +26,7 @@ namespace URSoldering.Client
{
SoldStatus(false);
}
}
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
{
}
}
private void btnStopSend_Click(object sender, EventArgs e)
{
......
......@@ -19,8 +19,7 @@ namespace URSoldering.Client
{
public partial class FrmWork : FrmBase
{
private static string VideoCameraName = ConfigAppSettings.GetValue(Setting_Init.VideoCameraName);
//private static string CodeCameraName = ConfigAppSettings.GetValue(Setting_Init.CodeCameraName);
private static string VideoCameraName = ConfigAppSettings.GetValue(Setting_Init.VideoCameraName);
private URSolderingRobot Robot = null;
public FrmWork()
{
......
using URSoldering.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System;
using System.Windows.Forms;
namespace URSoldering.Client
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!