Commit 34145f02 几米阳光

修改配置 ,原来的四轴坐标改为六轴坐标

1 个父辈 9a750da5
...@@ -56,39 +56,37 @@ namespace URSoldering.Common ...@@ -56,39 +56,37 @@ namespace URSoldering.Common
/// <summary> /// <summary>
/// 焊接机器人待机点 /// 焊接机器人待机点
/// </summary> /// </summary>
public static string Soldering_Home_Y = "Soldering_Home_Y";
public static string Soldering_Home_X = "Soldering_Home_X"; public static string Soldering_HomePoint = "Soldering_HomePoint";
public static string Soldering_Home_U = "Soldering_Home_U";
public static string Soldering_Home_Z = "Soldering_Home_Z";
public static string Soldering_Home_Hand = "Soldering_Home_Hand";
/// <summary> /// <summary>
/// 焊接机器人清洗点1 /// 焊接机器人清洗点1
/// </summary> /// </summary>
public static string Soldering_Clear_Y_1 = "Soldering_Clear_Y_1"; public static string Soldering_Clear1Point = "Soldering_Clear1Point";
public static string Soldering_Clear_X_1 = "Soldering_Clear_X_1";
public static string Soldering_Clear_U_1 = "Soldering_Clear_U_1";
public static string Soldering_Clear_Z_1 = "Soldering_Clear_Z_1";
public static string Soldering_Clear_Hand_1 = "Soldering_Clear_Hand_1";
/// <summary> /// <summary>
/// 焊接机器人清洗点2 /// 焊接机器人清洗点2
/// </summary> /// </summary>
public static string Soldering_Clear_Y_2 = "Soldering_Clear_Y_2"; public static string Soldering_Clear2Point = "Soldering_Clear2Point";
public static string Soldering_Clear_X_2 = "Soldering_Clear_X_2"; /// <summary>
public static string Soldering_Clear_U_2 = "Soldering_Clear_U_2"; /// 机械臂最小范围
public static string Soldering_Clear_Z_2 = "Soldering_Clear_Z_2"; /// </summary>
public static string Soldering_Clear_Hand_2 = "Soldering_Clear_Hand_2"; public static string Soldering_RobotMin = "Soldering_RobotMin";
/// <summary>
/// 机械臂最小范围
/// </summary>
public static string Soldering_RobotMax = "Soldering_RobotMax";
public static string Soldering_LIM_Z = "Soldering_LIM_Z"; public static string Soldering_LIM_Z = "Soldering_LIM_Z";
public static string Soldering_U_Min = "Soldering_U_Min"; //public static string Soldering_U_Min = "Soldering_U_Min";
public static string Soldering_X_Min = "Soldering_X_Min"; //public static string Soldering_X_Min = "Soldering_X_Min";
public static string Soldering_Y_Min = "Soldering_Y_Min"; //public static string Soldering_Y_Min = "Soldering_Y_Min";
public static string Soldering_Z_Min = "Soldering_Z_Min"; //public static string Soldering_Z_Min = "Soldering_Z_Min";
public static string Soldering_U_Max = "Soldering_U_Max"; //public static string Soldering_U_Max = "Soldering_U_Max";
public static string Soldering_X_Max = "Soldering_X_Max"; //public static string Soldering_X_Max = "Soldering_X_Max";
public static string Soldering_Y_Max = "Soldering_Y_Max"; //public static string Soldering_Y_Max = "Soldering_Y_Max";
public static string Soldering_Z_Max = "Soldering_Z_Max"; //public static string Soldering_Z_Max = "Soldering_Z_Max";
public static string SendWire_Change = "SendWire_Change"; public static string SendWire_Change = "SendWire_Change";
public static string Slave_ID = "Slave_ID"; public static string Slave_ID = "Slave_ID";
......
...@@ -175,7 +175,7 @@ namespace URSoldering.DeviceLibrary ...@@ -175,7 +175,7 @@ namespace URSoldering.DeviceLibrary
} }
public WeldPointInfo(int hand) public WeldPointInfo(int hand)
{ {
this.HandDirection = hand; //this.HandDirection = hand;
} }
/// <summary> /// <summary>
...@@ -188,26 +188,33 @@ namespace URSoldering.DeviceLibrary ...@@ -188,26 +188,33 @@ namespace URSoldering.DeviceLibrary
/// </summary> /// </summary>
public string pointName { get; set; } public string pointName { get; set; }
/// <summary> public double RobotX { get; set; }
/// x坐标 public double RoobtY { get; set; }
/// </summary> public double RobotZ { get; set; }
public double PositionX { get; set; } public double RobotRX { get; set; }
/// <summary> public double RobotRY { get; set; }
/// y坐标 public double RobotRZ { get; set; }
/// </summary>
public double PositionY { get; set; } ///// <summary>
/// <summary> ///// x坐标
/// u坐标 ///// </summary>
/// </summary> //public double PositionX { get; set; }
public double PositionU { get; set; } ///// <summary>
/// <summary> ///// y坐标
/// z坐标 ///// </summary>
/// </summary> //public double PositionY { get; set; }
public double PositionZ { get; set; } ///// <summary>
/// <summary> ///// u坐标
/// 手臂方向,2=左臂L,1=右臂R ///// </summary>
/// </summary> //public double PositionU { get; set; }
public int HandDirection { get; set; } ///// <summary>
///// z坐标
///// </summary>
//public double PositionZ { get; set; }
///// <summary>
///// 手臂方向,2=左臂L,1=右臂R
///// </summary>
//public int HandDirection { get; set; }
/// <summary> /// <summary>
/// 预热温度 /// 预热温度
...@@ -277,28 +284,28 @@ namespace URSoldering.DeviceLibrary ...@@ -277,28 +284,28 @@ namespace URSoldering.DeviceLibrary
/// </summary> /// </summary>
public int ClearTime { get; set; } public int ClearTime { get; set; }
public string HandValue //public string HandValue
{ //{
get // get
{ // {
if (HandDirection == 0) // if (HandDirection == 0)
{ // {
return "自动"; // return "自动";
} // }
else if (HandDirection == 1) // else if (HandDirection == 1)
{ // {
return "右臂"; // return "右臂";
} // }
else if (HandDirection == 2) // else if (HandDirection == 2)
{ // {
return "左臂"; // return "左臂";
} // }
return ""; // return "";
} // }
set // set
{ // {
} // }
} //}
} }
} }
...@@ -63,11 +63,6 @@ namespace URSoldering.DeviceLibrary ...@@ -63,11 +63,6 @@ namespace URSoldering.DeviceLibrary
{ {
if (Status.Equals(RobotStatus.Reset)) if (Status.Equals(RobotStatus.Reset))
{ {
////复位,黄灯闪烁绿灯常亮,红灯亮时绿灯不亮
//if (KNDIOValue(IO_Type.AlarmSingle).Equals(IO_VALUE.HIGH))
//{
// KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.LOW);
//}
if (KNDIOValue(IO_Type.AutoRunSingle).Equals(IO_VALUE.LOW)) if (KNDIOValue(IO_Type.AutoRunSingle).Equals(IO_VALUE.LOW))
{ {
KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.HIGH); KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.HIGH);
...@@ -89,10 +84,6 @@ namespace URSoldering.DeviceLibrary ...@@ -89,10 +84,6 @@ namespace URSoldering.DeviceLibrary
{ {
KNDIOMove(IO_Type.WaitSingle, IO_VALUE.LOW); KNDIOMove(IO_Type.WaitSingle, IO_VALUE.LOW);
} }
//if (KNDIOValue(IO_Type.AlarmSingle).Equals(IO_VALUE.HIGH))
//{
// KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.LOW);
//}
if (KNDIOValue(IO_Type.AutoRunSingle).Equals(IO_VALUE.LOW)) if (KNDIOValue(IO_Type.AutoRunSingle).Equals(IO_VALUE.LOW))
{ {
KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.HIGH); KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.HIGH);
...@@ -105,10 +96,6 @@ namespace URSoldering.DeviceLibrary ...@@ -105,10 +96,6 @@ namespace URSoldering.DeviceLibrary
{ {
KNDIOMove(IO_Type.WaitSingle, IO_VALUE.LOW); KNDIOMove(IO_Type.WaitSingle, IO_VALUE.LOW);
} }
//if (KNDIOValue(IO_Type.AlarmSingle).Equals(IO_VALUE.HIGH))
//{
// KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.LOW);
//}
if (KNDIOValue(IO_Type.AutoRunSingle).Equals(IO_VALUE.HIGH)) if (KNDIOValue(IO_Type.AutoRunSingle).Equals(IO_VALUE.HIGH))
{ {
KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.LOW); KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.LOW);
......
...@@ -93,8 +93,11 @@ namespace URSoldering.DeviceLibrary ...@@ -93,8 +93,11 @@ namespace URSoldering.DeviceLibrary
public static void Release() public static void Release()
{ {
bool isOk = false; bool isOk = false;
if (sb != null)
{
parseCommand(CMD_StopSend, out isOk); parseCommand(CMD_StopSend, out isOk);
sb.closePort(); sb.closePort();
}
IsRun = false; IsRun = false;
} }
public static void Reset() public static void Reset()
...@@ -201,6 +204,11 @@ namespace URSoldering.DeviceLibrary ...@@ -201,6 +204,11 @@ namespace URSoldering.DeviceLibrary
} }
private static byte[] parseCommand(string commandText, out bool isOk) private static byte[] parseCommand(string commandText, out bool isOk)
{ {
if (sb == null)
{
isOk = false;
return null;
}
byte[] message = new byte[commandText.Length + 2]; byte[] message = new byte[commandText.Length + 2];
message[0] = (byte)2; message[0] = (byte)2;
for (int i = 1; i < commandText.Length + 1; i++) for (int i = 1; i < commandText.Length + 1; i++)
......
...@@ -70,6 +70,12 @@ namespace URSoldering.DeviceLibrary ...@@ -70,6 +70,12 @@ namespace URSoldering.DeviceLibrary
} }
return StartConnect(); return StartConnect();
} }
public static string Start()
{
return "";
}
private static bool StartConnect() private static bool StartConnect()
{ {
try try
...@@ -235,17 +241,51 @@ namespace URSoldering.DeviceLibrary ...@@ -235,17 +241,51 @@ namespace URSoldering.DeviceLibrary
LogUtil.error("StopEpson出错啦" + ex.ToString()); LogUtil.error("StopEpson出错啦" + ex.ToString());
} }
} }
public static void GetPosition(Action<double, double, double, double, int> afterGet)
{
}
public static void FreeAxis()
{
}
public static void MoveTo(URPointValue point)
{
}
public static void MoveTo(double x, double y, double z, double rx, double ry, double rz)
{
}
public static void LockAxis()
{
}
public static URPointValue GetLastPosition()
{
return new URPointValue();
}
} }
public class URPointValue public class URPointValue
{ {
public URPointValue(double x, double y, double u, double z, int handDir) public URPointValue()
{
this.X = 0;
this.Y = 0;
this.Z = 0;
this.RX = 0;
this.RY = 0;
this.RZ = 0;
this.UpdateTime = DateTime.Now;
}
public URPointValue(double x, double y, double z, double rx,double ry,double rz)
{ {
// TODO: Complete member initialization // TODO: Complete member initialization
this.X = x; this.X = x;
this.Y = y; this.Y = y;
this.U = u;
this.Z = z; this.Z = z;
this.HandDir = handDir; this.RX = rx;
this.RY = ry;
this.RZ = rz;
this.UpdateTime = DateTime.Now; this.UpdateTime = DateTime.Now;
} }
/// <summary> /// <summary>
...@@ -254,9 +294,26 @@ namespace URSoldering.DeviceLibrary ...@@ -254,9 +294,26 @@ namespace URSoldering.DeviceLibrary
public DateTime UpdateTime { get; set; } public DateTime UpdateTime { get; set; }
public double X { get; set; } public double X { get; set; }
public double Y { get; set; } public double Y { get; set; }
public double U { get; set; }
public double Z { get; set; } public double Z { get; set; }
public int HandDir { get; set; } public double RX { get; set; }
public double RY { get; set; }
public double RZ { get; set; }
public string ToShowStr()
{
return "[X: " + X + ",Y: " + Y + ",Z: " + Z + ",RX: " + RX + ",RY:" + RY + ",RZ:" + RZ+"]" ;
}
public string ToJosonStr()
{
string jsonStr = JsonHelper.SerializeObject(this);
return jsonStr;
}
public static URPointValue ToObject(string json)
{
return JsonHelper.DeserializeJsonToObject<URPointValue>(json);
}
} }
public struct URStatus public struct URStatus
{ {
......
...@@ -113,24 +113,5 @@ namespace URSoldering.DeviceLibrary ...@@ -113,24 +113,5 @@ namespace URSoldering.DeviceLibrary
} }
} }
public static void GetPosition(Action<double, double, double, double, int> afterGet)
{
throw new NotImplementedException();
}
public static void FreeAxis()
{
throw new NotImplementedException();
}
public static void MoveTo(double x, double y, double z, double u, bool isfast, int hand, Action<string> afterMove)
{
throw new NotImplementedException();
}
public static void LockAxis()
{
throw new NotImplementedException();
}
} }
} }
...@@ -478,6 +478,26 @@ ...@@ -478,6 +478,26 @@
<metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>611, 17</value> <value>611, 17</value>
</metadata> </metadata>
<data name="dataGridViewImageColumn1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAANRJREFUSEvtk8ENhSAMQBnAgHplD/c/w8UN1Dkg4adESJWKlsM/8ZIm0FIekCDC
n+iiZtgia20MLizRvu9BCBEDxhw+i7CkRfZJdBxHIUkBtS+8irZty5tqrckxrHmjKsLPNc9zzKU5ME1T
nr8946MIS5RSZ/YqAqCWcjUZKcISODUm5THjOOb8k6wQGWNyE75JItXuSClzDfa4U3TAZ4TF0EjxJAKG
YYg16kOTHeu6Bu/9ObtSEznnYi8F3VGhJqrRRV2UYXcsyxKDC/9ojXRRIyH8ACKfopRlVag2AAAAAElF
TkSuQmCC
</value>
</data>
<data name="dataGridViewImageColumn2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAAONJREFUSEvtk00OhCAMRlkb49/We3j/tS70BuI1TAwzH8FOVQTrYla8pIkttg9I
UOZPJNFrxKKu62xIEYuUUjakJFESEd6OcRzNuq4uOxISbdtmpmly2ZFLR9/3dlCWZa5yJCQqy9KuYcaZ
S8cwDDQsz3NX/XEnqqqK1jDjjHdrWmtqwi45e51T1zXV0evDfwdfuKwoCle9ivhJ7iTgVgS4DLsGew6a
pqE8JAFBEZjnmYa1bev9xj8xoiKwLAsNPQfWnvBIBPg17hG7Ls5jEeAyiQSIRABvxPdOYohFb0milxjz
AeLDoohrNFdzAAAAAElFTkSuQmCC
</value>
</data>
<metadata name="Column_pointNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column_pointNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
...@@ -493,7 +513,13 @@ ...@@ -493,7 +513,13 @@
<metadata name="Column_Z.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column_Z.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column_U.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column_RX.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_RY.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_RZ.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column_preheatTemperature.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column_preheatTemperature.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
...@@ -538,9 +564,6 @@ ...@@ -538,9 +564,6 @@
<metadata name="Column_isClear.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column_isClear.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column_HandDirection.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_ClearTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column_ClearTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
...@@ -582,26 +605,6 @@ ...@@ -582,26 +605,6 @@
AeLDoohrNFdzAAAAAElFTkSuQmCC AeLDoohrNFdzAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="dataGridViewImageColumn1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAANRJREFUSEvtk8ENhSAMQBnAgHplD/c/w8UN1Dkg4adESJWKlsM/8ZIm0FIekCDC
n+iiZtgia20MLizRvu9BCBEDxhw+i7CkRfZJdBxHIUkBtS+8irZty5tqrckxrHmjKsLPNc9zzKU5ME1T
nr8946MIS5RSZ/YqAqCWcjUZKcISODUm5THjOOb8k6wQGWNyE75JItXuSClzDfa4U3TAZ4TF0EjxJAKG
YYg16kOTHeu6Bu/9ObtSEznnYi8F3VGhJqrRRV2UYXcsyxKDC/9ojXRRIyH8ACKfopRlVag2AAAAAElF
TkSuQmCC
</value>
</data>
<data name="dataGridViewImageColumn2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAAONJREFUSEvtk00OhCAMRlkb49/We3j/tS70BuI1TAwzH8FOVQTrYla8pIkttg9I
UOZPJNFrxKKu62xIEYuUUjakJFESEd6OcRzNuq4uOxISbdtmpmly2ZFLR9/3dlCWZa5yJCQqy9KuYcaZ
S8cwDDQsz3NX/XEnqqqK1jDjjHdrWmtqwi45e51T1zXV0evDfwdfuKwoCle9ivhJ7iTgVgS4DLsGew6a
pqE8JAFBEZjnmYa1bev9xj8xoiKwLAsNPQfWnvBIBPg17hG7Ls5jEeAyiQSIRABvxPdOYohFb0milxjz
AeLDoohrNFdzAAAAAElFTkSuQmCC
</value>
</data>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>35</value> <value>35</value>
</metadata> </metadata>
......
...@@ -226,9 +226,9 @@ namespace URSoldering.Client ...@@ -226,9 +226,9 @@ namespace URSoldering.Client
int index = 0; int index = 0;
foreach (WeldPointInfo weld in pointList) foreach (WeldPointInfo weld in pointList)
{ {
float x = (float)Math.Abs(weld.PositionX - orgX) * picBoard.Width / width - pointHight / 2; //float x = (float)Math.Abs(weld.PositionX - orgX) * picBoard.Width / width - pointHight / 2;
float y = (float)Math.Abs(weld.PositionY - orgY) * picBoard.Width / width - pointHight / 2; //float y = (float)Math.Abs(weld.PositionY - orgY) * picBoard.Width / width - pointHight / 2;
g.FillEllipse(Brushes.Red, x - pointHight / 2, y - pointHight / 2, pointHight, pointHight); //g.FillEllipse(Brushes.Red, x - pointHight / 2, y - pointHight / 2, pointHight, pointHight);
//if (index > 0) //if (index > 0)
//{ //{
// Pen p = new Pen(Color.Red, 2); // Pen p = new Pen(Color.Red, 2);
......
...@@ -30,23 +30,23 @@ namespace URSoldering.Client ...@@ -30,23 +30,23 @@ namespace URSoldering.Client
private void btnWelding_Click(object sender, EventArgs e) private void btnWelding_Click(object sender, EventArgs e)
{ {
//if (BoardManager.CurrBoard == null) if (BoardManager.CurrBoard == null)
//{ {
// if (BoardManager.boardList.Count > 0) if (BoardManager.boardList.Count > 0)
// { {
// BoardManager.UpdateCurrBoard(BoardManager.boardList[0].boardId); BoardManager.UpdateCurrBoard(BoardManager.boardList[0].boardId);
// } }
// else else
// { {
// MessageBox.Show("请先配置程序"); MessageBox.Show("请先配置程序");
// return; return;
// } }
//} }
//isClick = true; isClick = true;
//FrmWork fw = new FrmWork(); FrmWork fw = new FrmWork();
//this.Visible = false; ; this.Visible = false; ;
//fw.ShowDialog(); fw.ShowDialog();
//this.Visible = true; this.Visible = true;
} }
private void btnProduct_Click(object sender, EventArgs e) private void btnProduct_Click(object sender, EventArgs e)
...@@ -109,11 +109,11 @@ namespace URSoldering.Client ...@@ -109,11 +109,11 @@ namespace URSoldering.Client
private void btnAutoEdit_Click(object sender, EventArgs e) private void btnAutoEdit_Click(object sender, EventArgs e)
{ {
isClick = true; //isClick = true;
FrmAutoAddBoard info = new FrmAutoAddBoard(null); //FrmAutoAddBoard info = new FrmAutoAddBoard(null);
this.Visible = false; //this.Visible = false;
info.ShowDialog(); //info.ShowDialog();
this.Visible = true; //this.Visible = true;
} }
private void btnStart_Click(object sender, EventArgs e) private void btnStart_Click(object sender, EventArgs e)
......
...@@ -48,16 +48,14 @@ namespace URSoldering.Client ...@@ -48,16 +48,14 @@ namespace URSoldering.Client
LogUtil.error("进入焊接界面,发现WeldRobotBean自动运行中,关闭自动运行"); LogUtil.error("进入焊接界面,发现WeldRobotBean自动运行中,关闭自动运行");
WeldRobotBean.StopRun(); WeldRobotBean.StopRun();
} }
if (EpsonDevice.IsRun) if (URRobotControl.IsRun)
{ {
EpsonDevice.FreeAxis(); URRobotControl.FreeAxis();
URPointValue lastP = URRobotControl.GetLastPosition();
EpsonDevice.GetPosition(AfterGet); urRobotSControl1.ShowPoint(lastP);
} }
else else
{ {
//btnChange.Text = "机器人连接中。。。";
RobotStatus(false);
} }
isAuto = false; isAuto = false;
...@@ -66,60 +64,22 @@ namespace URSoldering.Client ...@@ -66,60 +64,22 @@ namespace URSoldering.Client
timer1.Elapsed += timer_Elapsed; timer1.Elapsed += timer_Elapsed;
timer1.Start(); timer1.Start();
timer2.Start(); timer2.Start();
}
private void AfterMove(string result)
{
}
private void AfterGet(double x, double y, double z, double u, int hand)
{
PointValue point = new PointValue(x, y, u, z, hand);
//PointValue point = EpsonDevice.LastPoint;
this.txtRobotX.Text = point.X.ToString();
this.txtRobotY.Text = point.Y.ToString();
this.txtRobotU.Text = point.U.ToString();
this.txtRobotZ.Text = point.Z.ToString();
string msg = WeldRobotBean.CheckEpsonPoint(point);
if (point.HandDir.Equals(1))
{
cmbHand.SelectedIndex = 0;
}
else
{
cmbHand.SelectedIndex = 1;
} }
if (point.X != 0 && isConnect == false)
{
EpsonDevice.FreeAxis();
isConnect = true;
RobotStatus(true);
}
}
private void RobotStatus(bool isConnect)
{
}
private bool isRun = false; private bool isRun = false;
private void timer_Elapsed(object sender, EventArgs e) private void timer_Elapsed(object sender, EventArgs e)
{ {
if (!EpsonDevice.IsRun && isRun.Equals(false)) if (!URRobotControl.IsRun && isRun.Equals(false))
{ {
Task.Factory.StartNew(delegate () Task.Factory.StartNew(delegate ()
{ {
string result = EpsonDevice.Start(); string result = URRobotControl.Start();
if (result != "") if (result != "")
{ {
LogUtil.info("连接失败:" + result); LogUtil.info("连接失败:" + result);
} }
else else
{ {
EpsonDevice.FreeAxis(); URRobotControl.FreeAxis();
isAuto = false; isAuto = false;
} }
}); });
...@@ -128,14 +88,14 @@ namespace URSoldering.Client ...@@ -128,14 +88,14 @@ namespace URSoldering.Client
} }
else else
{ {
//EpsonControl.FreeAxis(); URPointValue lastP = URRobotControl.GetLastPosition();
EpsonDevice.GetPosition(AfterGet); urRobotSControl1.ShowPoint(lastP);
} }
} }
private void FrmBoardInfo_FormClosing(object sender, FormClosingEventArgs e) private void FrmBoardInfo_FormClosing(object sender, FormClosingEventArgs e)
{ {
EpsonDevice.LockAxis(); URRobotControl.LockAxis();
timer2.Stop(); timer2.Stop();
timer1.Stop(); timer1.Stop();
UsbCameraHDevelop.CloseAllCamera(); UsbCameraHDevelop.CloseAllCamera();
...@@ -143,12 +103,12 @@ namespace URSoldering.Client ...@@ -143,12 +103,12 @@ namespace URSoldering.Client
private void btnRead_Click(object sender, EventArgs e) private void btnRead_Click(object sender, EventArgs e)
{ {
EpsonDevice.GetPosition(AfterGet); URPointValue lastP = URRobotControl.GetLastPosition();
} }
private void timer2_Tick(object sender, EventArgs e) private void timer2_Tick(object sender, EventArgs e)
{ {
if (EpsonDevice.IsRun) if (URRobotControl.IsRun)
{ {
} }
...@@ -164,12 +124,9 @@ namespace URSoldering.Client ...@@ -164,12 +124,9 @@ namespace URSoldering.Client
private void btnSetOrigin_Click(object sender, EventArgs e) private void btnSetOrigin_Click(object sender, EventArgs e)
{ {
saveOriginInfo(); URPointValue point = GetCurrRobotPoint();
} ConfigAppSettings.SaveValue(Setting_Init.BOARD_ORIGIN_X, point.X.ToString());
private void saveOriginInfo() ConfigAppSettings.SaveValue(Setting_Init.BOARD_ORIGIN_Y, point.Y.ToString());
{
ConfigAppSettings.SaveValue(Setting_Init.BOARD_ORIGIN_X, txtRobotX.Text);
ConfigAppSettings.SaveValue(Setting_Init.BOARD_ORIGIN_Y, txtRobotY.Text);
} }
private void btnGoHome_Click(object sender, EventArgs e) private void btnGoHome_Click(object sender, EventArgs e)
...@@ -182,97 +139,59 @@ namespace URSoldering.Client ...@@ -182,97 +139,59 @@ namespace URSoldering.Client
RobotBean.KNDIOMove(IO_Type.SendWire_Down, IO_VALUE.LOW); RobotBean.KNDIOMove(IO_Type.SendWire_Down, IO_VALUE.LOW);
RobotBean.KNDIOMove(IO_Type.SendWire_Up, IO_VALUE.HIGH); RobotBean.KNDIOMove(IO_Type.SendWire_Up, IO_VALUE.HIGH);
double x = WeldRobotBean.EpsonOrgX; URPointValue point = WeldRobotBean.HomePoint;
double y = WeldRobotBean.EpsonOrgY; URRobotControl.MoveTo(point);
double z = WeldRobotBean.EpsonOrgZ;
double u = WeldRobotBean.EpsonOrgU;
int hand = WeldRobotBean.EpsonOrgHandDir;
if (x != 0 && y != 0 && z != 0 && u != 0)
{
EpsonDevice.MoveTo(x, y, z, u, false, hand,AfterMove);
}
else
{
MessageBox.Show("原点坐标无效!");
}
} }
private void btnSaveHome_Click(object sender, EventArgs e) private void btnSaveHome_Click(object sender, EventArgs e)
{ {
double orgx = FormUtil.getDoubleValue(txtRobotX); URPointValue point = GetCurrRobotPoint();
double orgy = FormUtil.getDoubleValue(txtRobotY);
double orgu = FormUtil.getDoubleValue(txtRobotU);
double orgz = FormUtil.getDoubleValue(txtRobotZ);
//判断原点的Z轴
if (orgz > EpsonDevice.Robot_LIM_Z)
{
MessageBox.Show("保存失败,原点Z坐标(" + orgz + ")不能高于最高Z点(" + EpsonDevice.Robot_LIM_Z + ")");
return;
}
int hand =GetHand(); DialogResult result = ShowConfire(point, "原点");
DialogResult result = MessageBox.Show("是否将当前位置X:" + orgx + ",Y:" + orgy + ",U:" + orgu + ",Z:" + orgz + "," + cmbHand.Text + "保存为原点?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes)) if (result.Equals(DialogResult.Yes))
{ {
WeldRobotBean.UpdateOrgPoint(orgx, orgy, orgu, orgz, hand); WeldRobotBean.UpdateOrgPoint(point);
MessageBox.Show("保存原点成功!"); MessageBox.Show("保存原点成功!");
} }
} }
private int GetHand() private URPointValue GetCurrRobotPoint()
{
if (cmbHand.SelectedIndex >= 0)
{ {
return cmbHand.SelectedIndex + 1; return urRobotSControl1.GetPoint();
} }
else
{
return 0;
}
}
private void btnSetClear1_Click(object sender, EventArgs e) private void btnSetClear1_Click(object sender, EventArgs e)
{ {
double clearx = FormUtil.getDoubleValue(txtRobotX); URPointValue point = GetCurrRobotPoint();
double cleary = FormUtil.getDoubleValue(txtRobotY); DialogResult result = ShowConfire(point, "清洗点1");
double clearu = FormUtil.getDoubleValue(txtRobotU);
double clearz = FormUtil.getDoubleValue(txtRobotZ);
//判断原点的Z轴
if (clearz > EpsonDevice.Robot_LIM_Z)
{
MessageBox.Show("保存失败,清洗点1的Z坐标(" + clearz + ")不能高于最高Z点(" + EpsonDevice.Robot_LIM_Z + ")");
return;
}
int hand = GetHand();
DialogResult result = MessageBox.Show("是否将当前位置X:" + clearx + ",Y:" + cleary + ",U:" + clearu + ",Z:" + clearz + "," + cmbHand.Text + "保存为清洗点1?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes)) if (result.Equals(DialogResult.Yes))
{ {
WeldRobotBean.UpdateClear1Point(clearx, cleary, clearu, clearz, hand); WeldRobotBean.UpdateClear1Point(point);
MessageBox.Show("保存清洗点1成功!"); MessageBox.Show("保存清洗点1成功!");
} }
} }
private void btnSetClear2_Click(object sender, EventArgs e) private DialogResult ShowConfire(URPointValue point, string strMsg)
{ {
double clearx = FormUtil.getDoubleValue(txtRobotX);
double cleary = FormUtil.getDoubleValue(txtRobotY);
double clearu = FormUtil.getDoubleValue(txtRobotU);
double clearz = FormUtil.getDoubleValue(txtRobotZ);
//判断原点的Z轴 //判断原点的Z轴
if (clearz > EpsonDevice.Robot_LIM_Z) if (point.Z > URRobotControl.Robot_LIM_Z)
{ {
MessageBox.Show("保存失败,清洗点2的Z坐标(" + clearz + ")不能高于最高Z点(" + EpsonDevice.Robot_LIM_Z + ")"); MessageBox.Show("保存失败,"+ strMsg + "的Z坐标(" + point.Z + ")不能高于最高Z点(" + URRobotControl.Robot_LIM_Z + ")");
return; return DialogResult.Cancel;
}
DialogResult result = MessageBox.Show("是否将当前位置:" + point.ToShowStr() + "保存为" + strMsg + "?", "提示", MessageBoxButtons.YesNo);
return result;
} }
int hand = GetHand(); private void btnSetClear2_Click(object sender, EventArgs e)
DialogResult result = MessageBox.Show("是否将当前位置X:" + clearx + ",Y:" + cleary + ",U:" + clearu + ",Z:" + clearz + "," + cmbHand.Text + "保存为清洗点2?", "提示", MessageBoxButtons.YesNo); {
URPointValue point = GetCurrRobotPoint();
DialogResult result = ShowConfire(point, "清洗点2");
if (result.Equals(DialogResult.Yes)) if (result.Equals(DialogResult.Yes))
{ {
WeldRobotBean.UpdateClear2Point(clearx, cleary, clearu, clearz, hand); WeldRobotBean.UpdateClear2Point(point);
MessageBox.Show("保存清洗点2成功!"); MessageBox.Show("保存清洗点2成功!");
} }
} }
......
...@@ -42,39 +42,17 @@ namespace URSoldering.Client ...@@ -42,39 +42,17 @@ namespace URSoldering.Client
this.txtOriginX.Text = ConfigAppSettings.GetValue(Setting_Init.BOARD_ORIGIN_X); this.txtOriginX.Text = ConfigAppSettings.GetValue(Setting_Init.BOARD_ORIGIN_X);
this.txtOriginY.Text = ConfigAppSettings.GetValue(Setting_Init.BOARD_ORIGIN_Y); this.txtOriginY.Text = ConfigAppSettings.GetValue(Setting_Init.BOARD_ORIGIN_Y);
int ch = WeldRobotBean.SendWireXiShu; int ch = WeldRobotBean.SendWireXiShu;
//this.txtSpeed.Text = (double)ConfigAppSettings.GetIntValue(Setting_Init.ShuoKe_EndSpeed) / ch + "";
this.cmbOrgHand.SelectedIndex = WeldRobotBean.EpsonOrgHandDir;
txtOrgX.Text = WeldRobotBean.EpsonOrgX.ToString();
txtOrgY.Text = WeldRobotBean.EpsonOrgY.ToString();
txtOrgU.Text = WeldRobotBean.EpsonOrgU.ToString();
txtOrgZ.Text = WeldRobotBean.EpsonOrgZ.ToString();
txtLimZ.Text = ((double)ConfigAppSettings.GetNumValue(Setting_Init.Soldering_LIM_Z)).ToString(); txtLimZ.Text = ((double)ConfigAppSettings.GetNumValue(Setting_Init.Soldering_LIM_Z)).ToString();
txtsendWireSpeed.Text = ConfigAppSettings.GetValue(Setting_Init.ReverseSendWireSpeed); txtsendWireSpeed.Text = ConfigAppSettings.GetValue(Setting_Init.ReverseSendWireSpeed);
txtsendWireTime.Text = ConfigAppSettings.GetValue(Setting_Init.ReverseSendWireTime); txtsendWireTime.Text = ConfigAppSettings.GetValue(Setting_Init.ReverseSendWireTime);
txtClearU1.Text=WeldRobotBean.EpsonClearU1.ToString(); minControl.ShowPoint(WeldRobotBean.RobotMin);
txtClearX1.Text=WeldRobotBean.EpsonClearX1.ToString(); maxControl.ShowPoint(WeldRobotBean.RobotMax);
txtClearY1.Text = WeldRobotBean.EpsonClearY1.ToString();
txtClearZ1.Text = WeldRobotBean.EpsonClearZ1.ToString();
this.cmbClearHand1.SelectedIndex = WeldRobotBean.EpsonClearHandDir1;
txtClearU2.Text = WeldRobotBean.EpsonClearU2.ToString(); clear2Control.ShowPoint(WeldRobotBean.Clear2Point);
txtClearX2.Text = WeldRobotBean.EpsonClearX2.ToString(); clear1Control.ShowPoint(WeldRobotBean.Clear1Point);
txtClearY2.Text = WeldRobotBean.EpsonClearY2.ToString(); homeControl.ShowPoint(WeldRobotBean.HomePoint);
txtClearZ2.Text = WeldRobotBean.EpsonClearZ2.ToString();
this.cmbClearHand2.SelectedIndex = WeldRobotBean.EpsonClearHandDir2;
txtXMin.Text = WeldRobotBean.EpsonXMin.ToString();
txtYMin.Text = WeldRobotBean.EpsonYMin.ToString();
txtZMin.Text = WeldRobotBean.EpsonZMin.ToString();
txtUMin.Text = WeldRobotBean.EpsonUMin.ToString();
txtXMax.Text = WeldRobotBean.EpsonXMax.ToString();
txtYMax.Text = WeldRobotBean.EpsonYMax.ToString();
txtZMax.Text = WeldRobotBean.EpsonZMax.ToString();
txtUMax.Text = WeldRobotBean.EpsonUMax.ToString();
} }
private void saveValue() private void saveValue()
...@@ -111,94 +89,67 @@ namespace URSoldering.Client ...@@ -111,94 +89,67 @@ namespace URSoldering.Client
} }
int hand = cmbOrgHand.SelectedIndex; URPointValue homeP = homeControl.GetPoint();
double orgx=FormUtil.getDoubleValue(txtOrgX) ;
double orgy = FormUtil.getDoubleValue(txtOrgY);
double orgu = FormUtil.getDoubleValue(txtOrgU);
double orgz = FormUtil.getDoubleValue(txtOrgZ);
//判断原点的Z轴 //判断原点的Z轴
if (orgz > limz) if (homeP.Z > limz)
{ {
MessageBox.Show("待机点Z坐标不能高于最高Z点!"); MessageBox.Show("待机点Z坐标不能高于最高Z点!");
txtOrgZ.Focus(); homeControl.Focus();
txtOrgZ.SelectAll();
return; return;
} }
int clearHand1 = this.cmbClearHand1.SelectedIndex; URPointValue clear1P = clear1Control.GetPoint();
double clearx1 = FormUtil.getDoubleValue(txtClearX1);
double cleary1 = FormUtil.getDoubleValue(txtClearY1);
double clearu1 = FormUtil.getDoubleValue(txtClearU1);
double clearz1 = FormUtil.getDoubleValue(txtClearZ1);
//判断原点的Z轴 //判断原点的Z轴
if (clearz1 > limz) if (clear1P.Z > limz)
{ {
MessageBox.Show("清洗点1的Z坐标不能高于最高Z点!"); MessageBox.Show("清洗点1的Z坐标不能高于最高Z点!");
txtClearZ1.Focus(); clear1Control.Focus();
txtClearZ1.SelectAll();
return; return;
} }
URPointValue clear2P = clear2Control.GetPoint();
int clearHand2 = this.cmbClearHand2.SelectedIndex;
double clearx2 = FormUtil.getDoubleValue(txtClearX2);
double cleary2 = FormUtil.getDoubleValue(txtClearY2);
double clearu2 = FormUtil.getDoubleValue(txtClearU2);
double clearz2 = FormUtil.getDoubleValue(txtClearZ2);
//判断原点的Z轴 //判断原点的Z轴
if (clearz2 > limz) if (clear2P.Z > limz)
{ {
MessageBox.Show("清洗点2的Z坐标不能高于最高Z点!"); MessageBox.Show("清洗点2的Z坐标不能高于最高Z点!");
txtClearZ2.Focus(); clear2Control.Focus();
txtClearZ2.SelectAll();
return; return;
} }
double XMin = FormUtil.getDoubleValue(txtXMin); URPointValue minP = minControl.GetPoint();
double YMin = FormUtil.getDoubleValue(txtYMin); URPointValue maxP = maxControl.GetPoint();
double ZMin = FormUtil.getDoubleValue(txtZMin);
double UMin = FormUtil.getDoubleValue(txtUMin); //if (XMin > XMax)
//{
double XMax = FormUtil.getDoubleValue(txtXMax); // MessageBox.Show("请正确输入机械臂X轴范围!");
double YMax = FormUtil.getDoubleValue(txtYMax); // txtXMin.Focus();
double ZMax = FormUtil.getDoubleValue(txtZMax); // txtXMin.SelectAll();
double UMax = FormUtil.getDoubleValue(txtUMax); // return;
//}
if (XMin > XMax) //if (YMin > YMax)
{ //{
MessageBox.Show("请正确输入机械臂X轴范围!"); // MessageBox.Show("请正确输入机械臂Y轴范围!");
txtXMin.Focus(); // txtYMin.Focus();
txtXMin.SelectAll(); // txtYMin.SelectAll();
return; // return;
} //}
if (YMin > YMax) //if (ZMin > ZMax)
{ //{
MessageBox.Show("请正确输入机械臂Y轴范围!"); // MessageBox.Show("请正确输入机械臂Z轴范围!");
txtYMin.Focus(); // txtZMin.Focus();
txtYMin.SelectAll(); // txtZMin.SelectAll();
return; // return;
} //}
if (ZMin > ZMax) //if (UMin > UMax)
{ //{
MessageBox.Show("请正确输入机械臂Z轴范围!"); // MessageBox.Show("请正确输入机械臂U轴范围!");
txtZMin.Focus(); // txtUMin.Focus();
txtZMin.SelectAll(); // txtUMin.SelectAll();
return; // return;
} //}
if (UMin > UMax)
{ WeldRobotBean.UpdateOrgPoint(homeP);
MessageBox.Show("请正确输入机械臂U轴范围!"); WeldRobotBean.UpdateClear1Point(clear1P);
txtUMin.Focus(); WeldRobotBean.UpdateClear2Point(clear2P);
txtUMin.SelectAll();
return;
}
WeldRobotBean.UpdateOrgPoint(orgx, orgy, orgu, orgz, hand);
WeldRobotBean.UpdateClear1Point(clearx1, cleary1, clearu1, clearz1, clearHand1);
WeldRobotBean.UpdateClear2Point(clearx2, cleary2, clearu2, clearz2, clearHand2);
ConfigAppSettings.SaveValue(Setting_Init.Soldering_LIM_Z, limz.ToString()); ConfigAppSettings.SaveValue(Setting_Init.Soldering_LIM_Z, limz.ToString());
EpsonDevice.Robot_LIM_Z = limz; EpsonDevice.Robot_LIM_Z = limz;
...@@ -208,24 +159,10 @@ namespace URSoldering.Client ...@@ -208,24 +159,10 @@ namespace URSoldering.Client
ConfigAppSettings.SaveValue(Setting_Init.ReverseSendWireSpeed, sendWireSpeed); ConfigAppSettings.SaveValue(Setting_Init.ReverseSendWireSpeed, sendWireSpeed);
ConfigAppSettings.SaveValue(Setting_Init.ReverseSendWireTime, sendWireTime); ConfigAppSettings.SaveValue(Setting_Init.ReverseSendWireTime, sendWireTime);
WeldRobotBean.EpsonXMin = XMin; WeldRobotBean.RobotMin = minP;
WeldRobotBean.EpsonXMax = XMax; WeldRobotBean.RobotMax = maxP;
WeldRobotBean.EpsonYMin = YMin; ConfigAppSettings.SaveValue(Setting_Init.Soldering_RobotMin, minP.ToJosonStr());
WeldRobotBean.EpsonYMax = YMax; ConfigAppSettings.SaveValue(Setting_Init.Soldering_RobotMax, maxP.ToJosonStr());
WeldRobotBean.EpsonUMin = UMin;
WeldRobotBean.EpsonUMax = UMax;
WeldRobotBean.EpsonZMin = ZMin;
WeldRobotBean.EpsonZMax = ZMax;
ConfigAppSettings.SaveValue(Setting_Init.Soldering_X_Min, XMin.ToString());
ConfigAppSettings.SaveValue(Setting_Init.Soldering_Y_Min, YMin.ToString());
ConfigAppSettings.SaveValue(Setting_Init.Soldering_Z_Min, ZMin.ToString());
ConfigAppSettings.SaveValue(Setting_Init.Soldering_U_Min, UMin.ToString());
ConfigAppSettings.SaveValue(Setting_Init.Soldering_X_Max, XMax.ToString());
ConfigAppSettings.SaveValue(Setting_Init.Soldering_Y_Max, YMax.ToString());
ConfigAppSettings.SaveValue(Setting_Init.Soldering_Z_Max, ZMax.ToString());
ConfigAppSettings.SaveValue(Setting_Init.Soldering_U_Max, UMax.ToString());
MessageBox.Show("保存成功,需要重启之后才能生效!"); MessageBox.Show("保存成功,需要重启之后才能生效!");
this.Close(); this.Close();
......
...@@ -24,19 +24,14 @@ namespace URSoldering.Client ...@@ -24,19 +24,14 @@ namespace URSoldering.Client
cmbPointType.SelectedIndex = 0; cmbPointType.SelectedIndex = 0;
groupPoint.Text = "新增焊点"; groupPoint.Text = "新增焊点";
} }
public FrmWeldPointInfo(string name,double x,double y ,double u,double z,int hand) public FrmWeldPointInfo(string name,URPointValue point)
{ {
InitializeComponent(); InitializeComponent();
this.Text = "新增焊点"; this.Text = "新增焊点";
groupPoint.Text = "新增焊点"; groupPoint.Text = "新增焊点";
this.txtName.Text = name; this.txtName.Text = name;
cmbPointType.SelectedIndex = 0; cmbPointType.SelectedIndex = 0;
ShowPoint(point);
this.txtRobotU.Text = u.ToString();
this.txtRobotX.Text = x.ToString();
txtRobotY.Text = y.ToString();
txtRobotZ.Text = z.ToString();
this.cmbHand.SelectedIndex = hand;
this.txtClearTime.Text = WeldRobotBean.RobotConfig.ClearMSenconds.ToString(); this.txtClearTime.Text = WeldRobotBean.RobotConfig.ClearMSenconds.ToString();
} }
public FrmWeldPointInfo(WeldPointInfo weldPointInfo) public FrmWeldPointInfo(WeldPointInfo weldPointInfo)
...@@ -69,13 +64,7 @@ namespace URSoldering.Client ...@@ -69,13 +64,7 @@ namespace URSoldering.Client
{ {
this.txtClearTime.Text = weldPointInfo.ClearTime.ToString(); this.txtClearTime.Text = weldPointInfo.ClearTime.ToString();
} }
ShowPoint(new URPointValue(weldPointInfo.RobotX, weldPointInfo.RoobtY, weldPointInfo.RobotZ, weldPointInfo.RobotRX, weldPointInfo.RobotRY, weldPointInfo.RobotRZ));
this.txtRobotU.Text = weldPointInfo.PositionU.ToString();
this.txtRobotX.Text = weldPointInfo.PositionX.ToString();
txtRobotY.Text = weldPointInfo.PositionY.ToString();
txtRobotZ.Text = weldPointInfo.PositionZ.ToString();
this.cmbHand.SelectedIndex = weldPointInfo.HandDirection;
} }
private void btnSave_Click(object sender, EventArgs e) private void btnSave_Click(object sender, EventArgs e)
...@@ -232,11 +221,15 @@ namespace URSoldering.Client ...@@ -232,11 +221,15 @@ namespace URSoldering.Client
weldPointInfo.isNeedClear = chbClear.Checked; weldPointInfo.isNeedClear = chbClear.Checked;
weldPointInfo.ClearTime = clearTime; weldPointInfo.ClearTime = clearTime;
weldPointInfo.pointType = cmbPointType.SelectedIndex; weldPointInfo.pointType = cmbPointType.SelectedIndex;
weldPointInfo.PositionX = FormUtil.getDoubleValue(txtRobotX);
weldPointInfo.PositionY = FormUtil.getDoubleValue(txtRobotY); URPointValue p = urRobot.GetPoint();
weldPointInfo.PositionU = FormUtil.getDoubleValue(txtRobotU); weldPointInfo.RobotX = p.X;
weldPointInfo.PositionZ= FormUtil.getDoubleValue(txtRobotZ); weldPointInfo.RoobtY = p.Y;
weldPointInfo.HandDirection = cmbHand.SelectedIndex; weldPointInfo.RobotZ = p.Z;
weldPointInfo.RobotRX = p.RX;
weldPointInfo.RobotRY = p.RY;
weldPointInfo.RobotRZ = p.RZ;
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
...@@ -257,37 +250,23 @@ namespace URSoldering.Client ...@@ -257,37 +250,23 @@ namespace URSoldering.Client
private void btnUpdate_Click(object sender, EventArgs e) private void btnUpdate_Click(object sender, EventArgs e)
{ {
PointValue point = EpsonDevice.LastPoint; URPointValue point = URRobotControl.GetLastPosition();
double clearx = point.X;
double cleary = point.Y;
double clearu = point.U;
double clearz = point.Z;
//判断原点的Z轴 //判断原点的Z轴
if (clearz > EpsonDevice.Robot_LIM_Z) if (point.Z > EpsonDevice.Robot_LIM_Z)
{ {
MessageBox.Show("保存失败,焊点Z坐标(" + clearz + ")不能高于最高Z点(" + EpsonDevice.Robot_LIM_Z + ")"); MessageBox.Show("保存失败,焊点Z坐标(" + point.Z + ")不能高于最高Z点(" + EpsonDevice.Robot_LIM_Z + ")");
return; return;
} }
DialogResult result = MessageBox.Show("当前坐标:" +point.ToShowStr()+ ",是否确定更新?", "提示", MessageBoxButtons.YesNo);
int hand = point.HandDir; if (result.Equals(DialogResult.Yes))
string handStr = "自动";
if (hand == 1)
{ {
handStr = "右臂"; ShowPoint(point);
} }
else if (hand == 2)
{
handStr = "左臂";
} }
DialogResult result = MessageBox.Show("当前坐标:X:" + clearx + ",Y:" + cleary + ",Z:" + clearz + "," + ",U:" + clearu +",方向:"+ handStr + ",是否确定更新?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes)) private void ShowPoint(URPointValue point)
{ {
this.txtRobotU.Text = clearu.ToString(); urRobot.ShowPoint(point);
this.txtRobotX.Text = clearx.ToString();
this.txtRobotY.Text = cleary.ToString();
this.txtRobotZ.Text = clearz.ToString();
cmbHand.SelectedIndex = hand;
}
} }
private void chbClear_CheckedChanged(object sender, EventArgs e) private void chbClear_CheckedChanged(object sender, EventArgs e)
...@@ -302,9 +281,5 @@ namespace URSoldering.Client ...@@ -302,9 +281,5 @@ namespace URSoldering.Client
} }
} }
private void cmbPointType_SelectedIndexChanged(object sender, EventArgs e)
{
}
} }
} }
...@@ -85,12 +85,6 @@ ...@@ -85,12 +85,6 @@
<Compile Include="FrmBoardCopy.Designer.cs"> <Compile Include="FrmBoardCopy.Designer.cs">
<DependentUpon>FrmBoardCopy.cs</DependentUpon> <DependentUpon>FrmBoardCopy.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmAutoAddBoard.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmAutoAddBoard.Designer.cs">
<DependentUpon>FrmAutoAddBoard.cs</DependentUpon>
</Compile>
<Compile Include="FrmOrgConfig.cs"> <Compile Include="FrmOrgConfig.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -169,6 +163,12 @@ ...@@ -169,6 +163,12 @@
<Compile Include="FrmWeldPointInfo.Designer.cs"> <Compile Include="FrmWeldPointInfo.Designer.cs">
<DependentUpon>FrmWeldPointInfo.cs</DependentUpon> <DependentUpon>FrmWeldPointInfo.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmWork.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmWork.Designer.cs">
<DependentUpon>FrmWork.cs</DependentUpon>
</Compile>
<Compile Include="FrmWorkCount.cs"> <Compile Include="FrmWorkCount.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -183,9 +183,6 @@ ...@@ -183,9 +183,6 @@
<EmbeddedResource Include="FrmBoardCopy.resx"> <EmbeddedResource Include="FrmBoardCopy.resx">
<DependentUpon>FrmBoardCopy.cs</DependentUpon> <DependentUpon>FrmBoardCopy.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmAutoAddBoard.resx">
<DependentUpon>FrmAutoAddBoard.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmOrgConfig.resx"> <EmbeddedResource Include="FrmOrgConfig.resx">
<DependentUpon>FrmOrgConfig.cs</DependentUpon> <DependentUpon>FrmOrgConfig.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -225,6 +222,9 @@ ...@@ -225,6 +222,9 @@
<EmbeddedResource Include="FrmWeldPointInfo.resx"> <EmbeddedResource Include="FrmWeldPointInfo.resx">
<DependentUpon>FrmWeldPointInfo.cs</DependentUpon> <DependentUpon>FrmWeldPointInfo.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmWork.resx">
<DependentUpon>FrmWork.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmWorkCount.resx"> <EmbeddedResource Include="FrmWorkCount.resx">
<DependentUpon>FrmWorkCount.cs</DependentUpon> <DependentUpon>FrmWorkCount.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
namespace UserFromControl
{
partial class URRobotMControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label14 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.txtRY = new System.Windows.Forms.TextBox();
this.txtRZ = new System.Windows.Forms.TextBox();
this.label22 = new System.Windows.Forms.Label();
this.txtRX = new System.Windows.Forms.TextBox();
this.label18 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.txtRobotY = new System.Windows.Forms.TextBox();
this.txtRobotZ = new System.Windows.Forms.TextBox();
this.label20 = new System.Windows.Forms.Label();
this.txtRobotX = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(9, 118);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(29, 12);
this.label14.TabIndex = 84;
this.label14.Text = "RX:";
//
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(9, 190);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(29, 12);
this.label21.TabIndex = 82;
this.label21.Text = "RZ:";
//
// txtRY
//
this.txtRY.Location = new System.Drawing.Point(51, 150);
this.txtRY.MaxLength = 20;
this.txtRY.Name = "txtRY";
this.txtRY.Size = new System.Drawing.Size(101, 21);
this.txtRY.TabIndex = 87;
//
// txtRZ
//
this.txtRZ.Location = new System.Drawing.Point(51, 186);
this.txtRZ.MaxLength = 20;
this.txtRZ.Name = "txtRZ";
this.txtRZ.Size = new System.Drawing.Size(101, 21);
this.txtRZ.TabIndex = 83;
//
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(9, 154);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(29, 12);
this.label22.TabIndex = 86;
this.label22.Text = "RY:";
//
// txtRX
//
this.txtRX.Location = new System.Drawing.Point(51, 114);
this.txtRX.MaxLength = 20;
this.txtRX.Name = "txtRX";
this.txtRX.Size = new System.Drawing.Size(101, 21);
this.txtRX.TabIndex = 85;
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(9, 10);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(23, 12);
this.label18.TabIndex = 78;
this.label18.Text = "X:";
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(9, 82);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(23, 12);
this.label19.TabIndex = 76;
this.label19.Text = "Z:";
//
// txtRobotY
//
this.txtRobotY.Location = new System.Drawing.Point(51, 42);
this.txtRobotY.MaxLength = 20;
this.txtRobotY.Name = "txtRobotY";
this.txtRobotY.Size = new System.Drawing.Size(101, 21);
this.txtRobotY.TabIndex = 81;
//
// txtRobotZ
//
this.txtRobotZ.Location = new System.Drawing.Point(51, 78);
this.txtRobotZ.MaxLength = 20;
this.txtRobotZ.Name = "txtRobotZ";
this.txtRobotZ.Size = new System.Drawing.Size(101, 21);
this.txtRobotZ.TabIndex = 77;
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(9, 46);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(23, 12);
this.label20.TabIndex = 80;
this.label20.Text = "Y:";
//
// txtRobotX
//
this.txtRobotX.Location = new System.Drawing.Point(51, 6);
this.txtRobotX.MaxLength = 20;
this.txtRobotX.Name = "txtRobotX";
this.txtRobotX.Size = new System.Drawing.Size(101, 21);
this.txtRobotX.TabIndex = 79;
//
// URRobotPositionControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.label14);
this.Controls.Add(this.label21);
this.Controls.Add(this.txtRY);
this.Controls.Add(this.txtRZ);
this.Controls.Add(this.label22);
this.Controls.Add(this.txtRX);
this.Controls.Add(this.label18);
this.Controls.Add(this.label19);
this.Controls.Add(this.txtRobotY);
this.Controls.Add(this.txtRobotZ);
this.Controls.Add(this.label20);
this.Controls.Add(this.txtRobotX);
this.Name = "URRobotPositionControl";
this.Size = new System.Drawing.Size(156, 212);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.TextBox txtRY;
private System.Windows.Forms.TextBox txtRZ;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.TextBox txtRX;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.TextBox txtRobotY;
private System.Windows.Forms.TextBox txtRobotZ;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.TextBox txtRobotX;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using URSoldering.DeviceLibrary;
using URSoldering.Common;
namespace UserFromControl
{
public partial class URRobotMControl : UserControl
{
public URRobotMControl()
{
InitializeComponent();
}
public void ShowPoint(URPointValue point)
{
txtRobotX.Text = point.X.ToString();
txtRobotY.Text = point.Y.ToString();
txtRobotZ.Text = point.Z.ToString();
txtRX.Text = point.RX.ToString();
txtRY.Text = point.RY.ToString();
txtRZ.Text = point.RZ.ToString();
}
public URPointValue GetPoint()
{
double x = FormUtil.getDoubleValue(txtRobotX);
double y = FormUtil.getDoubleValue(txtRobotY);
double z = FormUtil.getDoubleValue(txtRobotZ);
double rx = FormUtil.getDoubleValue(txtRX);
double ry = FormUtil.getDoubleValue(txtRY);
double rz = FormUtil.getDoubleValue(txtRZ);
return new URPointValue(x, y, z, rx, ry, rz);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
namespace UserFromControl
{
partial class URRobotSControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lblRZ = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.lblRY = new System.Windows.Forms.Label();
this.lblRX = new System.Windows.Forms.Label();
this.label7 = 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.txtRobotY = new System.Windows.Forms.Label();
this.txtRobotX = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lblRZ
//
this.lblRZ.AutoSize = true;
this.lblRZ.Location = new System.Drawing.Point(167, 113);
this.lblRZ.Name = "lblRZ";
this.lblRZ.Size = new System.Drawing.Size(11, 12);
this.lblRZ.TabIndex = 44;
this.lblRZ.Text = "0";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(133, 113);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(29, 12);
this.label3.TabIndex = 41;
this.label3.Text = "RZ:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(132, 9);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(29, 12);
this.label4.TabIndex = 39;
this.label4.Text = "RX:";
//
// lblRY
//
this.lblRY.AutoSize = true;
this.lblRY.Location = new System.Drawing.Point(167, 61);
this.lblRY.Name = "lblRY";
this.lblRY.Size = new System.Drawing.Size(11, 12);
this.lblRY.TabIndex = 43;
this.lblRY.Text = "0";
//
// lblRX
//
this.lblRX.AutoSize = true;
this.lblRX.Location = new System.Drawing.Point(167, 9);
this.lblRX.Name = "lblRX";
this.lblRX.Size = new System.Drawing.Size(11, 12);
this.lblRX.TabIndex = 42;
this.lblRX.Text = "0";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(133, 61);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(29, 12);
this.label7.TabIndex = 40;
this.label7.Text = "RY:";
//
// txtRobotZ
//
this.txtRobotZ.AutoSize = true;
this.txtRobotZ.Location = new System.Drawing.Point(49, 113);
this.txtRobotZ.Name = "txtRobotZ";
this.txtRobotZ.Size = new System.Drawing.Size(11, 12);
this.txtRobotZ.TabIndex = 38;
this.txtRobotZ.Text = "0";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(15, 113);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(23, 12);
this.label13.TabIndex = 35;
this.label13.Text = "Z:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(14, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(23, 12);
this.label1.TabIndex = 33;
this.label1.Text = "X:";
//
// txtRobotY
//
this.txtRobotY.AutoSize = true;
this.txtRobotY.Location = new System.Drawing.Point(49, 61);
this.txtRobotY.Name = "txtRobotY";
this.txtRobotY.Size = new System.Drawing.Size(11, 12);
this.txtRobotY.TabIndex = 37;
this.txtRobotY.Text = "0";
//
// txtRobotX
//
this.txtRobotX.AutoSize = true;
this.txtRobotX.Location = new System.Drawing.Point(49, 9);
this.txtRobotX.Name = "txtRobotX";
this.txtRobotX.Size = new System.Drawing.Size(11, 12);
this.txtRobotX.TabIndex = 36;
this.txtRobotX.Text = "0";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(15, 61);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(23, 12);
this.label12.TabIndex = 34;
this.label12.Text = "Y:";
//
// URRobotSControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.lblRZ);
this.Controls.Add(this.label3);
this.Controls.Add(this.label4);
this.Controls.Add(this.lblRY);
this.Controls.Add(this.lblRX);
this.Controls.Add(this.label7);
this.Controls.Add(this.txtRobotZ);
this.Controls.Add(this.label13);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtRobotY);
this.Controls.Add(this.txtRobotX);
this.Controls.Add(this.label12);
this.Name = "URRobotSControl";
this.Size = new System.Drawing.Size(228, 146);
this.Load += new System.EventHandler(this.URRobotSControl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblRZ;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label lblRY;
private System.Windows.Forms.Label lblRX;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label txtRobotZ;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label txtRobotY;
private System.Windows.Forms.Label txtRobotX;
private System.Windows.Forms.Label label12;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using URSoldering.DeviceLibrary;
using URSoldering.Common;
namespace UserFromControl
{
public partial class URRobotSControl : UserControl
{
public URRobotSControl()
{
InitializeComponent();
}
private void URRobotSControl_Load(object sender, EventArgs e)
{
}
public void ShowPoint(URPointValue point)
{
txtRobotX.Text = point.X.ToString();
txtRobotY.Text = point.Y.ToString();
txtRobotZ.Text = point.Z.ToString();
lblRX.Text = point.RX.ToString();
lblRY.Text = point.RY.ToString();
lblRZ.Text = point.RZ.ToString();
}
public URPointValue GetPoint()
{
double x = FormUtil.getDoubleValue(txtRobotX);
double y = FormUtil.getDoubleValue(txtRobotY);
double z = FormUtil.getDoubleValue(txtRobotZ);
double rx = FormUtil.getDoubleValue(lblRX);
double ry = FormUtil.getDoubleValue(lblRY);
double rz = FormUtil.getDoubleValue(lblRZ);
return new URPointValue(x, y, z, rx, ry, rz);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -99,6 +99,18 @@ ...@@ -99,6 +99,18 @@
<Compile Include="IOTextControl.Designer.cs"> <Compile Include="IOTextControl.Designer.cs">
<DependentUpon>IOTextControl.cs</DependentUpon> <DependentUpon>IOTextControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="URRobotMControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="URRobotMControl.Designer.cs">
<DependentUpon>URRobotMControl.cs</DependentUpon>
</Compile>
<Compile Include="URRobotSControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="URRobotSControl.Designer.cs">
<DependentUpon>URRobotSControl.cs</DependentUpon>
</Compile>
<Compile Include="UserControl1.cs"> <Compile Include="UserControl1.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
...@@ -121,6 +133,12 @@ ...@@ -121,6 +133,12 @@
<EmbeddedResource Include="IOTextControl.resx"> <EmbeddedResource Include="IOTextControl.resx">
<DependentUpon>IOTextControl.cs</DependentUpon> <DependentUpon>IOTextControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="URRobotMControl.resx">
<DependentUpon>URRobotMControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="URRobotSControl.resx">
<DependentUpon>URRobotSControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControl1.resx"> <EmbeddedResource Include="UserControl1.resx">
<DependentUpon>UserControl1.cs</DependentUpon> <DependentUpon>UserControl1.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -145,6 +163,19 @@ ...@@ -145,6 +163,19 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{4b003e21-8356-447f-a55a-31be3004f2f9}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\DeviceLibrary\DeviceLibrary.csproj">
<Project>{29659924-d057-457f-9e94-715e46027a93}</Project>
<Name>DeviceLibrary</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!