change - 海康扫码器逻辑实现

foamRearStore
wenjy 11 months ago
parent db715ed7bb
commit 8679b2f818

Binary file not shown.

@ -68,6 +68,10 @@
<Compile Include="TaskInfoBusiness.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aucma.Scada.HikRobot\Aucma.Scada.HikRobot.csproj">
<Project>{D7FAA8F6-72A5-4504-82EE-29FE21FD5931}</Project>
<Name>Aucma.Scada.HikRobot</Name>
</ProjectReference>
<ProjectReference Include="..\Aucma.Scada.Model\Aucma.Scada.Model.csproj">
<Project>{320B716A-2373-4342-B0AA-3C4CB041E8AD}</Project>
<Name>Aucma.Scada.Model</Name>

@ -1,4 +1,5 @@
using Aucma.Scada.Model.domain;
using Aucma.Scada.HikRobot;
using Aucma.Scada.Model.domain;
using HighWayIot.Config;
using HighWayIot.Log4net;
using HighWayIot.Repository.service;
@ -32,6 +33,8 @@ namespace Aucma.Scada.Business
private RegisterServices registerServices = RegisterServices.Instance;
private InStoreTaskHandle taskHandle = InStoreTaskHandle.Instance;
private GrabImage grabImage = GrabImage.Instance;
#endregion
#region 接口引用
@ -76,7 +79,8 @@ namespace Aucma.Scada.Business
{
_spaceInfoService = registerServices.GetService<IBaseSpaceInfoService>();
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
grabImage.RefreshMaterialCodeStrEvent += InStore;
grabImage.RefreshLogMessageEvent += PrintLogInfoMessage;
StartPassDown();
}
@ -95,7 +99,7 @@ namespace Aucma.Scada.Business
try
{
PrintLogInfoMessage($"扫码成功,物料码:{materialCode}");
string materialType = materialCode;
string materialType = SubStringMaterialCode(materialCode);
var spaceInfo = _spaceInfoService.InStoreGetSpaceInfoByMaterialType(storeCode, materialType);
if (spaceInfo != null)
{
@ -106,6 +110,7 @@ namespace Aucma.Scada.Business
else
{
//报警停线
PrintLogInfoMessage($"物料码:{materialCode};未匹配到可用货道");
}
}
catch (Exception ex)
@ -373,5 +378,21 @@ namespace Aucma.Scada.Business
RefreshLogMessageEvent?.Invoke(message);
logHelper.Error(message, ex);
}
/// <summary>
/// 截图条码
/// </summary>
/// <param name="materialCode"></param>
/// <returns></returns>
private string SubStringMaterialCode(string materialCode)
{
string result = string.Empty;
if (!string.IsNullOrEmpty(materialCode))
{
result = materialCode.Substring(2, 10);
}
return result;
}
}
}

