Commit 34145f02 几米阳光

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

1 个父辈 9a750da5
......@@ -55,40 +55,38 @@ namespace URSoldering.Common
public static string BOARD_IMAGE_DEFAULT = "BOARD_IMAGE_DEFAULT";
/// <summary>
/// 焊接机器人待机点
/// </summary>
public static string Soldering_Home_Y = "Soldering_Home_Y";
public static string Soldering_Home_X = "Soldering_Home_X";
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>
public static string Soldering_HomePoint = "Soldering_HomePoint";
/// <summary>
/// 焊接机器人清洗点1
/// </summary>
public static string Soldering_Clear_Y_1 = "Soldering_Clear_Y_1";
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";
public static string Soldering_Clear1Point = "Soldering_Clear1Point";
/// <summary>
/// 焊接机器人清洗点2
/// </summary>
public static string Soldering_Clear_Y_2 = "Soldering_Clear_Y_2";
public static string Soldering_Clear_X_2 = "Soldering_Clear_X_2";
public static string Soldering_Clear_U_2 = "Soldering_Clear_U_2";
public static string Soldering_Clear_Z_2 = "Soldering_Clear_Z_2";
public static string Soldering_Clear_Hand_2 = "Soldering_Clear_Hand_2";
public static string Soldering_Clear2Point = "Soldering_Clear2Point";
/// <summary>
/// 机械臂最小范围
/// </summary>
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_U_Min = "Soldering_U_Min";
public static string Soldering_X_Min = "Soldering_X_Min";
public static string Soldering_Y_Min = "Soldering_Y_Min";
public static string Soldering_Z_Min = "Soldering_Z_Min";
public static string Soldering_U_Max = "Soldering_U_Max";
public static string Soldering_X_Max = "Soldering_X_Max";
public static string Soldering_Y_Max = "Soldering_Y_Max";
public static string Soldering_Z_Max = "Soldering_Z_Max";
//public static string Soldering_U_Min = "Soldering_U_Min";
//public static string Soldering_X_Min = "Soldering_X_Min";
//public static string Soldering_Y_Min = "Soldering_Y_Min";
//public static string Soldering_Z_Min = "Soldering_Z_Min";
//public static string Soldering_U_Max = "Soldering_U_Max";
//public static string Soldering_X_Max = "Soldering_X_Max";
//public static string Soldering_Y_Max = "Soldering_Y_Max";
//public static string Soldering_Z_Max = "Soldering_Z_Max";
public static string SendWire_Change = "SendWire_Change";
public static string Slave_ID = "Slave_ID";
......
......@@ -175,7 +175,7 @@ namespace URSoldering.DeviceLibrary
}
public WeldPointInfo(int hand)
{
this.HandDirection = hand;
//this.HandDirection = hand;
}
/// <summary>
......@@ -188,26 +188,33 @@ namespace URSoldering.DeviceLibrary
/// </summary>
public string pointName { 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; }
public double RobotX { get; set; }
public double RoobtY { get; set; }
public double RobotZ { get; set; }
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>
/// 预热温度
......@@ -277,28 +284,28 @@ 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 "左臂";
}
//public string HandValue
//{
// get
// {
// if (HandDirection == 0)
// {
// return "自动";
// }
// else if (HandDirection == 1)
// {
// return "右臂";
// }
// else if (HandDirection == 2)
// {
// return "左臂";
// }
return "";
}
set
{
}
}
// return "";
// }
// set
// {
// }
//}
}
}
......@@ -62,12 +62,7 @@ namespace URSoldering.DeviceLibrary
private void LedTimer_Elapsed(object sender, ElapsedEventArgs e)
{
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))
{
KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.HIGH);
......@@ -88,11 +83,7 @@ namespace URSoldering.DeviceLibrary
if (KNDIOValue(IO_Type.WaitSingle).Equals(IO_VALUE.HIGH))
{
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))
{
KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.HIGH);
......@@ -104,11 +95,7 @@ namespace URSoldering.DeviceLibrary
if (KNDIOValue(IO_Type.WaitSingle).Equals(IO_VALUE.HIGH))
{
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))
{
KNDIOMove(IO_Type.AutoRunSingle, IO_VALUE.LOW);
......
......@@ -93,8 +93,11 @@ namespace URSoldering.DeviceLibrary
public static void Release()
{
bool isOk = false;
parseCommand(CMD_StopSend, out isOk);
sb.closePort();
if (sb != null)
{
parseCommand(CMD_StopSend, out isOk);
sb.closePort();
}
IsRun = false;
}
public static void Reset()
......@@ -201,6 +204,11 @@ namespace URSoldering.DeviceLibrary
}
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++)
......
......@@ -70,6 +70,12 @@ namespace URSoldering.DeviceLibrary
}
return StartConnect();
}
public static string Start()
{
return "";
}
private static bool StartConnect()
{
try
......@@ -234,18 +240,52 @@ namespace URSoldering.DeviceLibrary
{
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 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
this.X = x;
this.Y = y;
this.U = u;
this.Z = z;
this.HandDir = handDir;
this.RX = rx;
this.RY = ry;
this.RZ = rz;
this.UpdateTime = DateTime.Now;
}
/// <summary>
......@@ -253,10 +293,27 @@ namespace URSoldering.DeviceLibrary
/// </summary>
public DateTime UpdateTime { get; set; }
public double X { get; set; }
public double Y { get; set; }
public double U { get; set; }
public double Y { 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
{
......
......@@ -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 @@
<metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>611, 17</value>
</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">
<value>True</value>
</metadata>
......@@ -493,7 +513,13 @@
<metadata name="Column_Z.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</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>
</metadata>
<metadata name="Column_preheatTemperature.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
......@@ -538,9 +564,6 @@
<metadata name="Column_isClear.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</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">
<value>True</value>
</metadata>
......@@ -582,26 +605,6 @@
AeLDoohrNFdzAAAAAElFTkSuQmCC
</value>
</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">
<value>35</value>
</metadata>
......
......@@ -226,9 +226,9 @@ namespace URSoldering.Client
int index = 0;
foreach (WeldPointInfo weld in pointList)
{
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;
g.FillEllipse(Brushes.Red, x - pointHight / 2, y - pointHight / 2, pointHight, pointHight);
//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;
//g.FillEllipse(Brushes.Red, x - pointHight / 2, y - pointHight / 2, pointHight, pointHight);
//if (index > 0)
//{
// Pen p = new Pen(Color.Red, 2);
......
......@@ -30,23 +30,23 @@ namespace URSoldering.Client
private void btnWelding_Click(object sender, EventArgs e)
{
//if (BoardManager.CurrBoard == null)
//{
// if (BoardManager.boardList.Count > 0)
// {
// BoardManager.UpdateCurrBoard(BoardManager.boardList[0].boardId);
// }
// else
// {
// MessageBox.Show("请先配置程序");
// return;
// }
//}
//isClick = true;
//FrmWork fw = new FrmWork();
//this.Visible = false; ;
//fw.ShowDialog();
//this.Visible = true;
if (BoardManager.CurrBoard == null)
{
if (BoardManager.boardList.Count > 0)
{
BoardManager.UpdateCurrBoard(BoardManager.boardList[0].boardId);
}
else
{
MessageBox.Show("请先配置程序");
return;
}
}
isClick = true;
FrmWork fw = new FrmWork();
this.Visible = false; ;
fw.ShowDialog();
this.Visible = true;
}
private void btnProduct_Click(object sender, EventArgs e)
......@@ -109,11 +109,11 @@ namespace URSoldering.Client
private void btnAutoEdit_Click(object sender, EventArgs e)
{
isClick = true;
FrmAutoAddBoard info = new FrmAutoAddBoard(null);
this.Visible = false;
info.ShowDialog();
this.Visible = true;
//isClick = true;
//FrmAutoAddBoard info = new FrmAutoAddBoard(null);
//this.Visible = false;
//info.ShowDialog();
//this.Visible = true;
}
private void btnStart_Click(object sender, EventArgs e)
......
......@@ -42,39 +42,17 @@ namespace URSoldering.Client
this.txtOriginX.Text = ConfigAppSettings.GetValue(Setting_Init.BOARD_ORIGIN_X);
this.txtOriginY.Text = ConfigAppSettings.GetValue(Setting_Init.BOARD_ORIGIN_Y);
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();
txtsendWireSpeed.Text = ConfigAppSettings.GetValue(Setting_Init.ReverseSendWireSpeed);
txtsendWireTime.Text = ConfigAppSettings.GetValue(Setting_Init.ReverseSendWireTime);
txtClearU1.Text=WeldRobotBean.EpsonClearU1.ToString();
txtClearX1.Text=WeldRobotBean.EpsonClearX1.ToString();
txtClearY1.Text = WeldRobotBean.EpsonClearY1.ToString();
txtClearZ1.Text = WeldRobotBean.EpsonClearZ1.ToString();
this.cmbClearHand1.SelectedIndex = WeldRobotBean.EpsonClearHandDir1;
txtClearU2.Text = WeldRobotBean.EpsonClearU2.ToString();
txtClearX2.Text = WeldRobotBean.EpsonClearX2.ToString();
txtClearY2.Text = WeldRobotBean.EpsonClearY2.ToString();
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();
minControl.ShowPoint(WeldRobotBean.RobotMin);
maxControl.ShowPoint(WeldRobotBean.RobotMax);
txtXMax.Text = WeldRobotBean.EpsonXMax.ToString();
txtYMax.Text = WeldRobotBean.EpsonYMax.ToString();
txtZMax.Text = WeldRobotBean.EpsonZMax.ToString();
txtUMax.Text = WeldRobotBean.EpsonUMax.ToString();
clear2Control.ShowPoint(WeldRobotBean.Clear2Point);
clear1Control.ShowPoint(WeldRobotBean.Clear1Point);
homeControl.ShowPoint(WeldRobotBean.HomePoint);
}
private void saveValue()
......@@ -109,97 +87,70 @@ namespace URSoldering.Client
txtsendWireTime.Focus();
return;
}
int hand = cmbOrgHand.SelectedIndex;
double orgx=FormUtil.getDoubleValue(txtOrgX) ;
double orgy = FormUtil.getDoubleValue(txtOrgY);
double orgu = FormUtil.getDoubleValue(txtOrgU);
double orgz = FormUtil.getDoubleValue(txtOrgZ);
URPointValue homeP = homeControl.GetPoint();
//判断原点的Z轴
if (orgz > limz)
if (homeP.Z > limz)
{
MessageBox.Show("待机点Z坐标不能高于最高Z点!");
txtOrgZ.Focus();
txtOrgZ.SelectAll();
homeControl.Focus();
return;
}
int clearHand1 = this.cmbClearHand1.SelectedIndex;
double clearx1 = FormUtil.getDoubleValue(txtClearX1);
double cleary1 = FormUtil.getDoubleValue(txtClearY1);
double clearu1 = FormUtil.getDoubleValue(txtClearU1);
double clearz1 = FormUtil.getDoubleValue(txtClearZ1);
URPointValue clear1P = clear1Control.GetPoint();
//判断原点的Z轴
if (clearz1 > limz)
if (clear1P.Z > limz)
{
MessageBox.Show("清洗点1的Z坐标不能高于最高Z点!");
txtClearZ1.Focus();
txtClearZ1.SelectAll();
clear1Control.Focus();
return;
}
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);
URPointValue clear2P = clear2Control.GetPoint();
//判断原点的Z轴
if (clearz2 > limz)
if (clear2P.Z > limz)
{
MessageBox.Show("清洗点2的Z坐标不能高于最高Z点!");
txtClearZ2.Focus();
txtClearZ2.SelectAll();
clear2Control.Focus();
return;
}
double XMin = FormUtil.getDoubleValue(txtXMin);
double YMin = FormUtil.getDoubleValue(txtYMin);
double ZMin = FormUtil.getDoubleValue(txtZMin);
double UMin = FormUtil.getDoubleValue(txtUMin);
double XMax = FormUtil.getDoubleValue(txtXMax);
double YMax = FormUtil.getDoubleValue(txtYMax);
double ZMax = FormUtil.getDoubleValue(txtZMax);
double UMax = FormUtil.getDoubleValue(txtUMax);
if (XMin > XMax)
{
MessageBox.Show("请正确输入机械臂X轴范围!");
txtXMin.Focus();
txtXMin.SelectAll();
return;
}
if (YMin > YMax)
{
MessageBox.Show("请正确输入机械臂Y轴范围!");
txtYMin.Focus();
txtYMin.SelectAll();
return;
}
if (ZMin > ZMax)
{
MessageBox.Show("请正确输入机械臂Z轴范围!");
txtZMin.Focus();
txtZMin.SelectAll();
return;
}
if (UMin > UMax)
{
MessageBox.Show("请正确输入机械臂U轴范围!");
txtUMin.Focus();
txtUMin.SelectAll();
return;
}
URPointValue minP = minControl.GetPoint();
URPointValue maxP = maxControl.GetPoint();
//if (XMin > XMax)
//{
// MessageBox.Show("请正确输入机械臂X轴范围!");
// txtXMin.Focus();
// txtXMin.SelectAll();
// return;
//}
//if (YMin > YMax)
//{
// MessageBox.Show("请正确输入机械臂Y轴范围!");
// txtYMin.Focus();
// txtYMin.SelectAll();
// return;
//}
//if (ZMin > ZMax)
//{
// MessageBox.Show("请正确输入机械臂Z轴范围!");
// txtZMin.Focus();
// txtZMin.SelectAll();
// return;
//}
//if (UMin > UMax)
//{
// MessageBox.Show("请正确输入机械臂U轴范围!");
// txtUMin.Focus();
// txtUMin.SelectAll();
// return;
//}
WeldRobotBean.UpdateOrgPoint(homeP);
WeldRobotBean.UpdateClear1Point(clear1P);
WeldRobotBean.UpdateClear2Point(clear2P);
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());
EpsonDevice.Robot_LIM_Z = limz;
......@@ -208,25 +159,11 @@ namespace URSoldering.Client
ConfigAppSettings.SaveValue(Setting_Init.ReverseSendWireSpeed, sendWireSpeed);
ConfigAppSettings.SaveValue(Setting_Init.ReverseSendWireTime, sendWireTime);
WeldRobotBean.EpsonXMin = XMin;
WeldRobotBean.EpsonXMax = XMax;
WeldRobotBean.EpsonYMin = YMin;
WeldRobotBean.EpsonYMax = YMax;
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());
WeldRobotBean.RobotMin = minP;
WeldRobotBean.RobotMax = maxP;
ConfigAppSettings.SaveValue(Setting_Init.Soldering_RobotMin, minP.ToJosonStr());
ConfigAppSettings.SaveValue(Setting_Init.Soldering_RobotMax, maxP.ToJosonStr());
MessageBox.Show("保存成功,需要重启之后才能生效!");
this.Close();
}
......
......@@ -24,19 +24,14 @@ namespace URSoldering.Client
cmbPointType.SelectedIndex = 0;
groupPoint.Text = "新增焊点";
}
public FrmWeldPointInfo(string name,double x,double y ,double u,double z,int hand)
public FrmWeldPointInfo(string name,URPointValue point)
{
InitializeComponent();
this.Text = "新增焊点";
groupPoint.Text = "新增焊点";
this.txtName.Text = name;
cmbPointType.SelectedIndex = 0;
this.txtRobotU.Text = u.ToString();
this.txtRobotX.Text = x.ToString();
txtRobotY.Text = y.ToString();
txtRobotZ.Text = z.ToString();
this.cmbHand.SelectedIndex = hand;
ShowPoint(point);
this.txtClearTime.Text = WeldRobotBean.RobotConfig.ClearMSenconds.ToString();
}
public FrmWeldPointInfo(WeldPointInfo weldPointInfo)
......@@ -69,13 +64,7 @@ namespace URSoldering.Client
{
this.txtClearTime.Text = weldPointInfo.ClearTime.ToString();
}
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;
ShowPoint(new URPointValue(weldPointInfo.RobotX, weldPointInfo.RoobtY, weldPointInfo.RobotZ, weldPointInfo.RobotRX, weldPointInfo.RobotRY, weldPointInfo.RobotRZ));
}
private void btnSave_Click(object sender, EventArgs e)
......@@ -232,12 +221,16 @@ namespace URSoldering.Client
weldPointInfo.isNeedClear = chbClear.Checked;
weldPointInfo.ClearTime = clearTime;
weldPointInfo.pointType = cmbPointType.SelectedIndex;
weldPointInfo.PositionX = FormUtil.getDoubleValue(txtRobotX);
weldPointInfo.PositionY = FormUtil.getDoubleValue(txtRobotY);
weldPointInfo.PositionU = FormUtil.getDoubleValue(txtRobotU);
weldPointInfo.PositionZ= FormUtil.getDoubleValue(txtRobotZ);
weldPointInfo.HandDirection = cmbHand.SelectedIndex;
URPointValue p = urRobot.GetPoint();
weldPointInfo.RobotX = p.X;
weldPointInfo.RoobtY = p.Y;
weldPointInfo.RobotZ = p.Z;
weldPointInfo.RobotRX = p.RX;
weldPointInfo.RobotRY = p.RY;
weldPointInfo.RobotRZ = p.RZ;
this.DialogResult = DialogResult.OK;
closeForm();
......@@ -257,39 +250,25 @@ namespace URSoldering.Client
private void btnUpdate_Click(object sender, EventArgs e)
{
PointValue point = EpsonDevice.LastPoint;
double clearx = point.X;
double cleary = point.Y;
double clearu = point.U;
double clearz = point.Z;
URPointValue point = URRobotControl.GetLastPosition();
//判断原点的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;
}
int hand = point.HandDir;
string handStr = "自动";
if (hand == 1)
{
handStr = "右臂";
}
else if (hand == 2)
{
handStr = "左臂";
}
DialogResult result = MessageBox.Show("当前坐标:X:" + clearx + ",Y:" + cleary + ",Z:" + clearz + "," + ",U:" + clearu +",方向:"+ handStr + ",是否确定更新?", "提示", MessageBoxButtons.YesNo);
DialogResult result = MessageBox.Show("当前坐标:" +point.ToShowStr()+ ",是否确定更新?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes))
{
this.txtRobotU.Text = clearu.ToString();
this.txtRobotX.Text = clearx.ToString();
this.txtRobotY.Text = cleary.ToString();
this.txtRobotZ.Text = clearz.ToString();
cmbHand.SelectedIndex = hand;
ShowPoint(point);
}
}
private void ShowPoint(URPointValue point)
{
urRobot.ShowPoint(point);
}
private void chbClear_CheckedChanged(object sender, EventArgs e)
{
if (chbClear.Checked)
......@@ -301,10 +280,6 @@ namespace URSoldering.Client
txtClearTime.Enabled = false;
}
}
private void cmbPointType_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}
......@@ -85,12 +85,6 @@
<Compile Include="FrmBoardCopy.Designer.cs">
<DependentUpon>FrmBoardCopy.cs</DependentUpon>
</Compile>
<Compile Include="FrmAutoAddBoard.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmAutoAddBoard.Designer.cs">
<DependentUpon>FrmAutoAddBoard.cs</DependentUpon>
</Compile>
<Compile Include="FrmOrgConfig.cs">
<SubType>Form</SubType>
</Compile>
......@@ -169,6 +163,12 @@
<Compile Include="FrmWeldPointInfo.Designer.cs">
<DependentUpon>FrmWeldPointInfo.cs</DependentUpon>
</Compile>
<Compile Include="FrmWork.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmWork.Designer.cs">
<DependentUpon>FrmWork.cs</DependentUpon>
</Compile>
<Compile Include="FrmWorkCount.cs">
<SubType>Form</SubType>
</Compile>
......@@ -183,9 +183,6 @@
<EmbeddedResource Include="FrmBoardCopy.resx">
<DependentUpon>FrmBoardCopy.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmAutoAddBoard.resx">
<DependentUpon>FrmAutoAddBoard.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmOrgConfig.resx">
<DependentUpon>FrmOrgConfig.cs</DependentUpon>
</EmbeddedResource>
......@@ -225,6 +222,9 @@
<EmbeddedResource Include="FrmWeldPointInfo.resx">
<DependentUpon>FrmWeldPointInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmWork.resx">
<DependentUpon>FrmWork.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmWorkCount.resx">
<DependentUpon>FrmWorkCount.cs</DependentUpon>
</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
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
......@@ -99,6 +99,18 @@
<Compile Include="IOTextControl.Designer.cs">
<DependentUpon>IOTextControl.cs</DependentUpon>
</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">
<SubType>UserControl</SubType>
</Compile>
......@@ -121,6 +133,12 @@
<EmbeddedResource Include="IOTextControl.resx">
<DependentUpon>IOTextControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="URRobotMControl.resx">
<DependentUpon>URRobotMControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="URRobotSControl.resx">
<DependentUpon>URRobotSControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControl1.resx">
<DependentUpon>UserControl1.cs</DependentUpon>
</EmbeddedResource>
......@@ -145,6 +163,19 @@
<ItemGroup>
<None Include="packages.config" />
</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" />
<!-- 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.
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!