更改SerialPortStream 串口工具

This commit is contained in:
13763374093 2025-04-09 11:40:32 +08:00
parent b33b565332
commit 486ed6a9c0
31 changed files with 913 additions and 350 deletions

View File

@ -56,6 +56,9 @@
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RJCP.SerialPortStream, Version=2.4.2.0, Culture=neutral, PublicKeyToken=5f5e7b70c6a74deb, processorArchitecture=MSIL">
<HintPath>..\packages\SerialPortStream.2.4.2\lib\net45\RJCP.SerialPortStream.dll</HintPath>
</Reference>
<Reference Include="Rubyer, Version=2.16.7.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Rubyer.2.16.7\lib\net462\Rubyer.dll</HintPath>
</Reference>

View File

@ -40,5 +40,14 @@ namespace BigProject.Config
public double D_ELBOW { get; set; } = 70;
public double L_FOREARM { get; set; } = 117;
public double L_WRIST { get; set; } = 97;
public CheckFunction checkFunction { get; set; } = CheckFunction._0X6B;
}
//检验方式
public enum CheckFunction
{
_0X6B,
MODBUS
}
}

View File

@ -36,7 +36,8 @@ namespace BigProject.Devices.Arm
//夹爪停止
public void Stop()
{
byte[] send = new byte[4] { 0x07, 0x0E, 0x52, 0x6B };
byte[] send = new byte[3] { 0x07, 0x0E, 0x52 };
send = _armClawSerial.ReBuildData(send);
_armClawSerial.SendMsgForResult(send, out byte[] resMsg);
}
@ -48,40 +49,52 @@ namespace BigProject.Devices.Arm
public void ReadAngle()
{
//读取状态信息 07 43 7A 6B
byte[] send = new byte[4] { 0x07, 0x43, 0x7A, 0x6B };
_armClawSerial.SendMsgForResult(send, out byte[] resMsg, 31);
try
{
//读取状态信息 07 43 7A 6B
byte[] send = new byte[3] { 0x07, 0x43, 0x7A };
send = _armClawSerial.ReBuildData(send);
var result = _armClawSerial.SendMsgForResult(send, out byte[] resMsg);
if (!result)
{
return;
}
if (resMsg[1] == 0x00 && resMsg[2] == 0xEE)
{
return;
}
if (resMsg[0] != 0x07)
{
return;
}
if (resMsg[1] == 0x00 && resMsg[2] == 0xEE)
{
return;
}
if (resMsg[0] != 0x07)
{
return;
}
//实时角度
var temp = (resMsg[19] * 256 * 256 * 256 + resMsg[20] * 256 * 256 + resMsg[21] * 256 + resMsg[22]) * 360 / 65536.0 / 9 * 2;
var Angle = Math.Round(temp, 2);
if (Angle <= -0.8 || Angle > 180)
{
return;
}
//根据三角函数计算末端长度
var Length = Math.Cos((180 - (Angle / 2) - CLAW_FINGER_ANGLE) / 180 * Math.PI) * CLAW_FINGER_LENTH + CLAW_FINGER_WIDTH;
Length = Math.Round(Length * 2, 2);
//实时角度
var temp = (resMsg[19] * 256 * 256 * 256 + resMsg[20] * 256 * 256 + resMsg[21] * 256 + resMsg[22]) * 360 / 65536.0 / 9 * 2;
var Angle = Math.Round(temp, 2);
if (Angle <= -0.8 || Angle > 180)
{
return;
//根据实时相电流计算力矩大小
var Power = (resMsg[6] * 256 + resMsg[7]) * 1.0;
Power = Math.Round(Power, 2);
if (Power == 0)
{
return;
}
//回调函数,让数值显示出来
UpdateClawMsgEvent?.Invoke(Angle, Length, Power);
//Log.Info($"Angle:{Angle}--Length:{Length}--Power:{Power}");
}
//根据三角函数计算末端长度
var Length = Math.Cos((180 - (Angle / 2) - CLAW_FINGER_ANGLE) / 180 * Math.PI) * CLAW_FINGER_LENTH + CLAW_FINGER_WIDTH;
Length = Math.Round(Length * 2, 2);
catch (Exception ex)
{
//根据实时相电流计算力矩大小
var Power = (resMsg[6] * 256 + resMsg[7]) * 1.0;
Power = Math.Round(Power, 2);
if (Power == 0)
{
return;
}
//回调函数,让数值显示出来
UpdateClawMsgEvent?.Invoke(Angle, Length, Power);
//Log.Info($"Angle:{Angle}--Length:{Length}--Power:{Power}");
}
}
}

View File

