Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 62e13569
由
LN
编写于
2019-07-31 10:01:02 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
西安料仓增加zxing识别二维码
1 个父辈
09248790
全部展开
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
188 行增加
和
80 行删除
dll/CodeLibrary.dll
source/ACSingleStore/ACSingleStore.csproj
source/ACSingleStore/App.config
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/Properties/Resources.Designer.cs
source/ACSingleStore/Properties/Settings.Designer.cs
source/ACSingleStore/记录.txt
source/Common/Setting_Init.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/StoreManager.cs
source/DeviceLibrary/halcon/CodeManager.cs
source/LoadCVSLibrary/position/CSVPositionReader.cs
dll/CodeLibrary.dll
查看文件 @
62e1356
此文件类型无法预览
source/ACSingleStore/ACSingleStore.csproj
查看文件 @
62e1356
...
...
@@ -9,9 +9,24 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.ACSingleStore</RootNamespace>
<AssemblyName>ACSingleStore</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
...
...
@@ -244,6 +259,13 @@
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
...
...
source/ACSingleStore/App.config
查看文件 @
62e1356
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
configSections
>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
</
configSections
>
<
appSettings
>
<!--是否开机自动启动料仓-->
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_Title"
value
=
"AC_SA_料仓_1"
/>
<
add
key
=
"scanner_start_command"
value
=
"S"
/>
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_Title"
value
=
"AC_SA_料仓_1"
/>
<
add
key
=
"scanner_start_command"
value
=
"S"
/>
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<
add
key
=
"StartBlowValue"
value
=
"4"
/>
<
add
key
=
"StartBlowValue"
value
=
"4"
/>
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<
add
key
=
"StopBlowValue"
value
=
"4"
/>
<
add
key
=
"StopBlowValue"
value
=
"4"
/>
<!--
Server
address
-->
<!--<
add
key
=
"http.server"
value
=
"http://localhost:80/"
/>-->
<!--
storeType
-->
<
add
key
=
"store_count"
value
=
"1"
/>
<
add
key
=
"store_count"
value
=
"1"
/>
<!--
start
one
store
config
-->
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\AC\linePositions.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\AC\StoreConfig.csv"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA"
/>
<
add
key
=
"Store_CID"
value
=
"rc29ac-1"
/>
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\AC\linePositions.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\AC\StoreConfig.csv"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA"
/>
<
add
key
=
"Store_CID"
value
=
"rc29ac-1"
/>
<!--
end
one
store
config
-->
<!--摄像机名称列表配置,用
#分割-->
<
add
key
=
"CameraName"
value
=
"GigE:MV-CE100-30GC (00C69898483)"
/>
<
add
key
=
"CameraName"
value
=
"GigE:MV-CE100-30GC (00C69898483)"
/>
<!--二维码类型列表配置,用
#分割,一维码=Barcode-->
<
add
key
=
"CodeType"
value
=
"QR Code#Data Matrix ECC 200#Micro QR Code"
/>
<
add
key
=
"CodeType"
value
=
"QR Code#Data Matrix ECC 200#Micro QR Code"
/>
<!--<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"AI_ConvertPosition"
value
=
"55"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"8000"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"AI_ConvertPosition"
value
=
"55"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"8000"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<!--出库等待料盘拿走的时间,秒-->
<
add
key
=
"OutStoreWaitSeconds"
value
=
"10"
/>
<
add
key
=
"OutStoreWaitSeconds"
value
=
"10"
/>
<!--压紧轴对应
1
mm
的脉冲-->
<
add
key
=
"ComAxisChangeValue"
value
=
"2400"
/>
<
add
key
=
"ComAxisChangeValue"
value
=
"2400"
/>
<!--温控器类型,
0
=壁挂王字壳温湿度变送器,
1
=妙昕温湿度记录仪-->
<
add
key
=
"HumitureControllerType"
value
=
"1"
/>
<
add
key
=
"HumitureControllerType"
value
=
"1"
/>
<!--流水线地址和端口配置-->
<
add
key
=
"LineServerIp"
value
=
"192.168.200.69"
/>
<
add
key
=
"LineServerPort"
value
=
"1234"
/>
<
add
key
=
"LineServerIp"
value
=
"192.168.200.69"
/>
<
add
key
=
"LineServerPort"
value
=
"1234"
/>
<!--解码方式,
0
=
halcon
解码,
1
=使用
zxing
解码-->
<
add
key
=
"DeCodeType"
value
=
"1"
/>
</
appSettings
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/ACStore-RC29-1.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
file
value
=
"logs/ACStore-RC29-1.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
</
appender
>
<
root
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
</
root
>
</
log4net
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
0"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
6.1"
/>
</
startup
>
<!-- 部署服务库项目时,必须将配置文件的内容添加到
主机的
app
.
config
文件中。
System
.
Configuration
不支持库的配置文件。 -->
...
...
@@ -70,14 +72,14 @@
<
service
name
=
"AcStoreWCF.CWSMDBox"
>
<
endpoint
address
=
""
binding
=
"basicHttpBinding"
contract
=
"AcStoreWCF.ICWSMDBox"
>
<
identity
>
<
dns
value
=
"localhost"
/>
<
dns
value
=
"localhost"
/>
</
identity
>
</
endpoint
>
<
endpoint
address
=
"mex"
binding
=
"mexHttpBinding"
contract
=
"IMetadataExchange"
/>
<
endpoint
address
=
"mex"
binding
=
"mexHttpBinding"
contract
=
"IMetadataExchange"
/>
<
host
>
<
baseAddresses
>
<
add
baseAddress
=
"http://localhost:8733/Design_Time_Addresses/AcStoreWCF/CWSMDBox/"
/>
<
add
baseAddress
=
"http://localhost:8733/Design_Time_Addresses/AcStoreWCF/CWSMDBox/"
/>
</
baseAddresses
>
</
host
>
</
service
>
...
...
@@ -87,11 +89,11 @@
<
behavior
>
<!-- 为避免泄漏元数据信息,
请在部署前将以下值设置为
false
-->
<
serviceMetadata
httpGetEnabled
=
"True"
httpsGetEnabled
=
"True"
/>
<
serviceMetadata
httpGetEnabled
=
"True"
httpsGetEnabled
=
"True"
/>
<!-- 要接收故障异常详细信息以进行调试,
请将以下值设置为
true
。在部署前设置为
false
以避免泄漏异常信息 -->
<
serviceDebug
includeExceptionDetailInFaults
=
"False"
/>
<
serviceDebug
includeExceptionDetailInFaults
=
"False"
/>
</
behavior
>
</
serviceBehaviors
>
</
behaviors
>
...
...
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
62e1356
此文件的差异被折叠,
点击展开。
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
62e1356
...
...
@@ -166,6 +166,14 @@ namespace OnlineStore.ACSingleStore
{
groupHistory
.
Visible
=
false
;
}
if
(
CodeManager
.
DeCodeType
.
Equals
(
0
))
{
groupCode
.
Visible
=
false
;
}
else
{
groupCode
.
Visible
=
true
;
}
}
private
DateTime
preReadModblsTime
=
DateTime
.
Now
;
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
...
...
@@ -314,7 +322,7 @@ namespace OnlineStore.ACSingleStore
int
lCountPulse1
=
ACServerManager
.
GetActualtPosition
(
store
.
Config
.
Middle_Axis
.
DeviceName
,
store
.
Config
.
Middle_Axis
.
GetAxisValue
());
lblCountPulse1
.
Text
=
string
.
Format
(
"{0:d}"
,
lCountPulse1
);
txtMiddleTarget
.
Text
=
store
.
Config
.
Middle_Axis
.
TargetPosition
.
ToString
();
if
(
store
.
Config
.
Middle_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
if
(
store
.
Config
.
Middle_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
{
lblOutPulse
.
Text
=
lblOutPulse1
.
Text
;
lblCountPulse
.
Text
=
lblCountPulse1
.
Text
;
...
...
@@ -329,7 +337,7 @@ namespace OnlineStore.ACSingleStore
int
lCountPulse2
=
ACServerManager
.
GetActualtPosition
(
store
.
Config
.
UpDown_Axis
.
DeviceName
,
store
.
Config
.
UpDown_Axis
.
GetAxisValue
());
lblCountPulse2
.
Text
=
string
.
Format
(
"{0:d}"
,
lCountPulse2
);
txtInoutTarget
.
Text
=
store
.
Config
.
InOut_Axis
.
TargetPosition
.
ToString
();
if
(
store
.
Config
.
UpDown_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
if
(
store
.
Config
.
UpDown_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
{
lblOutPulse
.
Text
=
lblOutPulse2
.
Text
;
lblCountPulse
.
Text
=
lblCountPulse2
.
Text
;
...
...
@@ -343,7 +351,7 @@ namespace OnlineStore.ACSingleStore
int
lCountPulse3
=
ACServerManager
.
GetActualtPosition
(
store
.
Config
.
InOut_Axis
.
DeviceName
,
store
.
Config
.
InOut_Axis
.
GetAxisValue
());
lblCountPulse3
.
Text
=
string
.
Format
(
"{0:d}"
,
lCountPulse3
);
txtUpdownTarget
.
Text
=
store
.
Config
.
UpDown_Axis
.
TargetPosition
.
ToString
();
if
(
store
.
Config
.
InOut_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
if
(
store
.
Config
.
InOut_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
{
lblOutPulse
.
Text
=
lblOutPulse3
.
Text
;
lblCountPulse
.
Text
=
lblCountPulse3
.
Text
;
...
...
@@ -507,20 +515,20 @@ namespace OnlineStore.ACSingleStore
// MessageBox.Show("位置超出" + axisC.Explain + "上下限(" + axisC.PositionMin + "-" + axisC.PositionMax + ")");
// return;
//}
if
(
store
.
Config
.
InOut_Axis
.
IsSameAxis
(
portName
,
SlvAddr
)
&&
(
store
.
InOutAxisCanMove
().
Equals
(
false
)))
if
(
store
.
Config
.
InOut_Axis
.
IsSameAxis
(
portName
,
SlvAddr
)
&&
(
store
.
InOutAxisCanMove
().
Equals
(
false
)))
{
MessageBox
.
Show
(
"定位气缸不在下降端,不能移动进出轴"
,
"警告"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Warning
);
return
;
}
else
if
(
store
.
Config
.
Middle_Axis
.
IsSameAxis
(
portName
,
SlvAddr
)
||
store
.
Config
.
UpDown_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
else
if
(
store
.
Config
.
Middle_Axis
.
IsSameAxis
(
portName
,
SlvAddr
)
||
store
.
Config
.
UpDown_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
{
if
(!
InOutIsIsP1
())
{
return
;
}
}
LogUtil
.
info
(
"点击【绝对运动】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
LogUtil
.
info
(
"点击【绝对运动】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
private
void
btnAxisVMove_Click
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -717,7 +725,7 @@ namespace OnlineStore.ACSingleStore
{
return
true
;
}
MessageBox
.
Show
(
"叉子不在待机位,请先将叉子退回待机位("
+
InOutDefaultPosition
+
")"
,
"警告(叉子在待机位时,才能移动升降轴和旋转轴) "
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Exclamation
);
MessageBox
.
Show
(
"叉子不在待机位,请先将叉子退回待机位("
+
InOutDefaultPosition
+
")"
,
"警告(叉子在待机位时,才能移动升降轴和旋转轴) "
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Exclamation
);
return
false
;
}
private
void
btnCloseAxis_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -985,7 +993,7 @@ namespace OnlineStore.ACSingleStore
private
void
料仓运转
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
this
.
Enabled
=
false
;
store
.
RunAxis
(
false
);
store
.
RunAxis
(
false
);
this
.
Enabled
=
true
;
LogUtil
.
info
(
"料仓运转ON完成"
);
}
...
...
@@ -1247,9 +1255,9 @@ namespace OnlineStore.ACSingleStore
this
.
ShowInTaskbar
=
true
;
DebugStatus
(
false
);
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"显示界面出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"显示界面出错:"
+
ex
.
ToString
());
}
}
private
void
ExitApp
()
...
...
@@ -1280,7 +1288,7 @@ namespace OnlineStore.ACSingleStore
}
private
void
toolStripMenuItem1_Click
(
object
sender
,
EventArgs
e
)
{
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
ExitApp
();
...
...
@@ -1303,7 +1311,7 @@ namespace OnlineStore.ACSingleStore
private
void
退出
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
ExitApp
();
...
...
@@ -1314,12 +1322,16 @@ namespace OnlineStore.ACSingleStore
private
void
学习二维码
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
// if (CodeManager.DeCodeType.Equals(0))
{
store
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
CodeLibrary
.
FrmCodeDecode
frm
=
new
FrmCodeDecode
();
frm
.
ShowDialog
();
store
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
}
private
void
btnReadHomeSingle_Click
(
object
sender
,
EventArgs
e
)
{
int
value
=
ACServerManager
.
GetHomeSingle
(
GetPortName
(),
GetSlaveAddr
());
...
...
@@ -1488,5 +1500,40 @@ namespace OnlineStore.ACSingleStore
store
.
KNDIOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
store
.
KNDIOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
}
private
void
btnOpenFile_Click
(
object
sender
,
EventArgs
e
)
{
System
.
Windows
.
Forms
.
OpenFileDialog
openDialog
=
new
System
.
Windows
.
Forms
.
OpenFileDialog
();
openDialog
.
Title
=
"打开本地图片"
;
openDialog
.
Filter
=
"All Supported Images (*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png)|*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png|Bitmaps (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|Graphics Interchange Format (*.gif)|*.gif|Joint Photographic Experts (*.jpg)|*.jpg|Portable Network Graphics (*.png)|*.png|All Files (*.*)|*.*"
;
openDialog
.
DefaultExt
=
"png"
;
//openDialog.DefaultExt = "png";
System
.
Windows
.
Forms
.
DialogResult
result
=
openDialog
.
ShowDialog
();
if
(
result
==
System
.
Windows
.
Forms
.
DialogResult
.
Cancel
)
{
return
;
}
string
fileName
=
openDialog
.
FileName
;
txtImage
.
Text
=
fileName
;
}
private
void
btnCodeTest_Click
(
object
sender
,
EventArgs
e
)
{
txtCode
.
Text
=
""
;
string
fileName
=
txtImage
.
Text
.
ToString
();
if
(
File
.
Exists
(
fileName
))
{
//读取图片内容
Bitmap
checkImg
=
(
Bitmap
)
Image
.
FromFile
(
fileName
).
Clone
();
string
result
=
ZXingCodeHelper
.
DecodeQRCode
(
checkImg
);
txtCode
.
Text
=
result
;
}
else
{
MessageBox
.
Show
(
"请先打开正确的图片!"
);
}
}
}
}
source/ACSingleStore/Properties/Resources.Designer.cs
查看文件 @
62e1356
...
...
@@ -47,7 +47,7 @@ namespace OnlineStore.ACSingleStore.Properties {
}
/// <summary>
///
使用此强类型资源类,为所有资源查找
///
重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
...
...
source/ACSingleStore/Properties/Settings.Designer.cs
查看文件 @
62e1356
...
...
@@ -12,7 +12,7 @@ namespace OnlineStore.ACSingleStore.Properties {
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"15.
6
.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"15.
9
.0.0"
)]
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
...
...
source/ACSingleStore/记录.txt
查看文件 @
62e1356
...
...
@@ -76,11 +76,13 @@
FA开头的二维码,默认为7*32
20190606
进入IO界面需要一直读取测高值。
压紧轴回原点增加自动重复运动功能。
20190730
RC29项目西安料仓扫码需要用zxing才能识别,增加配置
<!--解码方式,0=halcon 解码,1=使用zxing解码-->
<add key="DeCodeType" value="1"/>
...
...
source/Common/Setting_Init.cs
查看文件 @
62e1356
...
...
@@ -84,5 +84,10 @@ namespace OnlineStore.Common
/// 温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪
/// </summary>
public
static
string
HumitureControllerType
=
"HumitureControllerType"
;
/// <summary>
/// 解码类型,0=halcon,1=zxing解码
/// </summary>
public
static
string
DeCodeType
=
"DeCodeType"
;
}
}
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
62e1356
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
@@ -37,7 +37,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CodeLibrary">
<HintPath>..\..\
..\RC32-SZBOSCH-ACSingleStore\
dll\CodeLibrary.dll</HintPath>
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="halcondotnet">
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\halcondotnet.dll</HintPath>
...
...
@@ -54,6 +54,9 @@
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="zxing">
<HintPath>..\..\dll\zxing.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="acSingleStore\AC_SA_BoxBean.cs" />
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
62e1356
...
...
@@ -1528,6 +1528,10 @@ namespace OnlineStore.DeviceLibrary
message
=
""
;
}
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
if
(
CodeManager
.
DeCodeType
.
Equals
(
1
))
{
message
=
"=1+0x0-"
+
GetSize
()
+
"x"
+
height
+
"="
+
CodeManager
.
GetBarcode
(
message
);
}
onCodeReceived
(
message
);
}
...
...
source/DeviceLibrary/acSingleStore/StoreManager.cs
查看文件 @
62e1356
source/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
62e1356
using
CodeLibrary
;
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -8,11 +8,12 @@ using System.Linq;
using
System.Runtime.ExceptionServices
;
using
System.Text
;
using
System.Windows.Forms
;
using
CodeLibrary
;
namespace
OnlineStore.DeviceLibrary
{
public
class
CodeManager
{
public
static
int
DeCodeType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DeCodeType
);
public
static
List
<
string
>
cameraNameList
=
new
List
<
string
>();
public
static
List
<
string
>
codeTypeList
=
new
List
<
string
>();
...
...
@@ -163,6 +164,8 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】获取图片完成"
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
if
(
DeCodeType
.
Equals
(
0
))
{
HalconDotNet
.
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
...
...
@@ -185,8 +188,18 @@ namespace OnlineStore.DeviceLibrary
codeList
.
Add
(
c
.
CodeStr
);
r
=
r
+
"##"
+
c
.
CodeStr
;
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】【"
+
codeType
+
"】扫码完成:"
+
r
);
LogUtil
.
info
(
" 【"
+
cameraName
+
"】【"
+
codeType
+
"】扫码完成:"
+
r
);
}
}
}
else
{
string
result
=
CodeLibrary
.
ZXingCodeHelper
.
DecodeQRCode
(
bitmap
);
if
(!
String
.
IsNullOrEmpty
(
result
))
{
return
new
List
<
string
>()
{
result
};
}
}
}
}
...
...
@@ -218,6 +231,37 @@ namespace OnlineStore.DeviceLibrary
return
""
;
}
}
public
static
string
GetBarcode
(
string
codeStr
)
{
if
(!
string
.
IsNullOrEmpty
(
codeStr
))
{
string
[]
codeInfos
=
codeStr
.
Replace
(
"\r"
,
""
).
Split
(
'\n'
);
string
ri
=
""
;
string
qty
=
""
;
string
youxiao
=
""
;
foreach
(
string
codeInfo
in
codeInfos
)
{
if
(
codeInfo
.
StartsWith
(
"物料编码:"
))
{
ri
=
codeInfo
.
Substring
(
5
);
}
else
if
(
codeInfo
.
StartsWith
(
"入库数量:"
))
{
qty
=
codeInfo
.
Substring
(
5
);
}
else
if
(
codeInfo
.
StartsWith
(
"有效期限:"
))
{
youxiao
=
codeInfo
.
Substring
(
5
);
}
}
if
(!
string
.
IsNullOrEmpty
(
ri
))
{
string
pn
=
ri
.
Split
(
' '
)[
0
];
return
pn
+
";"
+
qty
+
";"
+
ri
+
";"
+
youxiao
;
}
}
return
""
;
}
}
}
source/LoadCVSLibrary/position/CSVPositionReader.cs
查看文件 @
62e1356
...
...
@@ -231,27 +231,6 @@ namespace OnlineStore.LoadCSVLibrary
return
newStr
;
}
//private void ReadTest( )
//{
// Dictionary<string, string> dic = new Dictionary<string, string>();
// string path = Application.StartupPath + @"\Test.csv";
// dic.Add("AxisPosition", "中轴位置");
// dic.Add("ModbusHighPosition", "电钢高位");
// dic.Add("ModbusLowPosition", "电钢低位");
// Dictionary<string, KTKStorePostion> ddd = LoadCVSLibrary.CSVReaderHelper<KTKStorePostion>.ReadCVS(path, dic, typeof(KTKStorePostion));
// if (ddd != null)
// {
// MessageBox.Show("读取成功!");
// }
// else
// {
// MessageBox.Show("读取失败,请检查数据格式!");
// }
//}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论