Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7cd96e6d
由
LN
编写于
2020-08-12 11:24:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
分流bug修改。httpPost方法修改。
1 个父辈
c55429b2
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
70 行增加
和
18 行删除
source/AssemblyLineClient/Program.cs
source/AssemblyLineClient/记录.txt
source/Common/util/LogUtil.cs
source/Common/util/MyWebClient.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/LineBean_Shunt.cs
source/AssemblyLineClient/Program.cs
查看文件 @
7cd96e6
...
...
@@ -53,8 +53,8 @@ namespace OnlineStore.AssemblyLine
/// </summary>
[
STAThread
]
static
void
Main
(
string
[]
Args
)
{
{
//string code = " (X: 380,Y: 148) L00000000000WG9D19055;E20191230 0180;B7H.10618.5B1008082019123004000;R0080820191230E9600";
//string r = CodeManager.ReplaceCode(code);
Application
.
SetUnhandledExceptionMode
(
UnhandledExceptionMode
.
CatchException
);
...
...
@@ -129,5 +129,24 @@ namespace OnlineStore.AssemblyLine
LogUtil
.
error
(
"【"
+
type
+
"】"
+
exceptionobj
);
}
static
void
Test
()
{
string
s
=
"http://192.168.101.11/myproject/rest/api/qisda/device/getSize?robotIndex=2&barcode=L165K001877%3bE20200329+0730%3bBQT001200218504192020032915000%3bR04192020042451762%23%230201X104K100CT%2f15000%2f165K001877%2f20200329%23%23"
;
string
param
=
"robotIndex=2&barcode=L165K001877"
;
System
.
Collections
.
Specialized
.
NameValueCollection
data
=
new
System
.
Collections
.
Specialized
.
NameValueCollection
();
Dictionary
<
string
,
object
>
value
=
new
Dictionary
<
string
,
object
>();
data
.
Add
(
"robotIndex"
,
2.
ToString
());
data
.
Add
(
"barcode"
,
"L165K001877%3bE20200329+0730%3bBQT001200218504192020032915000%3bR04192020042451762%23%230201X104K100CT%2f15000%2f165K001877%2f20200329%23%23"
);
value
.
Add
(
"robotIndex"
,
2
);
value
.
Add
(
"barcode"
,
"L165K001877%3bE20200329+0730%3bBQT001200218504192020032915000%3bR04192020042451762%23%230201X104K100CT%2f15000%2f165K001877%2f20200329%23%23"
);
// string param = JsonHelper.SerializeObject(value);
s
=
"http://192.168.101.11/myproject/service/store/emptyPosForPutin?cids=line-ac-01%2cline-ac-02%2cline-ac-03%2cline-ac-04%2cline-ac-05%2cline-ac-06%2cline-ac-07%2cline-ac-08%2cline-ac-09%2cline-ac-10%2cline-ac-11%2cline-ac-12%2cline-ac-13%2cline-ac-14%2cline-ac-15%2cline-ac-16%2cline-ac-17%2cline-ac-18&code=%3d7x8%3dL0000000IA0106D25D015%3bE20200106+0730%3bB7H.10524.5C1035042020010604000+%3bR035042020010600208%23%23&rfid=B16"
;
string
result
=
HttpHelper
.
Post
(
s
,
""
);
s
=
"http://192.168.101.11/myproject/rest/api/qisda/device/getSize?robotIndex=2&barcode=L165K001877%3bE20200329+0730%3bBQT001200218504192020032915000%3bR04192020042451762%23%230201X104K100CT%2f15000%2f165K001877%2f20200329%23%23"
;
result
=
HttpHelper
.
Post
(
s
,
""
);
return
;
}
}
}
source/AssemblyLineClient/记录.txt
查看文件 @
7cd96e6
20200805
20200812
分流bug修改。
httpPost方法修改。
20200805
横移3和横移1顶升下降之后需要等待1秒再检测托盘检测信号是否消失。
出料4紧急出料最多等待20-30秒,如果料架已离开或者当前无料架直接放行托盘。
上升端不到位就横移。
...
...
source/Common/util/LogUtil.cs
查看文件 @
7cd96e6
...
...
@@ -123,7 +123,7 @@ namespace OnlineStore.Common
}
else
{
LOGGER
.
Error
(
"ShowLogPro【"
+
msg
+
"】失败,未得到锁"
);
LOGGER
.
Debug
(
"ShowLogPro【"
+
msg
+
"】失败,未得到锁"
);
}
}
private
static
List
<
string
>
logList
=
new
List
<
string
>();
...
...
source/Common/util/MyWebClient.cs
查看文件 @
7cd96e6
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Specialized
;
using
System.IO
;
using
System.Linq
;
using
System.Net
;
...
...
@@ -82,17 +83,24 @@ namespace OnlineStore.Common
}
private
static
int
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Server_Log_Open
);
public
static
string
Post
(
string
url
,
string
paramData
,
Encoding
encoding
,
int
timeOut
,
out
bool
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
)
{
LOGGER
.
Info
(
"给服务器发送数据【"
+
paramData
+
"】 "
);
LOGGER
.
Info
(
"给服务器发送数据【"
+
url
+
"】【"
+
paramData
+
"】 "
);
}
//if (paramData != "null" && paramData != null)
//{
// LogUtil.debug(LOGGER, "HTTP POST to " + url + " \n\t >> " + paramData);
//}
string
result
=
""
;
if
(
url
.
ToLower
().
IndexOf
(
"https"
,
System
.
StringComparison
.
Ordinal
)
>
-
1
)
...
...
@@ -105,16 +113,16 @@ namespace OnlineStore.Common
{
var
wc
=
new
MyWebClient
(
timeOut
);
if
(
string
.
IsNullOrEmpty
(
wc
.
Headers
[
"Content-Type"
]))
wc
.
Headers
.
Add
(
"Content-Type"
,
"application/
json
;charset=UTF-8"
);
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
)
catch
(
WebException
ex
)
{
IsTimeOut
=
true
;
LogUtil
.
error
(
"POST ["
+
url
+
"] WebException :"
+
ex
.
ToString
(),
101
);
LogUtil
.
error
(
"POST ["
+
url
+
"] WebException :"
+
ex
.
ToString
(),
101
);
}
catch
(
Exception
e
)
{
...
...
@@ -130,7 +138,7 @@ namespace OnlineStore.Common
}
return
result
;
}
public
static
string
Get
(
string
url
)
{
return
Get
(
url
,
Encoding
.
UTF8
);
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
7cd96e6
...
...
@@ -99,7 +99,7 @@ namespace OnlineStore.DeviceLibrary
wait
.
IsEnd
=
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
if
(!
wait
.
IsEnd
)
{
{
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
//一分钟还未检测到
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
NoAlarm
())
...
...
@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
&&
span
.
TotalSeconds
<
LineManager
.
Config
.
IOSingle_TimerOut
*
2
)
{
preRWTime
=
DateTime
.
Now
;
string
msg
=
checkWaitInfo
.
Name
+
" "
+
NotOkMsg
+
"已等待 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒,重写DO:"
;
string
msg
=
checkWaitInfo
.
Name
+
" "
+
NotOkMsg
+
"已等待 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒,重写DO:"
;
bool
isLog
=
false
;
foreach
(
WaitResultInfo
ww
in
list
)
{
...
...
@@ -191,6 +191,20 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
checkWaitInfo
.
Name
+
" ["
+
checkWaitInfo
.
MoveStep
+
"] CheckWait 出错:"
,
ex
);
//如果是空指针异常,并且MoveStep=SW06_TopCylinderUp,单独处理
// [2020-08-10 13:32:45,352] [132] ERROR 横移轨道-41 [SW06_TopCylinderUp]
// CheckWait 出错:
//System.IndexOutOfRangeException: 索引超出了数组界限。
// 在 System.Collections.Generic.List`1.Enumerator.MoveNext()
// 在 OnlineStore.DeviceLibrary.LineBean.CheckWait(LineMoveInfo checkWaitInfo) 位置 E:\VSSource\RC1250_佳士达\RC1250-AssemblyLine\source\DeviceLibrary\assemblyLine\LineBean_Partial.cs:行号 89
if
(
ex
is
System
.
IndexOutOfRangeException
)
{
if
(
checkWaitInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW06_TopCylinderUp
))
{
LogUtil
.
error
(
checkWaitInfo
.
Name
+
" 当前步骤:SW06_TopCylinderUp,IndexOutOfRangeException异常,自动回到上一个步骤 SW05_LocationDown,等待500 重新开始 "
);
checkWaitInfo
.
NextMoveStep
(
LineMoveStep
.
SW05_LocationDown
);
checkWaitInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
}
}
}
}
#
endregion
...
...
source/DeviceLibrary/assemblyLine/LineBean_Shunt.cs
查看文件 @
7cd96e6
...
...
@@ -237,7 +237,8 @@ namespace OnlineStore.DeviceLibrary
{
Shunt_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
Shunt05_Top1Up
);
LogUtil
.
info
(
Name
+
"["
+
ShuntTrayNum
+
"]"
+
"分流横移:"
+
msg
+
" 需要分流,阻挡1上升,升降1上升 ,等待升降2是否可上升 "
);
CheckAndMove
(
IO_Type
.
Shunt_MotorRun1
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
Shunt_MotorRun2
,
IO_VALUE
.
LOW
);
CylinderMove
(
Shunt_MoveInfo
,
IO_Type
.
Shunt_TopCylinder_Down1
,
IO_Type
.
Shunt_TopCylinder_Up1
);
if
(
Shunt_Updown2CanUp
())
{
...
...
@@ -277,6 +278,7 @@ namespace OnlineStore.DeviceLibrary
{
Shunt_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
Shunt07_Top2Up
);
ShuntLog
(
"分流横移:升降2开始上升 "
);
Shunt_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
600
));
CylinderMove
(
Shunt_MoveInfo
,
IO_Type
.
Shunt_TopCylinder_Down2
,
IO_Type
.
Shunt_TopCylinder_Up2
);
//Shunt_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Shunt_TopCylinder_Down2, IO_VALUE.LOW));
}
...
...
@@ -324,7 +326,10 @@ namespace OnlineStore.DeviceLibrary
ShuntLog
(
"分流横移:升降2下降 ,皮带线2停止 "
);
CylinderMove
(
Shunt_MoveInfo
,
IO_Type
.
Shunt_TopCylinder_Up1
,
IO_Type
.
Shunt_TopCylinder_Down1
);
CylinderMove
(
Shunt_MoveInfo
,
IO_Type
.
Shunt_TopCylinder_Up2
,
IO_Type
.
Shunt_TopCylinder_Down2
);
IOMove
(
IO_Type
.
Shunt_MotorRun2
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
Shunt_MotorRun2
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
Shunt_MotorRun1
,
IO_VALUE
.
LOW
);
Shunt_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Shunt_MotorRun1
,
IO_VALUE
.
LOW
));
Shunt_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Shunt_MotorRun2
,
IO_VALUE
.
LOW
));
}
}
else
if
(
Shunt_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
Shunt11_TopDown
))
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论