Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO1196_X800
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit dce86849
由
刘韬
编写于
2024-12-14 22:13:10 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
88ad6acf
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
55 行增加
和
9 行删除
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary/databaseProc.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Counting.cs
DeviceLibrary/theMachine/MainMachine_OutMove.cs
TheMachine/Program.cs
TheMachine/SettingControl.Designer.cs
TheMachine/SettingControl.cs
Common/Setting_Init.cs
查看文件 @
dce8684
...
...
@@ -34,6 +34,9 @@ namespace OnlineStore.Common
[
MyConfigComment
(
"是否必须包含PN"
)]
public
static
MyConfig
<
bool
>
Device_MustHavePN
=
false
;
[
MyConfigComment
(
"跳过贴标流程"
)]
public
static
MyConfig
<
bool
>
Device_Disable_labelling
=
false
;
[
MyConfigComment
(
"X高压端口"
)]
public
static
MyConfig
<
string
>
XRay_Port
=
"http://192.168.1.4:50001"
;
...
...
DeviceLibrary/DeviceLibrary/databaseProc.cs
查看文件 @
dce8684
...
...
@@ -78,6 +78,11 @@ CREATE TABLE ""ReelInfo"" (
sql
=
"alter table ReelInfo add column resultimage TEXT;"
;
sh
.
ExecuteNonQuery
(
sql
);
}
if
(!
sc
.
Contains
(
"algo TEXT"
))
{
sql
=
"alter table ReelInfo add column algo TEXT;"
;
sh
.
ExecuteNonQuery
(
sql
);
}
}
}
...
...
@@ -126,7 +131,12 @@ id =@id";
sh
.
ExecuteNonQuery
(
sql
,
para
);
}
}
public
void
DeleteDataByDate
(
int
day
)
{
string
sql
=
"DELETE FROM ReelInfo WHERE DateTime < date('now', '-"
+
day
+
" days');"
;
SQLiteParameter
[]
para
=
new
SQLiteParameter
[]
{
};
sh
.
ExecuteNonQuery
(
sql
,
para
);
}
public
void
InsertLog
(
string
device
,
string
action
,
object
state
,
string
log
=
""
)
{
string
sql
=
"INSERT INTO ReelInfo VALUES(NULL, @device,@action, @state, @log,@datetime,NULL)"
;
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
dce8684
...
...
@@ -338,7 +338,7 @@ namespace DeviceLibrary
case
MoveStep
.
H01_HomeReset
:
ServerCM
.
storeStatus
=
StoreStatus
.
ResetMove
;
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
lastReeID
=
""
;
if
(
IOValue
(
IO_Type
.
Loading_Car_Check2
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
Loading_Car_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
Loading_Car1315_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
...
...
DeviceLibrary/theMachine/MainMachine_Counting.cs
查看文件 @
dce8684
...
...
@@ -23,6 +23,7 @@ namespace DeviceLibrary
Task
GetResultTask
=
null
;
Dictionary
<
string
,
int
>
CountList
=
new
Dictionary
<
string
,
int
>();
int
xrayimageretry
=
0
;
string
lastReeID
=
""
;
void
CountingMoveProcess
()
{
if
(
CheckWait
(
CountMoveInfo
))
...
...
@@ -155,6 +156,13 @@ namespace DeviceLibrary
if
(
string
.
IsNullOrWhiteSpace
(
CountMoveInfo
.
MoveParam
.
WareCode
))
CountMoveInfo
.
MoveParam
.
WareCode
=
CountMoveInfo
.
MoveParam
.
codeInfos
.
Where
(
c
=>
Regex
.
IsMatch
(
c
.
CodeStr
,
@"^S[2-3]0"
)).
FirstOrDefault
().
CodeStr
;
CountMoveInfo
.
MoveParam
.
ReeID
=
CountMoveInfo
.
MoveParam
.
WareCode
;
if
(
lastReeID
==
CountMoveInfo
.
MoveParam
.
ReeID
)
{
CountMoveInfo
.
log
(
"唯一码与上一盘料出现重复,请检查"
);
Msg
.
add
(
"唯一码与上一盘料出现重复,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"唯一码与上一盘料出现重复"
);
}
lastReeID
=
CountMoveInfo
.
MoveParam
.
ReeID
;
CountMoveInfo
.
MoveParam
.
PN
=
CountMoveInfo
.
MoveParam
.
codeInfos
.
Where
(
c
=>
c
.
CodeStr
.
StartsWith
(
"AT"
)).
FirstOrDefault
()?.
CodeStr
;
if
(
string
.
IsNullOrWhiteSpace
(
CountMoveInfo
.
MoveParam
.
PN
))
{
var
hc
=
CountMoveInfo
.
MoveParam
.
codeInfos
.
Where
(
c
=>
Regex
.
IsMatch
(
c
.
CodeStr
,
@"(?:@@|-)(AT\w*)(?:@@|-)"
)).
FirstOrDefault
()?.
CodeStr
;
...
...
DeviceLibrary/theMachine/MainMachine_OutMove.cs
查看文件 @
dce8684
...
...
@@ -5,6 +5,7 @@ using OnlineStore.Common;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics.Eventing.Reader
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -157,8 +158,14 @@ namespace DeviceLibrary
CountList
.
Remove
(
OutMoveInfo
.
MoveParam
.
ReeID
);
}
if
(
OutMoveInfo
.
MoveParam
.
QTY
>
0
)
{
if
(
Setting_Init
.
Device_Disable_labelling
)
OutMoveInfo
.
log
(
$
"已禁用贴标,不打印标签"
);
else
SetPrintJob
(
OutMoveInfo
);
else
{
}
else
{
OutMoveInfo
.
MoveParam
.
IsNg
=
true
;
OutMoveInfo
.
MoveParam
.
NgMsg
=
"点料结果为0"
;
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_20
);
...
...
@@ -181,9 +188,7 @@ namespace DeviceLibrary
{
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_20
);
}
break
;
case
MoveStep
.
Out_20
:
if
(
OutMoveInfo
.
MoveParam
.
IsNg
)
{
...
...
@@ -199,7 +204,6 @@ namespace DeviceLibrary
Unloading_Middle_Axis
.
AbsMove
(
OutMoveInfo
,
OutToPos
.
Middle_P2
,
Config
.
Unloading_Middle_Axis_P1_speed
);
Unloading_UpDown_Axis
.
AbsMove
(
OutMoveInfo
,
OutToPos
.
UpDown_P2
,
Config
.
Unloading_UpDown_Axis_P1_speed
);
OutMoveInfo
.
log
(
$
"旋转轴,升降轴到达p2点NG"
);
}
}
else
if
(
OutCarMoveInfo
.
MoveStep
==
MoveStep
.
OutCarReadyPut
&&
(
InCarType
==
OutCarType
||
InCarType
==
CarTypeE
.
None
))
...
...
@@ -234,8 +238,6 @@ namespace DeviceLibrary
pos1
=
0
;
Unloading_UpDown_Axis
.
AbsMove
(
OutMoveInfo
,
pos1
,
Config
.
Unloading_UpDown_Axis_P1_speed
);
OutMoveInfo
.
log
(
$
"升降轴到达放料p3点,pos:{pos1},PlateH:{OutMoveInfo.MoveParam.PlateH}"
);
//Unloading_UpDown_Axis.AbsMove(OutMoveInfo, OutToPos.UpDown_P3, Config.Unloading_UpDown_Axis_P1_speed);
//OutMoveInfo.log($"升降轴到达p3点");
break
;
case
MoveStep
.
Out_23
:
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_24
);
...
...
@@ -293,6 +295,12 @@ namespace DeviceLibrary
OutMoveInfo
.
log
(
$
"批量轴慢速上升到检测点亮,当前位置:{Unloading_Batch_Axis.GetAclPosition()},控制上升:{OutMoveInfo.MoveParam.PlateH},{target}"
);
break
;
case
MoveStep
.
Out_31
:
if
(
Setting_Init
.
Device_Disable_labelling
)
{
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_LabelFinished
);
OutMoveInfo
.
log
(
"已跳过贴标"
);
}
else
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_WaitForLabel
);
break
;
case
MoveStep
.
Out_WaitForLabel
:
...
...
TheMachine/Program.cs
查看文件 @
dce8684
...
...
@@ -7,6 +7,7 @@ using System.Collections.Generic;
using
System.Diagnostics
;
using
System.Drawing
;
using
System.Drawing.Drawing2D
;
using
System.IO
;
using
System.Linq
;
using
System.Runtime.InteropServices
;
using
System.Threading
;
...
...
@@ -84,10 +85,11 @@ namespace TheMachine
Environment
.
CurrentDirectory
=
Application
.
StartupPath
;
XmlConfigurator
.
Configure
();
var
pn
=
ServerCommunication
.
GetPnByReelid
(
"123"
);
//
var pn = ServerCommunication.GetPnByReelid("123");
//var pn= ServerCommunication.GetPnByReelid("S202306181351530002");
//LogUtil.info(pn);
//return;
CommonLib
.
DeleteOverDayFile
(
Path
.
Combine
(
CommonLib
.
AppPathRoot
,
"image"
),
"*.*"
,
30
);
Application
.
EnableVisualStyles
();
Application
.
SetCompatibleTextRenderingDefault
(
false
);
Application
.
Run
(
new
Form1
());
...
...
TheMachine/SettingControl.Designer.cs
查看文件 @
dce8684
...
...
@@ -44,6 +44,7 @@ namespace TheMachine
this
.
btn_openxray
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
uC_SetUserPassword1
=
new
TheMachine
.
UC_SetUserPassword
();
this
.
cb_musthavepn
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
cb_disablelabelling
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
groupBox1
.
SuspendLayout
();
this
.
X
光调试
.
SuspendLayout
();
this
.
SuspendLayout
();
...
...
@@ -203,6 +204,17 @@ namespace TheMachine
this
.
cb_musthavepn
.
UseVisualStyleBackColor
=
true
;
this
.
cb_musthavepn
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
cb_EnableBuzzer_CheckedChanged
);
//
// cb_disablelabelling
//
this
.
cb_disablelabelling
.
AutoSize
=
true
;
this
.
cb_disablelabelling
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
100
);
this
.
cb_disablelabelling
.
Name
=
"cb_disablelabelling"
;
this
.
cb_disablelabelling
.
Size
=
new
System
.
Drawing
.
Size
(
96
,
16
);
this
.
cb_disablelabelling
.
TabIndex
=
9
;
this
.
cb_disablelabelling
.
Text
=
"跳过贴标流程"
;
this
.
cb_disablelabelling
.
UseVisualStyleBackColor
=
true
;
this
.
cb_disablelabelling
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
cb_EnableBuzzer_CheckedChanged
);
//
// SettingControl
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
...
@@ -210,6 +222,7 @@ namespace TheMachine
this
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
Controls
.
Add
(
this
.
uC_SetUserPassword1
);
this
.
Controls
.
Add
(
this
.
cb_autorun
);
this
.
Controls
.
Add
(
this
.
cb_disablelabelling
);
this
.
Controls
.
Add
(
this
.
cb_musthavepn
);
this
.
Controls
.
Add
(
this
.
cb_EnableBuzzer
);
this
.
Name
=
"SettingControl"
;
...
...
@@ -238,5 +251,6 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
Button
btn_printertest
;
private
System
.
Windows
.
Forms
.
Button
buttonmunial
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_musthavepn
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_disablelabelling
;
}
}
TheMachine/SettingControl.cs
查看文件 @
dce8684
...
...
@@ -71,6 +71,7 @@ namespace TheMachine
Config
.
PropertyBind
(
Setting_Init
.
Printer_Labelname
.
Key
,
cb_labelselect
,
"SelectedItem"
,
"SelectedValueChanged"
);
Config
.
PropertyBind
(
Setting_Init
.
App_AutoRun
.
Key
,
cb_autorun
,
"Checked"
,
"CheckedChanged"
,
false
);
Config
.
PropertyBind
(
Setting_Init
.
Device_MustHavePN
.
Key
,
cb_musthavepn
,
"Checked"
,
"CheckedChanged"
,
false
);
Config
.
PropertyBind
(
Setting_Init
.
Device_Disable_labelling
.
Key
,
cb_disablelabelling
,
"Checked"
,
"CheckedChanged"
,
false
);
this
.
cb_autorun
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
cb_autorun_CheckedChanged
);
loadlabellist
();
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论