@ -14,6 +14,7 @@ using System.Collections;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Masuit.Tools;
using BigProject.Config;
using System.Windows.Markup;
namespace BigProject.Devices.Arm
{
@ -29,7 +30,7 @@ namespace BigProject.Devices.Arm
public Pose6D_t currentPose6D;
private ArmSerial serialControl;
public event Action<double, double, double, double, double, double> UpdateJointAngle;
public static event Action<double?, double?, double?, double?, double?, double?> UpdateJointAngle;
public ArmContrl(ConfigEntity armConfig,ArmSerial armSerial)
{
dof6Solver = new Dof6kinematic(armConfig);
@ -260,43 +261,14 @@ namespace BigProject.Devices.Arm
return max;
}
/// <summary>
/// 第6轴单圈回零
/// </summary>
public bool Arm6Homing()
{
int thisArmId = 6;
//零位编码器线性值 50962
var h = 54580;
//获取编码器当前值
byte[] send = new byte[3] { 0x06, 0x31, 0x6B };
serialControl.recCount = 5;
serialControl.SendMsgForResult(send, out byte[] resMsg);
while (serialControl.DataReceived.Count == 0)
{
Thread.Sleep(50);
}
var rec = serialControl.DataReceived;
if (rec.Count==5)
{
var t = rec[2]*256 + rec[3];
//单圈脉冲为3200
var angleAbPulse = (int)Math.Abs((h - t) * 1.0 / 65536 * 3200);
serialControl.LocationControl(thisArmId, 0, 10, Relative_Absolute: RelativeOrAbsolute.Relative,pulse:angleAbPulse, isMultiMachine: 0);
Thread.Sleep(50);
//设置当前位为0 位
SendThisIsZero(thisArmId);
}
return true;
}
/// <summary>
/// 立即停止
/// </summary>
public void ArmStopNow()
{
byte[] send = new byte[5] { 0x00, 0xFE, 0x98, 0x00, 0x6B };
serialControl.SendMsgForResult(send, out byte[] resMsg);
byte[] send = new byte[4] { 0x00, 0xFE, 0x98, 0x00 };
var re =serialControl.ReBuildData(send);
serialControl.SendMsgForResult(re, out byte[] resMsg);
}
/// <summary>
@ -305,9 +277,10 @@ namespace BigProject.Devices.Arm
public void SendThisIsZero(int addr)
{
//01 0A 6D 6B
byte[] send = new byte[4] { 0x00, 0x0A ,0x6D, 0x6B };
byte[] send = new byte[3] { 0x00, 0x0A ,0x6D };
send[0] = (byte)addr;
serialControl.SendMsgForResult(send, out byte[] resMsg);
var re = serialControl.ReBuildData(send);
serialControl.SendMsgForResult(re, out byte[] resMsg);
}
/// <summary>
@ -318,10 +291,11 @@ namespace BigProject.Devices.Arm
public bool GetCurrentAngle(int addr, CtrlStepMotor ctrlStep,out double angle)
{
angle = 0;
byte[] data = new byte[3] { (byte)addr, 0x36, 0x6B };
var res =serialControl.SendMsgForResult(data, out byte[] result,8);
byte[] data = new byte[2] { (byte)addr, 0x36 };
var re = serialControl.ReBuildData(data);
var res =serialControl.SendMsgForResult(re, out byte[] result);
if(!res)
{
{
return false;
}
if (result[1] == 0x00 && result[2] == 0xee)
@ -364,8 +338,9 @@ namespace BigProject.Devices.Arm
public bool SetIfEnable(int addr,bool status)
{
int flag = status ? 1 : 0;
byte[] data = new byte[6] { (byte)addr, 0xF3, 0xAB, (byte)flag, 0x00, 0x6B };
var res = serialControl.SendMsgForResult(data, out byte[] result, 4);
byte[] data = new byte[5] { (byte)addr, 0xF3, 0xAB, (byte)flag, 0x00 };
var re = serialControl.ReBuildData(data);
var res = serialControl.SendMsgForResult(re, out byte[] result);
if (!res)
{
return false;
@ -388,8 +363,9 @@ namespace BigProject.Devices.Arm
{
for (int i = 0; i < 6; i++)
{
byte[] data = new byte[3] { (byte)(i+1), 0x35, 0x6B };
var res = serialControl.SendMsgForResult(data, out byte[] result, 6);
byte[] data = new byte[2] { (byte)(i+1), 0x35 };
var re = serialControl.ReBuildData(data);
var res = serialControl.SendMsgForResult(re, out byte[] result);
if (!res)
{
return false;
@ -407,5 +383,62 @@ namespace BigProject.Devices.Arm
}
return true;
}
//读取电机力矩值
private bool ReadPower(int addr,out double outValue)
{
outValue = 0;
try
{
//读取状态信息 07 43 7A 6B
byte[] send = new byte[3] { (byte)addr, 0x43, 0x7A };
var re = serialControl.ReBuildData(send);
var result = serialControl.SendMsgForResult(re, out byte[] resMsg);
if (!result)
{
return false;
}
if (resMsg[1] == 0x00 && resMsg[2] == 0xEE)
{
return false;
}
if (resMsg[0] != addr)
{
return false;
}
//根据实时相电流计算力矩大小
var Power = (resMsg[6] * 256 + resMsg[7]) * 1.0;
Power = Math.Round(Power, 2);
if (Power == 0)
{
return false;
}
outValue = Power;
return true;
}
catch (Exception ex)
{
Log.Error(ex);
return false;
}
}
public void ReadSixPower()
{
double?[] values = new double?[6];
for (int i = 1; i <= 6; i++)
{
if (ReadPower(i, out double vaule))
{
values[i - 1] = vaule;
}
else
{
values[i - 1] = null;
}
}
UpdateJointAngle?.Invoke(values[0], values[1], values[2], values[3], values[4], values[5]);
}
}
}

View File

@ -13,17 +13,5 @@ namespace BigProject.Devices.Arm
public ArmLed() {
DeviceType = DeviceType.ArmLed;
}
//开启机械臂的灯
public void Open()
{
App.Core.ArmSerial.LedOpen();
}
//关闭机械臂的灯
public void Close()
{
App.Core.ArmSerial.LedClose();
}
}
}

View File

@ -9,7 +9,7 @@ xmlns:local="clr-namespace:BigProject.Dialogs"
mc:Ignorable="d"
Title="系统设置" Height="600" Width="700">
<Grid rubyer:GridHelper.ColumnDefinitions="300,*">
<Grid rubyer:GridHelper.RowDefinitions="40,40,40,40,40,40,50,20,*" >
<Grid rubyer:GridHelper.RowDefinitions="40,40,40,40,40,40,40,50,20,*" >
<Grid Grid.Row="0" rubyer:GridHelper.ColumnDefinitions="80,*" Margin="5">
<TextBlock Grid.Column="0">J1减速比</TextBlock>
<rubyer:NumericBox x:Name="tb_ReductionJ1" Grid.Column="1" Interval="1" NumericType="Int" Value="{Binding ReductionJ1}"/>
@ -34,7 +34,12 @@ Title="系统设置" Height="600" Width="700">
<TextBlock Grid.Column="0">J6减速比</TextBlock>
<rubyer:NumericBox x:Name="tb_ReductionJ6" Grid.Column="1" Interval="1" NumericType="Int" Value="{Binding ReductionJ6}"/>
</Grid>
<Grid Grid.Row="6" rubyer:GridHelper.ColumnDefinitions="*,*">
<Grid Grid.Row="6" rubyer:GridHelper.ColumnDefinitions="80,*" Margin="5">
<TextBlock Grid.Column="0">校验协议</TextBlock>
<ComboBox Grid.Column="1" x:Name="cb_CheckFuntion" SelectedValue="{Binding checkFunction}"/>
</Grid>
<Grid Grid.Row="7" rubyer:GridHelper.ColumnDefinitions="*,*">
<Button Margin="3,8" Grid.Column="1" x:Name="EnterOK" Click="EnterOK_Click" >
<StackPanel rubyer:PanelHelper.Spacing="8" Orientation="Horizontal" >
<TextBlock FontSize="12" Text="应用" />

View File

@ -31,7 +31,6 @@ namespace BigProject.Dialogs
//加载
private void ConfigDialog_Loaded(object sender, RoutedEventArgs e)
{
}
private void EnterOK_Click(object sender, RoutedEventArgs e)

View File

@ -37,7 +37,7 @@
<TextBlock FontSize="60" Grid.Column="0" Foreground="Red" Panel.ZIndex="3" x:Name="ResultTextInPic" ></TextBlock>
</Grid>
</Grid>
<Grid Grid.Column="1" rubyer:GridHelper.RowDefinitions="300,300,*">
<Grid Grid.Column="1" rubyer:GridHelper.RowDefinitions="300,200,*">
<GroupBox Header="点位循环记录">
<DataGrid x:Name="dg_JointRecord" rubyer:ControlHelper.FocusedForegroundBrush="{StaticResource Accent}" AutoGenerateColumns="False" BorderThickness="1" CanUserAddRows="False" GridLinesVisibility="All" IsReadOnly="True" SelectionMode="Single">
<DataGrid.Columns>
@ -109,6 +109,47 @@
</Grid>
</Grid>
</GroupBox>
<GroupBox Header="力矩信息" Grid.Row="2" x:Name="gb_ArmControl" IsEnabled="False">
<Grid rubyer:GridHelper.RowDefinitions="240,50">
<Grid rubyer:GridHelper.RowDefinitions="40,40,40,40,40,40,40" rubyer:GridHelper.ColumnDefinitions="40,200,50">
<TextBlock Grid.Column="0" Grid.Row="0">J1</TextBlock>
<ProgressBar Grid.Column="1" Grid.Row="0" Margin="0 18 0 0" Value="0" Minimum="0" Maximum="2000" x:Name="pb_pJ1"></ProgressBar>
<TextBlock Grid.Column="2" Grid.Row="0" Margin="6" x:Name="tb_pJ1">0</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="1">J2</TextBlock>
<ProgressBar Grid.Column="1" Grid.Row="1" Margin="0 18 0 0" Value="0" Minimum="0" Maximum="2000" x:Name="pb_pJ2"></ProgressBar>
<TextBlock Grid.Column="2" Grid.Row="1" Margin="6" x:Name="tb_pJ2">0</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="2">J3</TextBlock>
<ProgressBar Grid.Column="1" Grid.Row="2" Margin="0 18 0 0" Value="0" Minimum="0" Maximum="2000" x:Name="pb_pJ3"></ProgressBar>
<TextBlock Grid.Column="2" Grid.Row="2" Margin="6" x:Name="tb_pJ3">0</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="3">J4</TextBlock>
<ProgressBar Grid.Column="1" Grid.Row="3" Margin="0 18 0 0" Value="0" Minimum="0" Maximum="2000" x:Name="pb_pJ4"></ProgressBar>
<TextBlock Grid.Column="2" Grid.Row="3" Margin="6" x:Name="tb_pJ4">0</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="4">J5</TextBlock>
<ProgressBar Grid.Column="1" Grid.Row="4" Margin="0 18 0 0" Value="0" Minimum="0" Maximum="2000" x:Name="pb_pJ5"></ProgressBar>
<TextBlock Grid.Column="2" Grid.Row="4" Margin="6" x:Name="tb_pJ5">0</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="5">J6</TextBlock>
<ProgressBar Grid.Column="1" Grid.Row="5" Margin="0 18 0 0" Value="0" Minimum="0" Maximum="2000" x:Name="pb_pJ6"></ProgressBar>
<TextBlock Grid.Column="2" Grid.Row="5" Margin="6" x:Name="tb_pJ6">0</TextBlock>
</Grid>
<Grid rubyer:GridHelper.RowDefinitions="40" rubyer:GridHelper.ColumnDefinitions="125,125" Grid.Row="1">
<Grid Grid.Row="0" Margin="2">
<Button x:Name="bt_ArmLoopStart" Click="bt_ArmLoopStart_Click">开始监视信息</Button>
</Grid>
<Grid Grid.Column="3" Margin="2">
<Button x:Name="bt_ArmLoopEnd" IsEnabled="False" Click="bt_ArmLoopEnd_Click">停止监视信息</Button>
</Grid>
</Grid>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Column="2" rubyer:GridHelper.RowDefinitions="100,610,*" Margin="5,2,5,5">

View File

@ -29,6 +29,7 @@ using Rubyer;
using BigProject.JointMoveRecord;
using System.Collections.ObjectModel;
using BigProject.Dialogs;
using Newtonsoft.Json.Linq;
namespace BigProject
{
@ -66,6 +67,9 @@ namespace BigProject
//添加夹爪信息回调
ArmClaw.UpdateClawMsgEvent+= UpdateClawMsg;
//添加机械臂信息回调
ArmContrl.UpdateJointAngle += UpdateArmMsg;
//赋值当前角度位置
//MainWindow_UpdateJointAngle();
@ -132,10 +136,9 @@ namespace BigProject
}
//循环运动机械臂
bool JointLoopIsRun = false;
CancellationTokenSource cts;
private void bt_MoveLoop_Click(object sender, RoutedEventArgs e)
{
if (JointLoopIsRun) return;
var motorJ = App.Core.ArmContrl.motorJ;
for (int i = 0; i < motorJ.Length; i++)
{
@ -148,14 +151,18 @@ namespace BigProject
{
Log.Info($"夹爪设置使能状态失败");
}
JointLoopIsRun = true;
cts = new CancellationTokenSource();
var runCicleToken = cts.Token;
Task.Run(() => {
while (JointLoopIsRun)
while (true)
{
Thread.Sleep(50);
foreach (var rec in App.Core.JointRecords)
{
if (!JointLoopIsRun) return;
if(runCicleToken.IsCancellationRequested)
{
return;
}
this.Dispatcher.Invoke(() =>
{
dg_JointRecord.SelectedItem = rec;
@ -170,18 +177,20 @@ namespace BigProject
Thread.Sleep(100);
while (!App.Core.ArmContrl.IsMoveOver())
{
if (!JointLoopIsRun) return;
if (runCicleToken.IsCancellationRequested)
{
return;
}
Thread.Sleep(2000);
}
}
}
App.Core.ArmContrl.ArmStopNow();
});
}, runCicleToken);
}
//停止循环
private void bt_MoveLoopStop_Click(object sender, RoutedEventArgs e)
{
JointLoopIsRun = false;
cts.Cancel();
}
//删除记录
private void bt_DeleteRecord_Click(object sender, RoutedEventArgs e)
@ -259,8 +268,8 @@ namespace BigProject
{
//查看是否存在机械臂
var armConnected = false;
var res =App.Core.ArmSerial.SendMsgForResult(new byte[3] { 0x01, 0x33, 0x6b },out byte[] resMsg);
Thread.Sleep(500);
var re = App.Core.ArmSerial.ReBuildData(new byte[2] { 0x01, 0x33 });
var res = App.Core.ArmSerial.SendMsgForResult(re, out byte[] resMsg);
if (res&&resMsg[0] > 0)
{
Log.Info($"{item}连接成功找到jyker机械臂");
@ -268,6 +277,7 @@ namespace BigProject
cb_ComList.SelectedItem = item;
bt_LinkAuto.IsEnabled = false;
cb_ComList.IsEnabled = false;
gb_ArmControl.IsEnabled = true;
bt_Link.Content = "断开连接";
SetButtomState(true);
armConnected = true;
@ -275,9 +285,11 @@ namespace BigProject
MainWindow_UpdateJointAngle();
});
}
Thread.Sleep(100);
//夹爪连接
var clawConnected = false;
var resClaw = App.Core.ArmSerial.SendMsgForResult(new byte[3] { 0x07, 0x33, 0x6b }, out byte[] resMsgClaw);
var re1 = App.Core.ArmSerial.ReBuildData(new byte[2] { 0x07, 0x33 });
var resClaw = App.Core.ArmSerial.SendMsgForResult(re1, out byte[] resMsgClaw);
if (resClaw && resMsgClaw[0] > 0)
{
clawConnected = true;
@ -329,6 +341,7 @@ namespace BigProject
//读取位置信息并赋值
MainWindow_UpdateJointAngle();
gb_ClawControl.IsEnabled = true;
gb_ArmControl.IsEnabled = true;
}
}
}
@ -493,7 +506,7 @@ namespace BigProject
{
LoopReadClawAngle = true;
bt_ClawLoopStart.IsEnabled = false;
bt_ClawStop.IsEnabled = true;
bt_ClawLoopEnd.IsEnabled = true;
Task.Run(() => {
while (LoopReadClawAngle)
@ -509,7 +522,7 @@ namespace BigProject
{
LoopReadClawAngle = false;
bt_ClawLoopStart.IsEnabled = true;
bt_ClawStop.IsEnabled = false;
bt_ClawLoopEnd.IsEnabled = false;
}
//设置夹爪角度
private void pg_ClawAngle_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
@ -631,18 +644,26 @@ namespace BigProject
int richTextLine = 0;
private void Log_MessageEvent(string text)
{
var str = $"{DateTime.Now.ToString("HH:mm:ss")}:{text}\n";
this.Dispatcher.Invoke(() =>
try
{
tbLog.AppendText(str);
tbLog.ScrollToEnd();
if (richTextLine >= 3000)
var str = $"{DateTime.Now.ToString("HH:mm:ss")}:{text}\n";
this.Dispatcher.Invoke(() =>
{
tbLog.Text = string.Empty;
richTextLine = 0;
}
richTextLine++;
});
tbLog.AppendText(str);
tbLog.ScrollToEnd();
if (richTextLine >= 3000)
{
tbLog.Text = string.Empty;
richTextLine = 0;
}
richTextLine++;
});
}
catch (Exception)
{
}
}
@ -661,5 +682,76 @@ namespace BigProject
}
#endregion
#region
bool LoopReadArmAngle;
private void bt_ArmLoopStart_Click(object sender, RoutedEventArgs e)
{
LoopReadArmAngle = true;
bt_ArmLoopStart.IsEnabled = false;
bt_ArmLoopEnd.IsEnabled = true;
Task.Run(() => {
while (LoopReadArmAngle)
{
App.Core.ArmContrl.ReadSixPower();
Thread.Sleep(50);
}
});
}
private void bt_ArmLoopEnd_Click(object sender, RoutedEventArgs e)
{
LoopReadArmAngle = false;
bt_ArmLoopStart.IsEnabled = true;
bt_ArmLoopEnd.IsEnabled = false;
}
private void UpdateArmMsg(double? J1,double? J2, double? J3, double? J4, double? J5, double? J6)
{
this.Dispatcher.BeginInvoke(new Action(() =>
{
try
{
if(J1!=null)
{
pb_pJ1.Value = J1.Value;
tb_pJ1.Text = Math.Round(J1.Value, 2) + "";
};
if (J2 != null)
{
pb_pJ2.Value = J2.Value;
tb_pJ2.Text = Math.Round(J2.Value, 2) + "";
};
if (J3 != null)
{
pb_pJ3.Value = J3.Value;
tb_pJ3.Text = Math.Round(J3.Value, 2) + "";
};
if (J4 != null)
{
pb_pJ4.Value = J4.Value;
tb_pJ4.Text = Math.Round(J4.Value, 2) + "";
};
if (J5 != null)
{
pb_pJ5.Value = J5.Value;
tb_pJ5.Text = Math.Round(J5.Value, 2) + "";
};
if (J6 != null)
{
pb_pJ6.Value = J6.Value;
tb_pJ6.Text = Math.Round(J6.Value, 2) + "";
};
}
catch (Exception e)
{
Log.Error(e);
}
}));
}
#endregion
}
}

