Commit 1587d8a9 刘韬

稳定版本

1 个父辈 04115036
......@@ -73,5 +73,7 @@ namespace OnlineStore.Common
public static MyConfig<string> Runtime_Robot_ReelInfo;
public static MyConfig<string> Runtime_Robot_FromPos;
public static MyConfig<string> Runtime_Robot_ToPos;
public static MyConfig<string> RuntimeRobot_Arm_MoveStep;
public static MyConfig<string> RuntimeRobot_MoveStep;
}
}
......@@ -107,6 +107,7 @@
<Compile Include="DeviceLibrary\LineRunMonitor.cs" />
<Compile Include="DeviceLibrary\C8WeightSensor.cs" />
<Compile Include="DeviceLibrary\OKLEController.cs" />
<Compile Include="DeviceLibrary\RobotMoveHelper.cs" />
<Compile Include="DeviceLibrary\ServerCommunication.cs" />
<Compile Include="DeviceLibrary\AxisBean.cs" />
<Compile Include="theMachine\Common.cs" />
......
......@@ -119,6 +119,9 @@ namespace DeviceLibrary
LogUtil.info("ServoOff【" + AxisName + "】");
AxisManager.ServoOff(Config.DeviceName, Config.GetAxisValue());
}
public bool HasHome() {
return AxisManager.GetHomeEndStatus(Config.DeviceName, (short)Config.GetAxisValue()) == 3;
}
public void HomeMove(MoveInfo MoveInfo,bool force=true)
{
if (!force && AxisManager.GetHomeEndStatus(Config.DeviceName, (short)Config.GetAxisValue()) == 3)
......
......@@ -26,8 +26,8 @@ namespace DeviceLibrary
currentIOvalue = IO_VALUE.HIGH;
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(Low, IO_VALUE.LOW));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(High, IO_VALUE.HIGH));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(Low, IO_VALUE.LOW, true));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(High, IO_VALUE.HIGH, true));
}
Resume(false);
if (moveInfo!=null)
......@@ -40,8 +40,8 @@ namespace DeviceLibrary
currentIOvalue = IO_VALUE.LOW;
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(Low, IO_VALUE.HIGH));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(High, IO_VALUE.LOW));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(Low, IO_VALUE.HIGH, true));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(High, IO_VALUE.LOW, true));
}
Resume(false);
if (moveInfo != null)
......
using OnlineStore.Common;
using Robot.UR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DeviceLibrary
{
class RobotHelper
{
int lastMoveCmd = 0;
URRobotControl robot;
System.Timers.Timer RobotCheck;
public RobotHelper(URRobotControl _robot) {
robot = _robot;
RobotCheck = new System.Timers.Timer(5000);
RobotCheck.Elapsed += RobotCheck_Elapsed;
}
public volatile bool RobotStatus = false;
private void RobotCheck_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (!robot.IsRun)
{
robot.StartRobot();
RobotStatus = false;
}
robot.SendCMD("safetymode", 0);
Thread.Sleep(100);
if (!robot.CurDashboardReponse.Contains("NORMAL"))
{
RobotStatus = false;
//Msg.add(POS_Start + "机器人状态异常:" + Robot.CurDashboardReponse, MsgLevel.alarm);
if (robot.CurDashboardReponse.Contains("PROTECTIVE_STOP"))
{
robot.SendCMD("unlock protective stop", 0);
}
}
robot.SendCMD("programState", 0);
Thread.Sleep(300);
if (!robot.CurDashboardReponse.Contains("PLAYING"))
{
RobotStatus = false;
//Msg.add(POS_Start + "机器人状态异常:" + Robot.CurDashboardReponse, MsgLevel.alarm);
robot.PlayProgram();
}
else if (!robot.ClientIsConnected) {
RobotStatus = false;
robot.StopProgram();
}
else
RobotStatus = true;
}
public void Move(MoveInfo moveInfo, int movecmd) {
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(IsMoveOk), "等待" + $"[{robot.Name}]" + "移动到位"));
}
lastMoveCmd = movecmd;
robot.SendMoveCmd(movecmd, Setting_Init.URRobot_MI1_Speed_Rate);
}
internal void Start()
{
RobotCheck.Enabled = true;
}
public bool IsMoveOk(WaitResultInfo waitResultInfo) {
if (robot.CurCmdReponse.Contains($"{lastMoveCmd},done"))
return true;
else if (robot.CurCmdReponse.Contains($"done"))
{
LogUtil.error($"机器人没有移动到位,重新移动:{lastMoveCmd}");
robot.SendMoveCmd(lastMoveCmd);
return false;
}
else
return false;
}
internal void Stop()
{
RobotCheck.Enabled = false;
}
}
}
......@@ -78,8 +78,11 @@ namespace DeviceLibrary
{
VLog.Info("入库成功:" + InStoreJobInfo.ToStr());
string[] substrings = InStoreJobInfo.WareNum.Split('#');
string secondSubstring = substrings[1].Substring(1);
InStoreEnd(secondSubstring);
if (substrings.Length > 2)
{
string secondSubstring = substrings[1].Substring(1);
InStoreEnd(secondSubstring);
}
InStoreJobInfo = null;
}
}
......
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using RemoteSheardObject;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -18,6 +19,32 @@ namespace DeviceLibrary
public MsgService Msg { get; set; }
public string Name { get; set; }
public string GroupName { get; set; }
System.Timers.Timer timer;
public DeviceBase() {
timer = new System.Timers.Timer(5000);
timer.Elapsed += Timer_Elapsed;
timer.Enabled = true;
}
private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
EquipMsgData equipMsg = new EquipMsgData();
equipMsg.msgList = new List<EquipMessage>();
equipMsg.status = 0;
Msg.msg.ForEach(ml =>
{
equipMsg.msgList.Add(new EquipMessage()
{
msg = ml.msgtxt,
status = ml.msgLevel == MsgLevel.alarm ? 1 : 0
});
if (ml.msgLevel == MsgLevel.alarm)
equipMsg.status = 1;
});
equipMsg.equipName = GroupName;
TheLine.UploadStatus(equipMsg);
}
public static bool FwdFree(int curaddr) {
int nextaddr = curaddr + 1;
......@@ -32,7 +59,7 @@ namespace DeviceLibrary
public void StopMove(bool ServoOff = false)
{
//runStatus = RunStatus.Stop;
MoveInfo.List.ForEach((m) => { m.EndMove(); });
//MoveInfo.List.ForEach((m) => { m.EndMove(); });
if (AxisBean.List.ContainsKey(GroupName))
AxisBean.StopMultiAxis(AxisBean.List[GroupName]);
......@@ -69,8 +96,7 @@ namespace DeviceLibrary
{
isOk = false;
}
MoveInfo.WaitList.ForEach((w) => {
MoveInfo.WaitList.ToList().ForEach((w) => {
if (w.WaitType.Equals(WaitEnum.W014_Msg)) {
w.IsEnd = true;
Msg.add(w.ActionMsg, w.Data);
......@@ -122,7 +148,10 @@ namespace DeviceLibrary
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] " + crc.GetString("Res0157", "等待") + "(" + io.DisplayStr + "=" + wait.IoValue + $")" + crc.GetString("Res0158", "超时");
Msg.add(WarnMsg, MsgLevel.alarm);
Msg.add(WarnMsg, wait.NeedAlarm?MsgLevel.alarm: MsgLevel.warning);
if (wait.NeedAlarm)
RobotManage.UserPause(WarnMsg);
if (NoAlarm())
{
//Alarm(AlarmType.IoSingleTimeOut, WarnMsg);
......@@ -254,8 +283,8 @@ namespace DeviceLibrary
IOMove(IoHighType, IO_VALUE.HIGH);
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoLowType, IO_VALUE.LOW));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoHighType, IO_VALUE.HIGH));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoLowType, IO_VALUE.LOW, true));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoHighType, IO_VALUE.HIGH, true));
}
}
public IO_VALUE IOValue(string ioType) => IOManager.IOValue(ioType, GroupName);
......
......@@ -55,7 +55,7 @@ namespace DeviceLibrary
});
//ProcessMoveinfoEvent?.Invoke(MoveInfo.List);
if (!RobotManage.mainMachine.UserPause)
if (!RobotManage.mainMachine.UserPause && RobotManage.mainMachine.mstart)
{
DevicesList.ForEach(x =>
{
......
......@@ -42,13 +42,20 @@ namespace DeviceLibrary
RobotManage.UserPause("Reset_BTN", false);
}
}
bool isfirstrun = true;
void Run_BTN() {
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.HIGH))
{
if (!RobotManage.isRunning)
Msg.add(crc.GetString("Res0163","检测到自动运行状态,开始启动."), MsgLevel.info, ErrInfo.RunBtn);
{
if (isfirstrun)
{
isfirstrun = false;
Msg.add(crc.GetString("Res0163", "检测到自动运行状态,开始启动."), MsgLevel.info, ErrInfo.RunBtn);
}
}
else
Msg.add( crc.GetString("Res0164","系统正在运行."), MsgLevel.info);
Msg.add(crc.GetString("Res0164", "系统正在运行."), MsgLevel.info);
}
else
{
......
......@@ -138,7 +138,7 @@ namespace DeviceLibrary
currnetstoreStatus = isInSuddenDown ? StoreStatus.SuddenStop : StoreStatus.Warning;
}
//ProcessMoveinfoEvent?.Invoke(MoveInfo.List);
if (!UserPause)
if (!UserPause && mstart)
Msg.clear();
else
currnetstoreStatus = StoreStatus.Debugging;
......@@ -150,6 +150,7 @@ namespace DeviceLibrary
LogUtil.info("主线程已退出.");
}
public void Start() {
MoveInfo.List.ForEach((m) => { m.EndMove(); });
Run();
}
public void Stop() {
......
......@@ -47,6 +47,7 @@ namespace DeviceLibrary
public bool IsInWait { get; set; }
MoveStep preMoveStep;
MoveStep moveStep;
public int CanWhileCount = 0;
......@@ -66,7 +67,10 @@ namespace DeviceLibrary
{
get { return moveStep; }
}
public MoveStep PreMoveStep
{
get { return preMoveStep; }
}
public void NewMove(MoveStep step)
{
this.MoveParam = new ReelParam();
......@@ -74,7 +78,7 @@ namespace DeviceLibrary
}
public void NextMoveStep(MoveStep step)
{
// PreMoveStep = moveStep;
preMoveStep = moveStep;
moveStep = step;
LastSetpTime = DateTime.Now;
IsInWait = true;
......@@ -169,12 +173,13 @@ namespace DeviceLibrary
CanWhileMoveCount = 0;
}
public static WaitResultInfo WaitIO(string ioType, IO_VALUE ioValue)
public static WaitResultInfo WaitIO(string ioType, IO_VALUE ioValue,bool needAlarm=false)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W002_IOValue;
wait.IoType = ioType;
wait.IoValue = ioValue;
wait.NeedAlarm = needAlarm;
//wait.Devicegroup = devicegroup;
return wait;
}
......@@ -350,6 +355,7 @@ namespace DeviceLibrary
public Func<WaitResultInfo, bool> Action { get; set; }
public string ActionMsg { get; set; }
public dynamic Data { get; set; }
public bool NeedAlarm { get; set; }
}
internal class WaitEnum
......
......@@ -24,7 +24,7 @@ namespace DeviceLibrary
/// <param name="addr"></param>
/// <param name="trayInfo"></param>
/// <returns>是否放行 放行true, 拦截false</returns>
public static bool Process(MoveInfo moveInfo,string rfid, int addr, out TrayInfo trayInfo) {
public static bool Process(MoveInfo moveInfo,string rfid, int addr,int reelcheck, out TrayInfo trayInfo) {
lock (Traylist)
{
moveInfo.log($"处理RFID:{rfid},地址{addr},设备:{(AddrDesc.ContainsKey(addr)? AddrDesc[addr]:"")}");
......@@ -37,6 +37,10 @@ namespace DeviceLibrary
Traylist[rfid].LastAddr = addr;
Traylist[rfid].Destination = TrayManager.AddrDesc[Traylist[rfid].DestinationAddr];
Traylist[rfid].LastPosition = TrayManager.AddrDesc[Traylist[rfid].LastAddr];
if (reelcheck == 0)
Traylist[rfid].HasLoadCheck--;
else if (reelcheck == 1)
Traylist[rfid].HasLoadCheck = 1;
trayInfo = Traylist[rfid];
//Statistics();
}
......@@ -61,6 +65,7 @@ namespace DeviceLibrary
Traylist[rfid].LoadType = (TrayTypeE)Enum.Parse(typeof(TrayTypeE), requestLoadInfo.TrayType);
Traylist[rfid].TrayParam = requestLoadInfo.LoadParam.clone();
Traylist[rfid].DestinationAddr = GetAddrByGroupName(requestLoadInfo.DeviceGroupName);
Traylist[rfid].HasLoadCheck = 1;
LogUtil.info("设置托盘信息:" + Traylist[rfid].LoadType + "," + Traylist[rfid].TrayParam.ToStr() + "," + requestLoadInfo.DeviceGroupName);
}
SaveTrayInfo();
......@@ -315,7 +320,7 @@ namespace DeviceLibrary
public TrayTypeE TrayType;
public DateTime LastUpdateTime;
public ReelParam TrayParam;
public bool SenSorStatus = false;
public int HasLoadCheck = 0;
public DirectionE Direction { get => (Destination ==StoreCID.AMH_ML5_1 || Destination == StoreCID.AMH_ML5_2) ? DirectionE.Out : DirectionE.In; }
public bool isOnline = true;
public void SetToEmpty() {
......@@ -323,7 +328,7 @@ namespace DeviceLibrary
LoadType = TrayTypeE.None;
DestinationAddr = -1;
TrayParam = new ReelParam();
SenSorStatus = false;
HasLoadCheck = 0;
}
}
......
......@@ -28,14 +28,16 @@ namespace DeviceLibrary
}
DeviceGroup DeviceGroup;
MoveInfo MoveInfo;
public MoveInfo MoveInfo;
MoveInfo RoboMoveInfo;
CylinderManger Location;
//CylinderManger Location;
public AxisBean Comp;
public AxisBean Rotate;
URRobotControl Robot;
RobotHelper robotHelper;
string POS_Start = "MI1";
public MI(DeviceGroup device,out string msg) {
public MI(DeviceGroup device,out string msg) : base()
{
msg = "";
Name = device.Name+"("+ device.GroupName + ")";
DeviceGroup = device;
......@@ -44,22 +46,27 @@ namespace DeviceLibrary
MoveInfo = new MoveInfo(GroupName + "-T");
RoboMoveInfo = new MoveInfo(GroupName + "-Robo");
if (device.GroupName == "AMH-MI1")
{
Robot = RobotManage.Robot_MI1;
}
else
{
Robot = RobotManage.Robot_MI2;
POS_Start = "MI2";
}
robotHelper = new RobotHelper(Robot);
Comp = AxisBean.List[DeviceGroup.GroupName][0];
Rotate = AxisBean.List[DeviceGroup.GroupName][1];
Location = new CylinderManger($"物料顶升", GroupName, IO_Type.MI_Reel_Location_Up, IO_Type.MI_Reel_Location_Down);
}
public DeviceStateE DeviceState { get; set; }
public void Start()
{
OpenAllServo();
//Robot.StartRobot();
//Robot.PlayProgram();
robotHelper.Start();
DeviceState = DeviceStateE.HomeReset;
MoveInfo.NewMove(MoveStep.H01_HomeReset);
MoveInfo.log("开始回原");
......@@ -67,7 +74,8 @@ namespace DeviceLibrary
public void Stop()
{
Robot.StopProgram();
robotHelper.Stop();
Robot.StopRobot();
DeviceState = DeviceStateE.Stop;
MoveInfo.log("停止运行");
}
......@@ -77,14 +85,15 @@ namespace DeviceLibrary
{
MsgService.MSList[GroupName + "-T"].clear();
LogUtil.OutputDebugString("DeviceState:" + DeviceState.ToString());
if (!DeviceCheck())
{
return;
}
if (DeviceState == DeviceStateE.HomeReset)
ResetProcess();
else if (DeviceState == DeviceStateE.Run)
{
if (!DeviceCheck())
{
return;
}
{
OneWayProcess();
RobotMoveProcess();
}
......@@ -93,26 +102,18 @@ namespace DeviceLibrary
MsgService.MSList[GroupName + "-T"].Show();
}
}
private bool DeviceCheck()
{
if (!Robot.IsRun)
if (!Robot.ClientIsConnected)
{
Msg.add(POS_Start + crc.GetString("Res0010","机器人未启动,正在尝试启动."), MsgLevel.warning);
Robot.StartRobot();
//Thread.Sleep(1000);
Msg.add(POS_Start + crc.GetString("Res0011", "机器人未连接MT,无法操作."), MsgLevel.alarm);
return false;
}
Robot.SendCMD("safetymode", 0);
if (!Robot.CurDashboardReponse.Contains("NORMAL"))
{
Msg.add(POS_Start + "机器人状态异常:" + Robot.CurDashboardReponse,MsgLevel.alarm);
if (!robotHelper.RobotStatus) {
Msg.add(POS_Start + "机器人当前不可用", MsgLevel.alarm);
return false;
}
//if (!Robot.ClientIsConnected) {
// Msg.add(POS_Start + crc.GetString("Res0011","机器人未连接MT,无法操作."), MsgLevel.warning);
// Robot.SendCMD("safetymode", 0);
// return false;
//}
return true;
}
......@@ -128,9 +129,10 @@ namespace DeviceLibrary
VStore CurrntOutReadyStore;
public void OneWayProcess()
{
Config.Set("RuntimeRobot_MoveStep", MoveInfo.MoveStep.ToString());
if (CheckWait(MoveInfo))
return;
switch (MoveInfo.MoveStep)
{
case MoveStep.Wait:
......@@ -159,7 +161,7 @@ namespace DeviceLibrary
break;
case MoveStep.MI_01:
MoveInfo.NextMoveStep(MoveStep.MI_02);
Location.ToHigh(MoveInfo);
//Location.ToHigh(MoveInfo);
RoboMoveInfo.MoveParam = MoveInfo.MoveParam.clone();
RoboMoveInfo.NextMoveStep(MoveStep.MI_01);
MoveInfo.log("机器人开始取料");
......@@ -203,32 +205,6 @@ namespace DeviceLibrary
}
break;
/* 无用环节
case MoveStep.MI_10:
MoveInfo.NextMoveStep(MoveStep.MI_11);
Rotate.RelMove(RobotManage.Config.AMH_Route_PoToMM * 90, RobotManage.Config.AMH_Route_PoToMM_speed);
break;
case MoveStep.MI_11:
if (!Rotate.IsBusy)
{
MoveInfo.NextMoveStep(MoveStep.MI_20);
Location.ToLow(MoveInfo);
}
break;
case MoveStep.MI_20:
MoveInfo.NextMoveStep(MoveStep.MI_21);
FromPos = RobotManage.MI1Postion[POS_Start + "_SCAN"];
ToPos = RobotManage.MI1Postion[GetNextBufferStore()];
RoboMoveInfo.NextMoveStep(MoveStep.MI_01);
break;
case MoveStep.MI_21:
if (RoboMoveInfo.MoveStep == MoveStep.Wait)
{
InStoreJobList.ClearLastPosid();
MoveInfo.NextMoveStep(MoveStep.Wait);
}
break;
*/
case MoveStep.MI_50:
CurrntOutReadyStore = VStoreCollection.VStoreList.Values.ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.OutStoreReady);
if (CurrntOutReadyStore != null)
......@@ -259,7 +235,7 @@ namespace DeviceLibrary
}
else
{
var InStoreError = VStoreCollection.VStoreList.Values.ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.InStoreError);
var InStoreError = VStoreCollection.VStoreList.Values.ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.InStoreError ||vs.RTStoreStatus == RTStoreStatus.InStoreDataTimeOut);
if (InStoreError != null)
{
......@@ -273,10 +249,14 @@ namespace DeviceLibrary
MoveInfo.log("从服务器检索到物料数据:" + CurrentJobInfo.ToStr());
MoveInfo.MoveParam.IsNg = true;
MoveInfo.MoveParam.NgMsg = InStoreError.CID + "入库异常";
MoveInfo.log("检测到有料仓入库NG:"+ InStoreError.CID);
MoveInfo.log("检测到有料仓入库NG:" + InStoreError.CID);
}
else
return;
{
MoveInfo.log("没有找到,在等待出库的料仓");
MoveInfo.NextMoveStep(MoveStep.Wait);
TrayStop.DeviceList[GroupName].TrayRelease();
return; }
}
else
......@@ -299,8 +279,7 @@ namespace DeviceLibrary
Setting_Init.Runtime_Robot_FromPos = FromPos.PositionNum;
Setting_Init.Runtime_Robot_ToPos = ToPos.PositionNum;
MoveInfo.NextMoveStep(MoveStep.MI_51);
MoveInfo.log($"开始转移物料:{FromPos.PositionNum}=>{ToPos.PositionNum}");
MoveInfo.log($"开始转移物料:{FromPos.PositionNum}=>{ToPos.PositionNum}");
break;
case MoveStep.MI_51:
MoveInfo.NextMoveStep(MoveStep.MI_52);
......@@ -347,145 +326,102 @@ namespace DeviceLibrary
}
break;
}
}
public void RobotMoveProcess()
{
if (!Robot.ClientIsConnected)
{
Msg.add("机器人已停止运行", MsgLevel.alarm);
return;
}
Config.Set("RuntimeRobot_Arm_MoveStep", RoboMoveInfo.MoveStep.ToString());
if (CheckWait(RoboMoveInfo))
return;
switch (RoboMoveInfo.MoveStep)
{
case MoveStep.Wait:
break;
//从流水线取料
//机器人取料
case MoveStep.MI_01:
RoboMoveInfo.NextMoveStep(MoveStep.MI_02);
Comp.AbsMove(RoboMoveInfo, RobotManage.Config.AMH_RoboMI1_Comp_P1, RobotManage.Config.AMH_RoboMI1_Comp_P1_speed);
CompTOP1(RoboMoveInfo);
RoboMoveInfo.log("压紧轴到待机点");
break;
case MoveStep.MI_02:
//if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_03);
Robot.SendMoveCmd(FromPos.Take_P5, Setting_Init.URRobot_MI1_Speed_Rate);
RoboMoveInfo.log("机器人到Take_P5");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
RoboMoveInfo.NextMoveStep(MoveStep.MI_03);
robotHelper.Move(RoboMoveInfo, FromPos.Take_P5);
RoboMoveInfo.log("机器人到Take_P5");
break;
case MoveStep.MI_03:
if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_04);
TrayStop.DeviceList[GroupName].Location.ToLow(MoveInfo);
Comp.AbsMove(null, DeviceGroup.p3, RobotManage.Config.AMH_RoboMI1_Comp_P2_speed);
Comp.BatchAxisStartCheck(IO_Type.MI_Robot_Clamp_Check, IO_VALUE.HIGH);
RoboMoveInfo.log("压紧轴都下压");
//RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
RoboMoveInfo.NextMoveStep(MoveStep.MI_04);
TrayStop.DeviceList[GroupName].Location.ToLow(MoveInfo);
CompTOCompression(RoboMoveInfo);
RoboMoveInfo.log("压紧轴都下压");
break;
case MoveStep.MI_04:
if (Robot.MoveCmdOk() && !Comp.IsBusy)
if (!Comp.IsBusy)
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_05);
Robot.SendMoveCmd(FromPos.Take_P6, Setting_Init.URRobot_MI1_Speed_Rate);
robotHelper.Move(RoboMoveInfo, FromPos.Take_P6);
RoboMoveInfo.log("压紧轴到位");
RoboMoveInfo.log("机器人到Take_P6");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
break;
case MoveStep.MI_05:
if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_06);
Comp.AbsMove(null, DeviceGroup.p3, RobotManage.Config.AMH_RoboMI1_Comp_P2_speed);
Comp.BatchAxisStartCheck(IO_Type.MI_Robot_Clamp_Check, IO_VALUE.HIGH);
RoboMoveInfo.log("压紧轴都下压");
//RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
RoboMoveInfo.NextMoveStep(MoveStep.MI_06);
CompTOCompression(RoboMoveInfo);
RoboMoveInfo.log("压紧轴都下压");
break;
case MoveStep.MI_06:
if (Robot.MoveCmdOk() && !Comp.IsBusy)
if (!Comp.IsBusy)
{
RoboMoveInfo.log("压紧轴到位脉冲值:" + Comp.GetAclPosition());
RoboMoveInfo.NextMoveStep(MoveStep.MI_07);
Robot.SendMoveCmd(FromPos.Take_P7, Setting_Init.URRobot_MI1_Speed_Rate);
robotHelper.Move(RoboMoveInfo, FromPos.Take_P7);
RoboMoveInfo.log("机器人到Take_P7");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
break;
case MoveStep.MI_07:
if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_08);
Robot.SendMoveCmd(FromPos.P1, Setting_Init.URRobot_MI1_Speed_Rate);
RoboMoveInfo.log("机器人到P1");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
RoboMoveInfo.NextMoveStep(MoveStep.MI_08);
robotHelper.Move(RoboMoveInfo, FromPos.P1);
RoboMoveInfo.log("机器人到P1");
break;
case MoveStep.MI_08:
if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_40);
RoboMoveInfo.log("机器人取料完成");
RoboMoveInfo.NextMoveStep(MoveStep.MI_40);
RoboMoveInfo.log("机器人取料完成");
break;
}
break;
//放料到缓存位置
case MoveStep.MI_40:
if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_41);
Robot.SendMoveCmd(ToPos.Put_P2, Setting_Init.URRobot_MI1_Speed_Rate);
RoboMoveInfo.log("机器人到Put_P2");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
RoboMoveInfo.NextMoveStep(MoveStep.MI_41);
robotHelper.Move(RoboMoveInfo, ToPos.Put_P2);
RoboMoveInfo.log("机器人到Put_P2");
break;
case MoveStep.MI_41:
if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_42);
Comp.AbsMove(RoboMoveInfo, RobotManage.Config.AMH_RoboMI1_Comp_P1, RobotManage.Config.AMH_RoboMI1_Comp_P1_speed);
Robot.SendMoveCmd(ToPos.Put_P3, Setting_Init.URRobot_MI1_Speed_Rate);
RoboMoveInfo.log("压紧轴释放");
RoboMoveInfo.log("机器人到Put_P3");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
RoboMoveInfo.NextMoveStep(MoveStep.MI_42);
//Comp.AbsMove(RoboMoveInfo, RobotManage.Config.AMH_RoboMI1_Comp_P1, RobotManage.Config.AMH_RoboMI1_Comp_P1_speed);
CompTOP1(RoboMoveInfo);
robotHelper.Move(RoboMoveInfo, ToPos.Put_P3);
RoboMoveInfo.log("压紧轴释放");
RoboMoveInfo.log("机器人到Put_P3");
break;
case MoveStep.MI_42:
if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_43);
Robot.SendMoveCmd(ToPos.Put_P4, Setting_Init.URRobot_MI1_Speed_Rate);
RoboMoveInfo.log("机器人到Put_P4");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
RoboMoveInfo.NextMoveStep(MoveStep.MI_43);
robotHelper.Move(RoboMoveInfo, ToPos.Put_P4);
RoboMoveInfo.log("机器人到Put_P4");
break;
case MoveStep.MI_43:
if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.MI_44);
Robot.SendMoveCmd(ToPos.P1, Setting_Init.URRobot_MI1_Speed_Rate);
RoboMoveInfo.log("机器人到P1");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
RoboMoveInfo.NextMoveStep(MoveStep.MI_44);
robotHelper.Move(RoboMoveInfo, ToPos.P1);
RoboMoveInfo.log("机器人到P1");
break;
case MoveStep.MI_44:
if (Robot.MoveCmdOk())
{
RoboMoveInfo.NextMoveStep(MoveStep.Wait);
RoboMoveInfo.log("放料完成");
}
RoboMoveInfo.NextMoveStep(MoveStep.Wait);
RoboMoveInfo.log("放料完成");
break;
}
}
......@@ -518,7 +454,25 @@ namespace DeviceLibrary
//MoveInfo.log("释放托盘");
// MoveInfo.NextMoveStep(MoveStep.TrayStop_LoadProcessed);
}
void CompTOP1(MoveInfo MoveInfo)
{
if (Comp.HasHome())
Comp.AbsMove(MoveInfo, RobotManage.Config.AMH_RoboMI1_Comp_P1, RobotManage.Config.AMH_RoboMI1_Comp_P1_speed);
else
Comp.HomeMove(MoveInfo);
}
void CompTOCompression(MoveInfo MoveInfo)
{
if (!Comp.HasHome())
return;
Comp.AbsMove(null, DeviceGroup.p3, RobotManage.Config.AMH_RoboMI1_Comp_P2_speed);
Comp.BatchAxisStartCheck(IO_Type.MI_Robot_Clamp_Check, IO_VALUE.HIGH);
}
bool compdetereel = false;
int lastCmd = 0;
int lastStep = 0;
int lastPrefix = 0;
public void ResetProcess()
{
if (CheckWait(MoveInfo))
......@@ -527,19 +481,30 @@ namespace DeviceLibrary
switch (MoveInfo.MoveStep)
{
case MoveStep.Wait:
MoveInfo.NextMoveStep(MoveStep.H01_HomeReset);
compdetereel = IOValue(IO_Type.MI_Robot_Clamp_Check).Equals(IO_VALUE.HIGH);
Comp.HomeMove(MoveInfo);
//MoveInfo.NextMoveStep(MoveStep.H01_HomeReset);
break;
case MoveStep.H01_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
if (IOValue(IO_Type.MI_Robot_Reel_Check).Equals(IO_VALUE.HIGH) || compdetereel)
var m1step = (MoveStep)Enum.Parse(typeof(MoveStep), Config.Get("RuntimeRobot_MoveStep"));
var m2step = (MoveStep)Enum.Parse(typeof(MoveStep), Config.Get("RuntimeRobot_Arm_MoveStep"));
if (IOValue(IO_Type.MI_Robot_Clamp_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.MI_Robot_Reel_Check).Equals(IO_VALUE.LOW)
&& m1step == MoveStep.Wait)
{
MoveInfo.NextMoveStep(MoveStep.H09_HomeReset);
Robot.SendMoveCmd(1, Setting_Init.URRobot_MI1_Speed_Rate);
MoveInfo.log("没有最后的动作, 机器人回待机点");
}
else
{
Comp.AbsMove(null, DeviceGroup.p3, RobotManage.Config.AMH_RoboMI1_Comp_P2_speed);
Comp.BatchAxisStartCheck(IO_Type.MI_Robot_Clamp_Check, IO_VALUE.HIGH);
MoveInfo.MoveParam = JsonConvert.DeserializeObject<ReelParam>(Setting_Init.Runtime_Robot_ReelInfo);
FromPos = GetMIPosition(GroupName,Setting_Init.Runtime_Robot_FromPos);
RoboMoveInfo.MoveParam = MoveInfo.MoveParam.clone();
FromPos = GetMIPosition(GroupName, Setting_Init.Runtime_Robot_FromPos);
ToPos = GetMIPosition(GroupName, Setting_Init.Runtime_Robot_ToPos);
CurrentVStore = VStoreCollection.VStoreList[MoveInfo.MoveParam.cid];
MoveInfo.NextMoveStep(m1step);
RoboMoveInfo.NextMoveStep(m2step);
DeviceState = DeviceStateE.Run;
}
break;
case MoveStep.H02_HomeReset:
......@@ -561,7 +526,8 @@ namespace DeviceLibrary
MoveInfo.log("Robot.IsRun:" + Robot.IsRun);
MoveInfo.log("Robot.IsStartConnect:" + Robot.IsStartConnect);
MoveInfo.log("Robot.CurCmdReponse:" + Robot.CurCmdReponse);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
} else if (MoveInfo.IsTimeOut(30)) {
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
}
......@@ -579,44 +545,87 @@ namespace DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(POS_Start + crc.GetString("Res0018", "机器人未连接MT"), MoveInfo.CanWhileCount <= 0 ? MsgLevel.alarm : MsgLevel.warning));
break;
case MoveStep.H05_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
if (string.IsNullOrEmpty(Robot.LastMoveCmd))
MoveInfo.NextMoveStep(MoveStep.H09_HomeReset);
return;
m1step = (MoveStep)Enum.Parse(typeof(MoveStep), Setting_Init.RuntimeRobot_MoveStep);
m2step = (MoveStep)Enum.Parse(typeof(MoveStep), Setting_Init.RuntimeRobot_Arm_MoveStep);
if (IOValue(IO_Type.MI_Robot_Clamp_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.MI_Robot_Reel_Check).Equals(IO_VALUE.LOW)
&& m1step == MoveStep.Wait)
{
MoveInfo.NextMoveStep(MoveStep.H09_HomeReset);
Robot.SendMoveCmd(1, Setting_Init.URRobot_MI1_Speed_Rate);
MoveInfo.log("没有最后的动作, 机器人回待机点");
}
else
{
MoveInfo.MoveParam = JsonConvert.DeserializeObject<ReelParam>(Setting_Init.Runtime_Robot_ReelInfo);
FromPos = GetMIPosition(GroupName, Setting_Init.Runtime_Robot_FromPos);
ToPos = GetMIPosition(GroupName, Setting_Init.Runtime_Robot_ToPos);
CurrentVStore = VStoreCollection.VStoreList[MoveInfo.MoveParam.cid];
MoveInfo.NextMoveStep(m1step);
RoboMoveInfo.NextMoveStep(m2step);
DeviceState = DeviceStateE.Run;
}
else if (int.TryParse(Robot.LastMoveCmd, out int cmdid))
//else if (int.TryParse(Robot.LastMoveCmd, out int cmdid))
//{
// lastCmd = cmdid;
// lastStep = cmdid % 10;
// lastPrefix = lastStep * 10;
// Robot.SendMoveCmd(lastCmd, Setting_Init.URRobot_MI1_Speed_Rate);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
// MoveInfo.log("机器人重做最后的动作:" + lastCmd);
//}
break;
case MoveStep.H06_HomeReset:
if (Robot.MoveCmdOk())
{
if (cmdid == 1)
//如果上一步是回到待机点,并且料叉上无物料
if (lastStep==1 && !compdetereel && !IOValue(IO_Type.MI_Robot_Reel_Check).Equals(IO_VALUE.HIGH))
{
Robot.SendMoveCmd(1, Setting_Init.URRobot_MI1_Speed_Rate);
//回原结束
return;
}
else {
int nextstep = 1;
int laststep = cmdid % 10;
int prefix = laststep * 10;
if (laststep == 0 || laststep == 2)
nextstep = prefix + 5;
else if (laststep == 1 || laststep == 3)
nextstep = prefix + 4;
Robot.SendMoveCmd(nextstep, Setting_Init.URRobot_MI1_Speed_Rate);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
RoboMoveInfo.MoveParam = MoveInfo.MoveParam.clone();
//如果上一步是回待机点,但料叉上有物料
if (lastStep == 1)
{
MoveInfo.NextMoveStep(MoveStep.MI_02);
RoboMoveInfo.NextMoveStep(MoveStep.MI_07);
}
else if (lastStep == 0)//P5 取料低点
{
MoveInfo.NextMoveStep(MoveStep.MI_02);
RoboMoveInfo.NextMoveStep(MoveStep.MI_02);
}
else if (lastStep == 2)//P6 取料高点
{
MoveInfo.NextMoveStep(MoveStep.MI_02);
RoboMoveInfo.NextMoveStep(MoveStep.MI_04);
}
else if (lastStep == 5)//P7 取料退出过度点
{
MoveInfo.NextMoveStep(MoveStep.MI_02);
RoboMoveInfo.NextMoveStep(MoveStep.MI_06);
}
else if (lastStep == 1)//P2 放料高点P2
{
MoveInfo.NextMoveStep(MoveStep.MI_02);
RoboMoveInfo.NextMoveStep(MoveStep.MI_40);
}
}
break;
case MoveStep.H06_HomeReset:
//if (Robot.MoveCmdOk())
{
MoveInfo.NextMoveStep(MoveStep.H07_HomeReset);
Robot.SendMoveCmd(1, Setting_Init.URRobot_MI1_Speed_Rate);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
break;
case MoveStep.H07_HomeReset:
case MoveStep.H09_HomeReset:
if (Robot.MoveCmdOk())
{
MoveInfo.EndMove();
DeviceState = DeviceStateE.Run;
}
break;
//尝试解除安全保护
case MoveStep.H10_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H11_HomeReset);
Robot.SendCMD("safetymode", 0);
......@@ -632,6 +641,10 @@ namespace DeviceLibrary
else if (Robot.CurDashboardReponse.Contains("NORMAL")) {
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
}
else if (Robot.CurDashboardReponse.Contains("Starting program"))
{
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
}
else {
Msg.add("机器人状态异常:" + Robot.CurDashboardReponse, MsgLevel.alarm);
}
......@@ -646,7 +659,9 @@ namespace DeviceLibrary
case MoveStep.H13_HomeReset:
if (Robot.CurCmdReponse.Contains("Protective stop releasing")) {
MoveInfo.log("机器人成功解除保护");
Robot.StopProgram();
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
}
else if (MoveInfo.IsTimeOut(5))
{
......@@ -713,9 +728,9 @@ namespace DeviceLibrary
}
public RobotPosition GetMIPosition(string device, string pos) {
if (device == "mi")
if (device == "AMH-MI1")
return RobotManage.MI1Postion[pos];
else if (device == "mi")
else if (device == "AMH-MI2")
return RobotManage.MI2Postion[pos];
else
return RobotManage.CIPostion[pos];
......
......@@ -34,7 +34,8 @@ namespace DeviceLibrary
public PuYueRFID_C2S RFID_2 = null;
public LineRunMonitor Line;
LS_TypeE LS_Type = LS_TypeE.NoRfid;
public SideMove(DeviceGroup device,out string msg) {
public SideMove(DeviceGroup device,out string msg) : base()
{
msg = "";
Name = device.Name+"("+ device.GroupName + ")";
DeviceGroup = device;
......@@ -143,8 +144,7 @@ namespace DeviceLibrary
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_02);
Location_A.ToLow(LSAMoveInfo);
//Location_B.ToLow(LSAMoveInfo);
if (!Forcetry)
IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
}
......@@ -166,6 +166,7 @@ namespace DeviceLibrary
}
if (IOValue(IO_Type.Ls_A_Tray_Check).Equals(IO_VALUE.HIGH)) {
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_04);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
LastGoInFail = false;
}
else if (LSAMoveInfo.IsTimeOut(10))
......@@ -213,6 +214,7 @@ namespace DeviceLibrary
Line.LineStop("n");
Location_A.ToLow(LSAMoveInfo);
Location_B.ToLow(LSAMoveInfo);
IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS);
break;
case MoveStep.SideMove_10:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_01);
......@@ -322,7 +324,7 @@ namespace DeviceLibrary
Minfo.NextMoveStep(MoveStep.SideMove_04);
Minfo.log($"检测到进入的托盘");
Minfo.CanWhileCount = 3;
//Minfo.WaitList.Add(WaitResultInfo.WaitTime(500));
Minfo.WaitList.Add(WaitResultInfo.WaitTime(500));
}
else if (Minfo.IsTimeOut(10))
{
......@@ -344,13 +346,14 @@ namespace DeviceLibrary
Location_a.ToLow(Minfo);
return;
}
Minfo.CanWhileCount = 3;
//Location_a.ToHigh(Minfo);
break;
case MoveStep.SideMove_05:
if (RFID.ReadByte(0x20,16,out byte[] data, out string errmsg))
{
var rfid = Common.RfidFilter(data);
TrayManager.Process(Minfo,rfid, addr, out TrayInfo trayInfo);
TrayManager.Process(Minfo,rfid, addr,-1, out TrayInfo trayInfo);
if (TrayManager.CalcNeedTrans(addr, trayInfo.DestinationAddr, trayInfo.HasLoad))
Minfo.NextMoveStep(MoveStep.SideMove_10);
......
......@@ -35,7 +35,8 @@ namespace DeviceLibrary
CylinderManger Transplant;
public DeviceStateE DeviceState { get ; set ; }
public TransplantMove(DeviceGroup device, Robot_Config config, out string msg) {
public TransplantMove(DeviceGroup device, Robot_Config config, out string msg) : base()
{
msg = "";
Name = device.Name+"("+ device.GroupName + ")";
Config = config;
......@@ -98,17 +99,19 @@ namespace DeviceLibrary
}
else if (IOValue(IO_Type.AMH_Front_Check).Equals(IO_VALUE.HIGH))
{
if (GroupName == "AMH-SBSH2" && !canpass()) //SBSH2 等待前面空闲再放行
return;
MoveInfo.NextMoveStep(MoveStep.TransplantMove_01);
Location.ToLow(MoveInfo);
Location.ToLow(MoveInfo);
}
else
{
//Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info);
}
if (TrayManager.TestTrayRequest(GroupName)) {
Transplant.ToHigh(null);
}
//if (TrayManager.TestTrayRequest(GroupName)) {
// Transplant.ToHigh(null);
//}
break;
case MoveStep.TransplantMove_01:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_02);
......@@ -123,7 +126,7 @@ namespace DeviceLibrary
{
MoveInfo.NextMoveStep(MoveStep.TransplantMove_03);
MoveInfo.CanWhileCount = 3;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
//Location.ToHigh(MoveInfo);
}
else if (MoveInfo.IsTimeOut(10)) {
......@@ -136,7 +139,7 @@ namespace DeviceLibrary
{
CurrrentRFID = Common.RfidFilter(data);
MoveInfo.MoveParam.RFID = CurrrentRFID;
var through = TrayManager.Process(MoveInfo,CurrrentRFID, DeviceGroup.addr_1, out TrayInfo trayInfo);
var through = TrayManager.Process(MoveInfo,CurrrentRFID, DeviceGroup.addr_1, IOValue(IO_Type.AMH_Reel_Check).Equals(IO_VALUE.HIGH)?1:0, out TrayInfo trayInfo);
MoveInfo.log($"rfid:{CurrrentRFID},TrayManager.Process:{trayInfo.DestinationAddr},{DeviceGroup.addr_1},AMH_Reel_Check:{IOValue(IO_Type.AMH_Reel_Check)},HasLoad:{trayInfo.HasLoad}");
//入库判断
if (trayInfo.DestinationAddr == DeviceGroup.addr_1 && trayInfo.HasLoad)
......@@ -244,7 +247,8 @@ namespace DeviceLibrary
{
IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.LOW);
MoveInfo.NextMoveStep(MoveStep.Wait);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
if (GroupName == "AMH-SBSH2")
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
MoveInfo.log("托盘已放行");
} else if (MoveInfo.IsTimeOut(10)) {
MoveInfo.log("托盘放行失败,重新放行");
......@@ -328,7 +332,9 @@ namespace DeviceLibrary
IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.LOW);
MoveInfo.log("托盘放行结束");
SRec.info(crc.GetString("Res0024","物料横移"), GroupName, crc.GetString("Res0030","空托盘"), crc.GetString("Res0037","物料已取走"));
MoveInfo.NewMove(MoveStep.Wait);
MoveInfo.NewMove(MoveStep.Wait);
if (GroupName == "AMH-SBSH2")
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
break;
//从料仓=>线体
case MoveStep.TransplantMove_20:
......@@ -442,7 +448,9 @@ namespace DeviceLibrary
case MoveStep.TransplantMove_30:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_31);
IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.LOW);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
MoveInfo.NewMove(MoveStep.Wait);
if (GroupName == "AMH-SBSH2")
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
break;
case MoveStep.TransplantMove_31:
SRec.error(crc.GetString("Res0024","物料横移"), GroupName, crc.GetString("Res0025","载物托盘"), crc.GetString("Res0038","物料已到托盘"), CurrrentRFID, MoveInfo.MoveParam.ToStr());
......@@ -530,7 +538,7 @@ namespace DeviceLibrary
{
if (string.IsNullOrEmpty(CurrrentRFID))
CurrrentRFID = ConfigHelper.Config.Get($"Runtime_{GroupName}_CurrrentRFID");
TrayManager.Process(MoveInfo, CurrrentRFID, DeviceGroup.addr_1, out _);
TrayManager.Process(MoveInfo, CurrrentRFID, DeviceGroup.addr_1,-1, out _);
MoveInfo.log("检测到上次已打开吸盘,CurrrentRFID:"+ CurrrentRFID);
//入库过程
if (ConfigHelper.Config.Get($"Runtime_{GroupName}_IsInStore", false) && IOValue(IO_Type.AMH_Reel_Check).Equals(IO_VALUE.LOW))
......@@ -576,7 +584,7 @@ namespace DeviceLibrary
{
if (IOManager.IOValue(IO_Type.Ls_B_Front_Check, "LS2").Equals(IO_VALUE.HIGH))
{
Msg.add(crc.GetString("Res0039","LS2-2 堵塞中,暂缓放行"), MsgLevel.warning);
Msg.add(crc.GetString("Res0039","LS2-2 堵塞中,暂缓放行"), MsgLevel.info);
return false;
}
}
......@@ -584,7 +592,7 @@ namespace DeviceLibrary
{
if (IOManager.IOValue(IO_Type.Ls_A_Front_Check, "LS2").Equals(IO_VALUE.HIGH))
{
Msg.add(crc.GetString("Res0040","LS2-1 堵塞中,暂缓放行"), MsgLevel.warning);
Msg.add(crc.GetString("Res0040","LS2-1 堵塞中,暂缓放行"), MsgLevel.info);
return false;
}
}
......
......@@ -34,9 +34,10 @@ namespace DeviceLibrary
public AxisBean axis;
public AxisBean axis2;
public TrayStop(DeviceGroup device,out string msg) {
public TrayStop(DeviceGroup device, out string msg) : base()
{
msg = "";
Name = device.Name+"("+ device.GroupName + ")";
Name = device.Name + "(" + device.GroupName + ")";
DeviceGroup = device;
GroupName = DeviceGroup.GroupName;
Msg = new MsgService(GroupName);
......@@ -44,15 +45,16 @@ namespace DeviceLibrary
if (!string.IsNullOrEmpty(DeviceGroup.RFID_1))
{
RFID_1 = new PuYueRFID_C2S(DeviceGroup.RFID_1);
if (!RFID_1.Open()) {
msg += DeviceGroup.GroupName + " RFID 1:" + DeviceGroup.RFID_1 +","+crc.GetString("Res0183","打开失败")+ "\r\n";
if (!RFID_1.Open())
{
msg += DeviceGroup.GroupName + " RFID 1:" + DeviceGroup.RFID_1 + "," + crc.GetString("Res0183", "打开失败") + "\r\n";
}
}
Location = new CylinderManger($"托盘顶升", GroupName, IO_Type.MI_Location_Up, IO_Type.MI_Location_Down);
var axisc = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[GroupName].AxisID);
if (axisc != null)
axis = new AxisBean(axisc, GroupName);
axis = new AxisBean(axisc, GroupName);
axisc = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[GroupName].Axis2ID);
if (axisc != null)
axis2 = new AxisBean(axisc, GroupName);
......@@ -80,7 +82,6 @@ namespace DeviceLibrary
OneWayProcess();
}
}
int isalivetrytimes = 0;
int StopBufDelayMS = 500;
int StopDelayMS = 1500;
public void OneWayProcess()
......@@ -142,7 +143,7 @@ namespace DeviceLibrary
if (RFID_1.ReadByte(0x20, 16, out byte[] data, out string errmsg))
{
CurrrentRFID = Common.RfidFilter(data);
TrayManager.Process(MoveInfo, CurrrentRFID, DeviceGroup.addr_1, out TrayInfo trayInfo);
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 张东亮处理
......@@ -332,7 +333,7 @@ namespace DeviceLibrary
case MoveStep.TrayStop_07:
MoveInfo.NextMoveStep(MoveStep.TrayStop_WaitLoadProcess);
Location.ToHigh(MoveInfo);
isalivetrytimes = 0;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case MoveStep.TrayStop_WaitLoadProcess:
Msg.add(crc.GetString("Res0046","等待处理物料"),MsgLevel.info);
......@@ -360,9 +361,17 @@ namespace DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(crc.GetString("Res0046","等待处理物料"), MsgLevel.info));
}
}
}
break;
case MoveStep.TrayStop_LoadProcessed:
if (TrayManager.Traylist.ContainsKey(CurrrentRFID) && TrayManager.Traylist[CurrrentRFID].HasLoad)
{
if (IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.LOW))
{
Msg.add("托盘放料后没有检测到物料", MsgLevel.alarm);
return;
}
}
MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
Location.ToLow(MoveInfo);
MoveInfo.log("物料离开, 顶升下降");
......@@ -428,15 +437,32 @@ namespace DeviceLibrary
switch (MoveInfo.MoveStep)
{
case MoveStep.Wait:
if ((GroupName == "AMH-ML5-1" || GroupName == "AMH-ML5-2") && RobotManage.mainMachine.IOValue(IO_Type.ML5_DoorSafeCheck).Equals(IO_VALUE.LOW))
{
Msg.add(crc.GetString("Res0041","ML5料口门光栅被遮挡"), MsgLevel.warning);
break;
}
MoveInfo.NextMoveStep(MoveStep.H01_HomeReset);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case MoveStep.H01_HomeReset:
if ((GroupName == "AMH-ML5-1" || GroupName == "AMH-ML5-2") && RobotManage.mainMachine.IOValue(IO_Type.ML5_DoorSafeCheck).Equals(IO_VALUE.LOW))
{
Msg.add(crc.GetString("Res0041", "ML5料口门光栅被遮挡"), MsgLevel.warning);
break;
}
var dl = new string[] { "AMH-MI1" };//, "AMH-MI2" };
foreach (var d in dl)
{
if (GroupName == d && MI.DeviceList[d].DeviceState != DeviceStateE.Run
&& MI.DeviceList[d].MoveInfo.MoveStep != MoveStep.Wait)
{
Msg.add("等待" + d + "完成复位", MsgLevel.warning);
}
else if (GroupName == d && MI.DeviceList[d].DeviceState == DeviceStateE.Run
&& MI.DeviceList[d].MoveInfo.MoveStep != MoveStep.Wait)
{
MoveInfo.NextMoveStep(MoveStep.TrayStop_WaitLoadProcess);
DeviceState = DeviceStateE.Run;
return;
}
}
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
Location.ToLow(MoveInfo);
break;
......
......@@ -33,50 +33,30 @@ namespace RemoteSheardObject
return !string.IsNullOrEmpty(SubmitPostData("/service/store/robotBox/updateLocInfo", postData));
}
public static string SubmitPostData(string url, Dictionary<string, string> postData)
public static Dictionary<string,int> GetTaskCount()
{
url = CombineUrl(Config.Get("Device_Server_Address"), url);
//创建WebClient对象
using (var client = new WebClient())
//pizzaBox,pcb,tray,reel
var postData = new Dictionary<string, string>()
{
//设置提交数据的方式为"application/x-www-form-urlencoded"
client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
try
{
//将POST请求参数字典转换为参数字符串
var postDataString = new StringBuilder();
foreach (var item in postData)
{
if (!string.IsNullOrEmpty(item.Value))
{
postDataString.AppendFormat("{0}={1}&", item.Key, Uri.EscapeDataString(item.Value));
}
}
//去掉最后一个"&"符号
postDataString.Length--;
//将POST请求参数转换为字节数组
byte[] bytes = Encoding.UTF8.GetBytes(postDataString.ToString());
//提交POST请求并获取响应
byte[] response = client.UploadData(url, "POST", bytes);
};
Dictionary<string, int> taskdata = new Dictionary<string, int>();
taskdata["pizzaBox"] = 0;
taskdata["pcb"] = 0;
taskdata["tray"] = 0;
taskdata["reel"] = 0;
//将响应转换为字符串并输出
return Encoding.UTF8.GetString(response);
var result= JsonConvert.DeserializeObject<ResultData>(SubmitPostData("/rest/micron/device/getTaskCount", postData));
if (result.code != 0)
return taskdata;
}
catch (Exception ex)
{
// 捕获任何网络异常,并输出错误信息
Console.WriteLine("提交POST请求时发生错误:" + ex.Message);
// 请求失败,返回false
return "";
}
foreach (var k in taskdata.Keys)
{
if (result.data.ContainsKey(k))
taskdata[k] = int.Parse(result.data[k]);
}
return taskdata;
}
public static string CombineUrl(string baseUrl, string relativeUrl)
{
if (string.IsNullOrEmpty(baseUrl))
......@@ -112,6 +92,12 @@ namespace RemoteSheardObject
return default;
}
public static void UploadStatus(EquipMsgData equipMsgData)
{
string url = CombineUrl(Config.Get("Device_Server_Address"), "/rest/micron/device/updateStatus");
var resultStr = HttpHelper.Post<EquipMsgData, ResultData>(url, equipMsgData);
}
public class ResultData
{
//{"code":0,"msg":"ok","data":"7"}
......@@ -121,5 +107,49 @@ namespace RemoteSheardObject
public Dictionary<string, string> data { get; set; }
}
public static string SubmitPostData(string url, Dictionary<string, string> postData)
{
url = CombineUrl(Config.Get("Device_Server_Address"), url);
//创建WebClient对象
using (var client = new WebClient())
{
//设置提交数据的方式为"application/x-www-form-urlencoded"
client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
try
{
//将POST请求参数字典转换为参数字符串
var postDataString = new StringBuilder();
foreach (var item in postData)
{
if (!string.IsNullOrEmpty(item.Value))
{
postDataString.AppendFormat("{0}={1}&", item.Key, Uri.EscapeDataString(item.Value));
}
}
//去掉最后一个"&"符号
postDataString.Length--;
//将POST请求参数转换为字节数组
byte[] bytes = Encoding.UTF8.GetBytes(postDataString.ToString());
//提交POST请求并获取响应
byte[] response = client.UploadData(url, "POST", bytes);
//将响应转换为字符串并输出
return Encoding.UTF8.GetString(response);
}
catch (Exception ex)
{
// 捕获任何网络异常,并输出错误信息
Console.WriteLine("提交POST请求时发生错误:" + ex.Message);
// 请求失败,返回false
return "";
}
}
}
}
}
......@@ -367,6 +367,7 @@ namespace TheMachine
// RobotManage.mainMachine.Msg.Show();
// //return;
//}
LogUtil.info("用户按下启动:"+ sender.ToString());
RobotManage.Start();
userpause = false;
if (RobotManage.isRunning)
......@@ -375,7 +376,7 @@ namespace TheMachine
RobotManage_UserPauseSet(this, false);
//(sender as Button).Text = "暂停运行";
}
LogUtil.info("用户按下启动");
}
else if (!userpause)
{
......
......@@ -46,7 +46,7 @@ namespace TheMachine
}
}
}
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true).SetValue(Application.ProductName, Application.ExecutablePath);
Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true).SetValue(Application.ProductName, Application.ExecutablePath);
Config.LoadMyConfig(new Setting_Init().GetType());
Application.ThreadException += Application_ThreadException;
......
......@@ -145,6 +145,9 @@ namespace TheMachine
listView1.Items[ti.RFID].ForeColor = Color.DarkGray;
else
listView1.Items[ti.RFID].ForeColor = Color.Black;
if (ti.HasLoad && ti.HasLoadCheck<0)
listView1.Items[ti.RFID].ForeColor = Color.Red;
}
ListView2.Items.Clear();
foreach (var tivk in TrayManager.TrayRequest.ToArray())
......
......@@ -33,25 +33,26 @@ namespace TheMachine.device.Other
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.stateView = new TheMachine.DoubleBufferListView();
this.btn_manualout = new System.Windows.Forms.Button();
this.txt_reelid = new System.Windows.Forms.TextBox();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.uc_boxdebug1 = new TheMachine.uc_boxdebug();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.uc_boxdebug2 = new TheMachine.uc_boxdebug();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.uc_boxdebug3 = new TheMachine.uc_boxdebug();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.stateView = new TheMachine.DoubleBufferListView();
this.uc_boxdebug1 = new TheMachine.uc_boxdebug();
this.uc_boxdebug2 = new TheMachine.uc_boxdebug();
this.uc_boxdebug3 = new TheMachine.uc_boxdebug();
this.ucurRobot1 = new URRobot.UCURRobot();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.ucurRobot2 = new URRobot.UCURRobot();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.ucurRobot3 = new URRobot.UCURRobot();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.btn_ResetRobot = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage4.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -82,6 +83,7 @@ namespace TheMachine.device.Other
//
// tabPage4
//
this.tabPage4.Controls.Add(this.btn_ResetRobot);
this.tabPage4.Controls.Add(this.groupBox2);
this.tabPage4.Controls.Add(this.btn_manualout);
this.tabPage4.Controls.Add(this.txt_reelid);
......@@ -100,11 +102,24 @@ namespace TheMachine.device.Other
this.groupBox2.Controls.Add(this.stateView);
this.groupBox2.Location = new System.Drawing.Point(19, 24);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(561, 392);
this.groupBox2.Size = new System.Drawing.Size(561, 365);
this.groupBox2.TabIndex = 24;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Tower Status";
//
// stateView
//
this.stateView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.stateView.Dock = System.Windows.Forms.DockStyle.Fill;
this.stateView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.stateView.HideSelection = false;
this.stateView.Location = new System.Drawing.Point(3, 29);
this.stateView.MultiSelect = false;
this.stateView.Name = "stateView";
this.stateView.Size = new System.Drawing.Size(555, 333);
this.stateView.TabIndex = 0;
this.stateView.UseCompatibleStateImageBehavior = false;
//
// btn_manualout
//
this.btn_manualout.Location = new System.Drawing.Point(829, 487);
......@@ -133,6 +148,16 @@ namespace TheMachine.device.Other
this.tabPage1.Text = "MI1 点位";
this.tabPage1.UseVisualStyleBackColor = true;
//
// uc_boxdebug1
//
this.uc_boxdebug1.Config = null;
this.uc_boxdebug1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uc_boxdebug1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uc_boxdebug1.Location = new System.Drawing.Point(3, 3);
this.uc_boxdebug1.Name = "uc_boxdebug1";
this.uc_boxdebug1.Size = new System.Drawing.Size(986, 542);
this.uc_boxdebug1.TabIndex = 0;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.uc_boxdebug2);
......@@ -144,6 +169,16 @@ namespace TheMachine.device.Other
this.tabPage2.Text = "MI2 点位";
this.tabPage2.UseVisualStyleBackColor = true;
//
// uc_boxdebug2
//
this.uc_boxdebug2.Config = null;
this.uc_boxdebug2.Dock = System.Windows.Forms.DockStyle.Fill;
this.uc_boxdebug2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uc_boxdebug2.Location = new System.Drawing.Point(3, 3);
this.uc_boxdebug2.Name = "uc_boxdebug2";
this.uc_boxdebug2.Size = new System.Drawing.Size(986, 542);
this.uc_boxdebug2.TabIndex = 0;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.uc_boxdebug3);
......@@ -155,6 +190,16 @@ namespace TheMachine.device.Other
this.tabPage3.Text = "CI 点位";
this.tabPage3.UseVisualStyleBackColor = true;
//
// uc_boxdebug3
//
this.uc_boxdebug3.Config = null;
this.uc_boxdebug3.Dock = System.Windows.Forms.DockStyle.Fill;
this.uc_boxdebug3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uc_boxdebug3.Location = new System.Drawing.Point(3, 3);
this.uc_boxdebug3.Name = "uc_boxdebug3";
this.uc_boxdebug3.Size = new System.Drawing.Size(986, 542);
this.uc_boxdebug3.TabIndex = 0;
//
// tabPage5
//
this.tabPage5.Controls.Add(this.panel1);
......@@ -202,6 +247,14 @@ namespace TheMachine.device.Other
this.groupBox1.TabStop = false;
this.groupBox1.Text = "MI1";
//
// ucurRobot1
//
this.ucurRobot1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucurRobot1.Location = new System.Drawing.Point(2, 16);
this.ucurRobot1.Name = "ucurRobot1";
this.ucurRobot1.Size = new System.Drawing.Size(306, 197);
this.ucurRobot1.TabIndex = 17;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.ucurRobot2);
......@@ -214,6 +267,14 @@ namespace TheMachine.device.Other
this.groupBox3.TabStop = false;
this.groupBox3.Text = "MI2";
//
// ucurRobot2
//
this.ucurRobot2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucurRobot2.Location = new System.Drawing.Point(2, 16);
this.ucurRobot2.Name = "ucurRobot2";
this.ucurRobot2.Size = new System.Drawing.Size(306, 197);
this.ucurRobot2.TabIndex = 17;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.ucurRobot3);
......@@ -226,71 +287,6 @@ namespace TheMachine.device.Other
this.groupBox4.TabStop = false;
this.groupBox4.Text = "CI";
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// stateView
//
this.stateView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.stateView.Dock = System.Windows.Forms.DockStyle.Fill;
this.stateView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.stateView.HideSelection = false;
this.stateView.Location = new System.Drawing.Point(3, 29);
this.stateView.MultiSelect = false;
this.stateView.Name = "stateView";
this.stateView.Size = new System.Drawing.Size(555, 360);
this.stateView.TabIndex = 0;
this.stateView.UseCompatibleStateImageBehavior = false;
//
// uc_boxdebug1
//
this.uc_boxdebug1.Config = null;
this.uc_boxdebug1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uc_boxdebug1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uc_boxdebug1.Location = new System.Drawing.Point(3, 3);
this.uc_boxdebug1.Name = "uc_boxdebug1";
this.uc_boxdebug1.Size = new System.Drawing.Size(986, 542);
this.uc_boxdebug1.TabIndex = 0;
//
// uc_boxdebug2
//
this.uc_boxdebug2.Config = null;
this.uc_boxdebug2.Dock = System.Windows.Forms.DockStyle.Fill;
this.uc_boxdebug2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uc_boxdebug2.Location = new System.Drawing.Point(3, 3);
this.uc_boxdebug2.Name = "uc_boxdebug2";
this.uc_boxdebug2.Size = new System.Drawing.Size(986, 542);
this.uc_boxdebug2.TabIndex = 0;
//
// uc_boxdebug3
//
this.uc_boxdebug3.Config = null;
this.uc_boxdebug3.Dock = System.Windows.Forms.DockStyle.Fill;
this.uc_boxdebug3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uc_boxdebug3.Location = new System.Drawing.Point(3, 3);
this.uc_boxdebug3.Name = "uc_boxdebug3";
this.uc_boxdebug3.Size = new System.Drawing.Size(986, 542);
this.uc_boxdebug3.TabIndex = 0;
//
// ucurRobot1
//
this.ucurRobot1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucurRobot1.Location = new System.Drawing.Point(2, 16);
this.ucurRobot1.Name = "ucurRobot1";
this.ucurRobot1.Size = new System.Drawing.Size(306, 197);
this.ucurRobot1.TabIndex = 17;
//
// ucurRobot2
//
this.ucurRobot2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucurRobot2.Location = new System.Drawing.Point(2, 16);
this.ucurRobot2.Name = "ucurRobot2";
this.ucurRobot2.Size = new System.Drawing.Size(306, 197);
this.ucurRobot2.TabIndex = 17;
//
// ucurRobot3
//
this.ucurRobot3.Dock = System.Windows.Forms.DockStyle.Fill;
......@@ -299,6 +295,22 @@ namespace TheMachine.device.Other
this.ucurRobot3.Size = new System.Drawing.Size(306, 197);
this.ucurRobot3.TabIndex = 17;
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// btn_ResetRobot
//
this.btn_ResetRobot.Location = new System.Drawing.Point(19, 437);
this.btn_ResetRobot.Name = "btn_ResetRobot";
this.btn_ResetRobot.Size = new System.Drawing.Size(267, 93);
this.btn_ResetRobot.TabIndex = 25;
this.btn_ResetRobot.Text = "机器人复位至待机点, 并释放压紧装置";
this.btn_ResetRobot.UseVisualStyleBackColor = true;
this.btn_ResetRobot.Click += new System.EventHandler(this.btn_ResetRobot_Click);
//
// MycronicControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -347,5 +359,6 @@ namespace TheMachine.device.Other
private System.Windows.Forms.GroupBox groupBox2;
private DoubleBufferListView stateView;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Button btn_ResetRobot;
}
}
......@@ -80,5 +80,16 @@ namespace TheMachine.device.Other
stateView.Items.Add(lvi);
}
}
private void btn_ResetRobot_Click(object sender, EventArgs e)
{
if (RobotManage.isRunning)
{
MessageBox.Show("请先停止系统运行");
return;
}
MI.DeviceList["AMH-MI1"].
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!