Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 62c5dc32
由
LN
编写于
2022-12-13 16:07:29 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch '无轨道开发' of
http://106.15.194.121:8083/lina/Line-Smart-Workstation
into 无轨道开发
2 个父辈
9e26bb06
9a3dfd31
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
58 行增加
和
10 行删除
DeviceLibrary/csvLoad/CSVBomManager.cs
TSA-V/FrmAddBoard.cs
TSA-V/FrmBoardInfo.cs
DeviceLibrary/csvLoad/CSVBomManager.cs
查看文件 @
62c5dc3
...
@@ -4,6 +4,7 @@ using System.IO;
...
@@ -4,6 +4,7 @@ using System.IO;
using
System.Linq
;
using
System.Linq
;
using
System.Reflection
;
using
System.Reflection
;
using
System.Text
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
using
TSA_V.Common
;
using
TSA_V.Common
;
...
@@ -148,6 +149,12 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -148,6 +149,12 @@ namespace TSA_V.LoadCSVLibrary
{
{
value
=
"0"
;
value
=
"0"
;
}
}
if
(
proName
==
"PositionX"
||
proName
==
"PositionY"
)
{
value
=
Regex
.
Match
(
value
,
@"\d+\.\d+|\d+"
).
Value
;
if
(
value
==
""
)
value
=
"0"
;
}
//如果属性存在
//如果属性存在
prop
.
SetValue
(
bllIns
,
Convert
.
ChangeType
(
value
,
prop
.
PropertyType
),
null
);
//赋值****在这里需要考虑类型问题
prop
.
SetValue
(
bllIns
,
Convert
.
ChangeType
(
value
,
prop
.
PropertyType
),
null
);
//赋值****在这里需要考虑类型问题
}
}
...
@@ -156,12 +163,7 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -156,12 +163,7 @@ namespace TSA_V.LoadCSVLibrary
}
}
ComponetInfo
com
=
(
ComponetInfo
)
bllIns
;
ComponetInfo
com
=
(
ComponetInfo
)
bllIns
;
com
.
Id
=
index
+
1
;
com
.
Id
=
index
+
1
;
com
.
PositionNum
=
GetPositionNum
(
com
.
PositionNum
);
if
(
String
.
IsNullOrEmpty
(
com
.
PositionNum
)
||
String
.
IsNullOrEmpty
(
com
.
PN
))
{
LOGGER
.
Error
(
"读取csv,index="
+
index
+
",数据不完整,跳过数据,line="
+
line
);
continue
;
}
comList
.
Add
(
com
);
comList
.
Add
(
com
);
}
}
else
else
...
@@ -177,6 +179,46 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -177,6 +179,46 @@ namespace TSA_V.LoadCSVLibrary
index
++;
index
++;
}
}
Dictionary
<
string
,
string
>
pnposlist
=
new
Dictionary
<
string
,
string
>();
HashSet
<
string
>
usedposlist
=
new
HashSet
<
string
>();
foreach
(
var
com
in
comList
)
{
if
(
string
.
IsNullOrWhiteSpace
(
com
.
PositionNum
))
continue
;
com
.
PositionNum
=
GetPositionNum
(
com
.
PositionNum
);
if
(!
string
.
IsNullOrEmpty
(
com
.
PositionNum
))
{
usedposlist
.
Add
(
com
.
PositionNum
);
pnposlist
[
com
.
PN
]
=
com
.
PositionNum
;
}
}
foreach
(
var
com
in
comList
)
{
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;
//}
}
return
comList
;
return
comList
;
}
}
public
static
string
GetPositionNum
(
string
configPosition
)
public
static
string
GetPositionNum
(
string
configPosition
)
...
@@ -188,6 +230,8 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -188,6 +230,8 @@ namespace TSA_V.LoadCSVLibrary
}
}
return
""
;
return
""
;
}
}
public
static
bool
UpdateComponet
(
string
bomName
,
ComponetInfo
com
)
public
static
bool
UpdateComponet
(
string
bomName
,
ComponetInfo
com
)
{
{
if
(!
allComMap
.
ContainsKey
(
bomName
))
if
(!
allComMap
.
ContainsKey
(
bomName
))
...
...
TSA-V/FrmAddBoard.cs
查看文件 @
62c5dc3
...
@@ -99,7 +99,7 @@ namespace TSA_V
...
@@ -99,7 +99,7 @@ namespace TSA_V
return
false
;
return
false
;
}
}
board
.
LineWidth
=
FormUtil
.
GetIntValue
(
txtLineWidth
);
board
.
LineWidth
=
FormUtil
.
GetIntValue
(
txtLineWidth
);
if
(
board
.
LineWidth
<=
0
)
if
(
board
.
LineWidth
<=
0
&&
!
IOBase
.
NoLine
)
{
{
board
.
LineWidth
=
board
.
boardWidth
;
board
.
LineWidth
=
board
.
boardWidth
;
txtLineWidth
.
Text
=
board
.
LineWidth
.
ToString
();
txtLineWidth
.
Text
=
board
.
LineWidth
.
ToString
();
...
@@ -372,8 +372,9 @@ namespace TSA_V
...
@@ -372,8 +372,9 @@ namespace TSA_V
private
void
btnOpenFile_Click
(
object
sender
,
LinkLabelLinkClickedEventArgs
e
)
private
void
btnOpenFile_Click
(
object
sender
,
LinkLabelLinkClickedEventArgs
e
)
{
{
openFileDialogImg
.
InitialDirectory
=
Environment
.
GetFolderPath
(
Environment
.
SpecialFolder
.
DesktopDirectory
);
openFileDialogImg
.
InitialDirectory
=
Environment
.
GetFolderPath
(
Environment
.
SpecialFolder
.
DesktopDirectory
);
openFileDialogImg
.
DefaultExt
=
"jpg|gif|bmp|png|jpeg"
;
//openFileDialogImg.DefaultExt = "jpg|gif|bmp|png|jpeg";
openFileDialogImg
.
Filter
=
"jpg|*.jpg|gif|*.gif|bmp|*.bmp|png|*.png|jpeg|*.jpeg"
;
//openFileDialogImg.Filter = "jpg|*.jpg|gif|*.gif|bmp|*.bmp|png|*.png|jpeg|*.jpeg";
openFileDialogImg
.
Filter
=
"Image Files|*.bmp;*.jpg;*.gif;*.png;*jpeg"
;
string
directory
=
Environment
.
GetFolderPath
(
Environment
.
SpecialFolder
.
DesktopDirectory
);
//桌面路径
string
directory
=
Environment
.
GetFolderPath
(
Environment
.
SpecialFolder
.
DesktopDirectory
);
//桌面路径
openFileDialogImg
.
InitialDirectory
=
directory
;
openFileDialogImg
.
InitialDirectory
=
directory
;
if
(
openFileDialogImg
.
ShowDialog
()
==
DialogResult
.
OK
)
if
(
openFileDialogImg
.
ShowDialog
()
==
DialogResult
.
OK
)
...
...
TSA-V/FrmBoardInfo.cs
查看文件 @
62c5dc3
...
@@ -603,12 +603,15 @@ namespace TSA_V
...
@@ -603,12 +603,15 @@ namespace TSA_V
txtBoardL
.
Focus
();
txtBoardL
.
Focus
();
return
;
return
;
}
}
if
(
board
.
LineWidth
<=
0
)
if
(!
IOBase
.
NoLine
&&
board
.
LineWidth
<=
0
)
{
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
WriteLineWidth
,
"请输入线体宽度"
));
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
WriteLineWidth
,
"请输入线体宽度"
));
txtLineWidth
.
Focus
();
txtLineWidth
.
Focus
();
return
;
return
;
}
}
else
board
.
LineWidth
=
1
;
if
(
picBoard
.
Image
==
null
)
if
(
picBoard
.
Image
==
null
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论