View File

@ -1,7 +1,12 @@
using BigProject.Devices.Arm;
using BigProject.Config;
using BigProject.Devices.Arm;
using BigProject.Logger;
using Castle.DynamicProxy;
using Masuit.Tools;
using RJCP.IO.Ports;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Text;
@ -13,25 +18,19 @@ namespace BigProject.Serials
{
public class ArmSerial
{
private int LightBrightness = 0;
//返回的字节个数
public int recCount = 8;
public List<byte> DataReceived = new List<byte>();
private System.IO.Ports.SerialPort serialPort1 = new System.IO.Ports.SerialPort();
//串口工具
private SerialPortStream stream;
public ArmSerial(string name1,out bool OpenResult)
{
try
{
if (!serialPort1.IsOpen)
if (stream!=null&&stream.IsOpen)
{
serialPort1.BaudRate = 115200;
serialPort1.PortName = name1;
serialPort1.Open();
serialPort1.ReadTimeout = 500; // 设置读取超时时间(毫秒)
serialPort1.WriteTimeout = 500; // 设置写入超时时间(毫秒)
//serialPort1.DataReceived += SerialPort1_DataReceived;
stream.Dispose();
}
stream = new SerialPortStream(name1, 115200, 8, RJCP.IO.Ports.Parity.None, RJCP.IO.Ports.StopBits.One);
stream.ReadTimeout = 1000;
stream.Open();
OpenResult = true;
}
catch (Exception)
@ -44,91 +43,38 @@ namespace BigProject.Serials
public bool SerialDispose()
{
serialPort1.Close();
stream.Close();
return true;
}
//开启机械臂灯光
public void LedOpen()
public bool SendMsgForResult(byte[] msg ,out byte[] recMsg)
{
LightBrightness = 10;
SendMsgForResult(new byte[] { 0xFF, 0xFF, 0, 0, 0, 10,0x6B }, out byte[] msg);
}
//关闭机械臂灯光
public void LedClose()
{
LightBrightness = 0;
SendMsgForResult(new byte[] { 0xFF, 0xFF, 0, 0, 0, 0, 0x6B }, out byte[] msg);
}
public void CtrClaw(int angleA, int angleB,int angleC)
{
SendMsgForResult(new byte[] { 0xFF, 0xFF, (byte)angleA, (byte)angleB, (byte)angleC, (byte)LightBrightness, 0x6B },out byte[] msg);
}
//接收byte数据
private void SerialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
SerialPort sp = (SerialPort)sender;
byte[] rec = new byte[1024];
int lenth = sp.Read(rec, 0, 1024);
if (lenth>100)
{
return;
}
DataReceived.AddRange(rec);
}
//发送数据
public void SendMsgOnly(byte[] msg)
{
DataReceived.Clear();
string x = "";
for (int i = 0;i < msg.Length;i++)
{
x+= msg[i].ToString("x2")+" ";
}
Log.Info($"数据发送_{x}");
if (serialPort1.IsOpen)
serialPort1.Write(msg, 0, msg.Length);
}
public bool SendMsgForResult(byte[] msg ,out byte[] recMsg, int readLenth=128)
{
recMsg = new byte[readLenth];
recMsg = new byte[msg.Length];
try
{
string x = "";
for (int i = 0; i < msg.Length; i++)
{
x += msg[i].ToString("x2") + " ";
}
//Log.Info($"数据发送_{x}");
if (!serialPort1.IsOpen)
stream.Write(msg, 0, msg.Length);
byte[] buffer = new byte[1024];
int bytesRead;
bytesRead = stream.Read(buffer, 0, buffer.Length);
if(bytesRead==0)
{
return false;
}
serialPort1.Write(msg, 0, msg.Length);
Thread.Sleep(20);
serialPort1.Read(recMsg, 0, recMsg.Length);
Thread.Sleep(20);
string y = "";
for (int i = 0; i < recMsg.Length; i++)
{
y += recMsg[i].ToString("x2") + " ";
}
//Log.Info($"数据返回_{y}");
recMsg = buffer.Take(bytesRead).ToArray();
//string z = "";
//for (int i = 0; i < recMsg.Length; i++)
//{
// z += recMsg[i].ToString("x2") + " ";
//}
//Log.Info($"数据接收z_{z}");
return true;
}
catch (System.TimeoutException)
catch (Exception e)
{
Log.Info(e.Message);
return false;
}
}
//多圈堵转回零
public bool Zero(int addr = 1)
{
@ -187,9 +133,9 @@ namespace BigProject.Serials
//上电自动触发回零
bytes.Add((byte)AutoZero);
//校验位
bytes.AddRange(new byte[] { 0x6B });
var re =ReBuildData(bytes.ToArray());
//发送命令
SendMsgForResult(bytes.ToArray(),out byte[] resMsg);
SendMsgForResult(re,out byte[] resMsg);
return true;
}
@ -227,9 +173,9 @@ namespace BigProject.Serials
//是否多机同步
bytes.Add((byte)isMultiMachine);
//校验位
bytes.AddRange(new byte[] { 0x6B });
var re = ReBuildData(bytes.ToArray());
//发送命令
SendMsgForResult(bytes.ToArray(), out byte[] resMsg);
SendMsgForResult(re, out byte[] resMsg);
}
@ -238,9 +184,10 @@ namespace BigProject.Serials
/// </summary>
public void CallMotion()
{
byte[] bytes = new byte[4] { 0x00, 0xFF, 0x66, 0x6B };
byte[] bytes = new byte[3] { 0x00, 0xFF, 0x66 };
var re = ReBuildData(bytes.ToArray());
//发送命令
SendMsgForResult(bytes.ToArray(), out byte[] resMsg);
SendMsgForResult(re, out byte[] resMsg);
}
@ -272,6 +219,29 @@ namespace BigProject.Serials
return bytes;
}
//根据选择的验证方式重新整理发送内容
public byte[] ReBuildData(byte[] input)
{
List<byte> bytes = new List<byte>();
switch (App.Core.ArmConfig.checkFunction)
{
case Config.CheckFunction.MODBUS:
bytes.AddRange(input);
bytes.AddRange(CRC16(input));
return bytes.ToArray();
case Config.CheckFunction._0X6B:
bytes.AddRange(input);
bytes.Add(0x6B);
return bytes.ToArray();
default:
break;
}
return input;
}
#region CRC
//CRC16
public byte[] CRC16(byte[] data)
{
@ -295,6 +265,58 @@ namespace BigProject.Serials
}
return new byte[] { 0, 0 };
}
List<byte[]> ParseMixedModbusRtu(byte[] data)
{
List<byte[]> messages = new List<byte[]>();
int index = 0;
while (index < data.Length)
{
if (data.Length - index < 4) break; // At least need address, function code, and CRC
// Find the end of message by searching for a valid CRC
bool foundValidMessage = false;
for (int i = index + 4; i <= data.Length; i += 1) // Start from index+4 to ensure at least one byte for data
{
byte[] potentialMessage = new byte[i - index];
Array.Copy(data, index, potentialMessage, 0, i - index);
ushort crcReceived = (ushort)((potentialMessage[potentialMessage.Length - 2] ) | potentialMessage[potentialMessage.Length - 1] << 8);
ushort crcCalculated = CalculateCRC16(potentialMessage, 0, potentialMessage.Length - 2);
if (crcReceived == crcCalculated&&crcReceived!=0)
{
messages.Add(potentialMessage);
index = i;
foundValidMessage = true;
break;
}
}
if (!foundValidMessage) break; // No valid message found, exit loop
}
return messages;
}
ushort CalculateCRC16(byte[] data, int offset, int length)
{
ushort crc = 0xFFFF;
for (int pos = offset; pos < offset + length; pos++)
{
crc = (ushort)(crc ^ (data[pos]));
for (int j = 0; j < 8; j++)
{
crc = (crc & 1) != 0 ? (ushort)((crc >> 1) ^ 0xA001) : (ushort)(crc >> 1);
}
}
return crc;
}
#endregion
}
//运动模式

