Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 57adacc3
由
LN
编写于
2019-08-16 18:36:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
匈牙利料仓增加文件条码读取功能
1 个父辈
e2bf183f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
193 行增加
和
7 行删除
source/ACSingleStore/App.config
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/记录.txt
source/Common/Setting_Init.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/DeviceLibrary/acSingleStore/FileCodeController.cs
source/ACSingleStore/App.config
查看文件 @
57adacc
...
...
@@ -46,6 +46,10 @@
<
add
key
=
"DIMS"
value
=
"20"
/>
<
add
key
=
"DOMS"
value
=
"200"
/>
<
add
key
=
"SinglePosId"
value
=
"1#AC2_1_1_6"
/>
<!--是否使用文件条码 ,
1
=使用文件二维码,不需要扫码,
0
=使用相机扫码-->
<
add
key
=
"UseFileCode"
value
=
"1"
/>
<!--条码文件的位置,绝对路径-->
<
add
key
=
"CodeFilePath"
value
=
"D:\CodeFile.txt"
/>
</
appSettings
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
57adacc
此文件的差异被折叠,
点击展开。
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
57adacc
...
...
@@ -1775,5 +1775,16 @@ namespace OnlineStore.AutoInOutStore
}
}
private
void
button1_Click_2
(
object
sender
,
EventArgs
e
)
{
FileCodeController
.
ReloadFileCode
();
}
private
void
btnGetCode_Click
(
object
sender
,
EventArgs
e
)
{
string
code
=
FileCodeController
.
NextCode
();
MessageBox
.
Show
(
code
);
}
}
}
source/ACSingleStore/记录.txt
查看文件 @
57adacc
...
...
@@ -222,5 +222,23 @@ DI9 不要,只判断DI10
20190814修改:
匈牙利条码拼接修改,如果有2T475则拼接,没有的话按原来的方式返回。
// p/n 的码是P打头,SKID码是2T475打头
// RI;PN;QTY
\ No newline at end of file
//p/n 的码是P打头,SKID码是2T475打头
// RI;PN;QTY
20190816匈牙利料仓增加文件条码读取功能:
AutoInOutStore.exe.config增加配置:
<!--是否使用文件条码 ,1=使用文件二维码,不需要扫码,0=使用相机扫码-->
<add key ="UseFileCode" value ="1"/>
<!--条码文件的位置,绝对路径-->
<add key ="CodeFilePath" value ="D:\CodeFile.txt"/>
文件格式(PN1和RI1为最下面料盘的条码,以此类推):
PN1
RI1
PN2
RI2
PN3
RI3
PN4
RI4
\ No newline at end of file
source/Common/Setting_Init.cs
查看文件 @
57adacc
...
...
@@ -93,5 +93,15 @@ namespace OnlineStore.Common
/// 单盘入库默认PosID
/// </summary>
public
static
string
SinglePosId
=
"SinglePosId"
;
/// <summary>
/// 是否使用远程文件条码 ,1=使用文件二维码,不需要扫码
/// </summary>
public
static
string
UseFileCode
=
"UseFileCode"
;
/// <summary>
/// 条码文件的位置,绝对路径
/// </summary>
public
static
string
CodeFilePath
=
"CodeFilePath"
;
}
}
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
57adacc
...
...
@@ -59,6 +59,7 @@
<Compile Include="acSingleStore\AC_SA_BoxBean.cs" />
<Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" />
<Compile Include="acSingleStore\AutomaticBaiting_Partial.cs" />
<Compile Include="acSingleStore\FileCodeController.cs" />
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="acSingleStore\AutomaticBaiting.cs" />
<Compile Include="DeviceLibrary\IO\AIOBOX\BLL2.cs" />
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
查看文件 @
57adacc
...
...
@@ -311,6 +311,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I01_Wait
);
LogUtil
.
info
(
Name
+
"启动入料"
);
FileCodeController
.
ReloadFileCode
();
return
true
;
}
else
...
...
@@ -629,11 +630,27 @@ namespace OnlineStore.DeviceLibrary
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I03_ScanCode
);
LogUtil
.
info
(
Name
+
"入料: 开始扫码,最多等待6000 "
);
StoreMove
.
OneWaitCanEndStep
=
true
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCodeOK
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
6000
));
GetCameraCode
();
if
(
FileCodeController
.
UseFileCode
)
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
string
code
=
FileCodeController
.
NextCode
();
LogUtil
.
info
(
Name
+
"入料: 开始扫码,获取下一个文件二维码 : "
+
code
);
LastCodeList
=
new
List
<
string
>
{
code
};
LastCode
=
code
;
if
(
LastCode
.
Equals
(
""
))
{
StoreManager
.
Store
.
CodeOrInoutMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
InStoreNoCode
,
"未扫到二维码,需要将料盘送出"
);
LogUtil
.
error
(
"未扫到二维码,需要将料盘送出"
);
}
}
else
{
LogUtil
.
info
(
Name
+
"入料: 开始扫码,最多等待6000 "
);
StoreMove
.
OneWaitCanEndStep
=
true
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCodeOK
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
6000
));
GetCameraCode
();
}
}
else
{
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
57adacc
...
...
@@ -380,6 +380,11 @@ namespace OnlineStore.DeviceLibrary
// RI;PN;QTY
string
split
=
";"
;
string
result
=
""
;
//如果使用文件条码,直接返回
if
(
FileCodeController
.
UseFileCode
)
{
return
result
;
}
try
{
List
<
string
>
rCodes
=
new
List
<
string
>();
...
...
source/DeviceLibrary/acSingleStore/FileCodeController.cs
0 → 100644
查看文件 @
57adacc
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
/// <summary>
/// 文件条码操作类
/// </summary>
public
class
FileCodeController
{
public
static
bool
UseFileCode
=
false
;
public
static
string
FilePath
=
""
;
public
static
List
<
string
>
CurrCodeList
=
new
List
<
string
>();
public
static
int
CurrCodeIndex
=
-
1
;
static
FileCodeController
()
{
int
isuse
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseFileCode
);
if
(
isuse
.
Equals
(
1
))
{
FilePath
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeFilePath
);
if
(!
FilePath
.
Equals
(
""
))
{
UseFileCode
=
true
;
}
}
}
/// <summary>
/// 点击开始批量入库,开始读取文件并把条码放入内存
/// </summary>
/// <returns></returns>
public
static
bool
ReloadFileCode
()
{
if
(!
UseFileCode
)
{
return
false
;
}
try
{
CurrCodeList
=
new
List
<
string
>();
CurrCodeIndex
=
-
1
;
List
<
string
>
Data
=
new
List
<
string
>();
if
(
File
.
Exists
(
FilePath
))
{
string
[]
allLines
=
File
.
ReadAllLines
(
FilePath
);
foreach
(
string
str
in
allLines
)
{
string
code
=
str
.
Trim
();
if
(
String
.
IsNullOrEmpty
(
code
))
{
continue
;
}
Data
.
Add
(
str
);
}
//清理文件内容
File
.
WriteAllLines
(
FilePath
,
new
string
[]
{
});
}
else
{
LogUtil
.
error
(
"文件【"
+
FilePath
+
"】不存在"
);
return
false
;
}
//文件格式,需要拼接成:RI:PN:Q
//PN1
//RI1
//PN2
//RI2
//倒叙拼接二维码
if
(
Data
.
Count
>
0
)
{
string
codeMsg
=
""
;
for
(
int
i
=
Data
.
Count
-
1
;
i
>=
1
;
i
-=
2
)
{
string
ri
=
Data
[
i
];
string
pn
=
Data
[
i
-
1
];
string
code
=
ri
+
";"
+
pn
+
";1"
;
CurrCodeList
.
Add
(
code
);
codeMsg
+=
code
+
"\r\n"
;
}
LogUtil
.
info
(
"文件【"
+
FilePath
+
"】解析到条码=\r\n"
+
codeMsg
);
}
else
{
LogUtil
.
error
(
"文件【"
+
FilePath
+
"】未读取到条码"
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"ReloadFileCode出错:"
+
ex
.
ToString
());
}
return
false
;
}
public
static
string
NextCode
()
{
if
(
UseFileCode
&&
CurrCodeList
.
Count
>
0
)
{
CurrCodeIndex
++;
if
(
CurrCodeList
.
Count
>
CurrCodeIndex
)
{
return
CurrCodeList
[
CurrCodeIndex
];
}
}
return
""
;
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论