You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.1 KiB
C#
90 lines
3.1 KiB
C#
//using CentralControl.BaseData;
|
|
//using CommonFunc;
|
|
//using System;
|
|
//using System.Collections.Generic;
|
|
//using System.Linq;
|
|
//using System.Text;
|
|
//using System.Threading;
|
|
|
|
//namespace CentralControl.App_Code
|
|
//{
|
|
// public class LogicLine1007
|
|
// {
|
|
|
|
// Thread UpMaterialThread;
|
|
// PlcHelper plcHelper;
|
|
// Dictionary<string, string> OffLineRFIDDic = new Dictionary<string, string>();
|
|
|
|
// public LogicLine1007(PlcHelper plc)
|
|
// {
|
|
// plcHelper = plc;
|
|
// }
|
|
|
|
// public LogicLine1007()
|
|
// {
|
|
// plcHelper = new PlcHelper();
|
|
// plcHelper.Connection("127.0.0.1");
|
|
// }
|
|
// /// <summary>
|
|
// /// 启动上件扫描监听
|
|
// /// </summary>
|
|
// public void StartUpMateril(string lineNo)
|
|
// {
|
|
// OffLineRFIDDic.Add(lineNo, "");
|
|
// //添加下件件区 队列
|
|
// List<OffLineMaterialList> list = StaticData.OffMaterialAreaList.Where(t => (t.LineNo).ToString() == lineNo.ToString()).ToList();
|
|
// StaticData.OffMaterialsDic.Add(lineNo, list);
|
|
// ////创建物料上车线程集合
|
|
// Thread carthread = new Thread(new ParameterizedThreadStart(MaterialOffTeamMethod));
|
|
// carthread.IsBackground = true;
|
|
// carthread.Start(lineNo);
|
|
|
|
// }
|
|
|
|
|
|
// private void MaterialOffTeamMethod(object lineno)
|
|
// {
|
|
// Logger logger = new Logger();
|
|
|
|
// while (true)
|
|
// {
|
|
|
|
|
|
// //根据总装线的 读取RFID 获取 箱体成品编码
|
|
// object productno = plcHelper.Read(StaticData.getPlcInfoByCode("inlinematerial_" + lineno));
|
|
// ///测试数据
|
|
// if (productno == null)
|
|
// {
|
|
// productno = "123";
|
|
// }
|
|
// ///预留 pcl地址位读取订单号,或者总装物料编码, 或者 bom的版本号
|
|
// MesViewData datames = MESDBService.GetOffLineMaterialyRFid(productno.ToString());
|
|
// if (OffLineRFIDDic[lineno.ToString()] != productno.ToString())
|
|
// {
|
|
// logger.Log("当前扫描RFID:" + productno.ToString());
|
|
|
|
// //获取外筒物料半成品编码
|
|
// string currmaterialno = datames.BackNumber.Substring(0, 9);
|
|
|
|
// List<OffLineMaterialList> list = StaticData.OffMaterialsDic[lineno.ToString()];
|
|
// //插入数据库 上料队列
|
|
// OffLineMaterialList product = new OffLineMaterialList();
|
|
// product.MaterialNo = currmaterialno;
|
|
// //product.MaterialInfo = material;
|
|
// product.MaterDetailList = new List<MaterialInfo>();
|
|
|
|
|
|
// product.ProductBarNo = productno.ToString();
|
|
// product.LineNo = lineno.ToString();
|
|
// product.Id = DBService.AddOffLineMaterialList(product);
|
|
|
|
// list.Add(product);
|
|
// }
|
|
// Thread.Sleep(100000);
|
|
// }
|
|
// }
|
|
|
|
|
|
// }
|
|
//}
|