Commit ba57b470 刘韬

1

1 个父辈 8d4a1ed4
正在显示 47 个修改的文件 包含 1727 行增加265 行删除
...@@ -271,10 +271,10 @@ namespace OnlineStore ...@@ -271,10 +271,10 @@ namespace OnlineStore
if (string.IsNullOrEmpty(className)) if (string.IsNullOrEmpty(className))
className = cc.GetType().Name; className = cc.GetType().Name;
if (CurrLanguage.Equals(CodeResourceControl.GetLanguage())) //if (CurrLanguage.Equals(CodeResourceControl.GetLanguage()))
{ //{
//return; // //return;
} //}
//string className = cc.ClassName; //string className = cc.ClassName;
CurrLanguage = CodeResourceControl.GetLanguage(); CurrLanguage = CodeResourceControl.GetLanguage();
//string name = CodeResourceControl.GetString(CodeResourceControl.GetTextIdStr(className), cc.Text); //string name = CodeResourceControl.GetString(CodeResourceControl.GetTextIdStr(className), cc.Text);
......
...@@ -34,6 +34,23 @@ namespace OnlineStore.Common ...@@ -34,6 +34,23 @@ namespace OnlineStore.Common
[MyConfigComment("屏蔽日志窗口")] [MyConfigComment("屏蔽日志窗口")]
public static MyConfig<bool> Device_DisableLogWindow = true; public static MyConfig<bool> Device_DisableLogWindow = true;
[MyConfigComment("URRobot_MI1_IP")]
public static MyConfig<string> URRobot_MI1_IP;
[MyConfigComment("URRobot_MI1_速度倍率")]
public static MyConfig<int> URRobot_MI1_Speed_Rate = 50;
[MyConfigComment("URRobot_MI2_IP")]
public static MyConfig<string> URRobot_MI2_IP;
[MyConfigComment("URRobot_MI2_速度倍率")]
public static MyConfig<int> URRobot_MI2_Speed_Rate = 50;
[MyConfigComment("URRobot_CI_IP")]
public static MyConfig<string> URRobot_CI_IP;
[MyConfigComment("URRobot_CI_速度倍率")]
public static MyConfig<int> URRobot_CI_Speed_Rate = 50;
/// <summary> /// <summary>
/// 摄像机名称 /// 摄像机名称
......
...@@ -65,6 +65,9 @@ ...@@ -65,6 +65,9 @@
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="Robot.UR">
<HintPath>..\..\..\DllLibrary\第三方\URRobot\Robot.UR\Robot.UR\bin\Debug\Robot.UR.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
...@@ -115,6 +118,7 @@ ...@@ -115,6 +118,7 @@
<Compile Include="DeviceLibrary\IOManager.cs" /> <Compile Include="DeviceLibrary\IOManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="theMachine\sub\IDevice.cs" /> <Compile Include="theMachine\sub\IDevice.cs" />
<Compile Include="theMachine\sub\MI.cs" />
<Compile Include="theMachine\sub\TrayStop.cs" /> <Compile Include="theMachine\sub\TrayStop.cs" />
<Compile Include="theMachine\sub\TransplantMove.cs" /> <Compile Include="theMachine\sub\TransplantMove.cs" />
<Compile Include="theMachine\sub\SideMove.cs" /> <Compile Include="theMachine\sub\SideMove.cs" />
......
...@@ -24,8 +24,10 @@ namespace DeviceLibrary ...@@ -24,8 +24,10 @@ namespace DeviceLibrary
public event Func<int,int,(bool,string)> interference; public event Func<int,int,(bool,string)> interference;
public string AxisName; public string AxisName;
public bool ForceSafeCheck = false; public bool ForceSafeCheck = false;
public string DeviceGroupName;
public AxisBean(ConfigMoveAxis axisConfig, string deviceGroupName) public AxisBean(ConfigMoveAxis axisConfig, string deviceGroupName)
{ {
DeviceGroupName = deviceGroupName;
this.Config = axisConfig; this.Config = axisConfig;
AxisName = deviceGroupName + " " + Config.Explain + "[" + Config.DeviceName + "-" + Config.GetAxisValue() + "]"; AxisName = deviceGroupName + " " + Config.Explain + "[" + Config.DeviceName + "-" + Config.GetAxisValue() + "]";
if (!List.ContainsKey(deviceGroupName)) if (!List.ContainsKey(deviceGroupName))
...@@ -365,7 +367,7 @@ namespace DeviceLibrary ...@@ -365,7 +367,7 @@ namespace DeviceLibrary
try try
{ {
IsInProcess = true; IsInProcess = true;
if (IOManager.IOValue(TargetIoType).Equals(TargetIoValue)) if (IOManager.IOValue(TargetIoType, DeviceGroupName).Equals(TargetIoValue))
{ {
SuddenStop(); SuddenStop();
StopAxisCheckMove(); StopAxisCheckMove();
......
...@@ -269,5 +269,27 @@ namespace DeviceLibrary ...@@ -269,5 +269,27 @@ namespace DeviceLibrary
} }
} }
public void IOMove(string IoType, IO_VALUE value, string whenIoType, IO_VALUE whenvalue, int msTime = 0)
{
IOMove(IoType, value, msTime);
return;
Task.Run(() =>
{
IOManager.IOMove(IoType, value, GroupName);
//Thread.Sleep(msTime);
IO_VALUE tValue = value.Equals(IO_VALUE.HIGH) ? IO_VALUE.LOW : IO_VALUE.HIGH;
for (int i = 0; i < 30; i++)
{
Task.Delay(100).Wait();
if (IOManager.IOValue(whenIoType, GroupName).Equals(whenvalue))
{
break;
}
}
//Task.Delay(msTime).Wait();
IOManager.IOMove(IoType, tValue, GroupName);
});
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -21,6 +21,7 @@ namespace DeviceLibrary ...@@ -21,6 +21,7 @@ namespace DeviceLibrary
DevicesList = device; DevicesList = device;
DeviceListName = name; DeviceListName = name;
manualResets.Add(resetEvent); manualResets.Add(resetEvent);
LogUtil.info($"{DeviceListName}导入设备{DevicesList.Count}个");
} }
Thread thread; Thread thread;
public void Start() { public void Start() {
......
...@@ -46,8 +46,7 @@ namespace DeviceLibrary ...@@ -46,8 +46,7 @@ namespace DeviceLibrary
public int Count { public int Count {
get => jobInfos.Count; get => jobInfos.Count;
} }
public void ClearLastPosid(string posid) { public void ClearLastPosid() {
if (lastoutpos == posid)
lastoutpos = ""; lastoutpos = "";
} }
} }
......
...@@ -56,6 +56,9 @@ namespace DeviceLibrary ...@@ -56,6 +56,9 @@ namespace DeviceLibrary
TrayStop.Init(Config, DeviceGroup, out m); TrayStop.Init(Config, DeviceGroup, out m);
msg += m; msg += m;
TrayManager.Init(DeviceGroup); TrayManager.Init(DeviceGroup);
MI.Init(Config, DeviceGroup, out m);
msg += m;
#region 初始化led #region 初始化led
RunningLed = new Led(Config.DOList["root"][IO_Type.Run_Led].GetIOAddr(), LedColor.green); RunningLed = new Led(Config.DOList["root"][IO_Type.Run_Led].GetIOAddr(), LedColor.green);
StandbyLed = new Led(Config.DOList["root"][IO_Type.Standby_Led].GetIOAddr(), LedColor.yellow); StandbyLed = new Led(Config.DOList["root"][IO_Type.Standby_Led].GetIOAddr(), LedColor.yellow);
...@@ -168,6 +171,7 @@ namespace DeviceLibrary ...@@ -168,6 +171,7 @@ namespace DeviceLibrary
SideMove.DeviceList.Values.ToList().ForEach(s => s.Start()); SideMove.DeviceList.Values.ToList().ForEach(s => s.Start());
TransplantMove.DeviceList.Values.ToList().ForEach(s => s.Start()); TransplantMove.DeviceList.Values.ToList().ForEach(s => s.Start());
TrayStop.DeviceList.Values.ToList().ForEach(s => s.Start()); TrayStop.DeviceList.Values.ToList().ForEach(s => s.Start());
MI.DeviceList.Values.ToList().ForEach(s => s.Start());
} }
...@@ -178,6 +182,11 @@ namespace DeviceLibrary ...@@ -178,6 +182,11 @@ namespace DeviceLibrary
if (!lastSafeCheckStatus && ok) if (!lastSafeCheckStatus && ok)
{ {
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH); IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
MoveInfo.List.ForEach(mi => {
mi.LastSetpTime = DateTime.Now;
mi.IsInWait = true;
mi.WaitList.Add(WaitResultInfo.WaitTime(8000));
});
SafetyDevice.ResumeAll(); SafetyDevice.ResumeAll();
} }
lastSafeCheckStatus = ok; lastSafeCheckStatus = ok;
...@@ -194,8 +203,11 @@ namespace DeviceLibrary ...@@ -194,8 +203,11 @@ namespace DeviceLibrary
LogUtil.info("其他线程已完成"); LogUtil.info("其他线程已完成");
AxisBean.StopMultiAxis(AxisBean.List[GroupName]); AxisBean.StopMultiAxis(AxisBean.List[GroupName]);
MoveInfo.List.ForEach((m) => { m.CanWhileCount = 5; }); MoveInfo.List.ForEach((m) => { m.CanWhileCount = 5; });
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
SafetyDevice.PauseAll(); SafetyDevice.PauseAll();
Task.Run(() => {
Task.Delay(4000).Wait();
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
});
} }
} }
......
...@@ -48,6 +48,11 @@ namespace DeviceLibrary ...@@ -48,6 +48,11 @@ namespace DeviceLibrary
SideMove_16, SideMove_16,
SideMove_17, SideMove_17,
SideMove_18, SideMove_18,
SideMove_50,
SideMove_51,
SideMove_52,
SideMove_53,
SideMove_54,
TrayStop_01, TrayStop_01,
TrayStop_02, TrayStop_02,
...@@ -56,6 +61,8 @@ namespace DeviceLibrary ...@@ -56,6 +61,8 @@ namespace DeviceLibrary
TrayStop_05, TrayStop_05,
TrayStop_06, TrayStop_06,
TrayStop_07, TrayStop_07,
TrayStop_08,
TrayStop_09,
TrayStop_WaitLoadProcess, TrayStop_WaitLoadProcess,
TrayStop_LoadProcessed, TrayStop_LoadProcessed,
...@@ -97,6 +104,41 @@ namespace DeviceLibrary ...@@ -97,6 +104,41 @@ namespace DeviceLibrary
TransplantMove_37, TransplantMove_37,
TransplantMove_38, TransplantMove_38,
TransplantMove_39, TransplantMove_39,
MI_01,
MI_02,
MI_03,
MI_04,
MI_05,
MI_06,
MI_07,
MI_08,
MI_09,
MI_10,
MI_11,
MI_12,
MI_13,
MI_14,
MI_15,
MI_16,
MI_17,
MI_20,
MI_21,
MI_22,
MI_23,
MI_24,
MI_25,
MI_26,
MI_27,
MI_28,
MI_29,
MI_40,
MI_41,
MI_42,
MI_43,
MI_44,
MI_45,
} }
......
using OnlineStore; using OnlineStore;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using Robot.UR;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
...@@ -30,6 +31,14 @@ namespace DeviceLibrary ...@@ -30,6 +31,14 @@ namespace DeviceLibrary
static Thread mainThread; static Thread mainThread;
internal static bool InoutDebugMode; internal static bool InoutDebugMode;
public static Dictionary<string, RobotPosition> MI1Postion;
public static Dictionary<string, RobotPosition> MI2Postion;
public static Dictionary<string, RobotPosition> CIPostion;
public static URRobotControl Robot_MI1;
public static URRobotControl Robot_MI2;
public static URRobotControl Robot_CI;
public static void Init() { public static void Init() {
string msg = ""; string msg = "";
try try
...@@ -48,6 +57,46 @@ namespace DeviceLibrary ...@@ -48,6 +57,46 @@ namespace DeviceLibrary
IsLoadOk = false; IsLoadOk = false;
msg += crc.GetString("Res0180","找不到库位配置文件")+ "\n"; msg += crc.GetString("Res0180","找不到库位配置文件")+ "\n";
} }
string MI1PostionFile = "config\\MI1Postion.csv";
string MI2PostionFile = "config\\MI2Postion.csv";
string CIPostionFile = "config\\CIPostion.csv";
MI1Postion = CSVPositionReader<RobotPosition>.LoadCSVFile(MI1PostionFile);
MI2Postion = CSVPositionReader<RobotPosition>.LoadCSVFile(MI2PostionFile);
CIPostion = CSVPositionReader<RobotPosition>.LoadCSVFile(CIPostionFile);
Robot_MI1 = new URRobotControl(Setting_Init.URRobot_MI1_IP);
Robot_MI1.SetSpeedRate(Setting_Init.URRobot_MI1_Speed_Rate);
Robot_MI2 = new URRobotControl(Setting_Init.URRobot_MI2_IP);
Robot_MI2.SetSpeedRate(Setting_Init.URRobot_MI2_Speed_Rate);
Robot_CI = new URRobotControl(Setting_Init.URRobot_CI_IP);
Robot_CI.SetSpeedRate(Setting_Init.URRobot_CI_Speed_Rate);
if (Robot_MI1.StartRobot()) {
LogUtil.info("MI1 UR机器人启动成功,"+ Robot_MI1.GetStatus());
} else {
IsLoadOk = false;
msg += "MI1 UR机器人启动失败" + "\n";
}
if (Robot_MI2.StartRobot())
{
LogUtil.info("MI2 UR机器人启动成功," + Robot_MI2.GetStatus());
}
else
{
IsLoadOk = false;
msg += "MI2 UR机器人启动失败" + "\n";
}
if (Robot_CI.StartRobot())
{
LogUtil.info("CI UR机器人启动成功," + Robot_CI.GetStatus());
}
else
{
IsLoadOk = false;
msg += "CI UR机器人启动失败" + "\n";
}
CodeManager.LoadConfig();
RemoteService.Init(); RemoteService.Init();
mainMachine = new MainMachine(out string m); mainMachine = new MainMachine(out string m);
if (!string.IsNullOrWhiteSpace(m)) { if (!string.IsNullOrWhiteSpace(m)) {
...@@ -90,6 +139,7 @@ namespace DeviceLibrary ...@@ -90,6 +139,7 @@ namespace DeviceLibrary
var d1 = new DeviceRunControl("SideMove", SideMove.DeviceList.Values.ToList<IDevice>()); var d1 = new DeviceRunControl("SideMove", SideMove.DeviceList.Values.ToList<IDevice>());
var d2 = new DeviceRunControl("TransplantMove", TransplantMove.DeviceList.Values.ToList<IDevice>()); var d2 = new DeviceRunControl("TransplantMove", TransplantMove.DeviceList.Values.ToList<IDevice>());
var d3 = new DeviceRunControl("TrayStop", TrayStop.DeviceList.Values.ToList<IDevice>()); var d3 = new DeviceRunControl("TrayStop", TrayStop.DeviceList.Values.ToList<IDevice>());
var d4 = new DeviceRunControl("MI", MI.DeviceList.Values.ToList<IDevice>());
isRunning = true; isRunning = true;
GC.KeepAlive(mainThread); GC.KeepAlive(mainThread);
...@@ -110,6 +160,7 @@ namespace DeviceLibrary ...@@ -110,6 +160,7 @@ namespace DeviceLibrary
d1.Start(); d1.Start();
d2.Start(); d2.Start();
d3.Start(); d3.Start();
d4.Start();
} }
...@@ -127,6 +178,9 @@ namespace DeviceLibrary ...@@ -127,6 +178,9 @@ namespace DeviceLibrary
{ {
LogUtil.info("开始关闭系统."); LogUtil.info("开始关闭系统.");
IOManager.CloseAllConnection(); IOManager.CloseAllConnection();
Robot_MI1.StopRobot();
Robot_MI2.StopRobot();
Robot_CI.StopRobot();
} }
public static void UserPause(bool userpause) public static void UserPause(bool userpause)
{ {
......
...@@ -68,14 +68,10 @@ namespace DeviceLibrary ...@@ -68,14 +68,10 @@ namespace DeviceLibrary
try try
{ {
var TL = Traylist.Where(t => t.Value.DestinationAddr >= 0).ToDictionary(a => a.Key, a => a.Value); var TL = Traylist.Where(t => t.Value.DestinationAddr >= 0).ToDictionary(a => a.Key, a => a.Value);
if (TL.Count > 0)
{
File.Delete("Config\\TrayList.temp"); File.Delete("Config\\TrayList.temp");
File.WriteAllText("Config\\TrayList.temp~", JsonConvert.SerializeObject(TL)); File.WriteAllText("Config\\TrayList.temp~", JsonConvert.SerializeObject(TL));
File.Move("Config\\TrayList.temp~", "Config\\TrayList.temp"); File.Move("Config\\TrayList.temp~", "Config\\TrayList.temp");
} }
}
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("托盘信息保存失败:" + ex); LogUtil.error("托盘信息保存失败:" + ex);
...@@ -85,7 +81,7 @@ namespace DeviceLibrary ...@@ -85,7 +81,7 @@ namespace DeviceLibrary
/// deviceGroupName,RequestLoadInfo /// deviceGroupName,RequestLoadInfo
/// </summary> /// </summary>
public static Dictionary<string, RequestLoadInfo> TrayRequest = new Dictionary<string, RequestLoadInfo>(); public static Dictionary<string, RequestLoadInfo> TrayRequest = new Dictionary<string, RequestLoadInfo>();
public static bool HasTrayRequest(string deviceGroupName,string rfid,out ReelParam reelParam) public static bool TryGetTrayRequest(string deviceGroupName,string rfid,out ReelParam reelParam)
{ {
reelParam = null; reelParam = null;
LogUtil.info($"[{deviceGroupName}] HasTrayRequest:{deviceGroupName},{rfid},{TrayRequest.ContainsKey(deviceGroupName)}"); LogUtil.info($"[{deviceGroupName}] HasTrayRequest:{deviceGroupName},{rfid},{TrayRequest.ContainsKey(deviceGroupName)}");
...@@ -105,6 +101,10 @@ namespace DeviceLibrary ...@@ -105,6 +101,10 @@ namespace DeviceLibrary
return false; return false;
} }
} }
public static bool TestTrayRequest(string deviceGroupName)
{
return TrayRequest.ContainsKey(deviceGroupName);
}
public static void ClearTrayRequest(string deviceGroupName) public static void ClearTrayRequest(string deviceGroupName)
{ {
lock (TrayRequest) lock (TrayRequest)
......
...@@ -103,7 +103,7 @@ namespace DeviceLibrary ...@@ -103,7 +103,7 @@ namespace DeviceLibrary
} }
} }
int StopBufDelayMS = 500; int StopBufDelayMS = 500;
int StopDelayMS = 1000; int StopDelayMS = 1500;
bool LastGoInFail = false; bool LastGoInFail = false;
DateTime LastGoInFailTime = DateTime.Now; DateTime LastGoInFailTime = DateTime.Now;
#region Rfid横移 #region Rfid横移
...@@ -137,19 +137,17 @@ namespace DeviceLibrary ...@@ -137,19 +137,17 @@ namespace DeviceLibrary
} }
else else
{ {
Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info); //Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info);
} }
break; break;
case MoveStep.SideMove_02: case MoveStep.SideMove_02:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_03); LSAMoveInfo.NextMoveStep(MoveStep.SideMove_03);
IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.Ls_A_Front_Stop, IO_VALUE.HIGH, IO_Type.Ls_A_Front_Check, IO_VALUE.LOW, StopDelayMS);
//IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS); //IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS);
break; break;
case MoveStep.SideMove_03: case MoveStep.SideMove_03:
if (IOValue(IO_Type.Ls_A_Tray_Check).Equals(IO_VALUE.HIGH)) { if (IOValue(IO_Type.Ls_A_Tray_Check).Equals(IO_VALUE.HIGH)) {
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_04); LSAMoveInfo.NextMoveStep(MoveStep.SideMove_04);
IOMove(IO_Type.Ls_B_BufStop_Fwd, IO_VALUE.HIGH, 500);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
LastGoInFail = false; LastGoInFail = false;
} }
else if (LSAMoveInfo.IsTimeOut(10)) else if (LSAMoveInfo.IsTimeOut(10))
...@@ -167,6 +165,8 @@ namespace DeviceLibrary ...@@ -167,6 +165,8 @@ namespace DeviceLibrary
if (LSBMoveInfo.MoveStep==MoveStep.Wait) if (LSBMoveInfo.MoveStep==MoveStep.Wait)
{ {
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_06); LSAMoveInfo.NextMoveStep(MoveStep.SideMove_06);
IOMove(IO_Type.Ls_B_BufStop_Fwd, IO_VALUE.HIGH, 500);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
Location_A.ToHigh(LSAMoveInfo); Location_A.ToHigh(LSAMoveInfo);
Location_B.ToHigh(LSAMoveInfo); Location_B.ToHigh(LSAMoveInfo);
} }
...@@ -268,7 +268,7 @@ namespace DeviceLibrary ...@@ -268,7 +268,7 @@ namespace DeviceLibrary
} }
if (lsb.MoveStep >= MoveStep.SideMove_10) { if (lsb.MoveStep >= MoveStep.SideMove_10 && lsb.MoveStep < MoveStep.SideMove_50) {
Msg.add(sideb+crc.GetString("Res0015","侧穿越中"), MsgLevel.info); Msg.add(sideb+crc.GetString("Res0015","侧穿越中"), MsgLevel.info);
}else if (IOValue(Ls_A_Tray_Check).Equals(IO_VALUE.HIGH)) }else if (IOValue(Ls_A_Tray_Check).Equals(IO_VALUE.HIGH))
{ {
...@@ -284,14 +284,13 @@ namespace DeviceLibrary ...@@ -284,14 +284,13 @@ namespace DeviceLibrary
} }
else else
{ {
Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info); //Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info);
} }
break; break;
case MoveStep.SideMove_02: case MoveStep.SideMove_02:
Minfo.NextMoveStep(MoveStep.SideMove_03); Minfo.NextMoveStep(MoveStep.SideMove_03);
Minfo.log($"{Ls_A_Front_Stop}下降,{Ls_A_BufStop_Rwd}回退"); Minfo.log($"{Ls_A_Front_Stop}下降,{Ls_A_BufStop_Rwd}回退");
IOMove(Ls_A_Front_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(Ls_A_Front_Stop, IO_VALUE.HIGH, Ls_A_Front_Check, IO_VALUE.LOW, StopDelayMS);
IOMove(Ls_A_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS); IOMove(Ls_A_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS);
break; break;
case MoveStep.SideMove_03: case MoveStep.SideMove_03:
...@@ -354,7 +353,7 @@ namespace DeviceLibrary ...@@ -354,7 +353,7 @@ namespace DeviceLibrary
///直接穿过流程 ///直接穿过流程
case MoveStep.SideMove_06: case MoveStep.SideMove_06:
Minfo.NextMoveStep(MoveStep.SideMove_07); Minfo.NextMoveStep(MoveStep.SideMove_07);
IOMove(Ls_A_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(Ls_A_Stop, IO_VALUE.HIGH, Ls_A_Tray_Check, IO_VALUE.LOW, StopDelayMS);
IOMove(Ls_A_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS); IOMove(Ls_A_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS);
Minfo.log($"{Ls_A_Stop}阻挡放行"); Minfo.log($"{Ls_A_Stop}阻挡放行");
break; break;
...@@ -369,7 +368,7 @@ namespace DeviceLibrary ...@@ -369,7 +368,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.SideMove_08: case MoveStep.SideMove_08:
Minfo.NextMoveStep(MoveStep.SideMove_01); Minfo.NextMoveStep(MoveStep.SideMove_01);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); //Minfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
Minfo.log($"放行结束"); Minfo.log($"放行结束");
break; break;
///横移流程 ///横移流程
...@@ -397,38 +396,41 @@ namespace DeviceLibrary ...@@ -397,38 +396,41 @@ namespace DeviceLibrary
Location_a.ToHigh(Minfo); Location_a.ToHigh(Minfo);
Location_b.ToHigh(Minfo); Location_b.ToHigh(Minfo);
IOMove(Ls_B_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS); IOMove(Ls_B_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS);
Minfo.log($"2侧顶升升起"); //Minfo.log($"2侧顶升升起");
break; break;
case MoveStep.SideMove_12: case MoveStep.SideMove_12:
Minfo.NextMoveStep(MoveStep.SideMove_13); Minfo.NextMoveStep(MoveStep.SideMove_13);
Line.LineRun("n", Minfo==LSAMoveInfo? false:true, 999); Line.LineRun("n", Minfo==LSAMoveInfo? false:true, 999);
Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_B_Tray_Check, IO_VALUE.HIGH)); Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_B_Tray_Check, IO_VALUE.HIGH));
Minfo.log($"横移线体运行"); //Minfo.log($"横移线体运行");
break; break;
case MoveStep.SideMove_13: case MoveStep.SideMove_13:
Minfo.NextMoveStep(MoveStep.SideMove_13_2); Minfo.NextMoveStep(MoveStep.SideMove_01);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(3500)); Location_a.ToLow(Minfo);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(500));
lsb.NextMoveStep(MoveStep.SideMove_50);
Minfo.log($"横移本侧结束");
break; break;
case MoveStep.SideMove_13_2: ///本侧接管横移后通过
Minfo.NextMoveStep(MoveStep.SideMove_14); case MoveStep.SideMove_50:
IOMove(Ls_B_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS); Minfo.NextMoveStep(MoveStep.SideMove_51);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(3500)); IOMove(Ls_A_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS);
Minfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break; break;
case MoveStep.SideMove_14: case MoveStep.SideMove_51:
Minfo.NextMoveStep(MoveStep.SideMove_15); Minfo.NextMoveStep(MoveStep.SideMove_52);
Line.LineStop("n"); Line.LineStop("n");
Location_a.ToLow(Minfo); Location_a.ToLow(Minfo);
Location_b.ToLow(Minfo);
Minfo.log($"顶升下降横移线体停止"); Minfo.log($"顶升下降横移线体停止");
break; break;
case MoveStep.SideMove_15: case MoveStep.SideMove_52:
Minfo.NextMoveStep(MoveStep.SideMove_16); Minfo.NextMoveStep(MoveStep.SideMove_53);
if (LS_Type!= LS_TypeE.NoRfid) if (LS_Type!= LS_TypeE.NoRfid)
IOMove(Ls_B_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(Ls_A_Stop, IO_VALUE.HIGH, Ls_A_Tray_Check, IO_VALUE.LOW, StopDelayMS);
break; break;
case MoveStep.SideMove_16: case MoveStep.SideMove_53:
Minfo.NextMoveStep(MoveStep.SideMove_17); Minfo.NextMoveStep(MoveStep.SideMove_17);
Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_B_Tray_Check, IO_VALUE.LOW)); Minfo.WaitList.Add(WaitResultInfo.WaitIO(Ls_A_Tray_Check, IO_VALUE.LOW));
break; break;
case MoveStep.SideMove_17: case MoveStep.SideMove_17:
Minfo.NextMoveStep(MoveStep.SideMove_18); Minfo.NextMoveStep(MoveStep.SideMove_18);
......
...@@ -77,7 +77,7 @@ namespace DeviceLibrary ...@@ -77,7 +77,7 @@ namespace DeviceLibrary
} }
} }
int StopBufDelayMS = 500; int StopBufDelayMS = 500;
int StopDelayMS = 1000; int StopDelayMS = 1500;
int MetrialGetRetry = 0; int MetrialGetRetry = 0;
public void OneWayProcess() public void OneWayProcess()
{ {
...@@ -93,20 +93,23 @@ namespace DeviceLibrary ...@@ -93,20 +93,23 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.TransplantMove_04); MoveInfo.NextMoveStep(MoveStep.TransplantMove_04);
Location.ToLow(MoveInfo); Location.ToLow(MoveInfo);
} }
else else if (IOValue(IO_Type.AMH_Front_Check).Equals(IO_VALUE.HIGH))
if (IOValue(IO_Type.AMH_Front_Check).Equals(IO_VALUE.HIGH))
{ {
MoveInfo.NextMoveStep(MoveStep.TransplantMove_01); MoveInfo.NextMoveStep(MoveStep.TransplantMove_01);
Location.ToLow(MoveInfo); Location.ToLow(MoveInfo);
} }
else else
{ {
Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info); //Msg.add(crc.GetString("Res0184", "空闲中"), MsgLevel.info);
}
if (TrayManager.TestTrayRequest(GroupName)) {
Transplant.ToHigh(null);
} }
break; break;
case MoveStep.TransplantMove_01: case MoveStep.TransplantMove_01:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_02); MoveInfo.NextMoveStep(MoveStep.TransplantMove_02);
IOMove(IO_Type.AMH_Front_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.AMH_Front_Stop, IO_VALUE.HIGH, IO_Type.AMH_Front_Check,IO_VALUE.LOW, StopDelayMS);
MoveInfo.log($"前阻挡放行"); MoveInfo.log($"前阻挡放行");
break; break;
case MoveStep.TransplantMove_02: case MoveStep.TransplantMove_02:
...@@ -167,7 +170,7 @@ namespace DeviceLibrary ...@@ -167,7 +170,7 @@ namespace DeviceLibrary
} }
} }
else if (!trayInfo.HasLoad && TrayManager.HasTrayRequest(GroupName, CurrrentRFID,out ReelParam reelParam)) else if (!trayInfo.HasLoad && TrayManager.TryGetTrayRequest(GroupName, CurrrentRFID,out ReelParam reelParam))
{ {
if (IOValue(IO_Type.AMH_Reel_Check).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.AMH_Reel_Check).Equals(IO_VALUE.LOW))
{ {
...@@ -217,8 +220,10 @@ namespace DeviceLibrary ...@@ -217,8 +220,10 @@ namespace DeviceLibrary
Location.ToLow(MoveInfo); Location.ToLow(MoveInfo);
break; break;
case MoveStep.TransplantMove_04: case MoveStep.TransplantMove_04:
if (!canpass())
return;
MoveInfo.NextMoveStep(MoveStep.TransplantMove_05); MoveInfo.NextMoveStep(MoveStep.TransplantMove_05);
IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, IO_Type.AMH_In_Check, IO_VALUE.LOW, StopDelayMS);
Location.ToLow(MoveInfo); Location.ToLow(MoveInfo);
MoveInfo.log($"后阻挡放行"); MoveInfo.log($"后阻挡放行");
break; break;
...@@ -258,7 +263,8 @@ namespace DeviceLibrary ...@@ -258,7 +263,8 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.TransplantMove_13); MoveInfo.NextMoveStep(MoveStep.TransplantMove_13);
axis.AbsMove(MoveInfo, Config.AMH_TS_P1, Config.AMH_TS_P1_speed); axis.AbsMove(MoveInfo, Config.AMH_TS_P1, Config.AMH_TS_P1_speed);
MoveInfo.log("取料轴到P1"); MoveInfo.log("取料轴到P1");
if (MoveInfo.MoveParam.PlateH == 120 && MoveInfo.MoveParam.PlateW == 330) if (MoveInfo.MoveParam.PlateH == 120 && MoveInfo.MoveParam.PlateW == 330
|| MoveInfo.MoveParam.PlateH == 72 && MoveInfo.MoveParam.PlateW == 13)
Location.ToLow(MoveInfo); Location.ToLow(MoveInfo);
break; break;
case MoveStep.TransplantMove_13: case MoveStep.TransplantMove_13:
...@@ -274,7 +280,8 @@ namespace DeviceLibrary ...@@ -274,7 +280,8 @@ namespace DeviceLibrary
RobotManage.UserPause($"{MoveInfo.Name}取料失败"); RobotManage.UserPause($"{MoveInfo.Name}取料失败");
} }
MoveInfo.NextMoveStep(MoveStep.TransplantMove_11); MoveInfo.NextMoveStep(MoveStep.TransplantMove_11);
if (MoveInfo.MoveParam.PlateH == 120 && MoveInfo.MoveParam.PlateW == 330) if (MoveInfo.MoveParam.PlateH == 120 && MoveInfo.MoveParam.PlateW == 330
|| MoveInfo.MoveParam.PlateH == 72 && MoveInfo.MoveParam.PlateW == 13)
Location.ToHigh(MoveInfo); Location.ToHigh(MoveInfo);
} }
break; break;
...@@ -285,16 +292,18 @@ namespace DeviceLibrary ...@@ -285,16 +292,18 @@ namespace DeviceLibrary
break; break;
case MoveStep.TransplantMove_15: case MoveStep.TransplantMove_15:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_16); MoveInfo.NextMoveStep(MoveStep.TransplantMove_16);
IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, StopDelayMS);
MoveInfo2.NewMove(MoveStep.TransplantMove_01); MoveInfo2.NewMove(MoveStep.TransplantMove_01);
MoveInfo2.MoveParam = MoveInfo.MoveParam.clone(); MoveInfo2.MoveParam = MoveInfo.MoveParam.clone();
Location.ToLow(MoveInfo); Location.ToLow(MoveInfo);
MoveInfo.log("料盘已取走,放行托盘, 子流程开始移栽入库"); MoveInfo.log("料盘已取走,放行托盘, 子流程开始移栽入库");
ServerCommunication.UpdateRobotStatus(MoveInfo.MoveParam.WareCode, RobotStatusE.BOXDOOR, MoveInfo.MoveParam.RFID);
TrayManager.SetToEmpty(CurrrentRFID);
break; break;
case MoveStep.TransplantMove_16: case MoveStep.TransplantMove_16:
if (!canpass())
return;
MoveInfo.NextMoveStep(MoveStep.TransplantMove_17); MoveInfo.NextMoveStep(MoveStep.TransplantMove_17);
ServerCommunication.UpdateRobotStatus(MoveInfo.MoveParam.WareCode, RobotStatusE.BOXDOOR, MoveInfo.MoveParam.RFID); IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, IO_Type.AMH_In_Check, IO_VALUE.LOW, StopDelayMS);
TrayManager.SetToEmpty(CurrrentRFID);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break; break;
case MoveStep.TransplantMove_17: case MoveStep.TransplantMove_17:
...@@ -390,11 +399,12 @@ namespace DeviceLibrary ...@@ -390,11 +399,12 @@ namespace DeviceLibrary
break; break;
case MoveStep.TransplantMove_28: case MoveStep.TransplantMove_28:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_29); MoveInfo.NextMoveStep(MoveStep.TransplantMove_29);
break; break;
case MoveStep.TransplantMove_29: case MoveStep.TransplantMove_29:
if (!canpass())
return;
MoveInfo.NextMoveStep(MoveStep.TransplantMove_30); MoveInfo.NextMoveStep(MoveStep.TransplantMove_30);
IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, IO_Type.AMH_In_Check, IO_VALUE.LOW, StopDelayMS);
break; break;
case MoveStep.TransplantMove_30: case MoveStep.TransplantMove_30:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_31); MoveInfo.NextMoveStep(MoveStep.TransplantMove_31);
...@@ -483,6 +493,27 @@ namespace DeviceLibrary ...@@ -483,6 +493,27 @@ namespace DeviceLibrary
} }
} }
bool canpass() {
if (GroupName == "AMH-SBDH2-2")
{
if (IOManager.IOValue(IO_Type.Ls_B_Front_Check, "LS2").Equals(IO_VALUE.HIGH))
{
Msg.add("LS2-2 堵塞中,暂缓放行", MsgLevel.warning);
return false;
}
}
else if (GroupName == "AMH-SBSH1")
{
if (IOManager.IOValue(IO_Type.Ls_A_Front_Check, "LS2").Equals(IO_VALUE.HIGH))
{
Msg.add("LS2-1 堵塞中,暂缓放行", MsgLevel.warning);
return false;
}
}
return true;
}
public void TrayRelease() public void TrayRelease()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
......
...@@ -77,8 +77,9 @@ namespace DeviceLibrary ...@@ -77,8 +77,9 @@ namespace DeviceLibrary
OneWayProcess(); OneWayProcess();
} }
} }
int isalivetrytimes = 0;
int StopBufDelayMS = 500; int StopBufDelayMS = 500;
int StopDelayMS = 1000; int StopDelayMS = 1500;
public void OneWayProcess() public void OneWayProcess()
{ {
if (CheckWait(MoveInfo)) if (CheckWait(MoveInfo))
...@@ -100,12 +101,12 @@ namespace DeviceLibrary ...@@ -100,12 +101,12 @@ namespace DeviceLibrary
MoveInfo.log("入口检测到托盘"); MoveInfo.log("入口检测到托盘");
} }
else { else {
Msg.add(crc.GetString("Res0184","空闲中"), MsgLevel.info); //Msg.add(crc.GetString("Res0184","空闲中"), MsgLevel.info);
} }
break; break;
case MoveStep.TrayStop_01: case MoveStep.TrayStop_01:
MoveInfo.NextMoveStep(MoveStep.TrayStop_02); MoveInfo.NextMoveStep(MoveStep.TrayStop_02);
IOMove(IO_Type.AMH_Front_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.AMH_Front_Stop, IO_VALUE.HIGH, IO_Type.AMH_Front_Check, IO_VALUE.LOW, StopDelayMS);
break; break;
case MoveStep.TrayStop_02: case MoveStep.TrayStop_02:
if (IOValue(IO_Type.MI_In_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.MI_In_Check).Equals(IO_VALUE.HIGH))
...@@ -124,7 +125,7 @@ namespace DeviceLibrary ...@@ -124,7 +125,7 @@ namespace DeviceLibrary
{ {
CurrrentRFID = Common.RfidFilter(data); CurrrentRFID = Common.RfidFilter(data);
TrayManager.Process(MoveInfo, CurrrentRFID, DeviceGroup.addr_1, out TrayInfo trayInfo); TrayManager.Process(MoveInfo, CurrrentRFID, DeviceGroup.addr_1, out TrayInfo trayInfo);
var stop = TrayManager.HasTrayRequest(GroupName, CurrrentRFID, out _); 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}"); MoveInfo.log($"CurrrentRFID:{CurrrentRFID},HasLoad:{trayInfo.HasLoad},MI_Reel_Check:{IOValue(IO_Type.MI_Reel_Check)},NeedStop:{stop}");
#region 张东亮处理 #region 张东亮处理
if (GroupName == "AMH-MI1" || GroupName == "AMH-MI2") if (GroupName == "AMH-MI1" || GroupName == "AMH-MI2")
...@@ -165,7 +166,15 @@ namespace DeviceLibrary ...@@ -165,7 +166,15 @@ namespace DeviceLibrary
{ {
MoveInfo.NextMoveStep(MoveStep.TrayStop_07); MoveInfo.NextMoveStep(MoveStep.TrayStop_07);
//抵达了一个有物料的托盘等待处理 //抵达了一个有物料的托盘等待处理
}else
var device = MI.DeviceList[trayInfo.Destination];
if (!device.IsFree())
MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
else {
device.StartInStore(trayInfo.TrayParam);
}
}
else
MoveInfo.NextMoveStep(MoveStep.TrayStop_04); MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
return; return;
} }
...@@ -236,7 +245,7 @@ namespace DeviceLibrary ...@@ -236,7 +245,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.TrayStop_05: case MoveStep.TrayStop_05:
MoveInfo.NextMoveStep(MoveStep.TrayStop_06); MoveInfo.NextMoveStep(MoveStep.TrayStop_06);
IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, IO_Type.MI_In_Check, IO_VALUE.LOW, StopDelayMS);
break; break;
case MoveStep.TrayStop_06: case MoveStep.TrayStop_06:
if (IOValue(IO_Type.MI_In_Check).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.MI_In_Check).Equals(IO_VALUE.LOW))
...@@ -254,9 +263,29 @@ namespace DeviceLibrary ...@@ -254,9 +263,29 @@ namespace DeviceLibrary
case MoveStep.TrayStop_07: case MoveStep.TrayStop_07:
MoveInfo.NextMoveStep(MoveStep.TrayStop_WaitLoadProcess); MoveInfo.NextMoveStep(MoveStep.TrayStop_WaitLoadProcess);
Location.ToHigh(MoveInfo); Location.ToHigh(MoveInfo);
isalivetrytimes = 0;
break; break;
case MoveStep.TrayStop_WaitLoadProcess: case MoveStep.TrayStop_WaitLoadProcess:
Msg.add("等待处理载荷",MsgLevel.info); Msg.add("等待处理载荷",MsgLevel.info);
if (GroupName != "AMH-MI1" && GroupName != "AMH-MI2" && GroupName != "CI")
{
var remoteLoad = new RemoteLoad();
remoteLoad.Action = "IsAlive";
remoteLoad.RequestLoadInfo = new RequestLoadInfo();
var result = RemoteService.SendAndWait(GroupName, remoteLoad);
if (result != RemoteResult.True && IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.LOW))
{
isalivetrytimes++;
if (isalivetrytimes > 4)
{
MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
MoveInfo.log($"{GroupName} 料仓状态不明:{result}");
}
}
else {
isalivetrytimes=0;
}
}
break; break;
case MoveStep.TrayStop_LoadProcessed: case MoveStep.TrayStop_LoadProcessed:
MoveInfo.NextMoveStep(MoveStep.TrayStop_04); MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
...@@ -290,7 +319,7 @@ namespace DeviceLibrary ...@@ -290,7 +319,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.H02_HomeReset: case MoveStep.H02_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H03_HomeReset); MoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, StopDelayMS); IOMove(IO_Type.AMH_Tray_Stop, IO_VALUE.HIGH, IO_Type.MI_In_Check, IO_VALUE.LOW, StopDelayMS);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
break; break;
case MoveStep.H03_HomeReset: case MoveStep.H03_HomeReset:
......
...@@ -169,6 +169,7 @@ ...@@ -169,6 +169,7 @@
this.lblAlarmcode.Tag = "not"; this.lblAlarmcode.Tag = "not";
this.lblAlarmcode.Text = "ErrCode:160"; this.lblAlarmcode.Text = "ErrCode:160";
this.lblAlarmcode.Visible = false; this.lblAlarmcode.Visible = false;
this.lblAlarmcode.Click += new System.EventHandler(this.lblAlarmcode_Click);
// //
// label4 // label4
// //
......
...@@ -348,7 +348,7 @@ namespace DeviceLibrary ...@@ -348,7 +348,7 @@ namespace DeviceLibrary
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
LogUtil.OutputDebugString($"timer1_Tick:{this.Visible}"); //LogUtil.OutputDebugString($"timer1_Tick:{this.Visible}");
if (this.Visible && !DesignMode) if (this.Visible && !DesignMode)
{ {
ReadAxisStatus(); ReadAxisStatus();
...@@ -447,5 +447,10 @@ namespace DeviceLibrary ...@@ -447,5 +447,10 @@ namespace DeviceLibrary
lbl.BackColor = this.BackColor; lbl.BackColor = this.BackColor;
} }
} }
private void lblAlarmcode_Click(object sender, EventArgs e)
{
}
} }
} }
\ No newline at end of file \ No newline at end of file
位置,备注,待机点P1,放料高点P2,放料降低P3,放料退出过度点P4,取料低点P5,取料升高P6,取料退出过度点P7
CI_MT,流水线取料点,1,403,404,405,403,404,405
CI_SCAN,手动平台,1,410,411,412,410,411,412
CI_T01,点料机,1,400,401,402,400,401,402
CI_B01,缓存位1,1,301,303,305,301,303,305
CI_B02,缓存位2,1,311,313,315,311,313,315
CI_B03,缓存位3,1,321,323,325,321,323,325
CI_B04,缓存位4,1,331,333,335,331,333,335
CI_B05,缓存位5,1,341,343,345,341,343,345
CI_B06,缓存位6,1,351,353,355,351,353,355
...@@ -19,7 +19,8 @@ PRO,10,AMH移栽设备待机点P1,AMH_TS_P1,1000,,,10000,,,,,,,,, ...@@ -19,7 +19,8 @@ PRO,10,AMH移栽设备待机点P1,AMH_TS_P1,1000,,,10000,,,,,,,,,
PRO,10,AMH移栽设备取料P2-8mm,AMH_TS_P2,1000,,,10000,,,,,,,,, PRO,10,AMH移栽设备取料P2-8mm,AMH_TS_P2,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_RoboMI1_Comp_P1,1000,,,10000,,,,,,,,,
PRO,14,机器人压紧轴8mm压紧点,AMH_RoboMI1_Comp_P2,1000,,,10000,,,,,,,,,
PRO,15,托盘旋转轴每度脉冲,AMH_Route_PoToMM,1000,,,10000,,,,,,,,, PRO,15,托盘旋转轴每度脉冲,AMH_Route_PoToMM,1000,,,10000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
DI,0,急停,SuddenStop_BTN,0,,X00,,,,,,,,,, DI,0,急停,SuddenStop_BTN,0,,X00,,,,,,,,,,
......
位置,备注,待机点P1,放料高点P2,放料降低P3,放料退出过度点P4,取料低点P5,取料升高P6,取料退出过度点P7
MI1_MT,流水线取料点,1,451,453,454,450,452,455
MI1_SCAN,旋转拍照点,1,461,463,464,460,462,465
MI1_T01,料仓3,1,31,33,34,30,32,35
MI1_T02,料仓4,1,41,43,44,40,42,45
MI1_T03,料仓7,1,71,73,74,70,72,75
MI1_T04,料仓8,1,81,83,84,80,82,85
MI1_B01,缓存位1,1,101,103,104,100,102,105
MI1_B02,缓存位2,1,111,113,114,110,112,115
MI1_B03,缓存位3,1,121,123,124,120,122,125
MI1_B04,缓存位4,1,131,133,134,130,132,135
MI1_B05,缓存位5,1,141,143,144,140,142,145
MI1_B06,缓存位6,1,151,153,154,150,152,155
MI1_B07,缓存位7,1,161,163,164,160,162,165
MI1_B08,缓存位8,1,171,173,174,170,172,175
位置,备注,待机点P1,放料高点P2,放料降低P3,放料退出过度点P4,取料低点P5,取料升高P6,取料退出过度点P7
MI2_MT,流水线取料点,1,471,473,474,470,472,475
MI2_SCAN,旋转拍照点,1,481,483,484,480,482,485
MI2_T01,料仓1,1,11,13,14,10,12,15
MI2_T02,料仓2,1,21,23,24,20,22,25
MI2_T03,料仓5,1,51,53,54,50,52,55
MI2_T04,料仓6,1,61,63,64,60,62,65
MI2_B01,缓存位1,1,201,203,204,200,202,205
MI2_B02,缓存位2,1,211,213,214,210,212,215
MI2_B03,缓存位3,1,221,223,224,220,222,225
MI2_B04,缓存位4,1,231,233,234,230,232,235
MI2_B05,缓存位5,1,241,243,244,240,242,245
MI2_B06,缓存位6,1,251,253,254,250,252,255
MI2_B07,缓存位7,1,261,263,264,260,262,265
MI2_B08,缓存位8,1,271,273,274,270,272,275
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CSVExection.cs" /> <Compile Include="CSVExection.cs" />
<Compile Include="position\RobotPosition.cs" />
<Compile Include="position\DeviceGroup.cs" /> <Compile Include="position\DeviceGroup.cs" />
<Compile Include="position\ACSAStorePosition.cs" /> <Compile Include="position\ACSAStorePosition.cs" />
<Compile Include="position\CSVPositionReader.cs" /> <Compile Include="position\CSVPositionReader.cs" />
...@@ -79,9 +80,19 @@ ...@@ -79,9 +80,19 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="Config\DeviceGroup.csv"> <None Include="Config\DeviceGroup.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<Content Include="Config\CIPostion.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Config\MI2Postion.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Config\MI1Postion.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......
...@@ -17,6 +17,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -17,6 +17,11 @@ namespace OnlineStore.LoadCSVLibrary
string DeviceGroupFile = "config\\DeviceGroup.csv"; string DeviceGroupFile = "config\\DeviceGroup.csv";
var DeviceGroup = CSVPositionReader<DeviceGroup>.AddCSVFile(DeviceGroupFile); var DeviceGroup = CSVPositionReader<DeviceGroup>.AddCSVFile(DeviceGroupFile);
string MI1PostionFile = "config\\MI1Postion.csv";
var MI1PostionPostion = CSVPositionReader<RobotPosition>.LoadCSVFile(MI1PostionFile);
Console.Read(); Console.Read();
} }
} }
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
...@@ -246,6 +246,85 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -246,6 +246,85 @@ namespace OnlineStore.LoadCSVLibrary
return newStr; return newStr;
} }
public static Dictionary<String, T> LoadCSVFile(string filePath)
{
Type type = typeof(T);
Dictionary<string, string> proTitleMap = getProAttributeMap(typeof(T));
if (proTitleMap.Count <= 4)
{
LOGGER.Error(typeof(T).ToString() + "只读取到" + proTitleMap.Count + "个属性");
}
List<string> cvsTitleList = new List<string>(proTitleMap.Values);
List<string> propertyList = new List<string>(proTitleMap.Keys);
Dictionary<String, T> result = new Dictionary<String, T>();
string[] lines = ReadCSVFile(filePath);
int index = 0;
Dictionary<string, int> titleIndex = new Dictionary<string, int>();
foreach (var line in lines)
{
var array = line.Split(Spilt_Char);
if (index == 0)
{
titleIndex = GetTitleIndex(line, cvsTitleList);
}
else
{
try
{
if (array.Length >= titleIndex.Count)
{
if (array.Length > 0 && array[0].Equals(""))
{
continue;
}
var bllIns = type.Assembly.CreateInstance(type.FullName);
//取得属性集合
PropertyInfo[] props = type.GetProperties();
int listIndex = 0;
string PositionNum = "";
foreach (string key in cvsTitleList)
{
int titIndex = titleIndex[key];
string value = array[titIndex];
string proName = propertyList[listIndex];
PropertyInfo prop = props.First(c => c.Name == proName);//获取同名属性
if (prop != null)
{//如果属性存在
prop.SetValue(bllIns, Convert.ChangeType(value, prop.PropertyType), null);//赋值****在这里需要考虑类型问题
}
if (proName.Equals("PositionNum"))
{
PositionNum = value;
}
listIndex++;
}
result.Add(PositionNum, (T)bllIns);
//if (allPositionMap.ContainsKey(PositionNum))
//{
// throw new PositionAlreadyExistingExection("仓位:" + PositionNum + "已存在!");
//}
//allPositionMap.Add(PositionNum, (T)bllIns);
}
else
{
LOGGER.Error("读取csv,index=" + index + ",数据格式不匹配!,line=" + line);
}
}
catch (Exception ex)
{
LOGGER.Debug("CSV 读取行【" + line + "】行转换失败");
}
}
index++;
}
return result;
}
} }
......
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public class RobotPosition : StorePostionBase
{
/// <summary>
/// 备注
/// </summary>
[CSVAttribute("备注")]
public string Memo { get; set; }
/// <summary>
/// 待机点P1
/// </summary>
[CSVAttribute("待机点P1"), Editable(101)]
public int P1 { get; set; }
/// <summary>
/// 放料高点P2
/// </summary>
[CSVAttribute("放料高点P2"), Editable(101)]
public int Put_P2 { get; set; }
/// <summary>
/// 放料降低P3
/// </summary>
[CSVAttribute("放料降低P3"), Editable(101)]
public int Put_P3 { get; set; }
/// <summary>
/// 放料退出过度点P4
/// </summary>
[CSVAttribute("放料退出过度点P4"), Editable(101)]
public int Put_P4 { get; set; }
/// <summary>
/// 取料低点P5
/// </summary>
[CSVAttribute("取料低点P5"), Editable(101)]
public int Take_P5 { get; set; }
/// <summary>
/// 取料升高P6
/// </summary>
[CSVAttribute("取料升高P6"), Editable(101)]
public int Take_P6 { get; set; }
/// <summary>
/// 取料退出过度点P7
/// </summary>
[CSVAttribute("取料退出过度点P7"), Editable(1)]
public int Take_P7 { get; set; }
}
}
...@@ -13,20 +13,5 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -13,20 +13,5 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[CSVAttribute("位置")] [CSVAttribute("位置")]
public string PositionNum { get; set; } public string PositionNum { get; set; }
/// <summary>
/// 优先级
/// </summary>
[CSVAttribute("优先级")]
public int Priority { get; set; }
/// <summary>
/// 高
/// </summary>
[CSVAttribute("高度")]
public int BagHigh { get; set; }
/// <summary>
/// 宽
/// </summary>
[CSVAttribute("宽度")]
public int BagWidth { get; set; }
} }
} }
...@@ -127,16 +127,6 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -127,16 +127,6 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("AMH_RoboComp_PoToMM")] [ConfigProAttribute("AMH_RoboComp_PoToMM")]
public int AMH_RoboComp_PoToMM { get; set; } public int AMH_RoboComp_PoToMM { get; set; }
/// <summary> /// <summary>
/// PRO,0,机器人压紧轴待机点P1,AMH_RoboComp_P1,1000,,,10000,,,,,,,,,
/// </summary>
[ConfigProAttribute("AMH_RoboComp_P1")]
public int AMH_RoboComp_P1 { get; set; }
/// <summary>
/// PRO,0,机器人压紧轴待机点P1,AMH_RoboComp_P1,1000,,,10000,,,,,,,,,
/// </summary>
[ConfigProAttribute("AMH_RoboComp_P1_speed")]
public int AMH_RoboComp_P1_speed { get; set; }
/// <summary>
/// PRO,50,托盘旋转轴每度脉冲,AMH_Route_PoToMM,1000,,,,,,,,,,,, /// PRO,50,托盘旋转轴每度脉冲,AMH_Route_PoToMM,1000,,,,,,,,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("AMH_Route_PoToMM")] [ConfigProAttribute("AMH_Route_PoToMM")]
...@@ -146,6 +136,31 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -146,6 +136,31 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("AMH_Route_PoToMM_speed")] [ConfigProAttribute("AMH_Route_PoToMM_speed")]
public int AMH_Route_PoToMM_speed { get; set; } public int AMH_Route_PoToMM_speed { get; set; }
/// <summary>
/// PRO,14,机器人压紧轴待机点P1,AMH_RoboMI1_Comp_P1,1000,,,10000,,,,,,,,,
/// </summary>
[ConfigProAttribute("AMH_RoboMI1_Comp_P1")]
public int AMH_RoboMI1_Comp_P1 { get; set; }
/// <summary>
/// PRO,14,机器人压紧轴8mm压紧点,AMH_RoboMI1_Comp_P2,1000,,,10000,,,,,,,,,
/// </summary>
[ConfigProAttribute("AMH_RoboMI1_Comp_P2")]
public int AMH_RoboMI1_Comp_P2 { get; set; }
/// <summary>
/// PRO,14,机器人压紧轴待机点P1,AMH_RoboMI1_Comp_P1,1000,,,10000,,,,,,,,,
/// </summary>
[ConfigProAttribute("AMH_RoboMI1_Comp_P1_speed")]
public int AMH_RoboMI1_Comp_P1_speed { get; set; }
/// <summary>
/// PRO,14,机器人压紧轴8mm压紧点,AMH_RoboMI1_Comp_P2,1000,,,10000,,,,,,,,,
/// </summary>
[ConfigProAttribute("AMH_RoboMI1_Comp_P2_speed")]
public int AMH_RoboMI1_Comp_P2_speed { get; set; }
public ConfigIO GetWaitIO(string ioType,string device="root") public ConfigIO GetWaitIO(string ioType,string device="root")
{ {
if (DIList[device].ContainsKey(ioType)) if (DIList[device].ContainsKey(ioType))
......
...@@ -39,6 +39,16 @@ ...@@ -39,6 +39,16 @@
<conversionPattern value="[%date][%t]%-5p %m%n"/> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="URROBOTLog" type="log4net.Appender.RollingFileAppender">
<file value="logs/URROBOT.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<appender name="LngResource" type="log4net.Appender.RollingFileAppender"> <appender name="LngResource" type="log4net.Appender.RollingFileAppender">
<file value="logs/LngResource.log"/> <file value="logs/LngResource.log"/>
<param name="Encoding" value="UTF-8"/> <param name="Encoding" value="UTF-8"/>
...@@ -65,6 +75,10 @@ ...@@ -65,6 +75,10 @@
<level value="ALL"/> <level value="ALL"/>
<appender-ref ref="SLog"/> <appender-ref ref="SLog"/>
</logger> </logger>
<logger name="URROBOTLog" additivity="false">
<level value="ALL"/>
<appender-ref ref="URROBOTLog"/>
</logger>
<!--<root> <!--<root>
<level value="Info" /> <level value="Info" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
......
...@@ -17,6 +17,7 @@ using System.Text; ...@@ -17,6 +17,7 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using TheMachine.device.Other;
namespace TheMachine namespace TheMachine
{ {
...@@ -70,6 +71,7 @@ namespace TheMachine ...@@ -70,6 +71,7 @@ namespace TheMachine
DeviceControl<TrayStopControl> ci = new DeviceControl<TrayStopControl>(); DeviceControl<TrayStopControl> ci = new DeviceControl<TrayStopControl>();
AxisControl ac = new AxisControl(); AxisControl ac = new AxisControl();
SettingControl sc = new SettingControl(); SettingControl sc = new SettingControl();
MycronicControl mc = new MycronicControl();
readonly System.Windows.Forms.Timer t1 = new System.Windows.Forms.Timer(); readonly System.Windows.Forms.Timer t1 = new System.Windows.Forms.Timer();
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
...@@ -154,6 +156,7 @@ namespace TheMachine ...@@ -154,6 +156,7 @@ namespace TheMachine
AddForm("tab_traystopMI", "MI", mi); AddForm("tab_traystopMI", "MI", mi);
AddForm("tab_traystopCI", "CI", ci); AddForm("tab_traystopCI", "CI", ci);
AddForm("tab_traysetting", crc.GetString("Form1_tabc_tab_setting__SettingControl_tabControl1_tabPage1_Text","治具设置"), sc); AddForm("tab_traysetting", crc.GetString("Form1_tabc_tab_setting__SettingControl_tabControl1_tabPage1_Text","治具设置"), sc);
AddForm("tab_other", "周边", mc);
crc.LanguageProcess(this); crc.LanguageProcess(this);
} }
......

namespace TheMachine
{
partial class OtherControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// OrtherControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "OrtherControl";
this.Size = new System.Drawing.Size(799, 546);
this.ResumeLayout(false);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachine
{
public partial class OtherControl : UserControl
{
public OtherControl()
{
InitializeComponent();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -63,6 +63,9 @@ ...@@ -63,6 +63,9 @@
<Reference Include="Neotel.Rmaxis"> <Reference Include="Neotel.Rmaxis">
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath> <HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath>
</Reference> </Reference>
<Reference Include="Robot.UR">
<HintPath>..\..\..\DllLibrary\第三方\URRobot\Robot.UR\Robot.UR\bin\Debug\Robot.UR.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
...@@ -79,111 +82,95 @@ ...@@ -79,111 +82,95 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AboutBox1.cs"> <Compile Include="AboutBox1.cs" />
<SubType>Form</SubType>
</Compile>
<Compile Include="AboutBox1.Designer.cs"> <Compile Include="AboutBox1.Designer.cs">
<DependentUpon>AboutBox1.cs</DependentUpon> <DependentUpon>AboutBox1.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="AxisControl.cs"> <Compile Include="AxisControl.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="AxisControl.Designer.cs"> <Compile Include="AxisControl.Designer.cs">
<DependentUpon>AxisControl.cs</DependentUpon> <DependentUpon>AxisControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="DeviceControl.cs"> <Compile Include="DeviceControl.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="DeviceControl.Designer.cs"> <Compile Include="DeviceControl.Designer.cs">
<DependentUpon>DeviceControl.cs</DependentUpon> <DependentUpon>DeviceControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="device\HYControl.cs"> <Compile Include="device\HYControl.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="device\HYControl.Designer.cs"> <Compile Include="device\HYControl.Designer.cs">
<DependentUpon>HYControl.cs</DependentUpon> <DependentUpon>HYControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="device\Idevicetab.cs" /> <Compile Include="device\Idevicetab.cs" />
<Compile Include="device\TrayStopControl.cs"> <Compile Include="device\Other\MycronicControl.cs" />
<SubType>UserControl</SubType> <Compile Include="device\Other\MycronicControl.Designer.cs">
<DependentUpon>MycronicControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="device\TrayStopControl.cs" />
<Compile Include="device\TrayStopControl.Designer.cs"> <Compile Include="device\TrayStopControl.Designer.cs">
<DependentUpon>TrayStopControl.cs</DependentUpon> <DependentUpon>TrayStopControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="device\TransplantControl.cs"> <Compile Include="device\TransplantControl.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="device\TransplantControl.Designer.cs"> <Compile Include="device\TransplantControl.Designer.cs">
<DependentUpon>TransplantControl.cs</DependentUpon> <DependentUpon>TransplantControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Form1.cs"> <Compile Include="Form1.cs" />
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs"> <Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="IOControls.cs"> <Compile Include="IOControls.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="IOControls.Designer.cs"> <Compile Include="IOControls.Designer.cs">
<DependentUpon>IOControls.cs</DependentUpon> <DependentUpon>IOControls.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="LogControl.cs"> <Compile Include="LogControl.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="LogControl.Designer.cs"> <Compile Include="LogControl.Designer.cs">
<DependentUpon>LogControl.cs</DependentUpon> <DependentUpon>LogControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="OtherControl.cs" />
<Compile Include="OtherControl.Designer.cs">
<DependentUpon>OtherControl.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SettingControl.cs"> <Compile Include="SettingControl.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SettingControl.Designer.cs"> <Compile Include="SettingControl.Designer.cs">
<DependentUpon>SettingControl.cs</DependentUpon> <DependentUpon>SettingControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="TrayManagerControl.cs"> <Compile Include="TrayManagerControl.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="TrayManagerControl.Designer.cs"> <Compile Include="TrayManagerControl.Designer.cs">
<DependentUpon>TrayManagerControl.cs</DependentUpon> <DependentUpon>TrayManagerControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\CylinderButton.cs"> <Compile Include="UC\CylinderButton.cs" />
<SubType>Component</SubType> <Compile Include="UC\DoubleBufferListView.cs" />
</Compile> <Compile Include="UC\RfidControl.cs" />
<Compile Include="UC\DoubleBufferListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="UC\RfidControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\RfidControl.Designer.cs"> <Compile Include="UC\RfidControl.Designer.cs">
<DependentUpon>RfidControl.cs</DependentUpon> <DependentUpon>RfidControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\StorePosControl.cs"> <Compile Include="UC\RobotPosControl.cs" />
<SubType>UserControl</SubType> <Compile Include="UC\RobotPosControl.designer.cs">
<DependentUpon>RobotPosControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\StorePosControl.cs" />
<Compile Include="UC\StorePosControl.designer.cs"> <Compile Include="UC\StorePosControl.designer.cs">
<DependentUpon>StorePosControl.cs</DependentUpon> <DependentUpon>StorePosControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\ConfigControl.cs"> <Compile Include="UC\ConfigControl.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\ConfigControl.designer.cs"> <Compile Include="UC\ConfigControl.designer.cs">
<DependentUpon>ConfigControl.cs</DependentUpon> <DependentUpon>ConfigControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\IOControl.cs"> <Compile Include="UC\IOControl.cs" />
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\IOControl.Designer.cs"> <Compile Include="UC\IOControl.Designer.cs">
<DependentUpon>IOControl.cs</DependentUpon> <DependentUpon>IOControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\UC_LedConfig.cs"> <Compile Include="UC\UCURRobot.cs" />
<SubType>UserControl</SubType> <Compile Include="UC\UCURRobot.designer.cs">
<DependentUpon>UCURRobot.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\UC_LedConfig.cs" />
<Compile Include="UC\UC_LedConfig.Designer.cs"> <Compile Include="UC\UC_LedConfig.Designer.cs">
<DependentUpon>UC_LedConfig.cs</DependentUpon> <DependentUpon>UC_LedConfig.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\uc_boxdebug.cs" />
<Compile Include="UC\uc_boxdebug.designer.cs">
<DependentUpon>uc_boxdebug.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="AboutBox1.resx"> <EmbeddedResource Include="AboutBox1.resx">
<DependentUpon>AboutBox1.cs</DependentUpon> <DependentUpon>AboutBox1.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -197,6 +184,9 @@ ...@@ -197,6 +184,9 @@
<EmbeddedResource Include="device\HYControl.resx"> <EmbeddedResource Include="device\HYControl.resx">
<DependentUpon>HYControl.cs</DependentUpon> <DependentUpon>HYControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="device\Other\MycronicControl.resx">
<DependentUpon>MycronicControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="device\TrayStopControl.resx"> <EmbeddedResource Include="device\TrayStopControl.resx">
<DependentUpon>TrayStopControl.cs</DependentUpon> <DependentUpon>TrayStopControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -212,6 +202,9 @@ ...@@ -212,6 +202,9 @@
<EmbeddedResource Include="LogControl.resx"> <EmbeddedResource Include="LogControl.resx">
<DependentUpon>LogControl.cs</DependentUpon> <DependentUpon>LogControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="OtherControl.resx">
<DependentUpon>OtherControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
...@@ -231,6 +224,9 @@ ...@@ -231,6 +224,9 @@
<EmbeddedResource Include="UC\RfidControl.resx"> <EmbeddedResource Include="UC\RfidControl.resx">
<DependentUpon>RfidControl.cs</DependentUpon> <DependentUpon>RfidControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UC\RobotPosControl.resx">
<DependentUpon>RobotPosControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\StorePosControl.resx"> <EmbeddedResource Include="UC\StorePosControl.resx">
<DependentUpon>StorePosControl.cs</DependentUpon> <DependentUpon>StorePosControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -240,9 +236,15 @@ ...@@ -240,9 +236,15 @@
<EmbeddedResource Include="UC\IOControl.resx"> <EmbeddedResource Include="UC\IOControl.resx">
<DependentUpon>IOControl.cs</DependentUpon> <DependentUpon>IOControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UC\UCURRobot.resx">
<DependentUpon>UCURRobot.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UC_LedConfig.resx"> <EmbeddedResource Include="UC\UC_LedConfig.resx">
<DependentUpon>UC_LedConfig.cs</DependentUpon> <DependentUpon>UC_LedConfig.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UC\uc_boxdebug.resx">
<DependentUpon>uc_boxdebug.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.manifest" /> <None Include="app.manifest" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
using DeviceLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using Robot.UR;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachine
{
using crc = OnlineStore.CodeResourceControl;
public partial class RobotPosControl : UserControl
{
private Robot_Config _Config;
public Robot_Config Config
{
get { return _Config; }
set
{
if (value == null)
return;
_Config = value;
}
}
public RobotPosControl()
{
InitializeComponent();
this.Tag = "not";
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
tableLayoutPanel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)
.SetValue(tableLayoutPanel1, true, null);
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
if (!this.Created)
return;
this.Invoke((EventHandler)delegate
{
try
{
LoadPos(_aCStorePosition);
}
catch (Exception ee)
{
MessageBox.Show("Crc_LanguageChangeEvent LoadPos:" + ee.ToString());
}
});
}
private RobotPosition _aCStorePosition;
public void LoadPos(RobotPosition aCStorePosition)
{
if (aCStorePosition == null)
return;
_aCStorePosition = aCStorePosition;
tableLayoutPanel1.SuspendLayout();
int maxrow = tableLayoutPanel1.Height / 37;
tableLayoutPanel1.Controls.Clear();
this.tableLayoutPanel1.RowStyles.Clear();
//this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType., 26));
int r = 0;
int c = 0;
int lastSubType = 0;
Random random = new Random(1);
Color color = Color.Black;
var type = typeof(RobotPosition);
PropertyInfo[] props = type.GetProperties();
foreach (PropertyInfo prop in props)
{
var editable = prop.GetCustomAttributes(typeof(EditableAttribute));
if (editable.Count() == 0)
continue;
var asixno = ((EditableAttribute)editable.First()).Axisno;
var attrib = prop.GetCustomAttributes(typeof(CSVAttribute));
if (attrib.Count() == 0)
continue;
var FieldName = ((CSVAttribute)attrib.First()).FieldName;
var ProValue = prop.GetValue(aCStorePosition).ToString();
if (asixno != lastSubType)
{
lastSubType = asixno;
color = Color.FromArgb(random.Next(30, 150), random.Next(30, 150), random.Next(30, 150));
}
Button button = new Button();
button.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
button.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
button.Name = prop.Name;
button.Size = new System.Drawing.Size(225, 27);
button.Text = crc.GetString(prop.Name, FieldName);
button.Click += Button_Click;
button.ForeColor = color;
button.Tag = asixno;
tableLayoutPanel1.Controls.Add(button, c, r);
TextBox textBox = new TextBox();
textBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
textBox.Name = prop.Name;
textBox.Margin = new Padding(4, 8, 0, 0);
textBox.Size = new System.Drawing.Size(180, 23);
textBox.Text = ProValue;
textBox.KeyPress += TextBox_KeyPress;
textBox.TextChanged += TextBox_TextChanged;
tableLayoutPanel1.Controls.Add(textBox, c + 1, r);
textBox.Tag = prop.PropertyType.Name;
tableLayoutPanel1.SetColumnSpan(textBox, 2);
r++;
if (r > maxrow)
{
r = 0;
c += 3;
}
}
if (r <= maxrow + 1)
{
Label button1 = new Label();
tableLayoutPanel1.Controls.Add(button1, c, r++);
}
tableLayoutPanel1.ResumeLayout(true);
}
private void TextBox_TextChanged(object sender, EventArgs e)
{
var lastlen = lastvalue.Length;
var s = (sender as TextBox);
if (s.Tag.ToString() == "Int32")
{
if (!int.TryParse(s.Text, out _))
s.Text = lastvalue;
//s.SelectionStart = lastselectindex;
}
else if (s.Tag.ToString() == "Double")
{
if (!double.TryParse(s.Text, out _))
s.Text = lastvalue;
//s.SelectionStart = lastselectindex;
}
}
string lastvalue = "";
int lastselectindex = 0;
private void TextBox_KeyPress(object sender, KeyPressEventArgs e)
{
var s = (sender as TextBox);
if (s.Tag.ToString() == "Int32")
{
if (int.TryParse(s.Text, out _))
lastvalue = s.Text;
}
else if (s.Tag.ToString() == "Double")
{
if (double.TryParse(s.Text, out _))
lastvalue = s.Text;
}
lastselectindex = s.SelectionStart;
}
private void Button_Click(object sender, EventArgs e)
{
var cc = tableLayoutPanel1.Controls.Find(((Button)sender).Name, false);
var axis = getConfigMoveAxis((int)((Button)sender).Tag);
var targetpos = int.Parse(cc[1].Text);
axis.SendMoveCmd(targetpos, axis.SpeedRate);
LogUtil.info("手动点击机器人移动命令:" + axis.RobotIp + " - " + targetpos);
}
URRobotControl getConfigMoveAxis(int Axisid)
{
if (_aCStorePosition.PositionNum.StartsWith("MI1"))
return RobotManage.Robot_MI1;
else if (_aCStorePosition.PositionNum.StartsWith("MI2"))
return RobotManage.Robot_MI2;
else if (_aCStorePosition.PositionNum.StartsWith("CI"))
return RobotManage.Robot_CI;
return RobotManage.Robot_MI1;
}
private void ConfigControl_Load(object sender, EventArgs e)
{
OnlineStore.CodeResourceControl.LanguageChangeEvent += CodeResourceControl_LanguageChange;
CodeResourceControl_LanguageChange(null,null);
}
private void CodeResourceControl_LanguageChange(object sender, EventArgs e)
{
OnlineStore.CodeResourceControl.LanguageProcess(this);
}
private void btnSavePos_Click(object sender, EventArgs e)
{
for (int i = 0; i < tableLayoutPanel1.Controls.Count; i++)
{
if (tableLayoutPanel1.Controls[i].GetType().Name != "TextBox")
continue;
TextBox textBox = (TextBox)tableLayoutPanel1.Controls[i];
PropertyInfo pi = _aCStorePosition.GetType().GetProperty(textBox.Name);
if (pi != null)
{
//var cc = Config.configList.Find(new Predicate<ConfigBase>((c) => { return c.ProName == textBox.Name; }));
//if (cc != null)
// cc.ProValue = textBox.Text;
if (pi.PropertyType.Name == "Int32")
pi.SetValue(_aCStorePosition, int.Parse(textBox.Text));
else if (pi.PropertyType.Name == "Double")
pi.SetValue(_aCStorePosition, double.Parse(textBox.Text));
else
pi.SetValue(_aCStorePosition, textBox.Text);
}
}
var positionConfigFile = Path.Combine(Application.StartupPath, "Config\\MI1Postion.csv");
var positionConfigFile1 = Path.Combine(Application.StartupPath, "Config\\MI2Postion.csv");
var positionConfigFile3 = Path.Combine(Application.StartupPath, "Config\\CIPostion.csv");
bool result = CSVPositionReader<RobotPosition>.SavePostion(positionConfigFile, _aCStorePosition);
result = CSVPositionReader<RobotPosition>.SavePostion(positionConfigFile1, _aCStorePosition);
result = CSVPositionReader<RobotPosition>.SavePostion(positionConfigFile3, _aCStorePosition);
}
}
}

namespace TheMachine
{
partial class RobotPosControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnSavePos = new System.Windows.Forms.Button();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// groupBox3
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox3.Controls.Add(this.tableLayoutPanel1);
this.groupBox3.Location = new System.Drawing.Point(4, 4);
this.groupBox3.Margin = new System.Windows.Forms.Padding(4);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new System.Windows.Forms.Padding(4);
this.groupBox3.Size = new System.Drawing.Size(590, 299);
this.groupBox3.TabIndex = 108;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "点位列表";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 6;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 18);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(582, 277);
this.tableLayoutPanel1.TabIndex = 102;
this.tableLayoutPanel1.Tag = "not";
//
// btnSavePos
//
this.btnSavePos.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSavePos.Location = new System.Drawing.Point(424, 311);
this.btnSavePos.Margin = new System.Windows.Forms.Padding(4);
this.btnSavePos.Name = "btnSavePos";
this.btnSavePos.Size = new System.Drawing.Size(170, 31);
this.btnSavePos.TabIndex = 109;
this.btnSavePos.Text = "保存";
this.btnSavePos.UseVisualStyleBackColor = true;
this.btnSavePos.Click += new System.EventHandler(this.btnSavePos_Click);
//
// StorePosControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnSavePos);
this.Controls.Add(this.groupBox3);
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "StorePosControl";
this.Size = new System.Drawing.Size(598, 346);
this.Load += new System.EventHandler(this.ConfigControl_Load);
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Button btnSavePos;
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
using Robot.UR;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace URRobot
{
public partial class UCURRobot : UserControl
{
public URRobotControl robotControl;
public UCURRobot()
{
InitializeComponent();
for (int i = 0; i <= 100; i++)
{
cmbRate.Items.Add(i);
}
}
public void Init(URRobotControl rRobotControl)
{
this.robotControl = rRobotControl;
this.robotControl.Register(RobotClient_RobotModeFun, RobotClient_SafetModeFun, RobotClient_URPointValue);
cmbRate.SelectedIndex = robotControl.SpeedRate;
timer1.Start();
}
public bool MoveOk()
{
return robotControl.MoveCmdOk();
}
private void RobotClient_URPointValue(URPointValue value)
{
if (!this.IsHandleCreated) return;
this.Invoke(new Action(() =>
{
ShowPoint(value);
}));
}
private void RobotClient_SafetModeFun(string mode)
{
if (!this.IsHandleCreated) return;
this.Invoke(new Action(() => { lblSafeMode.Text = $"{mode}"; }));
}
private void RobotClient_RobotModeFun(string mode)
{
if (!this.IsHandleCreated) return;
this.Invoke(new Action(() => { lblRobotMode.Text = $"{mode}"; }));
}
void ShowPoint(URPointValue point)
{
txtRobotX.Text = point.X.ToString();
txtRobotY.Text = point.Y.ToString();
txtRobotZ.Text = point.Z.ToString();
lblRX.Text = point.RX.ToString();
lblRY.Text = point.RY.ToString();
lblRZ.Text = point.RZ.ToString();
}
public URPointValue GetPoint()
{
double x = getValue(txtRobotX);
double y = getValue(txtRobotY);
double z = getValue(txtRobotZ);
double rx = getValue(lblRX);
double ry = getValue(lblRY);
double rz = getValue(lblRZ);
return new URPointValue(x, y, z, rx, ry, rz);
}
public double getValue(Label textBox)
{
double.TryParse(textBox.Text, out double value);
return value;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (!this.IsHandleCreated) return;
try
{
this.Invoke(new Action(() =>
{
ShowPoint(robotControl.GetLastPosition());
lbl29999.BackColor = robotControl.IsRun ? Color.Green : Color.Red;
lbl30003.BackColor = robotControl.Port3003Connected ? Color.Green : Color.Red;
lblCurCmd.Text = $"Cmd:{robotControl.CurCmd}";
lblCmdResponse.Text = $"Response:{robotControl.CurCmdReponse}";
lblRobot.BackColor = robotControl.ClientIsConnected ? Color.Green : Color.Red;
lblRobot.Text = robotControl.ClientIp;
}));
}
catch { }
}
public bool IsConnected()
{
return robotControl.ClientIsConnected;
}
private void 启动机器人ToolStripMenuItem_Click(object sender, EventArgs e)
{
robotControl?.StartRobot();
}
private void 重置机器人ToolStripMenuItem_Click(object sender, EventArgs e)
{
robotControl?.Reset();
}
private void 关闭机器人ToolStripMenuItem_Click(object sender, EventArgs e)
{
robotControl?.StopRobot();
}
private void cmbRate_SelectedIndexChanged(object sender, EventArgs e)
{
robotControl?.SetSpeedRate(cmbRate.SelectedIndex);
}
public void SendMoveCmd(int CmdIdx,int rate=50)
{
robotControl?.SendMoveCmd(CmdIdx, rate, true);
}
public bool IsSendCmdOk(int cmdIdx)
{
return robotControl?.IsSendCmdOk(cmdIdx)??false;
}
private void 启动程序ToolStripMenuItem_Click(object sender, EventArgs e)
{
robotControl?.PlayProgram();
}
private void 暂停程序ToolStripMenuItem_Click(object sender, EventArgs e)
{
robotControl?.PauseProgram();
}
private void 停止程序ToolStripMenuItem_Click(object sender, EventArgs e)
{
robotControl?.StopProgram();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="toolStripDropDownButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIhSURBVFhHzZfPi05RHIffxZTCSlnZKBayEElTVlbKH6BI
pJSkKFlYzILNEFmIkJWNKAu/kkSykFmNhbIRK6VEatA0NSme53vc6dC8d+773nMnTz3N+c5777mf7j0/
7u01ZC/exLf4DR/jKVwUbuMvfICX8Qzewhl8g+uxMybRi++M6m+8sAH8vRMOop1vjiqxGrfgsqgSn/Ba
apblOj5MzeAiGkjf4Q6U4/g+Ncvi7b2SmnN3wxA+DseDj0dG0d9WRVWQ53gkNWMgvk7NwEfhRTdElY7d
lprd4AU0xwCdXjTnvw1wFu+i68Mu7Ix+AZwNDsxHf+p8yhalX4ADqRlM4FP0uK94A1dgEfoFyHFv8H+u
H9WjMcRKPIz7cTkORdMA91MzOIQeo07hqr0WB6ZpgHyHdIZ4zLGoEl/Qu1OLi4y3zFtX0SZAznz9zOGF
fX6epG63VYeLEuA0eoKDxdFrZ9b53zpaB/Bg1/wcO/yIbj6DMnAAF5Q7qVkMQ+TUBnB/N/G+qLqhNoCc
w8+4KaryLBhAXuAzHImqLI0CbMSfeCGqsjQKICfQ8ZBvNiV4hfl7Zi1OvSn0na8ES3AWx6NqiGu3Y2Jp
VO3Yit5VF7rGrENPqt6O2+C3wzQOPMOOoiEWWorrqNaYk1ENwW4cJsQadHX1XD9oW+EHiR19wCd4CasN
6F/Po9PtO3rOHizCdhzDe+gmZefz+QNf4lWsmUW93m9craw5p/kNxAAAAABJRU5ErkJggg==
</value>
</data>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -30,90 +30,15 @@ namespace TheMachine ...@@ -30,90 +30,15 @@ namespace TheMachine
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.groupInout = new System.Windows.Forms.GroupBox();
this.cb_inoutdebugmode = new System.Windows.Forms.CheckBox();
this.btn_autoinout = new System.Windows.Forms.Button();
this.btnInStore = new System.Windows.Forms.Button();
this.btnOutStore = new System.Windows.Forms.Button();
this.label_size = new System.Windows.Forms.Label(); this.label_size = new System.Windows.Forms.Label();
this.cmbPosition = new System.Windows.Forms.Label(); this.cmbPosition = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.label_verify = new System.Windows.Forms.Label(); this.label_verify = new System.Windows.Forms.Label();
this.cb_fixpos = new System.Windows.Forms.ComboBox(); this.robotPosControl1 = new TheMachine.RobotPosControl();
this.storePosControl1 = new TheMachine.StorePosControl();
this.btn_batchup = new System.Windows.Forms.Button();
this.groupInout.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupInout
//
this.groupInout.Controls.Add(this.cb_inoutdebugmode);
this.groupInout.Controls.Add(this.btn_batchup);
this.groupInout.Controls.Add(this.btn_autoinout);
this.groupInout.Controls.Add(this.btnInStore);
this.groupInout.Controls.Add(this.btnOutStore);
this.groupInout.Location = new System.Drawing.Point(2, 315);
this.groupInout.Name = "groupInout";
this.groupInout.Size = new System.Drawing.Size(257, 210);
this.groupInout.TabIndex = 101;
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
//
// cb_inoutdebugmode
//
this.cb_inoutdebugmode.AutoSize = true;
this.cb_inoutdebugmode.Location = new System.Drawing.Point(6, 20);
this.cb_inoutdebugmode.Name = "cb_inoutdebugmode";
this.cb_inoutdebugmode.Size = new System.Drawing.Size(108, 16);
this.cb_inoutdebugmode.TabIndex = 103;
this.cb_inoutdebugmode.Text = "出入库调试模式";
this.cb_inoutdebugmode.UseVisualStyleBackColor = true;
this.cb_inoutdebugmode.CheckedChanged += new System.EventHandler(this.cb_inoutdebugmode_CheckedChanged);
//
// btn_autoinout
//
this.btn_autoinout.BackColor = System.Drawing.SystemColors.Control;
this.btn_autoinout.Enabled = false;
this.btn_autoinout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_autoinout.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_autoinout.Location = new System.Drawing.Point(6, 162);
this.btn_autoinout.Name = "btn_autoinout";
this.btn_autoinout.Size = new System.Drawing.Size(173, 32);
this.btn_autoinout.TabIndex = 102;
this.btn_autoinout.Text = "自动库位测试";
this.btn_autoinout.UseVisualStyleBackColor = false;
this.btn_autoinout.Click += new System.EventHandler(this.btn_autoinout_Click);
//
// btnInStore
//
this.btnInStore.BackColor = System.Drawing.SystemColors.Control;
this.btnInStore.Enabled = false;
this.btnInStore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInStore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnInStore.Location = new System.Drawing.Point(6, 86);
this.btnInStore.Name = "btnInStore";
this.btnInStore.Size = new System.Drawing.Size(117, 32);
this.btnInStore.TabIndex = 102;
this.btnInStore.Text = "入库测试";
this.btnInStore.UseVisualStyleBackColor = false;
this.btnInStore.Click += new System.EventHandler(this.btnInStore_Click);
//
// btnOutStore
//
this.btnOutStore.BackColor = System.Drawing.SystemColors.Control;
this.btnOutStore.Enabled = false;
this.btnOutStore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOutStore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOutStore.Location = new System.Drawing.Point(6, 124);
this.btnOutStore.Name = "btnOutStore";
this.btnOutStore.Size = new System.Drawing.Size(117, 32);
this.btnOutStore.TabIndex = 101;
this.btnOutStore.Text = "出库测试";
this.btnOutStore.UseVisualStyleBackColor = false;
this.btnOutStore.Click += new System.EventHandler(this.btnOutStore_Click);
//
// label_size // label_size
// //
this.label_size.Location = new System.Drawing.Point(382, 321); this.label_size.Location = new System.Drawing.Point(382, 321);
...@@ -172,77 +97,40 @@ namespace TheMachine ...@@ -172,77 +97,40 @@ namespace TheMachine
this.label_verify.Tag = "not"; this.label_verify.Tag = "not";
this.label_verify.TextAlign = System.Drawing.ContentAlignment.TopRight; this.label_verify.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// cb_fixpos // robotPosControl1
//
this.cb_fixpos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_fixpos.FormattingEnabled = true;
this.cb_fixpos.Location = new System.Drawing.Point(266, 489);
this.cb_fixpos.Name = "cb_fixpos";
this.cb_fixpos.Size = new System.Drawing.Size(121, 20);
this.cb_fixpos.TabIndex = 226;
this.cb_fixpos.Tag = "not";
this.cb_fixpos.SelectedIndexChanged += new System.EventHandler(this.cb_fixpos_SelectedIndexChanged);
//
// storePosControl1
// //
this.storePosControl1.Config = null; this.robotPosControl1.Config = null;
this.storePosControl1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.robotPosControl1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.storePosControl1.Location = new System.Drawing.Point(266, 315); this.robotPosControl1.Location = new System.Drawing.Point(4, 315);
this.storePosControl1.Margin = new System.Windows.Forms.Padding(4); this.robotPosControl1.Margin = new System.Windows.Forms.Padding(4);
this.storePosControl1.Name = "storePosControl1"; this.robotPosControl1.Name = "robotPosControl1";
this.storePosControl1.Size = new System.Drawing.Size(503, 210); this.robotPosControl1.Size = new System.Drawing.Size(957, 243);
this.storePosControl1.TabIndex = 225; this.robotPosControl1.TabIndex = 225;
this.storePosControl1.Tag = ""; this.robotPosControl1.Tag = "not";
//
// btn_batchup
//
this.btn_batchup.BackColor = System.Drawing.SystemColors.Control;
this.btn_batchup.Enabled = false;
this.btn_batchup.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_batchup.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_batchup.Location = new System.Drawing.Point(6, 48);
this.btn_batchup.Name = "btn_batchup";
this.btn_batchup.Size = new System.Drawing.Size(173, 32);
this.btn_batchup.TabIndex = 102;
this.btn_batchup.Text = "上料准备";
this.btn_batchup.UseVisualStyleBackColor = false;
this.btn_batchup.Click += new System.EventHandler(this.btn_batchup_Click);
// //
// uc_boxdebug // uc_boxdebug
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.cb_fixpos);
this.Controls.Add(this.label_verify); this.Controls.Add(this.label_verify);
this.Controls.Add(this.cmbPosition); this.Controls.Add(this.cmbPosition);
this.Controls.Add(this.label_size); this.Controls.Add(this.label_size);
this.Controls.Add(this.storePosControl1); this.Controls.Add(this.robotPosControl1);
this.Controls.Add(this.dataGridView1); this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.groupInout);
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "uc_boxdebug"; this.Name = "uc_boxdebug";
this.Size = new System.Drawing.Size(981, 785); this.Size = new System.Drawing.Size(981, 785);
this.groupInout.ResumeLayout(false);
this.groupInout.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
#endregion #endregion
private System.Windows.Forms.GroupBox groupInout;
private System.Windows.Forms.Button btnInStore;
private System.Windows.Forms.Button btnOutStore;
private System.Windows.Forms.Timer timer1; private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.Label cmbPosition; private System.Windows.Forms.Label cmbPosition;
private System.Windows.Forms.Label label_size; private System.Windows.Forms.Label label_size;
private StorePosControl storePosControl1;
private System.Windows.Forms.CheckBox cb_inoutdebugmode;
private System.Windows.Forms.Button btn_autoinout;
private System.Windows.Forms.Label label_verify; private System.Windows.Forms.Label label_verify;
private System.Windows.Forms.ComboBox cb_fixpos; private RobotPosControl robotPosControl1;
private System.Windows.Forms.Button btn_batchup;
} }
} }
using DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachine.device.Other
{
public partial class MycronicControl : UserControl
{
public MycronicControl()
{
InitializeComponent();
}
private void MycronicControl_Load(object sender, EventArgs e)
{
uc_boxdebug1.Init(RobotManage.MI1Postion);
uc_boxdebug2.Init(RobotManage.MI2Postion);
uc_boxdebug3.Init(RobotManage.CIPostion);
ucurRobot1.Init(RobotManage.Robot_MI1);
ucurRobot2.Init(RobotManage.Robot_MI2);
ucurRobot3.Init(RobotManage.Robot_CI);
}
private void tabPage4_Click(object sender, EventArgs e)
{
}
private void btn_scancameraadjust_Click(object sender, EventArgs e)
{
//CodeLibrary.CodeResourceControl.GetLanguageEvent += Crc_GetLanguageEvent;
CodeLibrary.FrmCodeDecode frm = new CodeLibrary.FrmCodeDecode();
//frm.CurrLanguage = Crc_GetLanguageEvent();
frm.chbZxing.Checked = false;
try
{
frm.ShowDialog();
frm.Dispose();
}
catch { }
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -41,6 +41,7 @@ namespace TheMachine ...@@ -41,6 +41,7 @@ namespace TheMachine
this.button_p1 = new System.Windows.Forms.Button(); this.button_p1 = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.rfidControl1 = new TheMachine.UC.RfidControl(); this.rfidControl1 = new TheMachine.UC.RfidControl();
this.cylinderButton2 = new TheMachine.CylinderButton();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -168,6 +169,7 @@ namespace TheMachine ...@@ -168,6 +169,7 @@ namespace TheMachine
this.panel1.Controls.Add(this.textBox_p3); this.panel1.Controls.Add(this.textBox_p3);
this.panel1.Controls.Add(this.cylinderButton7); this.panel1.Controls.Add(this.cylinderButton7);
this.panel1.Controls.Add(this.button_save); this.panel1.Controls.Add(this.button_save);
this.panel1.Controls.Add(this.cylinderButton2);
this.panel1.Controls.Add(this.cylinderButton1); this.panel1.Controls.Add(this.cylinderButton1);
this.panel1.Controls.Add(this.cylinderButton8); this.panel1.Controls.Add(this.cylinderButton8);
this.panel1.Controls.Add(this.cylinderButton6); this.panel1.Controls.Add(this.cylinderButton6);
...@@ -186,6 +188,21 @@ namespace TheMachine ...@@ -186,6 +188,21 @@ namespace TheMachine
this.rfidControl1.TabIndex = 10; this.rfidControl1.TabIndex = 10;
this.rfidControl1.Visible = false; this.rfidControl1.Visible = false;
// //
// cylinderButton2
//
this.cylinderButton2.BackColor = System.Drawing.Color.White;
this.cylinderButton2.DeviceType = "root";
this.cylinderButton2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cylinderButton2.IO_HIGH = "MI_Reel_Location_Up";
this.cylinderButton2.IO_LOW = "MI_Reel_Location_Down";
this.cylinderButton2.Location = new System.Drawing.Point(624, 445);
this.cylinderButton2.Name = "cylinderButton2";
this.cylinderButton2.Size = new System.Drawing.Size(181, 38);
this.cylinderButton2.TabIndex = 5;
this.cylinderButton2.Tag = "not";
this.cylinderButton2.Text = "MI_Reel_Location_Up";
this.cylinderButton2.UseVisualStyleBackColor = false;
//
// TrayStopControl // TrayStopControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -213,5 +230,6 @@ namespace TheMachine ...@@ -213,5 +230,6 @@ namespace TheMachine
private System.Windows.Forms.Button button_p1; private System.Windows.Forms.Button button_p1;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private UC.RfidControl rfidControl1; private UC.RfidControl rfidControl1;
private CylinderButton cylinderButton2;
} }
} }
...@@ -63,14 +63,14 @@ namespace TheMachine ...@@ -63,14 +63,14 @@ namespace TheMachine
if (int.TryParse(textBox_p3.Text, out int p3)) if (int.TryParse(textBox_p3.Text, out int p3))
{ {
var axis = AxisBean.List[DeviceGroupName][0]; var axis = AxisBean.List[DeviceGroupName][0];
axis.AbsMove(null, p3, RobotManage.Config.AMH_RoboComp_P1_speed); axis.AbsMove(null, p3, RobotManage.Config.AMH_RoboMI1_Comp_P1_speed);
} }
} }
private void button_p1_Click(object sender, EventArgs e) private void button_p1_Click(object sender, EventArgs e)
{ {
var axis = AxisBean.List[DeviceGroupName][0]; var axis = AxisBean.List[DeviceGroupName][0];
axis.AbsMove(null, RobotManage.Config.AMH_RoboComp_P1, RobotManage.Config.AMH_RoboComp_P1_speed); axis.AbsMove(null, RobotManage.Config.AMH_RoboMI1_Comp_P1, RobotManage.Config.AMH_RoboMI1_Comp_P1_speed);
} }
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!