Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f8494ff8
由
LN
编写于
2025-05-21 10:32:07 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
新增点位坐标错误问题修改。
1 个父辈
563ad074
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
53 行增加
和
18 行删除
DeviceLibrary/bean/BoardInfo.cs
DeviceLibrary/csvLoad/CSVBomManager.cs
TSA-V/frmBoard/FrmBoardInfo.cs
TSA-V/frmBoard/FrmPointInfo.cs
TSA-V/workForm/PointDisplay.cs
DeviceLibrary/bean/BoardInfo.cs
查看文件 @
f8494ff
...
@@ -410,15 +410,15 @@ namespace TSA_V.DeviceLibrary
...
@@ -410,15 +410,15 @@ namespace TSA_V.DeviceLibrary
this
.
PolarityAngle
=
p
.
PolarityAngle
;
this
.
PolarityAngle
=
p
.
PolarityAngle
;
}
}
public
ProjectorPInfo
GetShowPInfo
(
float
imageXiShu
=
1
)
public
ProjectorPInfo
GetShowPInfo
(
float
imageXiShu
=
1
,
float
imageYShu
=
1
)
{
{
ProjectorPInfo
p
=
new
ProjectorPInfo
(
PositionX
*
imageXiShu
,
PositionY
*
image
XiShu
,
PointType
,
PolaritiesType
,
PolarityAngle
,
(
int
)(
PointSizeX
*
imageXiShu
),
(
int
)(
PointSizeY
*
imageXi
Shu
),
(
int
)(
PenWidth
*
imageXiShu
),
ShowText
);
ProjectorPInfo
p
=
new
ProjectorPInfo
(
PositionX
*
imageXiShu
,
PositionY
*
image
YShu
,
PointType
,
PolaritiesType
,
PolarityAngle
,
(
int
)(
PointSizeX
*
imageXiShu
),
(
int
)(
PointSizeY
*
imageY
Shu
),
(
int
)(
PenWidth
*
imageXiShu
),
ShowText
);
return
p
;
return
p
;
}
}
public
ProjectorPInfo
GetScreenShowPInfo
(
float
imageXiShu
=
1
)
public
ProjectorPInfo
GetScreenShowPInfo
(
float
imageXiShu
=
1
,
float
imageYShu
=
1
)
{
{
ProjectorPInfo
p
=
new
ProjectorPInfo
(
NodePositionX
*
imageXiShu
,
NodePositionY
*
image
XiShu
,
PointType
,
PolaritiesType
,
PolarityAngle
,
(
int
)(
PointSizeX
*
imageXiShu
),
(
int
)(
PointSizeY
*
imageXi
Shu
),
(
int
)(
PenWidth
*
imageXiShu
),
ShowText
);
ProjectorPInfo
p
=
new
ProjectorPInfo
(
NodePositionX
*
imageXiShu
,
NodePositionY
*
image
YShu
,
PointType
,
PolaritiesType
,
PolarityAngle
,
(
int
)(
PointSizeX
*
imageXiShu
),
(
int
)(
PointSizeY
*
imageY
Shu
),
(
int
)(
PenWidth
*
imageXiShu
),
ShowText
);
return
p
;
return
p
;
}
}
...
...
DeviceLibrary/csvLoad/CSVBomManager.cs
查看文件 @
f8494ff
...
@@ -24,7 +24,7 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -24,7 +24,7 @@ namespace TSA_V.LoadCSVLibrary
{
{
if
(
allComMap
.
ContainsKey
(
bomName
))
if
(
allComMap
.
ContainsKey
(
bomName
))
{
{
return
new
List
<
ComponetInfo
>(
allComMap
[
bomName
]
);
return
new
List
<
ComponetInfo
>(
allComMap
[
bomName
]);
}
}
else
else
{
{
...
@@ -36,7 +36,10 @@ namespace TSA_V.LoadCSVLibrary
...
@@ -36,7 +36,10 @@ namespace TSA_V.LoadCSVLibrary
return
list
;
return
list
;
}
}
}
}
return
null
;
LogUtil
.
error
(
"bomName="
+
bomName
+
" 未找到元器件列表"
);
return
new
List
<
ComponetInfo
>();
}
}
public
static
bool
BomNameIsExists
(
string
bomName
)
public
static
bool
BomNameIsExists
(
string
bomName
)
...
...
TSA-V/frmBoard/FrmBoardInfo.cs
查看文件 @
f8494ff
...
@@ -484,7 +484,7 @@ namespace TSA_V
...
@@ -484,7 +484,7 @@ namespace TSA_V
}
}
private
void
MoveTest
(
int
rowIndex
)
private
void
MoveTest
(
int
rowIndex
,
bool
showMsg
=
true
)
{
{
//移动测试
//移动测试
//double x = Double.Parse(dgvList.Rows[rowIndex].Cells[this.Column_NodeX.Name].Value.ToString());
//double x = Double.Parse(dgvList.Rows[rowIndex].Cells[this.Column_NodeX.Name].Value.ToString());
...
@@ -501,9 +501,13 @@ namespace TSA_V
...
@@ -501,9 +501,13 @@ namespace TSA_V
//判断位置是否超出范围
//判断位置是否超出范围
if
(!
TSAVBean
.
IsValidPosition
(
point
.
NodePositionX
,
point
.
NodePositionY
))
if
(!
TSAVBean
.
IsValidPosition
(
point
.
NodePositionX
,
point
.
NodePositionY
))
{
{
if
(
showMsg
)
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
PositionError
,
"位置:{0},{1}无效,请检查配置是否正确?"
,
point
.
NodePositionX
,
point
.
NodePositionY
),
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
PositionError
,
"位置:{0},{1}无效,请检查配置是否正确?"
,
point
.
NodePositionX
,
point
.
NodePositionY
),
ResourceCulture
.
GetString
(
ResourceCulture
.
MsgTitle
,
"提示?"
),
MessageBoxButtons
.
OK
);
ResourceCulture
.
GetString
(
ResourceCulture
.
MsgTitle
,
"提示?"
),
MessageBoxButtons
.
OK
);
}
}
}
else
else
{
{
FrmProjectorScreen
.
instance
.
ClearPoint
();
FrmProjectorScreen
.
instance
.
ClearPoint
();
...
@@ -805,6 +809,7 @@ namespace TSA_V
...
@@ -805,6 +809,7 @@ namespace TSA_V
loadPictureBoxSize
(
pointList
);
loadPictureBoxSize
(
pointList
);
}
}
private
float
imageXiShu
=
1
;
private
float
imageXiShu
=
1
;
private
float
imageYShu
=
1
;
private
int
selectIndex
=
0
;
private
int
selectIndex
=
0
;
private
void
loadPictureBoxSize
(
List
<
SMTPointInfo
>
pointList
=
null
)
private
void
loadPictureBoxSize
(
List
<
SMTPointInfo
>
pointList
=
null
)
{
{
...
@@ -879,7 +884,7 @@ namespace TSA_V
...
@@ -879,7 +884,7 @@ namespace TSA_V
DataGridViewRow
row
=
dgvList
.
Rows
[
rowIndex
];
DataGridViewRow
row
=
dgvList
.
Rows
[
rowIndex
];
SMTPointInfo
smtInfo
=
getRowPointInfo
(
row
);
SMTPointInfo
smtInfo
=
getRowPointInfo
(
row
);
panBoard
.
AutoScrollPosition
=
new
Point
((
int
)(
smtInfo
.
PositionX
*
display
.
imageXiShu
-
panBoard
.
Width
/
2
),
(
int
)(
smtInfo
.
PositionY
*
display
.
image
Xi
Shu
-
panBoard
.
Height
/
2
));
panBoard
.
AutoScrollPosition
=
new
Point
((
int
)(
smtInfo
.
PositionX
*
display
.
imageXiShu
-
panBoard
.
Width
/
2
),
(
int
)(
smtInfo
.
PositionY
*
display
.
image
Y
Shu
-
panBoard
.
Height
/
2
));
// panBoard.AutoScrollPosition = new Point((int)picBoard.Width, (int)picBoard.Height);
// panBoard.AutoScrollPosition = new Point((int)picBoard.Width, (int)picBoard.Height);
if
(
isFinishLoad
&&
this
.
txtBoardW
.
Text
.
Trim
()
!=
""
&&
this
.
txtBoardL
.
Text
.
Trim
()
!=
""
)
if
(
isFinishLoad
&&
this
.
txtBoardW
.
Text
.
Trim
()
!=
""
&&
this
.
txtBoardL
.
Text
.
Trim
()
!=
""
)
{
{
...
@@ -1211,7 +1216,7 @@ namespace TSA_V
...
@@ -1211,7 +1216,7 @@ namespace TSA_V
return
;
return
;
}
}
double
x
=
m_MouseDownPointX
/
imageXiShu
;
double
x
=
m_MouseDownPointX
/
imageXiShu
;
double
y
=
m_MouseDownPointY
/
image
Xi
Shu
;
double
y
=
m_MouseDownPointY
/
image
Y
Shu
;
x
=
Math
.
Round
(
x
,
0
,
MidpointRounding
.
AwayFromZero
);
x
=
Math
.
Round
(
x
,
0
,
MidpointRounding
.
AwayFromZero
);
y
=
Math
.
Round
(
y
,
0
,
MidpointRounding
.
AwayFromZero
);
y
=
Math
.
Round
(
y
,
0
,
MidpointRounding
.
AwayFromZero
);
...
@@ -1247,6 +1252,7 @@ namespace TSA_V
...
@@ -1247,6 +1252,7 @@ namespace TSA_V
记录为组装坐标
ToolStripMenuItem
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
ItemTextUpdateP
,
"更新为【{0}-{1}】的位置"
,
partNum
,
name
);
记录为组装坐标
ToolStripMenuItem
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
ItemTextUpdateP
,
"更新为【{0}-{1}】的位置"
,
partNum
,
name
);
UpdateSelPoint
(
rowIndex
);
UpdateSelPoint
(
rowIndex
);
MoveTest
(
rowIndex
,
false
);
}
}
}
}
}
}
...
@@ -1260,7 +1266,7 @@ namespace TSA_V
...
@@ -1260,7 +1266,7 @@ namespace TSA_V
return
;
return
;
}
}
double
x
=
m_MouseDownPointX
/
imageXiShu
;
double
x
=
m_MouseDownPointX
/
imageXiShu
;
double
y
=
m_MouseDownPointY
/
image
Xi
Shu
;
double
y
=
m_MouseDownPointY
/
image
Y
Shu
;
x
=
Math
.
Round
(
x
,
0
,
MidpointRounding
.
AwayFromZero
);
x
=
Math
.
Round
(
x
,
0
,
MidpointRounding
.
AwayFromZero
);
y
=
Math
.
Round
(
y
,
0
,
MidpointRounding
.
AwayFromZero
);
y
=
Math
.
Round
(
y
,
0
,
MidpointRounding
.
AwayFromZero
);
...
@@ -1457,7 +1463,7 @@ namespace TSA_V
...
@@ -1457,7 +1463,7 @@ namespace TSA_V
return
;
return
;
}
}
double
x
=
m_MouseDownPointX
/
imageXiShu
;
double
x
=
m_MouseDownPointX
/
imageXiShu
;
double
y
=
m_MouseDownPointY
/
image
Xi
Shu
;
double
y
=
m_MouseDownPointY
/
image
Y
Shu
;
x
=
Math
.
Round
(
x
,
0
,
MidpointRounding
.
AwayFromZero
);
x
=
Math
.
Round
(
x
,
0
,
MidpointRounding
.
AwayFromZero
);
y
=
Math
.
Round
(
y
,
0
,
MidpointRounding
.
AwayFromZero
);
y
=
Math
.
Round
(
y
,
0
,
MidpointRounding
.
AwayFromZero
);
//double NodeX = TSAVBean.Axis_X.LastVoltage;
//double NodeX = TSAVBean.Axis_X.LastVoltage;
...
@@ -1466,6 +1472,12 @@ namespace TSA_V
...
@@ -1466,6 +1472,12 @@ namespace TSA_V
double
NodeY
=
FrmProjectorScreen
.
instance
.
LastY
;
double
NodeY
=
FrmProjectorScreen
.
instance
.
LastY
;
LogUtil
.
info
(
"新增组装信息:X【"
+
m_MouseDownPointX
+
"】Y【"
+
m_MouseDownPointY
+
"】,坐标X【"
+
x
+
"】坐标Y【"
+
y
+
"】"
);
LogUtil
.
info
(
"新增组装信息:X【"
+
m_MouseDownPointX
+
"】Y【"
+
m_MouseDownPointY
+
"】,坐标X【"
+
x
+
"】坐标Y【"
+
y
+
"】"
);
AddNewPoint
(
x
,
y
,
NodeX
,
NodeY
);
AddNewPoint
(
x
,
y
,
NodeX
,
NodeY
);
if
(
dgvList
.
SelectedRows
.
Count
>
0
)
{
dgvList
.
SelectedRows
[
0
].
Selected
=
false
;
}
dgvList
.
Rows
[
dgvList
.
Rows
.
Count
-
1
].
Selected
=
true
;
}
}
private
void
全部启用
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
全部启用
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
@@ -1798,7 +1810,7 @@ namespace TSA_V
...
@@ -1798,7 +1810,7 @@ namespace TSA_V
chbNormal
.
Checked
=
false
;
chbNormal
.
Checked
=
false
;
}
}
panBoard
.
AutoScrollPosition
=
new
Point
((
int
)(
smtInfo
.
PositionX
*
display
.
imageXiShu
-
panBoard
.
Width
/
2
),
(
int
)(
smtInfo
.
PositionY
*
display
.
image
Xi
Shu
-
panBoard
.
Height
/
2
));
panBoard
.
AutoScrollPosition
=
new
Point
((
int
)(
smtInfo
.
PositionX
*
display
.
imageXiShu
-
panBoard
.
Width
/
2
),
(
int
)(
smtInfo
.
PositionY
*
display
.
image
Y
Shu
-
panBoard
.
Height
/
2
));
// panBoard.AutoScrollPosition = new Point((int)picBoard.Width, (int)picBoard.Height);
// panBoard.AutoScrollPosition = new Point((int)picBoard.Width, (int)picBoard.Height);
if
(
isFinishLoad
&&
this
.
txtBoardW
.
Text
.
Trim
()
!=
""
&&
this
.
txtBoardL
.
Text
.
Trim
()
!=
""
)
if
(
isFinishLoad
&&
this
.
txtBoardW
.
Text
.
Trim
()
!=
""
&&
this
.
txtBoardL
.
Text
.
Trim
()
!=
""
)
{
{
...
@@ -1817,6 +1829,7 @@ namespace TSA_V
...
@@ -1817,6 +1829,7 @@ namespace TSA_V
display
.
ImageNormal
=
chbNormal
.
Checked
;
display
.
ImageNormal
=
chbNormal
.
Checked
;
display
.
DrawEditPoint
(
width
,
height
,
smtInfo
,
color
);
display
.
DrawEditPoint
(
width
,
height
,
smtInfo
,
color
);
imageXiShu
=
display
.
imageXiShu
;
imageXiShu
=
display
.
imageXiShu
;
imageYShu
=
display
.
imageYShu
;
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
TSA-V/frmBoard/FrmPointInfo.cs
查看文件 @
f8494ff
...
@@ -46,6 +46,16 @@ namespace TSA_V
...
@@ -46,6 +46,16 @@ namespace TSA_V
{
{
InitializeComponent
();
InitializeComponent
();
this
.
boardInfo
=
board
;
this
.
boardInfo
=
board
;
smtPointInfo
=
new
SMTPointInfo
();
//先保存点位
smtPointInfo
.
PositionX
=
x
;
smtPointInfo
.
PositionY
=
y
;
smtPointInfo
.
NodePositionX
=
nodex
;
smtPointInfo
.
NodePositionY
=
nodey
;
//先计算投影位置
smtPointInfo
=
XYConvertManager
.
CalPointNodePosition
(
smtPointInfo
,
board
.
getCalPoint
());
isNewPoint
=
true
;
isNewPoint
=
true
;
this
.
Text
=
"新增组装信息"
;
this
.
Text
=
"新增组装信息"
;
this
.
txtTagNo
.
Text
=
name
;
this
.
txtTagNo
.
Text
=
name
;
...
@@ -57,8 +67,8 @@ namespace TSA_V
...
@@ -57,8 +67,8 @@ namespace TSA_V
{
{
projectorControl
.
ShowPointEvent
+=
projectorControl_ShowPointEvent
;
projectorControl
.
ShowPointEvent
+=
projectorControl_ShowPointEvent
;
projectorControl
.
XValue
=
x
;
projectorControl
.
XValue
=
node
x
;
projectorControl
.
YValue
=
y
;
projectorControl
.
YValue
=
node
y
;
projectorControl
.
ShowColor
=
boardInfo
.
PointColor
;
projectorControl
.
ShowColor
=
boardInfo
.
PointColor
;
projectorControl
.
loadTypeList
(
ResourceCulture
.
GetPTypes
(),
ResourceCulture
.
GetDirTypes
(),
ResourceCulture
.
GetXYControlMap
());
projectorControl
.
loadTypeList
(
ResourceCulture
.
GetPTypes
(),
ResourceCulture
.
GetDirTypes
(),
ResourceCulture
.
GetXYControlMap
());
projectorControl
.
MaxX
=
(
int
)
TSAVBean
.
X_Max
;
projectorControl
.
MaxX
=
(
int
)
TSAVBean
.
X_Max
;
...
@@ -66,8 +76,8 @@ namespace TSA_V
...
@@ -66,8 +76,8 @@ namespace TSA_V
actControl
.
ConType
=
1
;
actControl
.
ConType
=
1
;
actControl
.
loadTypeList
(
ResourceCulture
.
GetPTypes
(),
ResourceCulture
.
GetDirTypes
(),
ResourceCulture
.
GetXYControlMap
());
actControl
.
loadTypeList
(
ResourceCulture
.
GetPTypes
(),
ResourceCulture
.
GetDirTypes
(),
ResourceCulture
.
GetXYControlMap
());
actControl
.
XValue
=
node
x
;
actControl
.
XValue
=
x
;
actControl
.
YValue
=
node
y
;
actControl
.
YValue
=
y
;
actControl
.
ShowColor
=
boardInfo
.
PointColor
;
actControl
.
ShowColor
=
boardInfo
.
PointColor
;
actControl
.
ShowPointEvent
+=
ActControl_ShowPointEvent
;
actControl
.
ShowPointEvent
+=
ActControl_ShowPointEvent
;
if
(
boardInfo
!=
null
)
if
(
boardInfo
!=
null
)
...
@@ -92,6 +102,7 @@ namespace TSA_V
...
@@ -92,6 +102,7 @@ namespace TSA_V
List
<
string
>
pnList
=
new
List
<
string
>();
List
<
string
>
pnList
=
new
List
<
string
>();
List
<
ComponetInfo
>
list
=
CSVBomManager
.
GetComList
(
this
.
boardInfo
.
bomName
);
List
<
ComponetInfo
>
list
=
CSVBomManager
.
GetComList
(
this
.
boardInfo
.
bomName
);
foreach
(
ComponetInfo
obj
in
list
)
foreach
(
ComponetInfo
obj
in
list
)
{
{
if
(!
pnList
.
Contains
(
obj
.
PN
))
if
(!
pnList
.
Contains
(
obj
.
PN
))
...
@@ -264,7 +275,10 @@ namespace TSA_V
...
@@ -264,7 +275,10 @@ namespace TSA_V
if
(
isNewPoint
)
if
(
isNewPoint
)
{
{
if
(
smtPointInfo
==
null
)
{
smtPointInfo
=
new
SMTPointInfo
();
smtPointInfo
=
new
SMTPointInfo
();
}
smtPointInfo
.
pointNum
=
boardInfo
.
GetNextPNum
();
smtPointInfo
.
pointNum
=
boardInfo
.
GetNextPNum
();
}
}
...
@@ -368,6 +382,9 @@ namespace TSA_V
...
@@ -368,6 +382,9 @@ namespace TSA_V
{
{
smtPointInfo
.
PositionNum
=
com
.
PositionNum
;
smtPointInfo
.
PositionNum
=
com
.
PositionNum
;
}
}
boardInfo
.
smtList
.
Add
(
smtPointInfo
);
boardInfo
.
smtList
.
Add
(
smtPointInfo
);
this
.
DialogResult
=
DialogResult
.
OK
;
this
.
DialogResult
=
DialogResult
.
OK
;
closeForm
();
closeForm
();
...
...
TSA-V/workForm/PointDisplay.cs
查看文件 @
f8494ff
...
@@ -19,6 +19,7 @@ namespace TSA_V
...
@@ -19,6 +19,7 @@ namespace TSA_V
public
bool
ImageNormal
=
true
;
public
bool
ImageNormal
=
true
;
public
bool
ShowName
=
true
;
public
bool
ShowName
=
true
;
public
float
imageXiShu
=
1
;
public
float
imageXiShu
=
1
;
public
float
imageYShu
=
1
;
public
double
CurrBeiLu
=
1
;
public
double
CurrBeiLu
=
1
;
private
Image
PicImage
=
null
;
private
Image
PicImage
=
null
;
...
@@ -91,6 +92,7 @@ namespace TSA_V
...
@@ -91,6 +92,7 @@ namespace TSA_V
//panBoard.Refresh();
//panBoard.Refresh();
imageXiShu
=
(
float
)
picBoard
.
Width
/
(
float
)
width
;
imageXiShu
=
(
float
)
picBoard
.
Width
/
(
float
)
width
;
imageYShu
=(
float
)
picBoard
.
Height
/
(
float
)
height
;
Graphics
grfx
=
picBoard
.
CreateGraphics
();
Graphics
grfx
=
picBoard
.
CreateGraphics
();
//float preX = 0;
//float preX = 0;
...
@@ -101,7 +103,7 @@ namespace TSA_V
...
@@ -101,7 +103,7 @@ namespace TSA_V
//float x = (float)Math.Abs(weld.PositionX) * imageXiShu;
//float x = (float)Math.Abs(weld.PositionX) * imageXiShu;
//float y = (float)Math.Abs(weld.PositionY) * imageXiShu;
//float y = (float)Math.Abs(weld.PositionY) * imageXiShu;
float
x
=
(
float
)
weld
.
PositionX
*
imageXiShu
;
float
x
=
(
float
)
weld
.
PositionX
*
imageXiShu
;
float
y
=
(
float
)
weld
.
PositionY
*
image
Xi
Shu
;
float
y
=
(
float
)
weld
.
PositionY
*
image
Y
Shu
;
int
lineLength
=
8
;
int
lineLength
=
8
;
Color
color
=
Color
.
HotPink
;
Color
color
=
Color
.
HotPink
;
...
@@ -253,7 +255,7 @@ namespace TSA_V
...
@@ -253,7 +255,7 @@ namespace TSA_V
int
index
=
0
;
int
index
=
0
;
Brush
brushes
=
Brushes
.
HotPink
;
Brush
brushes
=
Brushes
.
HotPink
;
ProjectorPInfo
p
=
point
.
GetShowPInfo
(
imageXiShu
);
ProjectorPInfo
p
=
point
.
GetShowPInfo
(
imageXiShu
,
imageYShu
);
DrawPointManager
.
DrawPoint
(
grfx
,
p
,
color
);
DrawPointManager
.
DrawPoint
(
grfx
,
p
,
color
);
//写字
//写字
if
(
index
.
Equals
(
selectIndex
)
||
ShowName
)
if
(
index
.
Equals
(
selectIndex
)
||
ShowName
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论