Commit e5817e1c 刘韬

1

1 个父辈 1d786b63
......@@ -44,17 +44,24 @@ namespace OnlineStore.Common
[MyConfigComment("URRobot_MI1_IP")]
public static MyConfig<string> URRobot_MI1_IP;
[MyConfigComment("URRobot_MI1_监听端口")]
public static MyConfig<int> URRobot_MI1_ListenPort = 21;
[MyConfigComment("URRobot_MI1_速度倍率")]
public static MyConfig<int> URRobot_MI1_Speed_Rate = 50;
[MyConfigComment("URRobot_MI2_IP")]
public static MyConfig<string> URRobot_MI2_IP;
[MyConfigComment("URRobot_MI2_监听端口")]
public static MyConfig<int> URRobot_MI2_ListenPort = 41;
[MyConfigComment("URRobot_MI2_速度倍率")]
public static MyConfig<int> URRobot_MI2_Speed_Rate = 50;
[MyConfigComment("URRobot_CI_IP")]
public static MyConfig<string> URRobot_CI_IP;
[MyConfigComment("URRobot_CI_速度倍率")]
public static MyConfig<int> URRobot_CI_Speed_Rate = 50;
[MyConfigComment("URRobot_CI_监听端口")]
public static MyConfig<int> URRobot_CI_ListenPort = 31;
......
......@@ -45,7 +45,7 @@ namespace DeviceLibrary
{
robot.SendCMD("unlock protective stop", 0);
lastWeight = lastWeight + 1;
if (lastWeight > 4)
if (lastWeight > 3)
lastWeight = 1;
robot.log("触发保护性停止,调节负载重量:" + lastWeight);
return;
......@@ -110,19 +110,20 @@ namespace DeviceLibrary
}
public bool IsMoveOk(WaitResultInfo waitResultInfo) {
if (robot.CurCmdReponse.Contains($"{lastMoveCmd},done"))
//if (robot.CurCmdReponse.Contains($"{lastMoveCmd},done"))
if (robot.CurCmdReponse.StartsWith(lastMoveCmd.ToString()) && robot.CurCmdReponse.EndsWith("done"))
return true;
else if (robot.CurCmdReponse.Contains($"done") || retrytime>1)
{
retrytime = 0;
LogUtil.error($"机器人没有移动到位,重新移动:{lastMoveCmd},{lastWeight}");
robot.log($"机器人没有移动到位,重新移动:{lastMoveCmd},{lastWeight},{robot.CurCmdReponse}");
robot.SendMoveCmd(lastMoveCmd, lastSpeedRate, false, LoadRateParam[lastWeight]);
return false;
}
else if ((DateTime.Now - LastMoveTime).TotalSeconds>30) {
retrytime++;
LastMoveTime = DateTime.Now;
LogUtil.error($"机器人超过30秒没有反馈,停止程序重试");
robot.log($"机器人超过30秒没有反馈,停止程序重试");
robot.StopProgram();
return false;
}
......@@ -141,12 +142,12 @@ namespace DeviceLibrary
/// key=load kg, value = load lb,x,y,z
/// </summary>
public static Dictionary<int, float[]> LoadRateParam = new Dictionary<int, float[]>() {
{ 0, new float[] { 4.5f, 0, 37 / 100f, 100 / 100f } },
{ 1, new float[] { 5.5f, 0, 37 / 100f, 146 / 100f } },
{ 2, new float[] { 6.5f, 0, 37 / 100f, 174 / 100f } },
{ 3, new float[] { 7.5f, 0, 37 / 100f, 204 / 100f } },
{ 4, new float[] { 8.5f, 0, 37 / 100f, 212 / 100f } },
{ 5, new float[] { 9.5f, 0, 37 / 100f, 224 / 100f } }
{ 0, new float[] { 4.5f, 0, 37 / 1000f, 100 / 1000f } },
{ 1, new float[] { 5.5f, 0, 37 / 1000f, 146 / 1000f } },
{ 2, new float[] { 6.5f, 0, 37 / 1000f, 174 / 1000f } },
{ 3, new float[] { 7.5f, 0, 37 / 1000f, 204 / 1000f } },
{ 4, new float[] { 8.5f, 0, 37 / 1000f, 212 / 1000f } },
{ 5, new float[] { 9.5f, 0, 37 / 1000f, 224 / 1000f } }
};
//public static Dictionary<int, float[]> LoadRateParam = new Dictionary<int, float[]>() {
......
......@@ -344,6 +344,15 @@ namespace DeviceLibrary
public Dictionary<string, string> data { get; set; }
}
public class ResultData2
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public object data { get; set; }
}
/// <summary>
///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
///2=急停,3=故障,4=警告,5=调试
......
......@@ -424,7 +424,17 @@ namespace DeviceLibrary
}
else
{
var ngReel = false;
var ngMsg = "";
if (data.ContainsKey("ngReel") && data["ngReel"].ToLower() == "true")
{
ngReel = true;
data.TryGetValue("ngMsg", out ngMsg);
}
JobInfo jobInfo = new JobInfo(code, posIdStr, plateW, plateH);
jobInfo.isNG = ngReel;
jobInfo.NgMsg = ngMsg;
OutStoreEvent?.Invoke(crc.GetString("Res0064","服务器"), jobInfo);
}
......@@ -455,7 +465,7 @@ namespace DeviceLibrary
string resultStr = HttpHelper.Post(server, "");
VLog.Info("cancelPutInTask " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
ResultData data = JsonHelper.DeserializeJsonToObject<ResultData>(resultStr);
ResultData2 data = JsonHelper.DeserializeJsonToObject<ResultData2>(resultStr);
if (data == null)
{
......@@ -546,6 +556,8 @@ namespace DeviceLibrary
lock (VStoreCollection.OutStoreReelInfo)
{
VStoreCollection.OutStoreReelInfo[jobInfo.WareNum] = new JobInfo(jobInfo.WareNum, "", reelinfo.Diameter, reelinfo.Height);
VStoreCollection.OutStoreReelInfo[jobInfo.WareNum].isNG = jobInfo.isNG;
VStoreCollection.OutStoreReelInfo[jobInfo.WareNum].NgMsg = jobInfo.NgMsg;
Setting_Init.Runtime_OutStoreReelInfo = JsonConvert.SerializeObject(VStoreCollection.OutStoreReelInfo);
}
vLog.Info("出库时获取到料盘数据:" + VStoreCollection.OutStoreReelInfo[jobInfo.WareNum].ToStr());
......@@ -562,22 +574,25 @@ namespace DeviceLibrary
}
return true;
}
public bool BeginInStore(string towerid, JobInfo jobInfo, VLog vLog)
public bool BeginInStore(string towerid, JobInfo jobInfo)
{
if (!SendCommand(VCmd.SimulateStartButton, true, out string data, towerid, jobInfo.WareNum))
{
vLog.Error(data);
VLog.Error(data);
return false;
}
var result = XmlCommandSerializer.DeserializeResult(data);
if (result.Errorcode != 0)
{
vLog.Error(data);
VLog.Error(data);
return false;
}
return true;
}
MydataWcfServiceTest.ServiceReference2.TowerAppWSClient towerAppWSClient;
/// <summary>
/// 存储MyCronic料仓的剩余容量 7X8=1000;7X12=345;13X32=100;
/// </summary>
internal string capacity;
public bool SendCommand(string command, bool needlog, out string msg, params string[] arg)
......
......@@ -59,6 +59,7 @@ namespace DeviceLibrary
ServerCM.storeStatus = StoreStatus.None;
CurrentTowerStatusText = "Disable";
RTStoreStatus = RTStoreStatus.Offline;
TerminalError=false;
return;
}
......@@ -161,7 +162,7 @@ namespace DeviceLibrary
VLog.Info("物料已在舱口");
RTStoreStatus = RTStoreStatus.InStoreReady;
if (!ServerCM.BeginInStore(CID, InStoreJobInfo, VLog))
if (!ServerCM.BeginInStore(CID, InStoreJobInfo))
{
RTStoreStatus = RTStoreStatus.LockToInStore;
//Msg.add(CID + crc.GetString("Res0051", "无法入库"), MsgLevel.alarm);
......@@ -179,14 +180,13 @@ namespace DeviceLibrary
VLog.Info("出库执行中");
RTStoreStatus = RTStoreStatus.OutMoveExecute;
}
else if (ti.StatusCode == 1041)
else if (ti.StatusCode == 1041) //出库到舱门口
{
if (InStoreJobInfo == null)
if (InStoreJobInfo == null) //没有入库信息,判断是正常出库
{
if (RTStoreStatus != RTStoreStatus.OutStoreReady)
{
VLog.Info("出库物料已到舱门口:" + CurrentTerminalReelID);
InStoreJobInfo = null;
OutStoreEnd(CurrentTerminalReelID, CID);
}
......@@ -319,7 +319,9 @@ namespace DeviceLibrary
return crc.GetString("Res0070","空闲中");
}
/// <summary>
/// 当前入库任务信息
/// </summary>
public volatile JobInfo InStoreJobInfo;
StoreJobList OutStoreJobList;
public void RequestInStore(JobInfo jobInfo) {
......
......@@ -84,6 +84,9 @@ namespace DeviceLibrary
public int plateH { get; set; }
public string CID { get; set; }
public bool isNG { get; set; }
public string NgMsg { get; set; }
public string ToStr()
{
return "TrayCode【" + TrayCode + "】,WareNum=【" + WareNum + "】,PosId=【" + PosId + "】,plateW=【" + plateW + "】,plateH=【" + plateH + "】,CID=【" + CID + "】";
......
......@@ -67,13 +67,13 @@ namespace DeviceLibrary
MI2Postion = CSVPositionReader<RobotPosition>.LoadCSVFile(MI2PostionFile);
CIPostion = CSVPositionReader<RobotPosition>.LoadCSVFile(CIPostionFile);
Robot_MI1 = new URRobotControl(Setting_Init.URRobot_MI1_IP, "Robot-R1");
Robot_MI1 = new URRobotControl(Setting_Init.URRobot_MI1_IP, "Robot-R1", Setting_Init.URRobot_MI1_ListenPort);
Robot_MI1.Name = "R1";
Robot_MI1.SetSpeedRate(Setting_Init.URRobot_MI1_Speed_Rate);
Robot_MI2 = new URRobotControl(Setting_Init.URRobot_MI2_IP, "Robot-R2");
Robot_MI2 = new URRobotControl(Setting_Init.URRobot_MI2_IP, "Robot-R2", Setting_Init.URRobot_MI2_ListenPort);
Robot_MI2.Name = "R2";
Robot_MI2.SetSpeedRate(Setting_Init.URRobot_MI2_Speed_Rate);
Robot_CI = new URRobotControl(Setting_Init.URRobot_CI_IP, "Robot-CI");
Robot_CI = new URRobotControl(Setting_Init.URRobot_CI_IP, "Robot-CI", Setting_Init.URRobot_CI_ListenPort);
Robot_CI.SetSpeedRate(Setting_Init.URRobot_CI_Speed_Rate);
VStoreCollection = new VStoreCollection();
......
......@@ -142,14 +142,6 @@ namespace DeviceLibrary
public static bool CalcNeedTrans(int curaddr1, int destaddr1, bool hasload,TrayTypeE trayType) {
if (!hasload)
{
if (curaddr1 == 19 && RobotManage.mainMachine.ServerCM.OutMaterialTaskCount > Setting_Init.Device_LS3_MTP2_OutTaskMaxCount && trayType== TrayTypeE.MTP2)
{
return true;
}
if (curaddr1 == 19 && RobotManage.mainMachine.ServerCM.OutReelTaskCount > Setting_Init.Device_LS3_MTP1_OutTaskMaxCount && trayType == TrayTypeE.MTP1)
{
return true;
}
var addrs = TrayRequest.Values.Where(x=>x.TrayType==trayType.ToString()).Select(x => new { TaryType = x.GetTrayType, Addr = GetAddrByGroupName(x.DeviceGroupName) }).ToList();
foreach (var a in addrs)
{
......@@ -168,7 +160,15 @@ namespace DeviceLibrary
var ts = dis(a.Addr, ttt);
return !(trayaddrs.Where(t1 => dis(a.Addr, t1) < ts).Count() > 0);
};
//ls3处判断,出库任务数量大于值时治具托盘全部从LS3转移走
if (curaddr1 == 19 && RobotManage.mainMachine?.ServerCM.OutMaterialTaskCount > Setting_Init.Device_LS3_MTP2_OutTaskMaxCount && trayType == TrayTypeE.MTP2)
{
return true;
}
if (curaddr1 == 19 && RobotManage.mainMachine?.ServerCM.OutReelTaskCount > Setting_Init.Device_LS3_MTP1_OutTaskMaxCount && trayType == TrayTypeE.MTP1)
{
return true;
}
return false;
}
else
......@@ -453,9 +453,15 @@ namespace DeviceLibrary
/// </summary>
/// <returns></returns>
public static int GetAddrByGroupName(string groupname) {
var addr = AddrDesc.Where(a => a.Value == groupname).First();
return addr.Key;
try
{
var addr = AddrDesc.Where(a => a.Value == groupname).First();
return addr.Key;
}
catch (Exception ex) {
LogUtil.error($"GetAddrByGroupName: " + groupname + "," + ex);
return -1;
}
}
}
}
\ No newline at end of file
......@@ -154,6 +154,11 @@ namespace DeviceLibrary
switch (MoveInfo.MoveStep)
{
case MoveStep.Wait:
if (IOValue(IO_Type.MI_Robot_Reel_Check).Equals(IO_VALUE.HIGH)) {
Msg.add(crc.GetString("Res0106.217fe7b7","待机时机械手上检测到物料,请检查"), MsgLevel.alarm);
MoveInfo.log("待机时机械手上检测到物料,请检查");
return;
}
//判断有无出库任务
var testInStoreError = VStoreCollection.VStoreList.Values.Where(vs=>vs.TowerInfo.DeviceGroupName==GroupName).ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.InStoreError || vs.RTStoreStatus == RTStoreStatus.InStoreDataTimeOut || vs.TerminalError);
var hasoutjob = false;
......@@ -260,8 +265,8 @@ namespace DeviceLibrary
CurrentJobInfo = new JobInfo(InStoreError.CurrentTerminalReelID, "", int.Parse(result.data["plateW"]), int.Parse(result.data["plateH"]));
InStoreError.InStoreJobInfo = null;
MoveInfo.log("从服务器检索到物料数据:" + CurrentJobInfo.ToStr());
MoveInfo.MoveParam.IsNg = true;
MoveInfo.MoveParam.NgMsg = InStoreError.CID + "-" + InStoreError.CurrentTowerStatusText;
CurrentJobInfo.isNG = true;
CurrentJobInfo.NgMsg = InStoreError.CID + "-" + InStoreError.CurrentTowerStatusText;
MoveInfo.log("检测到有料仓入库NG:" + MoveInfo.MoveParam.NgMsg);
}
......@@ -318,6 +323,8 @@ namespace DeviceLibrary
MoveInfo.MoveParam.PosID = CurrentJobInfo.PosId;
MoveInfo.MoveParam.PlateW = CurrentJobInfo.plateW;
MoveInfo.MoveParam.PlateH = CurrentJobInfo.plateH;
MoveInfo.MoveParam.IsNg = CurrentJobInfo.isNG;
MoveInfo.MoveParam.NgMsg = CurrentJobInfo.NgMsg;
MoveInfo.MoveParam.cid = CurrntOutReadyStore.CID;
FromPos = GetMIPosition(GroupName, TowerList.List[MoveInfo.MoveParam.cid].PosID);
ToPos = GetMIPosition(GroupName, POS_Start + "_MT");
......@@ -348,6 +355,7 @@ namespace DeviceLibrary
MoveInfo.log($"当前出库料仓[{CurrntOutReadyStore.CID}]存在状态错误:" + CurrntOutReadyStore.RTStoreStatus);
CurrntOutReadyStore.RTStoreStatus = RTStoreStatus.Busy;
}
MoveInfo.log($"机器人抓取状态:MI_Robot_Reel_Check:{IOValue(IO_Type.MI_Robot_Reel_Check)}, MI_Robot_Clamp_Check:{IOValue(IO_Type.MI_Robot_Clamp_Check)}");
if ((MoveInfo.MoveParam.IsNg || CurrntOutReadyStore.TerminalError) && IOValue(IO_Type.MI_Robot_Reel_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.MI_Robot_Clamp_Check).Equals(IO_VALUE.LOW))
{
......@@ -364,20 +372,21 @@ namespace DeviceLibrary
}
break;
case MoveStep.MI_53:
if (!TrayStop.DeviceList["AMH-" + POS_Start].IsFree())
if (!TrayStop.DeviceList[GroupName].IsFree())
{
MoveInfo.NextMoveStep(MoveStep.MI_54);
RoboMoveInfo.NextMoveStep(MoveStep.MI_40);
MoveInfo.log("机器人开始放料");
}
else {
//RemoteLoad remoteLoad = new RemoteLoad();
//remoteLoad.Action = "SetTrayRequest";
//remoteLoad.GroupName= "AMH-" + POS_Start;
//remoteLoad.RequestLoadInfo = new RequestLoadInfo();
//remoteLoad.RequestLoadInfo.TrayType = TrayTypeE.MTP1.ToString();
//remoteLoad.RequestLoadInfo.IsEmpty = true;
//TrayManager.SetTrayRequest(remoteLoad);
RemoteLoad remoteLoad = new RemoteLoad();
remoteLoad.Action = "SetTrayRequest";
remoteLoad.GroupName = GroupName;
remoteLoad.RequestLoadInfo = new RequestLoadInfo();
remoteLoad.RequestLoadInfo.TrayType = TrayTypeE.MTP1.ToString();
remoteLoad.RequestLoadInfo.IsEmpty = true;
remoteLoad.RequestLoadInfo.DeviceGroupName = GroupName;
TrayManager.SetTrayRequest(remoteLoad);
Msg.add(crc.GetString("Res0097.b5a12101","等待空托盘"), MsgLevel.info);
}
break;
......@@ -386,7 +395,7 @@ namespace DeviceLibrary
{
MoveInfo.log("机器人完成放料");
RemoteLoad remoteLoad = new RemoteLoad();
remoteLoad.GroupName = "AMH-" + POS_Start;
remoteLoad.GroupName = GroupName;
remoteLoad.RequestLoadInfo = new RequestLoadInfo();
remoteLoad.RequestLoadInfo.DeviceGroupName = "AMH-ML5-2";
remoteLoad.RequestLoadInfo.IsEmpty = false;
......@@ -394,7 +403,7 @@ namespace DeviceLibrary
remoteLoad.RequestLoadInfo.LoadParam = MoveInfo.MoveParam.clone();// 填充料盘信息
TrayManager.TrayRelease(remoteLoad); //这条会自动放行托盘并且写入托盘目的地
TheLine.UpdateLocInfo("", MoveInfo.MoveParam.WareCode, TheLine.LineStatusE.INLINE, CurrrentRFID);
TrayManager.ClearTrayRequest(GroupName);
MoveInfo.NextMoveStep(MoveStep.MI_55);
}
break;
......@@ -429,7 +438,7 @@ namespace DeviceLibrary
break;
case MoveStep.MI_02:
RoboMoveInfo.NextMoveStep(MoveStep.MI_03);
robotHelper.Move(RoboMoveInfo, FromPos.Take_P5,0);
robotHelper.Move(RoboMoveInfo, FromPos.Take_P5,1);
RoboMoveInfo.log("机器人到Take_P5");
break;
case MoveStep.MI_03:
......@@ -442,7 +451,7 @@ namespace DeviceLibrary
if (!Comp.IsBusy)
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_05);
robotHelper.Move(RoboMoveInfo, FromPos.Take_P6,0);
robotHelper.Move(RoboMoveInfo, FromPos.Take_P6,1);
RoboMoveInfo.log("压紧轴到位");
RoboMoveInfo.log("机器人到Take_P6");
}
......@@ -487,12 +496,12 @@ namespace DeviceLibrary
break;
case MoveStep.MI_42:
RoboMoveInfo.NextMoveStep(MoveStep.MI_43);
robotHelper.Move(RoboMoveInfo, ToPos.Put_P4,0);
robotHelper.Move(RoboMoveInfo, ToPos.Put_P4,1);
RoboMoveInfo.log("机器人到Put_P4");
break;
case MoveStep.MI_43:
RoboMoveInfo.NextMoveStep(MoveStep.MI_44);
robotHelper.Move(RoboMoveInfo, ToPos.P1, 0);
robotHelper.Move(RoboMoveInfo, ToPos.P1, 1);
RoboMoveInfo.log("机器人到P1");
break;
case MoveStep.MI_44:
......@@ -807,9 +816,9 @@ namespace DeviceLibrary
int GetWeight(ReelParam reelParam) {
int w = 0;
if (reelParam == null)
w = 0;
w = 1;
else if (reelParam.PlateW==7)
w= 1;
w= 2;
else if (reelParam.PlateW == 13 && reelParam.PlateH==8)
w= 2;
else if(reelParam.PlateW == 13)
......
......@@ -179,7 +179,7 @@ namespace DeviceLibrary
}
else
{
Msg.add(crc.GetString("Res0034","托盘没有检测到物料"), MsgLevel.warning);
Msg.add(crc.GetString("Res0034","托盘没有检测到物料"), MsgLevel.alarm);
return;
}
......
......@@ -149,7 +149,7 @@ namespace DeviceLibrary
TrayManager.Process(MoveInfo, CurrrentRFID, DeviceGroup.addr_1, IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.HIGH)?1:0, out TrayInfo trayInfo);
var stop = TrayManager.TryGetTrayRequest(GroupName, CurrrentRFID, out _);
MoveInfo.log($"CurrrentRFID:{CurrrentRFID},HasLoad:{trayInfo.HasLoad},MI_Reel_Check:{IOValue(IO_Type.MI_Reel_Check)},NeedStop:{stop}");
#region
#region MI1,Mi2的情况判断
if ((GroupName == "AMH-MI1" || GroupName == "AMH-MI2") && trayInfo.TrayType== TrayTypeE.MTP1)
{
/*
......@@ -192,8 +192,12 @@ namespace DeviceLibrary
device.StartOutStore();
}
}
else if (trayInfo.DestinationAddr == DeviceGroup.addr_1 && trayInfo.HasLoad && IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.HIGH))
else if (trayInfo.DestinationAddr == DeviceGroup.addr_1 && trayInfo.HasLoad)
{
if (IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.LOW)) {
Msg.add(crc.GetString("Res0034", "托盘没有检测到物料"), MsgLevel.alarm);
return;
}
MoveInfo.NextMoveStep(MoveStep.TrayStop_07);
//抵达了一个有物料的托盘等待处理
var device = MI.DeviceList[GroupName];
......@@ -227,8 +231,13 @@ namespace DeviceLibrary
SRec.info(crc.GetString("Res0042","托盘挡停"), GroupName, crc.GetString("Res0030","空托盘"), crc.GetString("Res0043","准备接料"), CurrrentRFID);
return;
}
else if (trayInfo.DestinationAddr == DeviceGroup.addr_1 && trayInfo.HasLoad && IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.HIGH))
else if (trayInfo.DestinationAddr == DeviceGroup.addr_1 && trayInfo.HasLoad)
{
if (IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.LOW))
{
Msg.add(crc.GetString("Res0034", "托盘没有检测到物料"), MsgLevel.alarm);
return;
}
//有物料
MoveInfo.NextMoveStep(MoveStep.TrayStop_07);
RemoteLoad remoteLoad = new RemoteLoad();
......
此文件类型无法预览
using ConfigHelper;
using DeviceLibrary;
using log4net.Config;
using Microsoft.Win32.TaskScheduler;
using OnlineStore.Common;
......@@ -23,6 +24,8 @@ namespace TheMachine
[STAThread]
static void Main(string[] args)
{
if (args.ToList().FindIndex(a=>a.Contains("simulate"))>=0)
OnlineStore.G.simulate = true;
......@@ -59,6 +62,15 @@ namespace TheMachine
}
AddOrUpdateStartupTask();
Config.LoadMyConfig(new Setting_Init().GetType());
//RemoteLoad remoteLoad = new RemoteLoad();
//remoteLoad.Action = "SetTrayRequest";
//remoteLoad.GroupName = "AMH-MI2";
//remoteLoad.RequestLoadInfo = new RequestLoadInfo();
//remoteLoad.RequestLoadInfo.TrayType = TrayTypeE.MTP1.ToString();
//remoteLoad.RequestLoadInfo.IsEmpty = true;
//remoteLoad.RequestLoadInfo.DeviceGroupName = "AMH-MI2";
//TrayManager.SetTrayRequest(remoteLoad);
//TrayManager.CalcNeedTrans(19, 20, false, TrayTypeE.MTP1);
Application.ThreadException += Application_ThreadException;
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
......
......@@ -37,6 +37,7 @@ namespace TheMachine
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
tableLayoutPanel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)
.SetValue(tableLayoutPanel1, true, null);
cb_loadweight.SelectedIndex = 0;
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
......@@ -190,8 +191,8 @@ namespace TheMachine
var axis = getConfigMoveAxis((int)((Button)sender).Tag);
var targetpos = int.Parse(cc[1].Text);
axis.SendMoveCmd(targetpos, axis.SpeedRate,false, RobotHelper.LoadRateParam[1]);
LogUtil.info("手动点击机器人移动命令:" + axis.RobotIp + " - " + targetpos);
axis.SendMoveCmd(targetpos, axis.SpeedRate,false, RobotHelper.LoadRateParam[cb_loadweight.SelectedIndex]);
LogUtil.info("手动点击机器人移动命令:" + axis.RobotIp + " - " + targetpos+ "-"+ cb_loadweight.SelectedIndex);
}
URRobotControl getConfigMoveAxis(int Axisid)
{
......
......@@ -32,6 +32,8 @@ namespace TheMachine
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnSavePos = new System.Windows.Forms.Button();
this.cb_loadweight = new System.Windows.Forms.ComboBox();
this.label_loadweight = new System.Windows.Forms.Label();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
......@@ -81,19 +83,48 @@ namespace TheMachine
this.btnSavePos.UseVisualStyleBackColor = true;
this.btnSavePos.Click += new System.EventHandler(this.btnSavePos_Click);
//
// StorePosControl
// cb_loadweight
//
this.cb_loadweight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cb_loadweight.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_loadweight.FormattingEnabled = true;
this.cb_loadweight.Items.AddRange(new object[] {
"0",
"1",
"2",
"3",
"4"});
this.cb_loadweight.Location = new System.Drawing.Point(104, 308);
this.cb_loadweight.Name = "cb_loadweight";
this.cb_loadweight.Size = new System.Drawing.Size(73, 20);
this.cb_loadweight.TabIndex = 110;
//
// label_loadweight
//
this.label_loadweight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label_loadweight.AutoSize = true;
this.label_loadweight.Location = new System.Drawing.Point(8, 311);
this.label_loadweight.Name = "label_loadweight";
this.label_loadweight.Size = new System.Drawing.Size(77, 12);
this.label_loadweight.TabIndex = 111;
this.label_loadweight.Text = "Load weight:";
//
// RobotPosControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label_loadweight);
this.Controls.Add(this.cb_loadweight);
this.Controls.Add(this.btnSavePos);
this.Controls.Add(this.groupBox3);
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "StorePosControl";
this.Name = "RobotPosControl";
this.Size = new System.Drawing.Size(598, 346);
this.Load += new System.EventHandler(this.ConfigControl_Load);
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
......@@ -102,5 +133,7 @@ namespace TheMachine
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Button btnSavePos;
private System.Windows.Forms.ComboBox cb_loadweight;
private System.Windows.Forms.Label label_loadweight;
}
}
......@@ -119,7 +119,7 @@ namespace URRobot
public void SendMoveCmd(int CmdIdx,int rate=50)
{
robotControl?.SendMoveCmd(CmdIdx, rate, true,RobotHelper.LoadRateParam[1]);
robotControl?.SendMoveCmd(CmdIdx, rate, true,RobotHelper.LoadRateParam[0]);
}
public bool IsSendCmdOk(int cmdIdx)
{
......
......@@ -65,7 +65,7 @@ namespace TheMachine.device.Other
CheckBox checkBox = new CheckBox();
checkBox.Text = tower.TowerName;
checkBox.Checked = tower.Enable;
checkBox.Width = 150;
// 添加一个 Tag 属性,用于保存对应的 TowerInfo 对象
checkBox.Tag = tower;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!