Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9ecc8e31
由
刘韬
编写于
2021-01-18 13:53:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
合并LN_07 Jan, 2021 1 次提交
1 个父辈
b35ac40c
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
392 行增加
和
268 行删除
source/ACSingleStore/FrmIOStatus.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/positionTool/FrmPositionTool.Designer.cs
source/Common/util/HttpHelper.cs
source/Common/util/JsonHelper.cs
source/Common/util/LogUtil.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/StoreConfig/AC/linePositions.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/DeviceLibrary/acSingleStore/StoreManager.cs
source/ACSingleStore/FrmIOStatus.Designer.cs
查看文件 @
9ecc8e3
...
...
@@ -102,7 +102,7 @@
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
456
,
608
);
this
.
groupBox1
.
TabIndex
=
105
;
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
Text
=
"
DO写入
"
;
this
.
groupBox1
.
Text
=
"
IO状态修改
"
;
//
// btnCloseDeviceLed
//
...
...
@@ -155,7 +155,7 @@
this
.
btnDisDoorClose
.
Name
=
"btnDisDoorClose"
;
this
.
btnDisDoorClose
.
Size
=
new
System
.
Drawing
.
Size
(
135
,
52
);
this
.
btnDisDoorClose
.
TabIndex
=
268
;
this
.
btnDisDoorClose
.
Text
=
"激活
电气
维护门警报"
;
this
.
btnDisDoorClose
.
Text
=
"激活维护门警报"
;
this
.
btnDisDoorClose
.
UseVisualStyleBackColor
=
true
;
this
.
btnDisDoorClose
.
Click
+=
new
System
.
EventHandler
(
this
.
btnDisDoorClose_Click
);
//
...
...
@@ -166,7 +166,7 @@
this
.
btnDisDoorOpen
.
Name
=
"btnDisDoorOpen"
;
this
.
btnDisDoorOpen
.
Size
=
new
System
.
Drawing
.
Size
(
135
,
52
);
this
.
btnDisDoorOpen
.
TabIndex
=
267
;
this
.
btnDisDoorOpen
.
Text
=
"关闭
电气
维护门警报"
;
this
.
btnDisDoorOpen
.
Text
=
"关闭维护门警报"
;
this
.
btnDisDoorOpen
.
UseVisualStyleBackColor
=
true
;
this
.
btnDisDoorOpen
.
Click
+=
new
System
.
EventHandler
(
this
.
btnDisDoorOpen_Click
);
//
...
...
@@ -188,7 +188,7 @@
this
.
button5
.
Name
=
"button5"
;
this
.
button5
.
Size
=
new
System
.
Drawing
.
Size
(
135
,
52
);
this
.
button5
.
TabIndex
=
265
;
this
.
button5
.
Text
=
"
打开
进气口"
;
this
.
button5
.
Text
=
"
开启
进气口"
;
this
.
button5
.
UseVisualStyleBackColor
=
true
;
this
.
button5
.
Click
+=
new
System
.
EventHandler
(
this
.
button5_Click
);
//
...
...
@@ -277,7 +277,7 @@
this
.
label3
.
Name
=
"label3"
;
this
.
label3
.
Size
=
new
System
.
Drawing
.
Size
(
104
,
32
);
this
.
label3
.
TabIndex
=
247
;
this
.
label3
.
Text
=
"
选择
:"
;
this
.
label3
.
Text
=
"
端口
:"
;
this
.
label3
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
// btnOpenLed
...
...
@@ -384,7 +384,7 @@
this
.
label5
.
Name
=
"label5"
;
this
.
label5
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
30
);
this
.
label5
.
TabIndex
=
237
;
this
.
label5
.
Text
=
"保持(ms):"
;
this
.
label5
.
Text
=
"保持
时间
(ms):"
;
this
.
label5
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
// cmbWriteIO
...
...
@@ -555,4 +555,3 @@
private
System
.
Windows
.
Forms
.
Button
btnOpenDeviceLed
;
}
}
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
9ecc8e3
...
...
@@ -1574,6 +1574,8 @@ namespace OnlineStore.AutoInOutStore
LogUtil
.
info
(
LOGGER
,
store
.
StoreName
+
"开启自动出入库模式,开始位置【"
+
poText
+
"】(索引="
+
currIndex
+
"),间隔="
+
jiange
+
""
);
btnStart
.
Text
=
StopAuto
;
DebugStatus
(
false
);
string
msg
=
AutomaticBaiting
.
doStartBatchIn
();
LogUtil
.
info
(
"自动出入库: 开始自动入库:库位号【"
+
poText
+
"】,开始入库,结果:"
+
msg
);
}
}
}
...
...
source/ACSingleStore/positionTool/FrmPositionTool.Designer.cs
查看文件 @
9ecc8e3
...
...
@@ -33,7 +33,6 @@
this
.
groupBox6
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
picAxis2
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
ioSingle
=
new
UserFromControl
.
IOTextControl
();
this
.
txtP4Offset
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label10
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtP3Offset
=
new
System
.
Windows
.
Forms
.
TextBox
();
...
...
@@ -72,6 +71,7 @@
this
.
btnClear
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
richTextBox1
=
new
System
.
Windows
.
Forms
.
RichTextBox
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
ioSingle
=
new
UserFromControl
.
IOTextControl
();
this
.
groupBox6
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
picAxis2
)).
BeginInit
();
this
.
groupBox2
.
SuspendLayout
();
...
...
@@ -101,7 +101,7 @@
this
.
picAxis2
.
Image
=
((
System
.
Drawing
.
Image
)(
resources
.
GetObject
(
"picAxis2.Image"
)));
this
.
picAxis2
.
Location
=
new
System
.
Drawing
.
Point
(
453
,
13
);
this
.
picAxis2
.
Name
=
"picAxis2"
;
this
.
picAxis2
.
Size
=
new
System
.
Drawing
.
Size
(
551
,
5
4
2
);
this
.
picAxis2
.
Size
=
new
System
.
Drawing
.
Size
(
551
,
5
0
2
);
this
.
picAxis2
.
SizeMode
=
System
.
Windows
.
Forms
.
PictureBoxSizeMode
.
Zoom
;
this
.
picAxis2
.
TabIndex
=
285
;
this
.
picAxis2
.
TabStop
=
false
;
...
...
@@ -140,17 +140,6 @@
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
Text
=
"位置信息"
;
//
// ioSingle
//
this
.
ioSingle
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ioSingle
.
IOName
=
"检测信号"
;
this
.
ioSingle
.
IOValue
=
0
;
this
.
ioSingle
.
isCanClick
=
false
;
this
.
ioSingle
.
Location
=
new
System
.
Drawing
.
Point
(
46
,
425
);
this
.
ioSingle
.
Name
=
"ioSingle"
;
this
.
ioSingle
.
Size
=
new
System
.
Drawing
.
Size
(
202
,
28
);
this
.
ioSingle
.
TabIndex
=
289
;
//
// txtP4Offset
//
this
.
txtP4Offset
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
...
...
@@ -540,9 +529,9 @@
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
richTextBox1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
richTextBox1
.
Location
=
new
System
.
Drawing
.
Point
(
454
,
5
76
);
this
.
richTextBox1
.
Location
=
new
System
.
Drawing
.
Point
(
454
,
5
21
);
this
.
richTextBox1
.
Name
=
"richTextBox1"
;
this
.
richTextBox1
.
Size
=
new
System
.
Drawing
.
Size
(
549
,
88
);
this
.
richTextBox1
.
Size
=
new
System
.
Drawing
.
Size
(
549
,
143
);
this
.
richTextBox1
.
TabIndex
=
105
;
this
.
richTextBox1
.
Text
=
""
;
//
...
...
@@ -551,6 +540,17 @@
this
.
timer1
.
Interval
=
1000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
// ioSingle
//
this
.
ioSingle
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ioSingle
.
IOName
=
"检测信号"
;
this
.
ioSingle
.
IOValue
=
0
;
this
.
ioSingle
.
isCanClick
=
false
;
this
.
ioSingle
.
Location
=
new
System
.
Drawing
.
Point
(
46
,
425
);
this
.
ioSingle
.
Name
=
"ioSingle"
;
this
.
ioSingle
.
Size
=
new
System
.
Drawing
.
Size
(
202
,
28
);
this
.
ioSingle
.
TabIndex
=
289
;
//
// FrmPositionTool
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
...
...
source/Common/util/HttpHelper.cs
查看文件 @
9ecc8e3
...
...
@@ -12,76 +12,53 @@ using System.Security.Cryptography;
using
System.Security.Cryptography.X509Certificates
;
using
System.Reflection
;
using
log4net
;
using
System.Threading
;
namespace
OnlineStore.Common
{
public
class
HttpHelper
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
static
string
Post
(
string
url
,
string
paramData
)
public
static
int
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Server_Log_Open
);
private
static
object
lockObj
=
""
;
public
static
Operation
PostOP
(
string
url
,
Operation
operation
,
int
lockTime
=
0
)
{
return
Post
(
url
,
paramData
,
Encoding
.
UTF8
);
}
/// <summary>
///
/// </summary>
/// <param name="url"></param>
/// <param name="operation"></param>
/// <param name="simulate">是否模拟服务器返回结果</param>
/// <returns></returns>
public
static
Operation
Post
(
string
url
,
Operation
operation
,
bool
simulate
)
if
(
Monitor
.
TryEnter
(
lockObj
,
lockTime
))
{
try
{
if
(
simulate
)
{
//模拟服务器返回
operation
.
status
=
200
;
operation
.
data
.
Clear
();
operation
.
data
.
Add
(
"posId"
,
"A001"
);
string
pos
=
"D100-111#D102-222#D104-333"
;
operation
.
data
.
Add
(
"pos"
,
pos
);
if
(
operation
.
op
==
1
||
operation
.
op
==
2
)
{
//入库或出库
string
json
=
JsonHelper
.
SerializeObject
(
operation
);
LogUtil
.
error
(
LOGGER
,
"模拟HTTP服务器返回出库入库信息:"
+
json
);
return
operation
;
}
}
else
{
string
json
=
""
;
try
string
result
=
PostJson
(
url
,
json
,
Encoding
.
UTF8
);
if
(
operation
.
op
>
0
)
{
json
=
JsonHelper
.
SerializeObject
(
operation
);
LogUtil
.
info
(
"send 【"
+
url
+
"】【"
+
json
+
"】 "
+
",receive 【 "
+
result
+
"】"
);
}
catch
(
Exception
ex
)
{
LOGGER
.
Error
(
"JsonHelper.SerializeObject(operation) 出错【operation.op="
+
operation
.
op
+
"】"
+
ex
);
}
string
result
=
Post
(
url
,
json
);
if
(!
string
.
IsNullOrEmpty
(
result
))
{
try
Operation
resultOP
=
JsonHelper
.
DeserializeJsonToObject
<
Operation
>(
result
);
if
(
resultOP
!=
null
&&
(!
operation
.
seq
.
Equals
(
resultOP
.
seq
)))
{
return
JsonHelper
.
DeserializeJsonToObject
<
Operation
>(
result
);
LogUtil
.
error
(
" seq error : send 【"
+
json
+
"】 "
+
",receive 【 "
+
result
+
"】"
);
}
return
resultOP
;
}
}
catch
(
Exception
ex
)
{
LOGGER
.
Error
(
"JsonHelper.DeserializeJsonToObject 出错【result="
+
result
+
"】"
+
ex
);
}
LogUtil
.
error
(
"PostOP error【operation.op="
+
operation
.
op
+
"】:"
+
ex
);
}
finally
{
Monitor
.
Exit
(
lockObj
);
}
}
catch
(
Exception
ex
)
else
if
(
lockTime
>
10
)
{
LOGGER
.
Error
(
"Post 出错【operation.op="
+
operation
.
op
+
"】:"
+
ex
);
string
json
=
JsonHelper
.
SerializeObject
(
operation
);
LogUtil
.
error
(
" PostOP "
+
lockTime
+
" send "
+
json
+
" TryEnter fail "
);
}
return
null
;
}
public
static
int
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Server_Log_Open
);
public
static
string
Post
(
string
url
,
string
paramData
=
""
,
Encoding
encoding
=
null
)
public
static
string
PostJson
(
string
url
,
string
paramData
=
""
,
Encoding
encoding
=
null
)
{
if
(
encoding
==
null
)
{
...
...
@@ -89,12 +66,9 @@ namespace OnlineStore.Common
}
if
(
isLog
==
1
)
{
LOGGER
.
Info
(
"给服务器发送数据【"
+
paramData
+
"】 "
);
}
if
(
paramData
!=
"null"
&&
paramData
!=
null
)
{
// LogUtil.debug(LOGGER, "HTTP POST to " + url + " \n\t >> " + paramData);
LogUtil
.
info
(
"PostJson Send【"
+
paramData
+
"】 "
);
}
string
result
=
""
;
if
(
url
.
ToLower
().
IndexOf
(
"https"
,
System
.
StringComparison
.
Ordinal
)
>
-
1
)
...
...
@@ -112,19 +86,15 @@ namespace OnlineStore.Common
//paramData = Uri.EscapeDataString(paramData);
result
=
wc
.
UploadString
(
url
,
"POST"
,
paramData
);
//LogUtil.info(result);
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"POST【"
+
paramData
+
"】 ERROR:"
+
e
.
StackTrace
,
1
);
}
if
(!
result
.
Contains
(
"null"
)
&&
result
.
Length
!=
0
)
{
//LogUtil.debug(LOGGER,"receive << " + result);
LogUtil
.
error
(
"PostJson【"
+
paramData
+
"】 ERROR:"
+
e
.
StackTrace
,
1
);
}
if
(
isLog
==
1
)
{
L
OGGER
.
Info
(
"收到服务器数据
【"
+
result
+
"】"
);
L
ogUtil
.
info
(
"PostJson Revice
【"
+
result
+
"】"
);
}
return
result
;
}
...
...
@@ -138,21 +108,81 @@ namespace OnlineStore.Common
{
try
{
LogUtil
.
debug
(
LOGGER
,
"HTTP GET FROM: "
+
url
);
LogUtil
.
debug
(
"HTTP GET FROM: "
+
url
);
var
wc
=
new
WebClient
{
Encoding
=
encoding
};
var
readStream
=
wc
.
OpenRead
(
url
);
using
(
var
sr
=
new
StreamReader
(
readStream
,
encoding
))
{
var
result
=
sr
.
ReadToEnd
();
LogUtil
.
debug
(
LOGGER
,
"receive << "
+
result
);
LogUtil
.
debug
(
"receive << "
+
result
);
return
result
;
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"HTTP GET ERROR:"
+
e
.
Message
,
2
);
LogUtil
.
error
(
"HTTP GET ERROR:"
+
e
.
Message
,
2
);
}
return
""
;
}
public
static
string
Post
(
string
url
,
string
paramData
=
""
,
int
timeOut
=
5000
)
{
bool
IsTimeOut
=
false
;
return
Post
(
url
,
paramData
,
Encoding
.
UTF8
,
timeOut
,
out
IsTimeOut
);
}
public
static
string
Post
(
string
url
,
string
paramData
,
Encoding
encoding
,
int
timeOut
,
out
bool
IsTimeOut
)
{
if
(
paramData
.
Equals
(
""
))
{
int
index
=
url
.
IndexOf
(
"?"
);
if
(
index
>
0
)
{
paramData
=
url
.
Substring
(
index
+
1
,
url
.
Length
-
index
-
1
);
url
=
url
.
Substring
(
0
,
index
);
}
}
IsTimeOut
=
false
;
if
(
isLog
==
1
)
{
LogUtil
.
info
(
"Send【"
+
url
+
"】【"
+
paramData
+
"】 "
);
}
string
result
=
""
;
if
(
url
.
ToLower
().
IndexOf
(
"https"
,
System
.
StringComparison
.
Ordinal
)
>
-
1
)
{
ServicePointManager
.
ServerCertificateValidationCallback
=
new
RemoteCertificateValidationCallback
((
sender
,
certificate
,
chain
,
errors
)
=>
{
return
true
;
});
}
try
{
var
wc
=
new
MyWebClient
(
timeOut
);
if
(
string
.
IsNullOrEmpty
(
wc
.
Headers
[
"Content-Type"
]))
wc
.
Headers
.
Add
(
"Content-Type"
,
"application/x-www-form-urlencoded;charset=UTF-8"
);
wc
.
Encoding
=
encoding
;
result
=
wc
.
UploadString
(
url
,
"POST"
,
paramData
);
//LogUtil.info(result);
}
catch
(
WebException
ex
)
{
IsTimeOut
=
true
;
LogUtil
.
error
(
"POST ["
+
url
+
"] WebException :"
+
ex
.
ToString
());
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"POST ["
+
url
+
"] ERROR:"
+
e
.
ToString
());
}
if
(
isLog
==
1
)
{
LogUtil
.
info
(
"Revice【"
+
result
+
"】"
);
}
return
result
;
}
}
}
\ No newline at end of file
source/Common/util/JsonHelper.cs
查看文件 @
9ecc8e3
using
System.Collections.Generic
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
Newtonsoft.Json
;
...
...
@@ -16,9 +17,17 @@ namespace OnlineStore.Common
/// <returns>json字符串</returns>
public
static
string
SerializeObject
(
object
o
)
{
try
{
string
json
=
JsonConvert
.
SerializeObject
(
o
);
return
json
;
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"JsonHelper.SerializeObject error【"
+
o
.
ToString
()
+
"】"
+
ex
);
}
return
""
;
}
/// <summary>
/// 解析JSON字符串生成对象实体
...
...
@@ -28,12 +37,20 @@ namespace OnlineStore.Common
/// <returns>对象实体</returns>
public
static
T
DeserializeJsonToObject
<
T
>(
string
json
)
where
T
:
class
{
try
{
JsonSerializer
serializer
=
new
JsonSerializer
();
StringReader
sr
=
new
StringReader
(
json
);
object
o
=
serializer
.
Deserialize
(
new
JsonTextReader
(
sr
),
typeof
(
T
));
T
t
=
o
as
T
;
return
t
;
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
" JsonHelper.DeserializeJsonToObject error【"
+
json
+
"】"
+
ex
);
}
return
null
;
}
/// <summary>
/// 解析JSON数组生成对象实体集合
...
...
source/Common/util/LogUtil.cs
查看文件 @
9ecc8e3
...
...
@@ -135,6 +135,7 @@ namespace OnlineStore.Common
//logBox.SelectionColor = color;
System
.
DateTime
now
=
System
.
DateTime
.
Now
;
logBox
.
AppendText
(
now
.
ToLongTimeString
()
+
" "
+
msg
+
Environment
.
NewLine
);
logBox
.
ScrollToCaret
();
count
++;
}
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
9ecc8e3
...
...
@@ -56,6 +56,7 @@
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
...
...
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
9ecc8e3
...
...
@@ -173,7 +173,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
code
Count
,
GetCodeParamFilePath
(
codeType
),
codeType
);
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
code
Type
,
GetCodeParamFilePath
(
codeType
),
codeCount
,
2000
);
}
foreach
(
CodeInfo
c
in
cc
)
{
...
...
@@ -189,7 +189,7 @@ namespace OnlineStore.DeviceLibrary
{
// SaveImageToFile(deviceName, cameraName, bit);
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】
扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
LogUtil
.
info
(
" 【"
+
cameraName
+
"】"
+
"
扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
}
catch
(
AccessViolationException
e
)
{
...
...
@@ -294,18 +294,5 @@ namespace OnlineStore.DeviceLibrary
{
return
Regex
.
IsMatch
(
str
,
@"[\u4e00-\u9fa5]"
);
}
public
static
string
ProcessCode
(
List
<
string
>
codeList
)
{
string
code
=
""
;
foreach
(
string
cc
in
codeList
)
{
if
(
string
.
IsNullOrEmpty
(
cc
))
{
continue
;
}
code
+=
cc
+
"##"
;
}
return
ReplaceCode
(
code
);
}
}
}
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
9ecc8e3
...
...
@@ -50,15 +50,15 @@ AXIS,(轴四)压紧轴,Comp_Axis,3,HC,0,,,,,
AXIS,(轴五)批量上下料轴,Batch_Axis,4,HC,0,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,升降轴 仓门位置P7(人工拿走盘的位置),UpDownAxis_Door_P7,34
3100
,,,,,,,
PRO,升降轴 出库高点P2,UpDownAxis_OutHigh_P2,2
31250
,,,,,,,
PRO,升降轴 出库低点P8,UpDownAxis_OutLow_P8,21
4900
,,,,,,,
PRO,升降轴从吸盘下方接料后下降的高度,UpDownAxis_DownValue,100
00
,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#39
3356;12#387000;16#387700;20#385000;24#381620;28#381620;32#381620;36#375200;40#375200;48#375200;52#375200;75#375200
;,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,
24570
0,,,,,,,
PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,100
0
,,,,,,,
PRO,压紧轴(轴四)P1待机原位点,CompressAxis_P1_Position,
249
00,,,,,,,
PRO,压紧轴(轴四)P2压紧点集合,CompressAxis_P2_List,8#4
17100;12#380400;16#370000;20#330000;24#319450;28#300000;32#200000;36#200000;40#200000;44#200000;48#196500;52#24900;75#24900;81#314421
;,,,,,,,
PRO,升降轴 仓门位置P7(人工拿走盘的位置),UpDownAxis_Door_P7,34
73
,,,,,,,
PRO,升降轴 出库高点P2,UpDownAxis_OutHigh_P2,2
276
,,,,,,,
PRO,升降轴 出库低点P8,UpDownAxis_OutLow_P8,21
13
,,,,,,,
PRO,升降轴从吸盘下方接料后下降的高度,UpDownAxis_DownValue,100,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#39
26;12#3884;16#3840;20#3800;24#3759
;,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,
306
0,,,,,,,
PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,100,,,,,,,
PRO,压紧轴(轴四)P1待机原位点,CompressAxis_P1_Position,
70
00,,,,,,,
PRO,压紧轴(轴四)P2压紧点集合,CompressAxis_P2_List,8#4
2835;12#38557;16#34550;20#30540;24#26030
;,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,,,,
...
...
@@ -68,25 +68,24 @@ PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,180,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,
5
00,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,
10
00,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,
10
00,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,
3
0,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,
25
0,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,
30
00,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,
2
00,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,
8
00,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,
8
00,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,
1
00,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,
4
00,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,
4
00,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,
9
0,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,
10
0,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,
5
00,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,
4
00,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,
12
00,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,
12
00,,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,250,,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,3000,,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,
5
000,,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,
1
000,,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,5000,,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,5000,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,200,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,800,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,5000,,,,,,,
PRO,升降轴(轴二)到仓门速度,UpDownAxis_Door_Speed,500,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,80,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,200,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,3000,,,,,,,
PRO,升降轴(轴二)P1速度,UpDownAxis_P1_Speed,2000,,,,,,,
PRO,升降轴(轴二)P2速度,UpDownAxis_P2_Speed,2000,,,,,,,
PRO,升降轴(轴二)P3速度,UpDownAxis_P3_Speed,2000,,,,,,,
...
...
@@ -97,15 +96,15 @@ PRO,升降轴(轴二)到仓门P7速度,UpDownAxis_P7_Speed,2000,,,,,,,
PRO,升降轴(轴二)P8速度,UpDownAxis_P8_Speed,100,,,,,,,
PRO,旋转轴(轴一)P1速度,MiddleAxis_P1_Speed,800,,,,,,,
PRO,旋转轴(轴一)P2速度,MiddleAxis_P2_Speed,800,,,,,,,
PRO,进出轴(轴三)P1速度,InOutAxis_P1_Speed,
6
00,,,,,,,
PRO,进出轴(轴三)P2速度,InOutAxis_P2_Speed,
3
00,,,,,,,
PRO,进出轴(轴三)P3速度,InOutAxis_P3_Speed,
3
00,,,,,, ,
PRO,(轴一)旋转轴最小误差脉冲值,MiddleAxis_ErrorCountMin,
10
,,,,,,,
PRO,(轴二)升降轴轴最小误差脉冲值,UpdownAxis_ErrorCountMin,
10
,,,,,,,
PRO,(轴三)进出轴最小误差脉冲值,InoutAxis_ErrorCountMin,
10
,,,,,,,
PRO,(轴一)旋转轴最大误差脉冲值,MiddleAxis_ErrorCountMax,
100
0,,,,,,,
PRO,(轴二)升降轴轴最大误差脉冲值,UpdownAxis_ErrorCountMax,
100
0,,,,,,,
PRO,(轴三)进出轴最大误差脉冲值,InoutAxis_ErrorCountMax,
100
0,,,,,,,
PRO,进出轴(轴三)P1速度,InOutAxis_P1_Speed,
12
00,,,,,,,
PRO,进出轴(轴三)P2速度,InOutAxis_P2_Speed,
16
00,,,,,,,
PRO,进出轴(轴三)P3速度,InOutAxis_P3_Speed,
16
00,,,,,, ,
PRO,(轴一)旋转轴最小误差脉冲值,MiddleAxis_ErrorCountMin,
5
,,,,,,,
PRO,(轴二)升降轴轴最小误差脉冲值,UpdownAxis_ErrorCountMin,
5
,,,,,,,
PRO,(轴三)进出轴最小误差脉冲值,InoutAxis_ErrorCountMin,
5
,,,,,,,
PRO,(轴一)旋转轴最大误差脉冲值,MiddleAxis_ErrorCountMax,
2
0,,,,,,,
PRO,(轴二)升降轴轴最大误差脉冲值,UpdownAxis_ErrorCountMax,
2
0,,,,,,,
PRO,(轴三)进出轴最大误差脉冲值,InoutAxis_ErrorCountMax,
2
0,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,, ,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
...
...
@@ -124,37 +123,37 @@ PRO,温湿度端口号,Humiture_Port,COM5,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,200,,,,,,,
PRO,(轴五)上料轴慢速匀速上升速度,BatchAxis_SlowSpeed,
2
00,,,,,,,
PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,
4
000,,,,,,,
PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,
4
000,,,,,,,
PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,
8
0,,,,,,,
PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,
2
000,,,,,, ,
PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,
1610000
,,,,,, ,
PRO,(轴五)上料轴P2点(待机点),BatchAxis_P2,
10
000,,,,,,,
PRO,(轴五)上料轴P2速度,BatchAxis_P2_Speed,1000,,,,,,,
PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,10,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,200
00
,,,,,,,
PRO,(轴五)上料轴慢速匀速上升速度,BatchAxis_SlowSpeed,
100
00,,,,,,,
PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,
60
000,,,,,,,
PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,
60
000,,,,,,,
PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20
000
,,,,,,,
PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,
3000
0,,,,,,,
PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,
90
000,,,,,, ,
PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,
290669
,,,,,, ,
PRO,(轴五)上料轴P2点(待机点),BatchAxis_P2,
3
000,,,,,,,
PRO,(轴五)上料轴P2速度,BatchAxis_P2_Speed,1
5
000,,,,,,,
PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,10
0
,,,,,,,
PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,,
PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,,
PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,
3000
0,,,,,,,
PRO,(轴五)上料轴出料时检测到料盘需要下降的高度,BatchAxis_DownPosition2,
150
000,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,2000,,,,,,,
PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,
1
0,,,,,,,
PRO,(轴五)上料轴出料时检测到料盘需要下降的高度,BatchAxis_DownPosition2,
3
000,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,2000
0
,,,,,,,
PRO,(轴五)上料轴最最大料盘高度,到达后无法批量出库,BatchAxis_MaxHeight,250,,,,,,,
PRO,最后一盘料需要补充的高度,LastTrayAddHeight,7,,,,,,,
PRO,(轴五)上料轴P3点(上料目标位置),BatchAxis_P3,
1724717
,,,,,,,
PRO,(轴五)上料轴P3点(上料目标位置),BatchAxis_P3,
362062
,,,,,,,
,,,,,,,,,,
PRO,(轴二)升降轴单盘入库抬升料盘的高度,UpdownAxis_UpPosition,100
0
,,,,,,,
PRO,(轴五)上料轴出库上升最大高度,BatchAxis_OutMaxValue,1
49139
0,,,,,,,
PRO,(轴二)升降轴单盘入库抬升料盘的高度,UpdownAxis_UpPosition,100,,,,,,,
PRO,(轴五)上料轴出库上升最大高度,BatchAxis_OutMaxValue,1
0
0,,,,,,,
,,,,,,,,,,
PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,
3
0000,,,,,,,
PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,
1
5000,,,,,,,
PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,
1
5000,,,,,,,
PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,
1
0000,,,,,,,
PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,
2
5000,,,,,,,
PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,
2
5000,,,,,,,
PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,3000,,,,,,,
PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,5000,,,,,,,
PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,10000,,,,,,,
PRO,(轴四)压紧轴P1速度,CompAxis_P1_Speed,
11
00,,,,,,,
PRO,(轴四)压紧轴P2速度,CompAxis_P2_Speed,
11
00,,,,,,,
PRO,(轴四)压紧轴P3速度,CompAxis_P3_Speed,
11
00,,,,,,,
PRO,(轴四)压紧轴P1速度,CompAxis_P1_Speed,
30
00,,,,,,,
PRO,(轴四)压紧轴P2速度,CompAxis_P2_Speed,
75
00,,,,,,,
PRO,(轴四)压紧轴P3速度,CompAxis_P3_Speed,
75
00,,,,,,,
PRO,特殊二维码尺寸配置,CodeSizeConfig,T;PartNum;1=330x81,,,,,,,
source/DeviceLibrary/StoreConfig/AC/linePositions.csv
查看文件 @
9ecc8e3
此文件的差异太大,无法显示。
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
9ecc8e3
...
...
@@ -75,17 +75,13 @@ namespace OnlineStore.DeviceLibrary
CodeManager
.
LoadConfig
();
AutomaticBaiting
.
Init
();
IOManager
.
Init
();
//AxisManager.Init();
//初始化 //连接设备
if
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeRun
).
Equals
(
1
))
{
}
else
{
Task
.
Factory
.
StartNew
(
delegate
{
if
(!
IOManager
.
instance
.
ConnectionIOList
(
Config
.
DIODeviceNameList
))
{
return
;
}
IOManager
.
instance
.
ConnectionIOList
(
Config
.
DIODeviceNameList
);
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
Thread
.
Sleep
(
300
);
//默认三个灯都亮
...
...
@@ -137,7 +133,8 @@ namespace OnlineStore.DeviceLibrary
//SafetyLightProcess();
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"IoCheckTimer_Elapsed出错:"
+
ex
.
ToString
());
}
...
...
@@ -286,7 +283,8 @@ namespace OnlineStore.DeviceLibrary
}
return
false
;
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"启动错误"
+
ex
.
StackTrace
);
return
false
;
...
...
@@ -910,9 +908,10 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
EndMove
();
StopMove
(
true
);
storeStatus
=
StoreStatus
.
SuddenStop
;
}
else
if
(
alarmType
.
Equals
(
StoreAlarmType
.
BatchAxisAlarm
))
}
else
if
(
alarmType
.
Equals
(
StoreAlarmType
.
BatchAxisAlarm
))
{
LogUtil
.
error
(
"批量上下料
轴报警,批量上料模块停止运动"
);
LogUtil
.
error
(
"批量上下料轴报警,批量上料模块停止运动"
);
ACServerManager
.
SuddenStop
(
Config
.
Batch_Axis
.
DeviceName
,
Config
.
Batch_Axis
.
GetAxisValue
());
AutomaticBaiting
.
StopMove
();
}
...
...
@@ -968,7 +967,7 @@ namespace OnlineStore.DeviceLibrary
{
if
(
IsChongfu
)
{
LogUtil
.
info
(
"
【"
+
info
+
"】 处理完成,耗时:"
+
stopwatch
.
Elapsed
.
ToString
()
);
LogUtil
.
info
(
"
ShowTimeLog【"
+
info
+
"】 :"
+
stopwatch
.
Elapsed
.
ToString
()
+
" ms"
);
}
}
private
void
LedProcess
()
...
...
@@ -985,8 +984,6 @@ namespace OnlineStore.DeviceLibrary
//机器未启动 灭 灭 灭
//机器设备故障(非温湿度)报警 亮 灭 闪
//报警时只需要亮红灯
if
(
storeRunStatus
<=
StoreRunStatus
.
Wait
)
{
if
(
IOManager
.
IOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
...
...
@@ -1027,10 +1024,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
if
(
IOManager
.
IOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
//
if (IOManager.IOValue(IO_Type.Alarm_HddLed).Equals(IO_VALUE.HIGH))
//
{
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
}
//
}
}
bool
isBusy
=
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
||
...
...
@@ -1064,10 +1061,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
if
(
IOManager
.
IOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
//
if (IOManager.IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
//
{
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
}
//
}
}
}
//仓门打开,打开照明
...
...
@@ -1351,7 +1348,7 @@ namespace OnlineStore.DeviceLibrary
{
LOC
=
1
;
}
string
result
=
HttpHelper
.
Get
(
StoreManager
.
GetAPI
(
""
,
StoreManager
.
api_inventory
)
+
"?LOC="
+
LOC
);
string
result
=
HttpHelper
.
Get
(
StoreManager
.
GetAPI
(
StoreManager
.
api_inventory
)
+
"?LOC="
+
LOC
);
if
(!
String
.
IsNullOrEmpty
(
result
))
{
List
<
APIInfo
>
apilist
=
JsonHelper
.
DeserializeJsonToList
<
APIInfo
>(
result
);
...
...
@@ -1371,7 +1368,7 @@ namespace OnlineStore.DeviceLibrary
{
//开始自动入库
string
msg
=
AutomaticBaiting
.
doStartBatchIn
();
LogUtil
.
info
(
"自动出入库:已有出库["
+
AutomaticBaiting
.
BatchOutStoreCount
+
"]盘料共["
+
AutomaticBaiting
.
BatchOutStoreHeight
+
LogUtil
.
info
(
"自动出入库:已有出库["
+
AutomaticBaiting
.
BatchOutStoreCount
+
"]盘料共["
+
AutomaticBaiting
.
BatchOutStoreHeight
+
"]mm,开始自动入库:库位号【"
+
GetAutoPosid
(
false
)
+
"】,开始入库"
+
msg
);
}
else
...
...
@@ -1383,7 +1380,7 @@ namespace OnlineStore.DeviceLibrary
else
{
autoMsg
=
ResourceControl
.
GetString
(
"自动出库"
,
"自动出库"
)
+
":RI:"
+
readId
;
result
=
HttpHelper
.
Post
(
StoreManager
.
GetAPI
(
""
,
StoreManager
.
api_stackOut
)
+
"?RIS="
+
readId
);
result
=
HttpHelper
.
Post
(
StoreManager
.
GetAPI
(
StoreManager
.
api_stackOut
)
+
"?RIS="
+
readId
);
LogUtil
.
info
(
"自动出入库:自动出库:RI: "
+
readId
+
" ,"
+
result
);
}
}
...
...
@@ -1483,8 +1480,8 @@ namespace OnlineStore.DeviceLibrary
if (IsHasCompress_Axis.Equals(false) && Config.IsHasLocationCylinder >= 1)
{
//定位气缸停止
//
IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
//
IOManager.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
}*/
// MeteringSignal.StopCheck();
AutomaticBaiting
.
StopMove
();
...
...
@@ -1508,8 +1505,11 @@ namespace OnlineStore.DeviceLibrary
if
((
isInSuddenDown
.
Equals
(
false
))
&&
(
isNoAirCheck
.
Equals
(
false
))
&&
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
))
&&
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)))
{
if
(
lastPosId
.
Equals
(
""
))
{
return
true
;
}
}
return
false
;
}
public
void
LoguStatus
()
...
...
@@ -1705,18 +1705,18 @@ namespace OnlineStore.DeviceLibrary
{
WarnInfo
obj
=
AutomaticBaiting
.
WarnObj
;
boxStatus
.
SetMsg
(
obj
.
WarnMsg
,
obj
.
MsgCode
,
obj
.
MsgParam
);
SetOpMsgData
(
lineOperation
,
obj
.
WarnMsg
,
obj
.
MsgCode
,
obj
.
MsgParam
);
SetOpMsgData
(
lineOperation
,
obj
.
WarnMsg
,
obj
.
MsgCode
,
obj
.
MsgParam
);
}
if
(
lineOperation
.
msg
.
Equals
(
""
)
&&
(!
AutomaticBaiting
.
CodeMsg
.
Equals
(
""
)))
{
boxStatus
.
SetMsg
(
AutomaticBaiting
.
CodeMsg
,
ResourceControl
.
NoCodeMsg
);
SetOpMsgData
(
lineOperation
,
AutomaticBaiting
.
CodeMsg
,
ResourceControl
.
NoCodeMsg
);
SetOpMsgData
(
lineOperation
,
AutomaticBaiting
.
CodeMsg
,
ResourceControl
.
NoCodeMsg
);
AutomaticBaiting
.
CodeMsg
=
""
;
}
if
(
lineOperation
.
msg
.
Equals
(
""
)
&&
(!
CodeOrInoutMsg
.
Equals
(
""
)))
{
boxStatus
.
SetMsg
(
CodeOrInoutMsg
,
ResourceControl
.
InStoreNoCode
);
SetOpMsgData
(
lineOperation
,
CodeOrInoutMsg
,
ResourceControl
.
InStoreNoCode
);
SetOpMsgData
(
lineOperation
,
CodeOrInoutMsg
,
ResourceControl
.
InStoreNoCode
);
CodeOrInoutMsg
=
""
;
}
if
(
CodeOrInoutMsg
.
Equals
(
""
))
...
...
@@ -1725,16 +1725,17 @@ namespace OnlineStore.DeviceLibrary
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
boxStatus
.
SetMsg
(
ResourceControl
.
GetString
(
ResourceControl
.
HasWare
,
"叉子料盘检测有料,请检查"
),
ResourceControl
.
HasWare
);
SetOpMsgData
(
lineOperation
,
ResourceControl
.
GetString
(
ResourceControl
.
HasWare
,
"叉子料盘检测有料,请检查"
),
ResourceControl
.
HasWare
);
}
else
if
(
waitOutStoreList
.
Count
>
0
&&
(!
AutomaticBaiting
.
DoorCloseOK
()))
SetOpMsgData
(
lineOperation
,
ResourceControl
.
GetString
(
ResourceControl
.
HasWare
,
"叉子料盘检测有料,请检查"
),
ResourceControl
.
HasWare
);
}
else
if
(
waitOutStoreList
.
Count
>
0
&&
(!
AutomaticBaiting
.
DoorCloseOK
()))
{
boxStatus
.
SetMsg
(
ResourceControl
.
GetString
(
ResourceControl
.
TheDoorOpen
,
"门锁未关闭,无法出库"
),
ResourceControl
.
TheDoorOpen
);
SetOpMsgData
(
lineOperation
,
ResourceControl
.
GetString
(
ResourceControl
.
TheDoorOpen
,
"门锁未关闭,无法出库"
),
ResourceControl
.
TheDoorOpen
);
SetOpMsgData
(
lineOperation
,
ResourceControl
.
GetString
(
ResourceControl
.
TheDoorOpen
,
"门锁未关闭,无法出库"
),
ResourceControl
.
TheDoorOpen
);
}
else
if
(
AutomaticBaiting
.
BatchOutStoreHeight
>=
Config
.
BatchAxis_MaxHeight
)
{
boxStatus
.
SetMsg
(
ResourceControl
.
GetString
(
ResourceControl
.
OutFull
,
"批量轴已满,请取出料盘"
),
ResourceControl
.
OutFull
);
SetOpMsgData
(
lineOperation
,
ResourceControl
.
GetString
(
ResourceControl
.
OutFull
,
"批量轴已满,请取出料盘"
),
ResourceControl
.
OutFull
);
SetOpMsgData
(
lineOperation
,
ResourceControl
.
GetString
(
ResourceControl
.
OutFull
,
"批量轴已满,请取出料盘"
),
ResourceControl
.
OutFull
);
}
}
//WarnMsg = "";
...
...
@@ -1847,12 +1848,12 @@ namespace OnlineStore.DeviceLibrary
//如果料仓没有出入库,但是自动上下料机构在上料中
if
(
storeStatus
.
Equals
(
StoreStatus
.
StoreOnline
))
{
if
(
AutomaticBaiting
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)||
if
(
AutomaticBaiting
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
AutomaticBaiting
.
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Busy
))
{
status
=
(
int
)
StoreStatus
.
BatchInStore
;
}
else
if
(
AutomaticBaiting
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
StoreReset
)||
else
if
(
AutomaticBaiting
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
StoreReset
)
||
AutomaticBaiting
.
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Reset
))
{
status
=
(
int
)
StoreStatus
.
BatchReset
;
...
...
@@ -1872,9 +1873,9 @@ namespace OnlineStore.DeviceLibrary
Operation
lineOperation
=
getLineBoxStatus
();
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
lineOperation
,
false
);
Operation
resultOperation
=
HttpHelper
.
Post
OP
(
StoreManager
.
GetPostApi
(
server
),
lineOperation
);
//发送状态信息到服务器
if
(
resultOperation
==
null
)
if
(
resultOperation
==
null
)
{
//判断服务端是否返回出库操作
return
;
...
...
@@ -1884,7 +1885,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
500
)
{
LogUtil
.
info
(
StoreName
+
"SendLineStatus
共处理了【"
+
span
.
TotalMilliseconds
+
"】毫秒
"
);
LogUtil
.
info
(
StoreName
+
"SendLineStatus
【"
+
span
.
TotalMilliseconds
+
"】ms
"
);
}
}
...
...
@@ -1907,12 +1908,11 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
resultOperation
.
op
.
Equals
(
1
))
{
string
json
=
JsonHelper
.
SerializeObject
(
resultOperation
);
//ReviceInStoreProcess("", resultOperation);
LogUtil
.
error
(
"发送定时消息时,服务器返回Op=1 【"
+
json
+
"】"
);
}
//else if (resultOperation.op.Equals(5))
//{
// ProcessHumidityCMD(resultOperation);
//}
else
if
(
resultOperation
.
data
!=
null
)
{
string
result
=
""
;
...
...
@@ -1942,7 +1942,8 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:confirmReelOut=doit"
);
result
=
AutomaticBaiting
.
doConfirmReelGo
();
}
else
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
singleReelIn
)
&&
dataMap
[
ParamDefine
.
singleReelIn
].
Equals
(
ParamDefine
.
doit
))
}
else
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
singleReelIn
)
&&
dataMap
[
ParamDefine
.
singleReelIn
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:SingleReelIn=doit"
);
result
=
AutomaticBaiting
.
doSingleReelIn
();
...
...
@@ -2006,7 +2007,7 @@ namespace OnlineStore.DeviceLibrary
if
(
posArray
.
Length
!=
2
)
{
//WarnMsg = StoreName + ResourceControl.GetString(ResourceControl.OutStoreError, "出库格式错误:") + "【" + posId + "】";
SetWarnMsgAndLog
(
ResourceControl
.
OutStoreError
,
posId
);
SetWarnMsgAndLog
(
ResourceControl
.
OutStoreError
,
posId
);
//LogUtil.error(LOGGER, "收到服务器出库命令:库位号【" + posId + "】格式错误");
continue
;
}
...
...
@@ -2024,7 +2025,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
FixtureCodeInfo
currInOutFixture
=
new
FixtureCodeInfo
(
0
,
""
,
posId
,
plateW
,
plateH
,!
isSingleOut
);
FixtureCodeInfo
currInOutFixture
=
new
FixtureCodeInfo
(
0
,
""
,
posId
,
plateW
,
plateH
,
!
isSingleOut
);
if
(
CanStarInOut
())
{
bool
result
=
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
plateH
,
plateW
),
!
isSingleOut
);
...
...
@@ -2044,7 +2045,8 @@ namespace OnlineStore.DeviceLibrary
AddWaitOutInfo
(
currInOutFixture
);
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
StoreName
+
"解析服务发送的出库【"
+
posId
+
"】出错"
+
ex
.
StackTrace
);
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
9ecc8e3
...
...
@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
return
true
;
}
}
private
DateTime
preRWTime
=
DateTime
.
Now
;
private
void
CheckWait
()
{
List
<
WaitResultInfo
>
list
=
StoreMove
.
WaitList
;
...
...
@@ -169,16 +169,29 @@ namespace OnlineStore.DeviceLibrary
{
timeOutMs
=
650000
;
}
//if (!wait.IsEnd && span.TotalSeconds > 2 && wait.IoType.Equals(IO_Type.SuckingDisc_Air))
//{
// string ioType = IO_Type.SuckingDisc_Work;
// IO_VALUE doValue = IOManager.DOValue(ioType);
// if (!doValue.Equals(wait.IoValue))
// {
// LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + ioType + "=" + wait.IoValue + ")");
// IOManager.IOMove(ioType, wait.IoValue);
// }
//}
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
if
(
wait
.
IsEnd
.
Equals
(
false
)
&&
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
&&
span
.
TotalSeconds
<
30
&&
Config
.
DOList
.
ContainsKey
(
wait
.
IoType
))
{
preRWTime
=
DateTime
.
Now
;
string
msg
=
" ["
+
StoreMove
.
MoveType
+
"]["
+
StoreMove
.
MoveStep
+
"] "
+
NotOkMsg
+
"已等待 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒,重写DO:"
;
bool
isLog
=
false
;
foreach
(
WaitResultInfo
ww
in
list
)
{
if
(
ww
!=
null
&&
ww
.
WaitType
.
Equals
(
2
)
&&
Config
.
DOList
.
ContainsKey
(
ww
.
IoType
))
{
if
(
IOManager
.
DOValue
(
ww
.
IoType
).
Equals
(
ww
.
IoValue
).
Equals
(
false
))
{
isLog
=
true
;
IOManager
.
IOMove
(
ww
.
IoType
,
ww
.
IoValue
);
msg
+=
ww
.
ToStr
()
+
","
;
}
}
}
if
(
isLog
)
{
LogUtil
.
error
(
StoreName
+
msg
);
}
}
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
)
{
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
...
...
@@ -253,12 +266,12 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
span
.
TotalSeconds
>
StoreMove
.
TimeOutSeconds
)
{
//string msg = string.Format(ResourceControl.GetString(ResourceControl.MoveTimeOut), "[" + StoreMove.MoveStep + "]" ,
// "[" + NotOkMsg + "]","[" + Math.Round(span.TotalSeconds, 1) + "]")
;
string
msg
=
ResourceControl
.
MoveTimeOut
+
"["
+
StoreMove
.
MoveStep
+
"]"
+
$
"[{((Wait_Type)waitType).ToString()}]"
+
"["
+
NotOkMsg
+
"]"
+
"["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]"
;
string
p1
=
"["
+
StoreMove
.
MoveStep
+
"]"
;
string
p2
=
"["
+
NotOkMsg
+
"]"
;
string
p3
=
"["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]"
;
string
msg
=
ResourceControl
.
GetString
(
ResourceControl
.
MoveTimeOut
,
p1
+
ResourceControl
.
GetString
(
ResourceControl
.
TimeOut
,
"超时"
)
+
p2
+
p3
,
p1
,
p2
,
p3
)
;
string
newType
=
ResourceControl
.
MoveTimeOut
;
SetWaitWarnMsg
(
msg
,
newType
,
StoreMove
.
MoveStep
+
""
,
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
""
);
SetWaitWarnMsg
(
msg
,
newType
,
p1
,
p2
,
p3
);
LogUtil
.
error
(
WarnObj
.
WarnMsg
,
15
);
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnObj
.
WarnMsg
,
StoreMove
.
MoveType
);
}
...
...
@@ -558,7 +571,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_14_GoBack
)
{
preProTime
=
DateTime
.
Now
.
AddSeconds
(-
5
);
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PositionNum
:
""
;
LogUtil
.
info
(
LOGGER
,
" 【"
+
posId
+
"】 入库结束,耗时【"
+
FormUtil
.
GetSpanStr
(
InOutWatch
.
Elapsed
)
+
"】!"
);
StoreMove
.
EndMove
();
...
...
@@ -696,9 +709,9 @@ namespace OnlineStore.DeviceLibrary
InStoreLog
(
"入库:SIS_38 ,清理扫码信息,开始扫码,最多等待6000 "
);
AutomaticBaiting
.
ClearInStoreInfo
();
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SIS_38_ScanCode
);
StoreMove
.
OneWaitCanEndStep
=
true
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCodeOK
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
6000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
9000
));
StoreMove
.
OneWaitCanEndStep
=
true
;
AutomaticBaiting
.
GetCameraCode
();
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SIS_38_ScanCode
))
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
查看文件 @
9ecc8e3
...
...
@@ -376,8 +376,9 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I06_SuckingDisc_Up
);
InStoreLog
(
" 吸盘上升"
);
CylinderMove
(
IO_Type
.
ClampingDisc_Up
,
IO_Type
.
ClampingDisc_Down
,
false
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
ClampingDisc_Down
,
IO_VALUE
.
LOW
));
//CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, false);
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Down, IO_VALUE.LOW));
CylinderMove
(
IO_Type
.
ClampingDisc_Up
,
IO_Type
.
ClampingDisc_Down
,
true
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1500
));
}
...
...
@@ -479,7 +480,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
debug
(
Name
+
StoreMove
.
MoveStep
+
"入料: 从服务器获取入库PosId,尺寸:【"
+
LastWidth
+
"*"
+
LastHeight
+
"】二维码【"
+
LastCode
+
"】"
);
GetInStorePosId
(
ProcessMsg
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3
000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5
000
));
}
}
else
if
(
span
.
TotalSeconds
>
60
)
...
...
@@ -514,6 +515,7 @@ namespace OnlineStore.DeviceLibrary
else
{
InStoreLog
(
" 入库失败,尺寸:【"
+
LastWidth
+
"*"
+
LastHeight
+
"】将料盘送出,等待料盘拿走"
);
StoreManager
.
cancelPutInTask
(
LastSendCode
);
SendTrayOut
();
}
}
...
...
@@ -637,8 +639,8 @@ namespace OnlineStore.DeviceLibrary
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I03_ScanCode
);
InStoreLog
(
" 开始扫码,最多等待
10
000 "
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10
000
));
InStoreLog
(
" 开始扫码,最多等待
9
000 "
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
9
000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCodeOK
());
StoreMove
.
OneWaitCanEndStep
=
true
;
GetCameraCode
();
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
9ecc8e3
...
...
@@ -77,6 +77,7 @@ namespace OnlineStore.DeviceLibrary
}*/
return
false
;
}
protected
static
DateTime
preRWTime
=
DateTime
.
Now
;
private
static
void
CheckWait
()
{
List
<
WaitResultInfo
>
list
=
StoreMove
.
WaitList
;
...
...
@@ -112,43 +113,45 @@ namespace OnlineStore.DeviceLibrary
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
IOMove_2
)
{
wait
.
IsEnd
=
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
//int timeOutMs = StoreManager.Config.IOSingle_TimerOut;
//timeOutMs = 20;
//if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
//如果是气缸动作,若Do未输出,重新写一遍
//if ((!wait.IsEnd )&& span.TotalSeconds > 2)
//{
// ConfigIO io = StoreManager.Config.getWaitIO(wait.IoType);
// WarnMsg = "[" + StoreMove.MoveStep + "] 等待[" + io.ElectricalDefinition + "_" + io.Explain + "=" + wait.IoValue + "]超时";
// StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
// LogUtil.error(WarnMsg, 101);
// isOk = false;
// break;
// if (wait.IoType.Equals(IO_Type.ClampingDisc_Down) || wait.IoType.Equals(IO_Type.ClampingDisc_Up))
// {
// IO_VALUE doValue = IOManager.DOValue(wait.IoType);
// if (!doValue.Equals(wait.IoValue))
// {
// LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + wait.IoType + "=" + wait.IoValue + ")");
// IOManager.IOMove(wait.IoType, wait.IoValue);
// string ioType = wait.IoType.Equals(IO_Type.ClampingDisc_Down) ? IO_Type.ClampingDisc_Up : IO_Type.ClampingDisc_Down;
// IO_VALUE ioValue = wait.IoValue.Equals(IO_VALUE.LOW) ? IO_VALUE.HIGH : IO_VALUE.LOW;
// LogUtil.error("等待[" + wait.ToStr() + "],重写气缸DO(" + ioType + "=" + ioValue + ")");
// IOManager.IOMove(ioType, ioValue);
// }
// }
//}
//如果是气缸动作,若Do未输出,重新写一遍
if
(!
wait
.
IsEnd
&&
span
.
TotalSeconds
>
2
)
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
if
(
wait
.
IsEnd
.
Equals
(
false
)
&&
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
&&
span
.
TotalSeconds
<
30
&&
StoreManager
.
Store
.
Config
.
DOList
.
ContainsKey
(
wait
.
IoType
))
{
preRWTime
=
DateTime
.
Now
;
string
msg
=
" ["
+
StoreMove
.
MoveType
+
"]["
+
StoreMove
.
MoveStep
+
"] "
+
NotOkMsg
+
"已等待 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒,重写DO:"
;
bool
isLog
=
false
;
foreach
(
WaitResultInfo
ww
in
list
)
{
if
(
wait
.
IoType
.
Equals
(
IO_Type
.
ClampingDisc_Down
)
||
wait
.
IoType
.
Equals
(
IO_Type
.
ClampingDisc_Up
))
if
(
ww
!=
null
&&
ww
.
WaitType
.
Equals
(
2
)
&&
StoreManager
.
Store
.
Config
.
DOList
.
ContainsKey
(
ww
.
IoType
))
{
IO_VALUE
doValue
=
IOManager
.
DOValue
(
wait
.
IoType
);
if
(!
doValue
.
Equals
(
wait
.
IoValue
))
if
(
IOManager
.
DOValue
(
ww
.
IoType
).
Equals
(
ww
.
IoValue
).
Equals
(
false
))
{
LogUtil
.
error
(
"等待["
+
NotOkMsg
+
"],重写DO("
+
wait
.
IoType
+
"="
+
wait
.
IoValue
+
")"
);
IOManager
.
IOMove
(
wait
.
IoType
,
wait
.
IoValue
);
string
ioType
=
wait
.
IoType
.
Equals
(
IO_Type
.
ClampingDisc_Down
)
?
IO_Type
.
ClampingDisc_Up
:
IO_Type
.
ClampingDisc_Down
;
IO_VALUE
ioValue
=
wait
.
IoValue
.
Equals
(
IO_VALUE
.
LOW
)
?
IO_VALUE
.
HIGH
:
IO_VALUE
.
LOW
;
LogUtil
.
error
(
"等待["
+
wait
.
ToStr
()
+
"],重写气缸DO("
+
ioType
+
"="
+
ioValue
+
")"
);
IOManager
.
IOMove
(
ioType
,
ioValue
);
isLog
=
true
;
IOManager
.
IOMove
(
ww
.
IoType
,
ww
.
IoValue
);
msg
+=
ww
.
ToStr
()
+
","
;
}
}
//else if (wait.IoType.Equals(IO_Type.SuckingDisc_Air))
//{
// string ioType = IO_Type.SuckingDisc_Work;
// IO_VALUE doValue = IOManager.DOValue(ioType);
// if (!doValue.Equals(wait.IoValue))
// {
// LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + ioType + "=" + wait.IoValue + ")");
// IOManager.IOMove(ioType, wait.IoValue);
// }
//}
}
if
(
isLog
)
{
LogUtil
.
error
(
Name
+
msg
);
}
}
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
Time_3
)
...
...
@@ -163,10 +166,9 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE
value
=
(
IO_VALUE
)
ACServerManager
.
GetHomeSingle
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
wait
.
IsEnd
=
wait
.
IoValue
.
Equals
(
value
);
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
BatchAxisMove_10
)
{
wait
.
IsEnd
=
BatchAxisIsEnd
(
wait
,
span
);
wait
.
IsEnd
=
BatchAxisIsEnd
(
wait
,
span
);
if
(
wait
.
IsEnd
)
{
BatchAxisController
.
StopCheck
();
...
...
@@ -205,7 +207,7 @@ namespace OnlineStore.DeviceLibrary
{
string
msg
=
"["
+
StoreMove
.
MoveStep
+
"]"
+
ResourceControl
.
GetString
(
ResourceControl
.
TimeOut
,
"超时"
)
+
" ["
+
NotOkMsg
+
"]["
+
Math
.
Round
(
span
.
TotalSeconds
,
0
)
+
"秒]"
;
string
newType
=
ResourceControl
.
MoveTimeOut
+
"_"
+
waitType
.
ToString
().
PadLeft
(
2
,
'0'
);
SetWaitWarnMsg
(
msg
,
newType
,
StoreMove
.
MoveStep
+
""
,
Math
.
Round
(
span
.
TotalSeconds
,
0
)
+
""
);
SetWaitWarnMsg
(
msg
,
newType
,
StoreMove
.
MoveStep
+
""
,
Math
.
Round
(
span
.
TotalSeconds
,
0
)
+
""
);
LogUtil
.
error
(
msg
,
102
);
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
BatchIoTimeOut
,
""
,
msg
,
StoreMove
.
MoveType
);
}
...
...
@@ -395,7 +397,7 @@ namespace OnlineStore.DeviceLibrary
IOManager
.
IOMove
(
lowType
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
highType
,
IO_VALUE
.
HIGH
);
}
private
static
string
LastSendCode
=
""
;
public
static
string
ProcessMsg
()
{
string
msg
=
""
;
...
...
@@ -423,6 +425,8 @@ namespace OnlineStore.DeviceLibrary
{
msg
=
msg
+
"=1+0x0-"
+
LastWidth
+
"x"
+
LastHeight
+
"="
+
LastCode
+
spiltStr
;
}
msg
=
CodeManager
.
ReplaceCode
(
msg
);
LastSendCode
=
msg
;
return
msg
;
}
//=1+0x0-13x24=201810220856;025;5N02018101;121;700012865;92498;1800;##
...
...
@@ -486,10 +490,10 @@ namespace OnlineStore.DeviceLibrary
public
static
InOutStoreParam
GetInStoreParam
(
string
LogName
,
string
message
)
{
message
=
CodeManager
.
ReplaceCode
(
message
);
//
message = CodeManager.ReplaceCode(message);
if
(
message
.
Equals
(
""
)
||
string
.
IsNullOrEmpty
(
message
))
{
CodeMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
NoCodeMsg
,
"没有收到二维码信息,请重新放入料盘"
);
CodeMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
NoCodeMsg
,
"没有收到二维码信息,请重新放入料盘"
);
LogUtil
.
info
(
LogName
+
"没有收到二维码信息,请重新放入料盘"
);
return
null
;
}
...
...
@@ -522,11 +526,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
debug
(
"添加自动入库库位号:"
+
autoposId
);
}
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
Operation
resultOperation
=
HttpHelper
.
Post
OP
(
StoreManager
.
GetPostApi
(
server
),
operation
,
2000
);
if
(
resultOperation
==
null
)
{
LogUtil
.
info
(
LogName
+
"二维码【"
+
message
+
"】没有收到服务器反馈
!
"
);
LogUtil
.
info
(
LogName
+
"二维码【"
+
message
+
"】没有收到服务器反馈"
);
return
null
;
}
else
if
(!
string
.
IsNullOrEmpty
(
resultOperation
.
msg
))
...
...
@@ -571,7 +575,12 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
LogName
+
"解析服务发送的入库【"
+
posId
+
"】出错"
+
ex
.
StackTrace
);
}
}
return
null
;
}
else
{
LogUtil
.
error
(
LogName
+
"二维码【"
+
message
+
"】获取入库库位失败 "
);
}
return
null
;
}
public
static
Dictionary
<
string
,
string
>
GetBtnStatus
()
...
...
source/DeviceLibrary/acSingleStore/StoreManager.cs
查看文件 @
9ecc8e3
...
...
@@ -21,12 +21,14 @@ namespace OnlineStore.DeviceLibrary
public
static
string
api_inventory
=
"rest/api/v2/mes/inventory"
;
//获取单个或全总SMD-BOX 中的实时库存信息
public
static
string
api_stackOut
=
"rest/api/v2/mes/stackOut"
;
//本接⼜提供物料出库功能,可⼀次性出单/多盘物料
// 取消任务地址: /cancelPutInTask //参数: barcode
private
static
string
Addr_cancelPutInTask
=
"service/store/cancelPutInTask"
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
static
AC_SA_BoxBean
Store
=
null
;
public
static
AUTO_SA_Config
Config
=
null
;
private
static
bool
isInit
=
false
;
public
static
bool
IsConnectServer
=
!
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
).
Equals
(
""
);
public
static
bool
IsConnectServer
=
!
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
).
Equals
(
""
);
public
StoreManager
()
{
}
...
...
@@ -99,10 +101,6 @@ namespace OnlineStore.DeviceLibrary
}
return
Store
;
}
/// <summary>
/// 修改了料仓配置,更新缓存,更新配置文件(只能更新PRO的配置)
/// </summary>
/// <param name="kTK_LA_Store_Config"></param>
public
static
void
UpdateBoxConfig
(
AUTO_SA_Config
storeConfig
)
{
try
...
...
@@ -130,11 +128,22 @@ namespace OnlineStore.DeviceLibrary
return
host
+
api_communication
;
}
public
static
string
GetAPI
(
string
host
,
string
api
)
public
static
string
GetAPI
(
string
api
,
Dictionary
<
string
,
string
>
paramsMap
=
null
)
{
string
host
=
GetHostUrl
(
""
);
if
(
paramsMap
==
null
||
paramsMap
.
Count
<=
0
)
{
host
=
GetHostUrl
(
host
);
return
host
+
api
;
}
string
path
=
host
+
api
.
Trim
()
+
"?"
;
foreach
(
string
paramName
in
paramsMap
.
Keys
)
{
string
par
=
System
.
Web
.
HttpUtility
.
UrlEncode
(
paramsMap
[
paramName
],
System
.
Text
.
Encoding
.
UTF8
);
path
+=
paramName
+
"="
+
par
+
"&"
;
}
path
=
path
.
Substring
(
0
,
path
.
Length
-
1
);
return
path
;
}
private
static
string
GetHostUrl
(
string
host
)
{
...
...
@@ -152,7 +161,51 @@ namespace OnlineStore.DeviceLibrary
}
return
host
;
}
public
static
string
GetAllAxisPos
()
{
public
static
string
cancelPutInTask
(
string
barcode
)
{
string
msg
=
""
;
try
{
string
serverAddr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
if
(
string
.
IsNullOrEmpty
(
serverAddr
))
{
LogUtil
.
error
(
"cancelPutInTask ["
+
barcode
+
"] :未找到服务器地址"
);
return
msg
;
}
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"barcode"
,
barcode
);
string
server
=
GetAPI
(
Addr_cancelPutInTask
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
info
(
"cancelPutInTask "
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
" 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
//【http://192.168.21.62/myproject/service/store/cancelPutInTask?barcode=%3d1%2b0x0-7x8%3dIAC%3b6010A0243701%3b2031%3bNA%3b4000%3bVBR20BP02341%3b%23%23】
//【{"code":0,"msg":"ok","data":true}】
ReviceData
data
=
JsonHelper
.
DeserializeJsonToObject
<
ReviceData
>(
resultStr
);
if
(
data
==
null
)
{
return
msg
=
" cancelPutInTask【 "
+
barcode
+
"】 没有收到服务器反馈"
;
}
else
if
(
data
.
code
.
Equals
(
0
).
Equals
(
false
))
{
return
msg
=
" cancelPutInTask【 "
+
barcode
+
"】 :"
+
data
.
msg
;
}
return
""
;
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
" "
+
ex
.
ToString
());
}
return
msg
;
}
public
static
string
GetAllAxisPos
()
{
int
UpDown_AxisP
=
AxisManager
.
instance
.
GetActualtPosition
(
Config
.
UpDown_Axis
);
int
Batch_AxisP
=
AxisManager
.
instance
.
GetActualtPosition
(
Config
.
Batch_Axis
);
int
Comp_AxisP
=
AxisManager
.
instance
.
GetActualtPosition
(
Config
.
Comp_Axis
);
...
...
@@ -162,11 +215,20 @@ namespace OnlineStore.DeviceLibrary
}
}
public
class
ReviceData
{
//{"code":0,"msg":"ok","data":"7"}
public
int
code
{
get
;
set
;
}
public
string
msg
{
get
;
set
;
}
public
object
data
{
get
;
set
;
}
}
public
class
APIInfo
{
//[{"LOC":"1","RI":"A100007","QTY":1000,"PN":"pn"},{"LOC":"2","RI":"A100015","QTY":1000,"PN":"pn"}]
public
int
LOC
=
1
;
public
int
LOC
=
1
;
public
string
RI
=
""
;
public
string
QTY
=
""
;
public
string
PN
=
""
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论