change-入库完成不更新库存在途,开线程实时更新

change - 扫码器回调函数修改
collectionStore
liuwf 11 months ago
parent 4374e00852
commit f57c498a3a

@ -417,15 +417,15 @@ namespace Aucma.Scada.Business
// taskHandle.WritePlc(spaceInfo.storeCode, spaceInfo.spaceCode, true);
spaceInfo.materialType = taskInfo.materialType;
// spaceInfo.spaceStock = spaceInfo.spaceStock + 1;
// spaceInfo.spaceStock = spaceInfo.spaceStock + 1;
// spaceInfo.onRouteAmount -= 1;
//读取PLC获取货道信息存放数量、在途数量,
#region Add By wenjy 2023-10-30 13:44:00 通过PLC获取货道信息
var item = taskHandle.ReadSpaceInfoByPlc(spaceInfo);
// var item = taskHandle.ReadSpaceInfoByPlc(spaceInfo);
// spaceInfo.spaceStock = item.spaceStock;
spaceInfo.spaceStock = spaceInfo.spaceStock + 1;
spaceInfo.onRouteAmount = item.onRouteAmount;
// spaceInfo.spaceStock = spaceInfo.spaceStock + 1;
// spaceInfo.onRouteAmount = item.onRouteAmount;
// spaceInfo.spaceStatus = item.spaceStatus;
#endregion

@ -37,6 +37,12 @@ namespace Aucma.Scada.Business
private PlcPool _pool = PlcPool.Instance;
private PlcSpaceConfig spaceConfig = PlcSpaceConfig.Instance;
/// <summary>
/// 货道信息
/// </summary>
private IBaseSpaceInfoService _spaceInfoService;
#endregion
#region 私有变量
@ -89,11 +95,49 @@ namespace Aucma.Scada.Business
private InStoreTaskHandle()
{
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
_spaceInfoService = registerServices.GetService<IBaseSpaceInfoService>();
_plcDictionary = _pool.GetAll();
// RealReadFinish();
// RealReadFinish();
// RealUpdateSpaceInfoByPlc();
}
/// <summary>
/// 实时更新数据库货道数量----待测试
/// </summary>
private void RealUpdateSpaceInfoByPlc()
{
Task.Run(() =>
{
List<BaseSpaceInfo> spaceList = _spaceInfoService.GetSpaceInfosByStoreCode(appConfig.shellStoreCode, appConfig.linerStoreCode);
// List<SpaceAddress> spaceAddressList = spaceConfig.GetAllSpaceAddress(spaceList);
if (spaceList!=null && spaceList.Count>0)
{
Thread.Sleep(2000);
while (true)
{
foreach(BaseSpaceInfo spaceInfo in spaceList)
{
BaseSpaceInfo tempSpace = new BaseSpaceInfo();
tempSpace.storeCode = spaceInfo.storeCode;
tempSpace.spaceCode = spaceInfo.spaceCode;
ReadSpaceInfoByPlc(spaceInfo);
// 更新库存
if(tempSpace.spaceStock!=spaceInfo.spaceStock || tempSpace.onRouteAmount != spaceInfo.onRouteAmount)
{
spaceInfo.spaceStock = tempSpace.spaceStock;
spaceInfo.onRouteAmount = tempSpace.onRouteAmount;
}
}
Thread.Sleep(3000);
}
}
});
}
#region 20240221取消入库完成信号 判断箱壳,内胆入库是否完成
/// <summary>
/// 实时读取箱壳,内胆入库完成信号

