Commit bd6dcba0 刘韬

1

1 个父辈 79ba11eb
...@@ -17,7 +17,7 @@ namespace OnlineStore.Common ...@@ -17,7 +17,7 @@ namespace OnlineStore.Common
/// 系统主界面标题 /// 系统主界面标题
/// </summary> /// </summary>
[MyConfigComment("系统主界面标题")] [MyConfigComment("系统主界面标题")]
public static MyConfig<string> App_Title="MIMO"; public static MyConfig<string> App_Title="Cycle Line";
[MyConfigComment("服务器地址")] [MyConfigComment("服务器地址")]
public static MyConfig<string> Device_Server_Address = "http://192.168.1.243/smf-core"; public static MyConfig<string> Device_Server_Address = "http://192.168.1.243/smf-core";
...@@ -31,35 +31,8 @@ namespace OnlineStore.Common ...@@ -31,35 +31,8 @@ namespace OnlineStore.Common
[MyConfigComment("是否启用蜂鸣器")] [MyConfigComment("是否启用蜂鸣器")]
public static MyConfig<bool> Device_EnableBuzzer = true; public static MyConfig<bool> Device_EnableBuzzer = true;
[MyConfigComment("温湿度传感器串口号")]
public static MyConfig<string> Device_Humiture_Port = "COM3";
[MyConfigComment("是否启用校准库位")]
public static MyConfig<bool> Device_Use_Fixpos = false;
[MyConfigComment("屏蔽日志窗口")] [MyConfigComment("屏蔽日志窗口")]
public static MyConfig<bool> Device_DisableLogWindow = true; public static MyConfig<bool> Device_DisableLogWindow = true;
[MyConfigComment("屏蔽升降轴调试保护")]
public static MyConfig<bool> Device_DisableUpdownProtect = false;
[MyConfigComment("湿度超限吹气启动相对值=服务器设定湿度报警值-本相对值")]
public static MyConfig<int> Device_HumidityStartOffser = 1;
[MyConfigComment("湿度超限吹气停止相对值=服务器设定湿度报警值-本相对值")]
public static MyConfig<int> Device_HumidityEndOffser = 10;
[MyConfigComment("单料口入库只能单料口出")]
public static MyConfig<bool> Device_SingleInSingleOut = false;
[MyConfigComment("允许单料口单盘入库")]
public static MyConfig<bool> Device_Allow_SingleIn = false;
[MyConfigComment("是否启用socket扫码")]
public static MyConfig<bool> SocketScanner_enable = false;
[MyConfigComment("socket uri=socket://127.0.0.1:7930")]
public static MyConfig<string> SocketScanner_uri = "socket://127.0.0.1:7930";
[MyConfigComment("socket 扫码等待超时")]
public static MyConfig<int> SocketScanner_receiver_timeout = 10000;
[MyConfigComment("socket 扫码触发代码")]
public static MyConfig<string> SocketScanner_trigger_code= "trigger";
[MyConfigComment("socket 扫码接收匹配正则表达式")]
public static MyConfig<string> SocketScanner_pattern_code= "reel:(.+?)!";
/// <summary> /// <summary>
......
...@@ -83,15 +83,6 @@ namespace DeviceLibrary ...@@ -83,15 +83,6 @@ namespace DeviceLibrary
operation.op = 1; operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", code }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } }; operation.data = new Dictionary<string, string>() { { "code", code }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } };
if (reel.PlateH==100 && Setting_Init.Device_SingleInSingleOut)
{
//singleIn 单盘入库
operation.data.Add("singleIn", "true");
}
else
{
operation.data.Add("singleIn", "false");
}
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 15000, printlog); Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 15000, printlog);
if (resultOperation==null || operation.seq != resultOperation.seq) if (resultOperation==null || operation.seq != resultOperation.seq)
{ {
......
...@@ -12,23 +12,24 @@ namespace DeviceLibrary ...@@ -12,23 +12,24 @@ namespace DeviceLibrary
{ {
public class DeviceBase public class DeviceBase
{ {
public MsgService Msg; public MsgService Msg { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string Device { get; set; } = "root"; public string GroupName { get; set; }
public void StopMove(bool ServoOff=false) public void StopMove(bool ServoOff=false)
{ {
//runStatus = RunStatus.Stop; //runStatus = RunStatus.Stop;
MoveInfo.List.ForEach((m)=> { m.EndMove(); }); MoveInfo.List.ForEach((m)=> { m.EndMove(); });
AxisBean.StopMultiAxis(AxisBean.List[Device]); AxisBean.StopMultiAxis(AxisBean.List[GroupName]);
if (ServoOff) if (ServoOff)
{ {
AxisBean.CloseMultiAxis(AxisBean.List[Device]); AxisBean.CloseMultiAxis(AxisBean.List[GroupName]);
} }
} }
public void OpenAllServo() public void OpenAllServo()
{ {
AxisBean.RunMultiAxis(true, out _, AxisBean.List[Device]); AxisBean.RunMultiAxis(true, out _, AxisBean.List[GroupName]);
} }
int logType = 1000; int logType = 1000;
string WarnMsg = ""; string WarnMsg = "";
...@@ -87,7 +88,7 @@ namespace DeviceLibrary ...@@ -87,7 +88,7 @@ namespace DeviceLibrary
} }
else if (wait.WaitType.Equals(WaitEnum.W002_IOValue)) else if (wait.WaitType.Equals(WaitEnum.W002_IOValue))
{ {
ConfigIO io = RobotManage.Config.GetWaitIO(wait.IoType, Device); ConfigIO io = RobotManage.Config.GetWaitIO(wait.IoType, GroupName);
NotOkMsg = MoveInfo.Name + crc.GetString("Res0157","等待")+"【" + io.DisplayStr + "】=【" + wait.IoValue + "】"; NotOkMsg = MoveInfo.Name + crc.GetString("Res0157","等待")+"【" + io.DisplayStr + "】=【" + wait.IoValue + "】";
wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue); wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue);
if (!wait.IsEnd) if (!wait.IsEnd)
...@@ -234,32 +235,30 @@ namespace DeviceLibrary ...@@ -234,32 +235,30 @@ namespace DeviceLibrary
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoHighType, IO_VALUE.HIGH)); moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoHighType, IO_VALUE.HIGH));
} }
} }
public IO_VALUE IOValue(string ioType) => IOManager.IOValue(ioType); public IO_VALUE IOValue(string ioType) => IOManager.IOValue(ioType,GroupName);
public void IOMove(string IoType, IO_VALUE value, bool isCheck = false, int msTime = 0) public void IOMove(string IoType, IO_VALUE value, int msTime = 0)
{ {
if (msTime <= 0) if (msTime <= 0)
{ {
if (isCheck && (IOValue(IoType).Equals(value))) IOManager.IOMove(IoType, value, GroupName);
{
return;
}
IOManager.IOMove(IoType, value);
} }
else else
{ {
Task.Run(()=> Task.Run(()=>
{ {
IOManager.IOMove(IoType, value); IOManager.IOMove(IoType, value, GroupName);
Thread.Sleep(msTime); Thread.Sleep(msTime);
IO_VALUE tValue = value.Equals(IO_VALUE.HIGH) ? IO_VALUE.LOW : IO_VALUE.HIGH; IO_VALUE tValue = value.Equals(IO_VALUE.HIGH) ? IO_VALUE.LOW : IO_VALUE.HIGH;
LogUtil.info(Name + "定时回写IO: [" + IoType + "]=[" + value + "],msTime=" + msTime); LogUtil.info(Name + "定时回写IO: [" + IoType + "]=[" + value + "],msTime=" + msTime);
IOManager.IOMove(IoType, tValue); IOManager.IOMove(IoType, tValue, GroupName);
}); });
} }
} }
public enum StringStateE public enum StringStateE
{ {
None=0, None=0,
......
...@@ -20,28 +20,5 @@ namespace DeviceLibrary ...@@ -20,28 +20,5 @@ namespace DeviceLibrary
Msg.add(crc.GetString("Res0166","未检测到气压信号."), MsgLevel.warning); Msg.add(crc.GetString("Res0166","未检测到气压信号."), MsgLevel.warning);
} }
} }
bool lastTHoutRangeStatus = false;
DateTime lastTHoutRangeTime = DateTime.MaxValue;
bool IsTHoutRange()
{
if (HumitureController.LastData.Humidity > ServerCM.Max_Humidity// || HumitureController.LastData.Humidity < ServerCM.Min_Humidity
|| HumitureController.LastData.Temperate > ServerCM.Max_Temperature)
{
if (!lastTHoutRangeStatus)
lastTHoutRangeTime = DateTime.Now;
lastTHoutRangeStatus = true;
return true;
}
else
{
if (lastTHoutRangeStatus)
lastTHoutRangeTime = DateTime.MaxValue;
lastTHoutRangeStatus = false;
return false;
}
}
bool IsTHoutRangeOver30m() {
return (DateTime.Now - lastTHoutRangeTime).TotalMinutes > 30;
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -82,12 +82,6 @@ namespace DeviceLibrary ...@@ -82,12 +82,6 @@ namespace DeviceLibrary
//系统暂停, 绿闪,红闪 //系统暂停, 绿闪,红闪
MachineLedStateName[MachineLedStateE.SystemPause] = crc.GetString("Res0169","暂停"); MachineLedStateName[MachineLedStateE.SystemPause] = crc.GetString("Res0169","暂停");
MachineLedState.Add(MachineLedStateE.SystemPause, nls(LedState.blink, LedState.off, LedState.blink)); MachineLedState.Add(MachineLedStateE.SystemPause, nls(LedState.blink, LedState.off, LedState.blink));
//温湿度超限30分钟. 红闪,黄闪
MachineLedStateName[MachineLedStateE.THoutRangeOver30m] = crc.GetString("Res0170","温湿度超限30分钟");
MachineLedState.Add(MachineLedStateE.THoutRangeOver30m, nls(LedState.blink, LedState.blink, LedState.none));
//温湿度超限 绿闪黄闪
MachineLedStateName[MachineLedStateE.THoutRange] = crc.GetString("Res0171","温湿度超限");
MachineLedState.Add(MachineLedStateE.THoutRange, nls(LedState.none, LedState.blink, LedState.blink));
//进出库, 绿亮,黄闪 //进出库, 绿亮,黄闪
MachineLedStateName[MachineLedStateE.InOut] = crc.GetString("Res0172","出入库中"); MachineLedStateName[MachineLedStateE.InOut] = crc.GetString("Res0172","出入库中");
MachineLedState.Add(MachineLedStateE.InOut, nls(LedState.none, LedState.blink, LedState.on)); MachineLedState.Add(MachineLedStateE.InOut, nls(LedState.none, LedState.blink, LedState.on));
...@@ -139,22 +133,6 @@ namespace DeviceLibrary ...@@ -139,22 +133,6 @@ namespace DeviceLibrary
//StandbyLed.LedState = LedState.blink; //StandbyLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.InOut); ProcessLefCfg(MachineLedStateE.InOut);
} }
//温度超限 绿亮 黄闪
if (IsTHoutRange())
{
//RunningLed.LedState = LedState.on;
//StandbyLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.THoutRange);
}
//温度超限30分钟 绿亮 黄闪 红闪
if (IsTHoutRangeOver30m())
{
//RunningLed.LedState = LedState.on;
//StandbyLed.LedState = LedState.blink;
//AlarmLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.THoutRangeOver30m);
}
//系统暂停,说明书未定义, 绿闪, 红闪 //系统暂停,说明书未定义, 绿闪, 红闪
if (!canRunning || UserPause) if (!canRunning || UserPause)
{ {
......
...@@ -13,7 +13,7 @@ namespace DeviceLibrary ...@@ -13,7 +13,7 @@ namespace DeviceLibrary
{ {
public partial class MainMachine : DeviceBase, IRobot public partial class MainMachine : DeviceBase, IRobot
{ {
public string Name { get; set; } = "MIMO_PLUS"; new public string Name { get; set; } = "Cycle Line";
private bool _canRunning = true; private bool _canRunning = true;
public bool canRunning public bool canRunning
{ {
...@@ -33,27 +33,21 @@ namespace DeviceLibrary ...@@ -33,27 +33,21 @@ namespace DeviceLibrary
public Dictionary<string, DeviceGroup> DeviceGroup { get=>RobotManage.DeviceGroup; } public Dictionary<string, DeviceGroup> DeviceGroup { get=>RobotManage.DeviceGroup; }
public bool UserPause { get; set; } = false; public bool UserPause { get; set; } = false;
public MoveInfo ResetMoveInfo;
public delegate void ProcessMsg(List<Msg> msg); public delegate void ProcessMsg(List<Msg> msg);
public event ProcessMsg ProcessMsgEvent; public event ProcessMsg ProcessMsgEvent;
ServerCommunication ServerCM = new ServerCommunication(); ServerCommunication ServerCM = new ServerCommunication();
/// <summary>
/// 开始运行的时间
/// </summary>
public DateTime StartTime { get; set; }
/// <summary> /// <summary>
/// 是否在急停中 /// 是否在急停中
/// </summary> /// </summary>
public bool isInSuddenDown = false; public bool isInSuddenDown = false;
public MainMachine(out string msg) { public MainMachine(out string msg) {
GroupName = "root";
msg = ""; msg = "";
Config = RobotManage.Config; Config = RobotManage.Config;
Msg = new MsgService("root");
crc.LanguageChangeEvent += Crc_LanguageChangeEvent; crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
SideMove.Init(Config, DeviceGroup, out string m); SideMove.Init(Config, DeviceGroup, out string m);
...@@ -79,7 +73,7 @@ namespace DeviceLibrary ...@@ -79,7 +73,7 @@ namespace DeviceLibrary
private void Crc_LanguageChangeEvent(object sender, EventArgs e) private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{ {
ResetMoveInfo.Name = crc.GetString("Res0173","重置"); //ResetMoveInfo.Name = crc.GetString("Res0173","重置");
} }
public bool hasAlarm = false; public bool hasAlarm = false;
...@@ -107,7 +101,7 @@ namespace DeviceLibrary ...@@ -107,7 +101,7 @@ namespace DeviceLibrary
} }
else if (runStatus == RunStatus.HomeReset) else if (runStatus == RunStatus.HomeReset)
{ {
HomeReset(); runStatus = RunStatus.Running;
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -150,18 +144,13 @@ namespace DeviceLibrary ...@@ -150,18 +144,13 @@ namespace DeviceLibrary
LogUtil.info("主线程已退出."); LogUtil.info("主线程已退出.");
} }
public void Start() { public void Start() {
ServerCM.StartConnectServer();
Run(); Run();
} }
public void Stop() { public void Stop() {
mstart = false; mstart = false;
ServerCM.StopConnectServer();
Thread.Sleep(300);
Alarm(AlarmType.None); Alarm(AlarmType.None);
StopMove(true); StopMove(true);
LedProcess(null); LedProcess(null);
} }
public void BeginHomeReset(bool firstRun=false) { public void BeginHomeReset(bool firstRun=false) {
if (!firstRun) if (!firstRun)
...@@ -172,52 +161,13 @@ namespace DeviceLibrary ...@@ -172,52 +161,13 @@ namespace DeviceLibrary
OpenAllServo(); OpenAllServo();
Alarm(AlarmType.None); Alarm(AlarmType.None);
runStatus = RunStatus.HomeReset; runStatus = RunStatus.HomeReset;
ResetMoveInfo.NewMove(MoveStep.H01_HomeReset); SideMove.SideMoves.Values.ToList().ForEach(s => s.Start());
ResetMoveInfo.log("开始回原");
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
} }
//强制回原
bool forceHome=true;
void HomeReset()
{
if (CheckWait(ResetMoveInfo))
return;
switch (ResetMoveInfo.MoveStep)
{
case MoveStep.H01_HomeReset:
ServerCM.storeStatus = StoreStatus.ResetMove;
break;
case MoveStep.H02_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
ResetMoveInfo.log("夹爪升降上升");
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H03_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
break;
case MoveStep.HEND_HomeReset:
forceHome = false;
ResetMoveInfo.log("回原完成");
ResetMoveInfo.EndMove();
runStatus = RunStatus.Running;
ServerCM.storeStatus = StoreStatus.StoreOnline;
break;
}
}
bool _IgnoreSafecheck = false;
public bool IgnoreSafecheck { get => _IgnoreSafecheck; set {
_IgnoreSafecheck = value;
} }
public bool IgnoreGratingSignal = false;
bool lastSafeCheckStatus = true; bool lastSafeCheckStatus = true;
bool SafeCheck() { bool SafeCheck() {
bool ok = true; bool ok = true;
var ignorestring = "[" + crc.GetString("Res0174","已忽略") + "]";
if (!lastSafeCheckStatus && ok) if (!lastSafeCheckStatus && ok)
{ {
SafetyDevice.ResumeAll(); SafetyDevice.ResumeAll();
...@@ -229,13 +179,9 @@ namespace DeviceLibrary ...@@ -229,13 +179,9 @@ namespace DeviceLibrary
void DeviceSuddenStop() { void DeviceSuddenStop() {
if (lastSafeCheckStatus) if (lastSafeCheckStatus)
{ {
AxisBean.StopMultiAxis(AxisBean.List[Device]); AxisBean.StopMultiAxis(AxisBean.List[GroupName]);
MoveInfo.List.ForEach((m) => { m.CanWhileCount = 5; }); MoveInfo.List.ForEach((m) => { m.CanWhileCount = 5; });
SafetyDevice.PauseAll(); SafetyDevice.PauseAll();
if (runStatus == RunStatus.HomeReset)
{
ResetMoveInfo.NewMove(MoveStep.H01_HomeReset);
}
} }
} }
...@@ -248,9 +194,15 @@ namespace DeviceLibrary ...@@ -248,9 +194,15 @@ namespace DeviceLibrary
public bool DeviceCheck() { public bool DeviceCheck() {
bool ok = true; bool ok = true;
isInSuddenDown = IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW); isInSuddenDown = IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW);
if (UserPause) if (IOValue(IO_Type.AutoRun_Single).Equals(IO_VALUE.LOW)) {
Msg.add("自动运行开关未开", MsgLevel.warning);
DeviceSuddenStop();
lastSafeCheckStatus = false;
ok = false;
}
else if (UserPause)
{ {
Msg.add(crc.GetString("Res0175","系统暂停"), MsgLevel.warning); Msg.add(crc.GetString("Res0175", "系统暂停"), MsgLevel.warning);
DeviceSuddenStop(); DeviceSuddenStop();
lastSafeCheckStatus = false; lastSafeCheckStatus = false;
ok = false; ok = false;
...@@ -259,20 +211,14 @@ namespace DeviceLibrary ...@@ -259,20 +211,14 @@ namespace DeviceLibrary
else if (isInSuddenDown) else if (isInSuddenDown)
{ {
Alarm(AlarmType.SuddenStop); Alarm(AlarmType.SuddenStop);
Msg.add(crc.GetString("Res0176","急停中"), MsgLevel.alarm); Msg.add(crc.GetString("Res0176", "急停中"), MsgLevel.alarm);
ok = false; ok = false;
} }
else if (alarmType != AlarmType.None) { else if (alarmType != AlarmType.None)
//if (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH))
//{
// Alarm(AlarmType.None);
//}
//else
{ {
Msg.add(crc.GetString("Res0177","系统需要重置"), MsgLevel.alarm,ErrInfo.SuddenStop); Msg.add(crc.GetString("Res0177", "系统需要重置"), MsgLevel.alarm, ErrInfo.SuddenStop);
ok = false; ok = false;
} }
}
if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW))
{ {
if (lastAirCloseTime == DateTime.MinValue) if (lastAirCloseTime == DateTime.MinValue)
......
...@@ -33,6 +33,20 @@ namespace DeviceLibrary ...@@ -33,6 +33,20 @@ namespace DeviceLibrary
SideMove_02, SideMove_02,
SideMove_03, SideMove_03,
SideMove_04, SideMove_04,
SideMove_05,
SideMove_06,
SideMove_07,
SideMove_08,
SideMove_09,
SideMove_10,
SideMove_11,
SideMove_12,
SideMove_13,
SideMove_14,
SideMove_15,
SideMove_16,
SideMove_17,
SideMove_18,
} }
......
...@@ -128,22 +128,6 @@ namespace DeviceLibrary ...@@ -128,22 +128,6 @@ namespace DeviceLibrary
else else
LogUtil.info("用户取消暂停:"+ msg); LogUtil.info("用户取消暂停:"+ msg);
} }
public static void IgnoreSafecheck(bool s)
{
mainMachine.IgnoreSafecheck = s;
if (s)
LogUtil.info("用户设置忽略安全检查");
else
LogUtil.info("用户取消忽略安全检查");
}
public static void IgnoreGratingSignal(bool s)
{
mainMachine.IgnoreGratingSignal = s;
if (s)
LogUtil.info("用户设置忽略安全光栅");
else
LogUtil.info("用户取消忽略安全光栅");
}
} }
public enum StoreType { public enum StoreType {
......
...@@ -6,9 +6,20 @@ using System.Threading.Tasks; ...@@ -6,9 +6,20 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
interface IDevice public interface IDevice
{ {
void Process(); void Process();
void ResetProcess(); MsgService Msg { get; set; }
string GroupName { get; }
DeviceStateE DeviceState { get; set; }
void Start();
void Stop();
}
public enum DeviceStateE
{
Stop,
HomeReset,
Run
} }
} }
...@@ -8,9 +8,9 @@ using System.Threading.Tasks; ...@@ -8,9 +8,9 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
public class SideMove:DeviceBase, IDevice public class SideMove:DeviceBase, IDevice,ISafetyDevice
{ {
static List<SideMove> SideMoves = new List<SideMove>(); public static Dictionary<string,SideMove> SideMoves = new Dictionary<string, SideMove>();
public static void Init(Robot_Config config, Dictionary<string, DeviceGroup> devices,out string msg) { public static void Init(Robot_Config config, Dictionary<string, DeviceGroup> devices,out string msg) {
msg = ""; msg = "";
...@@ -18,23 +18,28 @@ namespace DeviceLibrary ...@@ -18,23 +18,28 @@ namespace DeviceLibrary
if (devices[key].DeviceType != "LS") if (devices[key].DeviceType != "LS")
continue; continue;
SideMove sideMove = new SideMove(devices[key],out string m); SideMove sideMove = new SideMove(devices[key],out string m);
SideMoves.Add(sideMove);
SideMoves.Add(devices[key].GroupName, sideMove);
msg += m; msg += m;
} }
} }
DeviceGroup DeviceGroup; DeviceGroup DeviceGroup;
MoveInfo MoveInfo; MoveInfo LSAMoveInfo;
MsgService Msg; MoveInfo LSBMoveInfo;
PuYueRFID_C2S RFID_1 = null; PuYueRFID_C2S RFID_1 = null;
PuYueRFID_C2S RFID_2 = null; PuYueRFID_C2S RFID_2 = null;
public LineRunMonitor Line;
LS_TypeE LS_Type = LS_TypeE.NoRfid; LS_TypeE LS_Type = LS_TypeE.NoRfid;
public SideMove(DeviceGroup device,out string msg) { public SideMove(DeviceGroup device,out string msg) {
msg = ""; msg = "";
Name = device.Name+"("+ device.GroupName + ")"; Name = device.Name+"("+ device.GroupName + ")";
DeviceGroup = device; DeviceGroup = device;
Device = DeviceGroup.GroupName; GroupName = DeviceGroup.GroupName;
Msg = new MsgService(Device); Msg = new MsgService(GroupName);
MoveInfo = new MoveInfo(device.GroupName); LSAMoveInfo = new MoveInfo(GroupName + "_A");
LSBMoveInfo = new MoveInfo(GroupName + "_B");
SafetyDevice.AddDevice(this);
if (!string.IsNullOrEmpty(DeviceGroup.RFID_1)) if (!string.IsNullOrEmpty(DeviceGroup.RFID_1))
{ {
RFID_1 = new PuYueRFID_C2S(DeviceGroup.RFID_1); RFID_1 = new PuYueRFID_C2S(DeviceGroup.RFID_1);
...@@ -50,7 +55,10 @@ namespace DeviceLibrary ...@@ -50,7 +55,10 @@ namespace DeviceLibrary
msg += DeviceGroup.DeviceType + " RFID 2:" + DeviceGroup.RFID_2 + "," + crc.GetString("Res0183","打开失败") + "\r\n"; msg += DeviceGroup.DeviceType + " RFID 2:" + DeviceGroup.RFID_2 + "," + crc.GetString("Res0183","打开失败") + "\r\n";
} }
} }
if (RobotManage.Config.DOList[device.GroupName].ContainsKey(IO_Type.Ls_A_LineRwd))
Line = new LineRunMonitor(GroupName, RobotManage.Config.DOList[GroupName][IO_Type.Ls_A_LineRwd].GetIOAddr(), RobotManage.Config.DOList[GroupName][IO_Type.Ls_A_LineRwd].GetIOAddr());
else
Line = new LineRunMonitor(GroupName, RobotManage.Config.DOList[GroupName][IO_Type.Ls_A_LineRun].GetIOAddr());
if (RFID_1 == null && RFID_2 == null) if (RFID_1 == null && RFID_2 == null)
LS_Type = LS_TypeE.NoRfid; LS_Type = LS_TypeE.NoRfid;
else if (RFID_2 == null) else if (RFID_2 == null)
...@@ -58,53 +66,310 @@ namespace DeviceLibrary ...@@ -58,53 +66,310 @@ namespace DeviceLibrary
else else
LS_Type = LS_TypeE.TwoWay; LS_Type = LS_TypeE.TwoWay;
} }
public DeviceStateE DeviceState { get; set; }
public void Start()
{
DeviceState = DeviceStateE.HomeReset;
}
public void Stop()
{
DeviceState = DeviceStateE.Stop;
}
public void Process() public void Process()
{ {
if (CheckWait(MoveInfo)) if (DeviceState == DeviceStateE.HomeReset)
ResetProcess();
else if (DeviceState == DeviceStateE.Run)
{
if (LS_Type == LS_TypeE.NoRfid)
NoRfidProcess();
else {
OneWayProcess(LSAMoveInfo);
OneWayProcess(LSBMoveInfo);
}
}
}
int StopBufDelayMS = 500;
int StopDelayMS = 1000;
#region Rfid横移
public void NoRfidProcess()
{
if (CheckWait(LSAMoveInfo))
return; return;
switch (MoveInfo.MoveStep) switch (LSAMoveInfo.MoveStep)
{ {
case MoveStep.Wait: case MoveStep.Wait:
if (IOValue(IO_Type.Ls_B_Tray_Check).Equals(IO_VALUE.HIGH)) { break;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); case MoveStep.SideMove_01:
} LSAMoveInfo.NextMoveStep(MoveStep.SideMove_01);
else if(IOValue(IO_Type.Ls_A_Tray_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.Ls_A_Front_Check).Equals(IO_VALUE.HIGH))
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); LSAMoveInfo.NextMoveStep(MoveStep.SideMove_02);
CylinderMove(LSAMoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW);
CylinderMove(LSAMoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW);
} }
else if (IOValue(IO_Type.Ls_A_Front_Check).Equals(IO_VALUE.HIGH)) else
{ {
MoveInfo.NextMoveStep(MoveStep.SideMove_01); Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info);
CylinderMove(MoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW);
CylinderMove(MoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW);
IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, false, 1000);
IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, false, 500);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_A_Tray_Check,IO_VALUE.HIGH));
} }
else { break;
Msg.add(crc.GetString("Res0184","空闲中"), MsgLevel.info); case MoveStep.SideMove_02:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_03);
IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, StopDelayMS);
IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_A_Tray_Check, IO_VALUE.HIGH));
break;
case MoveStep.SideMove_03:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_04);
IOMove(IO_Type.Ls_B_BufStop_Fwd, IO_VALUE.HIGH, 500);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.SideMove_04:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_05);
CylinderMove(LSAMoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.HIGH);
CylinderMove(LSAMoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.HIGH);
break;
case MoveStep.SideMove_05:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_06);
IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.HIGH);
break;
case MoveStep.SideMove_06:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_07);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_B_Tray_Check, IO_VALUE.HIGH));
break;
case MoveStep.SideMove_07:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_08);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.SideMove_08:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_09);
IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.LOW);
CylinderMove(LSAMoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW);
CylinderMove(LSAMoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW);
break;
case MoveStep.SideMove_09:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_10);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_B_Tray_Check, IO_VALUE.LOW));
break;
case MoveStep.SideMove_10:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_11);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.SideMove_11:
LSAMoveInfo.NewMove(MoveStep.SideMove_01);
break;
} }
}
#endregion
#region 单方向LS处理
public void OneWayProcess(MoveInfo moveInfo)
{
var Minfo = moveInfo;
if (CheckWait(Minfo))
return;
string side = Minfo== LSAMoveInfo? "A":"B";
var Ls_A_Front_Check = $"Ls_{side}_Front_Check";
var Ls_A_Location_Up = $"Ls_{side}_Location_Up";
var Ls_A_Location_Down = $"Ls_{side}_Location_Down";
var Ls_A_Front_Stop = $"Ls_{side}_Front_Stop";
var Ls_A_Stop = $"Ls_{side}_Stop";
var Ls_A_BufStop_Rwd = $"Ls_{side}_BufStop_Rwd";
var Ls_A_Tray_Check = $"Ls_{side}_Tray_Check";
var sideb = side == "A" ? "B" : "A";
var Ls_B_Location_Up = $"Ls_{sideb}_Location_Up";
var Ls_B_Location_Down = $"Ls_{sideb}_Location_Down";
var Ls_B_Front_Stop = $"Ls_{sideb}_Front_Stop";
var Ls_B_Stop = $"Ls_{sideb}_Stop";
var Ls_B_BufStop_Fwd = $"Ls_{sideb}_BufStop_Fwd";
var Ls_B_BufStop_Rwd = $"Ls_{sideb}_BufStop_Rwd";
var Ls_B_Tray_Check = $"Ls_{sideb}_Tray_Check";
var RFID = Minfo == LSAMoveInfo ? RFID_1 : RFID_2;
var lsb = (Minfo == LSAMoveInfo ? LSBMoveInfo : LSAMoveInfo);
switch (Minfo.MoveStep)
{
case MoveStep.Wait:
break; break;
case MoveStep.SideMove_01: case MoveStep.SideMove_01:
MoveInfo.NextMoveStep(MoveStep.SideMove_02); Minfo.NextMoveStep(MoveStep.SideMove_01);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); if (lsb.MoveStep >= MoveStep.SideMove_10) {
Msg.add(sideb+"侧穿越中", MsgLevel.info);
}
else if (IOValue(Ls_A_Front_Check).Equals(IO_VALUE.HIGH))
{
Minfo.NextMoveStep(MoveStep.SideMove_02);
CylinderMove(Minfo, Ls_A_Location_Up, Ls_A_Location_Down, IO_VALUE.LOW);
IOMove(IO_Type.Ls_A_Stop, IO_VALUE.LOW);
}
else
{
Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info);
}
break; break;
case MoveStep.SideMove_02: case MoveStep.SideMove_02:
MoveInfo.NextMoveStep(MoveStep.SideMove_02); Minfo.NextMoveStep(MoveStep.SideMove_03);
CylinderMove(MoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.HIGH); Minfo.CanWhileCount = 3;
CylinderMove(MoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.HIGH); IOMove(Ls_A_Front_Stop, IO_VALUE.HIGH, StopDelayMS);
IOMove(Ls_A_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS);
Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_A_Tray_Check, IO_VALUE.HIGH));
break; break;
case MoveStep.SideMove_03: case MoveStep.SideMove_03:
MoveInfo.NextMoveStep(MoveStep.SideMove_04); if (LS_Type == LS_TypeE.OneWay)
{
Minfo.NextMoveStep(MoveStep.SideMove_04);
return;
}
if (RFID.TryRead(out string rfid, out _) == 1)
{
if (rfid == "通过")
Minfo.NextMoveStep(MoveStep.SideMove_04);
else
Minfo.NextMoveStep(MoveStep.SideMove_10);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(500));
}
else if (Minfo.CanWhileCount > 0)
{
Minfo.CanWhileCount--;
Minfo.log($"RFid读取失败,重试第{3- Minfo.CanWhileCount}次");
}
else {
Minfo.log("RFid读取失败,直接通过");
Minfo.NextMoveStep(MoveStep.SideMove_04);
}
break;
///直接穿过流程
case MoveStep.SideMove_04:
Minfo.NextMoveStep(MoveStep.SideMove_05);
IOMove(Ls_A_Stop, IO_VALUE.HIGH, StopDelayMS);
break;
case MoveStep.SideMove_05:
Minfo.NextMoveStep(MoveStep.SideMove_06);
Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_A_Tray_Check, IO_VALUE.LOW));
break;
case MoveStep.SideMove_06:
Minfo.NextMoveStep(MoveStep.SideMove_01);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
///横移流程
case MoveStep.SideMove_10:
if (lsb.MoveStep == MoveStep.SideMove_01)
{
Minfo.NextMoveStep(MoveStep.SideMove_11);
}
else if (lsb.MoveStep >= MoveStep.SideMove_11) {
Minfo.NextMoveStep(MoveStep.SideMove_04);
Minfo.log($"{sideb}侧也在等待横移,本侧直接穿过");
}
else
{
Msg.add($"等待{sideb}侧空闲", MsgLevel.info);
}
break;
case MoveStep.SideMove_11:
Minfo.NextMoveStep(MoveStep.SideMove_05);
CylinderMove(Minfo, Ls_A_Location_Up, Ls_A_Location_Down, IO_VALUE.HIGH);
CylinderMove(Minfo, Ls_B_Location_Up, Ls_B_Location_Down, IO_VALUE.HIGH);
IOMove(Ls_B_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS);
break;
case MoveStep.SideMove_12:
Minfo.NextMoveStep(MoveStep.SideMove_06);
IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.HIGH); IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.HIGH);
Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_B_Tray_Check, IO_VALUE.HIGH));
break;
case MoveStep.SideMove_13:
Minfo.NextMoveStep(MoveStep.SideMove_07);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.SideMove_14:
Minfo.NextMoveStep(MoveStep.SideMove_08);
IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.LOW);
CylinderMove(Minfo, Ls_A_Location_Up, Ls_A_Location_Down, IO_VALUE.LOW);
CylinderMove(Minfo, Ls_B_Location_Up, Ls_B_Location_Down, IO_VALUE.LOW);
break;
case MoveStep.SideMove_15:
Minfo.NextMoveStep(MoveStep.SideMove_09);
IOMove(Ls_B_Stop, IO_VALUE.HIGH, StopDelayMS);
break;
case MoveStep.SideMove_16:
Minfo.NextMoveStep(MoveStep.SideMove_10);
Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_B_Tray_Check, IO_VALUE.LOW));
break;
case MoveStep.SideMove_17:
Minfo.NextMoveStep(MoveStep.SideMove_11);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.SideMove_18:
Minfo.NewMove(MoveStep.SideMove_01);
break; break;
} }
} }
#endregion
public void ResetProcess() public void ResetProcess()
{ {
throw new NotImplementedException(); if (CheckWait(LSAMoveInfo))
return;
switch (LSAMoveInfo.MoveStep)
{
case MoveStep.Wait:
break;
case MoveStep.H01_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.LOW);
CylinderMove(LSAMoveInfo, IO_Type.Ls_A_Location_Down, IO_Type.Ls_A_Location_Up, IO_VALUE.LOW);;
CylinderMove(LSAMoveInfo, IO_Type.Ls_B_Location_Down, IO_Type.Ls_B_Location_Up, IO_VALUE.LOW);
break;
case MoveStep.H02_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH);
IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH,500);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case MoveStep.H03_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
IOMove(IO_Type.Ls_B_BufStop_Fwd, IO_VALUE.HIGH, 500);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_A_Tray_Check, IO_VALUE.HIGH));
break;
case MoveStep.H04_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H05_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
CylinderMove(LSAMoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.HIGH);
CylinderMove(LSAMoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.HIGH);
break;
case MoveStep.H06_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H07_HomeReset);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_B_Tray_Check, IO_VALUE.HIGH));
break;
case MoveStep.H07_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.H08_HomeReset);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H08_HomeReset:
LSAMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset);
CylinderMove(LSAMoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW);
CylinderMove(LSAMoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW);
break;
case MoveStep.HEND_HomeReset:
LSAMoveInfo.NewMove(MoveStep.SideMove_01);
DeviceState = DeviceStateE.Run;
break;
}
}
public void Pause()
{
Line.Pause();
}
public void Resume()
{
Line.Resume();
} }
enum LS_TypeE { enum LS_TypeE {
......
...@@ -8,7 +8,7 @@ using System.Threading.Tasks; ...@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
public class TransplantMove : DeviceBase,IDevice public class TransplantMove : DeviceBase,IDevice,ISafetyDevice
{ {
static List<TransplantMove> SideMoves = new List<TransplantMove>(); static List<TransplantMove> SideMoves = new List<TransplantMove>();
...@@ -28,13 +28,17 @@ namespace DeviceLibrary ...@@ -28,13 +28,17 @@ namespace DeviceLibrary
PuYueRFID_C2S RFID_1 = null; PuYueRFID_C2S RFID_1 = null;
PuYueRFID_C2S RFID_2 = null; PuYueRFID_C2S RFID_2 = null;
AxisBean axis; AxisBean axis;
public DeviceStateE DeviceState { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public TransplantMove(DeviceGroup device,out string msg) { public TransplantMove(DeviceGroup device,out string msg) {
msg = ""; msg = "";
Name = device.Name+"("+ device.GroupName + ")"; Name = device.Name+"("+ device.GroupName + ")";
DeviceGroup = device; DeviceGroup = device;
Device = DeviceGroup.GroupName; GroupName = DeviceGroup.GroupName;
Msg = new MsgService(Device); Msg = new MsgService(GroupName);
MoveInfo = new MoveInfo(device.GroupName); MoveInfo = new MoveInfo(GroupName);
SafetyDevice.AddDevice(this);
if (!string.IsNullOrEmpty(DeviceGroup.RFID_1)) if (!string.IsNullOrEmpty(DeviceGroup.RFID_1))
{ {
RFID_1 = new PuYueRFID_C2S(DeviceGroup.RFID_1); RFID_1 = new PuYueRFID_C2S(DeviceGroup.RFID_1);
...@@ -50,8 +54,8 @@ namespace DeviceLibrary ...@@ -50,8 +54,8 @@ namespace DeviceLibrary
msg += DeviceGroup.DeviceType + " RFID 2:" + DeviceGroup.RFID_2 + "," + crc.GetString("Res0183","打开失败") + "\r\n"; msg += DeviceGroup.DeviceType + " RFID 2:" + DeviceGroup.RFID_2 + "," + crc.GetString("Res0183","打开失败") + "\r\n";
} }
} }
var axisc = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[device.GroupName].AxisID); var axisc = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[GroupName].AxisID);
axis = new AxisBean(axisc, device.GroupName); axis = new AxisBean(axisc, GroupName);
} }
public void Process() public void Process()
{ {
...@@ -73,8 +77,8 @@ namespace DeviceLibrary ...@@ -73,8 +77,8 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.SideMove_01); MoveInfo.NextMoveStep(MoveStep.SideMove_01);
CylinderMove(MoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW); CylinderMove(MoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW);
CylinderMove(MoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW); CylinderMove(MoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW);
IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, false, 1000); IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, 1000);
IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, false, 500); IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, 500);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_A_Tray_Check,IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_A_Tray_Check,IO_VALUE.HIGH));
} }
else { else {
...@@ -97,7 +101,22 @@ namespace DeviceLibrary ...@@ -97,7 +101,22 @@ namespace DeviceLibrary
} }
} }
public void ResetProcess() public void Start()
{
throw new NotImplementedException();
}
public void Stop()
{
throw new NotImplementedException();
}
public void Pause()
{
throw new NotImplementedException();
}
public void Resume()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
......
...@@ -28,12 +28,16 @@ namespace DeviceLibrary ...@@ -28,12 +28,16 @@ namespace DeviceLibrary
PuYueRFID_C2S RFID_1 = null; PuYueRFID_C2S RFID_1 = null;
PuYueRFID_C2S RFID_2 = null; PuYueRFID_C2S RFID_2 = null;
AxisBean axis; AxisBean axis;
AxisBean axis2;
public DeviceStateE DeviceState { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public TrayStop(DeviceGroup device,out string msg) { public TrayStop(DeviceGroup device,out string msg) {
msg = ""; msg = "";
Name = device.Name+"("+ device.GroupName + ")"; Name = device.Name+"("+ device.GroupName + ")";
DeviceGroup = device; DeviceGroup = device;
Device = DeviceGroup.GroupName; GroupName = DeviceGroup.GroupName;
Msg = new MsgService(Device); Msg = new MsgService(GroupName);
MoveInfo = new MoveInfo(device.GroupName); MoveInfo = new MoveInfo(device.GroupName);
if (!string.IsNullOrEmpty(DeviceGroup.RFID_1)) if (!string.IsNullOrEmpty(DeviceGroup.RFID_1))
{ {
...@@ -53,6 +57,9 @@ namespace DeviceLibrary ...@@ -53,6 +57,9 @@ namespace DeviceLibrary
var axisc = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[device.GroupName].AxisID); var axisc = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[device.GroupName].AxisID);
if (axisc!=null) if (axisc!=null)
axis = new AxisBean(axisc, device.GroupName); axis = new AxisBean(axisc, device.GroupName);
var axisc2 = RobotManage.Config.moveAxisList.Find(ma => ma.GetAxisValue() == RobotManage.DeviceGroup[device.GroupName].Axis2ID);
if (axisc2 != null)
axis2 = new AxisBean(axisc2, device.GroupName);
} }
public void Process() public void Process()
{ {
...@@ -74,8 +81,8 @@ namespace DeviceLibrary ...@@ -74,8 +81,8 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.SideMove_01); MoveInfo.NextMoveStep(MoveStep.SideMove_01);
CylinderMove(MoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW); CylinderMove(MoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW);
CylinderMove(MoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW); CylinderMove(MoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW);
IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, false, 1000); IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, 1000);
IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, false, 500); IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, 500);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_A_Tray_Check,IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_A_Tray_Check,IO_VALUE.HIGH));
} }
else { else {
...@@ -118,8 +125,8 @@ namespace DeviceLibrary ...@@ -118,8 +125,8 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.SideMove_01); MoveInfo.NextMoveStep(MoveStep.SideMove_01);
CylinderMove(MoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW); CylinderMove(MoveInfo, IO_Type.Ls_A_Location_Up, IO_Type.Ls_A_Location_Down, IO_VALUE.LOW);
CylinderMove(MoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW); CylinderMove(MoveInfo, IO_Type.Ls_B_Location_Up, IO_Type.Ls_B_Location_Down, IO_VALUE.LOW);
IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, false, 1000); IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, 1000);
IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, false, 500); IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, 500);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_A_Tray_Check, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Ls_A_Tray_Check, IO_VALUE.HIGH));
} }
else else
...@@ -142,6 +149,17 @@ namespace DeviceLibrary ...@@ -142,6 +149,17 @@ namespace DeviceLibrary
break; break;
} }
} }
public void Start()
{
throw new NotImplementedException();
}
public void Stop()
{
throw new NotImplementedException();
}
enum LS_TypeE { enum LS_TypeE {
NoRfid, NoRfid,
OneWay, OneWay,
......
...@@ -16,7 +16,7 @@ PRO,10,AMH移栽设备每毫米脉冲,AMH_TS_PoToMM,1000,,,,,,,,,,,, ...@@ -16,7 +16,7 @@ PRO,10,AMH移栽设备每毫米脉冲,AMH_TS_PoToMM,1000,,,,,,,,,,,,
PRO,10,AMH移栽设备待机点P1,AMH_TS_P1,1000,,,10000,,,,,,,,, PRO,10,AMH移栽设备待机点P1,AMH_TS_P1,1000,,,10000,,,,,,,,,
PRO,14,机器人压紧轴每毫米脉冲,AMH_RoboComp_PoToMM,1000,,,,,,,,,,,, PRO,14,机器人压紧轴每毫米脉冲,AMH_RoboComp_PoToMM,1000,,,,,,,,,,,,
PRO,14,机器人压紧轴待机点P1,AMH_RoboComp_P1,1000,,,10000,,,,,,,,, PRO,14,机器人压紧轴待机点P1,AMH_RoboComp_P1,1000,,,10000,,,,,,,,,
,,,,,,,,,,,,,,,, PRO,50,托盘旋转轴每度脉冲,AMH_Route_PoToMM,1000,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
DI,0,急停,SuddenStop_BTN,0,,X00,,,,,,,,,, DI,0,急停,SuddenStop_BTN,0,,X00,,,,,,,,,,
DI,0,复位,Reset_BTN,1,,X01,,,,,,,,,, DI,0,复位,Reset_BTN,1,,X01,,,,,,,,,,
......
设备组,名称,设备类型,RFID-1,RFID-2,伺服轴号,地址号-1,地址号-2,设备侧8mm放料点,料仓侧8mm放料点,位置,优先级,高度,宽度 设备组,名称,设备类型,RFID-1,RFID-2,伺服轴号,伺服轴号2,地址号-1,地址号-2,设备侧8mm放料点,料仓侧8mm放料点,位置,优先级,高度,宽度
LS1,横移,LS,,,,11,12,,,,,, LS1,横移,LS,,,,,11,12,,,,,,
LS2,横移,LS,192.168.103.115,,,9,15,,,,,, LS2,横移,LS,192.168.103.115,,,,9,15,,,,,,
LS3,横移,LS,192.168.103.110,192.168.103.106,,4,19,,,,,, LS3,横移,LS,192.168.103.110,192.168.103.106,,,4,19,,,,,,
LS4,横移,LS,,,,0,1,,,,,, LS4,横移,LS,,,,,0,1,,,,,,
,,,,,,,,,,,,, ,,,,,,,,,,,,,,
AMH-MI1,定位,RT,192.168.103.103,,4,16,,,345,,,, AMH-MI1,定位,RT,192.168.103.103,,4,4,16,,,345,,,,
AMH-MI2,定位,RT,192.168.103.107,,9,20,,,345,,,, AMH-MI2,定位,RT,192.168.103.107,,9,9,20,,,345,,,,
,,,,,,,,,,,,, ,,,,,,,,,,,,,,
AMH-ML5-1,定位,RT,192.168.103.108,,-1,2,,,,,,, AMH-ML5-1,定位,RT,192.168.103.108,,-1,,2,,,,,,,
AMH-ML5-2,定位,RT,192.168.103.109,,-1,3,,,,,,, AMH-ML5-2,定位,RT,192.168.103.109,,-1,,3,,,,,,,
,,,,,,,,,,,,, ,,,,,,,,,,,,,,
CI,定位,RT,192.168.103.111,,-1,5,,,,,,, CI,定位,RT,192.168.103.111,,-1,,5,,,,,,,
,,,,,,,,,,,,, ,,,,,,,,,,,,,,
AMH-SBSH2,移栽,SISO,192.168.103.116,,0,10,,123,234,,,, AMH-SBSH2,移栽,SISO,192.168.103.116,,0,,10,,123,234,,,,
AMH-SBDH2-1,移栽,SISO,192.168.103.101,,1,13,,123,234,,,, AMH-SBDH2-1,移栽,SISO,192.168.103.101,,1,,13,,123,234,,,,
AMH-SBDH2-2,移栽,SISO,192.168.103.102,,2,14,,123,234,,,, AMH-SBDH2-2,移栽,SISO,192.168.103.102,,2,,14,,123,234,,,,
AMH-SBSH1,移栽,SISO,192.168.103.114,,3,8,,123,234,,,, AMH-SBSH1,移栽,SISO,192.168.103.114,,3,,8,,123,234,,,,
AMH-SBDH3-1,移栽,SISO,192.168.103.112,,5,6,,123,234,,,, AMH-SBDH3-1,移栽,SISO,192.168.103.112,,5,,6,,123,234,,,,
AMH-SBDH3-2,移栽,SISO,192.168.103.113,,6,7,,123,234,,,, AMH-SBDH3-2,移栽,SISO,192.168.103.113,,6,,7,,123,234,,,,
AMH-SBDH1-1,移栽,SISO,192.168.103.104,,7,17,,123,234,,,, AMH-SBDH1-1,移栽,SISO,192.168.103.104,,7,,17,,123,234,,,,
AMH-SBDH1-2,移栽,SISO,192.168.103.105,,8,18,,123,234,,,, AMH-SBDH1-2,移栽,SISO,192.168.103.105,,8,,18,,123,234,,,,
...@@ -45,6 +45,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -45,6 +45,11 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[CSVAttribute("伺服轴号")] [CSVAttribute("伺服轴号")]
public int AxisID { get; set; } public int AxisID { get; set; }
/// <summary>
/// 伺服轴号
/// </summary>
[CSVAttribute("伺服轴号2")]
public int Axis2ID { get; set; }
/// <summary> /// <summary>
/// 地址号-1 /// 地址号-1
......
...@@ -43,8 +43,6 @@ namespace TheMachine ...@@ -43,8 +43,6 @@ namespace TheMachine
this.pnl = new System.Windows.Forms.Panel(); this.pnl = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.stateView = new System.Windows.Forms.ListView(); this.stateView = new System.Windows.Forms.ListView();
this.cb_IgnoreSafecheck = new System.Windows.Forms.CheckBox();
this.cb_IgnoreGratingSignal = new System.Windows.Forms.CheckBox();
this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox(); this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox();
this.btn_PauseBuzzer = new System.Windows.Forms.Button(); this.btn_PauseBuzzer = new System.Windows.Forms.Button();
this.listView1 = new System.Windows.Forms.ListView(); this.listView1 = new System.Windows.Forms.ListView();
...@@ -116,7 +114,7 @@ namespace TheMachine ...@@ -116,7 +114,7 @@ namespace TheMachine
// 简体中文ToolStripMenuItem // 简体中文ToolStripMenuItem
// //
this.简体中文ToolStripMenuItem.Name = "简体中文ToolStripMenuItem"; this.简体中文ToolStripMenuItem.Name = "简体中文ToolStripMenuItem";
this.简体中文ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.简体中文ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.简体中文ToolStripMenuItem.Tag = "not"; this.简体中文ToolStripMenuItem.Tag = "not";
this.简体中文ToolStripMenuItem.Text = "简体中文"; this.简体中文ToolStripMenuItem.Text = "简体中文";
this.简体中文ToolStripMenuItem.Click += new System.EventHandler(this.简体中文ToolStripMenuItem_Click); this.简体中文ToolStripMenuItem.Click += new System.EventHandler(this.简体中文ToolStripMenuItem_Click);
...@@ -124,7 +122,7 @@ namespace TheMachine ...@@ -124,7 +122,7 @@ namespace TheMachine
// englishToolStripMenuItem // englishToolStripMenuItem
// //
this.englishToolStripMenuItem.Name = "englishToolStripMenuItem"; this.englishToolStripMenuItem.Name = "englishToolStripMenuItem";
this.englishToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.englishToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.englishToolStripMenuItem.Tag = "not"; this.englishToolStripMenuItem.Tag = "not";
this.englishToolStripMenuItem.Text = "English"; this.englishToolStripMenuItem.Text = "English";
this.englishToolStripMenuItem.Click += new System.EventHandler(this.englishToolStripMenuItem_Click); this.englishToolStripMenuItem.Click += new System.EventHandler(this.englishToolStripMenuItem_Click);
...@@ -163,8 +161,6 @@ namespace TheMachine ...@@ -163,8 +161,6 @@ namespace TheMachine
// pnl // pnl
// //
this.pnl.Controls.Add(this.groupBox1); this.pnl.Controls.Add(this.groupBox1);
this.pnl.Controls.Add(this.cb_IgnoreSafecheck);
this.pnl.Controls.Add(this.cb_IgnoreGratingSignal);
this.pnl.Controls.Add(this.cb_EnableBuzzer); this.pnl.Controls.Add(this.cb_EnableBuzzer);
this.pnl.Controls.Add(this.btn_PauseBuzzer); this.pnl.Controls.Add(this.btn_PauseBuzzer);
this.pnl.Dock = System.Windows.Forms.DockStyle.Fill; this.pnl.Dock = System.Windows.Forms.DockStyle.Fill;
...@@ -196,28 +192,6 @@ namespace TheMachine ...@@ -196,28 +192,6 @@ namespace TheMachine
this.stateView.TabIndex = 0; this.stateView.TabIndex = 0;
this.stateView.UseCompatibleStateImageBehavior = false; this.stateView.UseCompatibleStateImageBehavior = false;
// //
// cb_IgnoreSafecheck
//
this.cb_IgnoreSafecheck.AutoSize = true;
this.cb_IgnoreSafecheck.Location = new System.Drawing.Point(607, 47);
this.cb_IgnoreSafecheck.Name = "cb_IgnoreSafecheck";
this.cb_IgnoreSafecheck.Size = new System.Drawing.Size(215, 25);
this.cb_IgnoreSafecheck.TabIndex = 2;
this.cb_IgnoreSafecheck.Text = "忽略安全检查(含安全光栅)";
this.cb_IgnoreSafecheck.UseVisualStyleBackColor = true;
this.cb_IgnoreSafecheck.CheckedChanged += new System.EventHandler(this.cb_IgnoreSafecheck_CheckedChanged);
//
// cb_IgnoreGratingSignal
//
this.cb_IgnoreGratingSignal.AutoSize = true;
this.cb_IgnoreGratingSignal.Location = new System.Drawing.Point(607, 78);
this.cb_IgnoreGratingSignal.Name = "cb_IgnoreGratingSignal";
this.cb_IgnoreGratingSignal.Size = new System.Drawing.Size(125, 25);
this.cb_IgnoreGratingSignal.TabIndex = 2;
this.cb_IgnoreGratingSignal.Text = "忽略安全光栅";
this.cb_IgnoreGratingSignal.UseVisualStyleBackColor = true;
this.cb_IgnoreGratingSignal.CheckedChanged += new System.EventHandler(this.cb_IgnoreGratingSignal_CheckedChanged);
//
// cb_EnableBuzzer // cb_EnableBuzzer
// //
this.cb_EnableBuzzer.AutoSize = true; this.cb_EnableBuzzer.AutoSize = true;
...@@ -323,8 +297,6 @@ namespace TheMachine ...@@ -323,8 +297,6 @@ namespace TheMachine
private System.Windows.Forms.TabPage tabP1; private System.Windows.Forms.TabPage tabP1;
private System.Windows.Forms.ListView stateView; private System.Windows.Forms.ListView stateView;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox cb_IgnoreSafecheck;
private System.Windows.Forms.CheckBox cb_IgnoreGratingSignal;
private System.Windows.Forms.ToolStripMenuItem 关于ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 关于ToolStripMenuItem;
private System.Windows.Forms.CheckBox cb_EnableBuzzer; private System.Windows.Forms.CheckBox cb_EnableBuzzer;
private System.Windows.Forms.Button btn_PauseBuzzer; private System.Windows.Forms.Button btn_PauseBuzzer;
......
...@@ -184,10 +184,6 @@ namespace TheMachine ...@@ -184,10 +184,6 @@ namespace TheMachine
stateView.Items.Clear(); stateView.Items.Clear();
foreach (MoveInfo moveInfo in moveInfoList) foreach (MoveInfo moveInfo in moveInfoList)
{ {
if (moveInfo.Equals(RobotManage.mainMachine.ResetMoveInfo) && RobotManage.mainMachine.runStatus != RunStatus.HomeReset)
{
continue;
}
ListViewItem lvi = new ListViewItem(new string[] { "", moveInfo.Name, moveInfo.MoveStep.ToString(),moveInfo.GetStateStr() }); ListViewItem lvi = new ListViewItem(new string[] { "", moveInfo.Name, moveInfo.MoveStep.ToString(),moveInfo.GetStateStr() });
stateView.Items.Add(lvi); stateView.Items.Add(lvi);
} }
...@@ -352,8 +348,14 @@ namespace TheMachine ...@@ -352,8 +348,14 @@ namespace TheMachine
{ {
if (RobotManage.mainMachine.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (RobotManage.mainMachine.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{ {
//Msg.add(crc.GetString(L.device_suddenstop_cant_start, "急停中,无法启动"), MsgLevel.warning); RobotManage.mainMachine.Msg.add("急停中,无法启动", MsgLevel.warning);
//MainMachine_ProcessMsgEvent(Msg.get()); MainMachine_ProcessMsgEvent(RobotManage.mainMachine.Msg.get().Values.First());
return;
}
if (RobotManage.mainMachine.IOValue(IO_Type.AutoRun_Single).Equals(IO_VALUE.LOW))
{
RobotManage.mainMachine.Msg.add("运行开关没有打开,无法启动", MsgLevel.warning);
MainMachine_ProcessMsgEvent(RobotManage.mainMachine.Msg.get().Values.First());
return; return;
} }
RobotManage.Start(); RobotManage.Start();
...@@ -393,14 +395,14 @@ namespace TheMachine ...@@ -393,14 +395,14 @@ namespace TheMachine
userpause = true; userpause = true;
(btn_run as Button).Text = crc.GetString("Res0203","恢复运行"); (btn_run as Button).Text = crc.GetString("Res0203","恢复运行");
(btn_run as Button).BackColor = Color.LightGreen; (btn_run as Button).BackColor = Color.LightGreen;
cb_IgnoreSafecheck.Enabled = true;
} }
else else
{ {
userpause = false; userpause = false;
(btn_run as Button).Text = crc.GetString("Res0204","暂停运行"); (btn_run as Button).Text = crc.GetString("Res0204","暂停运行");
(btn_run as Button).BackColor = Color.Yellow; (btn_run as Button).BackColor = Color.Yellow;
cb_IgnoreSafecheck.Enabled = false;
} }
} }
...@@ -420,7 +422,6 @@ namespace TheMachine ...@@ -420,7 +422,6 @@ namespace TheMachine
btn_stop.Enabled = false; btn_stop.Enabled = false;
btn_run.Text = crc.GetString("Res0205","启动"); btn_run.Text = crc.GetString("Res0205","启动");
btn_run.BackColor = Color.Transparent; btn_run.BackColor = Color.Transparent;
cb_IgnoreSafecheck.Enabled = true;
} }
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
...@@ -435,16 +436,6 @@ namespace TheMachine ...@@ -435,16 +436,6 @@ namespace TheMachine
} }
} }
private void cb_IgnoreSafecheck_CheckedChanged(object sender, EventArgs e)
{
RobotManage.IgnoreSafecheck((sender as CheckBox).Checked);
}
private void cb_IgnoreGratingSignal_CheckedChanged(object sender, EventArgs e)
{
RobotManage.IgnoreGratingSignal((sender as CheckBox).Checked);
}
private void 关于ToolStripMenuItem_Click(object sender, EventArgs e) private void 关于ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
AboutBox1 aboutBox1 = new AboutBox1(); AboutBox1 aboutBox1 = new AboutBox1();
......
...@@ -33,7 +33,7 @@ namespace TheMachine ...@@ -33,7 +33,7 @@ namespace TheMachine
{ {
if (!state) if (!state)
return; return;
uC_LedConfig1.Config = RobotManage.Config;
} }
private void SettingControl_Load(object sender, EventArgs e) private void SettingControl_Load(object sender, EventArgs e)
...@@ -69,11 +69,6 @@ namespace TheMachine ...@@ -69,11 +69,6 @@ namespace TheMachine
private void cb_tempsensorport_SelectedIndexChanged(object sender, EventArgs e)
{
HumitureController.Init(Setting_Init.Device_Humiture_Port);
}
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
if (!Visible) if (!Visible)
...@@ -81,9 +76,5 @@ namespace TheMachine ...@@ -81,9 +76,5 @@ namespace TheMachine
} }
private void button1_Click_1(object sender, EventArgs e)
{
}
} }
} }
...@@ -26,20 +26,20 @@ namespace TheMachine ...@@ -26,20 +26,20 @@ namespace TheMachine
crc.LanguageChangeEvent += (s,o)=> crc.LanguageProcess(this); crc.LanguageChangeEvent += (s,o)=> crc.LanguageProcess(this);
crc.CurrLanguage = Setting_Init.Device_Default_Language; crc.CurrLanguage = Setting_Init.Device_Default_Language;
} }
public void Init(string devicetype) public void Init(string _deviceGroup)
{ {
this.devicetype = devicetype; this.deviceGroup = _deviceGroup;
foreach (var c in this.Controls) { foreach (var c in this.Controls) {
if (!(c is CylinderButton)) if (!(c is CylinderButton))
continue; continue;
var cc = (c as CylinderButton); var cc = (c as CylinderButton);
cc.DeviceType = devicetype; cc.DeviceType = deviceGroup;
if (!RobotManage.Config.DOList[devicetype].ContainsKey(cc.IO_HIGH)) if (!RobotManage.Config.DOList[deviceGroup].ContainsKey(cc.IO_HIGH))
cc.Visible = false; cc.Visible = false;
} }
ioControl1.Init(RobotManage.Config, devicetype); ioControl1.Init(RobotManage.Config, deviceGroup);
if (!RobotManage.Config.DOList[devicetype].ContainsKey(IO_Type.Ls_A_LineRun)) { if (!RobotManage.Config.DOList[deviceGroup].ContainsKey(IO_Type.Ls_A_LineRun)) {
btn_linerun.Visible = false; btn_linerun.Visible = false;
btn_linerev.Visible = false; btn_linerev.Visible = false;
...@@ -47,23 +47,20 @@ namespace TheMachine ...@@ -47,23 +47,20 @@ namespace TheMachine
} }
crc.LanguageProcess(this); crc.LanguageProcess(this);
} }
string devicetype = "root"; string deviceGroup;
private void btn_linerun_Click(object sender, EventArgs e) private void btn_linerun_Click(object sender, EventArgs e)
{ {
IOManager.IOMove(IO_Type.Ls_A_LineRwd, IO_VALUE.LOW, devicetype); SideMove.SideMoves[deviceGroup].Line.LineRun("n", false, 999);
IOManager.IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.HIGH, devicetype);
} }
private void btn_linerev_Click(object sender, EventArgs e) private void btn_linerev_Click(object sender, EventArgs e)
{ {
IOManager.IOMove(IO_Type.Ls_A_LineRwd, IO_VALUE.HIGH, devicetype); SideMove.SideMoves[deviceGroup].Line.LineRun("n", true, 999);
IOManager.IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.HIGH, devicetype);
} }
private void btn_linestop_Click(object sender, EventArgs e) private void btn_linestop_Click(object sender, EventArgs e)
{ {
IOManager.IOMove(IO_Type.Ls_A_LineRwd, IO_VALUE.LOW, devicetype); SideMove.SideMoves[deviceGroup].Line.LineStop("n");
IOManager.IOMove(IO_Type.Ls_A_LineRun, IO_VALUE.LOW, devicetype);
} }
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!