@ -1,6 +1,8 @@
using HighWayIot.Config;
using Aucma.Scada.HikRobot;
using HighWayIot.Config;
using HighWayIot.Plc;
using System;
using System.Threading.Tasks;
namespace Aucma.Scada.Business
{
@ -24,13 +26,12 @@ namespace Aucma.Scada.Business
private PlcConfig plcConfig = PlcConfig.Instance;
private PlcPool plcPool = PlcPool.Instance;
private GrabImage grabImage = GrabImage.Instance;
#endregion
private MainBusiness()
{
//初始化扫码器
//初始化货道信息,保证系统内的库存信息与实物一致
}
/// <summary>
@ -51,6 +52,35 @@ namespace Aucma.Scada.Business
plcPool.disConnectAll();
}
/// <summary>
/// 开启海康扫码器
/// </summary>
public void InitHikRobot()
{
try
{
grabImage.InitHikRobot();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
/// <summary>
/// 关闭海康扫码器
/// </summary>
public void ExitHikRobot()
{
try
{
grabImage.ExitHikRobot();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}

@ -1 +1 @@
20d093f2e08cff5cb4761eaec31b10b67198e480
dafab2e3d503748c194ae4d54dfa0f3ec2feed3f

@ -80,3 +80,6 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\D
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.csproj.CopyComplete
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\MvCodeReaderSDK.Net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.HikRobot.pdb

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D7FAA8F6-72A5-4504-82EE-29FE21FD5931}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Aucma.Scada.HikRobot</RootNamespace>
<AssemblyName>Aucma.Scada.HikRobot</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MvCodeReaderSDK.Net">
<HintPath>..\HighWayIot.Library\MvCodeReaderSDK.Net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GrabImage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HighWayIot.Config\HighWayIot.Config.csproj">
<Project>{75180ee5-13ae-499b-b0f6-c7bfee1140cc}</Project>
<Name>HighWayIot.Config</Name>
</ProjectReference>
<ProjectReference Include="..\HighWayIot.Log4net\HighWayIot.Log4net.csproj">
<Project>{DEABC30C-EC6F-472E-BD67-D65702FDAF74}</Project>
<Name>HighWayIot.Log4net</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -0,0 +1,332 @@
using HighWayIot.Config;
using HighWayIot.Log4net;
using MvCodeReaderSDKNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Aucma.Scada.HikRobot
{
/// <summary>
/// 海康扫码器
/// </summary>
public class GrabImage
{
#region 单例实现
private static readonly Lazy<GrabImage> lazy = new Lazy<GrabImage>(() => new GrabImage());
public static GrabImage Instance
{
get
{
return lazy.Value;
}
}
#endregion
#region 对象引用
private AppConfig appConfig = AppConfig.Instance;
private LogHelper logHelper = LogHelper.Instance;
#endregion
#region 委托事件
public delegate void RefreshMaterialCodeStr(string storeCode,string materialCodeStr);
public event RefreshMaterialCodeStr RefreshMaterialCodeStrEvent;
/// <summary>
/// 日志信息刷新
/// </summary>
/// <param name="message"></param>
public delegate void RefreshLogMessage(string message);
public event RefreshLogMessage RefreshLogMessageEvent;
#endregion
#region 私有变量
private List<MvCodeReader> mvCodeReaders = new List<MvCodeReader>();
private string lastStr = string.Empty;
#endregion
private GrabImage()
{
}
public void InitHikRobot()
{
int nRet = MvCodeReader.MV_CODEREADER_OK;
MvCodeReader device = new MvCodeReader();
do
{
// 枚举设备
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;
}
RefreshLogMessageEvent?.Invoke("海康扫码器初始化枚举设备信息Enum device count : " + Convert.ToString(stDevList.nDeviceNum));
if (0 == stDevList.nDeviceNum)
{
break;
}
MvCodeReader.MV_CODEREADER_DEVICE_INFO stDevInfo; // 通用设备信息
// 打印设备信息 ,选择指定IP的设备
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)
{
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));
string ip = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8) + "." + (stGigEDeviceInfo.nCurrentIp & 0x000000ff);
RefreshLogMessageEvent?.Invoke($"打印扫码设备信息,下标:{i}IP{ip}");
if (ip == appConfig.shellHikRobotIp)
{
Grab(i, stDevList, stDevInfo, device, appConfig.shellStoreCode);
continue;
}else if(ip == appConfig.linerHikRobotIp)
{
Grab(i, stDevList, stDevInfo, device, appConfig.linerStoreCode);
continue;
}
}
}
} while (false);
}
private void Grab(int index,MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST stDevList, MvCodeReader.MV_CODEREADER_DEVICE_INFO stDevInfo,MvCodeReader device,string storeCode)
{
try
{
Task.Run(() =>
{
string str = storeCode == appConfig.shellStoreCode ? "箱壳" : "内胆";
int nRet = MvCodeReader.MV_CODEREADER_OK;
do
{
stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[index], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
// 创建设备
nRet = device.MV_CODEREADER_CreateHandle_NET(ref stDevInfo);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
RefreshLogMessageEvent?.Invoke($"Create device failed:{nRet}");
break;
}
else
{
RefreshLogMessageEvent?.Invoke($"{str}扫码器创建成功");
}
// 打开设备
nRet = device.MV_CODEREADER_OpenDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
RefreshLogMessageEvent?.Invoke("Open device failed:{nRet}");
break;
}
else
{
mvCodeReaders.Add(device);
RefreshLogMessageEvent?.Invoke($"{str}扫码器打开成功");
}
// 设置触发模式为off
if (MvCodeReader.MV_CODEREADER_OK != device.MV_CODEREADER_SetEnumValue_NET("TriggerMode", 0))
{
Console.WriteLine("Set TriggerMode failed!");
break;
}
else
{
RefreshLogMessageEvent?.Invoke($"{str}扫码器设置触发模式为off");
}
// 开启抓图
nRet = device.MV_CODEREADER_StartGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Start grabbing failed:{0:x8}", nRet);
break;
}
else
{
RefreshLogMessageEvent?.Invoke($"{str}扫码器开启抓图");
}
int nCount = 0;
IntPtr pBufForDriver = IntPtr.Zero;
MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2 stFrameInfo = new MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2();
IntPtr pstFrameInfo = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)));
Marshal.StructureToPtr(stFrameInfo, pstFrameInfo, false);
while (nCount++ != 10)
{
nRet = device.MV_CODEREADER_GetOneFrameTimeoutEx2_NET(ref pBufForDriver, pstFrameInfo, 1000);
// 获取一帧图像
if (MvCodeReader.MV_CODEREADER_OK == nRet)
{
stFrameInfo = (MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)Marshal.PtrToStructure(pstFrameInfo, typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2));
// 分配条码内存空间
MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2 stBcrResult = (MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)Marshal.PtrToStructure(stFrameInfo.pstCodeListEx, 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 = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
Console.WriteLine("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);
RefreshLogMessageEvent?.Invoke("Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
if (!string.IsNullOrEmpty(strCode))
{
if(strCode != lastStr)
{
RefreshMaterialCodeStrEvent?.Invoke(storeCode, strCode);
}
lastStr = strCode;
}
}
}
continue;
}
else
{
Console.WriteLine("No data:{0:x8}", nRet);
}
Thread.Sleep(3000);
}
} while (false);
});
}catch(Exception ex)
{
logHelper.Error("扫码异常", ex);
}
}
public void ExitHikRobot()
{
int nRet = MvCodeReader.MV_CODEREADER_OK;
foreach (var device in mvCodeReaders)
{
// 停止抓图
nRet = device.MV_CODEREADER_StopGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Stop grabbing failed{0:x8}", nRet);
continue;
}
// 关闭设备
nRet = device.MV_CODEREADER_CloseDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Close device failed{0:x8}", nRet);
continue;
}
// 销毁设备
nRet = device.MV_CODEREADER_DestroyHandle_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("Destroy device failed:{0:x8}", nRet);
continue;
}
}
mvCodeReaders = new List<MvCodeReader>();
}
// 判断字符编码
private 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;
}
}
}

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Aucma.Scada.HikRobot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Aucma.Scada.HikRobot")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("d7faa8f6-72a5-4504-82ee-29fe21fd5931")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

