Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d5f8f28c
由
LN
编写于
2021-04-15 15:25:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
去掉记录保存的注释
1 个父辈
8acb1138
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
75 行增加
和
93 行删除
DeviceLibrary/SQLite.cs
DeviceLibrary/manager/WorkInfo.cs
DeviceLibrary/mes/DeviceStatus.cs
DeviceLibrary/mes/MesUtil.cs
TSA-V/App.config
TSA-V/workForm/FrmTSAV.cs
DeviceLibrary/SQLite.cs
查看文件 @
d5f8f28
...
@@ -114,10 +114,13 @@ namespace DAL
...
@@ -114,10 +114,13 @@ namespace DAL
rtn
=
Execute
(
sql
);
rtn
=
Execute
(
sql
);
if
(!
rtn
)
break
;
if
(!
rtn
)
break
;
}
}
LogUtil
.
info
(
"数据库Commit"
);
if
(
rtn
)
if
(
rtn
)
tr
.
Commit
();
tr
.
Commit
();
else
else
tr
.
Rollback
();
tr
.
Rollback
();
LogUtil
.
info
(
"数据库 完成"
);
}
}
return
rtn
;
return
rtn
;
...
...
DeviceLibrary/manager/WorkInfo.cs
查看文件 @
d5f8f28
...
@@ -98,12 +98,12 @@ namespace TSA_V.DeviceLibrary
...
@@ -98,12 +98,12 @@ namespace TSA_V.DeviceLibrary
MesUtil
.
SendStatus
(
deviceStatus
);
MesUtil
.
SendStatus
(
deviceStatus
);
}
}
deviceStatus
.
workInfo
.
ID
=
LastDBId
;
deviceStatus
.
workInfo
.
ID
=
LastDBId
;
//
DB.db.AddHistory(deviceStatus.workInfo, out int id);
DB
.
db
.
AddHistory
(
deviceStatus
.
workInfo
,
out
int
id
);
//
if (LastDBId < 0)
if
(
LastDBId
<
0
)
//
{
{
//
LastDBId = id;
LastDBId
=
id
;
//
LogUtil.info("保存LastDBId=" + LastDBId);
LogUtil
.
info
(
"保存LastDBId="
+
LastDBId
);
//
}
}
if
(
currBoard
!=
null
)
if
(
currBoard
!=
null
)
{
{
LogUtil
.
info
(
"停止程序【"
+
currBoard
.
boardName
+
"】工作"
);
LogUtil
.
info
(
"停止程序【"
+
currBoard
.
boardName
+
"】工作"
);
...
@@ -111,11 +111,13 @@ namespace TSA_V.DeviceLibrary
...
@@ -111,11 +111,13 @@ namespace TSA_V.DeviceLibrary
//把上次的旋转轴转回待机点
//把上次的旋转轴转回待机点
if
(
this
.
WorkType
.
Equals
(
1
)
&&
PreNodeId
>
0
)
if
(
this
.
WorkType
.
Equals
(
1
)
&&
PreNodeId
>
0
)
{
{
PUSICANControl
.
StopMove
(
PreNodeId
);
Thread
.
Sleep
(
10
);
//上一个节点返回原点
//上一个节点返回原点
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
Thread
.
Sleep
(
10
);
Thread
.
Sleep
(
10
);
}
}
Thread
.
Sleep
(
100
);
//
Thread.Sleep(100);
endWorkTime
=
DateTime
.
Now
;
endWorkTime
=
DateTime
.
Now
;
IsShowAOI
=
false
;
IsShowAOI
=
false
;
IsWorking
=
false
;
IsWorking
=
false
;
...
...
DeviceLibrary/mes/DeviceStatus.cs
查看文件 @
d5f8f28
...
@@ -58,6 +58,33 @@ namespace TSA_V.DeviceLibrary
...
@@ -58,6 +58,33 @@ namespace TSA_V.DeviceLibrary
/// 组装元器件列表
/// 组装元器件列表
/// </summary>
/// </summary>
public
List
<
OpPointInfo
>
pointList
{
get
;
set
;
}
public
List
<
OpPointInfo
>
pointList
{
get
;
set
;
}
public
static
OpInfo
GetOpInfo
(
BoardInfo
board
,
int
maxIndex
=
-
1
)
{
//maxIndex=-1,没有oplist
OpInfo
op
=
new
OpInfo
();
op
.
ProName
=
board
.
boardName
;
op
.
ProType
=
board
.
boardCode
;
op
.
BoardWidth
=
board
.
boardWidth
;
op
.
BoardLength
=
board
.
boardLength
;
op
.
pointList
=
new
List
<
OpPointInfo
>();
if
(
maxIndex
>
0
)
{
int
index
=
0
;
foreach
(
SMTPointInfo
sm
in
board
.
smtList
)
{
if
(
maxIndex
>
0
&&
index
>
maxIndex
)
{
break
;
}
op
.
pointList
.
Add
(
new
OpPointInfo
(
sm
.
PartNum
,
sm
.
pointName
));
index
++;
}
}
return
op
;
}
}
}
public
class
OpPointInfo
public
class
OpPointInfo
...
...
DeviceLibrary/mes/MesUtil.cs
查看文件 @
d5f8f28
...
@@ -123,47 +123,20 @@ namespace TSA_V.DeviceLibrary
...
@@ -123,47 +123,20 @@ namespace TSA_V.DeviceLibrary
public
static
OpInfo
GetWorkInfo
()
public
static
OpInfo
GetWorkInfo
()
{
{
OpInfo
op
=
new
OpInfo
();
OpInfo
op
=
new
OpInfo
();
if
(
TSAVBean
.
Work
.
IsWorking
)
if
(
TSAVBean
.
Work
.
IsWorking
)
{
{
BoardInfo
board
=
TSAVBean
.
Work
.
currBoard
;
op
=
OpInfo
.
GetOpInfo
(
TSAVBean
.
Work
.
currBoard
,
TSAVBean
.
Work
.
currIndex
);
op
.
ProName
=
board
.
boardName
;
op
.
ProType
=
board
.
boardCode
;
if
(
CodeISOk
)
{
op
.
BarCode
=
CurrPCBCode
;
op
.
AoiResult
=
CurrAOIResult
;
}
op
.
BoardWidth
=
board
.
boardWidth
;
op
.
BoardLength
=
board
.
boardLength
;
op
.
pointList
=
new
List
<
OpPointInfo
>();
int
index
=
0
;
foreach
(
SMTPointInfo
sm
in
board
.
smtList
)
{
if
(
index
>
TSAVBean
.
Work
.
currIndex
)
{
break
;
}
op
.
pointList
.
Add
(
new
OpPointInfo
(
sm
.
PartNum
,
sm
.
pointName
));
index
++;
}
}
}
else
if
(
TSAVBean
.
LineStep
.
moveType
.
Equals
(
1
))
else
if
(
TSAVBean
.
LineStep
.
moveType
.
Equals
(
1
))
{
{
op
=
OpInfo
.
GetOpInfo
(
TSAVBean
.
Work
.
currBoard
);
BoardInfo
board
=
TSAVBean
.
Work
.
currBoard
;
}
op
.
ProName
=
board
.
boardName
;
if
(
CodeISOk
)
op
.
ProType
=
board
.
boardCode
;
{
if
(
CodeISOk
)
op
.
BarCode
=
CurrPCBCode
;
{
op
.
AoiResult
=
CurrAOIResult
;
op
.
BarCode
=
CurrPCBCode
;
op
.
AoiResult
=
CurrAOIResult
;
}
op
.
BoardWidth
=
board
.
boardWidth
;
op
.
BoardLength
=
board
.
boardLength
;
op
.
pointList
=
new
List
<
OpPointInfo
>();
}
}
return
op
;
return
op
;
}
}
...
@@ -176,43 +149,14 @@ namespace TSA_V.DeviceLibrary
...
@@ -176,43 +149,14 @@ namespace TSA_V.DeviceLibrary
if
(
TSAVBean
.
Work
.
IsWorking
)
if
(
TSAVBean
.
Work
.
IsWorking
)
{
{
deviceStatus
.
CurrStatus
=
3
;
deviceStatus
.
CurrStatus
=
3
;
BoardInfo
board
=
TSAVBean
.
Work
.
currBoard
;
op
=
OpInfo
.
GetOpInfo
(
TSAVBean
.
Work
.
currBoard
,
TSAVBean
.
Work
.
currIndex
);
op
.
ProName
=
board
.
boardName
;
op
.
ProType
=
board
.
boardCode
;
if
(
CodeISOk
)
{
op
.
BarCode
=
CurrPCBCode
;
op
.
AoiResult
=
CurrAOIResult
;
}
op
.
BoardWidth
=
board
.
boardWidth
;
op
.
BoardLength
=
board
.
boardLength
;
op
.
pointList
=
new
List
<
OpPointInfo
>();
int
index
=
0
;
foreach
(
SMTPointInfo
sm
in
board
.
smtList
)
{
if
(
index
>
TSAVBean
.
Work
.
currIndex
)
{
break
;
}
op
.
pointList
.
Add
(
new
OpPointInfo
(
sm
.
PartNum
,
sm
.
pointName
));
index
++;
}
}
}
else
if
(
TSAVBean
.
LineStep
.
moveType
.
Equals
(
1
))
else
if
(
TSAVBean
.
LineStep
.
moveType
.
Equals
(
1
))
{
{
deviceStatus
.
CurrStatus
=
3
;
deviceStatus
.
CurrStatus
=
3
;
BoardInfo
board
=
TSAVBean
.
Work
.
currBoard
;
op
=
OpInfo
.
GetOpInfo
(
TSAVBean
.
Work
.
currBoard
);
op
.
ProName
=
board
.
boardName
;
op
.
ProType
=
board
.
boardCode
;
if
(
CodeISOk
)
{
op
.
BarCode
=
CurrPCBCode
;
op
.
AoiResult
=
CurrAOIResult
;
}
op
.
BoardWidth
=
board
.
boardWidth
;
op
.
BoardLength
=
board
.
boardLength
;
op
.
pointList
=
new
List
<
OpPointInfo
>();
}
}
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Reset
))
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Reset
))
{
{
...
@@ -222,7 +166,11 @@ namespace TSA_V.DeviceLibrary
...
@@ -222,7 +166,11 @@ namespace TSA_V.DeviceLibrary
{
{
deviceStatus
.
CurrStatus
=
2
;
deviceStatus
.
CurrStatus
=
2
;
}
}
if
(
CodeISOk
)
{
op
.
BarCode
=
CurrPCBCode
;
op
.
AoiResult
=
CurrAOIResult
;
}
deviceStatus
.
workInfo
=
op
;
deviceStatus
.
workInfo
=
op
;
deviceStatus
.
WarnMsg
=
TSAVBean
.
WarnMsg
;
deviceStatus
.
WarnMsg
=
TSAVBean
.
WarnMsg
;
string
msg
=
JsonHelper
.
SerializeObject
(
deviceStatus
);
string
msg
=
JsonHelper
.
SerializeObject
(
deviceStatus
);
...
@@ -232,20 +180,20 @@ namespace TSA_V.DeviceLibrary
...
@@ -232,20 +180,20 @@ namespace TSA_V.DeviceLibrary
public
static
DeviceStatus
GetTestStatus
(
BoardInfo
board
,
string
pcbcode
=
""
)
public
static
DeviceStatus
GetTestStatus
(
BoardInfo
board
,
string
pcbcode
=
""
)
{
{
DeviceStatus
deviceStatus
=
new
DeviceStatus
();
DeviceStatus
deviceStatus
=
new
DeviceStatus
();
OpInfo
op
=
new
OpInfo
(
);
OpInfo
op
=
OpInfo
.
GetOpInfo
(
board
,
board
.
smtList
.
Count
);
deviceStatus
.
CurrStatus
=
3
;
deviceStatus
.
CurrStatus
=
3
;
op
.
ProName
=
board
.
boardName
;
//
op.ProName = board.boardName;
op
.
ProType
=
board
.
boardCode
;
//
op.ProType = board.boardCode;
op
.
BarCode
=
pcbcode
;
//
op.BarCode = pcbcode;
op
.
BoardWidth
=
board
.
boardWidth
;
//
op.BoardWidth = board.boardWidth;
op
.
BoardLength
=
board
.
boardLength
;
//
op.BoardLength = board.boardLength;
op
.
pointList
=
new
List
<
OpPointInfo
>();
//
op.pointList = new List<OpPointInfo>();
foreach
(
SMTPointInfo
sm
in
board
.
smtList
)
//
foreach (SMTPointInfo sm in board.smtList)
{
//
{
op
.
pointList
.
Add
(
new
OpPointInfo
(
sm
.
PartNum
,
sm
.
pointName
));
//
op.pointList.Add(new OpPointInfo(sm.PartNum, sm.pointName));
}
//
}
deviceStatus
.
workInfo
=
op
;
deviceStatus
.
workInfo
=
op
;
deviceStatus
.
WarnMsg
=
TSAVBean
.
WarnMsg
;
deviceStatus
.
WarnMsg
=
TSAVBean
.
WarnMsg
;
string
msg
=
JsonHelper
.
SerializeObject
(
deviceStatus
);
string
msg
=
JsonHelper
.
SerializeObject
(
deviceStatus
);
...
...
TSA-V/App.config
查看文件 @
d5f8f28
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
<!--
AOI
程序文件夹-->
<!--
AOI
程序文件夹-->
<
add
key
=
"AOIFileConfig"
value
=
"\config\AOIConfig\"
/>
<
add
key
=
"AOIFileConfig"
value
=
"\config\AOIConfig\"
/>
<!--是否启动
AOI
-->
<!--是否启动
AOI
-->
<
add
key
=
"IsNeedAOI"
value
=
"
1
"
/>
<
add
key
=
"IsNeedAOI"
value
=
"
0
"
/>
<
add
key
=
"DefaultPointSize"
value
=
"5"
/>
<
add
key
=
"DefaultPointSize"
value
=
"5"
/>
<
add
key
=
"DefaultPointType"
value
=
"1"
/>
<
add
key
=
"DefaultPointType"
value
=
"1"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
...
...
TSA-V/workForm/FrmTSAV.cs
查看文件 @
d5f8f28
...
@@ -362,11 +362,11 @@ namespace TSA_V
...
@@ -362,11 +362,11 @@ namespace TSA_V
private
void
btnStartWorking_Click
(
object
sender
,
EventArgs
e
)
private
void
btnStartWorking_Click
(
object
sender
,
EventArgs
e
)
{
{
LogUtil
.
info
(
Name
+
"点击:"
+
btnStartWorking
.
Text
+
",自动启动循环测试模式"
);
LogUtil
.
info
(
Name
+
"点击:"
+
btnStartWorking
.
Text
+
",自动启动循环测试模式"
);
btnStartWorking
.
Enabled
=
false
;
btnStartWorking
.
Enabled
=
false
;
//开始工作
//开始工作
TSAVBean
.
StartWork
(
BoardManager
.
CurrBoard
);
TSAVBean
.
StartWork
(
BoardManager
.
CurrBoard
);
WorkInfo
.
IsCycleDebug
=
true
;
WorkInfo
.
IsCycleDebug
=
true
;
btnStartWorking
.
Enabled
=
true
;
btnStartWorking
.
Enabled
=
true
;
}
}
private
void
FrmWelding_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
private
void
FrmWelding_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
...
@@ -722,13 +722,15 @@ namespace TSA_V
...
@@ -722,13 +722,15 @@ namespace TSA_V
}
}
private
void
btnStop_Click
(
object
sender
,
EventArgs
e
)
private
void
btnStop_Click
(
object
sender
,
EventArgs
e
)
{
{
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
if
(
TSAVBean
.
Status
>
TSAVStatus
.
Wait
)
if
(
TSAVBean
.
Status
>
TSAVStatus
.
Wait
)
{
{
TSAVBean
.
StopWork
();
TSAVBean
.
StopWork
();
}
}
//OpInfo op = OpInfo.GetOpInfo(BoardManager.CurrBoard);
//bool result = DB.db.AddHistory(op, out int id);
});
});
this
.
Close
();
this
.
Close
();
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论