Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2b1aebfa
由
贾鹏旭
编写于
2023-11-03 11:34:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.修改CSVBomManager.GetCom方法
2.修改创建新程序解析excel逻辑
1 个父辈
842be756
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
225 行增加
和
160 行删除
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
查看文件 @
2b1aebf
DeviceLibrary/csvLoad/CSVBomManager.cs
查看文件 @
2b1aebf
...
@@ -162,8 +162,7 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -162,8 +162,7 @@ namespace TSA_V.LoadCSVLibrary
listIndex
++;
listIndex
++;
}
}
ComponetInfo
com
=
(
ComponetInfo
)
bllIns
;
ComponetInfo
com
=
(
ComponetInfo
)
bllIns
;
com
.
Id
=
index
+
1
;
com
.
Id
=
index
;
comList
.
Add
(
com
);
comList
.
Add
(
com
);
}
}
else
else
...
@@ -179,55 +178,144 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -179,55 +178,144 @@ namespace TSA_V.LoadCSVLibrary
index
++;
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
>();
Dictionary
<
string
,
string
>
pnposlist
=
new
Dictionary
<
string
,
string
>();
HashSet
<
string
>
usedposlist
=
new
HashSet
<
string
>();
HashSet
<
string
>
usedposlist
=
new
HashSet
<
string
>();
List
<
ComponetInfo
>
componetlist
=
new
List
<
ComponetInfo
>();
List
<
ComponetInfo
>
componetlist
=
new
List
<
ComponetInfo
>();
foreach
(
var
com
in
comList
)
{
#
region
将解析好的
excel
内容,生成到
List
<
ComponetInfo
>
中
if
(
string
.
IsNullOrWhiteSpace
(
com
.
PositionNum
))
int
Id
=
1
;
continue
;
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
(
';'
);
string
[]
intarr
=
com
.
ComCount
.
Split
(
';'
);
if
(
strarr
.
Length
!=+
intarr
.
Length
)
if
(
strarr
.
Length
!=
intarr
.
Length
)
{
{
MessageBox
.
Show
(
$
"{com.PN}的数量分组{intarr.Length}和位置分组{strarr.Length},不统一!"
);
MessageBox
.
Show
(
$
"{com.PN}的数量分组{intarr.Length}和位置分组{strarr.Length},不统一!"
);
break
;
return
new
List
<
ComponetInfo
>()
;
}
}
int
i
=
index
;
int
j
=
0
;
for
(
int
j
=
0
;
j
<
strarr
.
Length
;
j
++)
{
foreach
(
var
item
in
strarr
)
componetlist
.
Add
(
new
ComponetInfo
{
{
ComponetInfo
componet
=
new
ComponetInfo
();
Id
=
(
j
==
0
)?
Id
:-
1
,
componet
.
Id
=
comList
.
Count
+
i
;
TagNo
=
com
.
TagNo
,
componet
.
PositionX
=
com
.
PositionX
;
PositionX
=
com
.
PositionX
,
componet
.
PositionNum
=
item
;
PositionNum
=
strarr
[
j
],
componet
.
PN
=
com
.
PN
;
PN
=
com
.
PN
,
componet
.
Text
=
com
.
Text
;
Text
=
com
.
Text
,
componet
.
ComCount
=
intarr
[
j
];
ComCount
=
intarr
[
j
],
componet
.
ComponentDes
=
com
.
ComponentDes
;
ComponentDes
=
com
.
ComponentDes
,
componet
.
Notes
=
com
.
Notes
;
Notes
=
com
.
Notes
componet
.
TagNo
=
com
.
TagNo
;
})
;
componetlist
.
Add
(
componet
);
}
i
++;
j
++
;
Id
++
;
if
(!
string
.
IsNullOrEmpty
(
com
.
PositionNum
))
if
(!
string
.
IsNullOrEmpty
(
com
.
PositionNum
))
{
{
usedposlist
.
Add
(
com
.
PositionNum
);
usedposlist
.
Add
(
com
.
PositionNum
);
pnposlist
[
com
.
PN
]
=
com
.
PositionNum
;
pnposlist
[
com
.
PN
]
=
com
.
PositionNum
;
}
}
}
}
//com.PositionNum = GetPositionNum(com.PositionNum);
#
endregion
//if (!string.IsNullOrEmpty(com.PositionNum))
foreach
(
var
com
in
componetlist
)
//{
// 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
)
{
{
if
(
string
.
IsNullOrWhiteSpace
(
com
.
PositionNum
)
&&
!
string
.
IsNullOrWhiteSpace
(
com
.
PN
))
if
(
string
.
IsNullOrWhiteSpace
(
com
.
PositionNum
)
&&
!
string
.
IsNullOrWhiteSpace
(
com
.
PN
))
...
@@ -253,8 +341,7 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -253,8 +341,7 @@ namespace TSA_V.LoadCSVLibrary
// continue;
// continue;
//}
//}
}
}
return
componetlist
;
return
componedate
;
}
}
public
static
string
[]
GetPositionNum
(
string
configPosition
)
public
static
string
[]
GetPositionNum
(
string
configPosition
)
{
{
...
@@ -471,18 +558,37 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -471,18 +558,37 @@ namespace TSA_V.LoadCSVLibrary
return
null
;
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
))
if
(
allComMap
.
ContainsKey
(
bomName
))
{
{
List
<
ComponetInfo
>
map
=
allComMap
[
bomName
];
List
<
ComponetInfo
>
map
=
allComMap
[
bomName
];
foreach
(
ComponetInfo
obj
in
map
)
foreach
(
ComponetInfo
obj
in
map
)
{
{
if
(
issamecom
)
{
if
(
obj
.
IsSameComAndCount
(
pointInfo
))
{
return
obj
;
}
}
else
{
if
(
obj
.
IsSameCom
(
pointInfo
))
if
(
obj
.
IsSameCom
(
pointInfo
))
{
{
return
obj
;
return
obj
;
}
}
}
}
}
foreach
(
ComponetInfo
obj
in
map
)
foreach
(
ComponetInfo
obj
in
map
)
{
{
if
(
obj
.
PN
.
Equals
(
pointInfo
.
PN
))
if
(
obj
.
PN
.
Equals
(
pointInfo
.
PN
))
...
...
DeviceLibrary/csvLoad/position/ComponetInfo.cs
查看文件 @
2b1aebf
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
...
@@ -48,8 +49,7 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -48,8 +49,7 @@ namespace TSA_V.LoadCSVLibrary
///位置
///位置
/// </summary>
/// </summary>
[
CSVAttribute
(
"PNum"
,
true
,
"料盘位置"
,
"位置"
,
"PositionNum"
,
"Lot"
)]
[
CSVAttribute
(
"PNum"
,
true
,
"料盘位置"
,
"位置"
,
"PositionNum"
,
"Lot"
)]
public
string
PositionNum
{
get
;
set
;
}
public
string
PositionNum
{
get
;
set
;}
/// <summary>
/// <summary>
///X坐标
///X坐标
/// </summary>
/// </summary>
...
@@ -122,5 +122,14 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -122,5 +122,14 @@ namespace TSA_V.LoadCSVLibrary
}
}
return
false
;
return
false
;
}
}
public
bool
IsSameComAndCount
(
SMTPointInfo
point
)
{
if
(
this
.
PN
.
Equals
(
point
.
PN
)
&&
int
.
Parse
(
this
.
ComCount
)
>
0
)
{
return
true
;
}
return
false
;
}
}
}
}
}
DeviceLibrary/manager/BoardManager.cs
查看文件 @
2b1aebf
DeviceLibrary/manager/WorkInfo.cs
查看文件 @
2b1aebf
using
PUSICANLibrary
;
using
PUSICANLibrary
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading
;
using
TSA_V.Common
;
using
TSA_V.Common
;
...
@@ -197,35 +198,12 @@ namespace TSA_V.DeviceLibrary
...
@@ -197,35 +198,12 @@ namespace TSA_V.DeviceLibrary
currPoint
=
GetSmtList
()[
currIndex
];
currPoint
=
GetSmtList
()[
currIndex
];
//LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + currPoint.pointName + "】");
//LogUtil.info(" 程序【" + currBoard.boardName + "】插件【" + currPoint.pointName + "】");
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
currBoard
.
bomName
,
currPoint
);
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
currBoard
.
bomName
,
currPoint
,
true
);
TSAVPosition
position
=
null
;
TSAVPosition
position
=
null
;
if
(
com
!=
null
)
if
(
com
!=
null
)
{
{
#
region
2023
-
10
-
31
添加
#
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
);
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
}
//记录运行过程的位号
//记录运行过程的位号
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
currBoard
.
boardName
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
currBoard
.
boardName
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
currIndex
.
ToString
());
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
currIndex
.
ToString
());
...
@@ -235,7 +213,6 @@ namespace TSA_V.DeviceLibrary
...
@@ -235,7 +213,6 @@ namespace TSA_V.DeviceLibrary
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
""
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
""
);
}
}
#
endregion
#
endregion
//position = CSVPositionReader<TSAVPosition>.GetPositonByNum(com.PositionNum);
useComponets
.
Add
(
com
);
useComponets
.
Add
(
com
);
}
}
else
else
...
...
TSA-V/FrmAddBoard.cs
查看文件 @
2b1aebf
...
@@ -204,7 +204,8 @@ namespace TSA_V
...
@@ -204,7 +204,8 @@ namespace TSA_V
{
{
nodeXValue
=
(
board
.
originX
+
(
double
)(
x
*
xNodeChange
*
xFangxiang
));
nodeXValue
=
(
board
.
originX
+
(
double
)(
x
*
xNodeChange
*
xFangxiang
));
nodeYValue
=
(
board
.
originY
+
(
double
)(
y
*
yNodeChange
*
yFangxiang
));
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
));
nodeXValue
=
(
board
.
originX
-
(
double
)(
x
*
xNodeChange
*
xFangxiang
));
nodeYValue
=
(
board
.
originY
-
(
double
)(
y
*
yNodeChange
*
yFangxiang
));
nodeYValue
=
(
board
.
originY
-
(
double
)(
y
*
yNodeChange
*
yFangxiang
));
...
@@ -230,10 +231,12 @@ namespace TSA_V
...
@@ -230,10 +231,12 @@ namespace TSA_V
point
.
WeldTime
=
3
;
point
.
WeldTime
=
3
;
point
.
NeedCheck
=
true
;
point
.
NeedCheck
=
true
;
point
.
NeedSoldering
=
true
;
point
.
NeedSoldering
=
true
;
LogUtil
.
info
(
"新增【"
+
board
.
boardName
+
"】元器件【"
+
point
.
PN
+
"】导入【"
+
com
.
PositionX
+
","
+
com
.
PositionY
+
"】图片【"
+
point
.
PositionX
+
","
+
point
.
PositionY
+
"】红点【"
+
nodeXValue
+
","
+
nodeYValue
+
"】"
);
if
(
com
.
Id
!=-
1
)
{
LogUtil
.
info
(
"新增【"
+
board
.
boardName
+
"】元器件【"
+
point
.
PN
+
"】导入【"
+
com
.
PositionX
+
","
+
com
.
PositionY
+
"】图片【"
+
point
.
PositionX
+
","
+
point
.
PositionY
+
"】红点【"
+
nodeXValue
+
","
+
nodeYValue
+
"】"
);
smtList
.
Add
(
point
);
smtList
.
Add
(
point
);
i
++;
i
++;
}
}
}
if
(!
rdbSelCom
.
Checked
)
if
(!
rdbSelCom
.
Checked
)
{
{
...
...
TSA-V/FrmBoardInfo.cs
查看文件 @
2b1aebf
...
@@ -26,7 +26,8 @@ namespace TSA_V
...
@@ -26,7 +26,8 @@ namespace TSA_V
private
FrmBoardInfo
()
private
FrmBoardInfo
()
{
{
InitializeComponent
();
display
.
SetPic
(
picBoard
,
panBoard
);
InitializeComponent
();
display
.
SetPic
(
picBoard
,
panBoard
);
CheckForIllegalCrossThreadCalls
=
false
;
CheckForIllegalCrossThreadCalls
=
false
;
}
}
public
void
SetBoard
(
BoardInfo
board
)
public
void
SetBoard
(
BoardInfo
board
)
...
@@ -54,10 +55,6 @@ namespace TSA_V
...
@@ -54,10 +55,6 @@ namespace TSA_V
isFinishLoad
=
false
;
isFinishLoad
=
false
;
chbNormal
.
Checked
=
true
;
chbNormal
.
Checked
=
true
;
chbShowName
.
Checked
=
true
;
chbShowName
.
Checked
=
true
;
if
(
isNew
==
false
)
if
(
isNew
==
false
)
{
{
AOIManager
.
LoadAOIFile
(
cmbAOIFile
,
updateBoardInfo
.
AOIProName
);
AOIManager
.
LoadAOIFile
(
cmbAOIFile
,
updateBoardInfo
.
AOIProName
);
...
...
TSA-V/FrmBoardInfo.resx
查看文件 @
2b1aebf
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
<data name="dataGridViewImageColumn1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="dataGridViewImageColumn1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGw
AAANRJREFUSEvtk8ENhSAMQBnAgHplD/c/w8UN1Dkg4adESJWKlsM/8ZIm0FIekCDC
vQAADr0BR/uQrQ
AAANRJREFUSEvtk8ENhSAMQBnAgHplD/c/w8UN1Dkg4adESJWKlsM/8ZIm0FIekCDC
n+iiZtgia20MLizRvu9BCBEDxhw+i7CkRfZJdBxHIUkBtS+8irZty5tqrckxrHmjKsLPNc9zzKU5ME1T
n+iiZtgia20MLizRvu9BCBEDxhw+i7CkRfZJdBxHIUkBtS+8irZty5tqrckxrHmjKsLPNc9zzKU5ME1T
nr8946MIS5RSZ/YqAqCWcjUZKcISODUm5THjOOb8k6wQGWNyE75JItXuSClzDfa4U3TAZ4TF0EjxJAKG
nr8946MIS5RSZ/YqAqCWcjUZKcISODUm5THjOOb8k6wQGWNyE75JItXuSClzDfa4U3TAZ4TF0EjxJAKG
YYg16kOTHeu6Bu/9ObtSEznnYi8F3VGhJqrRRV2UYXcsyxKDC/9ojXRRIyH8ACKfopRlVag2AAAAAElF
YYg16kOTHeu6Bu/9ObtSEznnYi8F3VGhJqrRRV2UYXcsyxKDC/9ojXRRIyH8ACKfopRlVag2AAAAAElF
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
<data name="dataGridViewImageColumn2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="dataGridViewImageColumn2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
<value>
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGw
AAAONJREFUSEvtk00OhCAMRlkb49/We3j/tS70BuI1TAwzH8FOVQTrYla8pIkttg9I
vQAADr0BR/uQrQ
AAAONJREFUSEvtk00OhCAMRlkb49/We3j/tS70BuI1TAwzH8FOVQTrYla8pIkttg9I
UOZPJNFrxKKu62xIEYuUUjakJFESEd6OcRzNuq4uOxISbdtmpmly2ZFLR9/3dlCWZa5yJCQqy9KuYcaZ
UOZPJNFrxKKu62xIEYuUUjakJFESEd6OcRzNuq4uOxISbdtmpmly2ZFLR9/3dlCWZa5yJCQqy9KuYcaZ
S8cwDDQsz3NX/XEnqqqK1jDjjHdrWmtqwi45e51T1zXV0evDfwdfuKwoCle9ivhJ7iTgVgS4DLsGew6a
S8cwDDQsz3NX/XEnqqqK1jDjjHdrWmtqwi45e51T1zXV0evDfwdfuKwoCle9ivhJ7iTgVgS4DLsGew6a
pqE8JAFBEZjnmYa1bev9xj8xoiKwLAsNPQfWnvBIBPg17hG7Ls5jEeAyiQSIRABvxPdOYohFb0milxjz
pqE8JAFBEZjnmYa1bev9xj8xoiKwLAsNPQfWnvBIBPg17hG7Ls5jEeAyiQSIRABvxPdOYohFb0milxjz
...
...
TSA-V/FrmBoardList.cs
查看文件 @
2b1aebf
...
@@ -92,7 +92,6 @@ namespace TSA_V
...
@@ -92,7 +92,6 @@ namespace TSA_V
FrmBoardInfo
.
instance
.
Show
();
FrmBoardInfo
.
instance
.
Show
();
FrmBoardInfo
.
instance
.
SetBoard
(
board
);
FrmBoardInfo
.
instance
.
SetBoard
(
board
);
FrmBoardInfo
.
instance
.
LoadForm
();
FrmBoardInfo
.
instance
.
LoadForm
();
}
}
else
else
{
{
...
...
TSA-V/FrmComponentList.cs
查看文件 @
2b1aebf
TSA-V/Smart-Workstation.csproj
查看文件 @
2b1aebf
...
@@ -326,6 +326,7 @@
...
@@ -326,6 +326,7 @@
</EmbeddedResource>
</EmbeddedResource>
<EmbeddedResource Include="FrmBoardInfo.resx">
<EmbeddedResource Include="FrmBoardInfo.resx">
<DependentUpon>FrmBoardInfo.cs</DependentUpon>
<DependentUpon>FrmBoardInfo.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</EmbeddedResource>
<EmbeddedResource Include="FrmBoardList.resx">
<EmbeddedResource Include="FrmBoardList.resx">
<DependentUpon>FrmBoardList.cs</DependentUpon>
<DependentUpon>FrmBoardList.cs</DependentUpon>
...
...
TSA-V/workForm/FrmBoardSelect.cs
查看文件 @
2b1aebf
...
@@ -386,14 +386,23 @@ namespace TSA_V
...
@@ -386,14 +386,23 @@ namespace TSA_V
string
TagNumber
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
TagNumber
);
string
TagNumber
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
TagNumber
);
if
(!
string
.
IsNullOrEmpty
(
ProcedureName
)&&!
string
.
IsNullOrEmpty
(
TagNumber
))
if
(!
string
.
IsNullOrEmpty
(
ProcedureName
)&&!
string
.
IsNullOrEmpty
(
TagNumber
))
{
{
DialogResult
dr
=
MessageBox
.
Show
(
$
"有未结束的程序'{ProcedureName}',是否继续?"
,
"提示"
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
);
if
(
dr
==
DialogResult
.
OK
)
{
cmbBoardList
.
Text
=
ProcedureName
;
cmbBoardList
.
Text
=
ProcedureName
;
BoardInfo
board
=
(
BoardInfo
)
cmbBoardList
.
SelectedItem
;
BoardInfo
board
=
(
BoardInfo
)
cmbBoardList
.
SelectedItem
;
if
(
string
.
IsNullOrEmpty
(
board
.
boardName
))
{
MessageBox
.
Show
(
$
"未找到当前板子信息{ProcedureName},请检查!"
);
return
;
}
BoardManager
.
CurrBoard
=
board
;
BoardManager
.
CurrBoard
=
board
;
FrmWork
fw
=
new
FrmWork
(
);
FrmWork
fw
=
new
FrmWork
(
true
);
this
.
Hide
();
this
.
Hide
();
this
.
Close
();
this
.
Close
();
fw
.
ShowDialog
();
fw
.
ShowDialog
();
}
}
}
}
}
}
}
}
}
TSA-V/workForm/FrmTSAV.cs
查看文件 @
2b1aebf
...
@@ -24,9 +24,11 @@ namespace TSA_V
...
@@ -24,9 +24,11 @@ namespace TSA_V
{
{
public
partial
class
FrmWork
:
FrmBase
public
partial
class
FrmWork
:
FrmBase
{
{
public
FrmWork
()
private
bool
isContinue
;
public
FrmWork
(
bool
iscontinue
=
false
)
{
{
InitializeComponent
();
InitializeComponent
();
isContinue
=
iscontinue
;
}
}
private
bool
isInitOk
=
false
;
private
bool
isInitOk
=
false
;
...
@@ -65,15 +67,15 @@ namespace TSA_V
...
@@ -65,15 +67,15 @@ namespace TSA_V
workSmtList
=
board
.
GetSmtList
();
workSmtList
=
board
.
GetSmtList
();
preIndex
=
-
1
;
preIndex
=
-
1
;
smtPoint
=
new
SMTPointInfo
();
smtPoint
=
new
SMTPointInfo
();
timerShowForm
.
Stop
();
timerShowForm
.
Stop
();
//获取记录运行未完成的步骤序号
int
TagNumber
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TagNumber
);
int
TagNumber
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TagNumber
);
if
(
workSmtList
.
Count
>
0
&&
TagNumber
!=
0
)
if
(
workSmtList
.
Count
>
0
&&
TagNumber
!=
0
&&
isContinue
)
{
{
//int TagNumber =ConfigAppSettings.GetIntValue(Setting_Init.TagNumber);
var
workSmt
=
workSmtList
.
Single
(
a
=>
a
.
pointNum
==
TagNumber
);
var
workSmt
=
workSmtList
.
Where
(
a
=>
a
.
pointNum
==
TagNumber
).
FirstOrDefault
();
smtPoint
=
workSmt
;
smtPoint
=
workSmt
;
preIndex
=
TagNumber
-
1
;
//索引从0开始
preIndex
=
TagNumber
-
1
;
}
}
else
else
{
{
...
@@ -584,38 +586,10 @@ namespace TSA_V
...
@@ -584,38 +586,10 @@ namespace TSA_V
lblPartNum
.
Text
=
smtPoint
.
TagNo
;
lblPartNum
.
Text
=
smtPoint
.
TagNo
;
lblPointName
.
Text
=
smtPoint
.
PN
;
lblPointName
.
Text
=
smtPoint
.
PN
;
#
region
2023
-
10
-
31
修改
#
region
2023
-
10
-
31
修改
ComponetInfo
com
=
null
;
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
BoardManager
.
CurrBoard
.
bomName
,
smtPoint
,
true
);
com
=
CSVBomManager
.
GetCom
(
BoardManager
.
CurrBoard
.
bomName
,
smtPoint
);
if
(
com
!=
null
)
if
(
com
!=
null
)
{
{
TSAVPosition
position
=
null
;
TSAVPosition
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
if
(
int
.
Parse
(
com
.
ComCount
)
<=
0
)
{
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}");
}
else
{
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
if
(
position
!=
null
)
if
(
position
!=
null
)
{
{
lblPositionNum
.
Text
=
position
.
PositionNum
;
lblPositionNum
.
Text
=
position
.
PositionNum
;
...
@@ -626,22 +600,10 @@ namespace TSA_V
...
@@ -626,22 +600,10 @@ namespace TSA_V
lblCount
.
Text
=
com
.
ComCount
.
ToString
();
lblCount
.
Text
=
com
.
ComCount
.
ToString
();
txtCount
.
Text
=
com
.
ComCount
.
ToString
();
txtCount
.
Text
=
com
.
ComCount
.
ToString
();
lblComNotices
.
Text
=
com
.
Notes
.
ToString
();
lblComNotices
.
Text
=
com
.
Notes
.
ToString
();
if
(
int
.
Parse
(
com
.
ComCount
)
<=
0
)
{
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
.
ProcedureName
,
board
.
boardName
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
smtPoint
.
pointNum
.
ToString
());
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
smtPoint
.
pointNum
.
ToString
());
...
@@ -859,39 +821,41 @@ namespace TSA_V
...
@@ -859,39 +821,41 @@ namespace TSA_V
}
}
FrmProjectorScreen
.
instance
.
ShowPoint
(
true
,
smtPoint
);
FrmProjectorScreen
.
instance
.
ShowPoint
(
true
,
smtPoint
);
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
this
.
board
.
bomName
,
smtPoint
);
#
region
这段代码是不是没必要
TSAVPosition
position
=
null
;
//ComponetInfo com = CSVBomManager.GetCom(this.board.bomName, smtPoint,true);
if
(
com
!=
null
)
//TSAVPosition position = 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)
//if (com != null)
//{
//{
// count = com.ComCount.ToString();
// position = CSVPositionReader<TSAVPosition>.GetPositonByNum(com.PositionNum);
// pnname = com.PN.ToString();
//}
// ComponentDes = com.ComponentDes;
//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;
//}
//}
////调用指示灯显示
//ScanRequestLabel.RequestPost(position, count, pnname, ComponentDes);
#
endregion
#
endregion
lblPositionNum
.
Text
=
position
.
PositionNum
;
}
int
leftCount
=
workSmtList
.
Count
-
1
-
preIndex
;
int
leftCount
=
workSmtList
.
Count
-
1
-
preIndex
;
if
(
preIndex
.
Equals
(
0
))
if
(
preIndex
.
Equals
(
0
))
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论