Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 842be756
由
贾鹏旭
编写于
2023-10-31 15:53:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.多料盘位置放一种同一种物料
2.程序运行中当前物料为0时,获取元器件库其他位置相同物料 3.新建程序上传excel,重新解析规则
1 个父辈
0b9c6bfc
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
231 行增加
和
46 行删除
Common/Setting_Init.cs
Common/util/ConfigAppSettings.cs
DeviceLibrary/csvLoad/CSVBomManager.cs
DeviceLibrary/csvLoad/position/ComponetInfo.cs
DeviceLibrary/manager/WorkInfo.cs
TSA-V/App.config
TSA-V/FrmBoardInfo.cs
TSA-V/FrmBoardPutCom.cs
TSA-V/FrmComponentList.cs
TSA-V/FrmPutCom.cs
TSA-V/Smart-Workstation.csproj
TSA-V/workForm/FrmBoardSelect.cs
TSA-V/workForm/FrmTSAV.Designer.cs
TSA-V/workForm/FrmTSAV.cs
Common/Setting_Init.cs
查看文件 @
842be75
...
@@ -175,5 +175,15 @@ namespace TSA_V.Common
...
@@ -175,5 +175,15 @@ namespace TSA_V.Common
public
static
string
OfflineMode
=
"OfflineMode"
;
public
static
string
OfflineMode
=
"OfflineMode"
;
public
static
string
PointDisplayType
=
"PointDisplayType"
;
public
static
string
PointDisplayType
=
"PointDisplayType"
;
/// <summary>
/// 运行中断程序名称
/// </summary>
public
static
string
ProcedureName
=
"ProcedureName"
;
/// <summary>
/// 位号
/// </summary>
public
static
string
TagNumber
=
"TagNumber"
;
}
}
}
}
Common/util/ConfigAppSettings.cs
查看文件 @
842be75
...
@@ -242,5 +242,13 @@ namespace TSA_V.Common
...
@@ -242,5 +242,13 @@ namespace TSA_V.Common
LogUtil
.
error
(
LOGGER
,
"SetValue保存配置出错:AppKey="
+
AppKey
+
",AppValue="
+
AppValue
+
","
+
ex
.
StackTrace
);
LogUtil
.
error
(
LOGGER
,
"SetValue保存配置出错:AppKey="
+
AppKey
+
",AppValue="
+
AppValue
+
","
+
ex
.
StackTrace
);
}
}
}
}
public
static
void
UpdateAppSetting
(
string
key
,
string
value
)
{
Configuration
configuration
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
configuration
.
AppSettings
.
Settings
[
key
].
Value
=
value
;
configuration
.
Save
(
ConfigurationSaveMode
.
Modified
);
ConfigurationManager
.
RefreshSection
(
"appSettings"
);
}
}
}
}
}
DeviceLibrary/csvLoad/CSVBomManager.cs
查看文件 @
842be75
...
@@ -181,18 +181,54 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -181,18 +181,54 @@ namespace TSA_V.LoadCSVLibrary
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
>();
foreach
(
var
com
in
comList
)
{
foreach
(
var
com
in
comList
)
{
if
(
string
.
IsNullOrWhiteSpace
(
com
.
PositionNum
))
if
(
string
.
IsNullOrWhiteSpace
(
com
.
PositionNum
))
continue
;
continue
;
com
.
PositionNum
=
GetPositionNum
(
com
.
PositionNum
);
if
(!
string
.
IsNullOrEmpty
(
com
.
PositionNum
))
string
[]
strarr
=
GetPositionNum
(
com
.
PositionNum
);
string
[]
intarr
=
com
.
ComCount
.
Split
(
';'
);
if
(
strarr
.
Length
!=+
intarr
.
Length
)
{
MessageBox
.
Show
(
$
"{com.PN}的数量分组{intarr.Length}和位置分组{strarr.Length},不统一!"
);
break
;
}
int
i
=
index
;
int
j
=
0
;
foreach
(
var
item
in
strarr
)
{
{
usedposlist
.
Add
(
com
.
PositionNum
);
ComponetInfo
componet
=
new
ComponetInfo
();
pnposlist
[
com
.
PN
]
=
com
.
PositionNum
;
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
))
{
usedposlist
.
Add
(
com
.
PositionNum
);
pnposlist
[
com
.
PN
]
=
com
.
PositionNum
;
}
}
}
//com.PositionNum = GetPositionNum(com.PositionNum);
//if (!string.IsNullOrEmpty(com.PositionNum))
//{
// usedposlist.Add(com.PositionNum);
// pnposlist[com.PN] = com.PositionNum;
//}
}
}
foreach
(
var
com
in
comList
)
{
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
))
{
{
...
@@ -218,17 +254,28 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -218,17 +254,28 @@ namespace TSA_V.LoadCSVLibrary
//}
//}
}
}
return
componedate
;
return
comList
;
}
}
public
static
string
GetPositionNum
(
string
configPosition
)
public
static
string
[]
GetPositionNum
(
string
configPosition
)
{
{
TSAVPosition
p
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
configPosition
);
string
[]
strings
=
configPosition
.
Split
(
';'
);
if
(
p
!=
null
)
string
[]
strarr
=
new
string
[
strings
.
Length
];
int
i
=
0
;
foreach
(
var
item
in
strings
)
{
{
return
p
.
PositionNum
;
TSAVPosition
p
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
item
);
if
(
p
!=
null
)
{
// return p.PositionNum;
strarr
[
i
]
=
p
.
PositionNum
;
}
else
{
strarr
[
i
]
=
""
;
}
i
++;
}
}
return
""
;
return
strarr
;
}
}
...
@@ -495,7 +542,7 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -495,7 +542,7 @@ namespace TSA_V.LoadCSVLibrary
{
{
if
(
comList
[
i
].
IsSameCom
(
smtPoint
))
if
(
comList
[
i
].
IsSameCom
(
smtPoint
))
{
{
comList
[
i
].
ComCount
=
count
;
comList
[
i
].
ComCount
=
count
.
ToString
()
;
updateOk
=
true
;
updateOk
=
true
;
break
;
break
;
}
}
...
@@ -507,7 +554,7 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -507,7 +554,7 @@ namespace TSA_V.LoadCSVLibrary
{
{
if
(
comList
[
i
].
PN
.
Equals
(
smtPoint
.
PN
))
if
(
comList
[
i
].
PN
.
Equals
(
smtPoint
.
PN
))
{
{
comList
[
i
].
ComCount
=
count
;
comList
[
i
].
ComCount
=
count
.
ToString
()
;
updateOk
=
true
;
updateOk
=
true
;
break
;
break
;
}
}
...
@@ -557,10 +604,10 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -557,10 +604,10 @@ namespace TSA_V.LoadCSVLibrary
List
<
ComponetInfo
>
list
=
(
from
m
in
useComponets
where
m
.
Id
.
Equals
(
obj
.
Id
)
select
m
).
ToList
();
List
<
ComponetInfo
>
list
=
(
from
m
in
useComponets
where
m
.
Id
.
Equals
(
obj
.
Id
)
select
m
).
ToList
();
if
(
list
.
Count
>
0
)
if
(
list
.
Count
>
0
)
{
{
obj
.
ComCount
=
obj
.
ComCount
-
list
.
Count
;
obj
.
ComCount
=
(
int
.
Parse
(
obj
.
ComCount
)
-
list
.
Count
).
ToString
()
;
if
(
obj
.
ComCount
<
0
)
if
(
int
.
Parse
(
obj
.
ComCount
)
<
0
)
{
{
obj
.
ComCount
=
0
;
obj
.
ComCount
=
"0"
;
}
}
}
}
newList
.
Add
(
obj
);
newList
.
Add
(
obj
);
...
...
DeviceLibrary/csvLoad/position/ComponetInfo.cs
查看文件 @
842be75
...
@@ -42,7 +42,7 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -42,7 +42,7 @@ namespace TSA_V.LoadCSVLibrary
///数量
///数量
/// </summary>
/// </summary>
[
CSVAttribute
(
"Count"
,
true
,
"数量"
,
"Quantity"
)]
[
CSVAttribute
(
"Count"
,
true
,
"数量"
,
"Quantity"
)]
public
int
ComCount
{
get
;
set
;
}
public
string
ComCount
{
get
;
set
;
}
/// <summary>
/// <summary>
///位置
///位置
...
@@ -116,7 +116,7 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -116,7 +116,7 @@ namespace TSA_V.LoadCSVLibrary
return
true
;
return
true
;
}
}
}
}
else
if
(
this
.
TagNo
.
Equals
(
point
.
TagNo
))
else
if
(
this
.
TagNo
.
Equals
(
point
.
TagNo
)
&&
this
.
PositionNum
.
Equals
(
point
.
PositionNum
)
)
{
{
return
true
;
return
true
;
}
}
...
...
DeviceLibrary/manager/WorkInfo.cs
查看文件 @
842be75
using
PUSICANLibrary
;
using
PUSICANLibrary
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading
;
using
TSA_V.Common
;
using
TSA_V.Common
;
using
TSA_V.DeviceLibrary.manager
;
using
TSA_V.DeviceLibrary.manager
;
...
@@ -200,7 +201,41 @@ namespace TSA_V.DeviceLibrary
...
@@ -200,7 +201,41 @@ namespace TSA_V.DeviceLibrary
TSAVPosition
position
=
null
;
TSAVPosition
position
=
null
;
if
(
com
!=
null
)
if
(
com
!=
null
)
{
{
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
#
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
);
}
//记录运行过程的位号
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
currBoard
.
boardName
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
currIndex
.
ToString
());
if
(
currPoint
.
pointNum
==
1
)
//第一个位号不需要记录
{
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
""
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
""
);
}
#
endregion
//position = CSVPositionReader<TSAVPosition>.GetPositonByNum(com.PositionNum);
useComponets
.
Add
(
com
);
useComponets
.
Add
(
com
);
}
}
else
else
...
@@ -212,7 +247,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -212,7 +247,7 @@ namespace TSA_V.DeviceLibrary
LogUtil
.
info
(
" 程序【"
+
currBoard
.
boardName
+
"】插件【"
+
currPoint
.
PN
+
"】未找到对应的元器件"
);
LogUtil
.
info
(
" 程序【"
+
currBoard
.
boardName
+
"】插件【"
+
currPoint
.
PN
+
"】未找到对应的元器件"
);
}
}
else
else
{
{
this
.
currPosition
=
position
;
this
.
currPosition
=
position
;
XYMove
();
XYMove
();
//插件机工作
//插件机工作
...
...
TSA-V/App.config
查看文件 @
842be75
...
@@ -124,6 +124,9 @@
...
@@ -124,6 +124,9 @@
<
add
key
=
"DisableBottomCylinder"
value
=
"1"
/>
<
add
key
=
"DisableBottomCylinder"
value
=
"1"
/>
<
add
key
=
"SMF_Serverurl"
value
=
"http://localhost:8800/"
/>
<
add
key
=
"SMF_Serverurl"
value
=
"http://localhost:8800/"
/>
<
add
key
=
"SMF_CID"
value
=
"NEOSTATION001"
/>
<
add
key
=
"SMF_CID"
value
=
"NEOSTATION001"
/>
<!--记录程序运行步骤-->
<
add
key
=
"ProcedureName"
value
=
"12343"
/>
<
add
key
=
"TagNumber"
value
=
"3"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"defaultAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"defaultAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
TSA-V/FrmBoardInfo.cs
查看文件 @
842be75
此文件的差异被折叠,
点击展开。
TSA-V/FrmBoardPutCom.cs
查看文件 @
842be75
...
@@ -160,7 +160,7 @@ namespace TSA_V
...
@@ -160,7 +160,7 @@ namespace TSA_V
int
newCount
=
(
int
)
numCount
.
Value
;
int
newCount
=
(
int
)
numCount
.
Value
;
ComponetInfo
com
=
comList
[
currIndex
];
ComponetInfo
com
=
comList
[
currIndex
];
com
.
ComCount
=
newCount
;
com
.
ComCount
=
newCount
.
ToString
()
;
CSVBomManager
.
UpdateComponet
(
bomName
,
com
);
CSVBomManager
.
UpdateComponet
(
bomName
,
com
);
}
}
private
void
btnNext_Click
(
object
sender
,
EventArgs
e
)
private
void
btnNext_Click
(
object
sender
,
EventArgs
e
)
...
...
TSA-V/FrmComponentList.cs
查看文件 @
842be75
...
@@ -159,7 +159,7 @@ namespace TSA_V
...
@@ -159,7 +159,7 @@ namespace TSA_V
obj
.
PN
=
FormUtil
.
getValue
(
txtName
);
obj
.
PN
=
FormUtil
.
getValue
(
txtName
);
obj
.
ComponentDes
=
FormUtil
.
getValue
(
txtDes
);
obj
.
ComponentDes
=
FormUtil
.
getValue
(
txtDes
);
obj
.
ComCount
=
FormUtil
.
GetIntValue
(
txtCount
);
obj
.
ComCount
=
FormUtil
.
GetIntValue
(
txtCount
)
.
ToString
()
;
obj
.
Notes
=
FormUtil
.
getValue
(
txtNotes
);
obj
.
Notes
=
FormUtil
.
getValue
(
txtNotes
);
obj
.
TagNo
=
FormUtil
.
getValue
(
txtPartNum
);
obj
.
TagNo
=
FormUtil
.
getValue
(
txtPartNum
);
obj
.
Id
=
FormUtil
.
GetIntValue
(
txtId
);
obj
.
Id
=
FormUtil
.
GetIntValue
(
txtId
);
...
@@ -173,7 +173,7 @@ namespace TSA_V
...
@@ -173,7 +173,7 @@ namespace TSA_V
return
;
return
;
}
}
if
(
obj
.
ComCount
<=
0
)
if
(
int
.
Parse
(
obj
.
ComCount
)
<=
0
)
{
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
WriteComNum
,
"请输入元器件数量!"
));
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
WriteComNum
,
"请输入元器件数量!"
));
txtCount
.
Focus
();
txtCount
.
Focus
();
...
@@ -226,7 +226,7 @@ namespace TSA_V
...
@@ -226,7 +226,7 @@ namespace TSA_V
obj
.
TagNo
=
FormUtil
.
getValue
(
txtPartNum
);
obj
.
TagNo
=
FormUtil
.
getValue
(
txtPartNum
);
obj
.
PN
=
FormUtil
.
getValue
(
txtName
);
obj
.
PN
=
FormUtil
.
getValue
(
txtName
);
obj
.
ComponentDes
=
FormUtil
.
getValue
(
txtDes
);
obj
.
ComponentDes
=
FormUtil
.
getValue
(
txtDes
);
obj
.
ComCount
=
FormUtil
.
GetIntValue
(
txtCount
);
obj
.
ComCount
=
FormUtil
.
GetIntValue
(
txtCount
)
.
ToString
()
;
obj
.
Notes
=
FormUtil
.
getValue
(
txtNotes
);
obj
.
Notes
=
FormUtil
.
getValue
(
txtNotes
);
obj
.
PositionNum
=
position
.
PositionNum
;
obj
.
PositionNum
=
position
.
PositionNum
;
//if (obj.TagNo.Equals(""))
//if (obj.TagNo.Equals(""))
...
@@ -258,7 +258,7 @@ namespace TSA_V
...
@@ -258,7 +258,7 @@ namespace TSA_V
return
;
return
;
}
}
if
(
obj
.
ComCount
<=
0
)
if
(
int
.
Parse
(
obj
.
ComCount
)
<=
0
)
{
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
WriteComNum
,
"请输入元器件数量!"
));
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
WriteComNum
,
"请输入元器件数量!"
));
txtCount
.
Focus
();
txtCount
.
Focus
();
...
@@ -316,7 +316,7 @@ namespace TSA_V
...
@@ -316,7 +316,7 @@ namespace TSA_V
point
.
ComponentDes
=
row
.
Cells
[
this
.
Column_description
.
Name
].
Value
.
ToString
();
point
.
ComponentDes
=
row
.
Cells
[
this
.
Column_description
.
Name
].
Value
.
ToString
();
point
.
Notes
=
row
.
Cells
[
this
.
Column_Notes
.
Name
].
Value
.
ToString
();
point
.
Notes
=
row
.
Cells
[
this
.
Column_Notes
.
Name
].
Value
.
ToString
();
point
.
PositionNum
=
row
.
Cells
[
this
.
Column_Position
.
Name
].
Value
.
ToString
();
point
.
PositionNum
=
row
.
Cells
[
this
.
Column_Position
.
Name
].
Value
.
ToString
();
point
.
ComCount
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
Column_Count
.
Name
].
Value
.
ToString
()
);
point
.
ComCount
=
row
.
Cells
[
this
.
Column_Count
.
Name
].
Value
.
ToString
(
);
point
.
Id
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
Column_ID
.
Name
].
Value
.
ToString
());
point
.
Id
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
Column_ID
.
Name
].
Value
.
ToString
());
}
}
...
@@ -373,11 +373,11 @@ namespace TSA_V
...
@@ -373,11 +373,11 @@ namespace TSA_V
int
selPosIndex
=
-
1
;
int
selPosIndex
=
-
1
;
int
index
=
-
1
;
int
index
=
-
1
;
string
posNum
=
CSVBomManager
.
GetPositionNum
(
obj
.
PositionNum
);
string
[]
posNum
=
CSVBomManager
.
GetPositionNum
(
obj
.
PositionNum
);
foreach
(
TSAVPosition
p
in
allPosition
)
foreach
(
TSAVPosition
p
in
allPosition
)
{
{
index
++;
index
++;
if
(
p
.
PositionNum
.
Equals
(
posNum
))
if
(
p
.
PositionNum
.
Equals
(
posNum
[
0
]
))
{
{
selPosIndex
=
index
;
selPosIndex
=
index
;
break
;
break
;
...
...
TSA-V/FrmPutCom.cs
查看文件 @
842be75
...
@@ -213,7 +213,7 @@ namespace TSA_V
...
@@ -213,7 +213,7 @@ namespace TSA_V
{
{
if
(
obj
.
PositionNum
.
Equals
(
com
.
PositionNum
))
if
(
obj
.
PositionNum
.
Equals
(
com
.
PositionNum
))
{
{
obj
.
ComCount
=
newCount
;
obj
.
ComCount
=
newCount
.
ToString
()
;
}
}
}
}
...
...
TSA-V/Smart-Workstation.csproj
查看文件 @
842be75
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
<HintPath>..\dll\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
<HintPath>..\dll\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
</Reference>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<Reference Include="System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\lib\net46\System.Data.SQLite.dll</HintPath>
<HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.3\lib\net46\System.Data.SQLite.dll</HintPath>
...
...
TSA-V/workForm/FrmBoardSelect.cs
查看文件 @
842be75
...
@@ -38,6 +38,7 @@ namespace TSA_V
...
@@ -38,6 +38,7 @@ namespace TSA_V
if
(!
IOBase
.
NoLine
)
if
(!
IOBase
.
NoLine
)
timer1
.
Start
();
timer1
.
Start
();
IsInitOk
=
true
;
IsInitOk
=
true
;
CheckIfHaveincomplete
();
}
}
private
void
LoadCom
()
private
void
LoadCom
()
{
{
...
@@ -376,5 +377,23 @@ namespace TSA_V
...
@@ -376,5 +377,23 @@ namespace TSA_V
//停止调宽
//停止调宽
LWidthManager
.
StopChangeWidth
();
LWidthManager
.
StopChangeWidth
();
}
}
private
void
CheckIfHaveincomplete
()
{
string
ProcedureName
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
ProcedureName
);
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
();
}
}
}
}
}
}
TSA-V/workForm/FrmTSAV.Designer.cs
查看文件 @
842be75
此文件的差异被折叠,
点击展开。
TSA-V/workForm/FrmTSAV.cs
查看文件 @
842be75
...
@@ -17,6 +17,8 @@ using AOI;
...
@@ -17,6 +17,8 @@ using AOI;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Net.Http
;
using
System.Net.Http
;
using
TSA_V.DeviceLibrary.manager
;
using
TSA_V.DeviceLibrary.manager
;
using
System.Linq
;
using
System.Configuration
;
namespace
TSA_V
namespace
TSA_V
{
{
...
@@ -27,11 +29,13 @@ namespace TSA_V
...
@@ -27,11 +29,13 @@ namespace TSA_V
InitializeComponent
();
InitializeComponent
();
}
}
private
bool
isInitOk
=
false
;
private
bool
isInitOk
=
false
;
private
BoardInfo
board
=
BoardManager
.
CurrBoard
;
private
BoardInfo
board
=
BoardManager
.
CurrBoard
;
private
PointDisplay
display
=
new
PointDisplay
();
private
PointDisplay
display
=
new
PointDisplay
();
private
List
<
SMTPointInfo
>
workSmtList
=
new
List
<
SMTPointInfo
>();
private
List
<
SMTPointInfo
>
workSmtList
=
new
List
<
SMTPointInfo
>();
private
void
FrmWelding_Load
(
object
sender
,
EventArgs
e
)
private
void
FrmWelding_Load
(
object
sender
,
EventArgs
e
)
{
{
btnCamera
.
Visible
=
TSAVBean
.
IsNeedAOI
;
btnCamera
.
Visible
=
TSAVBean
.
IsNeedAOI
;
TSAVBean
.
Work
.
WorkType
=
1
;
TSAVBean
.
Work
.
WorkType
=
1
;
LanguageProcess
();
LanguageProcess
();
...
@@ -63,7 +67,15 @@ namespace TSA_V
...
@@ -63,7 +67,15 @@ namespace TSA_V
smtPoint
=
new
SMTPointInfo
();
smtPoint
=
new
SMTPointInfo
();
timerShowForm
.
Stop
();
timerShowForm
.
Stop
();
if
(
workSmtList
.
Count
>
0
)
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开始
}
else
{
{
smtPoint
=
workSmtList
[
0
];
smtPoint
=
workSmtList
[
0
];
}
}
...
@@ -571,25 +583,74 @@ namespace TSA_V
...
@@ -571,25 +583,74 @@ namespace TSA_V
lblPositionNum
.
Text
=
smtPoint
.
PositionNum
;
lblPositionNum
.
Text
=
smtPoint
.
PositionNum
;
lblPartNum
.
Text
=
smtPoint
.
TagNo
;
lblPartNum
.
Text
=
smtPoint
.
TagNo
;
lblPointName
.
Text
=
smtPoint
.
PN
;
lblPointName
.
Text
=
smtPoint
.
PN
;
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
BoardManager
.
CurrBoard
.
bomName
,
smtPoint
);
#
region
2023
-
10
-
31
修改
ComponetInfo
com
=
null
;
com
=
CSVBomManager
.
GetCom
(
BoardManager
.
CurrBoard
.
bomName
,
smtPoint
);
if
(
com
!=
null
)
if
(
com
!=
null
)
{
{
TSAVPosition
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
com
.
PositionNum
);
TSAVPosition
position
=
null
;
if
(
int
.
Parse
(
com
.
ComCount
)
<=
0
)
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}");
}
else
{
{
lblPositionNum
.
Text
=
position
.
PositionNum
;
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
();
}
}
//if (position != null)
//{
// lblPositionNum.Text = position.PositionNum;
//}
lblComDes
.
Text
=
com
.
ComponentDes
;
//lblComDes.Text = com.ComponentDes;
this
.
lblComName
.
Text
=
com
.
PN
;
//this.lblComName.Text = com.PN;
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
(
com
.
ComCount
<=
0
)
//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
());
if
(
smtPoint
.
pointNum
==
1
)
//第一个位号不需要记录
{
{
lblComNotices
.
Text
=
ResourceCulture
.
GetString
(
"元器件数量不足,请及时补充"
,
"元器件数量不足,请及时补充"
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
ProcedureName
,
""
);
ConfigAppSettings
.
UpdateAppSetting
(
Setting_Init
.
TagNumber
,
""
);
}
}
#
endregion
}
}
else
else
{
{
...
@@ -676,6 +737,7 @@ namespace TSA_V
...
@@ -676,6 +737,7 @@ namespace TSA_V
return
;
return
;
}
}
preIndex
=
TSAVBean
.
Work
.
currIndex
;
preIndex
=
TSAVBean
.
Work
.
currIndex
;
smtPoint
=
TSAVBean
.
Work
.
currPoint
;
smtPoint
=
TSAVBean
.
Work
.
currPoint
;
ShowMsg
();
ShowMsg
();
...
@@ -839,7 +901,7 @@ namespace TSA_V
...
@@ -839,7 +901,7 @@ namespace TSA_V
else
if
(
leftCount
<=
0
)
else
if
(
leftCount
<=
0
)
{
{
lblStart
.
Visible
=
false
;
lblStart
.
Visible
=
false
;
lblLast
.
Visible
=
true
;
lblLast
.
Visible
=
true
;
}
}
else
else
{
{
...
@@ -854,7 +916,7 @@ namespace TSA_V
...
@@ -854,7 +916,7 @@ namespace TSA_V
else
else
{
{
lblBoardPoint
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
PointInfoMsg2
,
"当前:第{0}步"
,
(
preIndex
+
1
).
ToString
());
lblBoardPoint
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
PointInfoMsg2
,
"当前:第{0}步"
,
(
preIndex
+
1
).
ToString
());
}
}
Crop
(
Brushes
.
Red
);
Crop
(
Brushes
.
Red
);
if
(
timerShowForm
.
Enabled
.
Equals
(
false
))
if
(
timerShowForm
.
Enabled
.
Equals
(
false
))
{
{
...
@@ -1022,6 +1084,6 @@ namespace TSA_V
...
@@ -1022,6 +1084,6 @@ namespace TSA_V
{
{
FrmIoManager
frmWorkIo
=
new
FrmIoManager
(
true
);
FrmIoManager
frmWorkIo
=
new
FrmIoManager
(
true
);
frmWorkIo
.
ShowDialog
();
frmWorkIo
.
ShowDialog
();
}
}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论