Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit fd5f97ce
由
LN
编写于
2023-11-03 13:41:23 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch '无轨道开发' of
http://106.15.194.121:8083/lina/Line-Smart-Workstation
into 无轨道开发
2 个父辈
d10e5256
2b1aebfa
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
264 行增加
和
199 行删除
DeviceLibrary/bean/BoardInfo.cs
DeviceLibrary/csvLoad/CSVBomManager.cs
DeviceLibrary/csvLoad/position/ComponetInfo.cs
DeviceLibrary/manager/BoardManager.cs
DeviceLibrary/manager/WorkInfo.cs
TSA-V/FrmAddBoard.cs
TSA-V/FrmBoardInfo.cs
TSA-V/FrmBoardInfo.resx
TSA-V/FrmBoardList.cs
TSA-V/FrmComponentList.cs
TSA-V/Smart-Workstation.csproj
TSA-V/workForm/FrmBoardSelect.cs
TSA-V/workForm/FrmTSAV.cs
DeviceLibrary/bean/BoardInfo.cs
查看文件 @
fd5f97c
...
...
@@ -62,7 +62,7 @@ namespace TSA_V.DeviceLibrary
List
<
SMTPointInfo
>
needWorkSmtList
=
(
from
m
in
smtList
where
m
.
Disable
.
Equals
(
false
)
select
m
).
ToList
<
SMTPointInfo
>();
return
needWorkSmtList
;
}
/// <summary>
/// 基准点坐标X
/// </summary>
...
...
DeviceLibrary/csvLoad/CSVBomManager.cs
查看文件 @
fd5f97c
...
...
@@ -162,8 +162,7 @@ namespace TSA_V.LoadCSVLibrary
listIndex
++;
}
ComponetInfo
com
=
(
ComponetInfo
)
bllIns
;
com
.
Id
=
index
+
1
;
com
.
Id
=
index
;
comList
.
Add
(
com
);
}
else
...
...
@@ -179,55 +178,144 @@ namespace TSA_V.LoadCSVLibrary
index
++;
}
#
region
旧代码
//Dictionary<string, string> pnposlist = new Dictionary<string, string>();
//HashSet<string> usedposlist = new HashSet<string>();
//List<ComponetInfo> componetlist = new List<ComponetInfo>();
//int Id = 1;
//foreach (var com in comList)
//{
// if (string.IsNullOrWhiteSpace(com.PositionNum))
// continue;
// string[] strarr = GetPositionNum(com.PositionNum);
// string[] intarr = com.ComCount.Split(';');
// if (strarr.Length != +intarr.Length)
// {
// MessageBox.Show($"{com.PN}的数量分组{intarr.Length}和位置分组{strarr.Length},不统一!");
// return new List<ComponetInfo>();
// }
// else if (intarr.Length == 1 && strarr.Length == 1)
// {
// com.Id = Id;
// componetlist.Add(com);
// Id++;
// continue;
// }
// int j = 0;
// foreach (var item in strarr)
// {
// ComponetInfo componet = new ComponetInfo();
// string tagno = com.TagNo;
// int comid = Id + 1;
// if (j != 0)
// {
// tagno = "";
// comid = 0;
// }
// componet.Id = comid;
// componet.TagNo = tagno;
// componet.PositionX = com.PositionX;
// componet.PositionNum = item;
// componet.PN = com.PN;
// componet.Text = com.Text;
// componet.ComCount = intarr[j];
// componet.ComponentDes = com.ComponentDes;
// componet.Notes = com.Notes;
// componetlist.Add(componet);
// if (!string.IsNullOrEmpty(com.PositionNum))
// {
// usedposlist.Add(com.PositionNum);
// pnposlist[com.PN] = com.PositionNum;
// }
// j++;
// Id++;
// }
// //if (!string.IsNullOrEmpty(com.PositionNum))
// //{
// // usedposlist.Add(com.PositionNum);
// // pnposlist[com.PN] = com.PositionNum;
// //}
//}
//List<ComponetInfo> componedate = componetlist.Where(m => !m.PositionNum.Contains(";")).ToList();
//foreach (var com in componedate)
//{
// if (string.IsNullOrWhiteSpace(com.PositionNum) && !string.IsNullOrWhiteSpace(com.PN))
// {
// if (pnposlist.ContainsKey(com.PN))
// com.PositionNum = pnposlist[com.PN];
// else
// {
// foreach (var p in CSVPositionReader<TSAVPosition>.allPositionMap)
// {
// if (usedposlist.Contains(p.Value.PositionNum))
// continue;
// com.PositionNum = p.Value.PositionNum;
// pnposlist[com.PN] = com.PositionNum;
// usedposlist.Add(com.PositionNum);
// break;
// }
// }
// }
// //if (String.IsNullOrEmpty(com.PositionNum) || String.IsNullOrEmpty(com.PN))
// //{
// // LOGGER.Error("读取csv,数据不完整,跳过数据,line=" + com.TagNo);
// // continue;
// //}
//}
#
endregion
return
CreateCompone
(
comList
);
}
public
static
List
<
ComponetInfo
>
CreateCompone
(
List
<
ComponetInfo
>
comList
)
{
Dictionary
<
string
,
string
>
pnposlist
=
new
Dictionary
<
string
,
string
>();
HashSet
<
string
>
usedposlist
=
new
HashSet
<
string
>();
List
<
ComponetInfo
>
componetlist
=
new
List
<
ComponetInfo
>();
foreach
(
var
com
in
comList
)
{
if
(
string
.
IsNullOrWhiteSpace
(
com
.
PositionNum
))
continue
;
List
<
ComponetInfo
>
componetlist
=
new
List
<
ComponetInfo
>();
#
region
将解析好的
excel
内容,生成到
List
<
ComponetInfo
>
中
int
Id
=
1
;
foreach
(
var
com
in
comList
)
{
if
(
string
.
IsNullOrWhiteSpace
(
com
.
PositionNum
))
continue
;
string
[]
strarr
=
GetPositionNum
(
com
.
PositionNum
);
string
[]
strarr
=
GetPositionNum
(
com
.
PositionNum
);
string
[]
intarr
=
com
.
ComCount
.
Split
(
';'
);
if
(
strarr
.
Length
!=+
intarr
.
Length
)
if
(
strarr
.
Length
!=
intarr
.
Length
)
{
MessageBox
.
Show
(
$
"{com.PN}的数量分组{intarr.Length}和位置分组{strarr.Length},不统一!"
);
break
;
return
new
List
<
ComponetInfo
>()
;
}
int
i
=
index
;
int
j
=
0
;
foreach
(
var
item
in
strarr
)
for
(
int
j
=
0
;
j
<
strarr
.
Length
;
j
++)
{
ComponetInfo
componet
=
new
ComponetInfo
();
componet
.
Id
=
comList
.
Count
+
i
;
componet
.
PositionX
=
com
.
PositionX
;
componet
.
PositionNum
=
item
;
componet
.
PN
=
com
.
PN
;
componet
.
Text
=
com
.
Text
;
componet
.
ComCount
=
intarr
[
j
];
componet
.
ComponentDes
=
com
.
ComponentDes
;
componet
.
Notes
=
com
.
Notes
;
componet
.
TagNo
=
com
.
TagNo
;
componetlist
.
Add
(
componet
);
i
++;
j
++;
if
(!
string
.
IsNullOrEmpty
(
com
.
PositionNum
))
componetlist
.
Add
(
new
ComponetInfo
{
usedposlist
.
Add
(
com
.
PositionNum
);
pnposlist
[
com
.
PN
]
=
com
.
PositionNum
;
}
Id
=
(
j
==
0
)?
Id
:-
1
,
TagNo
=
com
.
TagNo
,
PositionX
=
com
.
PositionX
,
PositionNum
=
strarr
[
j
],
PN
=
com
.
PN
,
Text
=
com
.
Text
,
ComCount
=
intarr
[
j
],
ComponentDes
=
com
.
ComponentDes
,
Notes
=
com
.
Notes
});
}
//com.PositionNum = GetPositionNum(com.PositionNum);
//if (!string.IsNullOrEmpty(com.PositionNum))
//{
// usedposlist.Add(com.PositionNum);
// pnposlist[com.PN] = com.PositionNum;
//}
}
comList
.
AddRange
(
componetlist
);
List
<
ComponetInfo
>
componedate
=
comList
.
Where
(
m
=>
!
m
.
PositionNum
.
Contains
(
";"
)).
ToList
();
foreach
(
var
com
in
componedate
)
Id
++
;
if
(!
string
.
IsNullOrEmpty
(
com
.
PositionNum
))
{
usedposlist
.
Add
(
com
.
PositionNum
);
pnposlist
[
com
.
PN
]
=
com
.
PositionNum
;
}
}
#
endregion
foreach
(
var
com
in
componetlist
)
{
if
(
string
.
IsNullOrWhiteSpace
(
com
.
PositionNum
)
&&
!
string
.
IsNullOrWhiteSpace
(
com
.
PN
))
...
...
@@ -246,15 +334,14 @@ namespace TSA_V.LoadCSVLibrary
break
;
}
}
}
}
//if (String.IsNullOrEmpty(com.PositionNum) || String.IsNullOrEmpty(com.PN))
//{
// LOGGER.Error("读取csv,数据不完整,跳过数据,line=" + com.TagNo);
// continue;
//}
}
return
componedate
;
return
componetlist
;
}
public
static
string
[]
GetPositionNum
(
string
configPosition
)
{
...
...
@@ -471,17 +558,36 @@ namespace TSA_V.LoadCSVLibrary
return
null
;
}
public
static
ComponetInfo
GetCom
(
string
bomName
,
SMTPointInfo
pointInfo
)
/// <summary>
///
/// </summary>
/// <param name="bomName"></param>
/// <param name="pointInfo"></param>
/// <param name="issamecom">为true时执行新的查询元器件库逻辑,不影响之前的引用逻辑</param>
/// <returns></returns>
public
static
ComponetInfo
GetCom
(
string
bomName
,
SMTPointInfo
pointInfo
,
bool
issamecom
=
false
)
{
if
(
allComMap
.
ContainsKey
(
bomName
))
{
List
<
ComponetInfo
>
map
=
allComMap
[
bomName
];
foreach
(
ComponetInfo
obj
in
map
)
{
if
(
obj
.
IsSameCom
(
pointInfo
)
)
if
(
issamecom
)
{
return
obj
;
if
(
obj
.
IsSameComAndCount
(
pointInfo
))
{
return
obj
;
}
}
else
{
if
(
obj
.
IsSameCom
(
pointInfo
))
{
return
obj
;
}
}
}
foreach
(
ComponetInfo
obj
in
map
)
{
...
...
DeviceLibrary/csvLoad/position/ComponetInfo.cs
查看文件 @
fd5f97c
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
@@ -48,8 +49,7 @@ namespace TSA_V.LoadCSVLibrary
///位置
/// </summary>
[
CSVAttribute
(
"PNum"
,
true
,
"料盘位置"
,
"位置"
,
"PositionNum"
,
"Lot"
)]
public
string
PositionNum
{
get
;
set
;
}
public
string
PositionNum
{
get
;
set
;}
/// <summary>
///X坐标
/// </summary>
...
...
@@ -71,7 +71,7 @@ namespace TSA_V.LoadCSVLibrary
///投影文字
/// </summary>
[
CSVAttribute
(
"Text"
,
"投影文字"
,
false
)]
public
string
Text
{
get
;
set
;
}
public
string
Text
{
get
;
set
;
}
public
int
GetSortPosition
()
{
...
...
@@ -114,9 +114,18 @@ namespace TSA_V.LoadCSVLibrary
if
(
this
.
PN
.
Equals
(
point
.
PN
)
)
{
return
true
;
}
}
}
else
if
(
this
.
TagNo
.
Equals
(
point
.
TagNo
)&&
this
.
PositionNum
.
Equals
(
point
.
PositionNum
))
{
return
true
;
}
return
false
;
}
public
bool
IsSameComAndCount
(
SMTPointInfo
point
)
{
if
(
this
.
PN
.
Equals
(
point
.
PN
)
&&
int
.
Parse
(
this
.
ComCount
)
>
0
)
{
return
true
;
}
...
...
DeviceLibrary/manager/BoardManager.cs
查看文件 @
fd5f97c
...
...
@@ -20,7 +20,7 @@ namespace TSA_V.DeviceLibrary
private
static
int
MaxId
=
0
;
/// <summary>
/// 板子列表
/// </summary>
/// </summary>
public
static
List
<
BoardInfo
>
boardList
=
new
List
<
BoardInfo
>();
public
static
Image
defaultImage
=
null
;
...
...
DeviceLibrary/manager/WorkInfo.cs
查看文件 @
fd5f97c
using
PUSICANLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Threading
;
using
TSA_V.Common
;
...
...
@@ -197,35 +198,12 @@ namespace TSA_V.DeviceLibrary
currPoint
=
GetSmtList
()[
currIndex
];
//LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + currPoint.pointName + "】");
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
currBoard
.
bomName
,
currPoint
);
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
currBoard
.
bomName
,
currPoint
,
true
);
TSAVPosition
position
=
null
;
if
(
com
!=
null
)
{
#
region
2023
-
10
-
31
添加
//如果当前位置元器件数量为空时,查询当前元器件库相同物料编号的元器件使用
if
(
int
.
Parse
(
com
.
ComCount
)
<=
0
)
{
var
smtpoint
=
needWorkSmtList
.
Where
(
a
=>
a
.
PN
==
com
.
PN
).
ToList
();
foreach
(
var
item
in
smtpoint
)
{
var
componeinfo
=
CSVBomManager
.
GetCom
(
BoardManager
.
CurrBoard
.
bomName
,
item
);
if
(
componeinfo
!=
null
&&
int
.
Parse
(
componeinfo
.
ComCount
)
>
0
)
{
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
componeinfo
.
PositionNum
);
if
(
position
!=
null
)
{
com
=
componeinfo
;
currPoint
=
item
;
break
;
}
}
}
}
else
{
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
}
#
region
2023
-
10
-
31
添加
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
//记录运行过程的位号
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
currBoard
.
boardName
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
currIndex
.
ToString
());
...
...
@@ -235,7 +213,6 @@ namespace TSA_V.DeviceLibrary
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
""
);
}
#
endregion
//position = CSVPositionReader<TSAVPosition>.GetPositonByNum(com.PositionNum);
useComponets
.
Add
(
com
);
}
else
...
...
TSA-V/FrmAddBoard.cs
查看文件 @
fd5f97c
...
...
@@ -149,7 +149,7 @@ namespace TSA_V
{
return
null
;
}
List
<
ComponetInfo
>
comList
=
this
.
uploadPointList
;
List
<
ComponetInfo
>
comList
=
this
.
uploadPointList
;
if
(
rdbSelCom
.
Checked
)
{
comList
=
CSVBomManager
.
GetComList
(
board
.
bomName
);
...
...
@@ -204,7 +204,8 @@ namespace TSA_V
{
nodeXValue
=
(
board
.
originX
+
(
double
)(
x
*
xNodeChange
*
xFangxiang
));
nodeYValue
=
(
board
.
originY
+
(
double
)(
y
*
yNodeChange
*
yFangxiang
));
}
else
if
(
board
.
orgType
.
Equals
(
3
))
}
else
if
(
board
.
orgType
.
Equals
(
3
))
{
nodeXValue
=
(
board
.
originX
-
(
double
)(
x
*
xNodeChange
*
xFangxiang
));
nodeYValue
=
(
board
.
originY
-
(
double
)(
y
*
yNodeChange
*
yFangxiang
));
...
...
@@ -230,10 +231,12 @@ namespace TSA_V
point
.
WeldTime
=
3
;
point
.
NeedCheck
=
true
;
point
.
NeedSoldering
=
true
;
LogUtil
.
info
(
"新增【"
+
board
.
boardName
+
"】元器件【"
+
point
.
PN
+
"】导入【"
+
com
.
PositionX
+
","
+
com
.
PositionY
+
"】图片【"
+
point
.
PositionX
+
","
+
point
.
PositionY
+
"】红点【"
+
nodeXValue
+
","
+
nodeYValue
+
"】"
);
smtList
.
Add
(
point
);
i
++;
if
(
com
.
Id
!=-
1
)
{
LogUtil
.
info
(
"新增【"
+
board
.
boardName
+
"】元器件【"
+
point
.
PN
+
"】导入【"
+
com
.
PositionX
+
","
+
com
.
PositionY
+
"】图片【"
+
point
.
PositionX
+
","
+
point
.
PositionY
+
"】红点【"
+
nodeXValue
+
","
+
nodeYValue
+
"】"
);
smtList
.
Add
(
point
);
i
++;
}
}
if
(!
rdbSelCom
.
Checked
)
{
...
...
TSA-V/FrmBoardInfo.cs
查看文件 @
fd5f97c
...
...
@@ -26,7 +26,8 @@ namespace TSA_V
private
FrmBoardInfo
()
{
InitializeComponent
();
display
.
SetPic
(
picBoard
,
panBoard
);
InitializeComponent
();
display
.
SetPic
(
picBoard
,
panBoard
);
CheckForIllegalCrossThreadCalls
=
false
;
}
public
void
SetBoard
(
BoardInfo
board
)
...
...
@@ -54,10 +55,6 @@ namespace TSA_V
isFinishLoad
=
false
;
chbNormal
.
Checked
=
true
;
chbShowName
.
Checked
=
true
;
if
(
isNew
==
false
)
{
AOIManager
.
LoadAOIFile
(
cmbAOIFile
,
updateBoardInfo
.
AOIProName
);
...
...
@@ -717,7 +714,7 @@ namespace TSA_V
point
.
PointType
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
Column_PointType
.
Name
].
Value
.
ToString
());
point
.
PenWidth
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
Column_PenWidth
.
Name
].
Value
.
ToString
());
point
.
ShowText
=
(
row
.
Cells
[
this
.
Column_ShowText
.
Name
].
Value
.
ToString
());
point
.
Disable
=
Convert
.
ToBoolean
(
row
.
Cells
[
this
.
Column_disable
.
Name
].
Value
.
ToString
());
point
.
Disable
=
Convert
.
ToBoolean
(
row
.
Cells
[
this
.
Column_disable
.
Name
].
Value
.
ToString
());
}
catch
(
Exception
ex
)
{
...
...
TSA-V/FrmBoardInfo.resx
查看文件 @
fd5f97c
...
...
@@ -139,7 +139,7 @@
<data name="dataGridViewImageColumn1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGw
AAANRJREFUSEvtk8ENhSAMQBnAgHplD/c/w8UN1Dkg4adESJWKlsM/8ZIm0FIekCDC
vQAADr0BR/uQrQ
AAANRJREFUSEvtk8ENhSAMQBnAgHplD/c/w8UN1Dkg4adESJWKlsM/8ZIm0FIekCDC
n+iiZtgia20MLizRvu9BCBEDxhw+i7CkRfZJdBxHIUkBtS+8irZty5tqrckxrHmjKsLPNc9zzKU5ME1T
nr8946MIS5RSZ/YqAqCWcjUZKcISODUm5THjOOb8k6wQGWNyE75JItXuSClzDfa4U3TAZ4TF0EjxJAKG
YYg16kOTHeu6Bu/9ObtSEznnYi8F3VGhJqrRRV2UYXcsyxKDC/9ojXRRIyH8ACKfopRlVag2AAAAAElF
...
...
@@ -149,7 +149,7 @@
<data name="dataGridViewImageColumn2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGw
AAAONJREFUSEvtk00OhCAMRlkb49/We3j/tS70BuI1TAwzH8FOVQTrYla8pIkttg9I
vQAADr0BR/uQrQ
AAAONJREFUSEvtk00OhCAMRlkb49/We3j/tS70BuI1TAwzH8FOVQTrYla8pIkttg9I
UOZPJNFrxKKu62xIEYuUUjakJFESEd6OcRzNuq4uOxISbdtmpmly2ZFLR9/3dlCWZa5yJCQqy9KuYcaZ
S8cwDDQsz3NX/XEnqqqK1jDjjHdrWmtqwi45e51T1zXV0evDfwdfuKwoCle9ivhJ7iTgVgS4DLsGew6a
pqE8JAFBEZjnmYa1bev9xj8xoiKwLAsNPQfWnvBIBPg17hG7Ls5jEeAyiQSIRABvxPdOYohFb0milxjz
...
...
TSA-V/FrmBoardList.cs
查看文件 @
fd5f97c
...
...
@@ -37,7 +37,7 @@ namespace TSA_V
public
void
LoadCom
()
{
LoadOk
=
false
;
cmbBoardList
.
DataSource
=
null
;
cmbBoardList
.
DataSource
=
null
;
cmbBoardList
.
DataSource
=
BoardManager
.
boardList
;
cmbBoardList
.
DisplayMember
=
"boardName"
;
cmbBoardList
.
ValueMember
=
"boardId"
;
...
...
@@ -91,8 +91,7 @@ namespace TSA_V
this
.
Visible
=
false
;
FrmBoardInfo
.
instance
.
Show
();
FrmBoardInfo
.
instance
.
SetBoard
(
board
);
FrmBoardInfo
.
instance
.
LoadForm
();
FrmBoardInfo
.
instance
.
LoadForm
();
}
else
{
...
...
@@ -154,7 +153,7 @@ namespace TSA_V
this
.
listPoint
.
Items
.
Clear
();
int
i
=
0
;
foreach
(
SMTPointInfo
point
in
board
.
smtList
)
{
{
ListViewItem
lvi
=
new
ListViewItem
();
lvi
.
ImageIndex
=
i
;
...
...
TSA-V/FrmComponentList.cs
查看文件 @
fd5f97c
...
...
@@ -79,7 +79,7 @@ namespace TSA_V
// {
// dgvList.Rows.Add(SetRowInfo(null, com));
// }
//}
//}
UpdateGridList
(
list
);
}
}
...
...
@@ -275,7 +275,7 @@ namespace TSA_V
}
List
<
ComponetInfo
>
list
=
CSVBomManager
.
AddCom
(
cmbList
.
Text
,
obj
);
List
<
ComponetInfo
>
list
=
CSVBomManager
.
AddCom
(
cmbList
.
Text
,
obj
);
if
(
list
==
null
)
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
SaveError
,
"保存失败!"
));
...
...
TSA-V/Smart-Workstation.csproj
查看文件 @
fd5f97c
...
...
@@ -326,6 +326,7 @@
</EmbeddedResource>
<EmbeddedResource Include="FrmBoardInfo.resx">
<DependentUpon>FrmBoardInfo.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FrmBoardList.resx">
<DependentUpon>FrmBoardList.cs</DependentUpon>
...
...
TSA-V/workForm/FrmBoardSelect.cs
查看文件 @
fd5f97c
...
...
@@ -386,13 +386,22 @@ namespace TSA_V
string
TagNumber
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
TagNumber
);
if
(!
string
.
IsNullOrEmpty
(
ProcedureName
)&&!
string
.
IsNullOrEmpty
(
TagNumber
))
{
cmbBoardList
.
Text
=
ProcedureName
;
BoardInfo
board
=
(
BoardInfo
)
cmbBoardList
.
SelectedItem
;
BoardManager
.
CurrBoard
=
board
;
FrmWork
fw
=
new
FrmWork
();
this
.
Hide
();
this
.
Close
();
fw
.
ShowDialog
();
DialogResult
dr
=
MessageBox
.
Show
(
$
"有未结束的程序'{ProcedureName}',是否继续?"
,
"提示"
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
);
if
(
dr
==
DialogResult
.
OK
)
{
cmbBoardList
.
Text
=
ProcedureName
;
BoardInfo
board
=
(
BoardInfo
)
cmbBoardList
.
SelectedItem
;
if
(
string
.
IsNullOrEmpty
(
board
.
boardName
))
{
MessageBox
.
Show
(
$
"未找到当前板子信息{ProcedureName},请检查!"
);
return
;
}
BoardManager
.
CurrBoard
=
board
;
FrmWork
fw
=
new
FrmWork
(
true
);
this
.
Hide
();
this
.
Close
();
fw
.
ShowDialog
();
}
}
}
}
...
...
TSA-V/workForm/FrmTSAV.cs
查看文件 @
fd5f97c
...
...
@@ -24,9 +24,11 @@ namespace TSA_V
{
public
partial
class
FrmWork
:
FrmBase
{
public
FrmWork
()
private
bool
isContinue
;
public
FrmWork
(
bool
iscontinue
=
false
)
{
InitializeComponent
();
isContinue
=
iscontinue
;
}
private
bool
isInitOk
=
false
;
...
...
@@ -65,15 +67,15 @@ namespace TSA_V
workSmtList
=
board
.
GetSmtList
();
preIndex
=
-
1
;
smtPoint
=
new
SMTPointInfo
();
timerShowForm
.
Stop
();
//获取记录运行未完成的步骤序号
int
TagNumber
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TagNumber
);
if
(
workSmtList
.
Count
>
0
&&
TagNumber
!=
0
)
{
//int TagNumber =ConfigAppSettings.GetIntValue(Setting_Init.TagNumber);
var
workSmt
=
workSmtList
.
Where
(
a
=>
a
.
pointNum
==
TagNumber
).
FirstOrDefault
();
smtPoint
=
workSmt
;
preIndex
=
TagNumber
-
1
;
//索引从0开始
if
(
workSmtList
.
Count
>
0
&&
TagNumber
!=
0
&&
isContinue
)
{
var
workSmt
=
workSmtList
.
Single
(
a
=>
a
.
pointNum
==
TagNumber
);
smtPoint
=
workSmt
;
preIndex
=
TagNumber
-
1
;
}
else
{
...
...
@@ -584,64 +586,24 @@ namespace TSA_V
lblPartNum
.
Text
=
smtPoint
.
TagNo
;
lblPointName
.
Text
=
smtPoint
.
PN
;
#
region
2023
-
10
-
31
修改
ComponetInfo
com
=
null
;
com
=
CSVBomManager
.
GetCom
(
BoardManager
.
CurrBoard
.
bomName
,
smtPoint
);
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
BoardManager
.
CurrBoard
.
bomName
,
smtPoint
,
true
);
if
(
com
!=
null
)
{
TSAVPosition
position
=
null
;
if
(
int
.
Parse
(
com
.
ComCount
)
<=
0
)
TSAVPosition
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
if
(
position
!=
null
)
{
lblComDes
.
Text
=
com
.
ComponentDes
;
this
.
lblComName
.
Text
=
com
.
PN
;
lblCount
.
Text
=
com
.
ComCount
.
ToString
();
txtCount
.
Text
=
com
.
ComCount
.
ToString
();
var
smtpoint
=
workSmtList
.
Where
(
a
=>
a
.
PN
==
com
.
PN
).
ToList
();
foreach
(
var
item
in
smtpoint
)
{
var
componeinfo
=
CSVBomManager
.
GetCom
(
BoardManager
.
CurrBoard
.
bomName
,
item
);
if
(
componeinfo
!=
null
&&
int
.
Parse
(
componeinfo
.
ComCount
)
>
0
)
{
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
componeinfo
.
PositionNum
);
if
(
position
!=
null
)
{
com
=
componeinfo
;
break
;
}
}
}
string
str
=
$
"{smtPoint.PositionNum}位置元器件{smtPoint.PN}数量不足,请及时补充;\n当前使用{com.PositionNum}位置的元器件{com.PN},数量为{com.ComCount}"
;
lblComNotices
.
Text
=
str
;
//lblComNotices.Text = ResourceCulture.GetString("元器件数量不足,请及时补充;当前使用位置的元器件", $"{smtPoint.PositionNum}位置元器件{smtPoint.PN}数量不足,请及时补充;当前使用{com.PositionNum}位置的元器件{com.PN},数量为{com.ComCount}");
lblPositionNum
.
Text
=
position
.
PositionNum
;
}
else
lblComDes
.
Text
=
com
.
ComponentDes
;
this
.
lblComName
.
Text
=
com
.
PN
;
lblCount
.
Text
=
com
.
ComCount
.
ToString
();
txtCount
.
Text
=
com
.
ComCount
.
ToString
();
lblComNotices
.
Text
=
com
.
Notes
.
ToString
();
if
(
int
.
Parse
(
com
.
ComCount
)
<=
0
)
{
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
if
(
position
!=
null
)
{
lblPositionNum
.
Text
=
position
.
PositionNum
;
}
lblComDes
.
Text
=
com
.
ComponentDes
;
this
.
lblComName
.
Text
=
com
.
PN
;
lblCount
.
Text
=
com
.
ComCount
.
ToString
();
txtCount
.
Text
=
com
.
ComCount
.
ToString
();
lblComNotices
.
Text
=
com
.
Notes
.
ToString
();
lblComNotices
.
Text
=
ResourceCulture
.
GetString
(
"元器件数量不足,请及时补充"
,
"元器件数量不足,请及时补充"
);
}
//if (position != null)
//{
// lblPositionNum.Text = position.PositionNum;
//}
//lblComDes.Text = com.ComponentDes;
//this.lblComName.Text = com.PN;
//lblCount.Text = com.ComCount.ToString();
//txtCount.Text = com.ComCount.ToString();
//lblComNotices.Text = com.Notes.ToString();
//if (int.Parse(com.ComCount) <= 0)
//{
//lblComNotices.Text = ResourceCulture.GetString("元器件数量不足,请及时补充", "元器件数量不足,请及时补充");
//}
//记录运行过程的位号
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
board
.
boardName
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
smtPoint
.
pointNum
.
ToString
());
...
...
@@ -859,39 +821,41 @@ namespace TSA_V
}
FrmProjectorScreen
.
instance
.
ShowPoint
(
true
,
smtPoint
);
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
this
.
board
.
bomName
,
smtPoint
);
TSAVPosition
position
=
null
;
if
(
com
!=
null
)
{
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
}
else
{
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
smtPoint
.
PositionNum
);
}
if
(
position
==
null
)
{
//ComponetInfo com = ComponentManager.getById(smtPoint.pointType);
lblPositionNum
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
ComInsufficient
,
"元器件库存不足"
);
}
else
{
#
region
2023
-
09
-
22
添加
控制便签功能
//string count = null;
//string pnname = null;
//string ComponentDes = null;
//if (com != null)
//{
// count = com.ComCount.ToString();
// pnname = com.PN.ToString();
// ComponentDes = com.ComponentDes;
//}
////调用指示灯显示
//ScanRequestLabel.RequestPost(position, count, pnname, ComponentDes);
#
endregion
lblPositionNum
.
Text
=
position
.
PositionNum
;
}
#
region
这段代码是不是没必要
//ComponetInfo com = CSVBomManager.GetCom(this.board.bomName, smtPoint,true);
//TSAVPosition position = null;
//if (com != null)
//{
// position = CSVPositionReader<TSAVPosition>.GetPositonByNum(com.PositionNum);
//}
//else
//{
// position = CSVPositionReader<TSAVPosition>.GetPositonByNum(smtPoint.PositionNum);
//}
//if (position == null)
//{
// //ComponetInfo com = ComponentManager.getById(smtPoint.pointType);
// lblPositionNum.Text = ResourceCulture.GetString(ResourceCulture.ComInsufficient, "元器件库存不足");
//}
//else
//{
// #region 2023-09-22 添加 控制便签功能
// //string count = null;
// //string pnname = null;
// //string ComponentDes = null;
// //if (com != null)
// //{
// // count = com.ComCount.ToString();
// // pnname = com.PN.ToString();
// // ComponentDes = com.ComponentDes;
// //}
// ////调用指示灯显示
// //ScanRequestLabel.RequestPost(position, count, pnname, ComponentDes);
// #endregion
// lblPositionNum.Text = position.PositionNum;
//}
#
endregion
int
leftCount
=
workSmtList
.
Count
-
1
-
preIndex
;
if
(
preIndex
.
Equals
(
0
))
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论