File diff suppressed because it is too large Load Diff

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

@ -0,0 +1,17 @@
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\Aucma.Scada.HikRobot.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\MvCodeReaderSDK.Net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.csproj.AssemblyReference.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.csproj.CoreCompileInputs.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.csproj.CopyComplete
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Config.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Common.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Log4net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\Newtonsoft.Json.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\log4net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Config.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Common.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Log4net.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\Newtonsoft.Json.xml

@ -40,11 +40,13 @@ namespace Aucma.Scada.UI
else
{
mainBusiness.InitPlc();
mainBusiness.InitHikRobot();
}
}
private void Application_Exit(object sender, ExitEventArgs e)
{
mainBusiness.DisConnectPlc();
mainBusiness.ExitHikRobot();
logHelper.Info("程序退出");
}

@ -247,6 +247,10 @@
<Project>{004383BC-659A-41A5-9176-D60831B08438}</Project>
<Name>Aucma.Scada.Business</Name>
</ProjectReference>
<ProjectReference Include="..\Aucma.Scada.HikRobot\Aucma.Scada.HikRobot.csproj">
<Project>{d7faa8f6-72a5-4504-82ee-29fe21fd5931}</Project>
<Name>Aucma.Scada.HikRobot</Name>
</ProjectReference>
<ProjectReference Include="..\Aucma.Scada.Model\Aucma.Scada.Model.csproj">
<Project>{320b716a-2373-4342-b0aa-3c4cb041e8ad}</Project>
<Name>Aucma.Scada.Model</Name>

@ -16,3 +16,5 @@ instoreTaskType=1
outstoreTaskType=2
stationName=Ïä¿ÇÄÚµ¨×é×°
shellHikRobotIp=169.254.100.169
linerHikRobotIp=127.0.0.1

@ -1 +1 @@
d532180f0e1d6503c905235ff720a1761f0f3c80
2e8a851416f7d004d43adb23b4205d7e250c8d8f

@ -338,3 +338,6 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\A
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Microsoft.Extensions.DependencyInjection.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Microsoft.Extensions.DependencyInjection.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\MvCodeReaderSDK.Net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.HikRobot.pdb

