Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1b7dcae2
由
张东亮
编写于
2022-11-07 23:30:40 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
使用相机对屏蔽托盘进行二次判断并纠正信息
1 个父辈
7bbe83b1
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
31 个修改的文件
包含
523 行增加
和
134 行删除
source/AssemblyLineClient/App.config
source/AssemblyLineClient/AssemblyLineClient.csproj
source/AssemblyLineClient/FrmFeedingEquip.Designer.cs
source/AssemblyLineClient/FrmFeedingEquip.cs
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/AssemblyLineClient/FrmProvidingEquip.Designer.cs
source/AssemblyLineClient/FrmProvidingEquip.cs
source/AssemblyLineClient/Properties/Resources.Designer.cs
source/AssemblyLineClient/Properties/Settings.Designer.cs
source/Common/Common.csproj
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/LineConfig/Config_ProvidingEquip_4.csv
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/assemblymanager/ALineManager.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/assemblymanager/TrayDisableManager.cs
source/DeviceLibrary/assemblymanager/TrayManager.cs
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/model/InOutParam.cs
source/DeviceLibrary/model/KTK_Store.cs
source/DeviceLibrary/model/StoreStep.cs
source/DeviceLibrary/model/TrayInfo.cs
source/LoadCVSLibrary/LoadCSVLibrary.csproj
source/LoadCVSLibrary/storeConfig/config/ProvidingEquip_Config.cs
source/UserFromControl/Properties/Resources.Designer.cs
source/UserFromControl/UserFromControl.csproj
source/AssemblyLineClient/App.config
查看文件 @
1b7dcae
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
configSections
>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
</
configSections
>
<
appSettings
>
<!--是否开机自动启动料仓-->
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_Title"
value
=
"流水线客户端"
/>
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_Title"
value
=
"流水线客户端"
/>
<!--
Server
address
-->
<!--<
add
key
=
"http.server"
value
=
"http://localhost/myproject/service/store/emptyPosForPutin"
/>-->
<
add
key
=
"http.server"
value
=
"http://10.85.199.25/myproject/"
/>
<
add
key
=
"http.server"
value
=
"http://10.85.199.25/myproject/"
/>
<!--
storeType
-->
<
add
key
=
"Line_moveEquip_count"
value
=
"20"
/>
<
add
key
=
"Line_feedingEquip_count"
value
=
"4"
/>
<
add
key
=
"Line_providingEquip_count"
value
=
"4"
/>
<
add
key
=
"Line_dischargeLine_count"
value
=
"2"
/>
<
add
key
=
"Line_moveEquip_count"
value
=
"20"
/>
<
add
key
=
"Line_feedingEquip_count"
value
=
"4"
/>
<
add
key
=
"Line_providingEquip_count"
value
=
"4"
/>
<
add
key
=
"Line_dischargeLine_count"
value
=
"2"
/>
<!--
start
one
store
config
-->
<
add
key
=
"ConfigPath_Line"
value
=
"\LineConfig\Config_Line.csv"
/>
<
add
key
=
"ConfigPath_MoveEquip"
value
=
"\LineConfig\MoveEquip\Config_MoveEquip.csv"
/>
<
add
key
=
"ConfigPath_FeedingEquip"
value
=
"\LineConfig\Config_FeedingEquip.csv"
/>
<
add
key
=
"ConfigPath_ProvidingEquip"
value
=
"\LineConfig\Config_ProvidingEquip.csv"
/>
<
add
key
=
"ConfigPath_DischargeLine"
value
=
"\LineConfig\Config_DischargeLine.csv"
/>
<
add
key
=
"Line_Type"
value
=
"Line"
/>
<
add
key
=
"Line_CID"
value
=
"rc1250"
/>
<
add
key
=
"ConfigPath_Line"
value
=
"\LineConfig\Config_Line.csv"
/>
<
add
key
=
"ConfigPath_MoveEquip"
value
=
"\LineConfig\MoveEquip\Config_MoveEquip.csv"
/>
<
add
key
=
"ConfigPath_FeedingEquip"
value
=
"\LineConfig\Config_FeedingEquip.csv"
/>
<
add
key
=
"ConfigPath_ProvidingEquip"
value
=
"\LineConfig\Config_ProvidingEquip.csv"
/>
<
add
key
=
"ConfigPath_DischargeLine"
value
=
"\LineConfig\Config_DischargeLine.csv"
/>
<
add
key
=
"Line_Type"
value
=
"Line"
/>
<
add
key
=
"Line_CID"
value
=
"rc1250"
/>
<!--
end
one
store
config
-->
<!--摄像机名称列表配置,用
#分割-->
<
add
key
=
"CameraName"
value
=
"GigE:MV-CE100-30GC (00C69898519)#GigE:MV-CE100-30GC (00C95305929)"
/>
<
add
key
=
"CameraName"
value
=
"GigE:MV-CE100-30GC (00C69898519)#GigE:MV-CE100-30GC (00C95305929)"
/>
<!--二维码类型列表配置,用
#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200#QR Code"
/>
<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200#QR Code"
/>
<!--<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>-->
<
add
key
=
"ACBaudRate"
value
=
"115200"
/>
<
add
key
=
"ACBaudRate"
value
=
"115200"
/>
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<!--出库等待料盘拿走的时间,秒-->
<
add
key
=
"OutStoreWaitSeconds"
value
=
"10"
/>
<
add
key
=
"UseAIOBOX"
value
=
"1"
/>
<
add
key
=
"OutStoreWaitSeconds"
value
=
"10"
/>
<
add
key
=
"UseAIOBOX"
value
=
"1"
/>
<!--流水线监听端口-->
<
add
key
=
"TCPServerPort"
value
=
"5246"
/>
<
add
key
=
"TCPServerPort"
value
=
"5246"
/>
<!--
AGV
调度服务器地址-->
<
add
key
=
"AgvServerIp"
value
=
"10.85.199.20"
/>
<
add
key
=
"AgvServerIp"
value
=
"10.85.199.20"
/>
<!--
IO
配置-->
<
add
key
=
"DIMS"
value
=
"60"
/>
<
add
key
=
"DOMS"
value
=
"300"
/>
<
add
key
=
"LineRunTest"
value
=
"1"
/>
<
add
key
=
"DIMS"
value
=
"60"
/>
<
add
key
=
"DOMS"
value
=
"300"
/>
<
add
key
=
"LineRunTest"
value
=
"1"
/>
<!--
ABB
机器人服务器-->
<
add
key
=
"ABBServerPort"
value
=
"21"
/>
<
add
key
=
"ABBServerPort"
value
=
"21"
/>
<!--是否打开托盘编码界面-->
<
add
key
=
"OpenRFIDWrite"
value
=
"1"
/>
<
add
key
=
"DefaultPWD"
value
=
"123456"
/>
<
add
key
=
"OpenRFIDWrite"
value
=
"1"
/>
<
add
key
=
"DefaultPWD"
value
=
"123456"
/>
<!--当前调试的设备
ID
,分号分割-->
<
add
key
=
"DebugDeviceId"
value
=
"0"
/>
<
add
key
=
"Server_Log_Open"
value
=
"0"
/>
<
add
key
=
"CodeCount"
value
=
"4"
/>
<
add
key
=
"DefaultTrayNum"
value
=
"0"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"0"
/>
<
add
key
=
"NeedCheckTray"
value
=
"0"
/>
<
add
key
=
"Feed_LastShelfID_101"
value
=
"B19"
/>
<
add
key
=
"Feed_LastShelfID_102"
value
=
"B23"
/>
<
add
key
=
"Feed_LastShelfID_103"
value
=
"B25"
/>
<
add
key
=
"Feed_LastShelfID_104"
value
=
"B7"
/>
<
add
key
=
"Brush_Delay_Seconds"
value
=
"5"
/>
<
add
key
=
"SaveErrorImageToFile"
value
=
"1"
/>
<
add
key
=
"UseTrayCheck"
value
=
"8
,"
/>
<
add
key
=
"ConfigPath_TrayList"
value
=
"\LineConfig\TrayList.data"
/>
<
add
key
=
"DebugDeviceId"
value
=
"0"
/>
<
add
key
=
"Server_Log_Open"
value
=
"0"
/>
<
add
key
=
"CodeCount"
value
=
"4"
/>
<
add
key
=
"DefaultTrayNum"
value
=
"0"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"0"
/>
<
add
key
=
"NeedCheckTray"
value
=
"0"
/>
<
add
key
=
"Feed_LastShelfID_101"
value
=
"B19"
/>
<
add
key
=
"Feed_LastShelfID_102"
value
=
"B23"
/>
<
add
key
=
"Feed_LastShelfID_103"
value
=
"B25"
/>
<
add
key
=
"Feed_LastShelfID_104"
value
=
"B7"
/>
<
add
key
=
"Brush_Delay_Seconds"
value
=
"5"
/>
<
add
key
=
"SaveErrorImageToFile"
value
=
"1"
/>
<
add
key
=
"UseTrayCheck"
value
=
"4,5,6,9,12,13,14,15,20,18,8,16,17,1,2,11,7,3,10,19,101,102,103
,"
/>
<
add
key
=
"ConfigPath_TrayList"
value
=
"\LineConfig\TrayList.data"
/>
<
add
key
=
"TESTFILE"
value
=
"D:\皮带线料盘识别\test.bmp"
/>
</
appSettings
>
<!-- <
log4net
> -->
...
...
@@ -85,60 +85,60 @@
<!-- </
log4net
> -->
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/Line-RC1250.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
file
value
=
"logs/Line-RC1250.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
</
appender
>
<
appender
name
=
"TheRFID"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/rfid/TheRFID-line.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
file
value
=
"logs/rfid/TheRFID-line.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
</
appender
>
<
appender
name
=
"AIOBOX"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/aio/AIOBOX-line.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
file
value
=
"logs/aio/AIOBOX-line.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
</
appender
>
<
appender
name
=
"RunLog"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/log/RunLog-line.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
file
value
=
"logs/log/RunLog-line.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
" %m%n"
/>
<
conversionPattern
value
=
" %m%n"
/>
</
layout
>
</
appender
>
<
logger
name
=
"RollingLogFileAppender"
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
</
logger
>
<
logger
name
=
"TheRFID"
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"TheRFID"
/>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"TheRFID"
/>
</
logger
>
<
logger
name
=
"AIOBOX"
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"AIOBOX"
/>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"AIOBOX"
/>
</
logger
>
<
logger
name
=
"RunLog"
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RunLog"
/>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RunLog"
/>
</
logger
>
<!--<
root
>
<
level
value
=
"Info"
/>
...
...
@@ -146,14 +146,14 @@
</
root
>-->
</
log4net
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
6.1"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
8"
/>
</
startup
>
<
runtime
>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"log4net"
culture
=
"neutral"
publicKeyToken
=
"669e0ddf0bb1aa2a"
Retargetable
=
"Yes"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-9.9.9.0"
newVersion
=
"2.0.8.0"
/>
<
assemblyIdentity
name
=
"log4net"
culture
=
"neutral"
publicKeyToken
=
"669e0ddf0bb1aa2a"
Retargetable
=
"Yes"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-9.9.9.0"
newVersion
=
"2.0.8.0"
/>
</
dependentAssembly
>
</
assemblyBinding
>
</
runtime
>
</
configuration
>
\ No newline at end of file
</
configuration
>
source/AssemblyLineClient/AssemblyLineClient.csproj
查看文件 @
1b7dcae
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.AssemblyLine</RootNamespace>
<AssemblyName>AssemblyLine</AssemblyName>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
8
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
...
...
source/AssemblyLineClient/FrmFeedingEquip.Designer.cs
查看文件 @
1b7dcae
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmFeedingEquip.cs
查看文件 @
1b7dcae
...
...
@@ -292,6 +292,8 @@ namespace OnlineStore.AssemblyLine
chbBoxSendShelf
.
Visible
=
equipBean
.
Config
.
IsCanOut
.
Equals
(
1
);
chbUseTrayCheck
.
Visible
=
equipBean
.
Config
.
IsCanOut
.
Equals
(
0
);
chbBoxSendShelf
.
Checked
=
equipBean
.
OutEndSendShelfOut
;
//chbUseTrayCheck.Visible = equipBean.Config.DIList.ContainsKey(IO_Type.TrayCheck);
chbUseTrayCheck
.
Checked
=
LineManager
.
useTrayCheck
.
Contains
(
equipBean
.
DeviceID
);
IsLoad
=
true
;
}
...
...
@@ -776,6 +778,7 @@ namespace OnlineStore.AssemblyLine
}
}
}
}
}
...
...
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
1b7dcae
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
1b7dcae
...
...
@@ -12,6 +12,7 @@ using System.Drawing;
using
System.Linq
;
using
System.Reflection
;
using
System.Runtime.InteropServices
;
using
System.Runtime.Remoting.Metadata.W3cXsd2001
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
...
...
@@ -362,9 +363,11 @@ namespace OnlineStore.AssemblyLine
{
if
(
lineBean
.
runStatus
!=
LineRunStatus
.
Wait
)
{
MessageBox
.
Show
(
lineBean
.
Name
+
"当前状态:"
+
lineBean
.
runStatus
+
",不能启动!"
);
//
MessageBox.Show(lineBean.Name + "当前状态:" + lineBean.runStatus + ",不能启动!");
return
;
}
}
stopRequest
=
false
;
stopRun
=
false
;
LogUtil
.
info
(
"点击 开始启动"
);
startTimer
.
Interval
=
300
;
startTimer
.
Elapsed
+=
timer_Elapsed
;
...
...
@@ -427,7 +430,7 @@ namespace OnlineStore.AssemblyLine
{
if
(
lineBean
.
runStatus
.
Equals
(
LineRunStatus
.
Wait
))
{
MessageBox
.
Show
(
lineBean
.
Name
+
"流水线未启动,不需要停止"
);
//
MessageBox.Show(lineBean.Name + "流水线未启动,不需要停止");
return
;
}
LogUtil
.
info
(
lineBean
.
Name
+
"点击:停止"
);
...
...
@@ -541,11 +544,47 @@ namespace OnlineStore.AssemblyLine
LogUtil
.
error
(
"LogM Error: "
,
ex
);
}
}
bool
stopRun
=
false
;
bool
stopRequest
=
false
;
DateTime
stopTime
=
new
DateTime
();
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
try
{
LogM
();
try
{
if
(
SServerManager
.
stopRun
(
Name
))
{
if
(!
stopRequest
)
{
stopTime
=
DateTime
.
Now
;
stopRequest
=
true
;
//lineBean.WriteDrivetMotorRun(IO_VALUE.LOW);
}
if
(!
stopRun
&&
stopRequest
&&
(
DateTime
.
Now
-
stopTime
).
TotalSeconds
>
40
)
{
stopRun
=
true
;
//停止所有料仓TToolStripMenuItem_Click(null, null);
lineBean
.
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
lineBean
.
LineStopRun
=
true
;
LogUtil
.
info
(
"收到服务端停机要求,停止环形线"
);
}
}
else
{
if
(
stopRun
)
{
lineBean
.
LineStopRun
=
false
;
lineBean
.
WriteDrivetMotorRun
(
IO_VALUE
.
HIGH
);
//启动所有料仓AToolStripMenuItem_Click(null, null);
stopRun
=
false
;
LogUtil
.
info
(
"收到服务端开机要求,启动环形线"
);
}
stopRequest
=
false
;
}
}
catch
{
lineBean
.
WriteDrivetMotorRun
(
IO_VALUE
.
HIGH
);
}
if
(!
this
.
Visible
)
{
return
;
...
...
@@ -570,9 +609,9 @@ namespace OnlineStore.AssemblyLine
warnMsg
+=
TrayManager
.
TrayErrorMsg
+
"\r\n"
;
}
if
(
lineBean
.
IOErrorMsg
.
Equals
(
""
).
Equals
(
false
))
{
warnMsg
+=
lineBean
.
IOErrorMsg
+
"\r\n"
;
}
{
warnMsg
+=
lineBean
.
IOErrorMsg
+
"\r\n"
;
}
foreach
(
EquipBase
move
in
lineBean
.
AllEquipMap
.
Values
)
{
if
(
move
.
WarnMsg
.
Equals
(
""
).
Equals
(
false
))
...
...
@@ -942,8 +981,8 @@ namespace OnlineStore.AssemblyLine
private
void
btnTrayInfo_Click
(
object
sender
,
EventArgs
e
)
{
string
msg
=
""
;
string
msg
=
""
;
List
<
TrayInfo
>
tray
=
TrayManager
.
getTrayList
();
LogUtil
.
info
(
"-------------------开始打印托盘信息:"
);
msg
+=
"-------------------开始打印托盘信息:\r\n"
;
...
...
@@ -954,7 +993,7 @@ namespace OnlineStore.AssemblyLine
{
disstr
=
"✘"
;
}
LogUtil
.
info
(
disstr
+
t
.
ToStr
());
LogUtil
.
info
(
disstr
+
t
.
ToStr
());
msg
+=
disstr
+
t
.
ToStr
()
+
"\r\n"
;
}
LogUtil
.
info
(
"-------------------结束打印托盘信息"
);
...
...
@@ -1255,7 +1294,8 @@ namespace OnlineStore.AssemblyLine
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
trayNum
);
lblSelTrayNum
.
Text
=
tray
.
ToStr
();
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
}
...
...
@@ -1274,7 +1314,7 @@ namespace OnlineStore.AssemblyLine
DialogResult
resut
=
MessageBox
.
Show
(
"确定手动清空托盘【"
+
num
+
"】的信息?\r\n "
+
oldStr
+
""
,
"提示"
,
MessageBoxButtons
.
YesNo
);
if
(
resut
.
Equals
(
DialogResult
.
Yes
))
{
TrayManager
.
ClearInstore
(
tray
,
"手动清空托盘"
);
TrayManager
.
ClearInstore
(
tray
,
"手动清空托盘"
);
TrayManager
.
UpdateTrayInfo
(
num
);
TrayInfo
info
=
TrayManager
.
GetTrayInfo
(
num
);
MessageBox
.
Show
(
"更新成功:\r"
+
info
.
ToStr
());
...
...
@@ -1290,14 +1330,14 @@ namespace OnlineStore.AssemblyLine
return
;
}
if
(
启用分流横移
1
ToolStripMenuItem
.
Text
.
Contains
(
gouStr
))
{
{
启用分流横移
1
ToolStripMenuItem
.
Text
=
"启用分流横移1"
;
lineBean
.
DisableShunt
=
true
;
}
else
{
{
启用分流横移
1
ToolStripMenuItem
.
Text
=
gouStr
+
"启用分流横移1"
;
lineBean
.
DisableShunt
=
false
;
lineBean
.
DisableShunt
=
false
;
}
LogUtil
.
info
(
Name
+
" 点击:"
+
启用分流横移
1
ToolStripMenuItem
.
Text
+
",lineBean.DisableShunt="
+
lineBean
.
DisableShunt
);
}
...
...
@@ -1318,7 +1358,7 @@ namespace OnlineStore.AssemblyLine
启用分流横移
2
ToolStripMenuItem
.
Text
=
gouStr
+
"启用分流横移2"
;
lineBean
.
DisableShunt2
=
false
;
}
LogUtil
.
info
(
Name
+
" 点击:"
+
启用分流横移
2
ToolStripMenuItem
.
Text
+
",lineBean.DisableShunt2="
+
lineBean
.
DisableShunt2
);
LogUtil
.
info
(
Name
+
" 点击:"
+
启用分流横移
2
ToolStripMenuItem
.
Text
+
",lineBean.DisableShunt2="
+
lineBean
.
DisableShunt2
);
}
private
void
自动保存托盘信息
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -1373,11 +1413,41 @@ namespace OnlineStore.AssemblyLine
{
RFIDManager
.
Open
();
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"btnOpenRfid_Click"
,
ex
);
LogUtil
.
error
(
"btnOpenRfid_Click"
,
ex
);
}
}
//private void 启用服务器停止ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// if (SServerManager.IgnoreServerStop)
// {
// 启用服务器停止ToolStripMenuItem.Text = gouStr + " 启用服务器停止功能";
// SServerManager.IgnoreServerStop = false;
// }
// else
// {
// 启用服务器停止ToolStripMenuItem.Text = "启用服务器停止功能";
// SServerManager.IgnoreServerStop = true;
// }
// LogUtil.info(Name + " 点击:" + 启用服务器停止ToolStripMenuItem.Text);
//}
private
void
新托盘检测逻辑
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
if
(
TrayDisableManager
.
UseNewLogic
)
{
新托盘检测逻辑
ToolStripMenuItem
.
Text
=
"新托盘检测逻辑"
;
TrayDisableManager
.
UseNewLogic
=
false
;
}
else
{
新托盘检测逻辑
ToolStripMenuItem
.
Text
=
gouStr
+
" 新托盘检测逻辑"
;
TrayDisableManager
.
UseNewLogic
=
true
;
}
LogUtil
.
info
(
Name
+
" 点击:"
+
新托盘检测逻辑
ToolStripMenuItem
.
Text
);
}
}
}
source/AssemblyLineClient/FrmProvidingEquip.Designer.cs
查看文件 @
1b7dcae
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmProvidingEquip.cs
查看文件 @
1b7dcae
...
...
@@ -16,7 +16,7 @@ using System.Reflection;
using
UserFromControl
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.Common
;
using
System.Threading.Tasks
;
namespace
OnlineStore.AssemblyLine
{
...
...
@@ -62,6 +62,7 @@ namespace OnlineStore.AssemblyLine
lblThisSta
.
Text
=
equipBean
.
WarnMsg
;
lblName
.
Text
=
equipBean
.
Name
;
txtP1
.
Text
=
equipBean
.
Config
.
UpDownAxisP1
.
ToString
();
btnReelCheck
.
Visible
=
equipBean
.
Config
.
CameraName_1
!=
""
;
IsLoad
=
true
;
}
...
...
@@ -540,6 +541,32 @@ namespace OnlineStore.AssemblyLine
}
}
private
void
btnReelCheck_Click
(
object
sender
,
EventArgs
e
)
{
ReelCheck
(
btnReelCheck
.
Text
,
equipBean
.
Config
.
CameraName_1
);
}
private
void
ReelCheck
(
string
text
,
string
cameraName
)
{
if
(
String
.
IsNullOrEmpty
(
cameraName
))
{
return
;
}
Task
.
Factory
.
StartNew
(
delegate
{
int
rfid
=
equipBean
.
ReadReelCheckId
();
string
reelInfo
=
equipBean
.
GetCurReelInfo
(
cameraName
);
if
(!
string
.
IsNullOrEmpty
(
reelInfo
))
{
MessageBox
.
Show
(
"相机["
+
cameraName
+
"]检测料盘结果:["
+
rfid
+
"]["
+
reelInfo
+
"]"
,
text
+
"结果"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Information
);
}
else
{
MessageBox
.
Show
(
"相机["
+
cameraName
+
"]检测料盘失败:["
+
rfid
+
"]"
,
text
+
"结果"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
}
});
}
}
}
...
...
source/AssemblyLineClient/Properties/Resources.Designer.cs
查看文件 @
1b7dcae
...
...
@@ -19,7 +19,7 @@ namespace OnlineStore.AssemblyLine.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"1
5
.0.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"1
7
.0.0.0"
)]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
internal
class
Resources
{
...
...
@@ -47,8 +47,8 @@ namespace OnlineStore.AssemblyLine.Properties {
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
///
重写当前线程的 CurrentUICulture 属性
。
/// 重写当前线程的 CurrentUICulture 属性
,对
///
使用此强类型资源类的所有资源查找执行重写
。
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
internal
static
global
::
System
.
Globalization
.
CultureInfo
Culture
{
...
...
source/AssemblyLineClient/Properties/Settings.Designer.cs
查看文件 @
1b7dcae
...
...
@@ -12,7 +12,7 @@ namespace OnlineStore.AssemblyLine.Properties {
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"1
5.9
.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"1
7.3
.0.0"
)]
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
...
...
source/Common/Common.csproj
查看文件 @
1b7dcae
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
8
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
1b7dcae
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
8
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
source/DeviceLibrary/LineConfig/Config_ProvidingEquip_4.csv
查看文件 @
1b7dcae
...
...
@@ -3,6 +3,8 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,0,,,,,
PRO,0,对应的横移模块,SidesWayNum,4,,,,,
PRO,0,设备对应的出料流水线的编号,DLineEquipNum,2,,,,,
PRO,0,设备对应的出料流水线的第几条流水线,DLineLineNum,2,,,,,
PRO,0,出料口前阻挡监控相机,CameraName_1,r_camera_1,,,,,
PRO,0,出料口前阻挡RFID,CameraName_1_RFID,192.168.210.133,,,,,
,,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,1,,,,,
AXIS,0,移栽上下轴,UpDown_Axis,10,COM3,0,,,
...
...
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
1b7dcae
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
1b7dcae
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
1b7dcae
...
...
@@ -552,6 +552,7 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
}
public
bool
LineStopRun
=
false
;
public
void
WriteDrivetMotorRun
(
IO_VALUE
value
)
{
...
...
@@ -561,13 +562,12 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
DriveMotor_Run4
,
value
);
}
#
region
灯光处理
p
rivate
void
CloseLed
()
p
ublic
void
CloseLed
()
{
CheckAndMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
CheckAndMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
LOW
);
...
...
@@ -577,7 +577,7 @@ namespace OnlineStore.DeviceLibrary
try
{
DateTime
time
=
DateTime
.
Now
;
if
(
runStatus
<=
LineRunStatus
.
Wait
)
if
(
runStatus
<=
LineRunStatus
.
Wait
||
LineStopRun
)
{
CloseLed
();
return
;
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
1b7dcae
...
...
@@ -351,7 +351,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
Name
+
"入库 ["
+
posId
+
"],升降气缸下降到托盘["
+
currTrayNum
+
"]取料失败,升降轴上升,禁用托盘,同时放行托盘"
);
LogInfo
(
"入库 ["
+
posId
+
"]"
+
MoveInfo
.
SLog
+
": 升降轴上升,禁用托盘,同时放行托盘,顶升气缸1下降"
);
TrayDisableManager
.
AddDisable
(
currTrayNum
,
Name
,
"入库取料失败"
);
TrayDisableManager
.
AddDisable
(
currTrayNum
,
Name
,
"入库取料失败"
,
0
);
MI_18_UpdownUp
();
}
}
...
...
@@ -390,7 +390,7 @@ namespace OnlineStore.DeviceLibrary
}
LogUtil
.
error
(
Name
+
"入库 ["
+
posId
+
"],托盘【 "
+
currTrayNum
+
"】,有料托盘料盘检测信号不亮,升降轴上升,禁用托盘,同时放行托盘"
);
LogInfo
(
"入库 ["
+
posId
+
"]"
+
MoveInfo
.
SLog
+
": 升降轴上升,禁用托盘,同时放行托盘,顶升气缸1下降"
);
TrayDisableManager
.
AddDisable
(
currTrayNum
,
Name
,
"有料托盘料盘检测信号不亮"
);
TrayDisableManager
.
AddDisable
(
currTrayNum
,
Name
,
"有料托盘料盘检测信号不亮"
,
1
);
MI_18_UpdownUp
();
}
else
...
...
@@ -651,7 +651,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo
(
"当前托盘上的料盘检测信号["
+
io
.
ConfigStr
+
"]的值:"
+
IOValue
(
IO_Type
.
TrayCheck
));
}
LogInfo
(
" 出库中,需拦截空托盘【 "
+
currTrayNum
+
"】,空托盘料盘检测信号亮,禁用托盘"
);
TrayDisableManager
.
AddDisable
(
currTrayNum
,
Name
,
"空托盘料盘检测信号亮"
);
TrayDisableManager
.
AddDisable
(
currTrayNum
,
Name
,
"空托盘料盘检测信号亮"
,
2
);
}
else
{
...
...
@@ -734,7 +734,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo
(
"当前托盘上的料盘检测信号["
+
io
.
ConfigStr
+
"]的值:"
+
IOValue
(
IO_Type
.
TrayCheck
));
}
LogInfo
(
" 入库需拦截有料托盘【 "
+
currTrayNum
+
"】,有料托盘料盘检测信号不亮,禁用托盘"
);
TrayDisableManager
.
AddDisable
(
currTrayNum
,
Name
,
"有料托盘料盘检测信号不亮"
);
TrayDisableManager
.
AddDisable
(
currTrayNum
,
Name
,
"有料托盘料盘检测信号不亮"
,
1
);
return
false
;
}
else
if
(!
LineServer
.
BoxCanInStore
(
StoreID
))
...
...
@@ -958,7 +958,7 @@ namespace OnlineStore.DeviceLibrary
try
{
StopReadRfid
();
LogUtil
.
info
(
$
"【{Name}】停止记录rfid缓存"
);
LogUtil
.
debug
(
$
"【{Name}】停止记录rfid缓存"
);
}
catch
(
Exception
ex1
)
{
...
...
@@ -970,8 +970,13 @@ namespace OnlineStore.DeviceLibrary
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
{
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
currTrayNum
);
if
(
tray
.
InoutPar
?.
ManualJudgeNG
??
false
)
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘【"
+
currTrayNum
+
"】被为标记判定NG,放盘通过"
);
}
//出库中,需要拦盘
if
(
CheckIsNeedOutStore
())
else
if
(
CheckIsNeedOutStore
())
{
isNeed
=
true
;
}
...
...
@@ -1056,8 +1061,13 @@ namespace OnlineStore.DeviceLibrary
//托盘号正确
//preTrayNum = num;
bool
isNeedMove
=
false
;
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
currTrayNum
);
if
(
tray
.
InoutPar
?.
ManualJudgeNG
??
false
)
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘【"
+
currTrayNum
+
"】被为标记判定NG,放盘通过"
);
}
//判断盘是空盘,空盘并且编号正确才需要放料盘过去
if
(
CheckIsNeedOutStore
())
else
if
(
CheckIsNeedOutStore
())
{
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currTrayNum
);
isNeedMove
=
true
;
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
1b7dcae
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblymanager/ALineManager.cs
查看文件 @
1b7dcae
...
...
@@ -278,7 +278,7 @@ namespace OnlineStore.DeviceLibrary
try
{
int
id
=
Convert
.
ToInt32
(
st
.
Trim
());
if
(
id
>
0
&&
id
<=
20
)
//
if (id > 0 && id <= 20)
{
useTrayCheck
.
Add
(
id
);
}
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
1b7dcae
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblymanager/TrayDisableManager.cs
查看文件 @
1b7dcae
...
...
@@ -35,10 +35,83 @@ namespace OnlineStore.DeviceLibrary
List
<
TrayDisableInfo
>
dislist
=
new
List
<
TrayDisableInfo
>(
TrayDisableMap
.
Values
);
return
dislist
;
}
public
static
void
AddDisable
(
int
trayNum
,
string
deviceName
,
string
describle
)
public
static
bool
UseNewLogic
=
true
;
/// <summary>
/// 添加屏蔽库位
/// </summary>
/// <param name="trayNum"></param>
/// <param name="deviceName"></param>
/// <param name="describle"></param>
/// <param name="type">0,无;1:硬件未检测到;2:硬件检测到</param>
public
static
void
AddDisable
(
int
trayNum
,
string
deviceName
,
string
describle
,
int
type
)
{
TrayDisableInfo
t
=
new
TrayDisableInfo
(
trayNum
,
deviceName
,
describle
);
if
(
UseNewLogic
)
{
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
trayNum
);
if
(
tray
.
InoutPar
.
Corrected
)
{
LogUtil
.
info
(
$
"{deviceName} 托盘新判断逻辑,料盘已纠正,无需处理:【{tray.ToStr()}】【{describle}】"
);
return
;
}
if
(
tray
.
IsFull
&&
type
.
Equals
(
1
))
//有料,但传感器未检测到
{
LogUtil
.
info
(
$
"{deviceName} 托盘新判断逻辑:【{tray.ToStr()}】【{describle}】。需要二次判断"
);
tray
.
InoutPar
.
ManualJudgeNG
=
true
;
TrayManager
.
UpdateTrayInfo
(
trayNum
,
tray
.
IsFull
,
tray
.
InOrOutStore
,
tray
.
InoutPar
);
}
else
if
(!
tray
.
IsFull
&&
type
.
Equals
(
2
)
&&
!
tray
.
InoutPar
.
InStoreNg
)
//无料,但传感器感应到
{
tray
.
InoutPar
.
ManualJudgeNG
=
true
;
LogUtil
.
info
(
$
"{deviceName} 托盘新判断逻辑:【{tray.ToStr()}】【{describle}】。认为NG"
);
TrayManager
.
UpdateTrayInfo
(
trayNum
,
tray
.
IsFull
,
tray
.
InOrOutStore
,
tray
.
InoutPar
);
}
else
{
tray
.
InoutPar
.
ManualJudgeNG
=
true
;
TrayManager
.
UpdateTrayInfo
(
trayNum
,
tray
.
IsFull
,
tray
.
InOrOutStore
,
tray
.
InoutPar
);
LogUtil
.
info
(
$
"{deviceName} 托盘新判断逻辑:【{tray.ToStr()}】【{describle}】。其他处理,需要二次判断"
);
}
//if (tray.InOrOutStore.Equals(1))//入库料
//{
// if (tray.IsFull && type.Equals(1))//认为无料
// {
// TrayManager.UpdateTrayInfo(trayNum) ;
// LogUtil.info($"{deviceName} 托盘新判断逻辑:【{tray.ToStr()}】【{describle}】。认为无料");
// }
// else if(!tray.IsFull && type.Equals(2) && !tray.InoutPar.InStoreNg)
// {
// tray.InoutPar.InStoreNg = true;
// TrayManager.UpdateTrayInfo(trayNum,true,tray.InOrOutStore,tray.InoutPar);
// LogUtil.info($"{deviceName} 托盘新判断逻辑:【{tray.ToStr()}】【{describle}】。认为NG");
// }
//}
//else if(tray.InOrOutStore.Equals(2))
//{
// if (tray.IsFull && type.Equals(1))//认为无料
// {
// TrayManager.UpdateTrayInfo(trayNum);
// LogUtil.info($"{deviceName} 托盘新判断逻辑:【{tray.ToStr()}】【{describle}】。认为无料");
// }
// else if (!tray.IsFull && type.Equals(2) && !tray.InoutPar.InStoreNg)
// {
// tray.InoutPar.InStoreNg = true;
// TrayManager.UpdateTrayInfo(trayNum, true, tray.InOrOutStore, tray.InoutPar);
// LogUtil.info($"{deviceName} 托盘新判断逻辑:【{tray.ToStr()}】【{describle}】。认为NG");
// }
//}
}
else
{
AddDisableTray
(
t
);
}
}
public
static
void
AddDisableTray
(
int
trayNum
)
{
TrayDisableInfo
t
=
new
TrayDisableInfo
();
t
.
TrayCode
=
trayNum
;
if
(
TrayDisableMap
.
ContainsKey
(
trayNum
))
{
TrayDisableMap
[
trayNum
]
=
t
;
...
...
@@ -56,7 +129,25 @@ namespace OnlineStore.DeviceLibrary
}
LogUtil
.
info
(
"增加托盘禁用:"
+
t
.
ToStr
()
+
""
);
}
public
static
void
AddDisableTray
(
TrayDisableInfo
t
)
{
if
(
TrayDisableMap
.
ContainsKey
(
t
.
TrayCode
))
{
TrayDisableMap
[
t
.
TrayCode
]
=
t
;
}
else
{
TrayDisableMap
.
TryAdd
(
t
.
TrayCode
,
t
);
}
//如果托盘上物料是入库的,直接清理入库 任务
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
t
.
TrayCode
);
if
(
tray
.
IsFull
&&
tray
.
InOrOutStore
.
Equals
(
1
))
{
TrayManager
.
ClearInstore
(
tray
,
"禁用托盘["
+
t
.
TrayCode
+
"]"
);
}
LogUtil
.
info
(
"增加托盘禁用:"
+
t
.
ToStr
()
+
""
);
}
public
static
void
RemoveDisable
(
int
trayNum
)
{
TrayManager
.
UpdateTrayInfo
(
trayNum
);
...
...
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
1b7dcae
...
...
@@ -105,14 +105,18 @@ namespace OnlineStore.DeviceLibrary
{
param
=
new
InOutParam
();
}
param
.
Corrected
=
false
;
TrayInfoMap
[
trayNum
].
InoutPar
=
param
;
TrayInfoMap
[
trayNum
].
ShowMsg
=
ngMsg
;
}
else
{
TrayInfo
fixture
=
new
TrayInfo
(
trayNum
,
isFull
,
inOrOut
,
param
,
ngMsg
);
TrayInfo
fixture
=
new
TrayInfo
(
trayNum
,
isFull
,
inOrOut
,
param
,
ngMsg
);
fixture
.
InoutPar
.
Corrected
=
false
;
TrayInfoMap
.
TryAdd
(
trayNum
,
fixture
);
// TrayInfoMap.TryAdd(trayNum, fixture);
}
SaveMapToFile
();
}
...
...
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
1b7dcae
...
...
@@ -258,6 +258,169 @@ namespace OnlineStore.DeviceLibrary
return
codeList
;
}
[
HandleProcessCorruptedStateExceptions
]
public
static
(
bool
,
string
)
ReelCheckCameraScan
(
List
<
string
>
cameraList
,
string
deviceName
)
{
bool
isPreScan
=
deviceName
.
EndsWith
(
"预扫码"
);
List
<
string
>
codeList
=
new
List
<
string
>();
bool
findCode
=
true
;
if
(
cameraList
==
null
||
cameraList
.
Count
<=
0
)
{
return
(
findCode
,
ProcessCode
(
codeList
));
}
try
{
foreach
(
string
cameraName
in
cameraList
)
{
if
(
cameraName
.
Trim
().
Equals
(
""
))
{
continue
;
}
ScanCount
++;
DateTime
startTime
=
DateTime
.
Now
;
if
(
deviceName
!=
""
)
{
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】开始取图片"
);
}
Bitmap
bmp
=
null
;
HalconDotNet
.
HObject
ho_Image
=
null
;
try
{
ho_Image
=
Camera
.
_cam
.
CaptureOnImage
(
cameraName
,
out
bmp
);
if
(
ho_Image
==
null
)
{
LogUtil
.
error
(
deviceName
+
" 【"
+
cameraName
+
"】取图片失败["
+
Camera
.
_cam
.
ErrInfo
+
"],关闭相机"
);
CloseCamera
(
cameraName
);
continue
;
}
LogUtil
.
debug
(
deviceName
+
" 【"
+
cameraName
+
"】取图片完成,开始扫码"
);
string
r
=
""
;
// bool eyemNoCode = false;
Task
eyemtask
=
Task
.
Factory
.
StartNew
(
delegate
{
List
<
CodeInfo
>
tlci
=
EyemDecode
.
ModelDecoder
(
ref
bmp
);
foreach
(
CodeInfo
co
in
tlci
)
{
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】[eyemDecode]"
+
co
.
CodeType
+
"(X: "
+
co
.
X
+
",Y: "
+
co
.
Y
+
") "
+
co
.
CodeStr
);
string
str
=
CodeManager
.
ReplaceCode
(
co
.
CodeStr
);
if
(!
codeList
.
Contains
(
str
))
{
codeList
.
Add
(
str
);
r
=
r
+
"##eyem|"
+
co
.
CodeType
+
"|"
+
str
;
//if (!findCode)
//{
// findCode = HasRightCode(str);
//}
}
}
});
//最多等待60秒
bool
taskResult
=
eyemtask
.
Wait
(
60000
);
if
(!
taskResult
)
{
LogUtil
.
error
(
deviceName
+
" 【"
+
cameraName
+
"】eyem扫码超时"
);
//eyemNoCode = true;
}
//if (!isPreScan)
//{
// if (!findCode)
// {
// try
// {
// List<CodeInfo> cc = new List<CodeInfo>();
// eyemNoCode = true;
// RemoteDecodeHelper.RemoteDecodeParam remoteDecodeParam = new RemoteDecodeHelper.RemoteDecodeParam
// {
// codeTypeList = allCodeTypeList.ToArray(),
// codeCount = 3,
// timeout = 3000
// };
// cc = RemoteDecodeHelper.DecodeRequest(ho_Image, remoteDecodeParam);
// if (cc != null && cc.Count > 0) findCode = true;
// //if (cc != null)
// //{
// // foreach (CodeInfo c in cc)
// // {
// // string str = CodeManager.ReplaceCode(c.CodeStr);
// // if (!codeList.Contains(str))
// // {
// // codeList.Add(str);
// // r = r + "##halcon|" + c.CodeType + "|" + str;
// // if (!findCode)
// // {
// // findCode = HasRightCode(str);
// // }
// // }
// // }
// //}
// }
// catch (Exception ex)
// {
// LogUtil.error(deviceName + " RemoteDecodeHelper扫码出错:" + ex.ToString());
// }
// }
// //if (!findRightCode && SaveErrorImageToFile.Equals(1))
// if (SaveImage || (((!findCode) || eyemNoCode) && (!isPreScan)))
// {
// //如果halcon没扫出的,
// string nameStr = "";
// if (findCode && eyemNoCode)
// {
// nameStr = "eyem";
// }
// SaveImageToFile(deviceName, cameraName + nameStr, bmp);
// }
//}
if
(
deviceName
!=
""
||
r
!=
""
)
{
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】["
+
findCode
+
"]"
+
ScanCount
+
" :"
+
r
);
}
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
deviceName
+
" 扫码出现AccessViolationException异常,关闭相机【"
+
cameraName
+
"】:"
+
e
.
ToString
());
Camera
.
_cam
.
Close
(
cameraName
);
// GC.Collect();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" 扫码出错:"
+
ex
.
ToString
());
}
finally
{
if
(
ho_Image
!=
null
)
{
ho_Image
.
Dispose
();
ho_Image
=
null
;
}
// GC.Collect();
Task
.
Delay
(
10
);
}
}
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
deviceName
+
" 扫码出现AccessViolationException异常,关闭所有相机:"
+
e
.
ToString
());
Camera
.
_cam
.
CloseAll
();
//GC.Collect();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" 扫码出错:"
+
ex
.
ToString
());
}
string
code
=
ProcessCode
(
codeList
);
findCode
=
string
.
IsNullOrEmpty
(
code
)
?
false
:
true
;
return
(
findCode
,
code
);
}
private
static
int
SaveErrorImageToFile
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
SaveErrorImageToFile
);
private
static
void
SaveImageToFile
(
string
deviceName
,
string
cameraName
,
HalconDotNet
.
HObject
bitmap
)
...
...
@@ -282,6 +445,7 @@ namespace OnlineStore.DeviceLibrary
}
private
static
void
SaveImageToFile
(
string
deviceName
,
string
cameraName
,
Bitmap
bitmap
)
{
if
(!
SaveImage
)
return
;
string
date
=
deviceName
.
Trim
().
Replace
(
'_'
,
'-'
)
+
"-"
+
DateTime
.
Now
.
ToString
(
"yyyyMMdd-HHmmss"
)
+
DateTime
.
Now
.
Millisecond
;
string
dire
=
@"D:\image\" + deviceName.Trim().Replace('_', '-') + @"
\
" + cameraName.Trim().Replace('_', '-').Replace(':', '-') + @"
\
";
string
iamgeName
=
date
+
".bmp"
;
...
...
@@ -309,7 +473,7 @@ namespace OnlineStore.DeviceLibrary
foreach
(
string
code
in
codes
)
{
string
[]
strarray
=
code
.
Split
(
';'
);
if
(
strarray
.
Length
=
=
4
)
if
(
strarray
.
Length
>
=
4
)
{
if
(
//strarray[0].StartsWith("L") &&
...
...
source/DeviceLibrary/model/InOutParam.cs
查看文件 @
1b7dcae
...
...
@@ -60,6 +60,15 @@ namespace OnlineStore.DeviceLibrary
/// 是否是入库NG的料盘
/// </summary>
public
bool
InStoreNg
=
false
;
/// <summary>
/// 手动判断NG
/// </summary>
public
bool
ManualJudgeNG
=
false
;
/// <summary>
/// 相机已纠正
/// </summary>
public
bool
Corrected
=
false
;
public
string
NgMsg
=
""
;
public
string
ToStr
()
{
...
...
source/DeviceLibrary/model/KTK_Store.cs
查看文件 @
1b7dcae
...
...
@@ -593,22 +593,22 @@ namespace OnlineStore.DeviceLibrary
{
if
(
msg
.
StartsWith
(
Name
))
{
LogUtil
.
error
(
msg
,
logtype
,
logseconds
);
//
LogUtil.error(msg, logtype, logseconds);
}
else
{
LogUtil
.
error
(
Name
+
msg
,
logtype
,
logseconds
);
//
LogUtil.error(Name + msg, logtype, logseconds);
}
}
else
{
if
(
msg
.
StartsWith
(
Name
))
{
LogUtil
.
error
(
msg
);
//
LogUtil.error(msg);
}
else
{
LogUtil
.
error
(
Name
+
msg
);
//
LogUtil.error(Name + msg);
}
}
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
1b7dcae
...
...
@@ -257,6 +257,7 @@ namespace OnlineStore.DeviceLibrary
MI_18_UpdownUp
,
#
endregion
#
region
移栽装置出入库共同模块
1180
-
1100
/// <summary>
///移载(流水线)装置出入库处理,阻挡气缸1-1下降
...
...
source/DeviceLibrary/model/TrayInfo.cs
查看文件 @
1b7dcae
...
...
@@ -48,7 +48,7 @@ namespace OnlineStore.DeviceLibrary
//return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type +
// "]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ;
return
"托盘 ["
+
TrayCode
+
"] ["
+
LastUpdateTime
.
ToLongTimeString
()
+
"] ["
+
(
IsFull
?
"有料"
:
"空"
)
+
"] ["
+
type
+
"]"
;
return
"托盘 ["
+
TrayCode
+
"] ["
+
LastUpdateTime
.
ToLongTimeString
()
+
"] ["
+
(
IsFull
?
"有料"
:
"空"
)
+
"] ["
+
type
+
"]"
+
"["
+
((
inoutPar
?.
ManualJudgeNG
??
false
)
?
"判定NG"
:
"判定OK"
)
+
"]["
+((
inoutPar
?.
Corrected
??
false
)?
"纠正OK"
:
"未纠正"
)+
"]"
;
}
/// <summary>
/// 夹具编码值(1-32?)
...
...
source/LoadCVSLibrary/LoadCSVLibrary.csproj
查看文件 @
1b7dcae
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
8
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
source/LoadCVSLibrary/storeConfig/config/ProvidingEquip_Config.cs
查看文件 @
1b7dcae
...
...
@@ -119,8 +119,16 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[
ConfigProAttribute
(
"UpdownAxis_P3Speed"
,
false
)]
public
int
UpdownAxis_P3Speed
{
get
;
set
;
}
/// <summary>
/// PRO 0 出料口监控相机 CameraName_1
/// </summary>
[
ConfigProAttribute
(
"CameraName_1"
,
false
)]
public
string
CameraName_1
{
get
;
set
;
}
/// <summary>
/// PRO,0,出料口前阻挡RFID,CameraName_1_RFID,192.168.103.21,,,,,
/// </summary>
[
ConfigProAttribute
(
"CameraName_1_RFID"
,
false
)]
public
string
CameraName_1_RFID
{
get
;
set
;
}
/// <summary>
/// PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7*16=80000;,,,,,
...
...
source/UserFromControl/Properties/Resources.Designer.cs
查看文件 @
1b7dcae
...
...
@@ -19,7 +19,7 @@ namespace UserFromControl.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"1
5
.0.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"System.Resources.Tools.StronglyTypedResourceBuilder"
,
"1
7
.0.0.0"
)]
[
global
::
System
.
Diagnostics
.
DebuggerNonUserCodeAttribute
()]
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
internal
class
Resources
{
...
...
@@ -47,8 +47,8 @@ namespace UserFromControl.Properties {
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
///
重写当前线程的 CurrentUICulture 属性
。
/// 重写当前线程的 CurrentUICulture 属性
,对
///
使用此强类型资源类的所有资源查找执行重写
。
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
internal
static
global
::
System
.
Globalization
.
CultureInfo
Culture
{
...
...
source/UserFromControl/UserFromControl.csproj
查看文件 @
1b7dcae
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UserFromControl</RootNamespace>
<AssemblyName>UserFromControl</AssemblyName>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
8
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论