Commit 04115036 刘韬

稳定版

1 个父辈 291289f0
...@@ -70,5 +70,8 @@ namespace OnlineStore.Common ...@@ -70,5 +70,8 @@ namespace OnlineStore.Common
public static MyConfig<string> Runtime_OutStoreReelInfo; public static MyConfig<string> Runtime_OutStoreReelInfo;
public static MyConfig<string> Runtime_Robot_ReelInfo;
public static MyConfig<string> Runtime_Robot_FromPos;
public static MyConfig<string> Runtime_Robot_ToPos;
} }
} }
...@@ -47,8 +47,8 @@ namespace DeviceLibrary ...@@ -47,8 +47,8 @@ namespace DeviceLibrary
{ {
//if (!RobotManage.isRunning) //if (!RobotManage.isRunning)
// ProcessMsg(MsgService.MSList); // ProcessMsg(MsgService.MSList);
if (!string.IsNullOrWhiteSpace(server)) //if (!string.IsNullOrWhiteSpace(server))
SendLineStatus(); // SendLineStatus();
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -313,16 +313,6 @@ namespace DeviceLibrary ...@@ -313,16 +313,6 @@ namespace DeviceLibrary
path = path.Substring(0, path.Length - 1); path = path.Substring(0, path.Length - 1);
return path; return path;
} }
public static void UpdateRobotStatus(string code,RobotStatusE robotStatus,string trayrfid) {
NameValueCollection nameValue = new NameValueCollection();
nameValue.Add("code", code);
nameValue.Add("status", robotStatus.ToString());
nameValue.Add("locInfo", trayrfid);
var data = HttpHelper.Post(GetPostApi("/service/store/robotBox/emptyPosForPutin"), nameValue);
}
} }
public class ResultData public class ResultData
......
using Newtonsoft.Json;
using OnlineStore; using OnlineStore;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using RtTower.WebService.ComTowerApp.Contract;
using RtTower.WebService.SharedService;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.ServiceModel;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml;
namespace DeviceLibrary namespace DeviceLibrary
{ {
...@@ -27,7 +32,7 @@ namespace DeviceLibrary ...@@ -27,7 +32,7 @@ namespace DeviceLibrary
} }
} }
static string server = Setting_Init.Device_Server_Address; static string server = Setting_Init.Device_Server_Address;
static string CID;//= Setting_Init.Device_CID; string CID;//= Setting_Init.Device_CID;
int StoreID = 1; int StoreID = 1;
string StoreName=""; string StoreName="";
...@@ -46,14 +51,28 @@ namespace DeviceLibrary ...@@ -46,14 +51,28 @@ namespace DeviceLibrary
serverConnectTimer.Elapsed += ServerConnectTimer_Elapsed; serverConnectTimer.Elapsed += ServerConnectTimer_Elapsed;
GC.KeepAlive(serverConnectTimer); GC.KeepAlive(serverConnectTimer);
VLog.Info($"server:{server},cid:{CID}"); VLog.Info($"server:{server},cid:{CID}");
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 1073741824;
binding.MaxBufferSize = 1073741824;
binding.MaxBufferPoolSize = 5242880;
binding.AllowCookies = false;
Uri baseAddress = new Uri(Setting_Init.Device_StoreServerURL);
EndpointAddress endpointAddress = new EndpointAddress(baseAddress.ToString());
towerAppWSClient = new MydataWcfServiceTest.ServiceReference2.TowerAppWSClient(binding, endpointAddress);
} }
private void ServerConnectTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) private void ServerConnectTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{ {
try try
{ {
if (!RobotManage.isRunning) if (RobotManage.isRunning)
{
ProcessMsg(VMsg.msg); ProcessMsg(VMsg.msg);
SendLineStatus(); SendLineStatus();
}
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -75,85 +94,45 @@ namespace DeviceLibrary ...@@ -75,85 +94,45 @@ namespace DeviceLibrary
} }
).Where(x=>!string.IsNullOrEmpty(x))); ).Where(x=>!string.IsNullOrEmpty(x)));
} }
public void SendInStoreRequest(string[] codelist, ReelParam reel,bool printlog=false) {
if (RobotManage.InoutDebugMode)
return;
lock (serverclock)
{
var code = ProcessCode(codelist, reel.PlateW, reel.PlateH);
Operation operation = getLineBoxStatus();
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", code }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } };
int retrytimes = 0; public bool SendStoreState(string posid, string barcode, StoreStatus storeStatus)
retry:
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 15000, printlog);
if (RobotManage.isRunning &&( resultOperation==null || operation.seq != resultOperation.seq))
{
Thread.Sleep(1000);
//SendInStoreRequest(codelist, reel, printlog);
retrytimes++;
if (retrytimes <= 3)
goto retry;
}
ResultProcess(resultOperation);
}
}
public bool SendStoreState(string posid, StoreStatus storeStatus)
{ {
lock (serverclock) lock (serverclock)
{ {
Operation operation = getLineBoxStatus(); Operation operation = getLineBoxStatus();
if (!string.IsNullOrEmpty(posid)) if (!string.IsNullOrEmpty(posid))
operation.boxStatus[StoreID].data.Add(ParamDefine.posId, posid); operation.boxStatus[StoreID].data.Add(ParamDefine.posId, posid);
if (!string.IsNullOrEmpty(barcode))
if (storeStatus == StoreStatus.OutStoreEnd ||
storeStatus == StoreStatus.OutStoreBoxEnd ||
storeStatus == StoreStatus.InStoreEnd)
{ {
operation.boxStatus[StoreID].data.Add(ParamDefine.barcode, barcode);
operation.data = new Dictionary<string, string>();
operation.data.Add(ParamDefine.barcode, barcode);
} }
else operation.boxStatus[StoreID].status = (int)storeStatus;
operation.boxStatus[StoreID].status = (int)storeStatus; operation.status = (int)storeStatus;
LogUtil.info(JsonHelper.SerializeObject(operation)); LogUtil.info(JsonHelper.SerializeObject(operation));
if (RobotManage.InoutDebugMode) if (RobotManage.InoutDebugMode)
return true; return true;
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 15000); Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000);
if (resultOperation == null) if (resultOperation == null)
{ {
VLog.Error($"SendStoreState error,posid:{posid}, storeStatus:{storeStatus}"); LogUtil.info($"SendStoreState error,posid:{barcode}, storeStatus:{storeStatus}");
return false; return false;
} }
if (operation.seq != resultOperation.seq) if (operation.seq != resultOperation.seq)
{ {
VLog.Error($"SendStoreState seq error,posid:{posid}, storeStatus:{storeStatus}"); LogUtil.info($"SendStoreState seq error,posid:{barcode}, storeStatus:{storeStatus}");
return false; return false;
} }
VLog.Info($"SendStoreState success,posid:{posid}, storeStatus:{storeStatus}"); LogUtil.info($"SendStoreState success,posid:{barcode}, storeStatus:{storeStatus}");
ResultProcess(resultOperation); ResultProcess(resultOperation);
this.storeStatus = StoreStatus.StoreOnline;
} }
return true; return true;
} }
public string spiltStr = "##";
private string ProcessCode(string[] codeList,int reelw,int reelh)
{
string message = "";
//= 7x12 = CODE
foreach (string str in codeList)
{
string code = str.Replace("\r", "");
code = code.Replace("\n", "");
//根据二维码开头获取固定尺寸
string codeSize = $"{reelw}x{reelh}";
message = message + "=" + "1+0x0-" + codeSize + "=" + code + spiltStr;
}
return message;
}
/// <summary> /// <summary>
/// 获取整个料仓的状态 /// 获取整个料仓的状态
/// </summary> /// </summary>
...@@ -357,7 +336,7 @@ namespace DeviceLibrary ...@@ -357,7 +336,7 @@ namespace DeviceLibrary
//} //}
//else //else
{ {
SendStoreState("", StoreStatus.InStoreError); SendStoreState("","", StoreStatus.InStoreError);
} }
} }
...@@ -440,11 +419,15 @@ namespace DeviceLibrary ...@@ -440,11 +419,15 @@ namespace DeviceLibrary
} }
private static string Addr_cancelPutInTask = "/service/store/cancelPutInTask"; private static string Addr_cancelPutInTask = "/service/store/cancelPutInTask";
public string cancelPutInTask(string deviceName, string barcode) public string cancelPutInTask(string barcode)
{ {
string msg = ""; string msg = "";
try try
{ {
if (barcode.Count(c => c == '#') == 3)
{
barcode = barcode.Split('#')[1].Substring(1);
}
Dictionary<string, string> paramMap = new Dictionary<string, string>(); Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode); paramMap.Add("barcode", barcode);
...@@ -452,24 +435,24 @@ namespace DeviceLibrary ...@@ -452,24 +435,24 @@ namespace DeviceLibrary
string server = GetAddr(Addr_cancelPutInTask, paramMap); string server = GetAddr(Addr_cancelPutInTask, paramMap);
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Post(server, "");
VLog.Info(deviceName + "cancelPutInTask " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】"); VLog.Info("cancelPutInTask " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
ResultData data = JsonHelper.DeserializeJsonToObject<ResultData>(resultStr); ResultData data = JsonHelper.DeserializeJsonToObject<ResultData>(resultStr);
if (data == null) if (data == null)
{ {
return msg = deviceName + " cancelPutInTask【 " + barcode + "】 没有收到服务器反馈"; return msg = " cancelPutInTask【 " + barcode + "】 没有收到服务器反馈";
} }
else if (data.code.Equals(0).Equals(false)) else if (data.code.Equals(0).Equals(false))
{ {
return msg = deviceName + " cancelPutInTask【 " + barcode + "】 :" + data.msg; return msg = " cancelPutInTask【 " + barcode + "】 :" + data.msg;
} }
return ""; return "";
} }
catch (Exception ex) catch (Exception ex)
{ {
VLog.Error(deviceName + " " + ex.ToString()); VLog.Error(" " + ex.ToString());
} }
return msg; return msg;
} }
...@@ -522,5 +505,134 @@ namespace DeviceLibrary ...@@ -522,5 +505,134 @@ namespace DeviceLibrary
path = path.Substring(0, path.Length - 1); path = path.Substring(0, path.Length - 1);
return path; return path;
} }
public bool BeginOutStore(JobInfo jobInfo, VLog vLog)
{
if (!SendCommand(VCmd.GetCarrierInformation, true, out string data, jobInfo.WareNum))
{
vLog.Error(data);
return false;
}
var result = XmlCommandSerializer.DeserializeResult(data);
if (result.Errorcode != 0)
{
vLog.Error(data);
return false;
}
var reelinfo = XmlCommandSerializer.DeserializeCarrierInformation(result.Data);
lock (VStoreCollection.OutStoreReelInfo)
{
VStoreCollection.OutStoreReelInfo[jobInfo.WareNum] = new JobInfo(jobInfo.WareNum, "", reelinfo.Diameter, reelinfo.Height);
Setting_Init.Runtime_OutStoreReelInfo = JsonConvert.SerializeObject(VStoreCollection.OutStoreReelInfo);
}
vLog.Info("出库时获取到料盘数据:" + VStoreCollection.OutStoreReelInfo[jobInfo.WareNum].ToStr());
if (!SendCommand(VCmd.UnloadCarrier, true, out data, jobInfo.WareNum))
{
vLog.Error(data);
return false;
}
result = XmlCommandSerializer.DeserializeResult(data);
if (result.Errorcode != 0)
{
vLog.Error(data);
return false;
}
return true;
}
public bool BeginInStore(string towerid, JobInfo jobInfo, VLog vLog)
{
if (!SendCommand(VCmd.SimulateStartButton, true, out string data, towerid, jobInfo.WareNum))
{
vLog.Error(data);
return false;
}
var result = XmlCommandSerializer.DeserializeResult(data);
if (result.Errorcode != 0)
{
vLog.Error(data);
return false;
}
return true;
}
MydataWcfServiceTest.ServiceReference2.TowerAppWSClient towerAppWSClient;
public bool SendCommand(string command, bool needlog, out string msg, params string[] arg)
{
string errmsg;
try
{
XmlDocument xd = new XmlDocument();
command = string.Format(command, arg);
xd.LoadXml(command);
}
catch (Exception ex)
{
errmsg = "Command format error:\r\n" + ex.ToString();
msg = errmsg;
return false;
}
try
{
if (needlog)
VLog.Info("send: " + command);
//string command = textBox_sendcommand.Text;
try
{
var re = towerAppWSClient.XmlAction(command);
msg = re.ToString();
return true;
//errmsg = "Request sent successfully.";
}
catch (Exception ex)
{
errmsg = "Failed to send request." + ex;
msg = errmsg;
return false;
}
}
catch (Exception ex)
{
errmsg = "Error: " + ex.ToString();
msg = errmsg;
}
return false;
}
/*
10001 UnknownTower
10002 no Towers to list
10003 no ProductionSite to list
10010 no Articles to list
10011 Article not found
10012 Article aready exists
10013 Article not deleted
10020 no Carriers to list
10021 Carrier not found
10022 Carrier alredy exists
10023 Carrier already in Tower
10041 JobList not found
10042 JobList creation Error
10043 Joblist creation Warning
*/
public TowerDetailInformation GetTowerDetailInformation(string CID)
{
if (!SendCommand(VCmd.GetTowerInformation, false, out string data, CID))
{
VLog.Error(data);
return null;
}
var result = XmlCommandSerializer.DeserializeResult(data);
if (result.Errorcode != 0)
{
VLog.Error(data);
return null;
}
return XmlCommandSerializer.DeserializeTowerDetailInformation(result.Data);
}
} }
} }
\ No newline at end of file \ No newline at end of file
using OnlineStore; using OnlineStore;
using RemoteSheardObject;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.ServiceModel; using System.ServiceModel;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
...@@ -12,7 +14,7 @@ namespace DeviceLibrary ...@@ -12,7 +14,7 @@ namespace DeviceLibrary
{ {
public class VStore public class VStore
{ {
VServerComm ServerCM; public VServerComm ServerCM;
public VLog VLog; public VLog VLog;
VStoreCollection vc; VStoreCollection vc;
MsgService Msg; MsgService Msg;
...@@ -43,35 +45,48 @@ namespace DeviceLibrary ...@@ -43,35 +45,48 @@ namespace DeviceLibrary
VLog.Info(sender+"出库指令信息:" + e.ToStr()); VLog.Info(sender+"出库指令信息:" + e.ToStr());
OutStoreJobList.Enqueue(e.Clone()); OutStoreJobList.Enqueue(e.Clone());
//MI.DeviceList[TowerList.List[CurrentOutJobInfo.CID].DeviceGroupName].EnqueueOutStore(CurrentOutJobInfo); //MI.DeviceList[TowerList.List[CurrentOutJobInfo.CID].DeviceGroupName].EnqueueOutStore(CurrentOutJobInfo);
vc.BeginOutStore(e.Clone(), VLog);
} }
public RTStoreStatus RTStoreStatus = RTStoreStatus.Offline; public RTStoreStatus RTStoreStatus = RTStoreStatus.Offline;
DateTime LastStatusTime = DateTime.Now;
internal void VTowerProcess() { internal void VTowerProcess() {
var ti = vc.GetTowerDetailInformation(CID); var ti = ServerCM.GetTowerDetailInformation(CID);
if (ti != null) if (ti != null)
{ {
ServerCM.Temperature = ti.Temperature; ServerCM.Temperature = ti.Temperature;
ServerCM.Humidity = ti.Humidity * 100; ServerCM.Humidity = ti.Humidity;
if (ti.StatusCode == 26) if (ti.StatusCode == 26)
{ {
ServerCM.storeStatus = StoreStatus.StoreOnline; ServerCM.storeStatus = StoreStatus.StoreOnline;
if (RTStoreStatus != RTStoreStatus.LockToInStore) if (RTStoreStatus != RTStoreStatus.LockToInStore)
{ {
if (RTStoreStatus != RTStoreStatus.Ready) if (RTStoreStatus != RTStoreStatus.Ready)
VLog.Info("料仓已空闲"); VLog.Info("料仓已空闲");
RTStoreStatus = RTStoreStatus.Ready; RTStoreStatus = RTStoreStatus.Ready;
if (OutStoreJobList.Count > 0)
{
if (OutStoreJobList.Dequeue(out JobInfo jobInfo))
{
RTStoreStatus = RTStoreStatus.LockToInStore;
if (!ServerCM.BeginOutStore(jobInfo.Clone(), VLog)) {
RTStoreStatus = RTStoreStatus.Ready;
}
CurrentTerminalReelID = jobInfo.WareNum;
}
}
if (InStoreJobInfo != null) if (InStoreJobInfo != null)
{ {
VLog.Info("入库成功:" + InStoreJobInfo.ToStr()); VLog.Info("入库成功:" + InStoreJobInfo.ToStr());
string[] substrings = InStoreJobInfo.WareNum.Split('#');
string secondSubstring = substrings[1].Substring(1);
InStoreEnd(secondSubstring);
InStoreJobInfo = null; InStoreJobInfo = null;
} }
} }
else { else
{
Msg.add("料仓为入库锁定状态,请检查舱门口料盘状态", MsgLevel.alarm); Msg.add("料仓为入库锁定状态,请检查舱门口料盘状态", MsgLevel.alarm);
} }
} }
else if (ti.StatusCode == 1031) else if (ti.StatusCode == 1031)
{ {
...@@ -79,21 +94,28 @@ namespace DeviceLibrary ...@@ -79,21 +94,28 @@ namespace DeviceLibrary
if (RTStoreStatus != RTStoreStatus.InStoreExecute) if (RTStoreStatus != RTStoreStatus.InStoreExecute)
VLog.Info("入库执行中"); VLog.Info("入库执行中");
RTStoreStatus = RTStoreStatus.InStoreExecute; RTStoreStatus = RTStoreStatus.InStoreExecute;
InStoreJobInfo = null; //InStoreJobInfo = null;
} }
else if (ti.StatusCode == 1032) else if (ti.StatusCode == 1032)
{ {
if (RTStoreStatus != RTStoreStatus.InStoreReady) if ((DateTime.Now - LastStatusTime).TotalSeconds > 30) {
VLog.Info("物料已在舱口"); RTStoreStatus = RTStoreStatus.InStoreDataTimeOut;
RTStoreStatus = RTStoreStatus.InStoreReady; }
if (InStoreJobInfo != null) if (RTStoreStatus != RTStoreStatus.InStoreReady && InStoreJobInfo != null)
{ {
if (!vc.BeginInStore(CID, InStoreJobInfo,VLog)) { LastStatusTime = DateTime.Now;
Msg.add(crc.GetString("Res0051","无法入库"), MsgLevel.alarm); VLog.Info("物料已在舱口");
RTStoreStatus = RTStoreStatus.InStoreReady;
if (!ServerCM.BeginInStore(CID, InStoreJobInfo, VLog))
{
RTStoreStatus = RTStoreStatus.LockToInStore;
Msg.add(CID + crc.GetString("Res0051", "无法入库"), MsgLevel.alarm);
VLog.Info("入库指令失败:" + InStoreJobInfo.ToStr());
} }
CurrentTerminalReelID = InStoreJobInfo.WareNum;
//Thread.Sleep()
} }
} }
else if (ti.StatusCode == 1040) else if (ti.StatusCode == 1040)
...@@ -106,21 +128,31 @@ namespace DeviceLibrary ...@@ -106,21 +128,31 @@ namespace DeviceLibrary
else if (ti.StatusCode == 1041) else if (ti.StatusCode == 1041)
{ {
if (RTStoreStatus != RTStoreStatus.OutStoreReady) if (RTStoreStatus != RTStoreStatus.OutStoreReady)
{
VLog.Info("出库已完成"); VLog.Info("出库已完成");
OutStoreEnd(CurrentTerminalReelID, CID);
}
RTStoreStatus = RTStoreStatus.OutStoreReady; RTStoreStatus = RTStoreStatus.OutStoreReady;
OutStoreJobList.ClearLastPosid(); OutStoreJobList.ClearLastPosid();
} }
else if (ti.StatusCode == 0) else if (ti.StatusCode == 0 || ti.StatusCode == 18)
{ {
RTStoreStatus = RTStoreStatus.Offline; RTStoreStatus = RTStoreStatus.Offline;
//ServerCM.storeStatus = StoreStatus.InStoreExecute; ServerCM.storeStatus = StoreStatus.None;
}else if (ti.StatusCode == 310117)
{
RTStoreStatus = RTStoreStatus.InStoreError;
ServerCM.storeStatus = StoreStatus.InStoreError;
} }
else if (ti.StatusCode< 10000) else if (ti.StatusCode < 10000)
{ {
RTStoreStatus = RTStoreStatus.Busy; RTStoreStatus = RTStoreStatus.Busy;
ServerCM.storeStatus = StoreStatus.None;
VLog.Info($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}"); VLog.Info($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}");
} }
else else
{ {
VLog.Error($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}"); VLog.Error($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}");
ServerCM.storeStatus = StoreStatus.InTrouble; ServerCM.storeStatus = StoreStatus.InTrouble;
...@@ -133,29 +165,52 @@ namespace DeviceLibrary ...@@ -133,29 +165,52 @@ namespace DeviceLibrary
RTStoreStatus = RTStoreStatus.Offline; RTStoreStatus = RTStoreStatus.Offline;
} }
/* /*
18 offline
26 Ready/Idle 26 Ready/Idle
1031 loading material 1031 loading material
1032 material put into Terminal from outside 1032 material put into Terminal from outside
1040 出库执行中 1040 出库执行中
1041 unloading material 物料已到舱门口 1041 unloading material 物料已到舱门口
1042 material unloaded to Terminal from Tower 物料已取走 1042 material unloaded to Terminal from Tower 物料已取走
6015 Reel already loaded.
3068 初始化中 3068 初始化中
*/ */
} }
volatile JobInfo InStoreJobInfo;
public string GetStateStr()
{
if (RTStoreStatus == RTStoreStatus.OutStoreReady)
return "出库中" + (!string.IsNullOrEmpty(CurrentTerminalReelID)?"SN:" + CurrentTerminalReelID:"");
if (RTStoreStatus == RTStoreStatus.LockToInStore) {
return "等待入库信息";
}
if ( RTStoreStatus == RTStoreStatus.InStoreExecute || RTStoreStatus == RTStoreStatus.InStoreReady)
{
return "入库中" + " Barcode:" + InStoreJobInfo?.WareNum;
}
if (RTStoreStatus == RTStoreStatus.InStoreError)
{
return "入库出错,物料NG";
}
return "空闲中";
}
public volatile JobInfo InStoreJobInfo;
StoreJobList OutStoreJobList; StoreJobList OutStoreJobList;
public void RequestInStore(JobInfo jobInfo) { public void RequestInStore(JobInfo jobInfo) {
InStoreJobInfo = jobInfo.Clone(); InStoreJobInfo = jobInfo.Clone();
//return vc.BeginInStore(CID, jobInfo); //return vc.BeginInStore(CID, jobInfo);
} }
public bool OutStoreEnd(string reelid) { public bool OutStoreEnd(string reelid,string towerid) {
CurrentTerminalReelID = reelid; CurrentTerminalReelID = reelid;
return ServerCM.SendStoreState(reelid, StoreStatus.OutStoreBoxEnd); TheLine.UpdateLocInfo("", CurrentTerminalReelID, TheLine.LineStatusE.BOXDOOR, towerid);
return ServerCM.SendStoreState("", reelid, StoreStatus.OutStoreEnd);
} }
public bool InStoreEnd(string posid) public bool InStoreEnd(string posid)
{ {
return ServerCM.SendStoreState(posid, StoreStatus.InStoreEnd); return ServerCM.SendStoreState("", posid, StoreStatus.InStoreEnd);
} }
} }
public enum RTStoreStatus { public enum RTStoreStatus {
...@@ -163,11 +218,13 @@ namespace DeviceLibrary ...@@ -163,11 +218,13 @@ namespace DeviceLibrary
Ready, Ready,
InStoreReady, InStoreReady,
InStoreExecute, InStoreExecute,
InStoreError,
OutStoreReady, OutStoreReady,
OutMoveExecute, OutMoveExecute,
NGOutReady, NGOutReady,
LockToInStore, LockToInStore,
Busy, Busy,
Error, Error,
InStoreDataTimeOut
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,7 @@ namespace DeviceLibrary ...@@ -19,7 +19,7 @@ namespace DeviceLibrary
public class VStoreCollection public class VStoreCollection
{ {
MydataWcfServiceTest.ServiceReference2.TowerAppWSClient towerAppWSClient;
ServiceHost Host = null; ServiceHost Host = null;
public VLog VLog = new VLog(); public VLog VLog = new VLog();
public string StoreServerURL; public string StoreServerURL;
...@@ -33,15 +33,7 @@ namespace DeviceLibrary ...@@ -33,15 +33,7 @@ namespace DeviceLibrary
if(!string.IsNullOrEmpty(Setting_Init.Runtime_OutStoreReelInfo)) if(!string.IsNullOrEmpty(Setting_Init.Runtime_OutStoreReelInfo))
OutStoreReelInfo = JsonConvert.DeserializeObject<Dictionary<string, JobInfo>>(Setting_Init.Runtime_OutStoreReelInfo); OutStoreReelInfo = JsonConvert.DeserializeObject<Dictionary<string, JobInfo>>(Setting_Init.Runtime_OutStoreReelInfo);
BasicHttpBinding binding = new BasicHttpBinding(); //TowerList.List.Add("123132", new TowerInfo() { TowerID = "13123", TowerName = "asdasd" });
binding.MaxReceivedMessageSize = 1073741824;
binding.MaxBufferSize = 1073741824;
binding.MaxBufferPoolSize = 5242880;
binding.AllowCookies = false;
Uri baseAddress = new Uri(StoreServerURL);
EndpointAddress endpointAddress = new EndpointAddress(baseAddress.ToString());
towerAppWSClient = new MydataWcfServiceTest.ServiceReference2.TowerAppWSClient(binding, endpointAddress);
//TowerList.List.Add("123132", new TowerInfo() { TowerID = "13123", TowerName = "asdasd" });
//TowerList.SaveTowerInfo(); //TowerList.SaveTowerInfo();
TowerList.List.Values.ToList().ForEach(s => TowerList.List.Values.ToList().ForEach(s =>
{ {
...@@ -77,7 +69,7 @@ namespace DeviceLibrary ...@@ -77,7 +69,7 @@ namespace DeviceLibrary
VLog.Error("收到出库信息,但没有找到该料仓id"); VLog.Error("收到出库信息,但没有找到该料仓id");
} }
else else
VStoreList[towerid].OutStoreEnd(reelid); VStoreList[towerid].OutStoreEnd(reelid, towerid);
//VStoreList[towerid].ReelPutOnOutSide(reelid); //VStoreList[towerid].ReelPutOnOutSide(reelid);
break; break;
...@@ -108,125 +100,8 @@ namespace DeviceLibrary ...@@ -108,125 +100,8 @@ namespace DeviceLibrary
VLog.Info("RT料仓退出主循环"); VLog.Info("RT料仓退出主循环");
} }
public bool SendCommand(string command,bool needlog, out string msg,params string[] arg) {
string errmsg;
try
{
XmlDocument xd = new XmlDocument();
command = string.Format(command, arg);
xd.LoadXml(command);
}
catch (Exception ex)
{
errmsg = "Command format error:\r\n" + ex.ToString();
msg = errmsg;
return false;
}
try
{
if (needlog)
VLog.Info("send: " + command);
//string command = textBox_sendcommand.Text;
try
{
var re = towerAppWSClient.XmlAction(command);
msg = re.ToString();
return true;
//errmsg = "Request sent successfully.";
}
catch (Exception ex)
{
errmsg = "Failed to send request."+ ex;
msg = errmsg;
return false;
}
}
catch (Exception ex)
{
errmsg = "Error: " + ex.ToString();
msg = errmsg;
}
return false;
}
/*
10001 UnknownTower
10002 no Towers to list
10003 no ProductionSite to list
10010 no Articles to list
10011 Article not found
10012 Article aready exists
10013 Article not deleted
10020 no Carriers to list
10021 Carrier not found
10022 Carrier alredy exists
10023 Carrier already in Tower
10041 JobList not found
10042 JobList creation Error
10043 Joblist creation Warning
*/
public TowerDetailInformation GetTowerDetailInformation(string CID) {
if (!SendCommand(VCmd.GetTowerInformation,false, out string data, CID))
{
VLog.Error(data);
return null;
}
var result = XmlCommandSerializer.DeserializeResult(data);
if (result.Errorcode != 0) {
VLog.Error(data);
return null;
}
return XmlCommandSerializer.DeserializeTowerDetailInformation(result.Data);
}
public static Dictionary<string, JobInfo> OutStoreReelInfo = new Dictionary<string,JobInfo>(); public static Dictionary<string, JobInfo> OutStoreReelInfo = new Dictionary<string,JobInfo>();
public bool BeginOutStore(JobInfo jobInfo, VLog vLog)
{
if (!SendCommand(VCmd.GetCarrierInformation, true, out string data, jobInfo.WareNum))
{
vLog.Error(data);
return false;
}
var result = XmlCommandSerializer.DeserializeResult(data);
if (result.Errorcode != 0)
{
vLog.Error(data);
return false;
}
var reelinfo = XmlCommandSerializer.DeserializeCarrierInformation(result.Data);
lock (OutStoreReelInfo) {
OutStoreReelInfo[jobInfo.WareNum] = new JobInfo(jobInfo.WareNum,"", reelinfo.Diameter, reelinfo.Height);
Setting_Init.Runtime_OutStoreReelInfo = JsonConvert.SerializeObject(OutStoreReelInfo);
}
vLog.Info("出库时获取到料盘数据:"+ OutStoreReelInfo[jobInfo.WareNum].ToStr());
if (!SendCommand(VCmd.UnloadCarrier,true, out data, jobInfo.WareNum))
{
vLog.Error(data);
return false;
}
result = XmlCommandSerializer.DeserializeResult(data);
if (result.Errorcode != 0)
{
vLog.Error(data);
return false;
}
return true;
}
public bool BeginInStore(string towerid,JobInfo jobInfo,VLog vLog)
{
if (!SendCommand(VCmd.SimulateStartButton, true,out string data, towerid, jobInfo.WareNum))
{
vLog.Error(data);
return false;
}
var result = XmlCommandSerializer.DeserializeResult(data);
if (result.Errorcode != 0)
{
vLog.Error(data);
return false;
}
return true;
}
RtTowerClientService.Service service = new RtTowerClientService.Service(); RtTowerClientService.Service service = new RtTowerClientService.Service();
void StartService() void StartService()
{ {
......
...@@ -21,19 +21,19 @@ namespace DeviceLibrary ...@@ -21,19 +21,19 @@ namespace DeviceLibrary
{ {
lock (jobInfos) lock (jobInfos)
{ {
//if (lastoutpos == jobInfo.WareNum) if (lastoutpos == jobInfo.WareNum)
//{ {
// LogUtil.info($"[{jobname}] 出库任务正在执行:" + jobInfo.ToStr()); LogUtil.info($"[{jobname}] 出库任务正在执行:" + jobInfo.ToStr());
// return; return;
//} }
//var l = jobInfos.ToList().Find((x) => { return x.WareNum == jobInfo.WareNum; }); var l = jobInfos.ToList().Find((x) => { return x.WareNum == jobInfo.WareNum; });
//if (l == null) if (l == null)
//{ {
jobInfos.Enqueue(jobInfo); jobInfos.Enqueue(jobInfo);
LogUtil.info($"[{jobname}] 库任务加入队列:" + jobInfo.ToStr()); LogUtil.info($"[{jobname}] 库任务加入队列:" + jobInfo.ToStr());
//} }
//else else
// LogUtil.info($"[{jobname}] 出库任务已存在队列中:" + jobInfo.ToStr()); LogUtil.info($"[{jobname}] 出库任务已存在队列中:" + jobInfo.ToStr());
} }
} }
public bool Dequeue(out JobInfo jobInfo) public bool Dequeue(out JobInfo jobInfo)
......
...@@ -238,7 +238,6 @@ namespace DeviceLibrary ...@@ -238,7 +238,6 @@ namespace DeviceLibrary
} }
else if (isInSuddenDown) else if (isInSuddenDown)
{ {
//Alarm(AlarmType.SuddenStop);
Msg.add(crc.GetString("Res0176", "急停中"), MsgLevel.alarm); Msg.add(crc.GetString("Res0176", "急停中"), MsgLevel.alarm);
ok = false; ok = false;
} }
...@@ -268,7 +267,6 @@ namespace DeviceLibrary ...@@ -268,7 +267,6 @@ namespace DeviceLibrary
{ {
ok = false; ok = false;
Msg.add(msg, MsgLevel.warning); Msg.add(msg, MsgLevel.warning);
//LogUtil.error(msg);
} }
} }
if (alarmType!=AlarmType.SuddenStop) if (alarmType!=AlarmType.SuddenStop)
...@@ -285,7 +283,6 @@ namespace DeviceLibrary ...@@ -285,7 +283,6 @@ namespace DeviceLibrary
ok = false; ok = false;
LogUtil.error(string.Join(",",HuichuanLibrary.HCBoardManager.GetAxisErrorDetail(y.Config.GetAxisValue()))); LogUtil.error(string.Join(",",HuichuanLibrary.HCBoardManager.GetAxisErrorDetail(y.Config.GetAxisValue())));
} }
}); }); }); });
} }
......
...@@ -67,8 +67,10 @@ namespace DeviceLibrary ...@@ -67,8 +67,10 @@ namespace DeviceLibrary
CIPostion = CSVPositionReader<RobotPosition>.LoadCSVFile(CIPostionFile); CIPostion = CSVPositionReader<RobotPosition>.LoadCSVFile(CIPostionFile);
Robot_MI1 = new URRobotControl(Setting_Init.URRobot_MI1_IP); Robot_MI1 = new URRobotControl(Setting_Init.URRobot_MI1_IP);
Robot_MI1.Name = "R1";
Robot_MI1.SetSpeedRate(Setting_Init.URRobot_MI1_Speed_Rate); Robot_MI1.SetSpeedRate(Setting_Init.URRobot_MI1_Speed_Rate);
Robot_MI2 = new URRobotControl(Setting_Init.URRobot_MI2_IP); Robot_MI2 = new URRobotControl(Setting_Init.URRobot_MI2_IP);
Robot_MI1.Name = "R2";
Robot_MI2.SetSpeedRate(Setting_Init.URRobot_MI2_Speed_Rate); Robot_MI2.SetSpeedRate(Setting_Init.URRobot_MI2_Speed_Rate);
Robot_CI = new URRobotControl(Setting_Init.URRobot_CI_IP); Robot_CI = new URRobotControl(Setting_Init.URRobot_CI_IP);
Robot_CI.SetSpeedRate(Setting_Init.URRobot_CI_Speed_Rate); Robot_CI.SetSpeedRate(Setting_Init.URRobot_CI_Speed_Rate);
......
...@@ -2,6 +2,7 @@ using Newtonsoft.Json; ...@@ -2,6 +2,7 @@ using Newtonsoft.Json;
using OnlineStore; using OnlineStore;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using RemoteSheardObject;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
...@@ -198,7 +199,6 @@ namespace DeviceLibrary ...@@ -198,7 +199,6 @@ namespace DeviceLibrary
if (requestLoadInfo.IsEmpty) if (requestLoadInfo.IsEmpty)
{ {
SetTrayLoadInfo(device.CurrrentRFID, null); SetTrayLoadInfo(device.CurrrentRFID, null);
ServerCommunication.UpdateRobotStatus(requestLoadInfo.LoadParam.WareCode, RobotStatusE.FINISHED, remoteLoad.GroupName);
} }
else { else {
SetTrayLoadInfo(device.CurrrentRFID, requestLoadInfo); SetTrayLoadInfo(device.CurrrentRFID, requestLoadInfo);
...@@ -217,7 +217,6 @@ namespace DeviceLibrary ...@@ -217,7 +217,6 @@ namespace DeviceLibrary
if (requestLoadInfo.IsEmpty) if (requestLoadInfo.IsEmpty)
{ {
SetTrayLoadInfo(device.CurrrentRFID, null); SetTrayLoadInfo(device.CurrrentRFID, null);
ServerCommunication.UpdateRobotStatus(requestLoadInfo.LoadParam.WareCode, RobotStatusE.FINISHED, remoteLoad.GroupName);
} }
else { else {
SetTrayLoadInfo(device.CurrrentRFID, requestLoadInfo); SetTrayLoadInfo(device.CurrrentRFID, requestLoadInfo);
......
using ConfigHelper;
using Newtonsoft.Json;
using OnlineStore; using OnlineStore;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using RemoteSheardObject;
using Robot.UR; using Robot.UR;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -64,6 +67,7 @@ namespace DeviceLibrary ...@@ -64,6 +67,7 @@ namespace DeviceLibrary
public void Stop() public void Stop()
{ {
Robot.StopProgram();
DeviceState = DeviceStateE.Stop; DeviceState = DeviceStateE.Stop;
MoveInfo.log("停止运行"); MoveInfo.log("停止运行");
} }
...@@ -99,10 +103,16 @@ namespace DeviceLibrary ...@@ -99,10 +103,16 @@ namespace DeviceLibrary
//Thread.Sleep(1000); //Thread.Sleep(1000);
return false; return false;
} }
if (!Robot.ClientIsConnected) { Robot.SendCMD("safetymode", 0);
Msg.add(POS_Start + crc.GetString("Res0011","机器人未连接MT,无法操作."), MsgLevel.warning); if (!Robot.CurDashboardReponse.Contains("NORMAL"))
return false; {
Msg.add(POS_Start + "机器人状态异常:" + Robot.CurDashboardReponse,MsgLevel.alarm);
} }
//if (!Robot.ClientIsConnected) {
// Msg.add(POS_Start + crc.GetString("Res0011","机器人未连接MT,无法操作."), MsgLevel.warning);
// Robot.SendCMD("safetymode", 0);
// return false;
//}
return true; return true;
} }
...@@ -125,7 +135,8 @@ namespace DeviceLibrary ...@@ -125,7 +135,8 @@ namespace DeviceLibrary
{ {
case MoveStep.Wait: case MoveStep.Wait:
LogUtil.OutputDebugString("InStoreJobList:" + InStoreJobList.Count.ToString()); LogUtil.OutputDebugString("InStoreJobList:" + InStoreJobList.Count.ToString());
if (InStoreJob!=null) { if (InStoreJob != null)
{
CurrentJobInfo = InStoreJob.Clone(); CurrentJobInfo = InStoreJob.Clone();
InStoreJob = null; InStoreJob = null;
MoveInfo.log("收到物料入库任务:" + CurrentJobInfo.ToStr()); MoveInfo.log("收到物料入库任务:" + CurrentJobInfo.ToStr());
...@@ -135,10 +146,13 @@ namespace DeviceLibrary ...@@ -135,10 +146,13 @@ namespace DeviceLibrary
MoveInfo.MoveParam.PlateH = CurrentJobInfo.plateH; MoveInfo.MoveParam.PlateH = CurrentJobInfo.plateH;
MoveInfo.MoveParam.cid = CurrentJobInfo.CID; MoveInfo.MoveParam.cid = CurrentJobInfo.CID;
MoveInfo.NextMoveStep(MoveStep.MI_01); MoveInfo.NextMoveStep(MoveStep.MI_01);
FromPos = RobotManage.MI1Postion[POS_Start + "_MT"]; FromPos = GetMIPosition(GroupName, POS_Start + "_MT");
var cid = MoveInfo.MoveParam.PosID;//.Split('_')[0]; var cid = MoveInfo.MoveParam.PosID;//.Split('_')[0];
CurrentVStore= VStoreCollection.VStoreList[cid]; CurrentVStore = VStoreCollection.VStoreList[cid];
ToPos = RobotManage.MI1Postion[TowerList.List[cid].PosID]; ToPos = GetMIPosition(GroupName, TowerList.List[cid].PosID);
Setting_Init.Runtime_Robot_ReelInfo = JsonConvert.SerializeObject(MoveInfo.MoveParam);
Setting_Init.Runtime_Robot_FromPos = FromPos.PositionNum;
Setting_Init.Runtime_Robot_ToPos = ToPos.PositionNum;
MoveInfo.log($"开始转移物料:{FromPos.PositionNum}=>{ToPos.PositionNum}"); MoveInfo.log($"开始转移物料:{FromPos.PositionNum}=>{ToPos.PositionNum}");
} }
...@@ -166,9 +180,11 @@ namespace DeviceLibrary ...@@ -166,9 +180,11 @@ namespace DeviceLibrary
TrayManager.TrayRelease(remoteLoad); TrayManager.TrayRelease(remoteLoad);
TrayStop.DeviceList[GroupName].TrayRelease(); TrayStop.DeviceList[GroupName].TrayRelease();
RoboMoveInfo.log("取料完成托盘放行"); RoboMoveInfo.log("取料完成托盘放行");
TheLine.UpdateLocInfo("", remoteLoad.RequestLoadInfo.LoadParam.WareCode, TheLine.LineStatusE.INROBOT, GroupName);
} }
else else
RoboMoveInfo.log("取料完成"); RoboMoveInfo.log("取料完成");
} }
break; break;
case MoveStep.MI_03: case MoveStep.MI_03:
...@@ -187,6 +203,7 @@ namespace DeviceLibrary ...@@ -187,6 +203,7 @@ namespace DeviceLibrary
} }
break; break;
/* 无用环节
case MoveStep.MI_10: case MoveStep.MI_10:
MoveInfo.NextMoveStep(MoveStep.MI_11); MoveInfo.NextMoveStep(MoveStep.MI_11);
Rotate.RelMove(RobotManage.Config.AMH_Route_PoToMM * 90, RobotManage.Config.AMH_Route_PoToMM_speed); Rotate.RelMove(RobotManage.Config.AMH_Route_PoToMM * 90, RobotManage.Config.AMH_Route_PoToMM_speed);
...@@ -211,6 +228,7 @@ namespace DeviceLibrary ...@@ -211,6 +228,7 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.Wait); MoveInfo.NextMoveStep(MoveStep.Wait);
} }
break; break;
*/
case MoveStep.MI_50: case MoveStep.MI_50:
CurrntOutReadyStore = VStoreCollection.VStoreList.Values.ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.OutStoreReady); CurrntOutReadyStore = VStoreCollection.VStoreList.Values.ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.OutStoreReady);
if (CurrntOutReadyStore != null) if (CurrntOutReadyStore != null)
...@@ -223,29 +241,66 @@ namespace DeviceLibrary ...@@ -223,29 +241,66 @@ namespace DeviceLibrary
if (!VStoreCollection.OutStoreReelInfo.ContainsKey(CurrntOutReadyStore.CurrentTerminalReelID)) if (!VStoreCollection.OutStoreReelInfo.ContainsKey(CurrntOutReadyStore.CurrentTerminalReelID))
{ {
MoveInfo.log("当前出库料仓:" + CurrntOutReadyStore.CID + ",没有找到料盘信息:" + CurrntOutReadyStore.CurrentTerminalReelID); MoveInfo.log("当前出库料仓:" + CurrntOutReadyStore.CID + ",没有找到料盘信息:" + CurrntOutReadyStore.CurrentTerminalReelID);
return; var result = TheLine.GetReelSize<ResultData>(CurrntOutReadyStore.CurrentTerminalReelID);
} if (result != null && result.code == 0)
{
CurrentJobInfo = new JobInfo(CurrntOutReadyStore.CurrentTerminalReelID, "", int.Parse(result.data["plateW"]), int.Parse(result.data["plateH"]));
MoveInfo.log("从服务器检索到物料数据:" + CurrentJobInfo.ToStr());
var job = VStoreCollection.OutStoreReelInfo[CurrntOutReadyStore.CurrentTerminalReelID]; }
CurrentJobInfo = job.Clone(); else
return;
}
MoveInfo.log("收到物料出库任务:" + CurrentJobInfo.ToStr()); else
MoveInfo.MoveParam.WareCode = CurrentJobInfo.WareNum; {
MoveInfo.MoveParam.PosID = CurrentJobInfo.PosId; var job = VStoreCollection.OutStoreReelInfo[CurrntOutReadyStore.CurrentTerminalReelID];
MoveInfo.MoveParam.PlateW = CurrentJobInfo.plateW; CurrentJobInfo = job.Clone();
MoveInfo.MoveParam.PlateH = CurrentJobInfo.plateH; }
MoveInfo.MoveParam.cid = CurrntOutReadyStore.CID;
FromPos = RobotManage.MI1Postion[TowerList.List[MoveInfo.MoveParam.cid].PosID];
ToPos = RobotManage.MI1Postion[POS_Start + "_MT"];
MoveInfo.NextMoveStep(MoveStep.MI_51);
MoveInfo.log($"开始转移物料:{FromPos.PositionNum}=>{ToPos.PositionNum}");
}
else {
MoveInfo.log("没有找到,在等待出库的料仓");
MoveInfo.NextMoveStep(MoveStep.Wait);
TrayStop.DeviceList[GroupName].TrayRelease();
} }
else
{
var InStoreError = VStoreCollection.VStoreList.Values.ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.InStoreError);
if (InStoreError != null)
{
var result = TheLine.GetReelSize<ResultData>(InStoreError.CurrentTerminalReelID);
if (result != null && result.code == 0)
{
CurrntOutReadyStore = InStoreError;
InStoreError.ServerCM.cancelPutInTask(InStoreError.CurrentTerminalReelID);
CurrentJobInfo = new JobInfo(InStoreError.CurrentTerminalReelID, "", int.Parse(result.data["plateW"]), int.Parse(result.data["plateH"]));
InStoreError.InStoreJobInfo = null;
MoveInfo.log("从服务器检索到物料数据:" + CurrentJobInfo.ToStr());
MoveInfo.MoveParam.IsNg = true;
MoveInfo.MoveParam.NgMsg = InStoreError.CID + "入库异常";
MoveInfo.log("检测到有料仓入库NG:"+ InStoreError.CID);
}
else
return;
}
else
{
MoveInfo.log("没有找到,在等待出库的料仓");
MoveInfo.NextMoveStep(MoveStep.Wait);
TrayStop.DeviceList[GroupName].TrayRelease();
return;
}
}
MoveInfo.log("收到物料出库任务:" + CurrentJobInfo.ToStr());
MoveInfo.MoveParam.WareCode = CurrentJobInfo.WareNum;
MoveInfo.MoveParam.PosID = CurrentJobInfo.PosId;
MoveInfo.MoveParam.PlateW = CurrentJobInfo.plateW;
MoveInfo.MoveParam.PlateH = CurrentJobInfo.plateH;
MoveInfo.MoveParam.cid = CurrntOutReadyStore.CID;
FromPos = GetMIPosition(GroupName, TowerList.List[MoveInfo.MoveParam.cid].PosID);
ToPos = GetMIPosition(GroupName, POS_Start + "_MT");
Setting_Init.Runtime_Robot_ReelInfo = JsonConvert.SerializeObject(MoveInfo.MoveParam);
Setting_Init.Runtime_Robot_FromPos = FromPos.PositionNum;
Setting_Init.Runtime_Robot_ToPos = ToPos.PositionNum;
MoveInfo.NextMoveStep(MoveStep.MI_51);
MoveInfo.log($"开始转移物料:{FromPos.PositionNum}=>{ToPos.PositionNum}");
break; break;
case MoveStep.MI_51: case MoveStep.MI_51:
MoveInfo.NextMoveStep(MoveStep.MI_52); MoveInfo.NextMoveStep(MoveStep.MI_52);
...@@ -259,27 +314,35 @@ namespace DeviceLibrary ...@@ -259,27 +314,35 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.MI_53); MoveInfo.NextMoveStep(MoveStep.MI_53);
lock (VStoreCollection.OutStoreReelInfo) lock (VStoreCollection.OutStoreReelInfo)
{ {
VStoreCollection.OutStoreReelInfo.Remove(CurrntOutReadyStore.CurrentTerminalReelID); VStoreCollection.OutStoreReelInfo.Remove(MoveInfo.MoveParam.WareCode);
CurrntOutReadyStore.CurrentTerminalReelID = ""; //CurrntOutReadyStore.CurrentTerminalReelID = "";
} }
TheLine.UpdateLocInfo("", MoveInfo.MoveParam.WareCode, TheLine.LineStatusE.INROBOT, GroupName);
MoveInfo.log("机器人已取到料"); MoveInfo.log("机器人已取到料");
} }
break; break;
case MoveStep.MI_53: case MoveStep.MI_53:
MoveInfo.NextMoveStep(MoveStep.MI_54); if (RoboMoveInfo.MoveStep >= MoveStep.MI_44)
break; {
case MoveStep.MI_54: MoveInfo.log("机器人完成放料");
if (RoboMoveInfo.MoveStep == MoveStep.Wait)
{
MoveInfo.log("机器人完成取放料");
RemoteLoad remoteLoad = new RemoteLoad(); RemoteLoad remoteLoad = new RemoteLoad();
remoteLoad.GroupName = "AMH-"+ POS_Start; remoteLoad.GroupName = "AMH-" + POS_Start;
remoteLoad.RequestLoadInfo = new RequestLoadInfo(); remoteLoad.RequestLoadInfo = new RequestLoadInfo();
remoteLoad.RequestLoadInfo.DeviceGroupName = "AMH-ML5-2"; remoteLoad.RequestLoadInfo.DeviceGroupName = "AMH-ML5-2";
remoteLoad.RequestLoadInfo.IsEmpty = false; remoteLoad.RequestLoadInfo.IsEmpty = false;
remoteLoad.RequestLoadInfo.TrayType = TrayTypeE.MTP1.ToString(); remoteLoad.RequestLoadInfo.TrayType = TrayTypeE.MTP1.ToString();
remoteLoad.RequestLoadInfo.LoadParam = MoveInfo.MoveParam.clone();// 填充料盘信息 remoteLoad.RequestLoadInfo.LoadParam = MoveInfo.MoveParam.clone();// 填充料盘信息
TrayManager.TrayRelease(remoteLoad); //这条会自动放行托盘并且写入托盘目的地 TrayManager.TrayRelease(remoteLoad); //这条会自动放行托盘并且写入托盘目的地
TheLine.UpdateLocInfo("", MoveInfo.MoveParam.WareCode, TheLine.LineStatusE.INLINE, CurrrentRFID);
MoveInfo.NextMoveStep(MoveStep.MI_54);
}
break;
case MoveStep.MI_54:
if (RoboMoveInfo.MoveStep == MoveStep.Wait)
{
MoveInfo.log("机器人任务结束");
MoveInfo.NewMove(MoveStep.Wait); MoveInfo.NewMove(MoveStep.Wait);
} }
break; break;
...@@ -308,7 +371,7 @@ namespace DeviceLibrary ...@@ -308,7 +371,7 @@ namespace DeviceLibrary
RoboMoveInfo.log("压紧轴到待机点"); RoboMoveInfo.log("压紧轴到待机点");
break; break;
case MoveStep.MI_02: case MoveStep.MI_02:
if (!Robot.IsMoving()) //if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_03); RoboMoveInfo.NextMoveStep(MoveStep.MI_03);
Robot.SendMoveCmd(FromPos.Take_P5, Setting_Init.URRobot_MI1_Speed_Rate); Robot.SendMoveCmd(FromPos.Take_P5, Setting_Init.URRobot_MI1_Speed_Rate);
...@@ -317,18 +380,18 @@ namespace DeviceLibrary ...@@ -317,18 +380,18 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.MI_03: case MoveStep.MI_03:
if (!Robot.IsMoving()) if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_04); RoboMoveInfo.NextMoveStep(MoveStep.MI_04);
TrayStop.DeviceList[GroupName].Location.ToLow(MoveInfo); TrayStop.DeviceList[GroupName].Location.ToLow(MoveInfo);
Comp.AbsMove(null, DeviceGroup.p3, RobotManage.Config.AMH_RoboMI1_Comp_P2_speed); Comp.AbsMove(null, DeviceGroup.p3, RobotManage.Config.AMH_RoboMI1_Comp_P2_speed);
Comp.BatchAxisStartCheck(IO_Type.MI_Robot_Clamp_Check, IO_VALUE.HIGH); Comp.BatchAxisStartCheck(IO_Type.MI_Robot_Clamp_Check, IO_VALUE.HIGH);
RoboMoveInfo.log("压紧轴都下压"); RoboMoveInfo.log("压紧轴都下压");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500)); //RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
} }
break; break;
case MoveStep.MI_04: case MoveStep.MI_04:
if (!Robot.IsMoving() && !Comp.IsBusy) if (Robot.MoveCmdOk() && !Comp.IsBusy)
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_05); RoboMoveInfo.NextMoveStep(MoveStep.MI_05);
Robot.SendMoveCmd(FromPos.Take_P6, Setting_Init.URRobot_MI1_Speed_Rate); Robot.SendMoveCmd(FromPos.Take_P6, Setting_Init.URRobot_MI1_Speed_Rate);
...@@ -338,25 +401,36 @@ namespace DeviceLibrary ...@@ -338,25 +401,36 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.MI_05: case MoveStep.MI_05:
if (!Robot.IsMoving() && !Comp.IsBusy) if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_06); RoboMoveInfo.NextMoveStep(MoveStep.MI_06);
Comp.AbsMove(null, DeviceGroup.p3, RobotManage.Config.AMH_RoboMI1_Comp_P2_speed);
Comp.BatchAxisStartCheck(IO_Type.MI_Robot_Clamp_Check, IO_VALUE.HIGH);
RoboMoveInfo.log("压紧轴都下压");
//RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
break;
case MoveStep.MI_06:
if (Robot.MoveCmdOk() && !Comp.IsBusy)
{
RoboMoveInfo.log("压紧轴到位脉冲值:" + Comp.GetAclPosition());
RoboMoveInfo.NextMoveStep(MoveStep.MI_07);
Robot.SendMoveCmd(FromPos.Take_P7, Setting_Init.URRobot_MI1_Speed_Rate); Robot.SendMoveCmd(FromPos.Take_P7, Setting_Init.URRobot_MI1_Speed_Rate);
RoboMoveInfo.log("机器人到Take_P7"); RoboMoveInfo.log("机器人到Take_P7");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500)); RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
} }
break; break;
case MoveStep.MI_06: case MoveStep.MI_07:
if (!Robot.IsMoving()) if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_07); RoboMoveInfo.NextMoveStep(MoveStep.MI_08);
Robot.SendMoveCmd(FromPos.P1, Setting_Init.URRobot_MI1_Speed_Rate); Robot.SendMoveCmd(FromPos.P1, Setting_Init.URRobot_MI1_Speed_Rate);
RoboMoveInfo.log("机器人到P1"); RoboMoveInfo.log("机器人到P1");
RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500)); RoboMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
} }
break; break;
case MoveStep.MI_07: case MoveStep.MI_08:
if (!Robot.IsMoving()) if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_40); RoboMoveInfo.NextMoveStep(MoveStep.MI_40);
RoboMoveInfo.log("机器人取料完成"); RoboMoveInfo.log("机器人取料完成");
...@@ -365,7 +439,7 @@ namespace DeviceLibrary ...@@ -365,7 +439,7 @@ namespace DeviceLibrary
break; break;
//放料到缓存位置 //放料到缓存位置
case MoveStep.MI_40: case MoveStep.MI_40:
if (!Robot.IsMoving()) if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_41); RoboMoveInfo.NextMoveStep(MoveStep.MI_41);
Robot.SendMoveCmd(ToPos.Put_P2, Setting_Init.URRobot_MI1_Speed_Rate); Robot.SendMoveCmd(ToPos.Put_P2, Setting_Init.URRobot_MI1_Speed_Rate);
...@@ -374,7 +448,7 @@ namespace DeviceLibrary ...@@ -374,7 +448,7 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.MI_41: case MoveStep.MI_41:
if (!Robot.IsMoving()) if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_42); RoboMoveInfo.NextMoveStep(MoveStep.MI_42);
Comp.AbsMove(RoboMoveInfo, RobotManage.Config.AMH_RoboMI1_Comp_P1, RobotManage.Config.AMH_RoboMI1_Comp_P1_speed); Comp.AbsMove(RoboMoveInfo, RobotManage.Config.AMH_RoboMI1_Comp_P1, RobotManage.Config.AMH_RoboMI1_Comp_P1_speed);
...@@ -386,7 +460,7 @@ namespace DeviceLibrary ...@@ -386,7 +460,7 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.MI_42: case MoveStep.MI_42:
if (!Robot.IsMoving()) if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_43); RoboMoveInfo.NextMoveStep(MoveStep.MI_43);
Robot.SendMoveCmd(ToPos.Put_P4, Setting_Init.URRobot_MI1_Speed_Rate); Robot.SendMoveCmd(ToPos.Put_P4, Setting_Init.URRobot_MI1_Speed_Rate);
...@@ -395,7 +469,7 @@ namespace DeviceLibrary ...@@ -395,7 +469,7 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.MI_43: case MoveStep.MI_43:
if (!Robot.IsMoving()) if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.MI_44); RoboMoveInfo.NextMoveStep(MoveStep.MI_44);
Robot.SendMoveCmd(ToPos.P1, Setting_Init.URRobot_MI1_Speed_Rate); Robot.SendMoveCmd(ToPos.P1, Setting_Init.URRobot_MI1_Speed_Rate);
...@@ -405,7 +479,7 @@ namespace DeviceLibrary ...@@ -405,7 +479,7 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.MI_44: case MoveStep.MI_44:
if (!Robot.IsMoving()) if (Robot.MoveCmdOk())
{ {
RoboMoveInfo.NextMoveStep(MoveStep.Wait); RoboMoveInfo.NextMoveStep(MoveStep.Wait);
RoboMoveInfo.log("放料完成"); RoboMoveInfo.log("放料完成");
...@@ -444,6 +518,7 @@ namespace DeviceLibrary ...@@ -444,6 +518,7 @@ namespace DeviceLibrary
//MoveInfo.log("释放托盘"); //MoveInfo.log("释放托盘");
// MoveInfo.NextMoveStep(MoveStep.TrayStop_LoadProcessed); // MoveInfo.NextMoveStep(MoveStep.TrayStop_LoadProcessed);
} }
bool compdetereel = false;
public void ResetProcess() public void ResetProcess()
{ {
if (CheckWait(MoveInfo)) if (CheckWait(MoveInfo))
...@@ -453,14 +528,21 @@ namespace DeviceLibrary ...@@ -453,14 +528,21 @@ namespace DeviceLibrary
{ {
case MoveStep.Wait: case MoveStep.Wait:
MoveInfo.NextMoveStep(MoveStep.H01_HomeReset); MoveInfo.NextMoveStep(MoveStep.H01_HomeReset);
compdetereel = IOValue(IO_Type.MI_Robot_Clamp_Check).Equals(IO_VALUE.HIGH);
Comp.HomeMove(MoveInfo); Comp.HomeMove(MoveInfo);
break; break;
case MoveStep.H01_HomeReset: case MoveStep.H01_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset); MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
Location.ToLow(MoveInfo); if (IOValue(IO_Type.MI_Robot_Reel_Check).Equals(IO_VALUE.HIGH) || compdetereel)
{
Comp.AbsMove(null, DeviceGroup.p3, RobotManage.Config.AMH_RoboMI1_Comp_P2_speed);
Comp.BatchAxisStartCheck(IO_Type.MI_Robot_Clamp_Check, IO_VALUE.HIGH);
MoveInfo.MoveParam = JsonConvert.DeserializeObject<ReelParam>(Setting_Init.Runtime_Robot_ReelInfo);
FromPos = GetMIPosition(GroupName,Setting_Init.Runtime_Robot_FromPos);
ToPos = GetMIPosition(GroupName, Setting_Init.Runtime_Robot_ToPos);
}
break; break;
case MoveStep.H02_HomeReset: case MoveStep.H02_HomeReset:
if (!Robot.StartRobot()) { if (!Robot.StartRobot()) {
MoveInfo.CanWhileCount--; MoveInfo.CanWhileCount--;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
...@@ -481,29 +563,96 @@ namespace DeviceLibrary ...@@ -481,29 +563,96 @@ namespace DeviceLibrary
MoveInfo.log("Robot.CurCmdReponse:" + Robot.CurCmdReponse); MoveInfo.log("Robot.CurCmdReponse:" + Robot.CurCmdReponse);
} else if (MoveInfo.IsTimeOut(30)) { } else if (MoveInfo.IsTimeOut(30)) {
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(POS_Start + crc.GetString("Res0017","机器人启动失败"), MoveInfo.CanWhileCount <= 0 ? MsgLevel.alarm : MsgLevel.warning)); MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
} }
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(POS_Start + crc.GetString("Res0017", "机器人启动失败"), MoveInfo.CanWhileCount <= 0 ? MsgLevel.alarm : MsgLevel.warning));
break; break;
case MoveStep.H04_HomeReset: case MoveStep.H04_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H05_HomeReset); if (Robot.ClientIsConnected && Robot.CurCmdReponse.Contains("Start Program"))
if (Robot.ClientIsConnected)
{ {
Robot.SendMoveCmd(1, Setting_Init.URRobot_MI1_Speed_Rate); MoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
} }
else if (MoveInfo.IsTimeOut(10)) else if (MoveInfo.IsTimeOut(10))
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(POS_Start + crc.GetString("Res0018","机器人未连接MT"), MoveInfo.CanWhileCount <= 0 ? MsgLevel.alarm : MsgLevel.warning)); MoveInfo.NextMoveStep(MoveStep.H10_HomeReset);
} }
MoveInfo.WaitList.Add(WaitResultInfo.WaitMsg(POS_Start + crc.GetString("Res0018", "机器人未连接MT"), MoveInfo.CanWhileCount <= 0 ? MsgLevel.alarm : MsgLevel.warning));
break; break;
case MoveStep.H05_HomeReset: case MoveStep.H05_HomeReset:
if (!Robot.IsMoving()) MoveInfo.NextMoveStep(MoveStep.H06_HomeReset);
if (string.IsNullOrEmpty(Robot.LastMoveCmd))
{
}
else if (int.TryParse(Robot.LastMoveCmd, out int cmdid))
{
if (cmdid == 1)
{
Robot.SendMoveCmd(1, Setting_Init.URRobot_MI1_Speed_Rate);
}
else {
int nextstep = 1;
int laststep = cmdid % 10;
int prefix = laststep * 10;
if (laststep == 0 || laststep == 2)
nextstep = prefix + 5;
else if (laststep == 1 || laststep == 3)
nextstep = prefix + 4;
Robot.SendMoveCmd(nextstep, Setting_Init.URRobot_MI1_Speed_Rate);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
}
break;
case MoveStep.H06_HomeReset:
//if (Robot.MoveCmdOk())
{
MoveInfo.NextMoveStep(MoveStep.H07_HomeReset);
Robot.SendMoveCmd(1, Setting_Init.URRobot_MI1_Speed_Rate);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
break;
case MoveStep.H07_HomeReset:
if (Robot.MoveCmdOk())
{ {
MoveInfo.EndMove(); MoveInfo.EndMove();
DeviceState = DeviceStateE.Run; DeviceState = DeviceStateE.Run;
} }
break; break;
case MoveStep.H10_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H11_HomeReset);
Robot.SendCMD("safetymode", 0);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H11_HomeReset:
MoveInfo.log("机器人反馈安全模式为:" + Robot.CurDashboardReponse);
if (Robot.CurDashboardReponse.Contains("PROTECTIVE_STOP"))
{
MoveInfo.NextMoveStep(MoveStep.H12_HomeReset);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
}
else if (Robot.CurDashboardReponse.Contains("NORMAL")) {
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
}
else {
Msg.add("机器人状态异常:" + Robot.CurDashboardReponse, MsgLevel.alarm);
}
break;
case MoveStep.H12_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H13_HomeReset);
MoveInfo.log("机器人反馈安全模式为:"+Robot.CurCmdReponse);
Robot.SendCMD("unlock protective stop", 0);
MoveInfo.log("尝试解除机器人保护");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break;
case MoveStep.H13_HomeReset:
if (Robot.CurCmdReponse.Contains("Protective stop releasing")) {
MoveInfo.log("机器人成功解除保护");
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
}
else if (MoveInfo.IsTimeOut(5))
{
MoveInfo.NextMoveStep(MoveStep.H10_HomeReset);
}
break;
} }
} }
...@@ -522,7 +671,7 @@ namespace DeviceLibrary ...@@ -522,7 +671,7 @@ namespace DeviceLibrary
if (reelParam == null) if (reelParam == null)
{ {
//空托盘,判断有没有出库任务 //空托盘,判断有没有出库任务
var sc = VStoreCollection.VStoreList.Values.ToList().Find(vs=>vs.RTStoreStatus==RTStoreStatus.OutStoreReady); var sc = VStoreCollection.VStoreList.Values.ToList().Find(vs=>vs.RTStoreStatus==RTStoreStatus.OutStoreReady || vs.RTStoreStatus == RTStoreStatus.InStoreError);
return (sc != null); return (sc != null);
} }
...@@ -562,5 +711,15 @@ namespace DeviceLibrary ...@@ -562,5 +711,15 @@ namespace DeviceLibrary
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public RobotPosition GetMIPosition(string device, string pos) {
if (device == "mi")
return RobotManage.MI1Postion[pos];
else if (device == "mi")
return RobotManage.MI2Postion[pos];
else
return RobotManage.CIPostion[pos];
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -130,19 +130,21 @@ namespace DeviceLibrary ...@@ -130,19 +130,21 @@ namespace DeviceLibrary
if (IOValue(IO_Type.Ls_B_Tray_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.Ls_B_Tray_Check).Equals(IO_VALUE.HIGH))
{ {
break; break;
}else }
else
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);
LastGoInFail = false; LastGoInFail = false;
}else }
if (IOValue(IO_Type.Ls_A_Front_Check).Equals(IO_VALUE.HIGH)|| Forcetry) else
if (IOValue(IO_Type.Ls_A_Front_Check).Equals(IO_VALUE.HIGH) || Forcetry)
{ {
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_02); LSAMoveInfo.NextMoveStep(MoveStep.SideMove_02);
Location_A.ToLow(LSAMoveInfo); Location_A.ToLow(LSAMoveInfo);
//Location_B.ToLow(LSAMoveInfo); //Location_B.ToLow(LSAMoveInfo);
if (!Forcetry)
IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS); IOMove(IO_Type.Ls_A_BufStop_Fwd, IO_VALUE.HIGH, StopBufDelayMS);
LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); LSAMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
} }
...@@ -211,7 +213,6 @@ namespace DeviceLibrary ...@@ -211,7 +213,6 @@ namespace DeviceLibrary
Line.LineStop("n"); Line.LineStop("n");
Location_A.ToLow(LSAMoveInfo); Location_A.ToLow(LSAMoveInfo);
Location_B.ToLow(LSAMoveInfo); Location_B.ToLow(LSAMoveInfo);
LSBMoveInfo.NextMoveStep(MoveStep.SideMove_01);
break; break;
case MoveStep.SideMove_10: case MoveStep.SideMove_10:
LSAMoveInfo.NextMoveStep(MoveStep.SideMove_01); LSAMoveInfo.NextMoveStep(MoveStep.SideMove_01);
...@@ -380,10 +381,11 @@ namespace DeviceLibrary ...@@ -380,10 +381,11 @@ namespace DeviceLibrary
//IOMove(Ls_A_Stop, IO_VALUE.HIGH, Ls_A_Tray_Check, IO_VALUE.LOW, StopDelayMS); //IOMove(Ls_A_Stop, IO_VALUE.HIGH, Ls_A_Tray_Check, IO_VALUE.LOW, StopDelayMS);
IOMove(Ls_A_Stop, IO_VALUE.HIGH); IOMove(Ls_A_Stop, IO_VALUE.HIGH);
IOMove(Ls_A_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS); IOMove(Ls_A_BufStop_Rwd, IO_VALUE.HIGH, StopBufDelayMS);
Line.LineStop("n");
Minfo.log($"{Ls_A_Stop}阻挡放行"); Minfo.log($"{Ls_A_Stop}阻挡放行");
break; break;
case MoveStep.SideMove_07: case MoveStep.SideMove_07:
if (IOValue(Ls_A_Tray_Check).Equals(IO_VALUE.LOW)) if (IOMonitor.IODebound(Ls_A_Tray_Check,GroupName,IO_VALUE.LOW,1000))// IOValue(Ls_A_Tray_Check).Equals(IO_VALUE.LOW))
{ {
IOMove(Ls_A_Stop, IO_VALUE.LOW); IOMove(Ls_A_Stop, IO_VALUE.LOW);
Minfo.NextMoveStep(MoveStep.SideMove_08); Minfo.NextMoveStep(MoveStep.SideMove_08);
...@@ -453,14 +455,13 @@ namespace DeviceLibrary ...@@ -453,14 +455,13 @@ namespace DeviceLibrary
if (!FwdFree(addr)) if (!FwdFree(addr))
return; return;
Minfo.NextMoveStep(MoveStep.SideMove_53); Minfo.NextMoveStep(MoveStep.SideMove_53);
if (LS_Type != LS_TypeE.NoRfid)
IOMove(Ls_A_Stop, IO_VALUE.HIGH);
Location_a.ToLow(Minfo); Location_a.ToLow(Minfo);
Minfo.log($"顶升下降"); Minfo.log($"顶升下降");
break; break;
case MoveStep.SideMove_53: case MoveStep.SideMove_53:
Minfo.NextMoveStep(MoveStep.SideMove_54); Minfo.NextMoveStep(MoveStep.SideMove_54);
if (LS_Type!= LS_TypeE.NoRfid)
//IOMove(Ls_A_Stop, IO_VALUE.HIGH, Ls_A_Tray_Check, IO_VALUE.LOW, StopDelayMS);
IOMove(Ls_A_Stop, IO_VALUE.HIGH);
break; break;
case MoveStep.SideMove_54: case MoveStep.SideMove_54:
Minfo.NextMoveStep(MoveStep.SideMove_17); Minfo.NextMoveStep(MoveStep.SideMove_17);
......
using Newtonsoft.Json; using Newtonsoft.Json;
using OnlineStore; using OnlineStore;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using RemoteSheardObject;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -311,7 +312,7 @@ namespace DeviceLibrary ...@@ -311,7 +312,7 @@ namespace DeviceLibrary
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); TheLine.UpdateLocInfo("",MoveInfo.MoveParam.WareCode, TheLine.LineStatusE.BOXDOOR, GroupName);
TrayManager.SetToEmpty(CurrrentRFID); TrayManager.SetToEmpty(CurrrentRFID);
break; break;
case MoveStep.TransplantMove_16: case MoveStep.TransplantMove_16:
...@@ -397,6 +398,8 @@ namespace DeviceLibrary ...@@ -397,6 +398,8 @@ namespace DeviceLibrary
MoveInfo.log("释放料仓门, 设置托盘信息"); MoveInfo.log("释放料仓门, 设置托盘信息");
remoteLoad.RequestLoadInfo.IsEmpty = false; remoteLoad.RequestLoadInfo.IsEmpty = false;
TrayManager.SetTrayLoadInfo(CurrrentRFID, remoteLoad.RequestLoadInfo); TrayManager.SetTrayLoadInfo(CurrrentRFID, remoteLoad.RequestLoadInfo);
TheLine.UpdateLocInfo("", MoveInfo.MoveParam.WareCode, TheLine.LineStatusE.INLINE, CurrrentRFID);
//ServerCommunication.UpdateRobotStatus(MoveInfo.MoveParam.WareCode, RobotStatusE.INROBOT, CurrrentRFID); //ServerCommunication.UpdateRobotStatus(MoveInfo.MoveParam.WareCode, RobotStatusE.INROBOT, CurrrentRFID);
break; break;
case MoveStep.TransplantMove_24: case MoveStep.TransplantMove_24:
...@@ -418,6 +421,8 @@ namespace DeviceLibrary ...@@ -418,6 +421,8 @@ namespace DeviceLibrary
IOMove(IO_Type.AMH_Sucker, IO_VALUE.LOW); IOMove(IO_Type.AMH_Sucker, IO_VALUE.LOW);
IOMove(IO_Type.AMH_Sucker_Release, IO_VALUE.HIGH,2000); IOMove(IO_Type.AMH_Sucker_Release, IO_VALUE.HIGH,2000);
ConfigHelper.Config.Set($"Runtime_{GroupName}_IsSucker", false); ConfigHelper.Config.Set($"Runtime_{GroupName}_IsSucker", false);
TheLine.UpdateLocInfo("", MoveInfo.MoveParam.WareCode, TheLine.LineStatusE.BOXDOOR, GroupName);
break; break;
case MoveStep.TransplantMove_27: case MoveStep.TransplantMove_27:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_28); MoveInfo.NextMoveStep(MoveStep.TransplantMove_28);
...@@ -476,6 +481,7 @@ namespace DeviceLibrary ...@@ -476,6 +481,7 @@ namespace DeviceLibrary
IOMove(IO_Type.AMH_Sucker, IO_VALUE.LOW); IOMove(IO_Type.AMH_Sucker, IO_VALUE.LOW);
IOMove(IO_Type.AMH_Sucker_Release, IO_VALUE.HIGH, 2000); IOMove(IO_Type.AMH_Sucker_Release, IO_VALUE.HIGH, 2000);
ConfigHelper.Config.Set($"Runtime_{GroupName}_IsSucker", false); ConfigHelper.Config.Set($"Runtime_{GroupName}_IsSucker", false);
//TheLine.UpdateLocInfo("", MoveInfo2.MoveParam.WareCode, TheLine.LineStatusE.BOXDOOR, GroupName);
break; break;
case MoveStep.TransplantMove_04: case MoveStep.TransplantMove_04:
MoveInfo2.NextMoveStep(MoveStep.TransplantMove_05); MoveInfo2.NextMoveStep(MoveStep.TransplantMove_05);
...@@ -604,5 +610,11 @@ namespace DeviceLibrary ...@@ -604,5 +610,11 @@ namespace DeviceLibrary
{ {
return IOValue(IO_Type.AMH_Front_Check).Equals(IO_VALUE.LOW); return IOValue(IO_Type.AMH_Front_Check).Equals(IO_VALUE.LOW);
} }
public void ResetStatus() {
ConfigHelper.Config.Set($"Runtime_{GroupName}_IsSucker", false);
DeviceState = DeviceStateE.HomeReset;
MoveInfo.NewMove(MoveStep.H01_HomeReset);
MoveInfo.log("开始重置");
}
} }
} }
\ No newline at end of file \ No newline at end of file
using OnlineStore; using OnlineStore;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using RemoteSheardObject;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
...@@ -213,8 +214,6 @@ namespace DeviceLibrary ...@@ -213,8 +214,6 @@ namespace DeviceLibrary
remoteLoad.Action = "TrayReady"; remoteLoad.Action = "TrayReady";
remoteLoad.RequestLoadInfo = new RequestLoadInfo(); remoteLoad.RequestLoadInfo = new RequestLoadInfo();
remoteLoad.RequestLoadInfo.TrayType = trayInfo.TrayType.ToString(); remoteLoad.RequestLoadInfo.TrayType = trayInfo.TrayType.ToString();
if (trayInfo.TrayParam != null)
remoteLoad.RequestLoadInfo.LoadParam = trayInfo.TrayParam.clone();
remoteLoad.RequestLoadInfo.IsEmpty = true; remoteLoad.RequestLoadInfo.IsEmpty = true;
MoveInfo.remoteLoad = remoteLoad; MoveInfo.remoteLoad = remoteLoad;
...@@ -222,8 +221,6 @@ namespace DeviceLibrary ...@@ -222,8 +221,6 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.TrayStop_04); MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
SRec.info(crc.GetString("Res0042","托盘挡停"), GroupName, crc.GetString("Res0030","空托盘"), crc.GetString("Res0043","准备接料"), CurrrentRFID); SRec.info(crc.GetString("Res0042","托盘挡停"), GroupName, crc.GetString("Res0030","空托盘"), crc.GetString("Res0043","准备接料"), CurrrentRFID);
if (trayInfo.TrayParam != null)
ServerCommunication.UpdateRobotStatus(trayInfo.TrayParam.WareCode, RobotStatusE.INROBOT, MoveInfo.MoveParam.RFID);
return; return;
} }
else if (trayInfo.DestinationAddr == DeviceGroup.addr_1 && trayInfo.HasLoad && IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.HIGH)) else if (trayInfo.DestinationAddr == DeviceGroup.addr_1 && trayInfo.HasLoad && IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.HIGH))
...@@ -247,7 +244,7 @@ namespace DeviceLibrary ...@@ -247,7 +244,7 @@ namespace DeviceLibrary
else else
{ {
SRec.info(crc.GetString("Res0042","托盘挡停"), GroupName, crc.GetString("Res0025","载物托盘"), crc.GetString("Res0044","等待物料被接走"), CurrrentRFID, remoteLoad.RequestLoadInfo.LoadParam.WareCode); SRec.info(crc.GetString("Res0042","托盘挡停"), GroupName, crc.GetString("Res0025","载物托盘"), crc.GetString("Res0044","等待物料被接走"), CurrrentRFID, remoteLoad.RequestLoadInfo.LoadParam.WareCode);
MoveInfo.log($"{GroupName} 请求出库成功"); MoveInfo.log($"{GroupName} 请求出库成功"+ remoteLoad.RequestLoadInfo.LoadParam.ToStr());
} }
return; return;
} }
...@@ -393,7 +390,7 @@ namespace DeviceLibrary ...@@ -393,7 +390,7 @@ namespace DeviceLibrary
} }
else if (result == RemoteResult.Timeout) else if (result == RemoteResult.Timeout)
{ {
Debug.WriteLine("Remote IsSafe:False"); Debug.WriteLine("Remote Timeout IsSafe:False");
return false; return false;
} }
else if (RobotManage.mainMachine.IOValue(IO_Type.ML5_DoorSafeCheck).Equals(IO_VALUE.LOW)) else if (RobotManage.mainMachine.IOValue(IO_Type.ML5_DoorSafeCheck).Equals(IO_VALUE.LOW))
...@@ -417,6 +414,11 @@ namespace DeviceLibrary ...@@ -417,6 +414,11 @@ namespace DeviceLibrary
public void TrayRelease() { public void TrayRelease() {
MoveInfo.log("释放托盘"); MoveInfo.log("释放托盘");
MoveInfo.NextMoveStep(MoveStep.TrayStop_LoadProcessed); MoveInfo.NextMoveStep(MoveStep.TrayStop_LoadProcessed);
if (TrayManager.Traylist.ContainsKey(CurrrentRFID) && TrayManager.Traylist[CurrrentRFID].HasLoad)
{
var ri = TrayManager.Traylist[CurrrentRFID].TrayParam;
TheLine.UpdateLocInfo("", ri.WareCode, TheLine.LineStatusE.INLINE, CurrrentRFID);
}
} }
public void ResetProcess() public void ResetProcess()
{ {
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace RemoteSheardObject
{
public class EquipMsgData
{
public string equipName { get; set; }
public int ngCount { get; set; }
public List<EquipMessage> msgList { get; set; }
public int status { get; set; }
}
public class EquipMessage
{
public string msg { get; set; }
public string name { get; set; }
public int status { get; set; }
}
}
using log4net;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Security;
using System.Reflection;
using System.Text;
namespace RemoteSheardObject
{
public class MyWebClient : WebClient
{
private int _timeout;
/// <summary>
/// 超时时间(毫秒)
/// </summary>
public int Timeout
{
get
{
return _timeout;
}
set
{
_timeout = value;
}
}
public MyWebClient()
{
this._timeout = 60000;
}
public MyWebClient(int timeout)
{
this._timeout = timeout;
}
protected override WebRequest GetWebRequest(Uri address)
{
HttpWebRequest result = (HttpWebRequest)base.GetWebRequest(address);
result.Timeout = this._timeout;
return result;
}
}
public class HttpHelper
{
static ILog Log = LogManager.GetLogger("HTTP");
public static bool PingURLIP(string url, int ms = 100)
{
string[] urlArray = url.Split('/');
if (urlArray.Length > 3)
{
string ip = urlArray[2];
Ping pingSender = new Ping();
PingReply reply = pingSender.Send(ip, ms);//第一个参数为ip地址,第二个参数为ping的时间
if (reply.Status == IPStatus.Success)
{
//通
return true;
}
else
{
//不通
return false;
}
}
return true;
}
public static string Post(string url, string paramData, int timeOut = 10000)
{
return Post(url, paramData, Encoding.UTF8, timeOut);
}
public static string Post(string url, string paramData, Encoding encoding, int timeOut = 10000)
{
string result = "";
if (url.ToLower().IndexOf("https", System.StringComparison.Ordinal) > -1)
{
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback((sender, certificate, chain, errors) => { return true; });
}
try
{
using (var wc = new MyWebClient(timeOut))
{
if (string.IsNullOrEmpty(wc.Headers["Content-Type"]))
{
wc.Headers.Add("Content-Type", "application/json;charset=UTF-8");
}
wc.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
wc.Encoding = encoding;
result = wc.UploadString(url, "POST", paramData);
}
//LogUtil.info(result);
}
catch (Exception e)
{
Log.Error("POST ERROR:" + e.ToString()+"\r\n"+ url);
}
return result;
}
public static string Post(string url, NameValueCollection paramData, int timeOut = 10000)
{
string result = "";
if (url.ToLower().IndexOf("https", System.StringComparison.Ordinal) > -1)
{
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback((sender, certificate, chain, errors) => { return true; });
}
try
{
using (var wc = new MyWebClient(timeOut))
{
byte[] buf = wc.UploadValues(url, "POST", paramData);
result = Encoding.UTF8.GetString(buf);
}
//LogUtil.info(result);
}
catch (Exception e)
{
Log.Error("POST ERROR:" + e.ToString() + "\r\n" + url);
}
return result;
}
static object lockpost = new object();
public static T2 Post<T1,T2>(string url, T1 jsonobject, int timeout = 5000, bool printlog = false)
{
string json = "";
try
{
json = JsonConvert.SerializeObject(jsonobject);
string result = Post(url, json, timeout);
T2 op = JsonConvert.DeserializeObject<T2>(result);
if (printlog)
{
Log.Info("Send [" + json + "] Revice [" + result + "]");
}
return op;
}
catch (Exception ex)
{
Log.Error("Post 出错【"+ json + "】:" + ex);
}
return default;
}
public static string Get(string url,bool needlog=true)
{
return Get(url, Encoding.UTF8);
}
public static string Get(string url, Encoding encoding, bool needlog = true, int timeOut = 10000)
{
try
{
Debug.WriteLine("HTTP GET FROM: " + url);
using (var wc = new MyWebClient { Encoding = encoding })
{
var readStream = wc.OpenRead(url);
using (var sr = new StreamReader(readStream, encoding))
{
var result = sr.ReadToEnd();
Debug.WriteLine("receive << " + result);
return result;
}
}
}
catch (Exception e)
{
Log.Error("HTTP GET ERROR:" + e.Message);
}
return "";
}
}
}
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary">
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath> <HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath> <HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
...@@ -83,10 +87,15 @@ ...@@ -83,10 +87,15 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="EquipMsgData.cs" />
<Compile Include="MyWebClient.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RemoteClient.cs" /> <Compile Include="RemoteClient.cs" />
<Compile Include="SLog.cs" /> <Compile Include="SLog.cs" />
<Compile Include="StoreCID.cs" /> <Compile Include="StoreCID.cs" />
<Compile Include="TheLine.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
......
using ConfigHelper;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace RemoteSheardObject
{
public class TheLine
{
public enum LineStatusE {
INLINE,
INROBOT,
BOXDOOR,
FINISHED
}
public static bool UpdateLocInfo(string taskId, string barcode, LineStatusE status, string locInfo)
{
if (barcode.Count(c => c == '#') == 3)
{
barcode = barcode.Split('#')[1].Substring(1);
}
var postData = new Dictionary<string, string>()
{
{"taskId", taskId},
{"barcode", barcode},
{"status", status.ToString()},
{"locInfo", locInfo}
};
return !string.IsNullOrEmpty(SubmitPostData("/service/store/robotBox/updateLocInfo", postData));
}
public static string SubmitPostData(string url, Dictionary<string, string> postData)
{
url = CombineUrl(Config.Get("Device_Server_Address"), url);
//创建WebClient对象
using (var client = new WebClient())
{
//设置提交数据的方式为"application/x-www-form-urlencoded"
client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
try
{
//将POST请求参数字典转换为参数字符串
var postDataString = new StringBuilder();
foreach (var item in postData)
{
if (!string.IsNullOrEmpty(item.Value))
{
postDataString.AppendFormat("{0}={1}&", item.Key, Uri.EscapeDataString(item.Value));
}
}
//去掉最后一个"&"符号
postDataString.Length--;
//将POST请求参数转换为字节数组
byte[] bytes = Encoding.UTF8.GetBytes(postDataString.ToString());
//提交POST请求并获取响应
byte[] response = client.UploadData(url, "POST", bytes);
//将响应转换为字符串并输出
return Encoding.UTF8.GetString(response);
}
catch (Exception ex)
{
// 捕获任何网络异常,并输出错误信息
Console.WriteLine("提交POST请求时发生错误:" + ex.Message);
// 请求失败,返回false
return "";
}
}
}
public static string CombineUrl(string baseUrl, string relativeUrl)
{
if (string.IsNullOrEmpty(baseUrl))
{
return relativeUrl;
}
if (string.IsNullOrEmpty(relativeUrl))
{
return baseUrl;
}
baseUrl = baseUrl.TrimEnd('/');
relativeUrl = relativeUrl.TrimStart('/');
return string.Format("{0}/{1}", baseUrl, relativeUrl);
}
public static T GetReelSize<T>(string barcode)
{
if (barcode.Count(c => c == '#') == 3)
{
barcode = barcode.Split('#')[1].Substring(1);
}
var postData = new Dictionary<string, string>()
{
{"barcode", barcode},
};
var result = SubmitPostData( "/service/store/robotBox/getSize", postData);
if (result != null)
return JsonConvert.DeserializeObject<T>(result);
else
return default;
}
public class ResultData
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public Dictionary<string, string> data { get; set; }
}
}
}
...@@ -29,34 +29,41 @@ namespace TheMachine.device.Other ...@@ -29,34 +29,41 @@ namespace TheMachine.device.Other
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage4 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btn_manualout = new System.Windows.Forms.Button();
this.txt_reelid = new System.Windows.Forms.TextBox();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.ucurRobot1 = new URRobot.UCURRobot();
this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox();
this.ucurRobot2 = new URRobot.UCURRobot();
this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox();
this.ucurRobot3 = new URRobot.UCURRobot(); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tabPage1 = new System.Windows.Forms.TabPage(); this.stateView = new TheMachine.DoubleBufferListView();
this.uc_boxdebug1 = new TheMachine.uc_boxdebug(); this.uc_boxdebug1 = new TheMachine.uc_boxdebug();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.uc_boxdebug2 = new TheMachine.uc_boxdebug(); this.uc_boxdebug2 = new TheMachine.uc_boxdebug();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.uc_boxdebug3 = new TheMachine.uc_boxdebug(); this.uc_boxdebug3 = new TheMachine.uc_boxdebug();
this.txt_reelid = new System.Windows.Forms.TextBox(); this.ucurRobot1 = new URRobot.UCURRobot();
this.btn_manualout = new System.Windows.Forms.Button(); this.ucurRobot2 = new URRobot.UCURRobot();
this.ucurRobot3 = new URRobot.UCURRobot();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage4.SuspendLayout(); this.tabPage4.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabPage5.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// tabControl1 // tabControl1
...@@ -65,6 +72,7 @@ namespace TheMachine.device.Other ...@@ -65,6 +72,7 @@ namespace TheMachine.device.Other
this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage5);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
...@@ -74,10 +82,10 @@ namespace TheMachine.device.Other ...@@ -74,10 +82,10 @@ namespace TheMachine.device.Other
// //
// tabPage4 // tabPage4
// //
this.tabPage4.Controls.Add(this.groupBox2);
this.tabPage4.Controls.Add(this.btn_manualout); this.tabPage4.Controls.Add(this.btn_manualout);
this.tabPage4.Controls.Add(this.txt_reelid); this.tabPage4.Controls.Add(this.txt_reelid);
this.tabPage4.Controls.Add(this.panel1); this.tabPage4.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabPage4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabPage4.Location = new System.Drawing.Point(4, 22); this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4"; this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3); this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
...@@ -87,6 +95,78 @@ namespace TheMachine.device.Other ...@@ -87,6 +95,78 @@ namespace TheMachine.device.Other
this.tabPage4.UseVisualStyleBackColor = true; this.tabPage4.UseVisualStyleBackColor = true;
this.tabPage4.Click += new System.EventHandler(this.tabPage4_Click); this.tabPage4.Click += new System.EventHandler(this.tabPage4_Click);
// //
// groupBox2
//
this.groupBox2.Controls.Add(this.stateView);
this.groupBox2.Location = new System.Drawing.Point(19, 24);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(561, 392);
this.groupBox2.TabIndex = 24;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Tower Status";
//
// btn_manualout
//
this.btn_manualout.Location = new System.Drawing.Point(829, 487);
this.btn_manualout.Name = "btn_manualout";
this.btn_manualout.Size = new System.Drawing.Size(100, 38);
this.btn_manualout.TabIndex = 23;
this.btn_manualout.Text = "reelid出库";
this.btn_manualout.UseVisualStyleBackColor = true;
this.btn_manualout.Click += new System.EventHandler(this.btn_manualout_Click);
//
// txt_reelid
//
this.txt_reelid.Location = new System.Drawing.Point(631, 497);
this.txt_reelid.Name = "txt_reelid";
this.txt_reelid.Size = new System.Drawing.Size(192, 33);
this.txt_reelid.TabIndex = 22;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.uc_boxdebug1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(992, 548);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "MI1 点位";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.uc_boxdebug2);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(992, 548);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "MI2 点位";
this.tabPage2.UseVisualStyleBackColor = true;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.uc_boxdebug3);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(992, 548);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "CI 点位";
this.tabPage3.UseVisualStyleBackColor = true;
//
// tabPage5
//
this.tabPage5.Controls.Add(this.panel1);
this.tabPage5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabPage5.Location = new System.Drawing.Point(4, 22);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
this.tabPage5.Size = new System.Drawing.Size(992, 548);
this.tabPage5.TabIndex = 4;
this.tabPage5.Text = "Robot";
this.tabPage5.UseVisualStyleBackColor = true;
//
// panel1 // panel1
// //
this.panel1.AutoScroll = true; this.panel1.AutoScroll = true;
...@@ -96,7 +176,7 @@ namespace TheMachine.device.Other ...@@ -96,7 +176,7 @@ namespace TheMachine.device.Other
this.panel1.Margin = new System.Windows.Forms.Padding(2); this.panel1.Margin = new System.Windows.Forms.Padding(2);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(986, 224); this.panel1.Size = new System.Drawing.Size(986, 224);
this.panel1.TabIndex = 21; this.panel1.TabIndex = 22;
// //
// flowLayoutPanel1 // flowLayoutPanel1
// //
...@@ -122,14 +202,6 @@ namespace TheMachine.device.Other ...@@ -122,14 +202,6 @@ namespace TheMachine.device.Other
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "MI1"; this.groupBox1.Text = "MI1";
// //
// ucurRobot1
//
this.ucurRobot1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucurRobot1.Location = new System.Drawing.Point(2, 16);
this.ucurRobot1.Name = "ucurRobot1";
this.ucurRobot1.Size = new System.Drawing.Size(306, 197);
this.ucurRobot1.TabIndex = 17;
//
// groupBox3 // groupBox3
// //
this.groupBox3.Controls.Add(this.ucurRobot2); this.groupBox3.Controls.Add(this.ucurRobot2);
...@@ -142,14 +214,6 @@ namespace TheMachine.device.Other ...@@ -142,14 +214,6 @@ namespace TheMachine.device.Other
this.groupBox3.TabStop = false; this.groupBox3.TabStop = false;
this.groupBox3.Text = "MI2"; this.groupBox3.Text = "MI2";
// //
// ucurRobot2
//
this.ucurRobot2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucurRobot2.Location = new System.Drawing.Point(2, 16);
this.ucurRobot2.Name = "ucurRobot2";
this.ucurRobot2.Size = new System.Drawing.Size(306, 197);
this.ucurRobot2.TabIndex = 17;
//
// groupBox4 // groupBox4
// //
this.groupBox4.Controls.Add(this.ucurRobot3); this.groupBox4.Controls.Add(this.ucurRobot3);
...@@ -162,24 +226,24 @@ namespace TheMachine.device.Other ...@@ -162,24 +226,24 @@ namespace TheMachine.device.Other
this.groupBox4.TabStop = false; this.groupBox4.TabStop = false;
this.groupBox4.Text = "CI"; this.groupBox4.Text = "CI";
// //
// ucurRobot3 // timer1
// //
this.ucurRobot3.Dock = System.Windows.Forms.DockStyle.Fill; this.timer1.Enabled = true;
this.ucurRobot3.Location = new System.Drawing.Point(2, 16); this.timer1.Interval = 1000;
this.ucurRobot3.Name = "ucurRobot3"; this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
this.ucurRobot3.Size = new System.Drawing.Size(306, 197);
this.ucurRobot3.TabIndex = 17;
// //
// tabPage1 // stateView
// //
this.tabPage1.Controls.Add(this.uc_boxdebug1); this.stateView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.tabPage1.Location = new System.Drawing.Point(4, 22); this.stateView.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabPage1.Name = "tabPage1"; this.stateView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.stateView.HideSelection = false;
this.tabPage1.Size = new System.Drawing.Size(992, 548); this.stateView.Location = new System.Drawing.Point(3, 29);
this.tabPage1.TabIndex = 0; this.stateView.MultiSelect = false;
this.tabPage1.Text = "MI1 点位"; this.stateView.Name = "stateView";
this.tabPage1.UseVisualStyleBackColor = true; this.stateView.Size = new System.Drawing.Size(555, 360);
this.stateView.TabIndex = 0;
this.stateView.UseCompatibleStateImageBehavior = false;
// //
// uc_boxdebug1 // uc_boxdebug1
// //
...@@ -191,17 +255,6 @@ namespace TheMachine.device.Other ...@@ -191,17 +255,6 @@ namespace TheMachine.device.Other
this.uc_boxdebug1.Size = new System.Drawing.Size(986, 542); this.uc_boxdebug1.Size = new System.Drawing.Size(986, 542);
this.uc_boxdebug1.TabIndex = 0; this.uc_boxdebug1.TabIndex = 0;
// //
// tabPage2
//
this.tabPage2.Controls.Add(this.uc_boxdebug2);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(992, 548);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "MI2 点位";
this.tabPage2.UseVisualStyleBackColor = true;
//
// uc_boxdebug2 // uc_boxdebug2
// //
this.uc_boxdebug2.Config = null; this.uc_boxdebug2.Config = null;
...@@ -212,17 +265,6 @@ namespace TheMachine.device.Other ...@@ -212,17 +265,6 @@ namespace TheMachine.device.Other
this.uc_boxdebug2.Size = new System.Drawing.Size(986, 542); this.uc_boxdebug2.Size = new System.Drawing.Size(986, 542);
this.uc_boxdebug2.TabIndex = 0; this.uc_boxdebug2.TabIndex = 0;
// //
// tabPage3
//
this.tabPage3.Controls.Add(this.uc_boxdebug3);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(992, 548);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "CI 点位";
this.tabPage3.UseVisualStyleBackColor = true;
//
// uc_boxdebug3 // uc_boxdebug3
// //
this.uc_boxdebug3.Config = null; this.uc_boxdebug3.Config = null;
...@@ -233,22 +275,29 @@ namespace TheMachine.device.Other ...@@ -233,22 +275,29 @@ namespace TheMachine.device.Other
this.uc_boxdebug3.Size = new System.Drawing.Size(986, 542); this.uc_boxdebug3.Size = new System.Drawing.Size(986, 542);
this.uc_boxdebug3.TabIndex = 0; this.uc_boxdebug3.TabIndex = 0;
// //
// txt_reelid // ucurRobot1
// //
this.txt_reelid.Location = new System.Drawing.Point(56, 310); this.ucurRobot1.Dock = System.Windows.Forms.DockStyle.Fill;
this.txt_reelid.Name = "txt_reelid"; this.ucurRobot1.Location = new System.Drawing.Point(2, 16);
this.txt_reelid.Size = new System.Drawing.Size(192, 21); this.ucurRobot1.Name = "ucurRobot1";
this.txt_reelid.TabIndex = 22; this.ucurRobot1.Size = new System.Drawing.Size(306, 197);
this.ucurRobot1.TabIndex = 17;
// //
// btn_manualout // ucurRobot2
// //
this.btn_manualout.Location = new System.Drawing.Point(254, 300); this.ucurRobot2.Dock = System.Windows.Forms.DockStyle.Fill;
this.btn_manualout.Name = "btn_manualout"; this.ucurRobot2.Location = new System.Drawing.Point(2, 16);
this.btn_manualout.Size = new System.Drawing.Size(100, 38); this.ucurRobot2.Name = "ucurRobot2";
this.btn_manualout.TabIndex = 23; this.ucurRobot2.Size = new System.Drawing.Size(306, 197);
this.btn_manualout.Text = "reelid出库"; this.ucurRobot2.TabIndex = 17;
this.btn_manualout.UseVisualStyleBackColor = true; //
this.btn_manualout.Click += new System.EventHandler(this.btn_manualout_Click); // ucurRobot3
//
this.ucurRobot3.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucurRobot3.Location = new System.Drawing.Point(2, 16);
this.ucurRobot3.Name = "ucurRobot3";
this.ucurRobot3.Size = new System.Drawing.Size(306, 197);
this.ucurRobot3.TabIndex = 17;
// //
// MycronicControl // MycronicControl
// //
...@@ -260,14 +309,16 @@ namespace TheMachine.device.Other ...@@ -260,14 +309,16 @@ namespace TheMachine.device.Other
this.tabControl1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.tabPage4.ResumeLayout(false); this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout(); this.tabPage4.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tabPage5.ResumeLayout(false);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox3.ResumeLayout(false); this.groupBox3.ResumeLayout(false);
this.groupBox4.ResumeLayout(false); this.groupBox4.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
...@@ -282,6 +333,9 @@ namespace TheMachine.device.Other ...@@ -282,6 +333,9 @@ namespace TheMachine.device.Other
private uc_boxdebug uc_boxdebug2; private uc_boxdebug uc_boxdebug2;
private uc_boxdebug uc_boxdebug3; private uc_boxdebug uc_boxdebug3;
private System.Windows.Forms.TabPage tabPage4; private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.Button btn_manualout;
private System.Windows.Forms.TextBox txt_reelid;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
...@@ -290,7 +344,8 @@ namespace TheMachine.device.Other ...@@ -290,7 +344,8 @@ namespace TheMachine.device.Other
private URRobot.UCURRobot ucurRobot2; private URRobot.UCURRobot ucurRobot2;
private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.GroupBox groupBox4;
private URRobot.UCURRobot ucurRobot3; private URRobot.UCURRobot ucurRobot3;
private System.Windows.Forms.Button btn_manualout; private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txt_reelid; private DoubleBufferListView stateView;
private System.Windows.Forms.Timer timer1;
} }
} }
using DeviceLibrary; using DeviceLibrary;
using OnlineStore;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
...@@ -27,7 +28,36 @@ namespace TheMachine.device.Other ...@@ -27,7 +28,36 @@ namespace TheMachine.device.Other
ucurRobot1.Init(RobotManage.Robot_MI1); ucurRobot1.Init(RobotManage.Robot_MI1);
ucurRobot2.Init(RobotManage.Robot_MI2); ucurRobot2.Init(RobotManage.Robot_MI2);
ucurRobot3.Init(RobotManage.Robot_CI); ucurRobot3.Init(RobotManage.Robot_CI);
#region 状态信息listview初始化
stateView.View = View.Details;
ColumnHeader c1 = new ColumnHeader();
c1.Text = "";
c1.Width = 0;
ColumnHeader c2 = new ColumnHeader();
c2.Text = "Tower ID";
c2.Width = 120;
ColumnHeader c3 = new ColumnHeader();
c3.Text = "Status";
c3.Width = 120;
ColumnHeader c4 = new ColumnHeader();
c4.Text = crc.GetString("Form1_tabc_tabP1_Text", "信息");
c4.Width = 470;
stateView.Columns.Add(c1);
stateView.Columns.Add(c2);
stateView.Columns.Add(c3);
stateView.Columns.Add(c4);
#endregion
crc.LanguageChangeEvent += Crc_LanguageChangeEvent; ;
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
stateView.Columns[1].Text = "Tower ID";
stateView.Columns[2].Text = "Status";
stateView.Columns[3].Text = crc.GetString("Form1_tabc_tabP1_Text", "信息");
} }
private void tabPage4_Click(object sender, EventArgs e) private void tabPage4_Click(object sender, EventArgs e)
...@@ -37,8 +67,18 @@ namespace TheMachine.device.Other ...@@ -37,8 +67,18 @@ namespace TheMachine.device.Other
private void btn_manualout_Click(object sender, EventArgs e) private void btn_manualout_Click(object sender, EventArgs e)
{ {
RobotManage.VStoreCollection.VLog.Info("手动出库:"+ txt_reelid.Text); VStoreCollection.VStoreList.Values.First().VLog.Info("手动出库:"+ txt_reelid.Text);
RobotManage.VStoreCollection.BeginOutStore(new JobInfo(txt_reelid.Text, "", 0, 0), RobotManage.VStoreCollection.VLog); VStoreCollection.VStoreList.Values.First().ServerCM.BeginOutStore(new JobInfo(txt_reelid.Text, "", 0, 0), RobotManage.VStoreCollection.VLog);
}
private void timer1_Tick(object sender, EventArgs e)
{
stateView.Items.Clear();
foreach (var store in VStoreCollection.VStoreList.Values.ToList()) {
ListViewItem lvi = new ListViewItem(new string[] { "", store.CID, store.RTStoreStatus.ToString(), store.GetStateStr() });
stateView.Items.Add(lvi);
}
} }
} }
} }
...@@ -117,4 +117,7 @@ ...@@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </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>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -43,8 +43,9 @@ namespace TheMachine ...@@ -43,8 +43,9 @@ namespace TheMachine
this.cylinderButton1 = new TheMachine.CylinderButton(); this.cylinderButton1 = new TheMachine.CylinderButton();
this.ioControl1 = new TheMachine.IOControl(); this.ioControl1 = new TheMachine.IOControl();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.rfidControl1 = new TheMachine.UC.RfidControl();
this.btn_sucker_release = new System.Windows.Forms.Button(); this.btn_sucker_release = new System.Windows.Forms.Button();
this.rfidControl1 = new TheMachine.UC.RfidControl();
this.btn_Reset = new System.Windows.Forms.Button();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -196,6 +197,7 @@ namespace TheMachine ...@@ -196,6 +197,7 @@ namespace TheMachine
// panel1 // panel1
// //
this.panel1.AutoScroll = true; this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.btn_Reset);
this.panel1.Controls.Add(this.btn_sucker_release); this.panel1.Controls.Add(this.btn_sucker_release);
this.panel1.Controls.Add(this.rfidControl1); this.panel1.Controls.Add(this.rfidControl1);
this.panel1.Controls.Add(this.button_p3); this.panel1.Controls.Add(this.button_p3);
...@@ -217,15 +219,6 @@ namespace TheMachine ...@@ -217,15 +219,6 @@ namespace TheMachine
this.panel1.Size = new System.Drawing.Size(1021, 741); this.panel1.Size = new System.Drawing.Size(1021, 741);
this.panel1.TabIndex = 10; this.panel1.TabIndex = 10;
// //
// rfidControl1
//
this.rfidControl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.rfidControl1.Location = new System.Drawing.Point(547, 129);
this.rfidControl1.Name = "rfidControl1";
this.rfidControl1.Size = new System.Drawing.Size(196, 99);
this.rfidControl1.TabIndex = 10;
this.rfidControl1.Visible = false;
//
// btn_sucker_release // btn_sucker_release
// //
this.btn_sucker_release.BackColor = System.Drawing.Color.White; this.btn_sucker_release.BackColor = System.Drawing.Color.White;
...@@ -238,6 +231,25 @@ namespace TheMachine ...@@ -238,6 +231,25 @@ namespace TheMachine
this.btn_sucker_release.UseVisualStyleBackColor = false; this.btn_sucker_release.UseVisualStyleBackColor = false;
this.btn_sucker_release.Click += new System.EventHandler(this.btn_sucker_release_Click); this.btn_sucker_release.Click += new System.EventHandler(this.btn_sucker_release_Click);
// //
// rfidControl1
//
this.rfidControl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.rfidControl1.Location = new System.Drawing.Point(547, 129);
this.rfidControl1.Name = "rfidControl1";
this.rfidControl1.Size = new System.Drawing.Size(196, 99);
this.rfidControl1.TabIndex = 10;
this.rfidControl1.Visible = false;
//
// btn_Reset
//
this.btn_Reset.Location = new System.Drawing.Point(770, 140);
this.btn_Reset.Name = "btn_Reset";
this.btn_Reset.Size = new System.Drawing.Size(100, 69);
this.btn_Reset.TabIndex = 12;
this.btn_Reset.Text = "Reset";
this.btn_Reset.UseVisualStyleBackColor = true;
this.btn_Reset.Click += new System.EventHandler(this.btn_Reset_Click);
//
// TransplantControl // TransplantControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -269,5 +281,6 @@ namespace TheMachine ...@@ -269,5 +281,6 @@ namespace TheMachine
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private UC.RfidControl rfidControl1; private UC.RfidControl rfidControl1;
private System.Windows.Forms.Button btn_sucker_release; private System.Windows.Forms.Button btn_sucker_release;
private System.Windows.Forms.Button btn_Reset;
} }
} }
...@@ -90,5 +90,10 @@ namespace TheMachine ...@@ -90,5 +90,10 @@ namespace TheMachine
TransplantMove.DeviceList[DeviceGroupName].IOMove(IO_Type.AMH_Sucker, IO_VALUE.LOW); TransplantMove.DeviceList[DeviceGroupName].IOMove(IO_Type.AMH_Sucker, IO_VALUE.LOW);
TransplantMove.DeviceList[DeviceGroupName].IOMove(IO_Type.AMH_Sucker_Release, IO_VALUE.HIGH,2000); TransplantMove.DeviceList[DeviceGroupName].IOMove(IO_Type.AMH_Sucker_Release, IO_VALUE.HIGH,2000);
} }
private void btn_Reset_Click(object sender, EventArgs e)
{
TransplantMove.DeviceList[DeviceGroupName].ResetStatus();
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!