@ -13,7 +13,7 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\App.xaml
14-1433675110
34-1467425882
1351216602503
1361464425805
Page\AssemblyPlan\AssemblyPlanControl.xaml;Page\AssemblyPlan\PlanInfoEditWindow.xaml;Page\InStoreInfo\InStoreInfoControl.xaml;LogInfoControl.xaml;MainWindow.xaml;Page\InventoryInfo\InventoryInfoControl.xaml;Page\InventoryInfo\LinerInventory.xaml;Page\InventoryInfo\ShellInventory.xaml;Page\InventoryInfo\SpaceDetailWindow.xaml;Page\InventoryInfo\SpaceInfoControl.xaml;Page\OutStoreInfo\OutStoreInfoControl.xaml;Page\TaskInfo\TaskInfoControl.xaml;RecordControl.xaml;templates\style\resourceStyle.xaml;
False

@ -13,7 +13,7 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\App.xaml
14-1433675110
35454352239
1351216602503
1361464425805
Page\AssemblyPlan\AssemblyPlanControl.xaml;Page\AssemblyPlan\PlanInfoEditWindow.xaml;Page\InStoreInfo\InStoreInfoControl.xaml;LogInfoControl.xaml;MainWindow.xaml;Page\InventoryInfo\InventoryInfoControl.xaml;Page\InventoryInfo\LinerInventory.xaml;Page\InventoryInfo\ShellInventory.xaml;Page\InventoryInfo\SpaceDetailWindow.xaml;Page\InventoryInfo\SpaceInfoControl.xaml;Page\OutStoreInfo\OutStoreInfoControl.xaml;Page\TaskInfo\TaskInfoControl.xaml;RecordControl.xaml;templates\style\resourceStyle.xaml;
True

@ -108,5 +108,23 @@ namespace HighWayIot.Config
get { return Convert.ToInt32(iniHelper.IniReadValue("system", "outstoreTaskType")); }
set { iniHelper.IniWriteValue("system", "outstoreTaskType", value.ToString()); }
}
/// <summary>
/// 箱壳扫码器IP
/// </summary>
public string shellHikRobotIp
{
get { return iniHelper.IniReadValue("system", "shellHikRobotIp"); }
set { iniHelper.IniWriteValue("system", "shellHikRobotIp", value); }
}
/// <summary>
/// 内胆扫码器IP
/// </summary>
public string linerHikRobotIp
{
get { return iniHelper.IniReadValue("system", "linerHikRobotIp"); }
set { iniHelper.IniWriteValue("system", "linerHikRobotIp", value); }
}
}
}

@ -39,9 +39,16 @@ namespace HighWayIot.Repository.service.Impl
}
logHelper.Info($"根据仓库{store};物料:{materialType};获取到的货道信息:{jsonChange.ModeToJson(spaceInfos)}");
spaceInfo = inStoreFilter(spaceInfos);
logHelper.Info($"仓库{store};物料:{materialType};匹配的入库货道信息:{jsonChange.ModeToJson(spaceInfo)}");
if(spaceInfo != null)
{
logHelper.Info($"仓库{store};物料:{materialType};匹配的入库货道信息:{jsonChange.ModeToJson(spaceInfo)}");
spaceInfo.materialType = materialType;
spaceInfo.materialType = materialType;
}
else
{
logHelper.Info($"仓库{store};物料:{materialType};未匹配到可用货道");
}
}
catch (Exception ex)
{

@ -27,6 +27,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aucma.Scada.Business", "Auc
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aucma.Scada.Model", "Aucma.Scada.Model\Aucma.Scada.Model.csproj", "{320B716A-2373-4342-B0AA-3C4CB041E8AD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aucma.Scada.HikRobot", "Aucma.Scada.HikRobot\Aucma.Scada.HikRobot.csproj", "{D7FAA8F6-72A5-4504-82EE-29FE21FD5931}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -81,6 +83,10 @@ Global
{320B716A-2373-4342-B0AA-3C4CB041E8AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{320B716A-2373-4342-B0AA-3C4CB041E8AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{320B716A-2373-4342-B0AA-3C4CB041E8AD}.Release|Any CPU.Build.0 = Release|Any CPU
{D7FAA8F6-72A5-4504-82EE-29FE21FD5931}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7FAA8F6-72A5-4504-82EE-29FE21FD5931}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7FAA8F6-72A5-4504-82EE-29FE21FD5931}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7FAA8F6-72A5-4504-82EE-29FE21FD5931}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Loading…
Cancel
Save