@ -67,14 +67,23 @@ namespace Aucma.Scada.Business
Task.Run(() =>
{
Thread.Sleep(2000);
MvCodeHelper.DeviceListAcq();//获取创建设备
MvCodeHelper.StartGrab(); // 开启触发扫码接收数据
//MvCodeHelper1.DeviceListAcq();//获取创建设备
// MvCodeHelper1.StartGrab(); // 开启触发扫码接收数据
MvCodeHelper.Shell();
});
Task.Run(() =>
{
Thread.Sleep(2000);
//MvCodeHelper1.DeviceListAcq();//获取创建设备
// MvCodeHelper1.StartGrab(); // 开启触发扫码接收数据
MvCodeHelper.Liner();
});
}
catch (Exception ex)
{
MvCodeHelper.CloseAllDevice();
//MvCodeHelper.CloseAllDevice();
InitHikRobot();
}
}
@ -86,7 +95,7 @@ namespace Aucma.Scada.Business
{
try
{
MvCodeHelper.CloseAllDevice();
//MvCodeHelper.CloseAllDevice();
}
catch (Exception ex)
{

@ -657,6 +657,7 @@ namespace Aucma.Scada.Business
if (spaceInfo.spaceStock == 0)
{
spaceInfo.materialType = string.Empty;
spaceInfo.typeNameA = string.Empty;
}
_spaceInfoService.UpdateSpaceInfo(spaceInfo);

@ -46,6 +46,7 @@
<ItemGroup>
<Compile Include="GrabImage.cs" />
<Compile Include="MvCodeHelper.cs" />
<Compile Include="MvCodeHelper2.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>

@ -17,6 +17,12 @@ namespace Aucma.Core.Scanner
private static AppConfig appConfig = AppConfig.Instance;
public static bool m_bGrabbing = true;
private static string lastCode;
// 内胆扫码器ip
private static string LinerScannerIp = appConfig.linerHikRobotIp;
// 箱壳扫码器ip
private static string ShellScannerIp = appConfig.shellHikRobotIp;
#region 委托事件
public delegate void RefreshMaterialCodeStr(string materialCodeStr, string ip);
public static event RefreshMaterialCodeStr RefreshMaterialCodeStrEvent;
@ -28,264 +34,326 @@ namespace Aucma.Core.Scanner
public static event RefreshLogMessage RefreshLogMessageEvent;
#endregion
// 获取到的所有设备
public static MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST m_stDeviceList = new MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST();
// (成功创建)连接上的设备和其ip(string)集合
public static Dictionary<string, MvCodeReader> m_cMyDevices = new Dictionary<string, MvCodeReader>();
#region 设备连接状态
/// <summary>
/// 获取不到任务设备即连接失败
/// </summary>
/// <returns></returns>
public static bool ConnectionStatus(string ip)
public static void ShellImageCallbackFunc(IntPtr pData, IntPtr pstFrameInfoEx2, IntPtr pUser)
{
// 遍历所有已打开相机
foreach (var hashmap in m_cMyDevices)
var stFrameInfo = (MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)Marshal.PtrToStructure(pstFrameInfoEx2, typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2));
MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2 stBcrResult = (MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)Marshal.PtrToStructure(stFrameInfo.UnparsedBcrList.pstCodeListEx2, typeof(MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2));
Console.WriteLine("CodeNum[" + Convert.ToString(stBcrResult.nCodeNum) + "]");
for (Int32 i = 0; i < stBcrResult.nCodeNum; i++)
{
if (ip.Equals(hashmap.Key))
bool bIsValidUTF8 = IsTextUTF8(stBcrResult.stBcrInfoEx2[i].chCode);
if (bIsValidUTF8)
{
string strCode = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
Console.WriteLine("Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
}
else
{
return true;
string strCode = Encoding.GetEncoding("GB2312").GetString(stBcrResult.stBcrInfoEx2[i].chCode);
Console.WriteLine("Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp);
}
}
//// 没有连接上,重新获取并创建设备
//Task.Run(() =>
//{
// DeviceListAcq();
//});
return false;
MvCodeReader.MV_CODEREADER_OCR_INFO_LIST stOcrInfo = (MvCodeReader.MV_CODEREADER_OCR_INFO_LIST)Marshal.PtrToStructure(stFrameInfo.UnparsedOcrList.pstOcrList, typeof(MvCodeReader.MV_CODEREADER_OCR_INFO_LIST));
for (int i = 0; i < stOcrInfo.nOCRAllNum; i++)
{
string strOcrCharCode = Encoding.UTF8.GetString(stOcrInfo.stOcrRowInfo[i].chOcr);
Console.WriteLine("Get OcrInfo:" + "ocrNum[" + i.ToString() + "], ocrLen[" + Convert.ToString(stOcrInfo.stOcrRowInfo[i].nOcrLen) + "], ocrChar[" + strOcrCharCode.Trim().TrimEnd('\0') + "]");
}
}
#endregion
#region 获取并创建设备列表
/// <summary>
/// 获取并创建设备列表
/// </summary>
public static void DeviceListAcq()
public static void LinerImageCallbackFunc(IntPtr pData, IntPtr pstFrameInfoEx2, IntPtr pUser)
{
try
var stFrameInfo = (MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)Marshal.PtrToStructure(pstFrameInfoEx2, typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2));
MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2 stBcrResult = (MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)Marshal.PtrToStructure(stFrameInfo.UnparsedBcrList.pstCodeListEx2, typeof(MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2));
Console.WriteLine("CodeNum[" + Convert.ToString(stBcrResult.nCodeNum) + "]");
for (Int32 i = 0; i < stBcrResult.nCodeNum; i++)
{
RefreshLogMessageEvent?.Invoke("获取扫码器设备列表,进入DeviceListAcq()方法");
// 内胆扫码器ip
string LinerScannerIp = appConfig.linerHikRobotIp;
// 箱壳扫码器ip
string ShellScannerIp = appConfig.shellHikRobotIp;
System.GC.Collect();
m_stDeviceList.nDeviceNum = 0;
// 获取设备列表
int nRet = MvCodeReader.MV_CODEREADER_EnumDevices_NET(ref m_stDeviceList, MvCodeReader.MV_CODEREADER_GIGE_DEVICE);
if (0 != nRet)
bool bIsValidUTF8 = IsTextUTF8(stBcrResult.stBcrInfoEx2[i].chCode);
if (bIsValidUTF8)
{
RefreshLogMessageEvent?.Invoke("获取扫码器列表失败,扫码器错误码:" + nRet);
return;
string strCode = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
Console.WriteLine("Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
}
if (0 == m_stDeviceList.nDeviceNum)
else
{
RefreshLogMessageEvent?.Invoke("获取扫码器数量为0请检查扫码器连接:");
return;
string strCode = Encoding.GetEncoding("GB2312").GetString(stBcrResult.stBcrInfoEx2[i].chCode);
Console.WriteLine("Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), LinerScannerIp);
}
}
MvCodeReader m_cMyDevice = new MvCodeReader();
//创建所有设备
for (int i = 0; i < m_stDeviceList.nDeviceNum; i++)
{
MvCodeReader.MV_CODEREADER_DEVICE_INFO stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(m_stDeviceList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
if (stDevInfo.nTLayerType == MvCodeReader.MV_CODEREADER_GIGE_DEVICE)
{
IntPtr buffer = Marshal.UnsafeAddrOfPinnedArrayElement(stDevInfo.SpecialInfo.stGigEInfo, 0);
MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO stGigEDeviceInfo = (MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO)Marshal.PtrToStructure(buffer, typeof(MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO));
MvCodeReader.MV_CODEREADER_OCR_INFO_LIST stOcrInfo = (MvCodeReader.MV_CODEREADER_OCR_INFO_LIST)Marshal.PtrToStructure(stFrameInfo.UnparsedOcrList.pstOcrList, typeof(MvCodeReader.MV_CODEREADER_OCR_INFO_LIST));
// 获取ip
string ip = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8) + "." + (stGigEDeviceInfo.nCurrentIp & 0x000000ff);
// 只连接配置的扫码器
if (!ip.Equals(LinerScannerIp) && !ip.Equals(ShellScannerIp)) continue;
Console.Write("扫码器设备[" + i + "],ip:" + ip);
// 创建第i个设备
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);//创建设备
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("创建第" + i + "个扫码器设备失败,ip:" + ip);
return;
}
// 打开设备
nRet = m_cMyDevice.MV_CODEREADER_OpenDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
m_cMyDevice.MV_CODEREADER_DestroyHandle_NET();
Console.WriteLine("Device open fail!");
return;
}
RefreshLogMessageEvent?.Invoke("创建并打开第" + i + "个扫码器设备成功,ip:" + ip);
//设置触发模式
//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)
//{
// Console.WriteLine("设置触发模式失败");
// return;
//}
//添加到集合
m_cMyDevices.Add(ip, m_cMyDevice);
}
}
}
catch (Exception ex)
Console.WriteLine("ocrAllNum[" + Convert.ToString(stOcrInfo.nOCRAllNum) + "]");
for (int i = 0; i < stOcrInfo.nOCRAllNum; i++)
{
Console.WriteLine("获取和创建设备异常:" + ex);
string strOcrCharCode = Encoding.UTF8.GetString(stOcrInfo.stOcrRowInfo[i].chOcr);
Console.WriteLine("Get OcrInfo:" + "ocrNum[" + i.ToString() + "], ocrLen[" + Convert.ToString(stOcrInfo.stOcrRowInfo[i].nOcrLen) + "], ocrChar[" + strOcrCharCode.Trim().TrimEnd('\0') + "]");
}
}
#endregion
#region 光电触发扫码器接收条码处理业务
public static void StartGrab()
public static void Shell()
{
try
MvCodeReader.cbOutputEx2delegate ImageCallback;
MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2 stFrameInfo = new MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2();
MvCodeReader device = new MvCodeReader();
int nRet = MvCodeReader.MV_CODEREADER_OK;
do
{
int nRet = MvCodeReader.MV_CODEREADER_OK;
// 3.开启抓图
int nCount = 0;
IntPtr pData = IntPtr.Zero;
MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2 stFrameInfoEx2 = new MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2();
IntPtr pstFrameInfoEx2 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)));
Marshal.StructureToPtr(stFrameInfoEx2, pstFrameInfoEx2, false);
foreach (var hashmap in m_cMyDevices)
// ch:枚举设备 | en:Enum device
MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST stDevList = new MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST();
nRet = MvCodeReader.MV_CODEREADER_EnumDevices_NET(ref stDevList, MvCodeReader.MV_CODEREADER_GIGE_DEVICE);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Enum device failed:{0:x8}", nRet);
break;
}
Console.WriteLine("Enum device count : " + Convert.ToString(stDevList.nDeviceNum));
if (0 == stDevList.nDeviceNum)
{
Task.Run(() =>
break;
}
MvCodeReader.MV_CODEREADER_DEVICE_INFO stDevInfo; // 通用设备信息
Int32 nDevIndex = -1;
// ch:打印设备信息 | en:Print device info
for (Int32 i = 0; i < stDevList.nDeviceNum; i++)
{
stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
if (MvCodeReader.MV_CODEREADER_GIGE_DEVICE == stDevInfo.nTLayerType)
{
nRet = hashmap.Value.MV_CODEREADER_StartGrabbing_NET();
while (m_bGrabbing)
MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO stGigEDeviceInfo = (MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO)MvCodeReader.ByteToStruct(stDevInfo.SpecialInfo.stGigEInfo, typeof(MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO));
uint nIp1 = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24);
uint nIp2 = ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16);
uint nIp3 = ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8);
uint nIp4 = (stGigEDeviceInfo.nCurrentIp & 0x000000ff);
// Console.WriteLine("\n" + i.ToString() + ": [GigE] User Define Name : " + stGigEDeviceInfo.chUserDefinedName);
// Console.WriteLine("device IP :" + nIp1 + "." + nIp2 + "." + nIp3 + "." + nIp4);
string ipStr = nIp1 + "." + nIp2 + "." + nIp3 + "." + nIp4;
if (ipStr == ShellScannerIp)
{
// 光电触发了有图像
nRet = hashmap.Value.MV_CODEREADER_GetOneFrameTimeoutEx2_NET(ref pData, pstFrameInfoEx2, 1000);
// ch:获取一帧图像 | en:Get one image
if (MvCodeReader.MV_CODEREADER_OK == nRet)
{
stFrameInfoEx2 = (MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)Marshal.PtrToStructure(pstFrameInfoEx2, typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2));
// 分配条码内存空间
MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2 stBcrResult = (MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)Marshal.PtrToStructure(stFrameInfoEx2.UnparsedBcrList.pstCodeListEx2, typeof(MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2));
for (int i = 0; i < stBcrResult.nCodeNum; ++i)
{
bool bIsValidUTF8 = IsTextUTF8(stBcrResult.stBcrInfoEx2[i].chCode);
if (bIsValidUTF8)
{
// string strCode = System.Text.Encoding.Default.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
string strCode = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
// logHelper.Info("bIsValidUTF8:: Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
}
else
{
byte[] buffer = new byte[22];
if (stBcrResult.stBcrInfoEx2[i].chCode.Length > 0)
{
Array.Copy(stBcrResult.stBcrInfoEx2[i].chCode, buffer, 22);
}
string strCode = Encoding.GetEncoding("UTF-8").GetString(buffer).Trim().TrimEnd('\0');
RefreshLogMessageEvent?.Invoke("相机ip:" + hashmap.Key + " Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode + "]");
if (!string.IsNullOrEmpty(strCode) && lastCode != strCode)
{
RefreshMaterialCodeStrEvent?.Invoke(strCode, hashmap.Key);
lastCode = strCode;
}
}
}
}
Thread.Sleep(500);
nDevIndex = i;
Console.WriteLine("device IP :" + ipStr);
}
});
}
}
if (nDevIndex < 0) return;
stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[nDevIndex], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
// ch:创建设备 | en:Create device
nRet = device.MV_CODEREADER_CreateHandle_NET(ref stDevInfo);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Create device failed:{0:x8}", nRet);
break;
}
}
catch (Exception ex)
// ch:打开设备 | en:Open device
nRet = device.MV_CODEREADER_OpenDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Open device failed:{0:x8}", nRet);
break;
}
// ch:注册回调函数 | en:Register image callback
ImageCallback = new MvCodeReader.cbOutputEx2delegate(ShellImageCallbackFunc);
nRet = device.MV_CODEREADER_RegisterImageCallBackEx2_NET(ImageCallback, IntPtr.Zero);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Register image callback failed!");
break;
}
// ch:开启抓图 || en: start grab image
nRet = device.MV_CODEREADER_StartGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Start grabbing failed:{0:x8}", nRet);
break;
}
Console.WriteLine("Press enter to exit");
Console.ReadLine();
// ch:停止抓图 | en:Stop grabbing
nRet = device.MV_CODEREADER_StopGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Stop grabbing failed{0:x8}", nRet);
break;
}
// ch:关闭设备 | en:Close device
nRet = device.MV_CODEREADER_CloseDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Close device failed{0:x8}", nRet);
break;
}
// ch:销毁设备 | en:Destroy device
nRet = device.MV_CODEREADER_DestroyHandle_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Destroy device failed:{0:x8}", nRet);
break;
}
} while (false);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("扫码异常:" + ex);
// ch:销毁设备 | en:Destroy device
nRet = device.MV_CODEREADER_DestroyHandle_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Destroy device failed:{0:x8}", nRet);
}
}
}
#endregion
#region 关闭所有设备
public static void CloseAllDevice()
public static void Liner()
{
try
MvCodeReader.cbOutputEx2delegate ImageCallback;
MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2 stFrameInfo = new MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2();
MvCodeReader device = new MvCodeReader();
int nRet = MvCodeReader.MV_CODEREADER_OK;
do
{
Console.WriteLine("开始关闭所有设备");
int nRet = MvCodeReader.MV_CODEREADER_OK;
// 关闭所有已打开相机
foreach (var hashmap in m_cMyDevices)
// ch:枚举设备 | en:Enum device
MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST stDevList = new MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST();
nRet = MvCodeReader.MV_CODEREADER_EnumDevices_NET(ref stDevList, MvCodeReader.MV_CODEREADER_GIGE_DEVICE);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
// ch:停止抓图 | en:Stop grab image
nRet = hashmap.Value.MV_CODEREADER_StopGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备ip:" + hashmap.Value + "停止抓图失败");
Console.WriteLine("Stop grabbing failed{0:x8}", nRet);
}
// ch:关闭设备 | en:Close device
nRet = hashmap.Value.MV_CODEREADER_CloseDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备ip:" + hashmap.Value + "关闭失败");
Console.WriteLine("Enum device failed:{0:x8}", nRet);
break;
}
Console.WriteLine("Enum device count : " + Convert.ToString(stDevList.nDeviceNum));
if (0 == stDevList.nDeviceNum)
{
break;
}
}
MvCodeReader.MV_CODEREADER_DEVICE_INFO stDevInfo; // 通用设备信息
Int32 nDevIndex = -1;
// ch:打印设备信息 | en:Print device info
for (Int32 i = 0; i < stDevList.nDeviceNum; i++)
{
stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
// ch:销毁设备 | en:Destroy device
nRet = hashmap.Value.MV_CODEREADER_DestroyHandle_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
if (MvCodeReader.MV_CODEREADER_GIGE_DEVICE == stDevInfo.nTLayerType)
{
Console.WriteLine("设备ip:" + hashmap.Value + "销毁失败");
MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO stGigEDeviceInfo = (MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO)MvCodeReader.ByteToStruct(stDevInfo.SpecialInfo.stGigEInfo, typeof(MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO));
uint nIp1 = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24);
uint nIp2 = ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16);
uint nIp3 = ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8);
uint nIp4 = (stGigEDeviceInfo.nCurrentIp & 0x000000ff);
// Console.WriteLine("\n" + i.ToString() + ": [GigE] User Define Name : " + stGigEDeviceInfo.chUserDefinedName);
string ip = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8) + "." + (stGigEDeviceInfo.nCurrentIp & 0x000000ff);
string ipStr = nIp1 + "." + nIp2 + "." + nIp3 + "." + nIp4;
if (ipStr == LinerScannerIp)
{
Console.WriteLine("device IP :" + ipStr);
nDevIndex = i;
}
}
Console.WriteLine("设备ip:" + hashmap.Value + "关闭成功!");
}
}
catch (Exception ex)
{
Console.WriteLine("设备关闭异常:" + ex);
}
if (nDevIndex < 0) return;
stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[nDevIndex], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
// ch:创建设备 | en:Create device
nRet = device.MV_CODEREADER_CreateHandle_NET(ref stDevInfo);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Create device failed:{0:x8}", nRet);
break;
}
}
#endregion
// ch:打开设备 | en:Open device
nRet = device.MV_CODEREADER_OpenDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Open device failed:{0:x8}", nRet);
break;
}
#region 关闭指定设备
public void CloseDevice(KeyValuePair<MvCodeReader, string> hashmap)
{
try
{
int nRet = MvCodeReader.MV_CODEREADER_OK;
// ch:停止抓图 | en:Stop grab image
nRet = hashmap.Key.MV_CODEREADER_StopGrabbing_NET();
// ch:注册回调函数 | en:Register image callback
ImageCallback = new MvCodeReader.cbOutputEx2delegate(LinerImageCallbackFunc);
nRet = device.MV_CODEREADER_RegisterImageCallBackEx2_NET(ImageCallback, IntPtr.Zero);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Register image callback failed!");
break;
}
// ch:开启抓图 || en: start grab image
nRet = device.MV_CODEREADER_StartGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Start grabbing failed:{0:x8}", nRet);
break;
}
Console.WriteLine("Press enter to exit");
Console.ReadLine();
// ch:停止抓图 | en:Stop grabbing
nRet = device.MV_CODEREADER_StopGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备ip:" + hashmap.Value + "停止抓图失败");
Console.WriteLine("Stop grabbing failed{0:x8}", nRet);
return;
break;
}
// ch:关闭设备 | en:Close device
nRet = hashmap.Key.MV_CODEREADER_CloseDevice_NET();
nRet = device.MV_CODEREADER_CloseDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备ip:" + hashmap.Value + "关闭失败");
return;
Console.WriteLine("Close device failed{0:x8}", nRet);
break;
}
}
catch (Exception ex)
// ch:销毁设备 | en:Destroy device
nRet = device.MV_CODEREADER_DestroyHandle_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Destroy device failed:{0:x8}", nRet);
break;
}
} while (false);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备关闭异常:" + ex);
// ch:销毁设备 | en:Destroy device
nRet = device.MV_CODEREADER_DestroyHandle_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Destroy device failed:{0:x8}", nRet);
}
}
}
#endregion
}
#region 判断字符编码
/// <summary>
@ -360,28 +428,6 @@ namespace Aucma.Core.Scanner
#endregion
#region 将Byte转换为结构体类型
//将Byte转换为结构体类型
public static object ByteToStruct(byte[] bytes, Type type)
{
int size = Marshal.SizeOf(type);
if (size > bytes.Length)
{
return null;
}
//分配结构体内存空间
IntPtr structPtr = Marshal.AllocHGlobal(size);
//将byte数组拷贝到分配好的内存空间
Marshal.Copy(bytes, 0, structPtr, size);
//将内存空间转换为目标结构体
object obj = Marshal.PtrToStructure(structPtr, type);
//释放内存空间
Marshal.FreeHGlobal(structPtr);
return obj;
}
#endregion
}
}

