Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 478d0803
由
刘韬
编写于
2022-07-28 13:20:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
80340cc5
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
28 行增加
和
23 行删除
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/Properties/AssemblyInfo.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/dataLogic/DLScanSocket.cs
source/DeviceLibrary/halcon/CodeManager.cs
source/LoadCVSLibrary/storeConfig/config/AC_SA_Config.cs
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
478d080
...
...
@@ -627,6 +627,7 @@ namespace OnlineStore.ACSingleStore
private
void
扫码测试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
LogUtil
.
info
(
"isScannerRun:"
+
store
.
dlScanSocket
.
isScannerRun
);
if
(
store
.
dlScanSocket
.
isScannerRun
)
{
store
.
dlScanSocket
.
StartConnect
();
...
...
source/ACSingleStore/Properties/AssemblyInfo.cs
查看文件 @
478d080
...
...
@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SO951-HC-ACSingleStore
0f64825aab27a7a50fb6d1a79d844b0f7b265c8
0")]
[assembly: AssemblyProduct("SO951-HC-ACSingleStore
80340cc5c64647256d580f0ea4aa132b7bb874e
0")]
[assembly: AssemblyCopyright("Copyright ? 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
478d080
...
...
@@ -103,6 +103,7 @@ namespace OnlineStore.DeviceLibrary
}
LogUtil
.
info
(
StoreName
+
"共加载到["
+
positionList
.
Count
+
"]个库位,["
+
PositionNumList
.
Count
+
"]个为料仓有效库位"
);
dlScanSocket
=
new
DLScanSocket
(
config
.
Scanner_Ip
,
config
.
Scanner_Port
,
onCodeReceived
);
dlScanSocket
.
StartConnect
(
true
);
//初始化摄像机配置
CodeManager
.
LoadConfig
();
IOManager
.
Init
();
...
...
@@ -1174,9 +1175,7 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE
checkIO
=
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Door
);
var
IsServerAccess
=
CodeManager
.
IsServerAccess
();
int
height
=
0
;
if
(!
IsServerAccess
)
height
=
GetHeight
();
int
height
=
GetHeight
();
//判断料门口是否有料
//光栅不遮挡时才扫码
...
...
@@ -1201,6 +1200,7 @@ namespace OnlineStore.DeviceLibrary
//GetCameraCode();
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
LastScanTime
=
DateTime
.
Now
;
LogUtil
.
info
(
"isScannerRun:"
+
dlScanSocket
.
isScannerRun
);
var
isdl
=
dlScanSocket
.
BeginScan
();
LogUtil
.
info
(
StoreName
+
"DL扫码枪="
+
isdl
);
if
(!
isdl
)
...
...
@@ -1219,7 +1219,7 @@ namespace OnlineStore.DeviceLibrary
{
codelist
=
CodeManager
.
CameraScan
();
}
onCodeReceived
(
codelist
.
ToArray
());
onCodeReceived
(
"running"
,
codelist
.
ToArray
());
});
}
}
...
...
@@ -1482,7 +1482,7 @@ namespace OnlineStore.DeviceLibrary
/// 扫码枪数据接收
/// </summary>
/// <param name="message"></param>
private
void
onCodeReceived
(
string
[]
codeList
)
private
void
onCodeReceived
(
string
src
,
string
[]
codeList
)
{
try
{
...
...
@@ -1497,7 +1497,7 @@ namespace OnlineStore.DeviceLibrary
if
(
CurrScanCount
>=
MaxScanCount
)
{
InStoreFail
=
true
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
"["
+
CurrScanCount
+
"]未收到二维码,请重新放入料盘,通知服务器未扫到条码"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
$
"[{src}]"
+
"["
+
CurrScanCount
+
"]未收到二维码,请重新放入料盘,通知服务器未扫到条码"
);
//TODO 向服务器发送未扫到码消息
//发送扫码内容到服务器进行入库操作
...
...
@@ -1510,7 +1510,7 @@ namespace OnlineStore.DeviceLibrary
else
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"["
+
CurrScanCount
+
"]未收到二维码,请重新放入料盘"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
$
"[{src}]"
+
"["
+
CurrScanCount
+
"]未收到二维码,请重新放入料盘"
);
}
IsScanCode
=
false
;
return
;
...
...
@@ -1519,12 +1519,12 @@ namespace OnlineStore.DeviceLibrary
// InStoreFail = false;
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"二维码【 "
+
message
+
"】,设备未启动,不需要发送服务器"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
$
"[{src}]"
+
"二维码【 "
+
message
+
"】,设备未启动,不需要发送服务器"
);
IsScanCode
=
false
;
return
;
}
// CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
LogUtil
.
info
(
LOGGER
,
StoreName
+
"二维码【 "
+
message
+
"】,发送给服务器获取入库PosID"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
$
"[{src}]"
+
"二维码【 "
+
message
+
"】,发送给服务器获取入库PosID"
);
//发送扫码内容到服务器进行入库操作
Operation
operation
=
getLineBoxStatus
();
operation
.
op
=
1
;
...
...
@@ -1534,15 +1534,16 @@ namespace OnlineStore.DeviceLibrary
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
if
(
resultOperation
==
null
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"二维码【"
+
message
+
"】没有收到服务器反馈!"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
$
"[{src}]"
+
"二维码【"
+
message
+
"】没有收到服务器反馈!"
);
IsScanCode
=
false
;
return
;
}
else
if
(!
string
.
IsNullOrEmpty
(
resultOperation
.
msg
)
&&
string
.
IsNullOrEmpty
(
resultOperation
.
data
[
ParamDefine
.
posId
]
))
else
if
(!
string
.
IsNullOrEmpty
(
resultOperation
.
msg
)
&&
!
resultOperation
.
data
.
ContainsKey
(
ParamDefine
.
posId
))
{
InStoreFail
=
true
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 二维码【"
+
message
+
"】 服务器反馈 :"
+
resultOperation
.
msg
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
$
"[{src}]"
+
" 二维码【"
+
message
+
"】 服务器反馈 :"
+
resultOperation
.
msg
);
CodeMsg
=
resultOperation
.
msg
;
//SetWarnMsg("");
IsScanCode
=
false
;
return
;
}
...
...
@@ -1643,10 +1644,12 @@ namespace OnlineStore.DeviceLibrary
{
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
LastScanTime
=
DateTime
.
Now
;
dlScanSocket
.
BeginScan
();
var
isdl
=
dlScanSocket
.
BeginScan
();
if
(
isdl
)
return
;
Task
.
Run
(()
=>
{
var
codelist
=
CodeManager
.
CameraScan
();
onCodeReceived
(
codelist
.
ToArray
());
onCodeReceived
(
"手动"
,
codelist
.
ToArray
());
});
}
else
...
...
@@ -1737,7 +1740,7 @@ namespace OnlineStore.DeviceLibrary
}
public
int
GetHeight
()
{
if
(
!
CodeManager
.
IsServerAccess
())
if
(
CodeManager
.
IsServerAccess
())
return
0
;
if
(
Config
.
Default_TrayWidth
.
Equals
(
Width_7
))
{
...
...
@@ -1769,7 +1772,6 @@ namespace OnlineStore.DeviceLibrary
{
return
result
;
}
double
ai1Value
=
ConvertAI
(
IOManager
.
GetADIOValue
(
Config
.
AIDI1_Addr
),
Config
.
AIDI1_DefaultPosition
);
double
ai2Value
=
ConvertAI
(
IOManager
.
GetADIOValue
(
Config
.
AIDI2_Addr
),
Config
.
AIDI2_DefaultPosition
);
double
Value
=
0
;
...
...
@@ -1780,7 +1782,8 @@ namespace OnlineStore.DeviceLibrary
else
if
(
ai2Value
>
5
)
Value
=
Math
.
Round
(
ai2Value
,
1
);
// Common.LogUtil.OutputDebugString($"ai1Value:{ai1Value},ai1Value:{ai2Value},Value:{Value}");
// Common.LogUtil.OutputDebugString($"ai1Value:{ai1Value},ai1Value:{ai2Value},Value:{Value}");
return
CalHeight
(
Value
);
}
...
...
source/DeviceLibrary/dataLogic/DLScanSocket.cs
查看文件 @
478d080
...
...
@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
public
bool
isScannerRun
=
false
;
private
string
ScannerIP
=
""
;
private
int
ScannerPort
=
0
;
public
delegate
void
OnCodeRevice
(
string
[]
codeList
);
public
delegate
void
OnCodeRevice
(
string
src
,
string
[]
codeList
);
public
event
OnCodeRevice
CodeReviceEvent
;
public
DLScanSocket
(
string
serverIp
,
int
port
,
OnCodeRevice
revicePro
)
{
...
...
@@ -48,6 +48,7 @@ namespace OnlineStore.DeviceLibrary
{
isScannerRun
=
true
;
}
LogUtil
.
error
(
"datalogic Connect:"
+
result
);
}
}
catch
(
Exception
ex
)
...
...
@@ -129,7 +130,7 @@ namespace OnlineStore.DeviceLibrary
}
message
=
asciiEncoding
.
GetString
(
newBytes
.
ToArray
());
string
[]
codeList
=
message
.
Split
(
new
string
[]
{
spiltStr
},
StringSplitOptions
.
RemoveEmptyEntries
);
CodeReviceEvent
?.
Invoke
(
codeList
);
CodeReviceEvent
?.
Invoke
(
"datalogic"
,
codeList
);
// return message;
}
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
478d080
...
...
@@ -135,7 +135,7 @@ namespace OnlineStore.DeviceLibrary
public
static
bool
IsServerAccess
()
{
if
(
cameraNameList
!=
null
&&
cameraNameList
.
Count
>=
0
)
if
(
cameraNameList
!=
null
&&
cameraNameList
.
Count
>=
1
)
{
if
(
cameraNameList
[
0
].
Trim
().
ToLower
().
IndexOf
(
"server"
)
>=
0
)
{
...
...
source/LoadCVSLibrary/storeConfig/config/AC_SA_Config.cs
查看文件 @
478d080
...
...
@@ -503,12 +503,12 @@ namespace OnlineStore.LoadCSVLibrary
/// PRO (轴四)压紧轴加速度 CompAxis_AddSpeed 300
/// </summary>
[
ConfigProAttribute
(
"CompAxis_AddSpeed"
)]
public
shor
t
CompAxis_AddSpeed
{
get
;
set
;
}
public
in
t
CompAxis_AddSpeed
{
get
;
set
;
}
/// <summary>
/// PRO (轴四)压紧轴减速度 CompAxis_DelSpeed 300
/// </summary>
[
ConfigProAttribute
(
"CompAxis_DelSpeed"
)]
public
shor
t
CompAxis_DelSpeed
{
get
;
set
;
}
public
in
t
CompAxis_DelSpeed
{
get
;
set
;
}
/// <summary>
/// PRO (轴四)压紧轴原点低速 CompAxis_HomeLowSpeed 20
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论