View File

@ -1 +1 @@
3f1b242b1fd2030145eb3017cb1ae743f59da855
18b09c447cfa0e5b9df6bd4f4a5de266f4864645

View File

@ -104,3 +104,6 @@ D:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\obj\Debug
D:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\obj\Debug\BigProject.pdb
D:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\obj\Debug\Dialogs\ConfigDialog.g.cs
D:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\obj\Debug\Dialogs\ConfigDialog.baml
D:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\bin\Debug\RJCP.SerialPortStream.dll
D:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\bin\Debug\RJCP.SerialPortStream.pdb
D:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\bin\Debug\RJCP.SerialPortStream.xml

View File

@ -13,7 +13,7 @@ D:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\App.xaml
22021037608
11221526090
231814548399
36-144057187
371960579550
Dialogs\ConfigDialog.xaml;MainWindow.xaml;
False

View File

@ -13,7 +13,7 @@ D:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\App.xaml
22021037608
11221526090
24-267540219
36-144057187
371960579550
Dialogs\ConfigDialog.xaml;MainWindow.xaml;
True

View File

@ -1,5 +1,5 @@

FD:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\App.xaml;;
FD:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\MainWindow.xaml;;
FD:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\Dialogs\ConfigDialog.xaml;;
FD:\Ducument\mywork\jyker\gitbanben\jyker\HMIcode\BigProject\BigProject\MainWindow.xaml;;

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F5DD72F16D68E4F0E6DBCCC8F6159A9ACE9E25AAB6E92C6610282B857FEC769B"
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "09AAE9EA592DD6EBFD2973574989360EC3B1DE396ED87A3ED0223A48FDB87157"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -171,9 +171,49 @@ namespace BigProject {
#line hidden
#line 113 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox gb_ArmControl;
#line default
#line hidden
#line 118 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar pb_pJ1;
#line default
#line hidden
#line 119 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock tb_pJ1;
#line default
#line hidden
#line 122 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar pb_pJ2;
#line default
#line hidden
#line 123 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox cb_ComList;
internal System.Windows.Controls.TextBlock tb_pJ2;
#line default
#line hidden
#line 126 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar pb_pJ3;
#line default
#line hidden
@ -181,39 +221,71 @@ namespace BigProject {
#line 127 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_Link;
internal System.Windows.Controls.TextBlock tb_pJ3;
#line default
#line hidden
#line 128 "..\..\MainWindow.xaml"
#line 130 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_LinkAuto;
internal System.Windows.Controls.ProgressBar pb_pJ4;
#line default
#line hidden
#line 140 "..\..\MainWindow.xaml"
#line 131 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_X;
internal System.Windows.Controls.TextBlock tb_pJ4;
#line default
#line hidden
#line 148 "..\..\MainWindow.xaml"
#line 134 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Y;
internal System.Windows.Controls.ProgressBar pb_pJ5;
#line default
#line hidden
#line 156 "..\..\MainWindow.xaml"
#line 135 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Z;
internal System.Windows.Controls.TextBlock tb_pJ5;
#line default
#line hidden
#line 138 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar pb_pJ6;
#line default
#line hidden
#line 139 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock tb_pJ6;
#line default
#line hidden
#line 144 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_ArmLoopStart;
#line default
#line hidden
#line 147 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_ArmLoopEnd;
#line default
#line hidden
@ -221,23 +293,31 @@ namespace BigProject {
#line 164 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_A;
internal System.Windows.Controls.ComboBox cb_ComList;
#line default
#line hidden
#line 172 "..\..\MainWindow.xaml"
#line 168 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_B;
internal System.Windows.Controls.Button bt_Link;
#line default
#line hidden
#line 180 "..\..\MainWindow.xaml"
#line 169 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_C;
internal System.Windows.Controls.Button bt_LinkAuto;
#line default
#line hidden
#line 181 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_X;
#line default
#line hidden
@ -245,7 +325,7 @@ namespace BigProject {
#line 189 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint1;
internal System.Windows.Controls.TextBox tb_Y;
#line default
#line hidden
@ -253,7 +333,7 @@ namespace BigProject {
#line 197 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint2;
internal System.Windows.Controls.TextBox tb_Z;
#line default
#line hidden
@ -261,7 +341,7 @@ namespace BigProject {
#line 205 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint3;
internal System.Windows.Controls.TextBox tb_A;
#line default
#line hidden
@ -269,7 +349,7 @@ namespace BigProject {
#line 213 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint4;
internal System.Windows.Controls.TextBox tb_B;
#line default
#line hidden
@ -277,13 +357,53 @@ namespace BigProject {
#line 221 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_C;
#line default
#line hidden
#line 230 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint1;
#line default
#line hidden
#line 238 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint2;
#line default
#line hidden
#line 246 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint3;
#line default
#line hidden
#line 254 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint4;
#line default
#line hidden
#line 262 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint5;
#line default
#line hidden
#line 229 "..\..\MainWindow.xaml"
#line 270 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint6;
@ -291,7 +411,7 @@ namespace BigProject {
#line hidden
#line 234 "..\..\MainWindow.xaml"
#line 275 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_Home;
@ -299,7 +419,7 @@ namespace BigProject {
#line hidden
#line 237 "..\..\MainWindow.xaml"
#line 278 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_StopNow;
@ -307,7 +427,7 @@ namespace BigProject {
#line hidden
#line 242 "..\..\MainWindow.xaml"
#line 283 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_FK;
@ -315,7 +435,7 @@ namespace BigProject {
#line hidden
#line 245 "..\..\MainWindow.xaml"
#line 286 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_IK;
@ -323,7 +443,7 @@ namespace BigProject {
#line hidden
#line 250 "..\..\MainWindow.xaml"
#line 291 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_MoveJoint;
@ -331,7 +451,7 @@ namespace BigProject {
#line hidden
#line 253 "..\..\MainWindow.xaml"
#line 294 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_GetCurrentAngle;
@ -339,7 +459,7 @@ namespace BigProject {
#line hidden
#line 258 "..\..\MainWindow.xaml"
#line 299 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_MoveArmHand;
@ -347,7 +467,7 @@ namespace BigProject {
#line hidden
#line 261 "..\..\MainWindow.xaml"
#line 302 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_AddRecord;
@ -355,7 +475,7 @@ namespace BigProject {
#line hidden
#line 266 "..\..\MainWindow.xaml"
#line 307 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_MoveLoop;
@ -363,7 +483,7 @@ namespace BigProject {
#line hidden
#line 269 "..\..\MainWindow.xaml"
#line 310 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_MoveLoopStop;
@ -371,7 +491,7 @@ namespace BigProject {
#line hidden
#line 274 "..\..\MainWindow.xaml"
#line 315 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_DeleteRecord;
@ -379,7 +499,7 @@ namespace BigProject {
#line hidden
#line 280 "..\..\MainWindow.xaml"
#line 321 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tbLog;
@ -507,162 +627,219 @@ namespace BigProject {
this.tb_ClawPower = ((System.Windows.Controls.TextBlock)(target));
return;
case 17:
this.cb_ComList = ((System.Windows.Controls.ComboBox)(target));
this.gb_ArmControl = ((System.Windows.Controls.GroupBox)(target));
return;
case 18:
this.pb_pJ1 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 19:
this.tb_pJ1 = ((System.Windows.Controls.TextBlock)(target));
return;
case 20:
this.pb_pJ2 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 21:
this.tb_pJ2 = ((System.Windows.Controls.TextBlock)(target));
return;
case 22:
this.pb_pJ3 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 23:
this.tb_pJ3 = ((System.Windows.Controls.TextBlock)(target));
return;
case 24:
this.pb_pJ4 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 25:
this.tb_pJ4 = ((System.Windows.Controls.TextBlock)(target));
return;
case 26:
this.pb_pJ5 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 27:
this.tb_pJ5 = ((System.Windows.Controls.TextBlock)(target));
return;
case 28:
this.pb_pJ6 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 29:
this.tb_pJ6 = ((System.Windows.Controls.TextBlock)(target));
return;
case 30:
this.bt_ArmLoopStart = ((System.Windows.Controls.Button)(target));
#line 144 "..\..\MainWindow.xaml"
this.bt_ArmLoopStart.Click += new System.Windows.RoutedEventHandler(this.bt_ArmLoopStart_Click);
#line default
#line hidden
return;
case 31:
this.bt_ArmLoopEnd = ((System.Windows.Controls.Button)(target));
#line 147 "..\..\MainWindow.xaml"
this.bt_ArmLoopEnd.Click += new System.Windows.RoutedEventHandler(this.bt_ArmLoopEnd_Click);
#line default
#line hidden
return;
case 32:
this.cb_ComList = ((System.Windows.Controls.ComboBox)(target));
return;
case 33:
this.bt_Link = ((System.Windows.Controls.Button)(target));
#line 127 "..\..\MainWindow.xaml"
#line 168 "..\..\MainWindow.xaml"
this.bt_Link.Click += new System.Windows.RoutedEventHandler(this.bt_Link_Click);
#line default
#line hidden
return;
case 19:
case 34:
this.bt_LinkAuto = ((System.Windows.Controls.Button)(target));
#line 128 "..\..\MainWindow.xaml"
#line 169 "..\..\MainWindow.xaml"
this.bt_LinkAuto.Click += new System.Windows.RoutedEventHandler(this.bt_LinkAuto_Click);
#line default
#line hidden
return;
case 20:
case 35:
this.tb_X = ((System.Windows.Controls.TextBox)(target));
return;
case 21:
case 36:
this.tb_Y = ((System.Windows.Controls.TextBox)(target));
return;
case 22:
case 37:
this.tb_Z = ((System.Windows.Controls.TextBox)(target));
return;
case 23:
case 38:
this.tb_A = ((System.Windows.Controls.TextBox)(target));
return;
case 24:
case 39:
this.tb_B = ((System.Windows.Controls.TextBox)(target));
return;
case 25:
case 40:
this.tb_C = ((System.Windows.Controls.TextBox)(target));
return;
case 26:
case 41:
this.tb_Joint1 = ((System.Windows.Controls.TextBox)(target));
return;
case 27:
case 42:
this.tb_Joint2 = ((System.Windows.Controls.TextBox)(target));
return;
case 28:
case 43:
this.tb_Joint3 = ((System.Windows.Controls.TextBox)(target));
return;
case 29:
case 44:
this.tb_Joint4 = ((System.Windows.Controls.TextBox)(target));
return;
case 30:
case 45:
this.tb_Joint5 = ((System.Windows.Controls.TextBox)(target));
return;
case 31:
case 46:
this.tb_Joint6 = ((System.Windows.Controls.TextBox)(target));
return;
case 32:
case 47:
this.bt_Home = ((System.Windows.Controls.Button)(target));
#line 234 "..\..\MainWindow.xaml"
#line 275 "..\..\MainWindow.xaml"
this.bt_Home.Click += new System.Windows.RoutedEventHandler(this.bt_Home_Click);
#line default
#line hidden
return;
case 33:
case 48:
this.bt_StopNow = ((System.Windows.Controls.Button)(target));
#line 237 "..\..\MainWindow.xaml"
#line 278 "..\..\MainWindow.xaml"
this.bt_StopNow.Click += new System.Windows.RoutedEventHandler(this.bt_StopNow_Click);
#line default
#line hidden
return;
case 34:
case 49:
this.bt_FK = ((System.Windows.Controls.Button)(target));
#line 242 "..\..\MainWindow.xaml"
#line 283 "..\..\MainWindow.xaml"
this.bt_FK.Click += new System.Windows.RoutedEventHandler(this.bt_FK_Click);
#line default
#line hidden
return;
case 35:
case 50:
this.bt_IK = ((System.Windows.Controls.Button)(target));
#line 245 "..\..\MainWindow.xaml"
#line 286 "..\..\MainWindow.xaml"
this.bt_IK.Click += new System.Windows.RoutedEventHandler(this.bt_IK_Click);
#line default
#line hidden
return;
case 36:
case 51:
this.bt_MoveJoint = ((System.Windows.Controls.Button)(target));
#line 250 "..\..\MainWindow.xaml"
#line 291 "..\..\MainWindow.xaml"
this.bt_MoveJoint.Click += new System.Windows.RoutedEventHandler(this.bt_MoveJoint_Click);
#line default
#line hidden
return;
case 37:
case 52:
this.bt_GetCurrentAngle = ((System.Windows.Controls.Button)(target));
#line 253 "..\..\MainWindow.xaml"
#line 294 "..\..\MainWindow.xaml"
this.bt_GetCurrentAngle.Click += new System.Windows.RoutedEventHandler(this.bt_GetCurrentAngle_Click);
#line default
#line hidden
return;
case 38:
case 53:
this.bt_MoveArmHand = ((System.Windows.Controls.Button)(target));
#line 258 "..\..\MainWindow.xaml"
#line 299 "..\..\MainWindow.xaml"
this.bt_MoveArmHand.Click += new System.Windows.RoutedEventHandler(this.bt_MoveArmHand_Click);
#line default
#line hidden
return;
case 39:
case 54:
this.bt_AddRecord = ((System.Windows.Controls.Button)(target));
#line 261 "..\..\MainWindow.xaml"
#line 302 "..\..\MainWindow.xaml"
this.bt_AddRecord.Click += new System.Windows.RoutedEventHandler(this.bt_AddRecord_Click);
#line default
#line hidden
return;
case 40:
case 55:
this.bt_MoveLoop = ((System.Windows.Controls.Button)(target));
#line 266 "..\..\MainWindow.xaml"
#line 307 "..\..\MainWindow.xaml"
this.bt_MoveLoop.Click += new System.Windows.RoutedEventHandler(this.bt_MoveLoop_Click);
#line default
#line hidden
return;
case 41:
case 56:
this.bt_MoveLoopStop = ((System.Windows.Controls.Button)(target));
#line 269 "..\..\MainWindow.xaml"
#line 310 "..\..\MainWindow.xaml"
this.bt_MoveLoopStop.Click += new System.Windows.RoutedEventHandler(this.bt_MoveLoopStop_Click);
#line default
#line hidden
return;
case 42:
case 57:
this.bt_DeleteRecord = ((System.Windows.Controls.Button)(target));
#line 274 "..\..\MainWindow.xaml"
#line 315 "..\..\MainWindow.xaml"
this.bt_DeleteRecord.Click += new System.Windows.RoutedEventHandler(this.bt_DeleteRecord_Click);
#line default
#line hidden
return;
case 43:
case 58:
this.tbLog = ((System.Windows.Controls.TextBox)(target));
return;
}

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F5DD72F16D68E4F0E6DBCCC8F6159A9ACE9E25AAB6E92C6610282B857FEC769B"
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "09AAE9EA592DD6EBFD2973574989360EC3B1DE396ED87A3ED0223A48FDB87157"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -171,9 +171,49 @@ namespace BigProject {
#line hidden
#line 113 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox gb_ArmControl;
#line default
#line hidden
#line 118 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar pb_pJ1;
#line default
#line hidden
#line 119 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock tb_pJ1;
#line default
#line hidden
#line 122 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar pb_pJ2;
#line default
#line hidden
#line 123 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox cb_ComList;
internal System.Windows.Controls.TextBlock tb_pJ2;
#line default
#line hidden
#line 126 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar pb_pJ3;
#line default
#line hidden
@ -181,39 +221,71 @@ namespace BigProject {
#line 127 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_Link;
internal System.Windows.Controls.TextBlock tb_pJ3;
#line default
#line hidden
#line 128 "..\..\MainWindow.xaml"
#line 130 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_LinkAuto;
internal System.Windows.Controls.ProgressBar pb_pJ4;
#line default
#line hidden
#line 140 "..\..\MainWindow.xaml"
#line 131 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_X;
internal System.Windows.Controls.TextBlock tb_pJ4;
#line default
#line hidden
#line 148 "..\..\MainWindow.xaml"
#line 134 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Y;
internal System.Windows.Controls.ProgressBar pb_pJ5;
#line default
#line hidden
#line 156 "..\..\MainWindow.xaml"
#line 135 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Z;
internal System.Windows.Controls.TextBlock tb_pJ5;
#line default
#line hidden
#line 138 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ProgressBar pb_pJ6;
#line default
#line hidden
#line 139 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock tb_pJ6;
#line default
#line hidden
#line 144 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_ArmLoopStart;
#line default
#line hidden
#line 147 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_ArmLoopEnd;
#line default
#line hidden
@ -221,23 +293,31 @@ namespace BigProject {
#line 164 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_A;
internal System.Windows.Controls.ComboBox cb_ComList;
#line default
#line hidden
#line 172 "..\..\MainWindow.xaml"
#line 168 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_B;
internal System.Windows.Controls.Button bt_Link;
#line default
#line hidden
#line 180 "..\..\MainWindow.xaml"
#line 169 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_C;
internal System.Windows.Controls.Button bt_LinkAuto;
#line default
#line hidden
#line 181 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_X;
#line default
#line hidden
@ -245,7 +325,7 @@ namespace BigProject {
#line 189 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint1;
internal System.Windows.Controls.TextBox tb_Y;
#line default
#line hidden
@ -253,7 +333,7 @@ namespace BigProject {
#line 197 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint2;
internal System.Windows.Controls.TextBox tb_Z;
#line default
#line hidden
@ -261,7 +341,7 @@ namespace BigProject {
#line 205 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint3;
internal System.Windows.Controls.TextBox tb_A;
#line default
#line hidden
@ -269,7 +349,7 @@ namespace BigProject {
#line 213 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint4;
internal System.Windows.Controls.TextBox tb_B;
#line default
#line hidden
@ -277,13 +357,53 @@ namespace BigProject {
#line 221 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_C;
#line default
#line hidden
#line 230 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint1;
#line default
#line hidden
#line 238 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint2;
#line default
#line hidden
#line 246 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint3;
#line default
#line hidden
#line 254 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint4;
#line default
#line hidden
#line 262 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint5;
#line default
#line hidden
#line 229 "..\..\MainWindow.xaml"
#line 270 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tb_Joint6;
@ -291,7 +411,7 @@ namespace BigProject {
#line hidden
#line 234 "..\..\MainWindow.xaml"
#line 275 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_Home;
@ -299,7 +419,7 @@ namespace BigProject {
#line hidden
#line 237 "..\..\MainWindow.xaml"
#line 278 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_StopNow;
@ -307,7 +427,7 @@ namespace BigProject {
#line hidden
#line 242 "..\..\MainWindow.xaml"
#line 283 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_FK;
@ -315,7 +435,7 @@ namespace BigProject {
#line hidden
#line 245 "..\..\MainWindow.xaml"
#line 286 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_IK;
@ -323,7 +443,7 @@ namespace BigProject {
#line hidden
#line 250 "..\..\MainWindow.xaml"
#line 291 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_MoveJoint;
@ -331,7 +451,7 @@ namespace BigProject {
#line hidden
#line 253 "..\..\MainWindow.xaml"
#line 294 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_GetCurrentAngle;
@ -339,7 +459,7 @@ namespace BigProject {
#line hidden
#line 258 "..\..\MainWindow.xaml"
#line 299 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_MoveArmHand;
@ -347,7 +467,7 @@ namespace BigProject {
#line hidden
#line 261 "..\..\MainWindow.xaml"
#line 302 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_AddRecord;
@ -355,7 +475,7 @@ namespace BigProject {
#line hidden
#line 266 "..\..\MainWindow.xaml"
#line 307 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_MoveLoop;
@ -363,7 +483,7 @@ namespace BigProject {
#line hidden
#line 269 "..\..\MainWindow.xaml"
#line 310 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_MoveLoopStop;
@ -371,7 +491,7 @@ namespace BigProject {
#line hidden
#line 274 "..\..\MainWindow.xaml"
#line 315 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button bt_DeleteRecord;
@ -379,7 +499,7 @@ namespace BigProject {
#line hidden
#line 280 "..\..\MainWindow.xaml"
#line 321 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox tbLog;
@ -507,162 +627,219 @@ namespace BigProject {
this.tb_ClawPower = ((System.Windows.Controls.TextBlock)(target));
return;
case 17:
this.cb_ComList = ((System.Windows.Controls.ComboBox)(target));
this.gb_ArmControl = ((System.Windows.Controls.GroupBox)(target));
return;
case 18:
this.pb_pJ1 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 19:
this.tb_pJ1 = ((System.Windows.Controls.TextBlock)(target));
return;
case 20:
this.pb_pJ2 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 21:
this.tb_pJ2 = ((System.Windows.Controls.TextBlock)(target));
return;
case 22:
this.pb_pJ3 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 23:
this.tb_pJ3 = ((System.Windows.Controls.TextBlock)(target));
return;
case 24:
this.pb_pJ4 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 25:
this.tb_pJ4 = ((System.Windows.Controls.TextBlock)(target));
return;
case 26:
this.pb_pJ5 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 27:
this.tb_pJ5 = ((System.Windows.Controls.TextBlock)(target));
return;
case 28:
this.pb_pJ6 = ((System.Windows.Controls.ProgressBar)(target));
return;
case 29:
this.tb_pJ6 = ((System.Windows.Controls.TextBlock)(target));
return;
case 30:
this.bt_ArmLoopStart = ((System.Windows.Controls.Button)(target));
#line 144 "..\..\MainWindow.xaml"
this.bt_ArmLoopStart.Click += new System.Windows.RoutedEventHandler(this.bt_ArmLoopStart_Click);
#line default
#line hidden
return;
case 31:
this.bt_ArmLoopEnd = ((System.Windows.Controls.Button)(target));
#line 147 "..\..\MainWindow.xaml"
this.bt_ArmLoopEnd.Click += new System.Windows.RoutedEventHandler(this.bt_ArmLoopEnd_Click);
#line default
#line hidden
return;
case 32:
this.cb_ComList = ((System.Windows.Controls.ComboBox)(target));
return;
case 33:
this.bt_Link = ((System.Windows.Controls.Button)(target));
#line 127 "..\..\MainWindow.xaml"
#line 168 "..\..\MainWindow.xaml"
this.bt_Link.Click += new System.Windows.RoutedEventHandler(this.bt_Link_Click);
#line default
#line hidden
return;
case 19:
case 34:
this.bt_LinkAuto = ((System.Windows.Controls.Button)(target));
#line 128 "..\..\MainWindow.xaml"
#line 169 "..\..\MainWindow.xaml"
this.bt_LinkAuto.Click += new System.Windows.RoutedEventHandler(this.bt_LinkAuto_Click);
#line default
#line hidden
return;
case 20:
case 35:
this.tb_X = ((System.Windows.Controls.TextBox)(target));
return;
case 21:
case 36:
this.tb_Y = ((System.Windows.Controls.TextBox)(target));
return;
case 22:
case 37:
this.tb_Z = ((System.Windows.Controls.TextBox)(target));
return;
case 23:
case 38:
this.tb_A = ((System.Windows.Controls.TextBox)(target));
return;
case 24:
case 39:
this.tb_B = ((System.Windows.Controls.TextBox)(target));
return;
case 25:
case 40:
this.tb_C = ((System.Windows.Controls.TextBox)(target));
return;
case 26:
case 41:
this.tb_Joint1 = ((System.Windows.Controls.TextBox)(target));
return;
case 27:
case 42:
this.tb_Joint2 = ((System.Windows.Controls.TextBox)(target));
return;
case 28:
case 43:
this.tb_Joint3 = ((System.Windows.Controls.TextBox)(target));
return;
case 29:
case 44:
this.tb_Joint4 = ((System.Windows.Controls.TextBox)(target));
return;
case 30:
case 45:
this.tb_Joint5 = ((System.Windows.Controls.TextBox)(target));
return;
case 31:
case 46:
this.tb_Joint6 = ((System.Windows.Controls.TextBox)(target));
return;
case 32:
case 47:
this.bt_Home = ((System.Windows.Controls.Button)(target));
#line 234 "..\..\MainWindow.xaml"
#line 275 "..\..\MainWindow.xaml"
this.bt_Home.Click += new System.Windows.RoutedEventHandler(this.bt_Home_Click);
#line default
#line hidden
return;
case 33:
case 48:
this.bt_StopNow = ((System.Windows.Controls.Button)(target));
#line 237 "..\..\MainWindow.xaml"
#line 278 "..\..\MainWindow.xaml"
this.bt_StopNow.Click += new System.Windows.RoutedEventHandler(this.bt_StopNow_Click);
#line default
#line hidden
return;
case 34:
case 49:
this.bt_FK = ((System.Windows.Controls.Button)(target));
#line 242 "..\..\MainWindow.xaml"
#line 283 "..\..\MainWindow.xaml"
this.bt_FK.Click += new System.Windows.RoutedEventHandler(this.bt_FK_Click);
#line default
#line hidden
return;
case 35:
case 50:
this.bt_IK = ((System.Windows.Controls.Button)(target));
#line 245 "..\..\MainWindow.xaml"
#line 286 "..\..\MainWindow.xaml"
this.bt_IK.Click += new System.Windows.RoutedEventHandler(this.bt_IK_Click);
#line default
#line hidden
return;
case 36:
case 51:
this.bt_MoveJoint = ((System.Windows.Controls.Button)(target));
#line 250 "..\..\MainWindow.xaml"
#line 291 "..\..\MainWindow.xaml"
this.bt_MoveJoint.Click += new System.Windows.RoutedEventHandler(this.bt_MoveJoint_Click);
#line default
#line hidden
return;
case 37:
case 52:
this.bt_GetCurrentAngle = ((System.Windows.Controls.Button)(target));
#line 253 "..\..\MainWindow.xaml"
#line 294 "..\..\MainWindow.xaml"
this.bt_GetCurrentAngle.Click += new System.Windows.RoutedEventHandler(this.bt_GetCurrentAngle_Click);
#line default
#line hidden
return;
case 38:
case 53:
this.bt_MoveArmHand = ((System.Windows.Controls.Button)(target));
#line 258 "..\..\MainWindow.xaml"
#line 299 "..\..\MainWindow.xaml"
this.bt_MoveArmHand.Click += new System.Windows.RoutedEventHandler(this.bt_MoveArmHand_Click);
#line default
#line hidden
return;
case 39:
case 54:
this.bt_AddRecord = ((System.Windows.Controls.Button)(target));
#line 261 "..\..\MainWindow.xaml"
#line 302 "..\..\MainWindow.xaml"
this.bt_AddRecord.Click += new System.Windows.RoutedEventHandler(this.bt_AddRecord_Click);
#line default
#line hidden
return;
case 40:
case 55:
this.bt_MoveLoop = ((System.Windows.Controls.Button)(target));
#line 266 "..\..\MainWindow.xaml"
#line 307 "..\..\MainWindow.xaml"
this.bt_MoveLoop.Click += new System.Windows.RoutedEventHandler(this.bt_MoveLoop_Click);
#line default
#line hidden
return;
case 41:
case 56:
this.bt_MoveLoopStop = ((System.Windows.Controls.Button)(target));
#line 269 "..\..\MainWindow.xaml"
#line 310 "..\..\MainWindow.xaml"
this.bt_MoveLoopStop.Click += new System.Windows.RoutedEventHandler(this.bt_MoveLoopStop_Click);
#line default
#line hidden
return;
case 42:
case 57:
this.bt_DeleteRecord = ((System.Windows.Controls.Button)(target));
#line 274 "..\..\MainWindow.xaml"
#line 315 "..\..\MainWindow.xaml"
this.bt_DeleteRecord.Click += new System.Windows.RoutedEventHandler(this.bt_DeleteRecord_Click);
#line default
#line hidden
return;
case 43:
case 58:
this.tbLog = ((System.Windows.Controls.TextBox)(target));
return;
}

View File

@ -11,6 +11,7 @@
<package id="Microsoft.Win32.Registry" version="5.0.0" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="Rubyer" version="2.16.7" targetFramework="net472" />
<package id="SerialPortStream" version="2.4.2" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Security.AccessControl" version="5.0.0" targetFramework="net472" />
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net472" />