@ -0,0 +1,392 @@
using MvCodeReaderSDKNet;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using static System.Runtime.CompilerServices.RuntimeHelpers;
using HighWayIot.Log4net;
using HighWayIot.Config;
using System.Security.Policy;
namespace Aucma.Core.Scanner
{
public class MvCodeHelper2
{
private static AppConfig appConfig = AppConfig.Instance;
public static bool m_bGrabbing = true;
private static string lastCode;
#region 委托事件
public delegate void RefreshMaterialCodeStr(string materialCodeStr, string ip);
public static event RefreshMaterialCodeStr RefreshMaterialCodeStrEvent;
/// <summary>
/// 日志信息刷新
/// </summary>
/// <param name="message"></param>
public delegate void RefreshLogMessage(string message);
public static event RefreshLogMessage RefreshLogMessageEvent;
#endregion
// 获取到的所有设备
public static MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST m_stDeviceList = new MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST();
// (成功创建)连接上的设备和其ip(string)集合
public static Dictionary<string, MvCodeReader> m_cMyDevices = new Dictionary<string, MvCodeReader>();
#region 设备连接状态
/// <summary>
/// 获取不到任务设备即连接失败
/// </summary>
/// <returns></returns>
public static bool ConnectionStatus(string ip)
{
// 遍历所有已打开相机
foreach (var hashmap in m_cMyDevices)
{
if (ip.Equals(hashmap.Key))
{
return true;
}
}
//// 没有连接上,重新获取并创建设备
//Task.Run(() =>
//{
// DeviceListAcq();
//});
return false;
}
#endregion
#region 获取并创建设备列表
/// <summary>
/// 获取并创建设备列表
/// </summary>
public static void DeviceListAcq()
{
try
{
RefreshLogMessageEvent?.Invoke("获取扫码器设备列表,进入DeviceListAcq()方法");
// 内胆扫码器ip
string LinerScannerIp = appConfig.linerHikRobotIp;
// 箱壳扫码器ip
string ShellScannerIp = appConfig.shellHikRobotIp;
System.GC.Collect();
m_stDeviceList.nDeviceNum = 0;
// 获取设备列表
int nRet = MvCodeReader.MV_CODEREADER_EnumDevices_NET(ref m_stDeviceList, MvCodeReader.MV_CODEREADER_GIGE_DEVICE);
if (0 != nRet)
{
RefreshLogMessageEvent?.Invoke("获取扫码器列表失败,扫码器错误码:" + nRet);
return;
}
if (0 == m_stDeviceList.nDeviceNum)
{
RefreshLogMessageEvent?.Invoke("获取扫码器数量为0请检查扫码器连接:");
return;
}
MvCodeReader m_cMyDevice = new MvCodeReader();
//创建所有设备
for (int i = 0; i < m_stDeviceList.nDeviceNum; i++)
{
MvCodeReader.MV_CODEREADER_DEVICE_INFO stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(m_stDeviceList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
if (stDevInfo.nTLayerType == MvCodeReader.MV_CODEREADER_GIGE_DEVICE)
{
IntPtr buffer = Marshal.UnsafeAddrOfPinnedArrayElement(stDevInfo.SpecialInfo.stGigEInfo, 0);
MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO stGigEDeviceInfo = (MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO)Marshal.PtrToStructure(buffer, typeof(MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO));
// 获取ip
string ip = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8) + "." + (stGigEDeviceInfo.nCurrentIp & 0x000000ff);
// 只连接配置的扫码器
if (!ip.Equals(LinerScannerIp) && !ip.Equals(ShellScannerIp)) continue;
Console.Write("扫码器设备[" + i + "],ip:" + ip);
// 创建第i个设备
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);//创建设备
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("创建第" + i + "个扫码器设备失败,ip:" + ip);
return;
}
// 打开设备
nRet = m_cMyDevice.MV_CODEREADER_OpenDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
m_cMyDevice.MV_CODEREADER_DestroyHandle_NET();
Console.WriteLine("Device open fail!");
return;
}
RefreshLogMessageEvent?.Invoke("创建并打开第" + i + "个扫码器设备成功,ip:" + ip);
//设置触发模式
//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)
//{
// Console.WriteLine("设置触发模式失败");
// return;
//}
//添加到集合
m_cMyDevices.Add(ip, m_cMyDevice);
}
}
}
catch (Exception ex)
{
Console.WriteLine("获取和创建设备异常:" + ex);
}
}
#endregion
#region 光电触发扫码器接收条码处理业务
public static void StartGrab()
{
try
{
int nRet = MvCodeReader.MV_CODEREADER_OK;
// 3.开启抓图
int nCount = 0;
IntPtr pData = IntPtr.Zero;
MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2 stFrameInfoEx2 = new MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2();
IntPtr pstFrameInfoEx2 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)));
Marshal.StructureToPtr(stFrameInfoEx2, pstFrameInfoEx2, false);
foreach (var hashmap in m_cMyDevices)
{
Task.Run(() =>
{
nRet = hashmap.Value.MV_CODEREADER_StartGrabbing_NET();
while (m_bGrabbing)
{
// 光电触发了有图像
nRet = hashmap.Value.MV_CODEREADER_GetOneFrameTimeoutEx2_NET(ref pData, pstFrameInfoEx2, 1000);
// ch:获取一帧图像 | en:Get one image
if (MvCodeReader.MV_CODEREADER_OK == nRet)
{
stFrameInfoEx2 = (MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)Marshal.PtrToStructure(pstFrameInfoEx2, typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2));
// 分配条码内存空间
MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2 stBcrResult = (MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)Marshal.PtrToStructure(stFrameInfoEx2.UnparsedBcrList.pstCodeListEx2, typeof(MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2));
for (int i = 0; i < stBcrResult.nCodeNum; ++i)
{
bool bIsValidUTF8 = IsTextUTF8(stBcrResult.stBcrInfoEx2[i].chCode);
if (bIsValidUTF8)
{
// string strCode = System.Text.Encoding.Default.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
string strCode = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
// logHelper.Info("bIsValidUTF8:: Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
}
else
{
byte[] buffer = new byte[22];
if (stBcrResult.stBcrInfoEx2[i].chCode.Length > 0)
{
Array.Copy(stBcrResult.stBcrInfoEx2[i].chCode, buffer, 22);
}
string strCode = Encoding.GetEncoding("UTF-8").GetString(buffer).Trim().TrimEnd('\0');
RefreshLogMessageEvent?.Invoke("相机ip:" + hashmap.Key + " Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode + "]");
if (!string.IsNullOrEmpty(strCode) && lastCode != strCode)
{
RefreshMaterialCodeStrEvent?.Invoke(strCode, hashmap.Key);
lastCode = strCode;
}
}
}
}
Thread.Sleep(500);
}
});
}
}
catch (Exception ex)
{
Console.WriteLine("扫码异常:" + ex);
}
}
#endregion
#region 关闭所有设备
public static void CloseAllDevice()
{
try
{
Console.WriteLine("开始关闭所有设备");
int nRet = MvCodeReader.MV_CODEREADER_OK;
// 关闭所有已打开相机
foreach (var hashmap in m_cMyDevices)
{
// ch:停止抓图 | en:Stop grab image
nRet = hashmap.Value.MV_CODEREADER_StopGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备ip:" + hashmap.Value + "停止抓图失败");
Console.WriteLine("Stop grabbing failed{0:x8}", nRet);
}
// ch:关闭设备 | en:Close device
nRet = hashmap.Value.MV_CODEREADER_CloseDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备ip:" + hashmap.Value + "关闭失败");
}
// ch:销毁设备 | en:Destroy device
nRet = hashmap.Value.MV_CODEREADER_DestroyHandle_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备ip:" + hashmap.Value + "销毁失败");
}
Console.WriteLine("设备ip:" + hashmap.Value + "关闭成功!");
}
}
catch (Exception ex)
{
Console.WriteLine("设备关闭异常:" + ex);
}
}
#endregion
#region 关闭指定设备
public void CloseDevice(KeyValuePair<MvCodeReader, string> hashmap)
{
try
{
int nRet = MvCodeReader.MV_CODEREADER_OK;
// ch:停止抓图 | en:Stop grab image
nRet = hashmap.Key.MV_CODEREADER_StopGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备ip:" + hashmap.Value + "停止抓图失败");
Console.WriteLine("Stop grabbing failed{0:x8}", nRet);
return;
}
// ch:关闭设备 | en:Close device
nRet = hashmap.Key.MV_CODEREADER_CloseDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设备ip:" + hashmap.Value + "关闭失败");
return;
}
}
catch (Exception ex)
{
Console.WriteLine("设备关闭异常:" + ex);
}
}
#endregion
#region 判断字符编码
/// <summary>
/// 判断字符编码
/// </summary>
/// <param name="inputStream"></param>
/// <returns></returns>
public static bool IsTextUTF8(byte[] inputStream)
{
int encodingBytesCount = 0;
bool allTextsAreASCIIChars = true;
for (int i = 0; i < inputStream.Length; i++)
{
byte current = inputStream[i];
if ((current & 0x80) == 0x80)
{
allTextsAreASCIIChars = false;
}
// First byte
if (encodingBytesCount == 0)
{
if ((current & 0x80) == 0)
{
// ASCII chars, from 0x00-0x7F
continue;
}
if ((current & 0xC0) == 0xC0)
{
encodingBytesCount = 1;
current <<= 2;
// More than two bytes used to encoding a unicode char.
// Calculate the real length.
while ((current & 0x80) == 0x80)
{
current <<= 1;
encodingBytesCount++;
}
}
else
{
// Invalid bits structure for UTF8 encoding rule.
return false;
}
}
else
{
// Following bytes, must start with 10.
if ((current & 0xC0) == 0x80)
{
encodingBytesCount--;
}
else
{
// Invalid bits structure for UTF8 encoding rule.
return false;
}
}
}
if (encodingBytesCount != 0)
{
// Invalid bits structure for UTF8 encoding rule.
// Wrong following bytes count.
return false;
}
// Although UTF8 supports encoding for ASCII chars, we regard as a input stream, whose contents are all ASCII as default encoding.
return !allTextsAreASCIIChars;
}
#endregion
#region 将Byte转换为结构体类型
//将Byte转换为结构体类型
public static object ByteToStruct(byte[] bytes, Type type)
{
int size = Marshal.SizeOf(type);
if (size > bytes.Length)
{
return null;
}
//分配结构体内存空间
IntPtr structPtr = Marshal.AllocHGlobal(size);
//将byte数组拷贝到分配好的内存空间
Marshal.Copy(bytes, 0, structPtr, size);
//将内存空间转换为目标结构体
object obj = Marshal.PtrToStructure(structPtr, type);
//释放内存空间
Marshal.FreeHGlobal(structPtr);
return obj;
}
#endregion
}
}

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{43123E0B-B3B0-4FB4-A508-007D644B3E7C}</ProjectGuid>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<RootNamespace>Aucma.Scada.UI</RootNamespace>
<AssemblyName>Aucma.Scada.UI</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>

