Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 351f8cbf
由
刘韬
编写于
2022-01-30 13:55:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
5a1faba9
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
104 行增加
和
78 行删除
source/ACSingleStore/App.config
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/Program.cs
source/ACSingleStore/Properties/AssemblyInfo.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/dataLogic/DLScanSocket.cs
source/DeviceLibrary/store/Camera.cs
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
source/ACSingleStore/App.config
查看文件 @
351f8cb
...
...
@@ -12,7 +12,7 @@
<
add
key
=
"StartBlowValue"
value
=
"2"
/>
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<
add
key
=
"StopBlowValue"
value
=
"4"
/>
<
add
key
=
"UseAirBlow"
value
=
"
-
1"
/>
<
add
key
=
"UseAirBlow"
value
=
"1"
/>
<
add
key
=
"DoorOpenAirBlow"
value
=
"0"
/>
<
add
key
=
"humidityadjust"
value
=
"-11"
/>
<
add
key
=
"humiditylimited"
value
=
"4"
/>
...
...
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
351f8cb
...
...
@@ -84,37 +84,43 @@ namespace OnlineStore.ACSingleStore
LogUtil
.
error
(
LOGGER
,
"找不到对应的料仓"
);
return
;
}
try
{
uc_boxdebug1
.
Init
(
store
);
uc_boxdebug1
.
Init
(
store
);
txtMiddleP1
.
Text
=
store
.
Config
.
MiddleAxis_P1_Position
.
ToString
();
txtUpDownP1
.
Text
=
store
.
Config
.
UpDownAxis_DoorOPosition_P1
.
ToString
();
txtInOutP1
.
Text
=
store
.
Config
.
InOutAxis_P1_Position
.
ToString
();
txtComP1
.
Text
=
store
.
Config
.
CompressAxis_P1_Position
.
ToString
();
txtMiddleP1
.
Text
=
store
.
Config
.
MiddleAxis_P1_Position
.
ToString
();
txtUpDownP1
.
Text
=
store
.
Config
.
UpDownAxis_DoorOPosition_P1
.
ToString
();
txtInOutP1
.
Text
=
store
.
Config
.
InOutAxis_P1_Position
.
ToString
();
txtComP1
.
Text
=
store
.
Config
.
CompressAxis_P1_Position
.
ToString
();
txtUpDownP2
.
Text
=
store
.
Config
.
UpDownAxis_DoorIPosition_P2
.
ToString
();
txtUpDownP7
.
Text
=
store
.
Config
.
UpDownAxis_DoorOBPosition_P7
.
ToString
();
txtUpDownP8
.
Text
=
store
.
Config
.
UpDownAxis_DoorIBPosition_P8
.
ToString
();
//txtInOutP2.Text = store.Config.InOutAxis_DoorPosition_P2.ToString();
if
(
store
.
Config
.
StoreDOList
.
ContainsKey
(
IO_Type
.
Device_Led
))
{
btnOpenDLed
.
Visible
=
true
;
btnCloseDLed
.
Visible
=
true
;
txtUpDownP2
.
Text
=
store
.
Config
.
UpDownAxis_DoorIPosition_P2
.
ToString
();
txtUpDownP7
.
Text
=
store
.
Config
.
UpDownAxis_DoorOBPosition_P7
.
ToString
();
txtUpDownP8
.
Text
=
store
.
Config
.
UpDownAxis_DoorIBPosition_P8
.
ToString
();
//txtInOutP2.Text = store.Config.InOutAxis_DoorPosition_P2.ToString();
if
(
store
.
Config
.
StoreDOList
.
ContainsKey
(
IO_Type
.
Device_Led
))
{
btnOpenDLed
.
Visible
=
true
;
btnCloseDLed
.
Visible
=
true
;
}
else
{
btnOpenDLed
.
Visible
=
false
;
btnCloseDLed
.
Visible
=
false
;
}
timer1
.
Enabled
=
true
;
setAxisPopup
(
txtUpDownP1
,
btnUpDownP1
,
store
.
Config
.
UpDown_Axis
);
setAxisPopup
(
txtUpDownP7
,
btnUpDownP7
,
store
.
Config
.
UpDown_Axis
);
setAxisPopup
(
txtUpDownP8
,
btnUpDownP8
,
store
.
Config
.
UpDown_Axis
);
setAxisPopup
(
txtUpDownP2
,
btnUpDownP2
,
store
.
Config
.
UpDown_Axis
);
setAxisPopup
(
txtMiddleP1
,
btnMiddleP1
,
store
.
Config
.
Middle_Axis
);
setAxisPopup
(
txtInOutP1
,
btnInOutP1
,
store
.
Config
.
InOut_Axis
);
setAxisPopup
(
txtComP1
,
btnComP1
,
store
.
Config
.
Comp_Axis
);
}
else
{
btnOpenDLed
.
Visible
=
false
;
btnCloseDLed
.
Visible
=
false
;
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"加载界面出错"
+
ex
.
ToString
());
}
timer1
.
Enabled
=
true
;
setAxisPopup
(
txtUpDownP1
,
btnUpDownP1
,
store
.
Config
.
UpDown_Axis
);
setAxisPopup
(
txtUpDownP7
,
btnUpDownP7
,
store
.
Config
.
UpDown_Axis
);
setAxisPopup
(
txtUpDownP8
,
btnUpDownP8
,
store
.
Config
.
UpDown_Axis
);
setAxisPopup
(
txtUpDownP2
,
btnUpDownP2
,
store
.
Config
.
UpDown_Axis
);
setAxisPopup
(
txtMiddleP1
,
btnMiddleP1
,
store
.
Config
.
Middle_Axis
);
setAxisPopup
(
txtInOutP1
,
btnInOutP1
,
store
.
Config
.
InOut_Axis
);
setAxisPopup
(
txtComP1
,
btnComP1
,
store
.
Config
.
Comp_Axis
);
}
#
endregion
...
...
@@ -778,7 +784,7 @@ namespace OnlineStore.ACSingleStore
{
stop_button_Click
(
null
,
null
);
}
HIKCamera
.
Current
.
Close
();
ResourceCulture
.
LogDefaultMap
();
IOManager
.
instance
.
CloseAllDO
();
StoreOpenStatus
(
false
);
...
...
source/ACSingleStore/Program.cs
查看文件 @
351f8cb
...
...
@@ -130,7 +130,7 @@ namespace OnlineStore.ACSingleStore
// SISO.IO.X01_Reset
// SISO.Servo.InOut
public
string
DevicePath
;
public
string
DeviceName
;
//设别名称 比如AC01, Store02
public
string
CID
;
//设别名称 比如AC01, Store02
public
string
ErrorDescKey
;
//报警描述语言Key
public
string
ErrorDescription
;
//报警描述 支持{0}替换字符
public
string
[]
ErrorDescParameters
;
//报警描述参数
...
...
source/ACSingleStore/Properties/AssemblyInfo.cs
查看文件 @
351f8cb
...
...
@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SO951-HC-ACSingleStore
173c9a22466568332d0190b45847fb52e2b6d28f
")]
[assembly: AssemblyProduct("SO951-HC-ACSingleStore
5a1faba90251847885c81b6291b50d083a8262c9
")]
[assembly: AssemblyCopyright("Copyright ? 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
...
...
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
351f8cb
...
...
@@ -18,7 +18,7 @@ DI,前门限位,Door_Limit,9,HC,0,前门限位,X09,X09,0
DI,左侧门限位,Door_LeftLimit,10,HC,0,左侧门限位,X10,X10,0
DI,右侧门限位,Door_RightLimit,11,HC,0,右侧门限位,X11,X11,0
DI,激光对点检测,Laser_detection,12,HC,0,激光对点检测,X12,X12,0
DI,进料口电机异常,Motor_Error,13,HC,0,进料口电机异常,X13,X13,0
DI
X
,进料口电机异常,Motor_Error,13,HC,0,进料口电机异常,X13,X13,0
DI,料盘检测3(进料口),TrayCheck_Door_13,14,HC,0,料盘检测3(进料口),X14,X14,0
,,,,,,,,,
DO,自动指示灯,AutoRun_HddLed,0,HC,0,自动指示灯,Y00,Y01,0
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
351f8cb
...
...
@@ -1174,7 +1174,7 @@ namespace OnlineStore.DeviceLibrary
//光栅不遮挡时才扫码
if
((
checkIO
.
Equals
(
IO_VALUE
.
HIGH
))
&&
IOManager
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
)&&
height
>
0
)
{
if
(!
CanStartCode
()
||
IsDebug
||
InStoreFail
||
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(!
CanStartCode
()
||
IsDebug
||
InStoreFail
)
//
|| IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
// return;
}
...
...
@@ -1193,19 +1193,23 @@ namespace OnlineStore.DeviceLibrary
// GetCameraCode();
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
LastScanTime
=
DateTime
.
Now
;
dlScanSocket
.
BeginScan
();
Task
.
Run
(()=>
{
List
<
string
>
codelist
;
if
(
CodeManager
.
IsServerAccess
())
{
codelist
=
new
List
<
string
>()
{
"server"
};
}
else
var
isdl
=
dlScanSocket
.
BeginScan
();
if
(
isdl
)
{
Task
.
Run
(()
=>
{
codelist
=
CodeManager
.
CameraScan
();
}
onCodeReceived
(
codelist
.
ToArray
());
});
List
<
string
>
codelist
;
if
(
CodeManager
.
IsServerAccess
())
{
codelist
=
new
List
<
string
>()
{
"server"
};
}
else
{
codelist
=
CodeManager
.
CameraScan
();
}
onCodeReceived
(
codelist
.
ToArray
());
});
}
}
}
else
...
...
@@ -1551,7 +1555,7 @@ namespace OnlineStore.DeviceLibrary
catch
(
Exception
ex
)
{
IsScanCode
=
false
;
LOGGER
.
Error
(
StoreName
+
ex
.
StackTrace
);
LOGGER
.
Error
(
StoreName
+
ex
.
ToString
()
);
}
}
private
void
ReviceInStoreProcess
(
string
message
,
Operation
resultOperation
)
...
...
@@ -1564,18 +1568,18 @@ namespace OnlineStore.DeviceLibrary
string
posId
=
data
[
ParamDefine
.
posId
];
string
plateW
=
data
[
ParamDefine
.
plateW
];
string
plateH
=
data
[
ParamDefine
.
plateH
];
string
[]
posArray
=
posId
.
Split
(
'#'
);
if
(!(
posArray
.
Length
==
2
))
{
InStoreFail
=
true
;
//WarnMsg = StoreName + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
SetWarnMsg
(
ResourceControl
.
InStoreError
,
message
,
posId
);
LogUtil
.
error
(
LOGGER
,
"服务器反馈 入库库位格式错误:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
LogUtil
.
info
(
LOGGER
,
"服务器反馈 入库库位格式错误:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
return
;
}
//
string[] posArray = posId.Split('#');
//
if (!(posArray.Length == 2))
//
{
//
InStoreFail = true;
//
//WarnMsg = StoreName + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
//
SetWarnMsg(ResourceControl.InStoreError, message, posId);
//
LogUtil.error(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
//
LogUtil.info(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
//
return;
//
}
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
//
int storeId = int.Parse(posArray[0]);
//根据发送的posId获取位置列表
ACStorePosition
position
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
posId
);
if
(
position
==
null
)
...
...
@@ -1670,7 +1674,12 @@ namespace OnlineStore.DeviceLibrary
{
//无固定尺寸,判断宽度是否是固定,如果不是固定,直接获取当前高度宽度
codeSize
=
GetSize
()
+
"x"
+
GetHeight
();
if
(
codeList
.
Count
()
==
1
&&
codeList
[
0
]
==
"server"
)
{
codeSize
=
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Door_13
).
Equals
(
IO_VALUE
.
HIGH
)?
"13"
:
"7"
+
"x0"
;
}
}
foreach
(
string
code
in
codelists
.
ToArray
())
{
message
=
message
+
"="
+
"1+0x0-"
+
codeSize
+
"="
+
code
+
dlScanSocket
.
spiltStr
;
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
351f8cb
...
...
@@ -267,11 +267,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,找不到库位信息"
);
return
;
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,叉子料盘检测有料"
);
return
;
}
//
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
//
{
//
LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,叉子料盘检测有料");
//
return;
//
}
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】"
,
storeMoveColor
);
storeRunStatus
=
StoreRunStatus
.
Busy
;
storeStatus
=
StoreStatus
.
InStoreExecute
;
...
...
@@ -368,6 +368,7 @@ namespace OnlineStore.DeviceLibrary
ComMoveToPosition
(
moveP
.
ComPress_P3
,
Config
.
CompAxis_P3_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
LOW
));
}
else
{
...
...
@@ -568,11 +569,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,找不到库位信息"
);
return
false
;
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,叉子料盘检测有料"
);
return
false
;
}
//
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
//
{
//
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错,叉子料盘检测有料");
//
return false;
//
}
storeStatus
=
StoreStatus
.
OutStoreExecute
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
"启动出库【"
+
posId
+
"】 "
,
storeMoveColor
);
storeRunStatus
=
StoreRunStatus
.
Busy
;
...
...
@@ -629,6 +630,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
Middle_P2
,
Config
.
MiddleAxis_P2_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
UpDown_P5
,
Config
.
UpDownAxis_P5_Speed
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
LOW
));
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_03_ToBagPosition
)
{
...
...
source/DeviceLibrary/dataLogic/DLScanSocket.cs
查看文件 @
351f8cb
...
...
@@ -85,10 +85,10 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 发送扫码命令开始扫码
/// </summary>
public
void
BeginScan
()
public
bool
BeginScan
()
{
if
(!
isScannerRun
)
return
;
return
false
;
try
{
string
str
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
StartScan_CMD
);
...
...
@@ -98,6 +98,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
"【"
+
ScannerIP
+
"】开始扫码错误:"
+
ex
.
ToString
());
}
return
true
;
}
...
...
source/DeviceLibrary/store/Camera.cs
查看文件 @
351f8cb
...
...
@@ -28,6 +28,7 @@ namespace OnlineStore
public
string
Name
=
""
;
public
event
EventHandler
<
Bitmap
>
camera_event
;
public
string
DeviceName
=
"monitor1"
;
bool
loop
=
true
;
public
void
LoadCameraConfig
()
{
string
path
=
@".\StoreConfig\Camera.json"
;
...
...
@@ -58,6 +59,7 @@ namespace OnlineStore
{
LogUtil
.
error
(
Name
+
$
"监控相机打开失败"
);
}
loop
=
true
;
camerathread
=
new
Thread
(
new
ThreadStart
(
startCamera
));
camerathread
.
Start
();
GC
.
KeepAlive
(
camerathread
);
...
...
@@ -66,7 +68,7 @@ namespace OnlineStore
int
errortimes
=
0
;
void
startCamera
()
{
while
(
true
)
while
(
loop
)
{
try
{
...
...
@@ -83,24 +85,27 @@ namespace OnlineStore
}
else
if
(
errortimes
==
5
)
{
camera
.
Open
();
errortimes
++;
camera
.
Close
(
DeviceName
);
Thread
.
Sleep
(
1000
);
camera
.
Open
(
DeviceName
);
errortimes
=
0
;
LogUtil
.
error
(
Name
+
$
"相机错误次数过多,重新打开,{errortimes}"
);
Thread
.
Sleep
(
5000
);
}
else
if
(
errortimes
==
6
)
{
LogUtil
.
error
(
Name
+
$
"相机连接失败, 相机线程退出,{errortimes}"
);
break
;
}
Thread
.
Sleep
(
1000
/
7
);
}
catch
{
errortimes
++;
}
}
camera
.
Close
();
camera
.
Close
(
DeviceName
);
camera
.
Dispose
();
}
public
void
Close
()
{
LogUtil
.
info
(
Name
+
"线程退出"
);
loop
=
false
;
}
public
void
CameraGrabOne
(
string
filename
)
{
try
...
...
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
查看文件 @
351f8cb
...
...
@@ -86,7 +86,10 @@ namespace OnlineStore.LoadCSVLibrary
/// DI 进料口电机异常 Door_RightLimit X13
/// </summary>
public
static
string
Motor_Error
=
"Motor_Error"
;
/// <summary>
/// DI 料盘检测3(进料口) TrayCheck_Door_13 X14
/// </summary>
public
static
string
TrayCheck_Door_13
=
"TrayCheck_Door_13"
;
/// <summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论