change- 入库逻辑修改,完成信号改为监测在途数

foamRearStore
liuwf 10 months ago
parent 868f7f30a7
commit f165ada25f

Binary file not shown.

@ -57,7 +57,7 @@ namespace Aucma.Scada.Business
/// 下传执行计划 /// 下传执行计划
/// </summary> /// </summary>
/// <param name="planInfo"></param> /// <param name="planInfo"></param>
public delegate void NextPassExecutePlanInfo(ExecutePlanInfo planInfo); public delegate void NextPassExecutePlanInfo(ExecutePlanInfo planInfo,BaseSpaceInfo spaceInfo = null);
public event NextPassExecutePlanInfo NextPassExecutePlanInfoEvent; public event NextPassExecutePlanInfo NextPassExecutePlanInfoEvent;
#endregion #endregion
@ -121,7 +121,7 @@ namespace Aucma.Scada.Business
/// </summary> /// </summary>
/// <param name="productPlanCode"></param> /// <param name="productPlanCode"></param>
/// <param name="transmitAmount"></param> /// <param name="transmitAmount"></param>
public bool PlanTransmitByProductPlan(string productPlanCode, int transmitAmount) public bool PlanTransmitByProductPlan(string productPlanCode, int transmitAmount,BaseSpaceInfo spaceInfo = null)
{ {
bool result = false; bool result = false;
try try
@ -147,7 +147,7 @@ namespace Aucma.Scada.Business
GetEexecutePlanInfosByProductLineCode(); GetEexecutePlanInfosByProductLineCode();
// 直接下达 2023-12-20 // 直接下达 2023-12-20
ExecutePlanInfo_NextPass(executePlanInfo.executePlanCode, ""); ExecutePlanInfo_NextPass(executePlanInfo.executePlanCode, "",spaceInfo);
} }
} }
} }
@ -233,7 +233,7 @@ namespace Aucma.Scada.Business
/// 下传计划 /// 下传计划
/// </summary> /// </summary>
/// <param name="planCode"></param> /// <param name="planCode"></param>
public ExecutePlanInfo ExecutePlanInfo_NextPass(string planCode, string nowPlanCode) public ExecutePlanInfo ExecutePlanInfo_NextPass(string planCode, string nowPlanCode,BaseSpaceInfo spaceInfo = null)
{ {
ExecutePlanInfo planInfo = null; ExecutePlanInfo planInfo = null;
try try
@ -254,7 +254,7 @@ namespace Aucma.Scada.Business
if (planInfo != null) if (planInfo != null)
{ {
//传给出库 //传给出库
NextPassExecutePlanInfoEvent?.Invoke(planInfo); NextPassExecutePlanInfoEvent?.Invoke(planInfo,spaceInfo);
planInfo.executeStatus = 2; planInfo.executeStatus = 2;
planInfo.beginTime = DateTime.Now; planInfo.beginTime = DateTime.Now;

@ -120,15 +120,21 @@ namespace Aucma.Scada.Business
MvCodeHelper.RefreshLogMessageEvent += PrintLogInfoMessage; MvCodeHelper.RefreshLogMessageEvent += PrintLogInfoMessage;
StartPassDown(); StartPassDown();
//Task.Run(() => //Task.Run(() =>
//{ //{
// Thread.Sleep(6000); // Thread.Sleep(3000);
// for (int i = 1; i < 2; i++) // for (int i = 1; i < 2; i++)
// { // {
// InStore("B24010181060282920010"); // // 8302501181 8302500586 9
// InStore("B2401018302500586001" + i);
// Thread.Sleep(1000); // Thread.Sleep(1000);
// } // }
//});
// InStore("B2401018302501181001" + 1);
// Thread.Sleep(1000);
// InStore("B2401018302500889001" + 1);
// });
} }
#region delete 2024-01-04出库时堵塞入库 ,不需要堵塞整个库 #region delete 2024-01-04出库时堵塞入库 ,不需要堵塞整个库
@ -344,7 +350,8 @@ namespace Aucma.Scada.Business
} }
else else
{ {
PrintLogInfoMessage("未获取到需要下发的泡后入库任务"); logHelper.Info("未获取到需要下发的泡后入库任务");
// PrintLogInfoMessage("未获取到需要下发的泡后入库任务");
} }
} }
catch (Exception ex) catch (Exception ex)
@ -436,11 +443,11 @@ namespace Aucma.Scada.Business
RecordInstore recordInstore = new RecordInstore(); RecordInstore recordInstore = new RecordInstore();
recordInstore.storeCode = taskInfo.storeCode; recordInstore.storeCode = taskInfo.storeCode;
recordInstore.spaceCode = taskInfo.spaceCode; recordInstore.spaceCode = taskInfo.spaceCode;
recordInstore.materialCode = taskInfo.materialCode; recordInstore.materialCode = taskInfo.materialCode;
recordInstore.materialType = taskInfo.materialType; recordInstore.materialType = taskInfo.materialType;
recordInstore.materialName = GetMaterialName(taskInfo.materialType); recordInstore.materialName = GetMaterialName(taskInfo.materialType);
recordInstore.inStoreAmount = 1; recordInstore.inStoreAmount = 1;
recordInstore.inStoreTime = DateTime.Now; recordInstore.inStoreTime = DateTime.Now;
recordInstore.barcodeCode = taskInfo.materialCode; recordInstore.barcodeCode = taskInfo.materialCode;
_recordInStoreService.InsertRecordInStore(recordInstore); _recordInStoreService.InsertRecordInStore(recordInstore);
#endregion #endregion
@ -575,7 +582,7 @@ namespace Aucma.Scada.Business
} }
catch (Exception ex) catch (Exception ex)
{ {
PrintLogErrorMessage("货道信息读取异常", ex); PrintLogErrorMessage("货道信息plc读取异常", ex);
} }
return result; return result;