@ -0,0 +1,176 @@
<HR COLOR=red>
异常时间2024-02-27 14:24:14,319 [6] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 已取消一个任务。<br> <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 15:06:19,631 [34] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 15:53:28,010 [14] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 内胆入库任务下发异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.SendLinerTask_InStore(RealTaskInfo taskInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 347 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 15:53:30,030 [14] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 内胆入库任务下发异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.SendLinerTask_InStore(RealTaskInfo taskInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 347 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 15:53:32,044 [14] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 内胆入库任务下发异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.SendLinerTask_InStore(RealTaskInfo taskInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 347 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 17:40:52,304 [35] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 17:43:21,670 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 17:43:25,359 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 17:48:47,597 [22] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 17:59:48,728 [35] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:07:05,728 [26] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:24:05,560 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:24:06,691 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:24:15,653 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:25:08,241 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:25:08,804 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:25:12,113 [37] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:25:13,206 [37] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:25:13,464 [37] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:37:41,533 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:37:46,309 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:37:52,631 [30] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:37:59,662 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:38:00,499 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:38:11,526 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:38:20,153 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:39:46,115 [35] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:40:01,787 [26] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:42:12,096 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:43:12,984 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:43:15,034 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:43:15,672 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:43:16,941 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:47:48,908 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1><HR COLOR=red>
异常时间2024-02-27 18:48:21,500 [36] <BR>
异常级别ERROR <BR>
异 常 类logerror [(null)] <BR>
【附加信息】 : 货道信息读取异常<br>【异常类型】KeyNotFoundException <br>【异常信息】:给定关键字不在字典中。 <br>【堆栈调用】: 在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)<br> 在 Aucma.Scada.Business.InStoreTaskHandle.ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreTaskHandle.cs:行号 684<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfosByPlc(List`1 info) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 585<br> 在 Aucma.Scada.Business.InStoreBusiness.GetSpaceInfoByMaterialType(String storeCode, String materialType) <strong style="color:red">位置</strong> E:\c#\AUCMA\aucma.scada\collection\Aucma.Scada.Business\InStoreBusiness.cs:行号 551 <BR>
<HR Size=1>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -1,67 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<!-- 将日志以回滚文件的形式写到文件中 -->
<!-- 按日期切分日志文件,并将日期作为日志文件的名字 -->
<!--Error-->
<appender name="ErrorLog" type="log4net.Appender.RollingFileAppender">
<!--不加utf-8编码格式中文字符将显示成乱码-->
<param name="Encoding" value="utf-8" />
<file value="Log\"/>
<appendToFile value="true" />
<rollingStyle value="Date" />
<!--日期的格式,每天换一个文件记录,如不设置则永远只记录一天的日志,需设置-->
<datePattern value='yyyy-MM-dd/"error.txt"' />
<!--日志文件名是否为静态-->
<StaticLogFileName value="false"/>
<!--多线程时采用最小锁定-->
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<!--布局(向用户显示最后经过格式化的输出信息)-->
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date| %-5level %newline%message%newline--------------------------------%newline" />
</layout>
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="ERROR" />
<levelMax value="FATAL" />
</filter>
</appender>
<!--Error-->
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
</configSections>
<appSettings>
</appSettings>
<log4net>
<!--错误日志类-->
<logger name="logerror">
<level value="ALL" />
<appender-ref ref="ErrorAppender" />
</logger>
<!--信息日志类-->
<logger name="loginfo">
<level value="ALL" />
<appender-ref ref="InfoAppender" />
</logger>
<!--PLC日志类-->
<logger name="plclog">
<level value="ALL" />
<appender-ref ref="PlcAppender" />
</logger>
<!--Info-->
<appender name="InfoLog" type="log4net.Appender.RollingFileAppender">
<!--不加utf-8编码格式中文字符将显示成乱码-->
<param name="Encoding" value="utf-8" />
<!--定义文件存放位置-->
<!--<file value="../../../Log/"/>-->
<file value="Log\"/>
<appendToFile value="true" />
<rollingStyle value="Date" />
<!--日志文件名是否为静态-->
<StaticLogFileName value="false"/>
<!--日期的格式,每天换一个文件记录,如不设置则永远只记录一天的日志,需设置-->
<!--<datePattern value="&quot;GlobalInfoLogs_&quot;yyyyMMdd&quot;.log&quot;" />-->
<datePattern value='yyyy-MM-dd/"LogInfo.txt"' />
<!--多线程时采用最小锁定-->
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<!--布局(向用户显示最后经过格式化的输出信息)-->
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date| %-5level%c %newline%message%newline--------------------------------%newline" />
</layout>
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="DEBUG" />
<levelMax value="WARN" />
</filter>
</appender>
<!--Info-->
<!--RFID日志类-->
<logger name="rfidlog">
<level value="ALL" />
<appender-ref ref="RfidAppender" />
</logger>
<root>
<!-- 控制级别由低到高ALL|DEBUG|INFO|WARN|ERROR|FATAL|OFF -->
<!-- 比如定义级别为INFO则INFO级别向下的级别比如DEBUG日志将不会被记录 -->
<!-- 如果没有定义LEVEL的值则缺省为DEBUG -->
<level value="ALL" />
<!-- 按日期切分日志文件,并将日期作为日志文件的名字 -->
<appender-ref ref="ErrorLog" />
<appender-ref ref="InfoLog" />
</root>
</log4net>
<!--RFID日志类-->
<logger name="viewlog">
<level value="ALL" />
<appender-ref ref="ViewAppender" />
</logger>
<!--Sql日志类-->
<logger name="sqllog">
<level value="ALL" />
<appender-ref ref="SqlAppender" />
</logger>
<!--信号量日志类-->
<logger name="semaphorelog">
<level value="ALL" />
<appender-ref ref="SemaphoreAppender" />
</logger>
<!--错误日志附加介质-->
<appender name="ErrorAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxSizeRollBackups" value="100" />
<param name="MaxFileSize" value="10240" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"LogError.html"'/>
<param name="RollingStyle" value="Date" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;HR COLOR=red&gt;%n异常时间%d [%t] &lt;BR&gt;%n异常级别%-5p &lt;BR&gt;%n异 常 类:%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;" />
</layout>
</appender>
<!--信息日志附加介质-->
<appender name="InfoAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"LogInfo.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<!--PLC日志附加介质-->
<appender name="PlcAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"PlcLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<!--Rfid日志附加介质-->
<appender name="RfidAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"RfidLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<appender name="ViewAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"ViewLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<appender name="SqlAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"SqlLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<appender name="SemaphoreAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"SemaphoreLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
</log4net>
</configuration>

File diff suppressed because it is too large Load Diff

@ -23,9 +23,9 @@ instoreTaskType=1
#出库任务类型编号
outstoreTaskType=2
#箱壳扫码器IP
#箱壳扫码器IP shellHikRobotIp=10.10.92.122
shellHikRobotIp=10.10.92.122
#内胆扫码器IP
#内胆扫码器IP linerHikRobotIp=10.10.92.121
linerHikRobotIp=10.10.92.121
searchItems=Option 1%SC234%Option 3%SC232%Option 5%Option 6%Option 7%Option 8%Option 9%Option 10%%%%%
foamBeforeStoreCode=PBSCK-001

@ -1,8 +1,8 @@
[plcSystem]
眊褲PLCIP=10.10.92.22
眊褲PLC傷諳=2015
トレオィPLCIP=127.0.0.1
トレオィPLCカヒソレ=6001
トレオィPLCIP=10.10.92.6
トレオィPLCカヒソレ=2015
#眊褲⻌踱華硊
[shell_inStore_address]

@ -9,6 +9,7 @@ using LiveCharts;
using LiveCharts.Wpf;
using MySqlX.XDevAPI.Common;
using MySqlX.XDevAPI.Relational;
using SqlSugar;
using System;
using System.Collections;
using System.Collections.Generic;
@ -354,13 +355,23 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
/// <returns></returns>
private string SubStringByName(string name)
{
if(string.IsNullOrEmpty(name)) return string.Empty;
string result = string.Empty;
int firstCommaIndex = name.IndexOf(',');
int secondCommaIndex = name.IndexOf(',', firstCommaIndex + 1);
try
{
int firstCommaIndex = name.IndexOf(',');
int secondCommaIndex = name.IndexOf(',', firstCommaIndex + 1);
if (firstCommaIndex != -1 && secondCommaIndex != -1)
if (firstCommaIndex != -1 && secondCommaIndex != -1)
{
result = name.Substring(firstCommaIndex + 1, secondCommaIndex - firstCommaIndex - 1);
}
}
catch (Exception ex)
{
result = name.Substring(firstCommaIndex + 1, secondCommaIndex - firstCommaIndex - 1);
logHelper.Error(ex.Message.ToString());
}
return result;
}

@ -296,10 +296,10 @@ namespace Aucma.Scada.UI.viewModel
string ip1 = appConfig.shellHikRobotIp;
string ip2 = appConfig.linerHikRobotIp;
bool flag1 = MvCodeHelper.ConnectionStatus(ip1);
bool flag2 = MvCodeHelper.ConnectionStatus(ip2);
Scanner1State(flag1);
Scanner2State(flag2);
//bool flag1 = MvCodeHelper.ConnectionStatus(ip1);
//bool flag2 = MvCodeHelper.ConnectionStatus(ip2);
Scanner1State(true);
Scanner2State(true);
}
#endregion

@ -47,6 +47,10 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aucma.Scada.Model\Aucma.Scada.Model.csproj">
<Project>{320B716A-2373-4342-B0AA-3C4CB041E8AD}</Project>
<Name>Aucma.Scada.Model</Name>
</ProjectReference>
<ProjectReference Include="..\HighWayIot.Common\HighWayIot.Common.csproj">
<Project>{89A1EDD9-D79E-468D-B6D3-7D07B8843562}</Project>
<Name>HighWayIot.Common</Name>

@ -1,4 +1,5 @@
using HighWayIot.Common;
using Aucma.Scada.Model.domain;
using HighWayIot.Common;
using System;
using System.Collections.Generic;
using System.Linq;
@ -25,11 +26,26 @@ namespace HighWayIot.Config
{
}
/// <summary>
/// 通过货道列表获取对应货道plc地址
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public List<SpaceAddress> GetAllSpaceAddress(List<BaseSpaceInfo> list)
{
if(list == null) return null;
List<SpaceAddress> spaceAddresses = new List<SpaceAddress>();
foreach (BaseSpaceInfo info in list)
{
spaceAddresses.Add(GetSpaceAddress(info.storeCode, info.spaceCode));
}
return spaceAddresses;
}
public SpaceAddress GetSpaceAddress(string storeCode,string spaceCode)
{
SpaceAddress spaceAddress = new SpaceAddress();
spaceAddress.storeCode = storeCode;
spaceAddress.spaceCode = spaceCode;
spaceAddress.onStore = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "在库数量");
spaceAddress.onRoute = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "在途数量");
spaceAddress.inStoreFinish = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "入库完成");
@ -45,6 +61,8 @@ namespace HighWayIot.Config
public class SpaceAddress
{
public string storeCode;
public string spaceCode;
public string onStore { get; set; }
public string onRoute { get; set; }

@ -9,6 +9,14 @@ namespace HighWayIot.Repository.service
/// </summary>
public interface IBaseSpaceInfoService
{
/// <summary>
/// 通过仓库编号获取货道信息,可以传两个仓库编号,实时读plc更新库存使用
/// </summary>
/// <param name="storeCode1"></param>
/// <param name="storeCode2"></param>
/// <returns></returns>
List<BaseSpaceInfo> GetSpaceInfosByStoreCode(string storeCode1, string storeCode2);
/// <summary>
/// 入库通过物料类型获取指定货道,如果没有对应类型的货道返回空白类型的货道
/// </summary>

@ -168,6 +168,27 @@ namespace HighWayIot.Repository.service.Impl
return spaceInfo;
}
/// <summary>
/// 通过仓库编号获取货道信息,可以传两个仓库编号,实时读plc更新库存使用
/// </summary>
/// <param name="storeCode1"></param>
/// <param name="storeCode2"></param>
/// <returns></returns>
public List<BaseSpaceInfo> GetSpaceInfosByStoreCode(string storeCode1, string storeCode2)
{
List<BaseSpaceInfo> spaceInfos = null;
try
{
spaceInfos = _mesRepository.GetList(x => x.storeCode == storeCode1 || x.storeCode == storeCode2).ToList();
}
catch (Exception ex)
{
logHelper.Error("获取货道信息异常", ex);
}
return spaceInfos;
}
/// <summary>
/// 通过仓库编号获取货道信息
/// </summary>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save