Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e299a231
由
LN
编写于
2020-03-04 20:04:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
扫码时最多扫2次,通知服务器没扫到码,等待料盘拿走后,再重新开始扫码
1 个父辈
65f4f104
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
54 行增加
和
11 行删除
source/ACSingleStore/App.config
source/ACSingleStore/记录.txt
source/Common/Setting_Init.cs
source/Common/util/TcpClient.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/ACSingleStore/App.config
查看文件 @
e299a23
...
@@ -39,6 +39,8 @@
...
@@ -39,6 +39,8 @@
<
add
key
=
"UseBuzzer"
value
=
"1"
/>
<
add
key
=
"UseBuzzer"
value
=
"1"
/>
<
add
key
=
"StartScan_CMD"
value
=
"S"
/>
<
add
key
=
"StartScan_CMD"
value
=
"S"
/>
<
add
key
=
"ShowLanguageMsg"
value
=
"1"
/>
<
add
key
=
"ShowLanguageMsg"
value
=
"1"
/>
<!--每盘料扫码的次数-->
<
add
key
=
"MaxScanCount"
value
=
"2"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/ACSingleStore/记录.txt
查看文件 @
e299a23
...
@@ -121,3 +121,8 @@ DeCodeType=解码类型,0=halcon,1=zxing解码 西安料仓解析方式。2=
...
@@ -121,3 +121,8 @@ DeCodeType=解码类型,0=halcon,1=zxing解码 西安料仓解析方式。2=
20200302
20200302
进出轴回待机点需要判断原点信号亮。
进出轴回待机点需要判断原点信号亮。
20200304
扫码时最多扫2次,通知服务器没扫到码,等待料盘拿走后,再重新开始扫码
source/Common/Setting_Init.cs
查看文件 @
e299a23
...
@@ -102,5 +102,7 @@ namespace OnlineStore.Common
...
@@ -102,5 +102,7 @@ namespace OnlineStore.Common
public
static
string
Tool_TargetPosition
=
"Tool_TargetPosition"
;
public
static
string
Tool_TargetPosition
=
"Tool_TargetPosition"
;
public
static
string
ShowLanguageMsg
=
"ShowLanguageMsg"
;
public
static
string
ShowLanguageMsg
=
"ShowLanguageMsg"
;
public
static
string
Default_Language
=
"Default_Language"
;
public
static
string
Default_Language
=
"Default_Language"
;
public
static
string
MaxScanCount
=
"MaxScanCount"
;
}
}
}
}
source/Common/util/TcpClient.cs
查看文件 @
e299a23
...
@@ -169,7 +169,7 @@ namespace OnlineStore.Common
...
@@ -169,7 +169,7 @@ namespace OnlineStore.Common
{
{
m_clientSocket
.
BeginReceive
(
m_receiveBuffer
,
0
,
m_receiveBuffer
.
Length
,
0
,
new
AsyncCallback
(
ReceiveCallBack
),
null
);
m_clientSocket
.
BeginReceive
(
m_receiveBuffer
,
0
,
m_receiveBuffer
.
Length
,
0
,
new
AsyncCallback
(
ReceiveCallBack
),
null
);
LogUtil
.
info
(
LOGGER
,
"Connect to "
+
ServerIp
+
":"
+
ServerPort
+
" success!"
);
LogUtil
.
info
(
LOGGER
,
"
Re
Connect to "
+
ServerIp
+
":"
+
ServerPort
+
" success!"
);
}
}
isInProcess
=
false
;
isInProcess
=
false
;
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
e299a23
...
@@ -43,6 +43,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -43,6 +43,8 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
bool
IsHasCompress_Axis
=
true
;
public
bool
IsHasCompress_Axis
=
true
;
public
bool
UseBuzzer
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseBuzzer
).
Equals
(
1
);
public
bool
UseBuzzer
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseBuzzer
).
Equals
(
1
);
public
int
MaxScanCount
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
MaxScanCount
);
public
int
CurrScanCount
=
1
;
//public ScanSocket scanSocket = new ScanSocket();
//public ScanSocket scanSocket = new ScanSocket();
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
...
@@ -173,6 +175,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -173,6 +175,12 @@ namespace OnlineStore.DeviceLibrary
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
alarmType
=
StoreAlarmType
.
None
;
alarmType
=
StoreAlarmType
.
None
;
if
(
MaxScanCount
<=
0
)
{
MaxScanCount
=
2
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
MaxScanCount
,
MaxScanCount
);
}
//急停按钮和气压检测需要一起判断
//急停按钮和气压检测需要一起判断
IO_VALUE
suddenBtn
=
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
suddenBtn
=
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
airCheck
=
IOManager
.
IOValue
(
IO_Type
.
Airpressure_Check
);
IO_VALUE
airCheck
=
IOManager
.
IOValue
(
IO_Type
.
Airpressure_Check
);
...
@@ -261,6 +269,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -261,6 +269,7 @@ namespace OnlineStore.DeviceLibrary
CurrInOutCount
=
0
;
CurrInOutCount
=
0
;
CurrInOutACount
=
0
;
CurrInOutACount
=
0
;
CurrScanCount
=
0
;
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
...
@@ -1056,8 +1065,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1056,8 +1065,8 @@ namespace OnlineStore.DeviceLibrary
{
{
isWaitScan
=
false
;
isWaitScan
=
false
;
IsScanCode
=
true
;
IsScanCode
=
true
;
CurrScanCount
++;
LogUtil
.
info
(
StoreName
+
"检测到"
+
height
+
"寸料盘,开始扫码"
);
LogUtil
.
info
(
StoreName
+
"检测到"
+
height
+
"寸料盘,开始扫码
,次数 ["
+
CurrScanCount
+
"]
"
);
GetCameraCode
();
GetCameraCode
();
}
}
}
}
...
@@ -1069,6 +1078,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1069,6 +1078,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
CurrScanCount
=
0
;
isWaitScan
=
false
;
isWaitScan
=
false
;
}
}
}
}
...
@@ -1157,8 +1167,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1157,8 +1167,9 @@ namespace OnlineStore.DeviceLibrary
// LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutCount + "次,需要复位一下旋转轴");
// LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutCount + "次,需要复位一下旋转轴");
// }
// }
//}
//}
else
else
if
(!
IsDebug
)
{
{
//调试状态不处理出库任务
FixtureCodeInfo
currInOutFixture
=
null
;
FixtureCodeInfo
currInOutFixture
=
null
;
lock
(
waitOutListLock
)
lock
(
waitOutListLock
)
{
{
...
@@ -1317,6 +1328,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1317,6 +1328,7 @@ namespace OnlineStore.DeviceLibrary
{
{
try
try
{
{
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
LOW
);
string
message
=
ProcessCode
(
codeList
);
string
message
=
ProcessCode
(
codeList
);
message
=
ScanCodeManager
.
ReplaceCode
(
message
);
message
=
ScanCodeManager
.
ReplaceCode
(
message
);
...
@@ -1326,7 +1338,22 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1326,7 +1338,22 @@ namespace OnlineStore.DeviceLibrary
IsScanCode
=
false
;
IsScanCode
=
false
;
CodeMsg
=
ResourceControl
.
GetChinaString
(
ResourceControl
.
NoCodeMsg
,
"没有收到二维码信息,请重新放入料盘"
);
CodeMsg
=
ResourceControl
.
GetChinaString
(
ResourceControl
.
NoCodeMsg
,
"没有收到二维码信息,请重新放入料盘"
);
CodeMsgEn
=
ResourceControl
.
GetEnglishString
(
ResourceControl
.
NoCodeMsg
,
"没有收到二维码信息,请重新放入料盘"
);
CodeMsgEn
=
ResourceControl
.
GetEnglishString
(
ResourceControl
.
NoCodeMsg
,
"没有收到二维码信息,请重新放入料盘"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"没有收到二维码信息,请重新放入料盘"
);
if
(
CurrScanCount
>=
MaxScanCount
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"没有收到二维码信息 【"
+
CurrScanCount
+
"】次,请重新放入料盘,通知服务器未扫到条码"
);
//TODO 向服务器发送未扫到码消息
//发送扫码内容到服务器进行入库操作
Operation
operationT
=
getLineBoxStatus
();
operationT
.
op
=
1
;
operationT
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
message
},
{
"boxId"
,
StoreID
.
ToString
()
}
};
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operationT
,
false
);
}
else
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"没有收到二维码信息 【"
+
CurrScanCount
+
"】次,请重新放入料盘"
);
}
return
;
return
;
}
}
...
@@ -1343,7 +1370,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1343,7 +1370,7 @@ namespace OnlineStore.DeviceLibrary
Operation
operation
=
getLineBoxStatus
();
Operation
operation
=
getLineBoxStatus
();
operation
.
op
=
1
;
operation
.
op
=
1
;
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
message
},
{
"boxId"
,
StoreID
.
ToString
()
}
};
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
message
},
{
"boxId"
,
StoreID
.
ToString
()
}
};
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
//
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
if
(
resultOperation
==
null
)
if
(
resultOperation
==
null
)
{
{
...
@@ -1439,21 +1466,28 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1439,21 +1466,28 @@ namespace OnlineStore.DeviceLibrary
#
region
Halcon
扫码枪代码
#
region
Halcon
扫码枪代码
private
DateTime
LastScanTime
=
DateTime
.
Now
;
private
DateTime
LastScanTime
=
DateTime
.
Now
;
public
bool
IsTestCamera
=
false
;
public
void
GetCameraCode
()
public
void
GetCameraCode
()
{
{
TimeSpan
span
=
DateTime
.
Now
-
LastScanTime
;
TimeSpan
span
=
DateTime
.
Now
-
LastScanTime
;
if
(
IsTestCamera
&&
IsScanCode
&&
(
span
.
TotalSeconds
<
60
))
if
(
IsScanCode
&&
(
span
.
TotalSeconds
<
12
))
{
{
LogUtil
.
info
(
"上次扫码还未执行完毕,请稍后!"
);
LogUtil
.
info
(
"上次扫码还未执行完毕,请稍后!"
);
return
;
return
;
}
}
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
LastScanTime
=
DateTime
.
Now
;
dlScanSocket
.
BeginScan
();
dlScanSocket
.
BeginScan
();
}
}
private
bool
CanStartCode
()
{
TimeSpan
span
=
DateTime
.
Now
-
LastScanTime
;
if
(
IsScanCode
&&
span
.
TotalSeconds
<
12
)
{
return
false
;
}
return
true
;
}
private
string
ProcessCode
(
string
[]
codeList
)
private
string
ProcessCode
(
string
[]
codeList
)
{
{
string
message
=
""
;
string
message
=
""
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论