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
......
......@@ -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;
......
......@@ -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!