Commit 9afa759d 刘韬

1

1 个父辈 e5817e1c
......@@ -62,6 +62,8 @@ namespace OnlineStore.Common
public static MyConfig<int> URRobot_CI_Speed_Rate = 50;
[MyConfigComment("URRobot_CI_监听端口")]
public static MyConfig<int> URRobot_CI_ListenPort = 31;
[MyConfigComment("VJ点料机串口端口号")]
public static MyConfig<string> VJCounter_COMPORT = "COM5";
......
此文件类型无法预览
......@@ -110,6 +110,7 @@
<Compile Include="DeviceLibrary\RobotMoveHelper.cs" />
<Compile Include="DeviceLibrary\ServerCommunication.cs" />
<Compile Include="DeviceLibrary\AxisBean.cs" />
<Compile Include="DeviceLibrary\VJCounter.cs" />
<Compile Include="theMachine\Common.cs" />
<Compile Include="theMachine\JobList.cs" />
<Compile Include="theMachine\DeviceRunControl.cs" />
......
......@@ -26,7 +26,14 @@ namespace DeviceLibrary
RobotCheck.Elapsed += RobotCheck_Elapsed;
}
/// <summary>
/// 机器人是否可用
/// </summary>
public volatile bool RobotStatus = false;
/// <summary>
/// 机器人急停中
/// </summary>
public volatile bool EMERGENCY_STOP = false;
private void RobotCheck_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
......@@ -50,6 +57,11 @@ namespace DeviceLibrary
robot.log("触发保护性停止,调节负载重量:" + lastWeight);
return;
}
else if (robot.CurDashboardReponse.Contains("EMERGENCY_STOP"))
{
robot.log("机器人急停中");
EMERGENCY_STOP = true;
}
return;
}
......@@ -63,14 +75,18 @@ namespace DeviceLibrary
robot.StopProgram();
}
else if (!robot.ClientIsConnected) {
else if (!robot.ClientIsConnected)
{
RobotStatus = false;
robot.StopProgram();
Thread.Sleep(300);
robot.StopRobot();
}
else
{
RobotStatus = true;
EMERGENCY_STOP = false;
}
uploadStatus();
}
......@@ -137,9 +153,7 @@ namespace DeviceLibrary
RobotCheck.Enabled = false;
}
/// <summary>
/// lb=kg/0.45359237f
/// in=mm/25.4f
/// key=load kg, value = load lb,x,y,z
/// key=load kg, value = load 公斤,x,y,z(米)
/// </summary>
public static Dictionary<int, float[]> LoadRateParam = new Dictionary<int, float[]>() {
{ 0, new float[] { 4.5f, 0, 37 / 1000f, 100 / 1000f } },
......@@ -149,14 +163,5 @@ namespace DeviceLibrary
{ 4, new float[] { 8.5f, 0, 37 / 1000f, 212 / 1000f } },
{ 5, new float[] { 9.5f, 0, 37 / 1000f, 224 / 1000f } }
};
//public static Dictionary<int, float[]> LoadRateParam = new Dictionary<int, float[]>() {
// { 0, new float[] { 4.5f / 0.45359237f, 0, 37/25.4f, 100 / 25.4f } },
// { 1, new float[] { 5.5f / 0.45359237f, 0, 37 / 25.4f, 146 / 25.4f } },
// { 2, new float[] { 6.5f / 0.45359237f, 0, 37 / 25.4f, 174 / 25.4f } },
// { 3, new float[] { 7.5f / 0.45359237f, 0, 37 / 25.4f, 204 / 25.4f } },
// { 4, new float[] { 8.5f / 0.45359237f, 0, 37 / 25.4f, 212 / 25.4f } },
// { 5, new float[] { 9.5f / 0.45359237f, 0, 37 / 25.4f, 224 / 25.4f } }
//};
}
}
\ No newline at end of file
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
public class VJCounter
{
private static int baudRate = 115200;//波特率
private static Parity parity = Parity.None;//校验位
private static int dataBits = 8;//数据位
private static StopBits stopBits = StopBits.One; //停止位
private static SerialPort _serialPort = null;
static string comPortName;
public static bool Connect(string _comport, out string msg) {
msg = "";
try
{
comPortName = _comport;
_serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits);
//_serialPort.RtsEnable = true; //自动请求
//_serialPort.ReadTimeout = 100;//超时
_serialPort.Open();
LogUtil.error("VJCounter: 串口连接成功");
return true;
}catch (Exception ex)
{
msg = ex.ToString();
LogUtil.error("VJCounter: "+ex.ToString());
return false;
}
}
public static bool CheckConnect()
{
if (_serialPort == null)
{
return Connect(comPortName,out _);
}
else if (!_serialPort.IsOpen)
{
_serialPort = null;
return Connect(comPortName, out _);
}
else
return true;
}
public static void SendBarcode(string barcode) {
var b = Encoding.ASCII.GetBytes(barcode + "\n");
_serialPort.Write(b, 0, b.Length);
}
}
}
......@@ -48,6 +48,10 @@ namespace DeviceLibrary
<Command>GetCarrierInformation</Command>
<Parameter>{0}</Parameter>
</XmlCommand>";
public const string GetCarrierList = @"<XmlCommand>
<Command>GetCarrierList</Command>
<Parameter/>
</XmlCommand>";
static VCmd()
{
wslist.Add("GetTowers", @"<XmlCommand>
......
......@@ -589,6 +589,7 @@ namespace DeviceLibrary
}
return true;
}
MydataWcfServiceTest.ServiceReference2.TowerAppWSClient towerAppWSClient;
/// <summary>
/// 存储MyCronic料仓的剩余容量 7X8=1000;7X12=345;13X32=100;
......
......@@ -54,6 +54,8 @@ namespace DeviceLibrary
public volatile bool TerminalError = false;
DateTime LastStatusTime = DateTime.Now;
int LastStatusCode = 0;
public DateTime LastProcessErrorTime = DateTime.Now;
internal void VTowerProcess() {
if (!TowerInfo.Enable) {
ServerCM.storeStatus = StoreStatus.None;
......@@ -71,7 +73,7 @@ namespace DeviceLibrary
if (LastStatusCode != ti.StatusCode)
{
LastStatusCode = ti.StatusCode;
VLog.Info($"RTStoreStatus:{RTStoreStatus},StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}");
VLog.Info($"RTStoreStatus:{RTStoreStatus},StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus},capacity:{ServerCM.capacity}");
}
CurrentTowerStatusText = $"[TI={ti.StatusCode}-{ti.StatusText}]";
ServerCM.Temperature = ti.Temperature;
......@@ -80,15 +82,18 @@ namespace DeviceLibrary
{
Msg.add(crc.GetString("Res0098.70dccffd","温湿度超限"), MsgLevel.alarm);
}
//if (ti.StatusCode == 26 && ti.StatusText != "Ready")
//{
// VLog.Info("料仓已空闲");
//}
//else
if (ti.StatusCode == 26 && ti.StatusText == "Ready")
{
ServerCM.storeStatus = StoreStatus.StoreOnline;
if (RTStoreStatus != RTStoreStatus.LockToInStore && RTStoreStatus != RTStoreStatus.InStoreReady)
if (RTStoreStatus == RTStoreStatus.OutMoveExecute) {
TheLine.emptyOut(CurrentTerminalReelID);
TheLine.UpdateLocInfo("", CurrentTerminalReelID, TheLine.LineStatusE.BOXDOOR_NOREEL, CID);
VLog.Info("检测到料盘空出 reelid:"+ CurrentTerminalReelID);
}
if (RTStoreStatus != RTStoreStatus.LockToInStore && RTStoreStatus != RTStoreStatus.LockToOutStore && RTStoreStatus != RTStoreStatus.InStoreReady)
{
if (RTStoreStatus != RTStoreStatus.Ready)
VLog.Info("料仓已空闲");
......@@ -99,7 +104,7 @@ namespace DeviceLibrary
{
if (OutStoreJobList.Dequeue(out JobInfo jobInfo))
{
RTStoreStatus = RTStoreStatus.LockToInStore;
RTStoreStatus = RTStoreStatus.LockToOutStore;
if (!ServerCM.BeginOutStore(jobInfo.Clone(), VLog))
{
Msg.add(crc.GetString("Res0105.f3331370","发送出库指令失败") + ":" + jobInfo.WareNum, MsgLevel.alarm);
......@@ -122,35 +127,45 @@ namespace DeviceLibrary
}
else if ((DateTime.Now - LastStatusTime).TotalSeconds > 30)
{
TerminalError = true;
if (InStoreJobInfo != null)
CurrentTerminalReelID = InStoreJobInfo.WareNum;
if (RTStoreStatus == RTStoreStatus.InStoreReady)
{
TerminalError = true;//入库超时30秒没有入库
VLog.Error($"入库超时出错,没有执行入库过程,RTStoreStatus={RTStoreStatus}:" + InStoreJobInfo?.ToStr());
CurrentTowerStatusText = crc.GetString("Res0065", "入库错误,没有执行入库过程");
Msg.add($"TerminalError" + crc.GetString("Res0099.42525c5f", "入库超时"), MsgLevel.alarm);
}
else if (RTStoreStatus == RTStoreStatus.LockToInStore)
{
TerminalError = true;//入库超时30秒没有入库
VLog.Error($"入库超时出错,没有检测到料盘,RTStoreStatus={RTStoreStatus}:" + InStoreJobInfo?.ToStr());
CurrentTowerStatusText = crc.GetString("Res0065", "入库错误,没有执行入库过程");
Msg.add($"TerminalError:" + crc.GetString("Res0099.42525c5f", "入库超时"), MsgLevel.alarm);
}
else if (RTStoreStatus == RTStoreStatus.LockToOutStore)
{
VLog.Error($"出库超时出错,没有检测到出库信息,RTStoreStatus={RTStoreStatus}:" + CurrentTerminalReelID);
CurrentTowerStatusText = "出库错误,没有执行出库过程";
Msg.add($"TerminalError:" + "出库超时", MsgLevel.alarm);
}
else
{
VLog.Error($"未知状态超时,RTStoreStatus={RTStoreStatus}:" + InStoreJobInfo?.ToStr());
Msg.add($"TerminalError:" + "料仓状态异常", MsgLevel.warning);
}
Msg.add($"TerminalError" + crc.GetString("Res0099.42525c5f", "入库超时"), MsgLevel.warning);
}
}
else if (ti.StatusCode == 1031)
else if (ti.StatusCode == 1031 || ti.StatusCode == 1030) //分配库位,入库过程
{
ServerCM.storeStatus = StoreStatus.InStoreExecute;
if (RTStoreStatus != RTStoreStatus.InStoreExecute)
VLog.Info("入库执行中");
RTStoreStatus = RTStoreStatus.InStoreExecute;
//InStoreJobInfo = null;
}
else if (ti.StatusCode == 1032)
else if (ti.StatusCode == 1032) //料仓已经检测到料盘
{
if ((DateTime.Now - LastStatusTime).TotalSeconds > 30)
{
......@@ -173,7 +188,7 @@ namespace DeviceLibrary
}
}
else if (ti.StatusCode == 1040)
else if (ti.StatusCode == 1040) //出库过程中
{
ServerCM.storeStatus = StoreStatus.OutMoveExecute;
if (RTStoreStatus != RTStoreStatus.OutMoveExecute)
......@@ -196,7 +211,7 @@ namespace DeviceLibrary
}
else
{
TerminalError = true;
TerminalError = true; //有入库信息的情况下,出现出库状态
VLog.Info("异常出库:" + CurrentTerminalReelID);
}
......@@ -208,9 +223,13 @@ namespace DeviceLibrary
}
else if (ti.StatusCode >= 310000)
{
if (RTStoreStatus!=RTStoreStatus.InStoreError)
LastProcessErrorTime=DateTime.Now.AddSeconds(10);
Msg.add($"StatusCode:{ti.StatusCode},StatusText:{ti.StatusText},OnlineStatus:{ti.OnlineStatus}", MsgLevel.warning);
RTStoreStatus = RTStoreStatus.InStoreError;
ServerCM.storeStatus = StoreStatus.InStoreFaild;
//CurrentTowerStatusText = $"{ti.StatusText}-{ti.OnlineStatus}";
//InStoreJobInfo = null;
}
......@@ -299,25 +318,24 @@ namespace DeviceLibrary
return "Disable";
}
if (RTStoreStatus == RTStoreStatus.OutStoreReady)
return crc.GetString("Res0066","出库中") + (!string.IsNullOrEmpty(CurrentTerminalReelID)?"SN:" + CurrentTerminalReelID:"");
return crc.GetString("Res0066", "出库中") + (!string.IsNullOrEmpty(CurrentTerminalReelID) ? "SN:" + CurrentTerminalReelID : "");
if (RTStoreStatus == RTStoreStatus.LockToInStore)
return crc.GetString("Res0067", "等待入库信息");
if (RTStoreStatus == RTStoreStatus.LockToOutStore)
return "等待出库";
if (RTStoreStatus == RTStoreStatus.InStoreExecute || RTStoreStatus == RTStoreStatus.InStoreReady)
return crc.GetString("Res0068", "入库中") + " Barcode:" + InStoreJobInfo?.WareNum;
if (RTStoreStatus == RTStoreStatus.LockToInStore) {
return crc.GetString("Res0067","等待入库信息");
}
if ( RTStoreStatus == RTStoreStatus.InStoreExecute || RTStoreStatus == RTStoreStatus.InStoreReady)
{
return crc.GetString("Res0068","入库中") + " Barcode:" + InStoreJobInfo?.WareNum;
}
if (RTStoreStatus == RTStoreStatus.InStoreError)
{
return crc.GetString("Res0069","入库出错,物料NG") + " Barcode:" + InStoreJobInfo?.WareNum;
}
return crc.GetString("Res0069", "入库出错,物料NG") + " Barcode:" + InStoreJobInfo?.WareNum;
if (RTStoreStatus == RTStoreStatus.Error)
{
return CurrentTowerStatusText;
}
return crc.GetString("Res0070","空闲中");
return crc.GetString("Res0070", "空闲中");
}
/// <summary>
/// 当前入库任务信息
......@@ -355,7 +373,14 @@ namespace DeviceLibrary
OutStoreReady,
OutMoveExecute,
NGOutReady,
/// <summary>
/// 锁定料仓准备入库
/// </summary>
LockToInStore,
/// <summary>
/// 出库锁定料仓
/// </summary>
LockToOutStore,
Busy,
Error,
InStoreDataTimeOut
......
using log4net;
using MydataWcfServiceTest.ServiceReference2;
using Newtonsoft.Json;
using OnlineStore.Common;
using RemoteSheardObject;
using RtTower.WebService.ComTowerApp.Contract;
using RtTower.WebService.SharedService;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Description;
......@@ -13,6 +16,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using static RemoteSheardObject.TheLine;
namespace DeviceLibrary
{
......@@ -83,6 +87,8 @@ namespace DeviceLibrary
td.Start();
}
bool mstate = false;
DateTime LastQueryCarrierListTime = DateTime.MinValue;
void Run() {
mstate = true;
while (mstate) {
......@@ -103,6 +109,12 @@ namespace DeviceLibrary
MsgService.MSList["RT-" + vs.CID].Show();
}
});
if ((DateTime.Now - LastQueryCarrierListTime).TotalHours > 1)
{
LastQueryCarrierListTime = DateTime.Now;
Task.Run(() => { GetCarrierList(); });
}
}
VLog.Info("RT料仓退出主循环");
}
......@@ -188,6 +200,71 @@ namespace DeviceLibrary
}
VLog.Info("stop service success");
}
public void GetCarrierList()
{
try
{
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());
var towerAppWSClient = new MydataWcfServiceTest.ServiceReference2.TowerAppWSClient(binding, endpointAddress);
VLog.Info("开始查询 CarrierList");
var result = towerAppWSClient.XmlAction(VCmd.GetCarrierList);
VLog.Info("结束查询 CarrierList");
File.WriteAllText("logs\\CarrierList.xml", result.ToString());
towerAppWSClient.Close();
towerAppWSClient = null;
UploadCarrierInformationData();
}
catch (Exception ex)
{
VLog.Error(ex.ToString());
}
}
public void UploadCarrierInformationData()
{
var cril = new List<CarrierInformationData>();
try
{
XmlDocument xml = new XmlDocument();
xml.Load("logs\\CarrierList.xml");
var en = xml.SelectSingleNode("/XmlResult/Errorcode");
if (en.InnerText != "0")
return;
var crl = xml.SelectNodes("/XmlResult/Data/CarrierInformation");
foreach (XmlNode cr in crl)
{
var ci = new CarrierInformationData();
var Depot = cr.SelectSingleNode("Depot");
if (Depot == null)
{
continue;
}
var carrier = cr.SelectSingleNode("Carrier").InnerText;
//var carriers = carrier.Split('#');
//if (carriers.Count()!=4) {
// continue;
//}
ci.carrier = carrier;
//ci.partnumber = cr.SelectSingleNode("Carrier").InnerText;
ci.depot = cr.SelectSingleNode("Depot").InnerText;
ci.diameter = int.Parse(cr.SelectSingleNode("Diameter").InnerText);
ci.height = int.Parse(cr.SelectSingleNode("Height").InnerText);
cril.Add(ci);
}
TheLine.UploadCarrierInformation(cril);
VLog.Info("上传库位信息:" + cril.Count);
}catch (Exception ex)
{
VLog.Error("上传库位信息失败:" + ex);
}
}
}
}
......@@ -93,6 +93,12 @@ namespace DeviceLibrary
msg += crc.GetString("Res0181", "IO板卡初始化失败") + "\n";
}
if (!VJCounter.Connect(Setting_Init.VJCounter_COMPORT, out string msgs)) {
IsLoadOk = false;
msg += "VJ点料机连接失败" + "\n";
LogUtil.error(msg + "," + msgs);
}
DeviceRunControl.AddDevice("SideMove", SideMove.DeviceList.Values.ToList<IDevice>());
DeviceRunControl.AddDevice("TransplantMove", TransplantMove.DeviceList.Values.ToList<IDevice>());
//DeviceRunControl.AddDevice("TrayStop", TrayStop.DeviceList.Values.ToList<IDevice>());
......
......@@ -161,6 +161,7 @@ namespace DeviceLibrary
return !(trayaddrs.Where(t1 => dis(a.Addr, t1) < ts).Count() > 0);
};
//ls3处判断,出库任务数量大于值时治具托盘全部从LS3转移走
//ls3地址=19
if (curaddr1 == 19 && RobotManage.mainMachine?.ServerCM.OutMaterialTaskCount > Setting_Init.Device_LS3_MTP2_OutTaskMaxCount && trayType == TrayTypeE.MTP2)
{
return true;
......
......@@ -37,7 +37,7 @@ namespace DeviceLibrary
public AxisBean Comp;
//public AxisBean Rotate;
URRobotControl Robot;
RobotHelper robotHelper;
public RobotHelper robotHelper;
BufferSlotsManger BufferSlotsManger;
string POS_Start = "MI1";
string robotname = "";
......@@ -160,7 +160,7 @@ namespace DeviceLibrary
return;
}
//判断有无出库任务
var testInStoreError = VStoreCollection.VStoreList.Values.Where(vs=>vs.TowerInfo.DeviceGroupName==GroupName).ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.InStoreError || vs.RTStoreStatus == RTStoreStatus.InStoreDataTimeOut || vs.TerminalError);
var testInStoreError = VStoreCollection.VStoreList.Values.Where(vs => vs.TowerInfo.DeviceGroupName == GroupName).ToList().Find(vs => DateTime.Now > vs.LastProcessErrorTime && (vs.RTStoreStatus == RTStoreStatus.InStoreError || vs.RTStoreStatus == RTStoreStatus.InStoreDataTimeOut || vs.TerminalError));
var hasoutjob = false;
if (testInStoreError != null)
hasoutjob = true;
......@@ -169,7 +169,7 @@ namespace DeviceLibrary
var testOutReadyStore = VStoreCollection.VStoreList.Values.Where(vs => vs.TowerInfo.DeviceGroupName == GroupName).ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.OutStoreReady);
if (testOutReadyStore != null)
hasoutjob = true;
}
}
if (hasoutjob) {
MoveInfo.log("查询到出库任务,开始优先出库");
MoveInfo.NextMoveStep(MoveStep.MI_50);
......@@ -241,7 +241,8 @@ namespace DeviceLibrary
MoveInfo.log("机器人开始放料");
CurrentVStore.RequestInStore(new JobInfo(RoboMoveInfo.MoveParam.WareCode, "", RoboMoveInfo.MoveParam.PlateW, RoboMoveInfo.MoveParam.PlateH));
}
else {
else
{
MoveInfo.log("机器人放料时发现舱门口有料");
}
break;
......@@ -252,7 +253,6 @@ namespace DeviceLibrary
MoveInfo.NewMove(MoveStep.Wait);
}
break;
case MoveStep.MI_50:
var InStoreError = VStoreCollection.VStoreList.Values.Where(vs => vs.TowerInfo.DeviceGroupName == GroupName).ToList().Find(vs => vs.RTStoreStatus == RTStoreStatus.InStoreError || vs.RTStoreStatus == RTStoreStatus.InStoreDataTimeOut || vs.TerminalError);
if (InStoreError != null)
......@@ -268,7 +268,6 @@ namespace DeviceLibrary
CurrentJobInfo.isNG = true;
CurrentJobInfo.NgMsg = InStoreError.CID + "-" + InStoreError.CurrentTowerStatusText;
MoveInfo.log("检测到有料仓入库NG:" + MoveInfo.MoveParam.NgMsg);
}
else
{
......@@ -299,7 +298,6 @@ namespace DeviceLibrary
{
CurrentJobInfo = new JobInfo(CurrntOutReadyStore.CurrentTerminalReelID, "", int.Parse(result.data["plateW"]), int.Parse(result.data["plateH"]));
MoveInfo.log("从服务器检索到物料数据:" + CurrentJobInfo.ToStr());
}
else
return;
......@@ -318,6 +316,7 @@ namespace DeviceLibrary
return;
}
}
CurrntOutReadyStore.LastProcessErrorTime = DateTime.Now.AddSeconds(15);
MoveInfo.log("收到物料出库任务:" + CurrentJobInfo.ToStr());
MoveInfo.MoveParam.WareCode = CurrentJobInfo.WareNum;
MoveInfo.MoveParam.PosID = CurrentJobInfo.PosId;
......@@ -343,11 +342,9 @@ namespace DeviceLibrary
case MoveStep.MI_52:
if (RoboMoveInfo.MoveStep == MoveStep.MI_ReelTacked)
{
MoveInfo.NextMoveStep(MoveStep.MI_53);
lock (VStoreCollection.OutStoreReelInfo)
{
VStoreCollection.OutStoreReelInfo.Remove(MoveInfo.MoveParam.WareCode);
//CurrntOutReadyStore.CurrentTerminalReelID = "";
}
TheLine.UpdateLocInfo("", MoveInfo.MoveParam.WareCode, TheLine.LineStatusE.INROBOT, GroupName);
MoveInfo.log("机器人已取到料");
......@@ -361,14 +358,36 @@ namespace DeviceLibrary
{
MoveInfo.log("机器人抓取NG料后发现夹爪上没有料,流程结束处理");
CurrntOutReadyStore.TerminalError = false;
TrayStop.DeviceList[GroupName].TrayRelease();
RoboMoveInfo.NextMoveStep(MoveStep.Wait);
MoveInfo.NextMoveStep(MoveStep.Wait);
if (!TrayStop.DeviceList[GroupName].IsFree())
{
RemoteLoad remoteLoad = new RemoteLoad();
remoteLoad.Action = "SetTrayRequest";
remoteLoad.GroupName = GroupName;
remoteLoad.RequestLoadInfo = new RequestLoadInfo();
remoteLoad.RequestLoadInfo.TrayType = TrayTypeE.MTP1.ToString();
remoteLoad.RequestLoadInfo.IsEmpty = true;
remoteLoad.RequestLoadInfo.DeviceGroupName = GroupName;
TrayManager.SetTrayRequest(remoteLoad);
}
TheLine.emptyOut(CurrntOutReadyStore.CurrentTerminalReelID);
TheLine.UpdateLocInfo("", CurrntOutReadyStore.CurrentTerminalReelID, TheLine.LineStatusE.BOXDOOR_NOREEL, CurrntOutReadyStore.CID);
MoveInfo.log("检测到夹爪空抓 reelid:" + CurrntOutReadyStore.CurrentTerminalReelID);
return;
}
else if (MoveInfo.MoveParam.IsNg){
if (!MoveInfo.MoveParam.IsNg && IOValue(IO_Type.MI_Robot_Reel_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.MI_Robot_Clamp_Check).Equals(IO_VALUE.LOW))
{
return;
}
else if (MoveInfo.MoveParam.IsNg)
{
CurrntOutReadyStore.ServerCM.cancelPutInTask(CurrntOutReadyStore.CurrentTerminalReelID);
MoveInfo.log("物料NG取消入库:"+ CurrntOutReadyStore.CurrentTerminalReelID);
MoveInfo.log("物料NG取消入库:" + CurrntOutReadyStore.CurrentTerminalReelID);
}
MoveInfo.NextMoveStep(MoveStep.MI_53);
}
break;
case MoveStep.MI_53:
......@@ -750,7 +769,7 @@ namespace DeviceLibrary
if (DeviceState != DeviceStateE.Run)
return false;
if (reelParam==null && MoveInfo.MoveStep >= MoveStep.MI_50)//正在出库中
if (reelParam==null && MoveInfo.MoveStep >= MoveStep.MI_53)//正在出库中
return true;
if (MoveInfo.MoveStep != MoveStep.Wait)
......@@ -774,6 +793,7 @@ namespace DeviceLibrary
//有料托盘,判断目的地料仓是否空闲
if (VStoreCollection.VStoreList[reelParam.SubCID].RTStoreStatus == RTStoreStatus.Ready)
{
//料仓空闲, 锁定料仓准备入库
VStoreCollection.VStoreList[reelParam.SubCID].RTStoreStatus = RTStoreStatus.LockToInStore;
return true;
}
......
......@@ -5,6 +5,7 @@ using RemoteSheardObject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
......@@ -161,7 +162,7 @@ namespace DeviceLibrary
{
MoveInfo.log($"{GroupName} 开始转移物料置料仓,{CurrrentRFID},{MoveInfo.MoveParam.ToStr()}");
MoveInfo.NextMoveStep(MoveStep.TransplantMove_10); // 送达料仓
SRec.info(crc.GetString("Res0024","物料横移"), GroupName, crc.GetString("Res0025","载物托盘"), crc.GetString("Res0026","开始将物料转移至料仓"), CurrrentRFID, MoveInfo.MoveParam.ToStr());
//SRec.info(crc.GetString("Res0024","物料横移"), GroupName, crc.GetString("Res0025","载物托盘"), crc.GetString("Res0026","开始将物料转移至料仓"), CurrrentRFID, MoveInfo.MoveParam.ToStr());
ConfigHelper.Config.Set($"Runtime_{GroupName}_MoveParamJson", JsonConvert.SerializeObject(MoveInfo.MoveParam));
return;
}
......@@ -171,9 +172,20 @@ namespace DeviceLibrary
}
else
{
//查询新库位
MoveInfo.log($"当前需求设备CID:{GroupName}已离线");
var rm = TheLine.Regetposid(trayInfo.TrayParam, trayInfo.TrayType.ToString(), out string msg);
MoveInfo.log($"重新获取库位 msg:{msg},\t {rm.ToStr()}");
RequestLoadInfo RequestLoadInfo = new RequestLoadInfo();
RequestLoadInfo.LoadParam = rm.clone();
RequestLoadInfo.DeviceGroupName = rm.cid;
RequestLoadInfo.TrayType = trayInfo.TrayType.ToString();
RequestLoadInfo.IsEmpty = false;
TrayManager.SetTrayLoadInfo(CurrrentRFID, RequestLoadInfo);
MoveInfo.log($"入库托盘与 {GroupName} 通讯失败,放行托盘,{MoveInfo.MoveParam.ToStr()}");
MoveInfo.NextMoveStep(MoveStep.TransplantMove_04);
SRec.error(crc.GetString("Res0024","物料横移"), GroupName, crc.GetString("Res0025","载物托盘"), crc.GetString("Res0033","料仓当前不可用,放行托盘"), CurrrentRFID, MoveInfo.MoveParam.ToStr());
//SRec.error(crc.GetString("Res0024","物料横移"), GroupName, crc.GetString("Res0025","载物托盘"), crc.GetString("Res0033","料仓当前不可用,放行托盘"), CurrrentRFID, MoveInfo.MoveParam.ToStr());
}
}
......@@ -298,8 +310,8 @@ namespace DeviceLibrary
else if (MoveInfo.IsTimeOut(1)) {
MetrialGetRetry++;
if (MetrialGetRetry > 3) {
Msg.add($"{MoveInfo.Name}取料失败", MsgLevel.alarm);
RobotManage.UserPause($"{MoveInfo.Name}取料失败");
Msg.add($"MT=>{MoveInfo.Name}"+crc.GetString("Res0107.7cfe5c5e","取料失败"), MsgLevel.alarm);
RobotManage.UserPause($"MT=>{MoveInfo.Name}取料失败");
}
MoveInfo.NextMoveStep(MoveStep.TransplantMove_11);
if (MoveInfo.MoveParam.PlateH == 120 && MoveInfo.MoveParam.PlateW == 330
......@@ -387,8 +399,8 @@ namespace DeviceLibrary
{
MetrialGetRetry++;
if (MetrialGetRetry > 3) {
Msg.add($"{MoveInfo.Name}取料失败", MsgLevel.alarm);
RobotManage.UserPause($"{MoveInfo.Name}取料失败");
Msg.add($"{MoveInfo.Name}=>MT"+crc.GetString("Res0107.7cfe5c5e","取料失败"), MsgLevel.alarm);
RobotManage.UserPause($"{MoveInfo.Name}=>MT取料失败");
MetrialGetRetry = 0;
//return;
}
......@@ -438,7 +450,15 @@ namespace DeviceLibrary
Location.ToLow(MoveInfo);
break;
case MoveStep.TransplantMove_28:
MoveInfo.NextMoveStep(MoveStep.TransplantMove_29);
if (IOValue(IO_Type.AMH_Reel_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(MoveStep.TransplantMove_29);
}
else if (MoveInfo2.IsTimeOut(10))
{
Msg.add(MoveInfo2.Name + ":" + crc.GetString("Res0108.eb57e95a", "往托盘放料后没有检测到物料"), MsgLevel.alarm);
MoveInfo2.log("往托盘放料后没有检测到物料");
}
break;
case MoveStep.TransplantMove_29:
if (!canpass())
......@@ -506,10 +526,10 @@ namespace DeviceLibrary
remoteLoad.Action = "DoorRelease";
remoteLoad.Seq = Snowflake.Instance().GetId();
remoteLoad.RequestLoadInfo = new RequestLoadInfo();
remoteLoad.RequestLoadInfo.IsEmpty=false;
remoteLoad.RequestLoadInfo.IsEmpty = false;
remoteLoad.RequestLoadInfo.LoadParam = MoveInfo2.MoveParam.clone();
RemoteService.SendAndWait(GroupName, remoteLoad);
MoveInfo2.log("从线体到料仓移栽结束:"+ MoveInfo2.MoveParam.ToStr());
MoveInfo2.log("从线体到料仓移栽结束:" + MoveInfo2.MoveParam.ToStr());
MoveInfo2.NewMove(MoveStep.Wait);
break;
}
......
......@@ -179,6 +179,13 @@ namespace DeviceLibrary
//托盘直接放行: MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
//托盘处理完放行,全局方法: TrayStop.DeviceList["AMH-MI1"].TrayRelease();
//if (stop && !trayInfo.HasLoad && IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.LOW))
if (MI.DeviceList.ContainsKey(GroupName) && MI.DeviceList[GroupName].robotHelper.EMERGENCY_STOP)
{
MoveInfo.log("检测到机器人急停,托盘放行处理");
MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
return;
}else
if (!trayInfo.HasLoad && IOValue(IO_Type.MI_Reel_Check).Equals(IO_VALUE.LOW))
{
MoveInfo.NextMoveStep(MoveStep.TrayStop_07);
......@@ -198,14 +205,34 @@ namespace DeviceLibrary
Msg.add(crc.GetString("Res0034", "托盘没有检测到物料"), MsgLevel.alarm);
return;
}
MoveInfo.NextMoveStep(MoveStep.TrayStop_07);
//抵达了一个有物料的托盘等待处理
var device = MI.DeviceList[GroupName];
if (!device.HasJob(trayInfo.TrayParam))
MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
else {
var cid = trayInfo.TrayParam.PosID;
if (VStoreCollection.VStoreList[cid].RTStoreStatus == RTStoreStatus.Offline)
{
MoveInfo.log($"当前需求设备CID:{cid}已离线");
var rm= TheLine.Regetposid(trayInfo.TrayParam, trayInfo.TrayType.ToString(), out string msg);
MoveInfo.log($"重新获取库位 msg:{msg},\t {rm.ToStr()}");
RequestLoadInfo RequestLoadInfo = new RequestLoadInfo();
RequestLoadInfo.LoadParam = rm.clone();
RequestLoadInfo.DeviceGroupName= rm.cid;
RequestLoadInfo.TrayType = trayInfo.TrayType.ToString();
RequestLoadInfo.IsEmpty = false;
TrayManager.SetTrayLoadInfo(CurrrentRFID, RequestLoadInfo);
//查询新库位, 检查料仓状态
MoveInfo.NextMoveStep(MoveStep.TrayStop_03);
return;
}
else
{
MoveInfo.NextMoveStep(MoveStep.TrayStop_07);
device.StartInStore(trayInfo.TrayParam);
//抵达了一个有物料的托盘等待处理
var device = MI.DeviceList[GroupName];
if (!device.HasJob(trayInfo.TrayParam))
MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
else
{
MoveInfo.NextMoveStep(MoveStep.TrayStop_07);
device.StartInStore(trayInfo.TrayParam);
}
}
}
else
......@@ -322,6 +349,12 @@ namespace DeviceLibrary
}
break;
case MoveStep.TrayStop_WaitLoadProcess:
//if (MI.DeviceList.ContainsKey(GroupName) && MI.DeviceList[GroupName].robotHelper.EMERGENCY_STOP) {
// MoveInfo.log("检测到机器人急停,托盘放行处理");
// MoveInfo.NextMoveStep(MoveStep.TrayStop_04);
// return;
//}
Msg.add(crc.GetString("Res0046","等待处理物料"),MsgLevel.info);
if (GroupName != "AMH-MI1" && GroupName != "AMH-MI2" && GroupName != "CI")
{
......
......@@ -28,7 +28,8 @@ namespace DeviceLibrary
InitializeComponent();
crc.OpenResourceLog = true;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
crc.CurrLanguage = Setting_Init.Device_Default_Language;
if (!string.IsNullOrEmpty(Setting_Init.Device_Default_Language))
crc.CurrLanguage = Setting_Init.Device_Default_Language;
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
......
......@@ -24,8 +24,13 @@ namespace DeviceLibrary
return;
this.Tag = "not";
crc.OpenResourceLog = true;
crc.LanguageChangeEvent += (s, o) => crc.LanguageProcess(this);
crc.CurrLanguage = Setting_Init.Device_Default_Language;
crc.LanguageChangeEvent += (s, o) =>
{
RefreshList();
crc.LanguageProcess(this);
};
if (!string.IsNullOrEmpty(Setting_Init.Device_Default_Language))
crc.CurrLanguage = Setting_Init.Device_Default_Language;
}
private void FixtureSizeConfigControl_Load(object sender, EventArgs e)
......
......@@ -201,12 +201,12 @@ public class ReelParam
{
if (IsNg)
{
return $":{NgMsg}[{WareCode}][{RFID}][{PlateW}x{PlateH}]";
return $":{NgMsg}[{WareCode}][{RFID}][{PlateW}x{PlateH}][{cid}]";
}
else
{
return $":[{PosID}][{WareCode}][{RFID}][{PlateW}x{PlateH}]";
return $":[{PosID}][{WareCode}][{RFID}][{PlateW}x{PlateH}][{cid},{SubCID}]";
}
}
bool islog = false;
......
......@@ -2,6 +2,7 @@ using ConfigHelper;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using System.Text;
......@@ -15,7 +16,8 @@ namespace RemoteSheardObject
INLINE,
INROBOT,
BOXDOOR,
FINISHED
FINISHED,
BOXDOOR_NOREEL
}
public static bool UpdateLocInfo(string taskId, string barcode, LineStatusE status, string locInfo)
{
......@@ -33,6 +35,19 @@ namespace RemoteSheardObject
return !string.IsNullOrEmpty(SubmitPostData("/service/store/robotBox/updateLocInfo", postData));
}
public static bool emptyOut(string barcode)
{
if (barcode.Count(c => c == '#') == 3)
{
barcode = barcode.Split('#')[1].Substring(1);
}
var postData = new Dictionary<string, string>()
{
{"barcode", barcode}
};
return !string.IsNullOrEmpty(SubmitPostData("/service/store/robotBox/emptyOut", postData));
}
/// <summary>
/// 获取正在进行的任务数量
/// </summary>
......@@ -109,6 +124,16 @@ namespace RemoteSheardObject
var resultStr = HttpHelper.Post<NgMsgData, ResultData2>(url, ngMsgData,5000,true);
}
/// <summary>
/// 上传mycronic库存信息
/// </summary>
/// <param name="equipMsgData"></param>
public static void UploadCarrierInformation(List<CarrierInformationData> equipMsgData)
{
string url = CombineUrl(Config.Get("Device_Server_Address"), "/rest/micron/device/updateMInventory");
var resultStr = HttpHelper.Post<List<CarrierInformationData>, ResultData2>(url, equipMsgData);
}
/// <summary>
/// NG口位置,1=左侧,2=右侧
/// </summary>
/// <param name="ngPos"></param>
......@@ -217,6 +242,106 @@ namespace RemoteSheardObject
return "";
}
}
}
}
public static ReelParam Regetposid(ReelParam reelParam,string traytype, out string msg)
{
msg = "";
var barcode = reelParam.WareCode;
if (barcode.Count(c => c == '#') == 3)
{
barcode = barcode.Split('#')[1].Substring(1);
}
try
{
Dictionary<string, string> nameValue = new Dictionary<string, string>();
nameValue.Add("code", reelParam.WareCode);
nameValue.Add("preCid", reelParam.cid);
if (reelParam.PlateW == 13 && reelParam.PlateH < 44)
nameValue.Add("cids", "AMH-SBDH3-2,AMH-SBSH1,AMH-SBSH2,AMH-SBDH2-1,AMH-SBDH2-2,AMH-SBDH1-1,AMH-SBDH1-2,003040,003048,003039,003043,003035,003036,003041,003042");
else //不包含 AMH-SBDH3-1
nameValue.Add("cids", "AMH-SBDH3-1,AMH-SBDH3-2,AMH-SBSH1,AMH-SBSH2,AMH-SBDH2-1,AMH-SBDH2-2,AMH-SBDH1-1,AMH-SBDH1-2,003040,003048,003039,003043,003035,003036,003041,003042");
var data = SubmitPostData("/service/store/robotBox/emptyPosForPutin", nameValue);
msg += "Regetposid code: " + reelParam.WareCode + ",preCid: " + reelParam.cid + ",cids:" + nameValue["cids"] + ",Result: " + data + "\r\n";
emptyPosForPutin result = JsonConvert.DeserializeObject<emptyPosForPutin>(data);
if (result != null && (result.result == "0" || result.result == "98"))
{
if (string.IsNullOrEmpty(result.cid))
{
msg += "no cid\r\n";
reelParam.cid = traytype == "MTP1" ? "AMH-ML5-2" : "AMH-ML5-1";
reelParam.IsNg = true;
reelParam.NgMsg = result.msg;
return reelParam;
}
var mid = "";
if ("003040,003048,003039,003043".IndexOf(result.cid) >= 0)
{
mid = "AMH-MI1";
}
else if ("003035,003036,003041,003042".IndexOf(result.cid) >= 0)
{
mid = "AMH-MI2";
}
//if (reel.PlateW == 7 || reel.PlateW == 13 && reel.PlateH < 44 || reel.PlateW == 15)
if (mid == "AMH-MI1" || mid == "AMH-MI2")
{
var micode = $"P{reelParam.PN}#S{reelParam.RI}#{reelParam.QTY}#{reelParam.DC}";
msg += "送往MI物料重组2dcode:" + micode;
reelParam.SubCID = result.cid;
reelParam.WareCode = micode;
reelParam.PosID = result.pos;
reelParam.cid = mid;
//RobotManage.SendTrayRequest("003039", micode, "AMH-MI1");
//RobotManage.SendTrayRequest(result.cid, micode, mid);
}
else
{
reelParam.cid = result.cid;
reelParam.PosID = result.pos;
}
return reelParam;
//RobotManage.SendTrayRequest(result.pos, result.barcode, result.cid);
}
else
{
if (result != null && result.msg != null)
msg = result.msg;
reelParam.cid = traytype == "MTP1" ? "AMH-ML5-2" : "AMH-ML5-1"; ;
reelParam.IsNg = true;
reelParam.NgMsg = msg;
return reelParam;
}
}
catch (Exception ex) {
msg += ex.ToString();
reelParam.cid = traytype == "MTP1" ? "AMH-ML5-2" : "AMH-ML5-1"; ;
reelParam.IsNg = true;
reelParam.NgMsg = msg;
return reelParam;
}
}
public class emptyPosForPutin
{
public string result;
public string msg;
public string pos;
public string barcode;
public string cid;
}
[Serializable]
public class CarrierInformationData
{
public string carrier;
public string partnumber;
public string depot;
public int diameter;
public int height;
}
}
}
\ No newline at end of file
......@@ -77,7 +77,7 @@ namespace TheMachine
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
}
private void AddForm(string id, string text, UserControl form)
public void AddForm(string id, string text, UserControl form)
{
foreach (TabPage tp in tabControl1.TabPages)
{
......
......@@ -17,6 +17,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TheMachine.device;
using TheMachine.device.Other;
namespace TheMachine
......@@ -49,7 +50,7 @@ namespace TheMachine
private string Crc_GetLanguageEvent()
{
return Setting_Init.Device_Default_Language;
return Setting_Init.Device_Default_Language??"zh-CN";
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
......@@ -76,7 +77,8 @@ namespace TheMachine
DeviceControl<TrayStopControl> ml = new DeviceControl<TrayStopControl>();
DeviceControl<TrayStopControl> mi = new DeviceControl<TrayStopControl>();
DeviceControl<TrayStopControl> ci = new DeviceControl<TrayStopControl>();
AxisControl ac = new AxisControl();
CIDebugControl cidebug = new CIDebugControl();
AxisControl ac = new AxisControl();
SettingControl sc = new SettingControl();
MycronicControl mc = new MycronicControl();
......@@ -183,6 +185,8 @@ namespace TheMachine
AddForm("tab_traystopCI", "MT-CI", ci);
AddForm("tab_traysetting", crc.GetString("Form1_tabc_tab_setting__SettingControl_tabControl1_tabPage1_Text","治具设置"), sc);
AddForm("tab_other", "MI", mc);
ci.AddForm("tab_ciconfig", "CI-Test", cidebug);
crc.LanguageProcess(this);
}
......
......@@ -104,6 +104,12 @@
<Compile Include="DeviceControl.Designer.cs">
<DependentUpon>DeviceControl.cs</DependentUpon>
</Compile>
<Compile Include="device\CIDebugControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="device\CIDebugControl.Designer.cs">
<DependentUpon>CIDebugControl.cs</DependentUpon>
</Compile>
<Compile Include="device\HYControl.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -237,6 +243,9 @@
<EmbeddedResource Include="DeviceControl.resx">
<DependentUpon>DeviceControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="device\CIDebugControl.resx">
<DependentUpon>CIDebugControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="device\HYControl.resx">
<DependentUpon>HYControl.cs</DependentUpon>
</EmbeddedResource>
......
namespace TheMachine.device
{
partial class CIDebugControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.label_status = new System.Windows.Forms.Label();
this.btn_start = new System.Windows.Forms.Button();
this.txt_barcode = new System.Windows.Forms.TextBox();
this.label_barcode = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// label_status
//
this.label_status.AutoSize = true;
this.label_status.Location = new System.Drawing.Point(60, 86);
this.label_status.Name = "label_status";
this.label_status.Size = new System.Drawing.Size(41, 12);
this.label_status.TabIndex = 0;
this.label_status.Text = "label1";
//
// btn_start
//
this.btn_start.Location = new System.Drawing.Point(325, 86);
this.btn_start.Name = "btn_start";
this.btn_start.Size = new System.Drawing.Size(135, 23);
this.btn_start.TabIndex = 1;
this.btn_start.Text = "开始点料";
this.btn_start.UseVisualStyleBackColor = true;
this.btn_start.Click += new System.EventHandler(this.btn_start_Click);
//
// txt_barcode
//
this.txt_barcode.Location = new System.Drawing.Point(123, 34);
this.txt_barcode.Name = "txt_barcode";
this.txt_barcode.Size = new System.Drawing.Size(337, 21);
this.txt_barcode.TabIndex = 2;
this.txt_barcode.Text = "P123456#S123456789#0#182+EA";
//
// label_barcode
//
this.label_barcode.AutoSize = true;
this.label_barcode.Location = new System.Drawing.Point(60, 37);
this.label_barcode.Name = "label_barcode";
this.label_barcode.Size = new System.Drawing.Size(53, 12);
this.label_barcode.TabIndex = 0;
this.label_barcode.Text = "Barcode:";
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// CIDebugControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.txt_barcode);
this.Controls.Add(this.btn_start);
this.Controls.Add(this.label_barcode);
this.Controls.Add(this.label_status);
this.Name = "CIDebugControl";
this.Size = new System.Drawing.Size(517, 310);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label_status;
private System.Windows.Forms.Button btn_start;
private System.Windows.Forms.TextBox txt_barcode;
private System.Windows.Forms.Label label_barcode;
private System.Windows.Forms.Timer timer1;
}
}
using DeviceLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachine.device
{
public partial class CIDebugControl : UserControl
{
public CIDebugControl()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
string status = "";
if (TrayStop.DeviceList["CI"].IOValue(IO_Type.CI_Count_Finished).Equals(IO_VALUE.HIGH))
{
status = "Ready";
}
else
{
status = "Counting";
}
label_status.Text = status;
}
private void btn_start_Click(object sender, EventArgs e)
{
if (TrayStop.DeviceList["CI"].IOValue(IO_Type.CI_Count_Finished).Equals(IO_VALUE.HIGH))
{
if (VJCounter.CheckConnect())
{
VJCounter.SendBarcode(txt_barcode.Text.Trim());
Thread.Sleep(500);
TrayStop.DeviceList["CI"].IOMove(IO_Type.CI_Start, IO_VALUE.HIGH, 1000);
LogUtil.info("手动点击开始点料");
}
else {
MessageBox.Show("未成功连接VJ点料机");
}
}
else
{
MessageBox.Show("点料机没有准备好,不能启动.");
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
......@@ -24,7 +24,8 @@ namespace TheMachine
this.Tag = "not";
crc.OpenResourceLog = true;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
crc.CurrLanguage = Setting_Init.Device_Default_Language;
if (!string.IsNullOrEmpty(Setting_Init.Device_Default_Language))
crc.CurrLanguage = Setting_Init.Device_Default_Language;
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
......
......@@ -22,7 +22,8 @@ namespace TheMachine
this.Tag = "not";
crc.OpenResourceLog = true;
crc.LanguageChangeEvent += (s, o) => crc.LanguageProcess(this);
crc.CurrLanguage = Setting_Init.Device_Default_Language;
if (!string.IsNullOrEmpty(Setting_Init.Device_Default_Language))
crc.CurrLanguage = Setting_Init.Device_Default_Language;
}
public void Init(string deviceGroupName)
{
......
......@@ -22,7 +22,8 @@ namespace TheMachine
this.Tag = "not";
crc.OpenResourceLog = true;
crc.LanguageChangeEvent += (s, o) => crc.LanguageProcess(this);
crc.CurrLanguage = Setting_Init.Device_Default_Language;
if (!string.IsNullOrEmpty(Setting_Init.Device_Default_Language))
crc.CurrLanguage = Setting_Init.Device_Default_Language;
}
public void Init(string deviceGroupName)
{
......@@ -46,6 +47,8 @@ namespace TheMachine
if (TrayStop.DeviceList[deviceGroupName].RFID_1 != null)
rfidControl1.Init(deviceGroupName, TrayStop.DeviceList[deviceGroupName].RFID_1);
textBox_p3.Text= RobotManage.DeviceGroup[DeviceGroupName].p3.ToString();
crc.LanguageProcess(this);
}
......
此文件太大,无法显示。
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!