Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS200
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit fb13a9c4
由
刘韬
编写于
2024-06-27 10:41:33 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
更新翻译
1 个父辈
95a3c3ce
全部展开
显示空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
190 行增加
和
79 行删除
AutoScanAndLabel/AutoScanAndLabel.csproj
AutoScanAndLabel/SettingControl.Designer.cs
AutoScanAndLabel/resources/NS200_Res.xlsx
AutoScanAndLabel/resources/NS200自动扫码贴标机2.xlsx
AutoScanAndLabel/resources/So1164自动扫码贴标机.xlsx
AutoScanAndLabel/resources/en-US-1.lngres
AutoScanAndLabel/resources/en-US.lngres
AutoScanAndLabel/resources/zh-CN.lngres
AutoScanAndLabel/resources/自动扫码贴标机.xlsx
Common/bean/Bean.cs
DeviceLibrary/AutoScanAndLabel/AxisBean.cs
DeviceLibrary/AutoScanAndLabel/LabelParam.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _LabelProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _LedProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _MiddleProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _RightProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine.cs
DeviceLibrary/AutoScanAndLabel/MoveStep.cs
DeviceLibrary/AutoScanAndLabel/RobotManage.cs
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/DeviceLibrary/PrinterHelper.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
AutoScanAndLabel/AutoScanAndLabel.csproj
查看文件 @
fb13a9c
...
...
@@ -165,6 +165,7 @@
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FrmLabelEdit.resx">
<DependentUpon>FrmLabelEdit.cs</DependentUpon>
...
...
@@ -222,8 +223,7 @@
<None Include="resources\ja-JP.lngres">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="resources\So1164自动扫码贴标机.xlsx" />
<None Include="resources\So1164自动扫码贴标机2.xlsx" />
<None Include="resources\NS200_Res.xlsx" />
<None Include="resources\zh-CN.lngres">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
...
...
AutoScanAndLabel/SettingControl.Designer.cs
查看文件 @
fb13a9c
...
...
@@ -38,7 +38,9 @@ namespace AutoScanAndLabel
this
.
chbAutoRun
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
btn_labelDebug
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
listEdit_pn
=
new
AutoScanAndLabel
.
UC
.
ListEditControl
();
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
listEditControl1
=
new
AutoScanAndLabel
.
UC
.
ListEditControl
();
this
.
txt_code
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
btn_codetest
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label_matchdebugstring
=
new
System
.
Windows
.
Forms
.
Label
();
...
...
@@ -48,8 +50,6 @@ namespace AutoScanAndLabel
this
.
cb_IgnoreGratingSignal
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
checkBox1
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
uC_U11
=
new
AutoScanAndLabel
.
UC_U1
();
this
.
listEditControl1
=
new
AutoScanAndLabel
.
UC
.
ListEditControl
();
this
.
listEdit_pn
=
new
AutoScanAndLabel
.
UC
.
ListEditControl
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
...
...
@@ -149,6 +149,18 @@ namespace AutoScanAndLabel
this
.
groupBox2
.
Text
=
"PN匹配规则"
;
this
.
groupBox2
.
Visible
=
false
;
//
// listEdit_pn
//
this
.
listEdit_pn
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
listEdit_pn
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
listEdit_pn
.
ListFile
=
"config/pn.list"
;
this
.
listEdit_pn
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
17
);
this
.
listEdit_pn
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
5
);
this
.
listEdit_pn
.
Name
=
"listEdit_pn"
;
this
.
listEdit_pn
.
Size
=
new
System
.
Drawing
.
Size
(
354
,
158
);
this
.
listEdit_pn
.
TabIndex
=
3
;
this
.
listEdit_pn
.
DataRefresh
+=
new
System
.
EventHandler
(
this
.
listEdit_pn_DataRefresh
);
//
// groupBox3
//
this
.
groupBox3
.
Controls
.
Add
(
this
.
listEditControl1
);
...
...
@@ -160,6 +172,18 @@ namespace AutoScanAndLabel
this
.
groupBox3
.
Text
=
"QTY匹配规则"
;
this
.
groupBox3
.
Visible
=
false
;
//
// listEditControl1
//
this
.
listEditControl1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
listEditControl1
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
listEditControl1
.
ListFile
=
"config/qty.list"
;
this
.
listEditControl1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
17
);
this
.
listEditControl1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
5
);
this
.
listEditControl1
.
Name
=
"listEditControl1"
;
this
.
listEditControl1
.
Size
=
new
System
.
Drawing
.
Size
(
354
,
208
);
this
.
listEditControl1
.
TabIndex
=
3
;
this
.
listEditControl1
.
DataRefresh
+=
new
System
.
EventHandler
(
this
.
listEdit_pn_DataRefresh
);
//
// txt_code
//
this
.
txt_code
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
24
);
...
...
@@ -245,36 +269,11 @@ namespace AutoScanAndLabel
//
this
.
uC_U11
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
uC_U11
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
198
);
this
.
uC_U11
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
176
);
this
.
uC_U11
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
4
);
this
.
uC_U11
.
Name
=
"uC_U11"
;
this
.
uC_U11
.
Size
=
new
System
.
Drawing
.
Size
(
678
,
150
);
this
.
uC_U11
.
Size
=
new
System
.
Drawing
.
Size
(
467
,
150
);
this
.
uC_U11
.
TabIndex
=
9
;
this
.
uC_U11
.
Visible
=
false
;
//
// listEditControl1
//
this
.
listEditControl1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
listEditControl1
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
listEditControl1
.
ListFile
=
"config/qty.list"
;
this
.
listEditControl1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
17
);
this
.
listEditControl1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
5
);
this
.
listEditControl1
.
Name
=
"listEditControl1"
;
this
.
listEditControl1
.
Size
=
new
System
.
Drawing
.
Size
(
354
,
208
);
this
.
listEditControl1
.
TabIndex
=
3
;
this
.
listEditControl1
.
DataRefresh
+=
new
System
.
EventHandler
(
this
.
listEdit_pn_DataRefresh
);
//
// listEdit_pn
//
this
.
listEdit_pn
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
listEdit_pn
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
listEdit_pn
.
ListFile
=
"config/pn.list"
;
this
.
listEdit_pn
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
17
);
this
.
listEdit_pn
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
5
);
this
.
listEdit_pn
.
Name
=
"listEdit_pn"
;
this
.
listEdit_pn
.
Size
=
new
System
.
Drawing
.
Size
(
354
,
158
);
this
.
listEdit_pn
.
TabIndex
=
3
;
this
.
listEdit_pn
.
DataRefresh
+=
new
System
.
EventHandler
(
this
.
listEdit_pn_DataRefresh
);
//
// SettingControl
//
...
...
AutoScanAndLabel/resources/NS200_Res.xlsx
0 → 100644
查看文件 @
fb13a9c
此文件类型无法预览
AutoScanAndLabel/resources/NS200自动扫码贴标机2.xlsx
deleted
100644 → 0
查看文件 @
95a3c3c
此文件类型无法预览
AutoScanAndLabel/resources/So1164自动扫码贴标机.xlsx
deleted
100644 → 0
查看文件 @
95a3c3c
此文件类型无法预览
AutoScanAndLabel/resources/en-US-1.lngres
deleted
100644 → 0
查看文件 @
95a3c3c
此文件的差异被折叠,
点击展开。
AutoScanAndLabel/resources/en-US.lngres
查看文件 @
fb13a9c
此文件的差异被折叠,
点击展开。
AutoScanAndLabel/resources/zh-CN.lngres
查看文件 @
fb13a9c
此文件的差异被折叠,
点击展开。
AutoScanAndLabel/resources/自动扫码贴标机.xlsx
deleted
100644 → 0
查看文件 @
95a3c3c
此文件类型无法预览
Common/bean/Bean.cs
查看文件 @
fb13a9c
...
...
@@ -111,6 +111,48 @@ namespace OnlineStore.Common
public
List
<
EquipMsg
>
showLogs
=
new
List
<
EquipMsg
>();
public
String
type
{
get
;
set
;
}
=
"NS200"
;
/// <summary>
/// 消息集合
/// </summary>
public
List
<
MsgInfo
>
msgList
;
}
[
Serializable
]
public
class
MsgInfo
{
/**
* 提示消息
*/
public
string
msg
=
""
;
/**
* 消息类型,INFO,WARNING,ERROR,DATA
*/
public
string
type
;
/**
* 英文提示消息
*/
public
string
msgEn
=
""
;
public
string
msgJp
=
""
;
/**
* 翻译key
*/
public
string
msgKey
=
""
;
/**
* 翻译参数
*/
public
string
[]
msgParam
;
/**
* 报警类型
*/
public
string
alarmType
=
""
;
/**
*报警错误码
*/
public
string
alarmCode
=
""
;
/**
* 模块
*/
public
string
moudle
=
""
;
}
/**
* agv日志信息
...
...
DeviceLibrary/AutoScanAndLabel/AxisBean.cs
查看文件 @
fb13a9c
...
...
@@ -274,7 +274,6 @@ namespace DeviceLibrary
}
TargetIoValue
=
value
;
TargetIoType
=
targetIo
;
IsInProcess
=
false
;
axisCheckTimer
.
Start
();
return
true
;
}
...
...
@@ -287,31 +286,22 @@ namespace DeviceLibrary
}
return
true
;
}
private
bool
IsInProcess
=
false
;
private
DateTime
lastOkTime
=
DateTime
.
Now
;
private
void
CheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
TimeSpan
pan
=
DateTime
.
Now
-
lastOkTime
;
if
(
IsInProcess
&&
pan
.
TotalMilliseconds
<
100
)
{
return
;
}
try
{
IsInProcess
=
true
;
lastOkTime
=
DateTime
.
Now
;
if
(
IOManager
.
IOValue
(
TargetIoType
).
Equals
(
TargetIoValue
))
{
SuddenStop
();
StopAxisCheckMove
();
LogUtil
.
info
(
AxisName
+
"上料轴,检测到 "
+
TargetIoType
+
"="
+
TargetIoValue
+
",停止运动"
);
SuddenStop
();
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"CheckTimer_Elapsed出错:"
,
ex
);
}
finally
{
IsInProcess
=
false
;
}
}
#
endregion
...
...
DeviceLibrary/AutoScanAndLabel/LabelParam.cs
查看文件 @
fb13a9c
...
...
@@ -103,5 +103,15 @@ namespace DeviceLibrary
return
"["
+
WareCode
+
"], ["
+
PlateW
+
"x"
+
PlateH
+
"]"
;
}
}
bool
isnglog
=
false
;
public
void
LogNgInfo
(
ServerCommunication
server
)
{
if
(!
isnglog
&&
IsNg
)
{
isnglog
=
server
.
SendNGInfo
(
NgMsg
);
}
}
}
}
DeviceLibrary/AutoScanAndLabel/MainMachine _LabelProcess.cs
查看文件 @
fb13a9c
...
...
@@ -46,10 +46,15 @@ namespace DeviceLibrary
LabelMoveInfo
.
log
(
"Label_YR转到取标点"
);
break
;
case
MoveStep
.
Lbl02_1
:
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
_WaitPrintInfo
);
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
02_2
);
Label_X_Axis
.
AbsMove
(
LabelMoveInfo
,
Config
.
Label_X_P2
,
Config
.
Label_X_P2_speed
);
LabelMoveInfo
.
log
(
"Label_X转到取标点,等待标签打印完毕"
);
break
;
case
MoveStep
.
Lbl02_2
:
//补一个空白流程, 防止提前检测到Lbl_WaitPrintInfo步骤
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitPrintInfo
);
LabelMoveInfo
.
log
(
"等待标签打印完毕"
);
break
;
case
MoveStep
.
Lbl_WaitPrintInfo
:
LabelMoveInfo
.
log
(
"等待打印标签信息"
);
break
;
...
...
@@ -111,9 +116,9 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
Lbl_PrintFail
:
if
(
labelFailReason
==
LabelFailReason
.
SuckerFailure
)
Msg
.
add
(
"标签打印失败,请检查打印机状态,关门后将自动重试"
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0129.0e13d0de"
,
"标签打印失败,请检查打印机状态,关门后将自动重试"
)
,
MsgLevel
.
alarm
);
else
if
(
labelFailReason
==
LabelFailReason
.
SuckerFailure
)
Msg
.
add
(
"标签吸取失败,请标签,关门后将自动重试"
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0130.c3836615"
,
"标签吸取失败,请检查,关门后将自动重试"
)
,
MsgLevel
.
alarm
);
if
(
IOValue
(
IO_Type
.
LeftBackDoor_Check
).
Equals
(
IO_VALUE
.
LOW
)
||
IOValue
(
IO_Type
.
RightBackDoor_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_PrintFail_02
);
...
...
@@ -122,9 +127,9 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
Lbl_PrintFail_02
:
if
(
labelFailReason
==
LabelFailReason
.
SuckerFailure
)
Msg
.
add
(
"标签打印失败,请检查打印机状态,关门后将自动重试"
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0129.0e13d0de"
,
"标签打印失败,请检查打印机状态,关门后将自动重试"
),
MsgLevel
.
warning
);
else
if
(
labelFailReason
==
LabelFailReason
.
SuckerFailure
)
Msg
.
add
(
"标签吸取失败,请标签,关门后将自动重试"
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0130.c3836615"
,
"标签吸取失败,请检查,关门后将自动重试"
),
MsgLevel
.
warning
);
if
(
IOValue
(
IO_Type
.
LeftBackDoor_Check
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
RightBackDoor_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_PrintLabel
);
...
...
@@ -165,6 +170,7 @@ namespace DeviceLibrary
if
(
IsLabelLeave
)
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl10
);
CurrentPrintInfo
=
null
;
LabelMoveInfo
.
log
(
"标签已经被取走"
);
}
else
...
...
@@ -184,7 +190,8 @@ namespace DeviceLibrary
}
if
(
LabelMoveInfo
.
MoveParam
.
codeInfos
==
null
||
LabelMoveInfo
.
MoveParam
.
codeInfos
.
Count
==
0
)
{
break
;
LabelMoveInfo
.
log
(
"没有贴标信息"
);
return
;
}
Point
p
=
new
Point
(
LabelMoveInfo
.
MoveParam
.
codeInfos
[
0
].
X
,
LabelMoveInfo
.
MoveParam
.
codeInfos
[
0
].
X
);
int
labelAngle
=
0
;
...
...
@@ -321,7 +328,7 @@ namespace DeviceLibrary
{
state
+=
crc
.
GetString
(
"Res0072"
,
"标签已打印,当前ReelID:"
)
+
LabelMoveInfo
.
MoveParam
.
WareCode
;
}
if
(
LabelMoveInfo
.
MoveStep
==
MoveStep
.
Lbl_WaitPrint
)
if
(
LabelMoveInfo
.
MoveStep
==
MoveStep
.
Lbl_WaitPrint
Info
)
{
state
+=
crc
.
GetString
(
"Res0073"
,
"等待标签打印"
);
}
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _LedProcess.cs
查看文件 @
fb13a9c
...
...
@@ -28,11 +28,12 @@ namespace DeviceLibrary
RightLed
.
LedState
=
LedState
.
off
;
LeftLed
.
LedState
=
LedState
.
off
;
//无法运行,量报警灯
if
(!
canRunning
)
if
(!
canRunning
||
IsAlarm
)
{
AlarmLed
.
LedState
=
LedState
.
on
;
}
else
AlarmLed
.
LedState
=
LedState
.
off
;
//所有过程都在运动,闪烁运行中灯
//if (!RightMoveInfo.IsStep(MoveStep.Wait)
// || !LeftMoveInfo.IsStep(MoveStep.Wait)
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _MiddleProcess.cs
查看文件 @
fb13a9c
...
...
@@ -123,11 +123,12 @@ namespace DeviceLibrary
{
if
(
true
||
clampTool
.
IsClamp
())
{
if
(!
LabelMoveInfo
.
IsStep
(
MoveStep
.
Lbl_WaitPrintInfo
))
{
if
(!
LabelMoveInfo
.
IsStep
(
MoveStep
.
Lbl_WaitPrintInfo
))
{
MiddleMoveInfo
.
log
(
"等待贴标流程空闲"
);
return
;
}
MiddleMoveInfo
.
NextMoveStep
(
MoveStep
.
M08
);
CurrentPrintInfo
=
MiddleMoveInfo
.
MoveParam
.
clone
();
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_PrintLabel
);
Take_Middle_Axis
.
AbsMove
(
MiddleMoveInfo
,
Config
.
Take_Middle_P3
,
Config
.
Take_Middle_P3_speed
);
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _RightProcess.cs
查看文件 @
fb13a9c
...
...
@@ -88,7 +88,9 @@ namespace DeviceLibrary
{
RightMoveInfo
.
log
(
$
"未识别到有效二维码,转入NG箱;pointX={pointX};pointY={pointY}"
);
RightMoveInfo
.
MoveParam
.
IsNg
=
true
;
ServerCM
.
SendNGInfo
(
crc
.
GetString
(
"Res0128.e5d9ef10"
,
"模版匹配失败"
));
UnifiedDataHandler
.
RecordPrintNg
(
false
,
false
,
out
string
[]
strarrys
);
}
else
{
...
...
@@ -280,15 +282,6 @@ namespace DeviceLibrary
Dictionary
<
string
,
int
>
newpointangle
;
int
plantw
=
GetTrayWidth
();
(
LastCodeList
,
keyword
,
filename
,
newpointangle
)
=
CodeManager
.
CameraScan
(
new
List
<
string
>
{
Config
.
RightCameraName
},
plantw
);
//LabelParam labelParam = new LabelParam();
//labelParam.codeInfos = new List<CodeInfo>(LastCodeList);
//if (!Common.codeProcess(labelParam, out _))
//{
// Task.Delay(500).Wait();
// (LastCodeList2, keyword, filename) = CodeManager.CameraScan(new List<string> { Config.RightCameraName });
// LastCodeList.AddRange(LastCodeList2);
//}
//IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
return
(
LastCodeList
,
keyword
,
filename
,
newpointangle
);
}));
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine.cs
查看文件 @
fb13a9c
...
...
@@ -216,6 +216,7 @@ namespace DeviceLibrary
}
}
LogUtil
.
info
(
"主线程已退出."
);
RobotManage
.
isRunning
=
false
;
}
public
void
Stop
()
{
...
...
@@ -254,7 +255,8 @@ namespace DeviceLibrary
ResetMoveInfo
.
log
(
"正在回原"
);
SafeReleaseLeftShelf
=
false
;
Label_Z_Axis
.
HomeMove
(
ResetMoveInfo
);
clampTool
.
HomeReset
();
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
HIGH
);
break
;
case
MoveStep
.
H02_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H03_HomeReset
);
...
...
@@ -325,6 +327,17 @@ namespace DeviceLibrary
MiddleMoveInfo
.
NewMove
(
MoveStep
.
M_Standby
);
LabelMoveInfo
.
NewMove
(
MoveStep
.
Lbl01
);
if
(
clampTool
.
IsClamp
())
{
MiddleMoveInfo
.
NextMoveStep
(
MoveStep
.
M20_ToNgBox
);
MiddleMoveInfo
.
log
(
"复位时残留NG物料"
);
}
else
{
clampTool
.
HomeReset
();
//clampTool.Release();
}
runStatus
=
RunStatus
.
Running
;
break
;
}
...
...
@@ -350,7 +363,7 @@ namespace DeviceLibrary
bool
ok
=
true
;
if
(
UserPause
)
{
Msg
.
add
(
crc
.
GetString
(
"Res0057"
,
"用户暂停"
),
MsgLevel
.
warning
);
DeviceSuddenStop
();
ok
=
false
;
}
...
...
@@ -363,7 +376,7 @@ namespace DeviceLibrary
ok
=
false
;
DeviceSuddenStop
();
}
Msg
.
add
(
crc
.
GetString
(
"Res0058"
,
"安全光栅被遮挡"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0058"
,
"安全光栅被遮挡"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
alarm
);
}
if
(
IOValue
(
IO_Type
.
HasNgBox
).
Equals
(
IO_VALUE
.
LOW
))
{
...
...
@@ -377,12 +390,12 @@ namespace DeviceLibrary
//}
if
(
IOValue
(
IO_Type
.
LeftBackDoor_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
if
(!
IgnoreSafecheck
)
if
(!
IgnoreSafecheck
&&
!
LabelMoveInfo
.
IsStep
(
MoveStep
.
Lbl_PrintFail
)
)
{
ok
=
false
;
DeviceSuddenStop
();
}
Msg
.
add
(
crc
.
GetString
(
"Res0064"
,
"左后门没有关闭"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0064"
,
"左后门没有关闭"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
alarm
);
}
if
(
Config
.
DIList
.
ContainsKey
(
IO_Type
.
RightBackDoor_Check
))
{
...
...
@@ -393,7 +406,7 @@ namespace DeviceLibrary
ok
=
false
;
DeviceSuddenStop
();
}
Msg
.
add
(
crc
.
GetString
(
"Res0065"
,
"右后门没有关闭"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0065"
,
"右后门没有关闭"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
alarm
);
}
}
...
...
@@ -464,7 +477,7 @@ namespace DeviceLibrary
{
TimeSpan
span
=
DateTime
.
Now
-
checkAlarmTime
;
//在回原点,复位,出入库时,检测报警间隔减小
if
(
(!
runStatus
.
Equals
(
RunStatus
.
Stop
)
&&
span
.
TotalSeconds
>
3
)
||
span
.
TotalSeconds
>
1
)
if
(
!
runStatus
.
Equals
(
RunStatus
.
Stop
)
)
{
foreach
(
ConfigMoveAxis
configMoveAxis
in
Config
.
moveAxisList
)
{
...
...
DeviceLibrary/AutoScanAndLabel/MoveStep.cs
查看文件 @
fb13a9c
...
...
@@ -106,6 +106,7 @@ namespace DeviceLibrary
Lbl01
,
Lbl02
,
Lbl02_1
,
Lbl02_2
,
Lbl_WaitPrintInfo
,
Lbl_PrintLabel
,
Lbl03
,
...
...
DeviceLibrary/AutoScanAndLabel/RobotManage.cs
查看文件 @
fb13a9c
...
...
@@ -121,7 +121,7 @@ namespace DeviceLibrary
mainMachine
?.
ServerCM
?.
StopConnectServer
();
mainMachine
?.
Stop
();
mainMachine
.
UserPause
=
false
;
isRunning
=
false
;
}
}
...
...
@@ -174,6 +174,7 @@ namespace DeviceLibrary
LogUtil
.
info
(
"用户暂停"
);
else
LogUtil
.
info
(
"系统暂停: "
+
msg
);
Msg
.
add
(
crc
.
GetString
(
"Res0057"
,
"用户暂停"
),
MsgLevel
.
warning
);
}
else
LogUtil
.
info
(
"用户取消暂停:"
+
msg
);
...
...
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
fb13a9c
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -100,12 +99,12 @@ namespace DeviceLibrary
{
Camera
.
_cam
.
CloseAll
();
}
string
camname
=
"普通相机"
;
string
camname
=
$
"普通相机"
;
CameraType
cameraType
=
CameraType
.
HIK
;
if
(
iscode
)
{
cameraType
=
CameraType
.
HIKIDMVS
;
camname
=
"扫码相机"
;
camname
=
$
"扫码相机"
;
}
Camera
.
Type
=
cameraType
;
Camera
.
_cam
.
Load
();
...
...
@@ -188,7 +187,9 @@ namespace DeviceLibrary
{
if
(
codes
.
Count
==
0
)
{
throw
new
FileNotFoundException
(
"扫码相机未扫描到任何条码!"
);
//throw new FileNotFoundException("扫码相机未扫描到任何条码!");
LogUtil
.
error
(
"扫码相机未扫描到任何条码!"
);
return
(
codeList
,
keyword
,
bitmapfilename
,
newpointanlge
);
}
LogUtil
.
info
(
$
"开始请求ns100服务:识别条码为:{string.Join("
##
", codes.Select(a=>a.CodeStr+$"
@
@x
:{
a
.
X
};
y
:{
a
.
Y
};
角度
{
a
.
Orientation
}
"))}"
);
...
...
DeviceLibrary/DeviceLibrary/PrinterHelper.cs
查看文件 @
fb13a9c
using
Asa
;
using
Asa
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.Common.util
;
...
...
@@ -114,7 +114,7 @@ namespace DeviceLibrary
var
bmp
=
print
.
PrintPreview
(
data
);
if
(!
zebraManger
.
PrintImage
(
bmp
,
out
msg
))
{
if
(
msg
==
"上一个标签尚未移走"
)
if
(
msg
==
crc
.
GetString
(
"Res0224"
,
"上一个标签尚未移走"
)
)
{
msg
=
crc
.
GetString
(
"Res0224"
,
"上一个标签尚未移走"
);
}
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
fb13a9c
...
...
@@ -16,6 +16,7 @@ using System.Text;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
static
System
.
Net
.
WebRequestMethods
;
using
static
System
.
Windows
.
Forms
.
VisualStyles
.
VisualStyleElement
.
TrackBar
;
namespace
DeviceLibrary
...
...
@@ -56,6 +57,10 @@ namespace DeviceLibrary
{
if
(!
server
.
StartsWith
(
"http"
))
return
;
if
(!
RobotManage
.
isRunning
)
return
;
SendLineStatus
();
}
...
...
@@ -141,12 +146,12 @@ namespace DeviceLibrary
}
else
if
(!
RobotManage
.
isRunning
)
{
sendmsg
=
crc
.
GetString
(
"Res0001"
,
"设备未启动"
);
sendmsg
=
"I="
+
crc
.
GetString
(
"Res0127.a5affabf"
,
"设备未启动"
);
}
lineOperation
.
msg
=
sendmsg
;
lineOperation
.
msg
=
lineOperation
.
msg
.
Trim
().
Trim
(
','
);
boxStatus
.
msg
=
lineOperation
.
msg
;
//
boxStatus.msg = lineOperation.msg;
lineOperation
.
msgEn
=
lineOperation
.
msg
;
lineOperation
.
msgJp
=
lineOperation
.
msg
;
...
...
@@ -472,6 +477,52 @@ namespace DeviceLibrary
}
return
equipMsgs
;
}
public
bool
SendNGInfo
(
string
ngmsg
)
{
lock
(
serverclock
)
{
try
{
Operation
operation
=
getLineBoxStatus
();
operation
.
msgList
=
new
List
<
MsgInfo
>
{
new
MsgInfo
{
moudle
=
"NG"
,
type
=
"WARNING"
,
msg
=
ngmsg
}
};
//operation.boxStatus[StoreID].status = (int)storeStatus;
//LogUtil.Log.Info(JsonHelper.SerializeObject(operation));
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
operation
,
5000
);
if
(
resultOperation
==
null
)
{
LogUtil
.
error
(
$
"SendNGInfo error,ngmsg={ngmsg}"
);
return
false
;
}
if
(
operation
.
seq
!=
resultOperation
.
seq
)
{
LogUtil
.
error
(
$
"SendNGInfo seq error,ngmsg={ngmsg},cseq={operation.seq},rseq={resultOperation.seq}"
);
return
false
;
}
LogUtil
.
info
(
$
"SendNGInfo success,ngmsg={ngmsg}"
);
ResultProcess
(
resultOperation
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
$
"SendNGInfo error:{ngmsg}"
,
ex
);
}
}
return
true
;
}
}
public
class
ResultData
{
...
...
@@ -549,4 +600,5 @@ namespace DeviceLibrary
InStoreError
=
14
,
}
}
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论