@ -1,10 +1,12 @@
using Aucma.Scada.Model.domain; using Aucma.Scada.Model.domain;
using HighWayIot.Common;
using HighWayIot.Config; using HighWayIot.Config;
using HighWayIot.Log4net; using HighWayIot.Log4net;
using HighWayIot.Plc; using HighWayIot.Plc;
using HighWayIot.Repository.service; using HighWayIot.Repository.service;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -39,6 +41,13 @@ namespace Aucma.Scada.Business
private RegisterServices registerServices = RegisterServices.Instance; private RegisterServices registerServices = RegisterServices.Instance;
private JsonChange json = JsonChange.Instance;
/// <summary>
/// 已下传的任务信息
/// </summary>
private List<RealTaskInfo> foamRearTaskInfos ;
/// <summary> /// <summary>
/// 实时任务 /// 实时任务
/// </summary> /// </summary>
@ -48,7 +57,7 @@ namespace Aucma.Scada.Business
#region 私有变量 #region 私有变量
private Dictionary<string, IPlc> _plcDictionary = new Dictionary<string, IPlc>(); private Dictionary<string, IPlc> _plcDictionary = new Dictionary<string, IPlc>();
private Dictionary<string, int> foamRearKeyValuePairs = new Dictionary<string, int>();
/// <summary> /// <summary>
/// 泡后任务编号,PLC反馈后进行赋值 /// 泡后任务编号,PLC反馈后进行赋值
/// </summary> /// </summary>
@ -78,11 +87,52 @@ namespace Aucma.Scada.Business
{ {
_taskInfoService = registerServices.GetService<IRealTaskInfoService>(); _taskInfoService = registerServices.GetService<IRealTaskInfoService>();
_plcDictionary = _pool.GetAll(); _plcDictionary = _pool.GetAll();
List<RealTaskInfo> taskList = _taskInfoService.GetTaskInfosForInstore(appConfig.foamStoreCode, appConfig.instoreTaskType, 2); // 程序启动查询数据库
RealReadFinish(); foamRearTaskInfos = _taskInfoService.GetTaskInfosForInstore(appConfig.foamStoreCode, appConfig.instoreTaskType, 2);
foamRearTaskInfos = new List<RealTaskInfo>();
RealReadPlcSpace();
SendHeart();
// RealReadFinish(); change-入库完成信号改回监测在途数
// test();
} }
//public void test()
//{
// Task.Run(() =>
// {
// while (true)
// {
// List<RealTaskInfo> taskList = _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.foamStoreCode }, appConfig.instoreTaskType);
// Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} ======》 打印数据:{json.ModeToJson(taskList)}");
// //Thread.Sleep(500);
// }
// });
//}
/// <summary>
/// 心跳
/// </summary>
private void SendHeart()
{
Task.Run(() =>
{
Thread.Sleep(3000);
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
#region 判断入库是否完成 if (_plc != null)
{
while (true)
{
_plc.writeInt32ByAddress("D7020",1);
Thread.Sleep(1000);
_plc.writeInt32ByAddress("D7020", 0);
Thread.Sleep(1000);
}
}
});
}
#region 判断入库是否完成 delete20240224-入库完成信号改回监测在途数
/// <summary> /// <summary>
/// 实时读取入库完成信号 /// 实时读取入库完成信号
/// </summary> /// </summary>
@ -126,7 +176,9 @@ namespace Aucma.Scada.Business
/// <param name="taskInfo"></param> /// <param name="taskInfo"></param>
/// <returns></returns> /// <returns></returns>
public void JudgeIsFinish(RealTaskInfo taskInfo,IPlc _plc,SpaceAddress spaceAddress) public void JudgeIsFinish(RealTaskInfo taskInfo,IPlc _plc,SpaceAddress spaceAddress)
{ {
// 测试方法模拟plc正式启用删除
// _plc.writeInt32ByAddress(spaceAddress.inStoreFinish, 1);
//读取入库完成反馈信号 //读取入库完成反馈信号
if (_plc.readInt32ByAddress(spaceAddress.inStoreFinish) == 1) if (_plc.readInt32ByAddress(spaceAddress.inStoreFinish) == 1)
{ {
@ -134,10 +186,82 @@ namespace Aucma.Scada.Business
InStoreFinsihEvent(taskInfo.taskCode); InStoreFinsihEvent(taskInfo.taskCode);
} }
} }
#endregion #endregion
#region 监测PLC在途数量变化完成入库任务
#region 泡后入库任务下发处理 private void RealReadPlcSpace()
public int SendFoamTask_InStore(RealTaskInfo taskInfo) {
Thread.Sleep(5000);
Task.Run(() =>
{
while (true)
{
RealReadShellPlcSpace();
Thread.Sleep(500);
}
});
}
/// <summary>
/// 读取箱壳已下发任务的货道信息读取后将货道编号及在途数量写入Dictionary进行比较在途数减少则入库完成
/// </summary>
private void RealReadShellPlcSpace()
{
if (foamRearTaskInfos != null && foamRearTaskInfos.Count>0)
{
List<string> spaceCodes = foamRearTaskInfos.Select(x => x.spaceCode).Distinct().ToList();
for (int i = 0; i < spaceCodes.Count; i++)
{
string spaceCode = spaceCodes[i];
BaseSpaceInfo spaceInfo = new BaseSpaceInfo() { storeCode = appConfig.foamStoreCode, spaceCode = spaceCode };
spaceInfo = ReadSpaceInfoByPlc(spaceInfo);
if (foamRearKeyValuePairs.ContainsKey(spaceInfo.spaceCode))
{
foamRearKeyValuePairs.TryGetValue(spaceInfo.spaceCode, out int value);
//判断前次读取的数据和当前数据,如果前次数据大于当前数据则代表入库完成,然后筛选任务中对应货道的首个任务进行完成
//如果前次数据不大于当前数据则更新字典中存放的数据
if (value > spaceInfo.onRouteAmount)
{
//筛选任务
var list = foamRearTaskInfos.Where(x => x.spaceCode == spaceInfo.spaceCode).ToList();
if (list.Count > 0)
{
RealTaskInfo taskInfo = list.OrderBy(x => x.createTime).First();
InStoreFinsihEvent?.Invoke(taskInfo.taskCode);
foamRearTaskInfos.Remove(taskInfo);
}
foamRearKeyValuePairs.Remove(spaceInfo.spaceCode);
}
else
{
foamRearKeyValuePairs[spaceInfo.spaceCode] = spaceInfo.onRouteAmount;
}
}
else
{
foamRearKeyValuePairs.Add(spaceInfo.spaceCode, spaceInfo.onRouteAmount);
}
}
}
}
#endregion
#region 泡后入库任务下发处理
public int SendFoamTask_InStore(RealTaskInfo taskInfo)
{ {
int result = 0; int result = 0;
try try
@ -147,7 +271,9 @@ namespace Aucma.Scada.Business
if (_plc != null) if (_plc != null)
{ {
if (_plc.IsConnected) if (_plc.IsConnected)
{ {
// 测试方法模拟plc正式启用删除
// _plc.writeInt32ByAddress(plcConfig.in_foam_answer, 1);
if (_plc.readInt32ByAddress(plcConfig.in_foam_answer) == 1) if (_plc.readInt32ByAddress(plcConfig.in_foam_answer) == 1)
{ {
logHelper.Info("泡后入库应答字为1货道号:" + plcConfig.in_foam_spaceCode + ";写" + short.Parse(taskInfo.spaceCode.Substring(5, 1))); logHelper.Info("泡后入库应答字为1货道号:" + plcConfig.in_foam_spaceCode + ";写" + short.Parse(taskInfo.spaceCode.Substring(5, 1)));
@ -207,6 +333,8 @@ namespace Aucma.Scada.Business
{ {
do do
{ {
// 测试方法模拟plc正式启用删除
// _plc.writeInt32ByAddress(plcConfig.in_foam_answer, 2);
//读取PLC应答字为2时上位机清空写入的入库内容 //读取PLC应答字为2时上位机清空写入的入库内容
if (_plc.readInt32ByAddress(plcConfig.in_foam_answer) == 2) if (_plc.readInt32ByAddress(plcConfig.in_foam_answer) == 2)
{ {
@ -217,7 +345,7 @@ namespace Aucma.Scada.Business
// _plc.writeInt32ByAddress(plcConfig.in_foam_answer, 0); // _plc.writeInt32ByAddress(plcConfig.in_foam_answer, 0);
isFlag = false; isFlag = false;
foamRearTaskInfos.Add(taskInfo);
InStoreAnswerEvent?.Invoke(appConfig.foamStoreCode, taskInfo.taskCode); InStoreAnswerEvent?.Invoke(appConfig.foamStoreCode, taskInfo.taskCode);
} }
@ -255,12 +383,11 @@ namespace Aucma.Scada.Business
if (_plc != null) if (_plc != null)
{ {
if (_plc.IsConnected)
{
spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore); spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute); spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
// spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus); // spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus);
}
} }
return spaceInfo; return spaceInfo;

@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms;
using static Aucma.Scada.Business.OutStoreTaskHandle; using static Aucma.Scada.Business.OutStoreTaskHandle;
namespace Aucma.Scada.Business namespace Aucma.Scada.Business
@ -125,7 +126,7 @@ namespace Aucma.Scada.Business
/// 接收下达的组装计划根据BOM获取需要出库的泡后、内胆物料信息 /// 接收下达的组装计划根据BOM获取需要出库的泡后、内胆物料信息
/// </summary> /// </summary>
/// <param name="planInfo"></param> /// <param name="planInfo"></param>
private void PlanHandle(ExecutePlanInfo planInfo) private void PlanHandle(ExecutePlanInfo planInfo,BaseSpaceInfo spaceInfo = null)
{ {
lock (string.Empty) lock (string.Empty)
{ {
@ -143,7 +144,7 @@ namespace Aucma.Scada.Business
for (int i = 0; i < planInfo.planAmount - planInfo.completeAmount; i++) for (int i = 0; i < planInfo.planAmount - planInfo.completeAmount; i++)
{ {
string taskCode = System.Guid.NewGuid().ToString("N").Substring(0, 10); string taskCode = System.Guid.NewGuid().ToString("N").Substring(0, 10);
OutStore(appConfig.foamStoreCode, bomInfo, planInfo.executePlanCode, taskCode); OutStore(appConfig.foamStoreCode, bomInfo, planInfo.executePlanCode, taskCode,spaceInfo);
Thread.Sleep(500); Thread.Sleep(500);
} }
} }
@ -157,7 +158,7 @@ namespace Aucma.Scada.Business
/// <param name="storeCode"></param> /// <param name="storeCode"></param>
/// <param name="bomInfo"></param> /// <param name="bomInfo"></param>
/// <param name="planCode"></param> /// <param name="planCode"></param>
private void OutStore(string storeCode, BaseBomInfo bomInfo, string planCode, string taskCode) private void OutStore(string storeCode, BaseBomInfo bomInfo, string planCode, string taskCode,BaseSpaceInfo spaceInfo = null)
{ {
try try
{ {
@ -165,7 +166,10 @@ namespace Aucma.Scada.Business
#region Delete By wenjy 2023-10-30 11:41:00 取消通过数据库获取货道数量、在途量改为通过PLC获取货道信息 #region Delete By wenjy 2023-10-30 11:41:00 取消通过数据库获取货道数量、在途量改为通过PLC获取货道信息
//BaseSpaceInfo spaceInfo = _spaceInfoService.OutStoreGetSpaceInfoByMaterialCode(storeCode, bomInfo.materialCode); //BaseSpaceInfo spaceInfo = _spaceInfoService.OutStoreGetSpaceInfoByMaterialCode(storeCode, bomInfo.materialCode);
#endregion #endregion
BaseSpaceInfo spaceInfo = GetSpaceInfoByMaterialType(storeCode, bomInfo.materialCode); if(spaceInfo == null)
{
spaceInfo = GetSpaceInfoByMaterialType(storeCode, bomInfo.materialCode);
}
if (spaceInfo != null) if (spaceInfo != null)
{ {
PrintLogInfoMessage($"匹配货道:{spaceInfo.spaceName}"); PrintLogInfoMessage($"匹配货道:{spaceInfo.spaceName}");
@ -208,6 +212,7 @@ namespace Aucma.Scada.Business
{ {
#region 出库任务赋值 #region 出库任务赋值
RealTaskInfo realTaskInfo = new RealTaskInfo(); RealTaskInfo realTaskInfo = new RealTaskInfo();
// 执行计划编号
realTaskInfo.planCode = planCode; realTaskInfo.planCode = planCode;
realTaskInfo.taskType = 2; realTaskInfo.taskType = 2;
realTaskInfo.taskCode = taksCode; realTaskInfo.taskCode = taksCode;
@ -249,6 +254,7 @@ namespace Aucma.Scada.Business
return result; return result;
} }
/// <summary> /// <summary>
/// 根据创建时间获取第一个货道明细 /// 根据创建时间获取第一个货道明细
/// </summary> /// </summary>
@ -337,14 +343,14 @@ namespace Aucma.Scada.Business
if (taskInfo != null) if (taskInfo != null)
{ {
PrintLogInfoMessage($"下发泡后出库任务:{taskInfo.taskCode};仓库{taskInfo.storeCode};货道:{taskInfo.spaceCode}"); // PrintLogInfoMessage($"下发泡后出库任务:{taskInfo.taskCode};仓库{taskInfo.storeCode};货道:{taskInfo.spaceCode}");
int result = taskHandleBusiness.SendFoamTask_OutStore(taskInfo); int result = taskHandleBusiness.SendFoamTask_OutStore(taskInfo);
if (result==1) if (result==1)
{ {
PrintLogInfoMessage($"泡后出库任务:{taskInfo.taskCode}下发成功等待PLC执行反馈"); PrintLogInfoMessage($"出库任务:{taskInfo.taskCode}下发成功等待PLC执行反馈");
semaphore.Wait();//一直堵塞直到信号量释放 semaphore.Wait();//一直堵塞直到信号量释放
PrintLogInfoMessage($"泡后出库任务:{taskInfo.taskCode};开始执行"); PrintLogInfoMessage($"出库任务:{taskInfo.taskCode};开始执行");
taskInfo.taskStatus = 2; taskInfo.taskStatus = 2;
_taskInfoService.UpdateTaskInfo(taskInfo); _taskInfoService.UpdateTaskInfo(taskInfo);
@ -616,7 +622,19 @@ namespace Aucma.Scada.Business
BaseSpaceInfo spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(storeCode, spaceCode); BaseSpaceInfo spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(storeCode, spaceCode);
if (spaceInfo.spaceStock > 0) if (spaceInfo.spaceStock > 0)
{ {
result = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N").Substring(0, 10), System.Guid.NewGuid().ToString("N").Substring(0, 10), 1); #region 创建mes执行任务关联生产计划
var productPlanInfo = _productPlanInfoService.GetProductPlanInfosByMaterialCode(spaceInfo.materialType);
if(productPlanInfo != null)
{
result = assemblyPlanBusiness.PlanTransmitByProductPlan(productPlanInfo.planCode, 1,spaceInfo);
}
#endregion
else
{
// 不关联生产计划
result = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N").Substring(0, 10), System.Guid.NewGuid().ToString("N").Substring(0, 10), 1);
}
} }
else else
{ {
@ -630,6 +648,56 @@ namespace Aucma.Scada.Business
return result; return result;
} }
/// <summary>
/// 整道出
/// </summary>
/// <param name="storeCode"></param>
/// <param name="spaceCode"></param>
/// <returns></returns>
public bool OutAllBySpaceCode(string storeCode, string spaceCode)
{
bool result = false;
try
{
BaseSpaceInfo spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(storeCode, spaceCode);
if (spaceInfo.spaceStock > 0)
{
#region 创建mes执行任务关联生产计划
var productPlanInfo = _productPlanInfoService.GetProductPlanInfosByMaterialCode(spaceInfo.materialType);
if (productPlanInfo != null)
{
result = assemblyPlanBusiness.PlanTransmitByProductPlan(productPlanInfo.planCode, spaceInfo.spaceStock);
}
#endregion
else
{
for(int i = 1; i < spaceInfo.spaceStock; i++)
{
result = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N").Substring(0, 10), System.Guid.NewGuid().ToString("N").Substring(0, 10), 1);
if (!result)
{
return false;
}
}
}
}
else
{
PrintLogInfoMessage($"仓库:{storeCode};货道:{spaceCode};出库失败:库存不足");
}
}
catch (Exception ex)
{
logHelper.Error("根据货道出一个异常", ex);
}
return result;
}
/// <summary> /// <summary>
/// 日志输出,界面刷新同时记录文件 /// 日志输出,界面刷新同时记录文件
/// </summary> /// </summary>

@ -145,6 +145,7 @@ namespace Aucma.Scada.Business
#endregion #endregion
#region 泡后出库任务下发处理 #region 泡后出库任务下发处理
/// <summary> /// <summary>
/// 泡后出库任务下发 /// 泡后出库任务下发

@ -14,6 +14,7 @@ namespace Aucma.Core.Scanner
{ {
public class MvCodeHelper public class MvCodeHelper
{ {
private static LogHelper logHelper = LogHelper.Instance;
private static AppConfig appConfig = AppConfig.Instance; private static AppConfig appConfig = AppConfig.Instance;
public static bool m_bGrabbing = true; public static bool m_bGrabbing = true;
#region 委托事件 #region 委托事件
@ -40,19 +41,27 @@ namespace Aucma.Core.Scanner
/// <returns></returns> /// <returns></returns>
public static bool ConnectionStatus(string ip) public static bool ConnectionStatus(string ip)
{ {
// 遍历所有已打开相机 try
foreach (KeyValuePair<MvCodeReader, string> hashmap in m_cMyDevices)
{ {
if (ip.Equals(hashmap.Value)) // 遍历所有已打开相机
foreach (KeyValuePair<MvCodeReader, string> hashmap in m_cMyDevices)
{ {
return true; if (ip.Equals(hashmap.Value))
{
return true;
}
} }
// 没有连接上,重新获取并创建设备
Task.Run(() =>
{
DeviceListAcq();
});
} }
// 没有连接上,重新获取并创建设备 catch (Exception ex)
Task.Run(() =>
{ {
DeviceListAcq(); logHelper.Error(ex.Message.ToString());
}); }
return false; return false;
} }
#endregion #endregion
@ -65,21 +74,26 @@ namespace Aucma.Core.Scanner
{ {
try try
{ {
RefreshLogMessageEvent?.Invoke("获取扫码器设备列表,进入DeviceListAcq()方法"); // RefreshLogMessageEvent?.Invoke("获取扫码器设备列表,进入DeviceListAcq()方法");
// 扫码器ip
string scannerIp = appConfig.foamHikRobotIp;
if (string.IsNullOrEmpty(scannerIp)) return;
System.GC.Collect(); System.GC.Collect();
m_stDeviceList.nDeviceNum = 0; m_stDeviceList.nDeviceNum = 0;
// 获取设备列表 // 获取设备列表
int nRet = MvCodeReader.MV_CODEREADER_EnumDevices_NET(ref m_stDeviceList, MvCodeReader.MV_CODEREADER_GIGE_DEVICE); int nRet = MvCodeReader.MV_CODEREADER_EnumDevices_NET(ref m_stDeviceList, MvCodeReader.MV_CODEREADER_GIGE_DEVICE);
if (0 != nRet) if (0 != nRet)
{ {
logHelper.Info("获取扫码器列表失败,扫码器错误码:" + nRet);
RefreshLogMessageEvent?.Invoke("获取扫码器列表失败,扫码器错误码:" + nRet); RefreshLogMessageEvent?.Invoke("获取扫码器列表失败,扫码器错误码:" + nRet);
return; return;
} }
if (0 == m_stDeviceList.nDeviceNum) if (0 == m_stDeviceList.nDeviceNum)
{ {
RefreshLogMessageEvent?.Invoke("获取扫码器数量为0请检查扫码器连接:");
// RefreshLogMessageEvent?.Invoke("获取扫码器数量为0请检查扫码器连接:");
return; return;
} }
@ -96,14 +110,14 @@ namespace Aucma.Core.Scanner
// 获取ip // 获取ip
string ip = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8) + "." + (stGigEDeviceInfo.nCurrentIp & 0x000000ff); string ip = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8) + "." + (stGigEDeviceInfo.nCurrentIp & 0x000000ff);
// Console.WriteLine($"打印扫码设备信息,下标:{i}IP{ip}"); // 只连接配置的扫码器
Console.Write("扫码器设备[" + i + "],ip:" + ip); if (!scannerIp.Equals(ip)) continue;
// 创建第i个设备 // 创建第i个设备
stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(m_stDeviceList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO)); stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(m_stDeviceList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
nRet = m_cMyDevice.MV_CODEREADER_CreateHandle_NET(ref stDevInfo);//创建设备 nRet = m_cMyDevice.MV_CODEREADER_CreateHandle_NET(ref stDevInfo);//创建设备
if (MvCodeReader.MV_CODEREADER_OK != nRet) if (MvCodeReader.MV_CODEREADER_OK != nRet)
{ {
Console.WriteLine("创建第" + i + "个扫码器设备失败,ip:" + ip); // Console.WriteLine("创建第" + i + "个扫码器设备失败,ip:" + ip);
return; return;
} }
// 打开设备 // 打开设备
@ -111,15 +125,15 @@ namespace Aucma.Core.Scanner
if (MvCodeReader.MV_CODEREADER_OK != nRet) if (MvCodeReader.MV_CODEREADER_OK != nRet)
{ {
m_cMyDevice.MV_CODEREADER_DestroyHandle_NET(); m_cMyDevice.MV_CODEREADER_DestroyHandle_NET();
Console.WriteLine("Device open fail!"); // Console.WriteLine("Device open fail!");
return; return;
} }
RefreshLogMessageEvent?.Invoke("创建并打开第" + i + "个扫码器设备成功,ip:" + ip); // RefreshLogMessageEvent?.Invoke("创建并打开第" + i + "个扫码器设备成功,ip:" + ip);
//设置触发模式 //设置触发模式
nRet = m_cMyDevice.MV_CODEREADER_SetEnumValue_NET("TriggerMode", (uint)MvCodeReader.MV_CODEREADER_TRIGGER_MODE.MV_CODEREADER_TRIGGER_MODE_ON); nRet = m_cMyDevice.MV_CODEREADER_SetEnumValue_NET("TriggerMode", (uint)MvCodeReader.MV_CODEREADER_TRIGGER_MODE.MV_CODEREADER_TRIGGER_MODE_ON);
if (MvCodeReader.MV_CODEREADER_OK != nRet) if (MvCodeReader.MV_CODEREADER_OK != nRet)
{ {
Console.WriteLine("设置触发模式失败"); // Console.WriteLine("设置触发模式失败");
return; return;
} }
//添加到集合 //添加到集合
@ -129,7 +143,7 @@ namespace Aucma.Core.Scanner
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine("获取和创建设备异常:" + ex); logHelper.Error("获取和创建扫码器设备异常:" + ex.Message.ToString());
} }
} }
#endregion #endregion
@ -178,10 +192,11 @@ namespace Aucma.Core.Scanner
Array.Copy(stBcrResult.stBcrInfoEx2[i].chCode, buffer, 22); Array.Copy(stBcrResult.stBcrInfoEx2[i].chCode, buffer, 22);
} }
string strCode = Encoding.GetEncoding("UTF-8").GetString(buffer).Trim().TrimEnd('\0'); string strCode = Encoding.GetEncoding("UTF-8").GetString(buffer).Trim().TrimEnd('\0');
RefreshLogMessageEvent?.Invoke("相机ip:" + hashmap.Value + " Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode + "]"); // RefreshLogMessageEvent?.Invoke("相机ip:" + hashmap.Value + " Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode + "]");
if (!string.IsNullOrEmpty(strCode)) if (!string.IsNullOrEmpty(strCode))
{ {
// 获取到条码处理业务 logHelper.Info("扫码器扫描到条码:"+strCode);
// 获取到条码处理业务
RefreshMaterialCodeStrEvent?.Invoke(strCode); RefreshMaterialCodeStrEvent?.Invoke(strCode);
} }

@ -56,14 +56,19 @@
<StackPanel Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right"> <StackPanel Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">
<Grid> <Grid>
<Grid.ColumnDefinitions> <!--<Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>-->
<TextBlock Grid.Column="0" Text="白班" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/> <Grid.RowDefinitions>
<TextBlock Grid.Column="1" Text="|" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/> <RowDefinition Height="*"/>
<TextBlock Grid.Column="2" Text="SCADA" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,10,0"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{Binding ShiftStr}" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Row="1" Text="{Binding CurrentDateTime}" FontSize="20" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<!--<TextBlock Grid.Column="1" Text="|" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Column="2" Text="SCADA" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,10,0"/>-->
</Grid> </Grid>
</StackPanel> </StackPanel>
</Grid> </Grid>

@ -248,9 +248,9 @@
</lvc:Axis> </lvc:Axis>
</lvc:CartesianChart.AxisX> </lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY> <lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="20"> <lvc:Axis FontSize="20" MinValue="0">
<lvc:Axis.Separator> <lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" > <lvc:Separator Step="10" Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator> </lvc:Separator>
</lvc:Axis.Separator> </lvc:Axis.Separator>
</lvc:Axis> </lvc:Axis>
@ -364,9 +364,9 @@
</lvc:Axis> </lvc:Axis>
</lvc:CartesianChart.AxisX> </lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY> <lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="20"> <lvc:Axis FontSize="20" MinValue="0">
<lvc:Axis.Separator> <lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" > <lvc:Separator Step="10" Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator> </lvc:Separator>
</lvc:Axis.Separator> </lvc:Axis.Separator>
</lvc:Axis> </lvc:Axis>

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:Aucma.Scada.UI.Page.AssemblyPlan" xmlns:local="clr-namespace:Aucma.Scada.UI.Page.AssemblyPlan"
xmlns:local1="clr-namespace:Aucma.Scada.UI.Converter.AssemblyPlan" xmlns:local1="clr-namespace:Aucma.Scada.UI.Converter.AssemblyPlan"
mc:Ignorable="d" mc:Ignorable="d"
Title="MES生产计划" Height="650" Width="900" Name="window" WindowStartupLocation="CenterScreen" FontFamily="Microsoft YaHei" Background="#1152AC" Title="MES生产计划" Height="650" Width="1000" Name="window" WindowStartupLocation="CenterScreen" FontFamily="Microsoft YaHei" Background="#1152AC"
ResizeMode="NoResize" > ResizeMode="NoResize" >
<Window.Resources> <Window.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}"> <Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
@ -146,9 +146,10 @@
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Binding="{Binding planCode}" Header="计划编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding planCode}" Header="计划编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding orderCode}" Header="工单编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding orderCode}" Header="工单编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding materialName}" Header="产品型号" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding materialCode}" Header="产品编码" Width="1.3*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding planAmount}" Header="计划数量" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding materialName}" Header="产品型号" Width="2.3*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding completeAmount}" Header="完成数量" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding planAmount}" Header="计划数量" Width="0.8*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding completeAmount}" Header="完成数量" Width="0.8*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding beginTime,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="开始时间" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding beginTime,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="开始时间" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>

@ -162,9 +162,9 @@
</lvc:Axis> </lvc:Axis>
</lvc:CartesianChart.AxisX> </lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY> <lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="15"> <lvc:Axis FontSize="15" MinValue="0">
<lvc:Axis.Separator> <lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" > <lvc:Separator Step="1" Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator> </lvc:Separator>
</lvc:Axis.Separator> </lvc:Axis.Separator>
</lvc:Axis> </lvc:Axis>

@ -92,18 +92,19 @@
<Border.Effect> <Border.Effect>
<DropShadowEffect Color="#1254AB" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect> <DropShadowEffect Color="#1254AB" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect>
</Border.Effect> </Border.Effect>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ItemsControl Grid.Column="0" ItemsSource="{Binding Shapes}" VerticalAlignment="Center" HorizontalAlignment="Center" > <ItemsControl Grid.Column="0" ItemsSource="{Binding Shapes}" VerticalAlignment="Center" HorizontalAlignment="Center" >
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<!--布局--> <!--布局-->
<ItemsPanelTemplate> <ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"></WrapPanel> <WrapPanel Orientation="Horizontal"></WrapPanel>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<!--控件模板--> <!--控件模板-->
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Control x:Name="ctrl" Width="450" Height="200" ></Control> <Control x:Name="ctrl" Width="550" Height="200" ></Control>
<DataTemplate.Triggers> <DataTemplate.Triggers>
<!--根据不同类型选择不同模板--> <!--根据不同类型选择不同模板-->
<DataTrigger Binding="{Binding spaceType}" Value="1"> <DataTrigger Binding="{Binding spaceType}" Value="1">
@ -116,7 +117,7 @@
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
<!--<RowDefinition Height="2*"/>--> <!--<RowDefinition Height="2*"/>-->
<RowDefinition Height="*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Row="0"> <Border Grid.Row="0">
@ -156,6 +157,7 @@
<Border Grid.Row="1"> <Border Grid.Row="1">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/> <RowDefinition/>
<!--<RowDefinition/> <!--<RowDefinition/>
<RowDefinition/>--> <RowDefinition/>-->
@ -163,6 +165,7 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<!--<ColumnDefinition Width="1*"/> <!--<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@ -170,13 +173,19 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border Grid.Column="0" Grid.Row="0" BorderBrush="White" BorderThickness="1" > <Border Grid.Column="0" Grid.Row="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="型号1" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="产品编码" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
<Border Grid.Column="1" Grid.Row="0" BorderBrush="White" BorderThickness="1"> <Border Grid.Column="1" Grid.Row="0" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.SubmitCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding Text, ElementName=spaceCodeText}" Background="Transparent"> <Button Command="{Binding DataContext.SubmitCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding Text, ElementName=spaceCodeText}" Background="Transparent">
<TextBlock Text="{Binding materialType}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" /> <TextBlock Text="{Binding materialType}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button> </Button>
</Border> </Border>
<Border Grid.Column="0" Grid.Row="1" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="产品名称" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" Grid.Row="1" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding typeNameA}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
<!--<Border Grid.Column="0" Grid.Row="1" BorderBrush="White" BorderThickness="1" > <!--<Border Grid.Column="0" Grid.Row="1" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="型号2" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="型号2" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
@ -206,6 +215,7 @@
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1" > <Border Grid.Column="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="状态" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="状态" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
@ -243,6 +253,11 @@
<TextBlock Text="出一个" Foreground="Green" FontSize="17" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" /> <TextBlock Text="出一个" Foreground="Green" FontSize="17" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button> </Button>
</Border> </Border>
<Border Grid.Column="7" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.OutAllCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding spaceCode}" Style="{StaticResource BUTTON_AGREE}" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<TextBlock Text="整道出" Foreground="Green" FontSize="17" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
</Grid> </Grid>
</Border> </Border>
</Grid> </Grid>
@ -258,6 +273,7 @@
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</ScrollViewer>
</Border> </Border>
<Border Grid.Column="1" BorderBrush="#1254AB" BorderThickness="2" Margin="5"> <Border Grid.Column="1" BorderBrush="#1254AB" BorderThickness="2" Margin="5">
@ -281,8 +297,8 @@
Foreground="#FFFFFF" > Foreground="#FFFFFF" >
<!--resourceStyle 399行修改选中字体颜色--> <!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Binding="{Binding spaceCode}" Header="货道编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding spaceCode}" Header="货道编号" Width="0.5*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding materialCode}" Header="物料编号" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding materialCode}" Header="物料编号" Width="1.2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding materialName}" Header="物料名称" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding materialName}" Header="物料名称" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn Binding="{Binding materialType}" Header="物料类型" Width="1*" IsReadOnly="True"/>--> <!--<DataGridTextColumn Binding="{Binding materialType}" Header="物料类型" Width="1*" IsReadOnly="True"/>-->
</DataGrid.Columns> </DataGrid.Columns>

@ -116,8 +116,8 @@
<TextBlock Text="选择型号: " FontSize="20" Foreground="#FFFFFF" /> <TextBlock Text="选择型号: " FontSize="20" Foreground="#FFFFFF" />
<RadioButton Content="型号1" GroupName="Direction" IsChecked="{Binding IsSelectedOptionA, Mode=TwoWay}" /> <RadioButton Content="型号1" GroupName="Direction" IsChecked="{Binding IsSelectedOptionA, Mode=TwoWay}" />
<RadioButton Content="型号2" GroupName="Direction" IsChecked="{Binding IsSelectedOptionB, Mode=TwoWay}" Margin="10 0 0 0"/> <!--<RadioButton Content="型号2" GroupName="Direction" IsChecked="{Binding IsSelectedOptionB, Mode=TwoWay}" Margin="10 0 0 0"/>
<RadioButton Content="型号3" GroupName="Direction" IsChecked="{Binding IsSelectedOptionC, Mode=TwoWay}" Margin="10 0 0 0"/> <RadioButton Content="型号3" GroupName="Direction" IsChecked="{Binding IsSelectedOptionC, Mode=TwoWay}" Margin="10 0 0 0"/>-->
</StackPanel> </StackPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">

@ -25,4 +25,4 @@ outstoreTaskType=2
#泡后扫码器IP #泡后扫码器IP
foamHikRobotIp=169.254.100.169 foamHikRobotIp=169.254.100.169
searchItems=SC232%SC233%SC234%150%%% searchItems=SC232%SC233%SC234%310%%%%

@ -1,6 +1,6 @@
[plcSystem] [plcSystem]
ナンコ<EFBFBD>LCIP=127.0.0.1 ナンコ<EFBFBD>LCIP=10.10.92.40
ナンコ<EFBFBD>LCカヒソレ=6000 ナンコ<EFBFBD>LCカヒソレ=2015
[foam_inStore_address] [foam_inStore_address]
Èë¿â»õµÀºÅ=D7000 Èë¿â»õµÀºÅ=D7000

@ -1,45 +1,45 @@
#泡后库货道信息 #是否已满=D7221 #货道状态=D7231 仓库状态=D7300 #设备状态字,0未启动状态,1已自动运行,2维修调试状态,禁止启动 #泡后库货道信息 #是否已满=D7221 #货道状态=D7231 仓库状态=D7300 #设备状态字,0未启动状态,1已自动运行,2维修调试状态,禁止启动
[FPJCK-001_PH_001] [PHK-001_PH_001]
在库数量=D7201 在库数量=D7201
在途数量=D7211 在途数量=D7211
入库完成=D7021 入库完成=D7021
出库完成=D7240 出库完成=D7240
[FPJCK-001_PH_002] [PHK-001_PH_002]
在库数量=D7202 在库数量=D7202
在途数量=D7212 在途数量=D7212
入库完成=D7022 入库完成=D7022
出库完成=D7240 出库完成=D7240
[FPJCK-001_PH_003] [PHK-001_PH_003]
在库数量=D7203 在库数量=D7203
在途数量=D7213 在途数量=D7213
入库完成=D7023 入库完成=D7023
出库完成=D7240 出库完成=D7240
[FPJCK-001_PH_004] [PHK-001_PH_004]
在库数量=D7204 在库数量=D7204
在途数量=D7214 在途数量=D7214
入库完成=D7024 入库完成=D7024
出库完成=D7240 出库完成=D7240
[FPJCK-001_PH_005] [PHK-001_PH_005]
在库数量=D7205 在库数量=D7205
在途数量=D7215 在途数量=D7215
入库完成=D7025 入库完成=D7025
出库完成=D7240 出库完成=D7240
[FPJCK-001_PH_006] [PHK-001_PH_006]
在库数量=D7206 在库数量=D7206
在途数量=D7216 在途数量=D7216
入库完成=D7026 入库完成=D7026
出库完成=D7240 出库完成=D7240
[FPJCK-001_PH_007] [PHK-001_PH_007]
在库数量=D7207 在库数量=D7207
在途数量=D7217 在途数量=D7217
入库完成=D7027 入库完成=D7027
出库完成=D7240 出库完成=D7240
[FPJCK-001_PH_008] [PHK-001_PH_008]
在库数量=D7208 在库数量=D7208
在途数量=D7218 在途数量=D7218
入库完成=D7028 入库完成=D7028
出库完成=D7240 出库完成=D7240
[FPJCK-001_PH_009] [PHK-001_PH_009]
在库数量=D7209 在库数量=D7209
在途数量=D7219 在途数量=D7219
入库完成=D7029 入库完成=D7029

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "84F515A86A4846FC82B9B47C7EDB54DC973761E8F2F843D1C81762A668D8806E" #pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1296D2EF215B5C9FF53838D5B9FC5A2B6B1D38722C6D080F11FEFF784D1288AA"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
@ -41,7 +41,7 @@ namespace Aucma.Scada.UI {
public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 82 "..\..\MainWindow.xaml" #line 87 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button instoreInfo; internal System.Windows.Controls.Button instoreInfo;
@ -49,7 +49,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 83 "..\..\MainWindow.xaml" #line 88 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button outstoreInfo; internal System.Windows.Controls.Button outstoreInfo;
@ -57,7 +57,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 84 "..\..\MainWindow.xaml" #line 89 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button taskInfo; internal System.Windows.Controls.Button taskInfo;
@ -65,7 +65,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 85 "..\..\MainWindow.xaml" #line 90 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button inventoryInfo; internal System.Windows.Controls.Button inventoryInfo;
@ -73,7 +73,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 86 "..\..\MainWindow.xaml" #line 91 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button assemblyPlan; internal System.Windows.Controls.Button assemblyPlan;
@ -81,7 +81,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 90 "..\..\MainWindow.xaml" #line 95 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button Minimized; internal System.Windows.Controls.Button Minimized;
@ -89,7 +89,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 91 "..\..\MainWindow.xaml" #line 96 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button Exit; internal System.Windows.Controls.Button Exit;
@ -97,7 +97,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 97 "..\..\MainWindow.xaml" #line 102 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush MesDbStatus; internal System.Windows.Media.ImageBrush MesDbStatus;
@ -105,7 +105,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 100 "..\..\MainWindow.xaml" #line 105 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock MesDbStateTxt; internal System.Windows.Controls.TextBlock MesDbStateTxt;
@ -113,7 +113,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 103 "..\..\MainWindow.xaml" #line 108 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush PlcStatus; internal System.Windows.Media.ImageBrush PlcStatus;
@ -121,7 +121,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 106 "..\..\MainWindow.xaml" #line 111 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock PLCState; internal System.Windows.Controls.TextBlock PLCState;
@ -129,7 +129,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 110 "..\..\MainWindow.xaml" #line 115 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush Scanner1Status; internal System.Windows.Media.ImageBrush Scanner1Status;
@ -137,7 +137,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 113 "..\..\MainWindow.xaml" #line 118 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock Scanner1; internal System.Windows.Controls.TextBlock Scanner1;

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "84F515A86A4846FC82B9B47C7EDB54DC973761E8F2F843D1C81762A668D8806E" #pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1296D2EF215B5C9FF53838D5B9FC5A2B6B1D38722C6D080F11FEFF784D1288AA"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
@ -41,7 +41,7 @@ namespace Aucma.Scada.UI {
public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 82 "..\..\MainWindow.xaml" #line 87 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button instoreInfo; internal System.Windows.Controls.Button instoreInfo;
@ -49,7 +49,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 83 "..\..\MainWindow.xaml" #line 88 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button outstoreInfo; internal System.Windows.Controls.Button outstoreInfo;
@ -57,7 +57,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 84 "..\..\MainWindow.xaml" #line 89 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button taskInfo; internal System.Windows.Controls.Button taskInfo;
@ -65,7 +65,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 85 "..\..\MainWindow.xaml" #line 90 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button inventoryInfo; internal System.Windows.Controls.Button inventoryInfo;
@ -73,7 +73,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 86 "..\..\MainWindow.xaml" #line 91 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button assemblyPlan; internal System.Windows.Controls.Button assemblyPlan;
@ -81,7 +81,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 90 "..\..\MainWindow.xaml" #line 95 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button Minimized; internal System.Windows.Controls.Button Minimized;
@ -89,7 +89,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 91 "..\..\MainWindow.xaml" #line 96 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button Exit; internal System.Windows.Controls.Button Exit;
@ -97,7 +97,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 97 "..\..\MainWindow.xaml" #line 102 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush MesDbStatus; internal System.Windows.Media.ImageBrush MesDbStatus;
@ -105,7 +105,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 100 "..\..\MainWindow.xaml" #line 105 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock MesDbStateTxt; internal System.Windows.Controls.TextBlock MesDbStateTxt;
@ -113,7 +113,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 103 "..\..\MainWindow.xaml" #line 108 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush PlcStatus; internal System.Windows.Media.ImageBrush PlcStatus;
@ -121,7 +121,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 106 "..\..\MainWindow.xaml" #line 111 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock PLCState; internal System.Windows.Controls.TextBlock PLCState;
@ -129,7 +129,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 110 "..\..\MainWindow.xaml" #line 115 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush Scanner1Status; internal System.Windows.Media.ImageBrush Scanner1Status;
@ -137,7 +137,7 @@ namespace Aucma.Scada.UI {
#line hidden #line hidden
#line 113 "..\..\MainWindow.xaml" #line 118 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock Scanner1; internal System.Windows.Controls.TextBlock Scanner1;

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\AssemblyPlan\AssemblyPlanControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "81BB58658FBF245B46897C7FED6C2717ED87387144DEA479AC0C7218AF0B119C" #pragma checksum "..\..\..\..\Page\AssemblyPlan\AssemblyPlanControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B4DB7DC5AC844B473794BE5AD1EA1C85167140643555D4BEB710FCAB6D553509"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\AssemblyPlan\AssemblyPlanControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "81BB58658FBF245B46897C7FED6C2717ED87387144DEA479AC0C7218AF0B119C" #pragma checksum "..\..\..\..\Page\AssemblyPlan\AssemblyPlanControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B4DB7DC5AC844B473794BE5AD1EA1C85167140643555D4BEB710FCAB6D553509"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\AssemblyPlan\PlanInfoEditWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B659539AE4E067497E0D82C0BD50A089445DAE70FC3F9B0813DCDEA948D7AC79" #pragma checksum "..\..\..\..\Page\AssemblyPlan\PlanInfoEditWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "A8BCABA5CBE8F206A8C3B8531F1994EAA59CB846EA6698F761A3BEFADAC62040"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\AssemblyPlan\PlanInfoEditWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B659539AE4E067497E0D82C0BD50A089445DAE70FC3F9B0813DCDEA948D7AC79" #pragma checksum "..\..\..\..\Page\AssemblyPlan\PlanInfoEditWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "A8BCABA5CBE8F206A8C3B8531F1994EAA59CB846EA6698F761A3BEFADAC62040"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7012E740612AEB51281394C4CADCE95451CE8202499FB91074E1297E31AD081D" #pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "27725EFE70A99F62EE757B45F2A95B25B711DC8F9DE032F083EE71DCD4D1E6DA"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7012E740612AEB51281394C4CADCE95451CE8202499FB91074E1297E31AD081D" #pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "27725EFE70A99F62EE757B45F2A95B25B711DC8F9DE032F083EE71DCD4D1E6DA"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\BomFoamRearInventory.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "43D95CFBDF80A87CAE8F4743F718368517E5C4F5064091D0BED61F628153B897" #pragma checksum "..\..\..\..\Page\InventoryInfo\BomFoamRearInventory.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "051C148C286C0C6F0D9F7368DD7DD9D694A4480FCEB90FF0E65EB555235E1435"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\BomFoamRearInventory.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "43D95CFBDF80A87CAE8F4743F718368517E5C4F5064091D0BED61F628153B897" #pragma checksum "..\..\..\..\Page\InventoryInfo\BomFoamRearInventory.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "051C148C286C0C6F0D9F7368DD7DD9D694A4480FCEB90FF0E65EB555235E1435"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\SelectType.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E46B7692378AE323FA368BD3CA7165488E519DC145B1B4257FFA345E50ED22CB" #pragma checksum "..\..\..\..\Page\InventoryInfo\SelectType.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "29806FD6F0358C6BE2BE294B297ED745F04A4F4E68973B3EEFC6268C197059E9"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\SelectType.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E46B7692378AE323FA368BD3CA7165488E519DC145B1B4257FFA345E50ED22CB" #pragma checksum "..\..\..\..\Page\InventoryInfo\SelectType.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "29806FD6F0358C6BE2BE294B297ED745F04A4F4E68973B3EEFC6268C197059E9"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -4,6 +4,7 @@ using Aucma.Scada.UI.Page.InventoryInfo;
using GalaSoft.MvvmLight; using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command; using GalaSoft.MvvmLight.Command;
using HighWayIot.Config; using HighWayIot.Config;
using HighWayIot.Plc;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
@ -30,6 +31,8 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
private AppConfig appConfig = AppConfig.Instance; private AppConfig appConfig = AppConfig.Instance;
private AssemblyPlanBusiness assemblyPlanBusiness = AssemblyPlanBusiness.Instance;
public BoxFoamRearInventoryViewModel() public BoxFoamRearInventoryViewModel()
{ {
@ -50,6 +53,8 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
SpaceDetailCommand = new RelayCommand<object>(obj => SpaceDetail(obj)); SpaceDetailCommand = new RelayCommand<object>(obj => SpaceDetail(obj));
OutOnlyOneCommand = new RelayCommand<object>(obj => OutOnlyOne(obj)); OutOnlyOneCommand = new RelayCommand<object>(obj => OutOnlyOne(obj));
OutAllCommand = new RelayCommand<object>(obj => OutAll(obj));
#endregion #endregion
outStoreBusiness.RefreshStoreStockEvent += Query; outStoreBusiness.RefreshStoreStockEvent += Query;
@ -141,6 +146,12 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
/// 出一个 /// 出一个
/// </summary> /// </summary>
public RelayCommand<object> OutOnlyOneCommand { get; set; } public RelayCommand<object> OutOnlyOneCommand { get; set; }
/// <summary>
/// 整条道出
/// </summary>
public RelayCommand<object> OutAllCommand { get; set; }
#endregion #endregion
/// <summary> /// <summary>
@ -158,7 +169,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
App.Current.Dispatcher.Invoke((Action)(() => App.Current.Dispatcher.Invoke((Action)(() =>
{ {
var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.foamStoreCode); var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.foamStoreCode).OrderBy(x=>x.objId);
if (info != null) if (info != null)
{ {
if (spaceItems.Count > 0) if (spaceItems.Count > 0)
@ -169,6 +180,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
foreach (var item in info) foreach (var item in info)
{ {
spaceItems.Add(item); spaceItems.Add(item);
} }
Shapes = spaceItems; Shapes = spaceItems;
} }
@ -286,6 +298,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
} }
} }
/// <summary> /// <summary>
/// 手动出一个 /// 手动出一个
/// </summary> /// </summary>
@ -293,6 +306,8 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
private void OutOnlyOne(object obj) private void OutOnlyOne(object obj)
{ {
string info = obj as string; string info = obj as string;
bool result = outStoreBusiness.OutOnlyOneBySpaceCode(appConfig.foamStoreCode, info); bool result = outStoreBusiness.OutOnlyOneBySpaceCode(appConfig.foamStoreCode, info);
if (result) if (result)
{ {
@ -304,6 +319,59 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
MessageBox.Show("出库任务创建失败"); MessageBox.Show("出库任务创建失败");
} }
} }
/// <summary>
/// 整条道出
/// </summary>
/// <param name="obj"></param>
private void OutAll(object obj)
{
string info = obj as string;
bool result = outStoreBusiness.OutAllBySpaceCode(appConfig.foamStoreCode, info);
if (result)
{
Query();
MessageBoxTimeoutA((IntPtr)0, $"出库任务创建成功3秒后关闭提示", "提示", 0, 0, 3000);
}
else
{
MessageBox.Show("出库任务创建失败");
}
}
///// <summary>
///// 手动出一个
///// </summary>
///// <param name="obj"></param>
//private void OutOnlyOne(object obj)
//{
// string info = obj as string;
// bool result = outStoreBusiness.OutOnlyOneBySpaceCode(appConfig.foamStoreCode, info);
// if (result)
// {
// Query();
// MessageBoxTimeoutA((IntPtr)0, $"出库任务创建成功3秒后关闭提示", "提示", 0, 0, 3000);
// }
// else
// {
// MessageBox.Show("出库任务创建失败");
// }
//}
///// <summary>
///// 整条道出
///// </summary>
///// <param name="obj"></param>
//private void OutAll(object obj)
//{
//}
} }
} }

@ -21,7 +21,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
{ {
InventoryOnClickCommand = new RelayCommand<object>(obj => InventoryOnClick(obj)); InventoryOnClickCommand = new RelayCommand<object>(obj => InventoryOnClick(obj));
InventoryControl = shellInventory; InventoryControl = boxFoamRearInventory;
} }
#region 参数定义 #region 参数定义

@ -293,7 +293,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
{ {
if (!string.IsNullOrEmpty(searchText)) if (!string.IsNullOrEmpty(searchText))
{ {
var infos = baseMaterialInfoService.getAllInfos().Where(x=>x.MaterialName.Contains(searchText)); var infos = baseMaterialInfoService.getAllInfos().Where(x=>x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText));
MaterialDataGrid.Clear(); MaterialDataGrid.Clear();
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {

@ -14,6 +14,7 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using System.Windows.Threading;
namespace Aucma.Scada.UI.viewModel namespace Aucma.Scada.UI.viewModel
{ {
@ -32,6 +33,14 @@ namespace Aucma.Scada.UI.viewModel
public MainViewModel() public MainViewModel()
{ {
// 创建一个DispatcherTimer对象
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(1);
timer.Tick += Timer_Tick;
timer.Start();
ControlOnClickCommand = new RelayCommand<object>(obj => ControlOnClick(obj)); ControlOnClickCommand = new RelayCommand<object>(obj => ControlOnClick(obj));
OpenSystemKeyboardCommand = new RelayCommand(OpenSystemKeyboard); OpenSystemKeyboardCommand = new RelayCommand(OpenSystemKeyboard);
@ -445,6 +454,39 @@ namespace Aucma.Scada.UI.viewModel
} }
#endregion #endregion
public string _currentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
public string CurrentDateTime
{
get => _currentDateTime;
set { _currentDateTime = value; RaisePropertyChanged(nameof(CurrentDateTime)); }
}
public string _shiftStr = string.Empty;
public string ShiftStr
{
get => _shiftStr;
set { _shiftStr = value; RaisePropertyChanged(nameof(ShiftStr)); }
}
private void Timer_Tick(object sender, EventArgs e)
{
DateTime now = DateTime.Now;
// 判断当前是否是白班时间段
if (now.Hour >= 8 && now.Hour < 20)
{
ShiftStr = $"白班 08点-20点";
}
else
{
ShiftStr = $"夜班 20点-08点";
}
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
} }
} }

@ -37,5 +37,14 @@ namespace HighWayIot.Repository.service
/// <param name="productPlanInfo"></param> /// <param name="productPlanInfo"></param>
/// <returns></returns> /// <returns></returns>
bool UpdateProductPlanInfo(ProductPlanInfo productPlanInfo); bool UpdateProductPlanInfo(ProductPlanInfo productPlanInfo);
/// <summary>
/// 通过物料编码找到生产计划
/// </summary>
/// <param name="productLineCode"></param>
/// <returns></returns>
ProductPlanInfo GetProductPlanInfosByMaterialCode(string materialCode);
} }
} }

@ -117,5 +117,33 @@ namespace HighWayIot.Repository.service.Impl
} }
return result; return result;
} }
/// <summary>
/// 通过物料编码和工位找到生产计划
/// </summary>
/// <param name="productLineCode"></param>
/// <returns></returns>
public ProductPlanInfo GetProductPlanInfosByMaterialCode(string materialCode)
{
ProductPlanInfo planInfo = null;
try
{
Expression<Func<ProductPlanInfo, bool>> exp = s1 => true;
exp = exp.And(x => x.materialCode == materialCode && x.productLineCode=="1006");
planInfo = _mesRepository.GetFirst(exp);
logHelper.Info($"根据物料编码{materialCode};获取到的计划信息:{jsonChange.ModeToJson(planInfo)}");
}
catch (Exception ex)
{
logHelper.Error("通过计划编号获取计划信息异常", ex);
}
return planInfo;
}
} }
} }

Loading…
Cancel
Save