liulb@mesnac.com 1 year ago
commit 32ce350ef7

@ -30,6 +30,8 @@ using Admin.Core.Service;
using System.Windows.Forms.VisualStyles;
using Microsoft.IdentityModel.Logging;
using Aucma.Core.ProductOffLine.Business;
using System.Windows.Media;
/*
*
@ -172,7 +174,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
private void LoadProduct()
{
ChartValues<double> achievement = new ChartValues<double>();
ProductionHourList = new List<string>();
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
Achievement.Clear();
@ -209,10 +211,17 @@ namespace Aucma.Core.ProductOffLine.ViewModels
column.DataLabels = true;
column.Title = "型号";
column.Values = achievement;
column.Foreground = Brushes.White;
ModelStatistics.Add(column);
MaterialNameList = new List<string>()
{
"SC-230,11W/H成品",
"SC-439箱体",
"SC-439U壳",
"SC-439背板",
"SC-439VAM,元气森林,C",
};
ProductionHourList = new List<string>()
{
"12",
@ -232,7 +241,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
column2.DataLabels = true;
column2.Title = "产量";
column2.Values = achievement2;
column2.Foreground = Brushes.White;
Achievement.Add(column2);
}
@ -277,6 +286,19 @@ namespace Aucma.Core.ProductOffLine.ViewModels
}
#endregion
#region 型号统计柱状图X轴日期
/// <summary>
/// 型号统计柱状图X轴日期
/// </summary>
private List<string> materialNameList;
public List<string> MaterialNameList
{
get { return materialNameList; }
set { materialNameList = value; }
}
#endregion
/// <summary>
/// 扫描的条码处理
/// </summary>

@ -12,9 +12,114 @@
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="ColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="#dddddd"/>
<Style TargetType="DataGrid">
<!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false"/>
<Setter Property="Background" Value="#1152AC" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Foreground" Value="White"/>
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#4285DE"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#1152AC"/>
</Setter.Value>
</Setter>
</Style>
<!--列头标题栏样式-->
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--单元格样式-->
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}" >
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="#dddddd"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Slider}">
<Style.Resources>
<!-- 重写重复触发按钮的样式 -->
<Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="0" />
<Setter Property="Width" Value="30" />
</Style>
</Style.Resources>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="SmallChange" Value="1" />
<!-- 重写Slider的模板 -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.RowSpan="2" Height="Auto" Margin="0" Padding="0" VerticalAlignment="Stretch"
VerticalContentAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Value}">
<!-- 给TextBox绑定上下命令 -->
<TextBox.InputBindings>
<KeyBinding Gesture="Up" Command="{x:Static Slider.IncreaseSmall}" />
<KeyBinding Gesture="Down" Command="{x:Static Slider.DecreaseSmall}" />
<KeyBinding Gesture="PageUp" Command="{x:Static Slider.IncreaseLarge}" />
<KeyBinding Gesture="PageDown" Command="{x:Static Slider.DecreaseLarge}" />
</TextBox.InputBindings>
</TextBox>
<RepeatButton Grid.Row="0" Grid.Column="1" Command="{x:Static Slider.IncreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
</RepeatButton>
<RepeatButton Grid.Row="1" Grid.Column="1" Command="{x:Static Slider.DecreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M0,0 L4,4 8,0 Z" Fill="Black" />
</RepeatButton>
<!-- 由于Slider的内部实现要求存在这些必要组件,所以必须保留,但是设置为隐藏即可 -->
<Border x:Name="TrackBackground" Visibility="Collapsed">
<Rectangle x:Name="PART_SelectionRange" Visibility="Collapsed" />
</Border>
<Thumb x:Name="Thumb" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type DatePickerTextBox}">
<Setter Property="Background" Value="#0288d1" />
</Style>
</UserControl.Resources>
@ -45,29 +150,29 @@
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="1.2*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="1.2*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.Column="0" Background="#0288d1">
<Border Grid.Row="0" Grid.Column="0" Background="#1157b9">
<TextBlock Text="当前工位" Foreground="White"/>
</Border>
<Border Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Background="#0288d1">
<TextBlock Text="成品下线扫描" Foreground="White" FontWeight="Bold" FontSize="18"/>
<Border Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Background="#1157b9">
<TextBlock Text="成品下线" Foreground="White" FontWeight="Bold" FontSize="25"/>
</Border>
<Border Grid.Row="0" Grid.Column="1" Background="#0288d1">
<Border Grid.Row="0" Grid.Column="1" Background="#1157b9">
<TextBlock Text="产品条码" Foreground="White" />
</Border>
<Border Grid.Row="1" Grid.Column="1" Background="#0288d1">
<Border Grid.Row="1" Grid.Column="1" Background="#1157b9">
<TextBlock Text="产品型号" Foreground="White" />
</Border>
<Border Grid.Row="2" Grid.Column="1" Background="#0288d1">
<Border Grid.Row="2" Grid.Column="1" Background="#1157b9">
<TextBlock Text="订单数量" Foreground="White" />
</Border>
<Border Grid.Row="3" Grid.Column="1" Background="#0288d1">
<Border Grid.Row="3" Grid.Column="1" Background="#1157b9">
<TextBlock Text="提示信息" Foreground="White" />
</Border>
<Border Grid.Row="0" Grid.Column="2">
@ -82,13 +187,13 @@
<Border Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="3">
<TextBlock Text="获取信息成功3127991000093D8U0050 返回值 : Y.上传条码失败E,条码重复,上传条码失败E,条码重复上传" Foreground="White"/>
</Border>
<Border Grid.Row="0" Grid.Column="3" Background="#0288d1">
<Border Grid.Row="0" Grid.Column="3" Background="#1157b9">
<TextBlock Text="扫描时间" Foreground="White" />
</Border>
<Border Grid.Row="1" Grid.Column="3" Background="#0288d1">
<Border Grid.Row="1" Grid.Column="3" Background="#1157b9">
<TextBlock Text="订单编号" Foreground="White" />
</Border>
<Border Grid.Row="2" Grid.Column="3" Background="#0288d1">
<Border Grid.Row="2" Grid.Column="3" Background="#1157b9">
<TextBlock Text="订单已上传" Foreground="White" />
</Border>
<Border Grid.Row="0" Grid.Column="4">
@ -100,13 +205,13 @@
<Border Grid.Row="2" Grid.Column="4">
<TextBlock Text="48" Foreground="White"/>
</Border>
<Border Grid.Row="0" Grid.Column="5" Background="#0288d1">
<Border Grid.Row="0" Grid.Column="5" Background="#1157b9">
<TextBlock Text="下线产量" Foreground="White" />
</Border>
<Border Grid.Row="1" Grid.RowSpan="2" Grid.Column="5">
<TextBlock Text="255" Foreground="White"/>
<TextBlock Text="255" Foreground="White" FontSize="40"/>
</Border>
<Border Grid.Row="3" Grid.Column="4" Grid.ColumnSpan="2" Height="39" Margin="164,0,0,0" VerticalAlignment="Bottom">
<Border Grid.Row="3" Grid.Column="5" Height="39" VerticalAlignment="Center">
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<RadioButton Content="A库" Margin="5 0" Foreground="White"/>
<RadioButton Content="B库" Margin="5 0" Foreground="White" />
@ -133,7 +238,7 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" >
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="#1157b9" Margin="1,1,5,5" >
<TextBlock Text="当日小时产量统计" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" >
@ -165,7 +270,7 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" >
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="#1157b9" Margin="1,1,5,5" >
<TextBlock Text="当日型号产量统计" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" >
@ -193,21 +298,11 @@
</Grid>
</Border>
<Border Grid.Row="2">
<DataGrid Grid.Row="0" ItemsSource="{Binding PlanInfoDataGrid}" Background="#00000000"
ColumnHeaderHeight="35"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0" AlternationCount="2"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
<DataGrid Grid.Row="0" ItemsSource="{Binding PlanInfoDataGrid}" ColumnHeaderHeight="35" Height="{Binding Path=ActualHeight, ElementName=ScanPanel}"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" >
<!-- 表头剧中-->
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center">
</Setter>
<Setter Property="Background" Value="Transparent" />
</Style>
</DataGrid.ColumnHeaderStyle>
<!--修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanCode}" Header="订单编号" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>

@ -39,7 +39,7 @@ namespace Aucma.Core.Scanner
/// <param name="Code1"></param>
public delegate void ReceiveCode(string code, int scannerNo);
public static event ReceiveCode? ReceiveCodeEvent;
public static bool m_bGrabbing = true;
#endregion
@ -102,7 +102,7 @@ namespace Aucma.Core.Scanner
}
MvCodeReader m_cMyDevice = new MvCodeReader();
//创建所有设备
for (int i = 0; i < m_stDeviceList.nDeviceNum; i++)
{
@ -125,6 +125,22 @@ namespace Aucma.Core.Scanner
return;
}
log.Info("创建第" + i + "个扫码器设备成功,ip:" + ip);
// 打开设备
nRet = m_cMyDevice.MV_CODEREADER_OpenDevice_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
m_cMyDevice.MV_CODEREADER_DestroyHandle_NET();
log.Error("Device open fail!");
return;
}
//设置触发模式
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)
{
log.Error("Set TriggerMode On Fail!");
return;
}
//添加到集合
m_cMyDevices.Add(m_cMyDevice, ip);
@ -172,7 +188,7 @@ namespace Aucma.Core.Scanner
#endregion
#region 开启扫描
public static void StartGrab()
public static void StartGrab1()
{
try
{
@ -258,97 +274,70 @@ namespace Aucma.Core.Scanner
#endregion
#region (先不使用此方法,待测试) 通过plc触发单个扫码器接收条码处理业务
/// <summary>
/// 根据plc信号地址区分扫码器Ip,再获取指定扫码器条码,返回条码
/// </summary>
/// <param name="ip"></param>
public static string StartGrabByPlc(string ip)
#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 (KeyValuePair<MvCodeReader, string> hashmap in m_cMyDevices)
{
// 1.找到指定相机 hashmap.Key
if (hashmap.Value == ip)
nRet = hashmap.Key.MV_CODEREADER_StartGrabbing_NET();
while (m_bGrabbing)
{
// 2.打开相机开启扫描
int nRet = hashmap.Key.MV_CODEREADER_OpenDevice_NET();//打开设备
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
log.Error("打开扫码器设备失败,销毁设备,ip:" + ip);
hashmap.Key.MV_CODEREADER_DestroyHandle_NET();
return null;
}
// ch:设置触发模式为off || en:set trigger mode as off
if (MvCodeReader.MV_CODEREADER_OK != hashmap.Key.MV_CODEREADER_SetEnumValue_NET("TriggerMode", 0))
{
log.Error("设置扫码器设备触发模式失败ip:" + ip);
return null;
}
// ch:开启抓图 | en:start grab
nRet = hashmap.Key.MV_CODEREADER_StartGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
log.Error("设置扫码器设备开启抓图失败ip:" + ip);
return null;
}
// 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);
while (nCount++!=10)
// 光电触发了有图像
nRet = hashmap.Key.MV_CODEREADER_GetOneFrameTimeoutEx2_NET(ref pData, pstFrameInfoEx2, 1000);
// ch:获取一帧图像 | en:Get one image
if (MvCodeReader.MV_CODEREADER_OK == nRet)
{
nRet = hashmap.Key.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)
{
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)
{
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);
log.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)
{
// string strCode = System.Text.Encoding.Default.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
string strCode = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode);
log.Info("bIsValidUTF8:: Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]");
return null;
Array.Copy(stBcrResult.stBcrInfoEx2[i].chCode, buffer, 22);
}
else
string strCode = Encoding.GetEncoding("UTF-8").GetString(buffer).Trim().TrimEnd('\0');
log.Info("相机ip:" + hashmap.Value + " Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode + "]");
if (!string.IsNullOrEmpty(strCode))
{
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');
log.Info("相机ip:" + hashmap.Value + " Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode + "]");
if (!string.IsNullOrEmpty(strCode))
{
// 关闭设备
CloseDevice(hashmap);
// 获取到条码就跳出扫码
return strCode ;
}
// 获取到条码处理业务
Console.WriteLine(strCode);
}
}
}
// Thread.Sleep(500);
}
}
Thread.Sleep(500);
}
}
}
}
catch(Exception ex)
catch (Exception ex)
{
log.Error("扫码异常:" + ex);
}
return null;
}
#endregion
@ -401,22 +390,22 @@ namespace Aucma.Core.Scanner
{
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)
{
log.Error("设备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)
{
log.Error("设备ip:" + hashmap.Value + "关闭失败");
return;
}
int nRet = MvCodeReader.MV_CODEREADER_OK;
// ch:停止抓图 | en:Stop grab image
nRet = hashmap.Key.MV_CODEREADER_StopGrabbing_NET();
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
log.Error("设备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)
{
log.Error("设备ip:" + hashmap.Value + "关闭失败");
return;
}
}
catch (Exception ex)
{

@ -15,8 +15,8 @@ namespace Aucma.Core.Scanner
{
MvCodeHelper.DeviceListAcq();//获取创建设备
MvCodeHelper.StartGrab();//获取数据
MvCodeHelper.StartGrab(); // 开启触发扫码接收数据
}
catch (Exception ex)

Binary file not shown.
Loading…
Cancel
Save