Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cf1beefc
由
LN
编写于
2025-02-05 11:16:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.增加自定义极性方向。2.增加点位复制功能。
1 个父辈
66419989
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
388 行增加
和
177 行删除
Common/Setting_NInit.cs
DeviceLibrary/bean/BoardInfo.cs
DeviceLibrary/bean/ProjectorPInfo.cs
DeviceLibrary/manager/BoardManager.cs
DeviceLibrary/manager/work/TSAVBean.cs
DeviceLibrary/manager/work/WorkInfo.cs
TSA-V/Properties/Resource.en-US.resx
TSA-V/Properties/Resource.ru-RU.resx
TSA-V/Properties/Resource.zh-CN.resx
TSA-V/ResourceCulture.cs
TSA-V/frmBoard/FrmBoardInfo.Designer.cs
TSA-V/frmBoard/FrmBoardInfo.cs
TSA-V/frmBoard/FrmBoardInfo.resx
TSA-V/frmBoard/FrmEditMPoint.cs
TSA-V/frmBoard/FrmPointInfo.cs
TSA-V/manager/XYConvertManager.cs
TSA-V/projector/FrmProjectorScreen.cs
UserFromControl/ProjectorControl.Designer.cs
UserFromControl/ProjectorControl.cs
Common/Setting_NInit.cs
查看文件 @
cf1beef
...
@@ -47,6 +47,8 @@ namespace TSA_V.Common
...
@@ -47,6 +47,8 @@ namespace TSA_V.Common
public
static
MyConfig
<
bool
>
Work_IsNeedCount
=
true
;
public
static
MyConfig
<
bool
>
Work_IsNeedCount
=
true
;
[
MyConfigComment
(
"是否需要显示批量操作功能"
)]
[
MyConfigComment
(
"是否需要显示批量操作功能"
)]
public
static
MyConfig
<
bool
>
Work_ShowOperateBtn
=
true
;
public
static
MyConfig
<
bool
>
Work_ShowOperateBtn
=
true
;
[
MyConfigComment
(
"红外坐标校准是否更改校准点的坐标,true=不更改,false=更改"
)]
public
static
MyConfig
<
bool
>
Work_UseCheckOK
=
true
;
[
MyConfigComment
(
" IO模块 0=康耐得 1=零点 2=南京实点 3=泥人科技,无线体"
)]
[
MyConfigComment
(
" IO模块 0=康耐得 1=零点 2=南京实点 3=泥人科技,无线体"
)]
...
...
DeviceLibrary/bean/BoardInfo.cs
查看文件 @
cf1beef
...
@@ -403,11 +403,12 @@ namespace TSA_V.DeviceLibrary
...
@@ -403,11 +403,12 @@ namespace TSA_V.DeviceLibrary
PenWidth
=
p
.
PenWidth
;
PenWidth
=
p
.
PenWidth
;
this
.
ShowText
=
p
.
ShowText
;
this
.
ShowText
=
p
.
ShowText
;
this
.
PolaritiesType
=
p
.
PolaritiesType
;
this
.
PolaritiesType
=
p
.
PolaritiesType
;
this
.
PolarityAngle
=
p
.
PolarityAngle
;
}
}
public
ProjectorPInfo
GetShowPInfo
(
float
imageXiShu
=
1
)
public
ProjectorPInfo
GetShowPInfo
(
float
imageXiShu
=
1
)
{
{
ProjectorPInfo
p
=
new
ProjectorPInfo
(
PositionX
*
imageXiShu
,
PositionY
*
imageXiShu
,
PointType
,
PolaritiesType
,
(
int
)(
PointSizeX
*
imageXiShu
),
(
int
)(
PointSizeY
*
imageXiShu
),
(
int
)(
PenWidth
*
imageXiShu
),
ShowText
);
ProjectorPInfo
p
=
new
ProjectorPInfo
(
PositionX
*
imageXiShu
,
PositionY
*
imageXiShu
,
PointType
,
PolaritiesType
,
PolarityAngle
,
(
int
)(
PointSizeX
*
imageXiShu
),
(
int
)(
PointSizeY
*
imageXiShu
),
(
int
)(
PenWidth
*
imageXiShu
),
ShowText
);
return
p
;
return
p
;
}
}
...
@@ -441,6 +442,10 @@ namespace TSA_V.DeviceLibrary
...
@@ -441,6 +442,10 @@ namespace TSA_V.DeviceLibrary
/// 极性,
/// 极性,
/// </summary>
/// </summary>
public
int
PolaritiesType
{
get
;
set
;
}
=
0
;
public
int
PolaritiesType
{
get
;
set
;
}
=
0
;
/// <summary>
/// 极性角度,
/// </summary>
public
int
PolarityAngle
{
get
;
set
;
}
=
0
;
/// <summary>
/// <summary>
/// 导出导入程序时使用
/// 导出导入程序时使用
...
...
DeviceLibrary/bean/ProjectorPInfo.cs
查看文件 @
cf1beef
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
;
...
@@ -8,7 +9,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -8,7 +9,7 @@ namespace TSA_V.DeviceLibrary
{
{
public
class
ProjectorPInfo
public
class
ProjectorPInfo
{
{
public
ProjectorPInfo
(
double
x
,
double
y
,
int
type
=
1
,
int
polaritiesType
=
0
,
int
sizeX
=
4
,
int
sizeY
=
4
,
int
lineWidth
=
2
,
string
showText
=
""
,
int
color
=-
1
)
public
ProjectorPInfo
(
double
x
,
double
y
,
int
type
=
1
,
int
polaritiesType
=
0
,
int
angle
=
0
,
int
sizeX
=
4
,
int
sizeY
=
4
,
int
lineWidth
=
2
,
string
showText
=
""
,
int
color
=-
1
)
{
{
this
.
PX
=
x
;
this
.
PX
=
x
;
this
.
PY
=
y
;
this
.
PY
=
y
;
...
@@ -19,6 +20,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -19,6 +20,7 @@ namespace TSA_V.DeviceLibrary
this
.
ShowText
=
showText
;
this
.
ShowText
=
showText
;
this
.
showColor
=
color
;
this
.
showColor
=
color
;
this
.
PolaritiesType
=
polaritiesType
;
this
.
PolaritiesType
=
polaritiesType
;
this
.
PolarityAngle
=
angle
;
}
}
public
double
PX
=
2
;
public
double
PX
=
2
;
public
double
PY
=
2
;
public
double
PY
=
2
;
...
@@ -39,5 +41,69 @@ namespace TSA_V.DeviceLibrary
...
@@ -39,5 +41,69 @@ namespace TSA_V.DeviceLibrary
/// 极性,
/// 极性,
/// </summary>
/// </summary>
public
int
PolaritiesType
=
0
;
public
int
PolaritiesType
=
0
;
/// <summary>
/// 极性角度,
/// </summary>
public
int
PolarityAngle
{
get
;
set
;
}
=
0
;
public
static
int
getAngleByType
(
int
type
,
int
angle
)
{
int
ret
=
0
;
switch
(
type
)
{
case
0
:
break
;
case
1
:
ret
=
270
;
break
;
case
2
:
ret
=
90
;
break
;
case
3
:
ret
=
180
;
break
;
case
4
:
ret
=
0
;
break
;
case
5
:
ret
=
225
;
break
;
case
6
:
ret
=
315
;
break
;
case
7
:
ret
=
135
;
break
;
case
8
:
ret
=
45
;
break
;
case
9
:
ret
=
angle
;
break
;
}
return
ret
;
}
/// <summary>
/// 计算极性的中心位置
/// </summary>
/// <param name="point">点位中心</param>
/// <param name="distance">距离</param>
/// <param name="angleInDegrees">角度</param>
/// <returns></returns>
public
static
Point
CalculatePoint
(
Point
point
,
double
distance
,
double
angleInDegrees
)
{
double
angleInRadians
=
angleInDegrees
*
(
Math
.
PI
/
180.0
);
double
deltaX
=
distance
*
Math
.
Cos
(
angleInRadians
);
double
deltaY
=
distance
*
Math
.
Sin
(
angleInRadians
);
int
newX
=
(
int
)(
point
.
X
+
deltaX
);
int
newY
=
(
int
)(
point
.
Y
+
deltaY
);
return
new
Point
(
newX
,
newY
);
}
}
}
}
}
DeviceLibrary/manager/BoardManager.cs
查看文件 @
cf1beef
...
@@ -100,6 +100,12 @@ namespace TSA_V.DeviceLibrary
...
@@ -100,6 +100,12 @@ namespace TSA_V.DeviceLibrary
sm
.
imgP
=
new
DrawPointInfo
(
sm
.
PointSizeX
,
sm
.
PointSizeY
,
sm
.
PenWidth
);
sm
.
imgP
=
new
DrawPointInfo
(
sm
.
PointSizeX
,
sm
.
PointSizeY
,
sm
.
PenWidth
);
needSave
=
true
;
needSave
=
true
;
}
}
int
newAngle
=
ProjectorPInfo
.
getAngleByType
(
sm
.
PolaritiesType
,
sm
.
PolarityAngle
);
if
(
sm
.
PolarityAngle
!=
newAngle
)
{
sm
.
PolarityAngle
=
newAngle
;
needSave
=
true
;
}
}
}
if
(
board
.
boardId
>
MaxId
)
if
(
board
.
boardId
>
MaxId
)
...
...
DeviceLibrary/manager/work/TSAVBean.cs
查看文件 @
cf1beef
...
@@ -345,9 +345,13 @@ namespace TSA_V.DeviceLibrary
...
@@ -345,9 +345,13 @@ namespace TSA_V.DeviceLibrary
}
}
public
delegate
bool
ShowPointDelegate
(
ProjectorPInfo
p
);
public
delegate
bool
ShowPointDelegate
(
ProjectorPInfo
p
);
public
static
event
ShowPointDelegate
ShowPointEvent
;
public
static
event
ShowPointDelegate
ShowPointEvent
;
public
static
void
ShowPoint
(
double
x
,
double
y
,
int
type
=
1
,
int
polaritiesType
=
0
,
int
sizex
=
1
,
int
sizey
=
1
,
int
penWidth
=
2
,
string
name
=
""
,
int
color
=-
1
)
//public static void ShowPoint(double x, double y, int type = 1,int polaritiesType=0,int angle, int sizex = 1, int sizey = 1, int penWidth = 2, string name = "",int color=-1)
{
//{
ProjectorPInfo
p
=
new
ProjectorPInfo
((
int
)
x
,
(
int
)
y
,
type
,
polaritiesType
,
sizex
,
sizey
,
penWidth
,
name
,
color
);
// ProjectorPInfo p = new ProjectorPInfo((int)x, (int)y, type, polaritiesType,angle, sizex, sizey, penWidth, name,color);
// ShowPointEvent?.Invoke(p);
//}
public
static
void
ShowPoint
(
ProjectorPInfo
p
)
{
ShowPointEvent
?.
Invoke
(
p
);
ShowPointEvent
?.
Invoke
(
p
);
}
}
...
...
DeviceLibrary/manager/work/WorkInfo.cs
查看文件 @
cf1beef
...
@@ -301,7 +301,8 @@ namespace TSA_V.DeviceLibrary
...
@@ -301,7 +301,8 @@ namespace TSA_V.DeviceLibrary
if
(
TSAVBean
.
IsValidPosition
(
currPoint
.
NodePositionX
,
currPoint
.
NodePositionY
))
if
(
TSAVBean
.
IsValidPosition
(
currPoint
.
NodePositionX
,
currPoint
.
NodePositionY
))
{
{
LogUtil
.
info
(
" 程序【"
+
currBoard
.
boardName
+
"】插件【"
+
currPoint
.
TagNo
+
"_"
+
currPoint
.
PN
+
"】,X轴【"
+
currPoint
.
NodePositionX
+
"】,Y轴【"
+
currPoint
.
NodePositionY
+
"】显示投影光标"
);
LogUtil
.
info
(
" 程序【"
+
currBoard
.
boardName
+
"】插件【"
+
currPoint
.
TagNo
+
"_"
+
currPoint
.
PN
+
"】,X轴【"
+
currPoint
.
NodePositionX
+
"】,Y轴【"
+
currPoint
.
NodePositionY
+
"】显示投影光标"
);
TSAVBean
.
ShowPoint
(
currPoint
.
NodePositionX
,
currPoint
.
NodePositionY
,
currPoint
.
PointType
,
currPoint
.
PolaritiesType
,
currPoint
.
PointSizeX
,
currPoint
.
PointSizeY
,
currPoint
.
PenWidth
,
currPoint
.
ShowText
,
currBoard
.
PointColor
);
TSAVBean
.
ShowPoint
(
currPoint
.
GetShowPInfo
());
//TSAVBean.ShowPoint(currPoint.NodePositionX, currPoint.NodePositionY, currPoint.PointType,currPoint.PolaritiesType, currPoint.PointSizeX, currPoint.PointSizeY, currPoint.PenWidth, currPoint.ShowText, currBoard.PointColor);
waitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
waitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
}
else
else
...
...
TSA-V/Properties/Resource.en-US.resx
查看文件 @
cf1beef
...
@@ -2771,5 +2771,8 @@
...
@@ -2771,5 +2771,8 @@
<data name = "FrmMaintenance_LblUserName_Text" xml:space = "preserve"> <value> admin/Admin </value> </data>
<data name = "FrmMaintenance_LblUserName_Text" xml:space = "preserve"> <value> admin/Admin </value> </data>
<data name = "FrmMaintenance_lblVersion_Text" xml:space = "preserve"> <value> V4.1.9152.25101 </value> </data>
<data name = "FrmMaintenance_lblVersion_Text" xml:space = "preserve"> <value> V4.1.9152.25101 </value> </data>
<data name = "PWSureCopyPoint" xml:space = "preserve"> <value> Confirm Copy? Target is {0} Rows, {1} Columns, X Spacing={2}, Y Spacing={3} </value> </data>
<data name = "PWSureCopyPoint" xml:space = "preserve"> <value> Confirm Copy? Target is {0} Rows, {1} Columns, X Spacing={2}, Y Spacing={3} </value> </data>
<data name = "FrmEditMPoint_rdbDelete_Text" xml:space = "preserve"> <value> Delete </value> </data>
<data name = "FrmEditMPoint_rdbDelete_Text" xml:space = "preserve"> <value> Delete </value> </data>
<data name="Type100" xml:space="preserve">
<value>Polarity_Custom</value>
</data>
</root>
</root>
\ No newline at end of file
\ No newline at end of file
TSA-V/Properties/Resource.ru-RU.resx
查看文件 @
cf1beef
...
@@ -2750,4 +2750,7 @@
...
@@ -2750,4 +2750,7 @@
<data name = "FrmMaintenance_lblVersion_Text" xml:space = "preserve"> <value> V4.1.9152.25101 </value> </data>
<data name = "FrmMaintenance_lblVersion_Text" xml:space = "preserve"> <value> V4.1.9152.25101 </value> </data>
<data name = "PWSureCopyPoint" xml:space = "preserve"> <value> 确定复制?目标为{0}行,{1}列,X间距={2}, Y间距={3} </value> </data>
<data name = "PWSureCopyPoint" xml:space = "preserve"> <value> 确定复制?目标为{0}行,{1}列,X间距={2}, Y间距={3} </value> </data>
<data name = "FrmEditMPoint_rdbDelete_Text" xml:space = "preserve"> <value> 删除 </value> </data>
<data name = "FrmEditMPoint_rdbDelete_Text" xml:space = "preserve"> <value> 删除 </value> </data>
<data name="Type100" xml:space="preserve">
<value>极性_自定义</value>
</data>
</root>
</root>
\ No newline at end of file
\ No newline at end of file
TSA-V/Properties/Resource.zh-CN.resx
查看文件 @
cf1beef
...
@@ -2889,40 +2889,112 @@
...
@@ -2889,40 +2889,112 @@
<data name="xyAxisArrive" xml:space="preserve">
<data name="xyAxisArrive" xml:space="preserve">
<value>XY轴目标</value>
<value>XY轴目标</value>
</data>
</data>
<data name="comInitError" xml:space="preserve">
<data name = "comInitError" xml:space = "preserve"> <value> {0}初始化失败 </value> </data>
<value> {0}初始化失败 </value>
<data name = "comOpenFail" xml:space = "preserve"> <value> 串口{0}打开失败 </value> </data>
</data>
<data name = "FrmBoardSelect_chbSoftMode_Text" xml:space = "preserve"> <value> 简洁模式 </value> </data>
<data name="comOpenFail" xml:space="preserve">
<data name = "isRestart" xml:space = "preserve"> <value> 更改此模式需要重新加载设备,是否现在重启软件? </value> </data>
<value> 串口{0}打开失败 </value>
<data name = "FrmWork_btnResetAOI_Text" xml:space = "preserve"> <value> 还原 </value> </data>
</data>
<data name = "shortageInfo" xml:space = "preserve"> <value> 缺料信息: </value> </data>
<data name="FrmBoardSelect_chbSoftMode_Text" xml:space="preserve">
<data name = "FrmLogin_label3_Text" xml:space = "preserve"> <value> Neo Station </value> </data>
<value> 简洁模式 </value>
<data name = "FrmBoardInfo_btnMEdit_Text" xml:space = "preserve"> <value> 批量操作 </value> </data>
</data>
<data name = "FrmEditMPoint_Text" xml:space = "preserve"> <value> 点位批量操作 </value> </data>
<data name="isRestart" xml:space="preserve">
<data name = "FrmEditMPoint_label6_Text" xml:space = "preserve"> <value> 删除左侧列表中的点位 </value> </data>
<value> 更改此模式需要重新加载设备,是否现在重启软件? </value>
<data name = "FrmEditMPoint_radioButton1_Text" xml:space = "preserve"> <value> 删除 </value> </data>
</data>
<data name = "FrmEditMPoint_rdbPianyi_Text" xml:space = "preserve"> <value> 坐标偏移/旋转 </value> </data>
<data name="FrmWork_btnResetAOI_Text" xml:space="preserve">
<data name = "FrmEditMPoint_label3_Text" xml:space = "preserve"> <value> mm </value> </data>
<value> 还原 </value>
<data name = "FrmEditMPoint_label5_Text" xml:space = "preserve"> <value> mm </value> </data>
</data>
<data name = "FrmEditMPoint_checkBox1_Text" xml:space = "preserve"> <value> 自动为位号增加后缀 </value> </data>
<data name="shortageInfo" xml:space="preserve">
<data name = "FrmEditMPoint_label2_Text" xml:space = "preserve"> <value> 列间距: </value> </data>
<value> 缺料信息: </value>
<data name = "FrmEditMPoint_label12_Text" xml:space = "preserve"> <value> 列: </value> </data>
</data>
<data name = "FrmEditMPoint_label11_Text" xml:space = "preserve"> <value> 行间距: </value> </data>
<data name="FrmLogin_label3_Text" xml:space="preserve">
<data name = "FrmEditMPoint_label7_Text" xml:space = "preserve"> <value> 行: </value> </data>
<value> Neo Station </value>
<data name = "FrmEditMPoint_rdbCopy_Text" xml:space = "preserve"> <value> 复制 </value> </data>
</data>
<data name = "FrmEditMPoint_label8_Text" xml:space = "preserve"> <value> mm </value> </data>
<data name="FrmBoardInfo_btnMEdit_Text" xml:space="preserve">
<data name = "FrmEditMPoint_label122_Text" xml:space = "preserve"> <value> mm </value> </data>
<value> 批量操作 </value>
<data name = "FrmEditMPoint_label1_Text" xml:space = "preserve"> <value> ° </value> </data>
</data>
<data name = "FrmEditMPoint_label9_Text" xml:space = "preserve"> <value> X轴偏移量→: </value> </data>
<data name="FrmEditMPoint_Text" xml:space="preserve">
<data name = "FrmEditMPoint_label4_Text" xml:space = "preserve"> <value> 旋转角度: </value> </data>
<value> 点位批量操作 </value>
<data name = "FrmEditMPoint_label10_Text" xml:space = "preserve"> <value> Y轴偏移量↓: </value> </data>
</data>
<data name = "FrmEditMPoint_焊点列表_Text" xml:space = "preserve"> <value> 列表 </value> </data>
<data name="FrmEditMPoint_label6_Text" xml:space="preserve">
<data name = "FrmEditMPoint_btnClose_Text" xml:space = "preserve"> <value> 返回 </value> </data>
<value> 删除左侧列表中的点位 </value>
<data name = "FrmEditMPoint_btnSave_Text" xml:space = "preserve"> <value> 保存 </value> </data>
</data>
<data name = "NoSaveBack" xml:space = "preserve"> <value> 不保存直接返回? </value> </data>
<data name="FrmEditMPoint_radioButton1_Text" xml:space="preserve">
<data name = "FrmMaintenance_label1_Text" xml:space = "preserve"> <value> Neo Station </value> </data>
<value> 删除 </value>
<data name = "FrmMaintenance_LblUserName_Text" xml:space = "preserve"> <value> admin/Admin </value> </data>
</data>
<data name = "FrmMaintenance_lblVersion_Text" xml:space = "preserve"> <value> V4.1.9152.25101 </value> </data>
<data name="FrmEditMPoint_rdbPianyi_Text" xml:space="preserve">
<data name = "PWSureCopyPoint" xml:space = "preserve"> <value> 确定复制?目标为{0}行,{1}列,X间距={2}, Y间距={3} </value> </data>
<value> 坐标偏移/旋转 </value>
<data name = "FrmEditMPoint_rdbDelete_Text" xml:space = "preserve"> <value> 删除 </value> </data>
</data>
<data name="FrmEditMPoint_label3_Text" xml:space="preserve">
<value> mm </value>
</data>
<data name="FrmEditMPoint_label5_Text" xml:space="preserve">
<value> mm </value>
</data>
<data name="FrmEditMPoint_checkBox1_Text" xml:space="preserve">
<value> 自动为位号增加后缀 </value>
</data>
<data name="FrmEditMPoint_label2_Text" xml:space="preserve">
<value> 列间距: </value>
</data>
<data name="FrmEditMPoint_label12_Text" xml:space="preserve">
<value> 列: </value>
</data>
<data name="FrmEditMPoint_label11_Text" xml:space="preserve">
<value> 行间距: </value>
</data>
<data name="FrmEditMPoint_label7_Text" xml:space="preserve">
<value> 行: </value>
</data>
<data name="FrmEditMPoint_rdbCopy_Text" xml:space="preserve">
<value> 复制 </value>
</data>
<data name="FrmEditMPoint_label8_Text" xml:space="preserve">
<value> mm </value>
</data>
<data name="FrmEditMPoint_label122_Text" xml:space="preserve">
<value> mm </value>
</data>
<data name="FrmEditMPoint_label1_Text" xml:space="preserve">
<value> ° </value>
</data>
<data name="FrmEditMPoint_label9_Text" xml:space="preserve">
<value> X轴偏移量→: </value>
</data>
<data name="FrmEditMPoint_label4_Text" xml:space="preserve">
<value> 旋转角度: </value>
</data>
<data name="FrmEditMPoint_label10_Text" xml:space="preserve">
<value> Y轴偏移量↓: </value>
</data>
<data name="FrmEditMPoint_焊点列表_Text" xml:space="preserve">
<value> 列表 </value>
</data>
<data name="FrmEditMPoint_btnClose_Text" xml:space="preserve">
<value> 返回 </value>
</data>
<data name="FrmEditMPoint_btnSave_Text" xml:space="preserve">
<value> 保存 </value>
</data>
<data name="NoSaveBack" xml:space="preserve">
<value> 不保存直接返回? </value>
</data>
<data name="FrmMaintenance_label1_Text" xml:space="preserve">
<value> Neo Station </value>
</data>
<data name="FrmMaintenance_LblUserName_Text" xml:space="preserve">
<value> admin/Admin </value>
</data>
<data name="FrmMaintenance_lblVersion_Text" xml:space="preserve">
<value> V4.1.9152.25101 </value>
</data>
<data name="PWSureCopyPoint" xml:space="preserve">
<value> 确定复制?目标为{0}行,{1}列,X间距={2}, Y间距={3} </value>
</data>
<data name="FrmEditMPoint_rdbDelete_Text" xml:space="preserve">
<value> 删除 </value>
</data>
<data name="Type100" xml:space="preserve">
<value>极性_自定义</value>
</data>
</root>
</root>
\ No newline at end of file
\ No newline at end of file
TSA-V/ResourceCulture.cs
查看文件 @
cf1beef
...
@@ -211,6 +211,7 @@ namespace TSA_V
...
@@ -211,6 +211,7 @@ namespace TSA_V
string
str12
=
ResourceCulture
.
GetString
(
ResourceCulture
.
Type12
,
"极性_右上方"
);
string
str12
=
ResourceCulture
.
GetString
(
ResourceCulture
.
Type12
,
"极性_右上方"
);
string
str13
=
ResourceCulture
.
GetString
(
ResourceCulture
.
Type13
,
"极性_左下方"
);
string
str13
=
ResourceCulture
.
GetString
(
ResourceCulture
.
Type13
,
"极性_左下方"
);
string
str14
=
ResourceCulture
.
GetString
(
ResourceCulture
.
Type14
,
"极性_右下方"
);
string
str14
=
ResourceCulture
.
GetString
(
ResourceCulture
.
Type14
,
"极性_右下方"
);
string
str100
=
ResourceCulture
.
GetString
(
ResourceCulture
.
Type100
,
"极性_自定义"
);
string
wu
=
ResourceCulture
.
GetString
(
ResourceCulture
.
Type_None
,
"无"
);
string
wu
=
ResourceCulture
.
GetString
(
ResourceCulture
.
Type_None
,
"无"
);
string
[]
typeList
=
new
string
[]
{
string
[]
typeList
=
new
string
[]
{
//"1=●",
//"1=●",
...
@@ -227,7 +228,8 @@ namespace TSA_V
...
@@ -227,7 +228,8 @@ namespace TSA_V
"5="
+
str11
,
"5="
+
str11
,
"6="
+
str12
,
"6="
+
str12
,
"7="
+
str13
,
"7="
+
str13
,
"8="
+
str14
"8="
+
str14
,
"100="
+
str100
};
};
return
typeList
;
return
typeList
;
...
@@ -908,6 +910,10 @@ namespace TSA_V
...
@@ -908,6 +910,10 @@ namespace TSA_V
/// </summary>
/// </summary>
internal
static
readonly
string
Type14
=
"Type14"
;
internal
static
readonly
string
Type14
=
"Type14"
;
/// <summary>
/// <summary>
/// 极性_自定义
/// </summary>
internal
static
readonly
string
Type100
=
"Type100"
;
/// <summary>
/// 无
/// 无
/// </summary>
/// </summary>
internal
static
readonly
string
Type_None
=
"Type_None"
;
internal
static
readonly
string
Type_None
=
"Type_None"
;
...
...
TSA-V/frmBoard/FrmBoardInfo.Designer.cs
查看文件 @
cf1beef
...
@@ -119,6 +119,7 @@
...
@@ -119,6 +119,7 @@
this
.
Column_Notes
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
Column_Notes
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
col_IsEdit
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
col_IsEdit
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
col_Polarities
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
col_Polarities
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
col_PolarityAngle
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
Column_getPosition
=
new
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
();
this
.
Column_getPosition
=
new
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
();
this
.
Column_MoveTest
=
new
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
();
this
.
Column_MoveTest
=
new
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
();
this
.
Column_btnDetail
=
new
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
();
this
.
Column_btnDetail
=
new
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
();
...
@@ -655,6 +656,7 @@
...
@@ -655,6 +656,7 @@
this
.
Column_Notes
,
this
.
Column_Notes
,
this
.
col_IsEdit
,
this
.
col_IsEdit
,
this
.
col_Polarities
,
this
.
col_Polarities
,
this
.
col_PolarityAngle
,
this
.
Column_getPosition
,
this
.
Column_getPosition
,
this
.
Column_MoveTest
,
this
.
Column_MoveTest
,
this
.
Column_btnDetail
,
this
.
Column_btnDetail
,
...
@@ -1047,6 +1049,12 @@
...
@@ -1047,6 +1049,12 @@
this
.
col_Polarities
.
Name
=
"col_Polarities"
;
this
.
col_Polarities
.
Name
=
"col_Polarities"
;
this
.
col_Polarities
.
Visible
=
false
;
this
.
col_Polarities
.
Visible
=
false
;
//
//
// col_PolarityAngle
//
this
.
col_PolarityAngle
.
HeaderText
=
"角度"
;
this
.
col_PolarityAngle
.
Name
=
"col_PolarityAngle"
;
this
.
col_PolarityAngle
.
Visible
=
false
;
//
// Column_getPosition
// Column_getPosition
//
//
this
.
Column_getPosition
.
HeaderText
=
"更新坐标"
;
this
.
Column_getPosition
.
HeaderText
=
"更新坐标"
;
...
@@ -1234,6 +1242,7 @@
...
@@ -1234,6 +1242,7 @@
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
Column_Notes
;
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
Column_Notes
;
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
col_IsEdit
;
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
col_IsEdit
;
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
col_Polarities
;
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
col_Polarities
;
private
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
col_PolarityAngle
;
private
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
Column_getPosition
;
private
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
Column_getPosition
;
private
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
Column_MoveTest
;
private
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
Column_MoveTest
;
private
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
Column_btnDetail
;
private
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
Column_btnDetail
;
...
...
TSA-V/frmBoard/FrmBoardInfo.cs
查看文件 @
cf1beef
...
@@ -316,6 +316,7 @@ namespace TSA_V
...
@@ -316,6 +316,7 @@ namespace TSA_V
view
.
Cells
[
Column_disable
.
Index
].
Value
=
point
.
Disable
;
view
.
Cells
[
Column_disable
.
Index
].
Value
=
point
.
Disable
;
view
.
Cells
[
col_IsEdit
.
Index
].
Value
=
point
.
IsEdit
;
view
.
Cells
[
col_IsEdit
.
Index
].
Value
=
point
.
IsEdit
;
view
.
Cells
[
col_Polarities
.
Index
].
Value
=
point
.
PolaritiesType
;
view
.
Cells
[
col_Polarities
.
Index
].
Value
=
point
.
PolaritiesType
;
view
.
Cells
[
col_PolarityAngle
.
Index
].
Value
=
point
.
PolarityAngle
;
if
(
updateBoardInfo
!=
null
)
if
(
updateBoardInfo
!=
null
)
{
{
...
@@ -486,25 +487,28 @@ namespace TSA_V
...
@@ -486,25 +487,28 @@ namespace TSA_V
private
void
MoveTest
(
int
rowIndex
)
private
void
MoveTest
(
int
rowIndex
)
{
{
//移动测试
//移动测试
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());
double
y
=
Double
.
Parse
(
dgvList
.
Rows
[
rowIndex
].
Cells
[
this
.
Column_NodeY
.
Name
].
Value
.
ToString
());
//double y = Double.Parse(dgvList.Rows[rowIndex].Cells[this.Column_NodeY.Name].Value.ToString());
int
type
=
Int32
.
Parse
(
dgvList
.
Rows
[
rowIndex
].
Cells
[
this
.
Column_PointType
.
Name
].
Value
.
ToString
());
//int type = Int32.Parse(dgvList.Rows[rowIndex].Cells[this.Column_PointType.Name].Value.ToString());
int
sizeX
=
Int32
.
Parse
(
dgvList
.
Rows
[
rowIndex
].
Cells
[
this
.
Column_PointSizeX
.
Name
].
Value
.
ToString
());
//int sizeX = Int32.Parse(dgvList.Rows[rowIndex].Cells[this.Column_PointSizeX.Name].Value.ToString());
int
sizeY
=
Int32
.
Parse
(
dgvList
.
Rows
[
rowIndex
].
Cells
[
this
.
Column_PointSizeY
.
Name
].
Value
.
ToString
());
//int sizeY = Int32.Parse(dgvList.Rows[rowIndex].Cells[this.Column_PointSizeY.Name].Value.ToString());
int
penWidth
=
Int32
.
Parse
(
dgvList
.
Rows
[
rowIndex
].
Cells
[
this
.
Column_PenWidth
.
Name
].
Value
.
ToString
());
//int penWidth = Int32.Parse(dgvList.Rows[rowIndex].Cells[this.Column_PenWidth.Name].Value.ToString());
string
name
=
dgvList
.
Rows
[
rowIndex
].
Cells
[
this
.
Column_Name
.
Name
].
Value
.
ToString
();
//string name = dgvList.Rows[rowIndex].Cells[this.Column_Name.Name].Value.ToString();
string
showText
=
dgvList
.
Rows
[
rowIndex
].
Cells
[
this
.
Column_ShowText
.
Name
].
Value
.
ToString
();
//string showText = dgvList.Rows[rowIndex].Cells[this.Column_ShowText.Name].Value.ToString();
int
polaritiesType
=
Int32
.
Parse
(
dgvList
.
Rows
[
rowIndex
].
Cells
[
this
.
col_Polarities
.
Name
].
Value
.
ToString
());
//int polaritiesType = Int32.Parse( dgvList.Rows[rowIndex].Cells[this.col_Polarities.Name].Value.ToString());
SMTPointInfo
point
=
getRowPointInfo
(
dgvList
.
Rows
[
rowIndex
]);
//判断位置是否超出范围
//判断位置是否超出范围
if
(!
TSAVBean
.
IsValidPosition
(
x
,
y
))
if
(!
TSAVBean
.
IsValidPosition
(
point
.
NodePositionX
,
point
.
NodePositionY
))
{
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
PositionError
,
"位置:{0},{1}无效,请检查配置是否正确?"
,
x
,
y
),
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
();
FrmProjectorScreen
.
instance
.
ShowPoint
(
new
ProjectorPInfo
((
int
)
x
,
(
int
)
y
,
type
,
polaritiesType
,
sizeX
,
sizeY
,
penWidth
,
showText
,
btnColorChange
.
BackColor
.
ToArgb
()));
//FrmProjectorScreen.instance.ShowPoint(new ProjectorPInfo((int)x, (int)y, type, polaritiesType, sizeX, sizeY, penWidth, showText,btnColorChange.BackColor.ToArgb()));
FrmProjectorScreen
.
instance
.
ShowPoint
(
point
.
GetShowPInfo
());
}
}
}
}
...
@@ -734,6 +738,7 @@ namespace TSA_V
...
@@ -734,6 +738,7 @@ namespace TSA_V
point
.
Disable
=
Convert
.
ToBoolean
(
row
.
Cells
[
this
.
Column_disable
.
Name
].
Value
.
ToString
());
point
.
Disable
=
Convert
.
ToBoolean
(
row
.
Cells
[
this
.
Column_disable
.
Name
].
Value
.
ToString
());
point
.
IsEdit
=
Convert
.
ToBoolean
(
row
.
Cells
[
this
.
col_IsEdit
.
Name
].
Value
.
ToString
());
point
.
IsEdit
=
Convert
.
ToBoolean
(
row
.
Cells
[
this
.
col_IsEdit
.
Name
].
Value
.
ToString
());
point
.
PolaritiesType
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
col_Polarities
.
Name
].
Value
.
ToString
());
point
.
PolaritiesType
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
col_Polarities
.
Name
].
Value
.
ToString
());
point
.
PolarityAngle
=
Convert
.
ToInt32
(
row
.
Cells
[
this
.
col_PolarityAngle
.
Name
].
Value
.
ToString
());
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
TSA-V/frmBoard/FrmBoardInfo.resx
查看文件 @
cf1beef
...
@@ -222,6 +222,9 @@
...
@@ -222,6 +222,9 @@
<metadata name="col_Polarities.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="col_Polarities.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
</metadata>
<metadata name="col_PolarityAngle.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_getPosition.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="Column_getPosition.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<value>True</value>
</metadata>
</metadata>
...
...
TSA-V/frmBoard/FrmEditMPoint.cs
查看文件 @
cf1beef
...
@@ -297,6 +297,7 @@ namespace TSA_V
...
@@ -297,6 +297,7 @@ namespace TSA_V
newPoint
.
Group
=
index
;
newPoint
.
Group
=
index
;
newPoint
.
TagNo
=
point
.
TagNo
+
"-"
+
index
;
newPoint
.
TagNo
=
point
.
TagNo
+
"-"
+
index
;
newPoint
.
PointSizeX
=
point
.
PointSizeX
;
newPoint
.
PointSizeX
=
point
.
PointSizeX
;
newPoint
.
CheckOK
=
false
;
msg
+=
"\r\n"
+
point
.
pointName
+
"_"
+
point
.
PN
+
$
",更改组={index}"
;
msg
+=
"\r\n"
+
point
.
pointName
+
"_"
+
point
.
PN
+
$
",更改组={index}"
;
resultPointList
.
Add
(
newPoint
);
resultPointList
.
Add
(
newPoint
);
...
...
TSA-V/frmBoard/FrmPointInfo.cs
查看文件 @
cf1beef
...
@@ -188,12 +188,12 @@ namespace TSA_V
...
@@ -188,12 +188,12 @@ namespace TSA_V
projectorControl
.
YValue
=
smtPointInfo
.
NodePositionY
;
projectorControl
.
YValue
=
smtPointInfo
.
NodePositionY
;
projectorControl
.
ShowText
=
smtPointInfo
.
ShowText
;
projectorControl
.
ShowText
=
smtPointInfo
.
ShowText
;
projectorControl
.
SetPointType
(
smtPointInfo
.
PointType
,
smtPointInfo
.
PointSizeX
,
smtPointInfo
.
PointSizeY
,
smtPointInfo
.
PenWidth
,
smtPointInfo
.
PolaritiesType
);
projectorControl
.
SetPointType
(
smtPointInfo
.
PointType
,
smtPointInfo
.
PointSizeX
,
smtPointInfo
.
PointSizeY
,
smtPointInfo
.
PenWidth
,
smtPointInfo
.
PolaritiesType
,
smtPointInfo
.
PolarityAngle
);
if
(
this
.
smtPointInfo
.
IsEdit
==
false
)
if
(
this
.
smtPointInfo
.
IsEdit
==
false
)
{
{
if
(
prePoint
!=
null
&&
prePoint
.
IsEdit
)
if
(
prePoint
!=
null
&&
prePoint
.
IsEdit
)
{
{
projectorControl
.
SetPointType
(
prePoint
.
PointType
,
prePoint
.
PointSizeX
,
prePoint
.
PointSizeY
,
prePoint
.
PenWidth
,
prePoint
.
PolaritiesType
);
projectorControl
.
SetPointType
(
prePoint
.
PointType
,
prePoint
.
PointSizeX
,
prePoint
.
PointSizeY
,
prePoint
.
PenWidth
,
prePoint
.
PolaritiesType
,
prePoint
.
PolarityAngle
);
}
}
}
}
...
@@ -203,12 +203,12 @@ namespace TSA_V
...
@@ -203,12 +203,12 @@ namespace TSA_V
actControl
.
XValue
=
smtPointInfo
.
PositionX
;
actControl
.
XValue
=
smtPointInfo
.
PositionX
;
actControl
.
YValue
=
smtPointInfo
.
PositionY
;
actControl
.
YValue
=
smtPointInfo
.
PositionY
;
actControl
.
ShowText
=
smtPointInfo
.
ShowText
;
actControl
.
ShowText
=
smtPointInfo
.
ShowText
;
actControl
.
SetPointType
(
smtPointInfo
.
PointType
,
smtPointInfo
.
imgP
.
SizeY
,
smtPointInfo
.
imgP
.
SizeY
,
smtPointInfo
.
imgP
.
PWidth
,
smtPointInfo
.
PolaritiesType
);
actControl
.
SetPointType
(
smtPointInfo
.
PointType
,
smtPointInfo
.
imgP
.
SizeY
,
smtPointInfo
.
imgP
.
SizeY
,
smtPointInfo
.
imgP
.
PWidth
,
smtPointInfo
.
PolaritiesType
,
smtPointInfo
.
PolarityAngle
);
if
(
this
.
smtPointInfo
.
IsEdit
==
false
)
if
(
this
.
smtPointInfo
.
IsEdit
==
false
)
{
{
if
(
prePoint
!=
null
&&
prePoint
.
IsEdit
)
if
(
prePoint
!=
null
&&
prePoint
.
IsEdit
)
{
{
actControl
.
SetPointType
(
prePoint
.
PointType
,
prePoint
.
imgP
.
SizeX
,
prePoint
.
imgP
.
SizeY
,
prePoint
.
imgP
.
PWidth
,
prePoint
.
PolaritiesType
);
actControl
.
SetPointType
(
prePoint
.
PointType
,
prePoint
.
imgP
.
SizeX
,
prePoint
.
imgP
.
SizeY
,
prePoint
.
imgP
.
PWidth
,
prePoint
.
PolaritiesType
,
prePoint
.
PolarityAngle
);
}
}
}
}
actControl
.
ShowCurrPoint
();
actControl
.
ShowCurrPoint
();
...
@@ -314,6 +314,7 @@ namespace TSA_V
...
@@ -314,6 +314,7 @@ namespace TSA_V
smtPointInfo
.
ShowText
=
actControl
.
ShowText
;
smtPointInfo
.
ShowText
=
actControl
.
ShowText
;
smtPointInfo
.
imgP
=
new
DrawPointInfo
(
actControl
.
PointSizeX
,
actControl
.
PointSizeY
,
actControl
.
PenWidth
);
smtPointInfo
.
imgP
=
new
DrawPointInfo
(
actControl
.
PointSizeX
,
actControl
.
PointSizeY
,
actControl
.
PenWidth
);
smtPointInfo
.
PolaritiesType
=
actControl
.
PolaritiesType
;
smtPointInfo
.
PolaritiesType
=
actControl
.
PolaritiesType
;
smtPointInfo
.
PolarityAngle
=
actControl
.
PolarityAngle
;
smtPointInfo
.
CheckOK
=
false
;
smtPointInfo
.
CheckOK
=
false
;
if
(
boardInfo
!=
null
&&
boardInfo
.
calInfo
!=
null
&&
boardInfo
.
calInfo
.
CurrStep
>=
3
)
if
(
boardInfo
!=
null
&&
boardInfo
.
calInfo
!=
null
&&
boardInfo
.
calInfo
.
CurrStep
>=
3
)
...
@@ -338,6 +339,7 @@ namespace TSA_V
...
@@ -338,6 +339,7 @@ namespace TSA_V
smtPointInfo
.
PenWidth
=
projectorControl
.
PenWidth
;
smtPointInfo
.
PenWidth
=
projectorControl
.
PenWidth
;
smtPointInfo
.
ShowText
=
projectorControl
.
ShowText
;
smtPointInfo
.
ShowText
=
projectorControl
.
ShowText
;
smtPointInfo
.
PolaritiesType
=
projectorControl
.
PolaritiesType
;
smtPointInfo
.
PolaritiesType
=
projectorControl
.
PolaritiesType
;
smtPointInfo
.
PolarityAngle
=
projectorControl
.
PolarityAngle
;
smtPointInfo
.
pUTime
=
DateTime
.
Now
.
Ticks
;
smtPointInfo
.
pUTime
=
DateTime
.
Now
.
Ticks
;
smtPointInfo
.
CheckOK
=
true
;
smtPointInfo
.
CheckOK
=
true
;
}
}
...
...
TSA-V/manager/XYConvertManager.cs
查看文件 @
cf1beef
...
@@ -52,7 +52,7 @@ namespace TSA_V
...
@@ -52,7 +52,7 @@ namespace TSA_V
{
{
try
try
{
{
if
(
smtPoint
.
CheckOK
)
if
(
smtPoint
.
CheckOK
&&
Setting_NInit
.
Work_UseCheckOK
)
{
{
//校准点不再自动计算
//校准点不再自动计算
return
smtPoint
;
return
smtPoint
;
...
...
TSA-V/projector/FrmProjectorScreen.cs
查看文件 @
cf1beef
...
@@ -224,7 +224,7 @@ namespace TSA_V
...
@@ -224,7 +224,7 @@ namespace TSA_V
}
}
}
}
private
void
DrawPoint
(
Color
color
,
Graphics
g
,
int
x
,
int
y
,
int
type
=
0
,
int
PolaritiesType
=
0
,
int
sizeX
=
2
,
int
sizeY
=
2
,
int
lineLength
=
2
,
string
name
=
""
)
private
void
DrawPoint
(
Color
color
,
Graphics
g
,
int
x
,
int
y
,
int
type
=
0
,
int
PolaritiesType
=
0
,
int
angle
=
0
,
int
sizeX
=
2
,
int
sizeY
=
2
,
int
lineLength
=
2
,
string
name
=
""
)
{
{
if
(
sizeX
<
2
)
if
(
sizeX
<
2
)
{
{
...
@@ -273,86 +273,7 @@ namespace TSA_V
...
@@ -273,86 +273,7 @@ namespace TSA_V
{
{
g
.
FillEllipse
(
myBrush
,
new
Rectangle
(
x
-
sizeX
/
2
,
y
-
sizeY
/
2
,
sizeX
,
sizeY
));
//画实心椭圆
g
.
FillEllipse
(
myBrush
,
new
Rectangle
(
x
-
sizeX
/
2
,
y
-
sizeY
/
2
,
sizeX
,
sizeY
));
//画实心椭圆
}
}
//else if (type.Equals(PointType_Define.Plus_Up_7))
//{
// int plusSize = sizeX / 2;
// int pX = x;
// int pY = y - sizeY / 2 - lineLength - plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
//}
//else if (type.Equals(PointType_Define.Plus_Down_8))
//{
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeX / 2;
// int pX = x;
// int pY = y + sizeY / 2 + lineLength + plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
//else if (type.Equals(PointType_Define.Plus_Left_9))
//{
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeY / 2;
// int pX = x - sizeX / 2 - lineLength - plusSize;
// int pY = y;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
//else if (type.Equals(PointType_Define.Plus_Right_10))
//{
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeY / 2;
// int pX = x + sizeX / 2 + lineLength + plusSize;
// int pY = y;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
//else if (type.Equals(PointType_Define.Plus_LUp_11))
//{
// int plusSize = sizeX / 2;
// int pX = x-plusSize;
// int pY = y - sizeY / 2 - lineLength - plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
//}
//else if (type.Equals(PointType_Define.Plus_RUp_12))
//{
// int plusSize = sizeX / 2;
// int pX = x + plusSize;
// int pY = y - sizeY / 2 - lineLength - plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
//}
//else if (type.Equals(PointType_Define.Plus_LDown_13))
//{
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeX / 2;
// int pX = x-plusSize;
// int pY = y + sizeY / 2 + lineLength + plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
//else if (type.Equals(PointType_Define.Plus_RDown_14))
//{
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeX / 2;
// int pX = x + plusSize;
// int pY = y + sizeY / 2 + lineLength + plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
if
(
PolaritiesType
.
Equals
(
PolaritiesType_Define
.
Plus_Up_1
))
if
(
PolaritiesType
.
Equals
(
PolaritiesType_Define
.
Plus_Up_1
))
{
{
...
@@ -434,6 +355,13 @@ namespace TSA_V
...
@@ -434,6 +355,13 @@ namespace TSA_V
g
.
DrawLine
(
pen
,
new
Point
(
pX
-
plusSize
,
pY
),
new
Point
(
pX
+
plusSize
,
pY
));
g
.
DrawLine
(
pen
,
new
Point
(
pX
-
plusSize
,
pY
),
new
Point
(
pX
+
plusSize
,
pY
));
g
.
DrawLine
(
pen
,
new
Point
(
pX
,
pY
-
plusSize
),
new
Point
(
pX
,
pY
+
plusSize
));
g
.
DrawLine
(
pen
,
new
Point
(
pX
,
pY
-
plusSize
),
new
Point
(
pX
,
pY
+
plusSize
));
}
}
else
if
(
angle
>
0
)
{
int
pointWidth
=
sizeX
;
Point
drawP
=
ProjectorPInfo
.
CalculatePoint
(
new
Point
(
x
,
y
),
pointWidth
,
angle
);
g
.
DrawLine
(
pen
,
new
Point
(
drawP
.
X
-
pointWidth
/
2
,
drawP
.
Y
),
new
Point
(
drawP
.
X
+
pointWidth
/
2
,
drawP
.
Y
));
g
.
DrawLine
(
pen
,
new
Point
(
drawP
.
X
,
drawP
.
Y
-
pointWidth
/
2
),
new
Point
(
drawP
.
X
,
drawP
.
Y
+
pointWidth
/
2
));
}
if
(!
name
.
Equals
(
""
))
if
(!
name
.
Equals
(
""
))
{
{
int
size
=
(
sizeX
+
sizeY
)
/
2
;
int
size
=
(
sizeX
+
sizeY
)
/
2
;
...
@@ -490,7 +418,7 @@ namespace TSA_V
...
@@ -490,7 +418,7 @@ namespace TSA_V
}
}
Graphics
g
=
panel1
.
CreateGraphics
();
Graphics
g
=
panel1
.
CreateGraphics
();
Color
pColor
=
Color
.
FromArgb
(
p
.
showColor
);
Color
pColor
=
Color
.
FromArgb
(
p
.
showColor
);
DrawPoint
(
pColor
,
g
,
(
int
)
p
.
PX
,
(
int
)
p
.
PY
,
p
.
PType
,
p
.
PolaritiesType
,
p
.
SizeX
,
p
.
SizeY
,
p
.
PenWidth
,
p
.
ShowText
);
DrawPoint
(
pColor
,
g
,
(
int
)
p
.
PX
,
(
int
)
p
.
PY
,
p
.
PType
,
p
.
PolaritiesType
,
p
.
PolarityAngle
,
p
.
SizeX
,
p
.
SizeY
,
p
.
PenWidth
,
p
.
ShowText
);
g
.
Dispose
();
g
.
Dispose
();
}
}
public
void
ShowPoint
(
bool
showName
,
int
rgbColor
,
params
SMTPointInfo
[]
points
)
public
void
ShowPoint
(
bool
showName
,
int
rgbColor
,
params
SMTPointInfo
[]
points
)
...
@@ -509,7 +437,7 @@ namespace TSA_V
...
@@ -509,7 +437,7 @@ namespace TSA_V
int
y
=
(
int
)
point
.
NodePositionY
;
int
y
=
(
int
)
point
.
NodePositionY
;
int
sizex
=
point
.
PointSizeX
;
int
sizex
=
point
.
PointSizeX
;
int
sizey
=
point
.
PointSizeY
;
int
sizey
=
point
.
PointSizeY
;
DrawPoint
(
pColor
,
g
,
x
,
y
,
type
,
point
.
PolaritiesType
,
sizex
,
sizey
,
point
.
PenWidth
,
""
);
DrawPoint
(
pColor
,
g
,
x
,
y
,
type
,
point
.
PolaritiesType
,
point
.
PolarityAngle
,
sizex
,
sizey
,
point
.
PenWidth
,
""
);
if
(
showName
)
if
(
showName
)
{
{
...
@@ -551,7 +479,7 @@ namespace TSA_V
...
@@ -551,7 +479,7 @@ namespace TSA_V
int
y
=
(
int
)
point
.
NodePositionY
;
int
y
=
(
int
)
point
.
NodePositionY
;
int
sizex
=
point
.
PointSizeX
;
int
sizex
=
point
.
PointSizeX
;
int
sizey
=
point
.
PointSizeY
;
int
sizey
=
point
.
PointSizeY
;
DrawPoint
(
pColor
,
g
,
x
,
y
,
type
,
point
.
PolaritiesType
,
sizex
,
sizey
,
point
.
PenWidth
,
""
);
DrawPoint
(
pColor
,
g
,
x
,
y
,
type
,
point
.
PolaritiesType
,
point
.
PolarityAngle
,
sizex
,
sizey
,
point
.
PenWidth
,
""
);
if
(
showName
)
if
(
showName
)
{
{
...
@@ -677,6 +605,10 @@ namespace TSA_V
...
@@ -677,6 +605,10 @@ namespace TSA_V
///"8=正极限_右下方"
///"8=正极限_右下方"
/// </summary>
/// </summary>
public
static
int
Plus_RDown_8
=
8
;
public
static
int
Plus_RDown_8
=
8
;
/// <summary>
/// 自定义角度
/// </summary>
public
static
int
Plus_Custom
=
9
;
}
}
...
...
UserFromControl/ProjectorControl.Designer.cs
查看文件 @
cf1beef
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
private
void
InitializeComponent
()
private
void
InitializeComponent
()
{
{
this
.
group
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
group
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
pictureBox6
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
pictureBox6
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
pictureBox5
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
pictureBox5
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
pictureBox4
=
new
System
.
Windows
.
Forms
.
PictureBox
();
this
.
pictureBox4
=
new
System
.
Windows
.
Forms
.
PictureBox
();
...
@@ -59,8 +61,8 @@
...
@@ -59,8 +61,8 @@
this
.
lblx
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblx
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnShowPoint
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnShowPoint
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lbltype
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lbltype
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
numAngle
=
new
System
.
Windows
.
Forms
.
NumericUpDown
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
group
.
SuspendLayout
();
this
.
group
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
pictureBox6
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
pictureBox6
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
pictureBox5
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
pictureBox5
)).
BeginInit
();
...
@@ -73,6 +75,7 @@
...
@@ -73,6 +75,7 @@
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numY
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numY
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numX
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numX
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numPenWidth
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numPenWidth
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numAngle
)).
BeginInit
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// group
// group
...
@@ -81,6 +84,8 @@
...
@@ -81,6 +84,8 @@
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
group
.
BackColor
=
System
.
Drawing
.
Color
.
Black
;
this
.
group
.
BackColor
=
System
.
Drawing
.
Color
.
Black
;
this
.
group
.
Controls
.
Add
(
this
.
label1
);
this
.
group
.
Controls
.
Add
(
this
.
numAngle
);
this
.
group
.
Controls
.
Add
(
this
.
groupBox2
);
this
.
group
.
Controls
.
Add
(
this
.
groupBox2
);
this
.
group
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
group
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
group
.
Controls
.
Add
(
this
.
pictureBox6
);
this
.
group
.
Controls
.
Add
(
this
.
pictureBox6
);
...
@@ -121,6 +126,26 @@
...
@@ -121,6 +126,26 @@
this
.
group
.
Text
=
"投影位置"
;
this
.
group
.
Text
=
"投影位置"
;
this
.
group
.
Paint
+=
new
System
.
Windows
.
Forms
.
PaintEventHandler
(
this
.
group_Paint
);
this
.
group
.
Paint
+=
new
System
.
Windows
.
Forms
.
PaintEventHandler
(
this
.
group_Paint
);
//
//
// groupBox2
//
this
.
groupBox2
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
9
,
171
);
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
508
,
1
);
this
.
groupBox2
.
TabIndex
=
339
;
this
.
groupBox2
.
TabStop
=
false
;
//
// groupBox1
//
this
.
groupBox1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
9
,
54
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
508
,
1
);
this
.
groupBox1
.
TabIndex
=
338
;
this
.
groupBox1
.
TabStop
=
false
;
//
// pictureBox6
// pictureBox6
//
//
this
.
pictureBox6
.
Location
=
new
System
.
Drawing
.
Point
(
377
,
59
);
this
.
pictureBox6
.
Location
=
new
System
.
Drawing
.
Point
(
377
,
59
);
...
@@ -216,7 +241,7 @@
...
@@ -216,7 +241,7 @@
// panImg
// panImg
//
//
this
.
panImg
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
panImg
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
panImg
.
Location
=
new
System
.
Drawing
.
Point
(
3
21
,
104
);
this
.
panImg
.
Location
=
new
System
.
Drawing
.
Point
(
3
83
,
105
);
this
.
panImg
.
Name
=
"panImg"
;
this
.
panImg
.
Name
=
"panImg"
;
this
.
panImg
.
Size
=
new
System
.
Drawing
.
Size
(
134
,
63
);
this
.
panImg
.
Size
=
new
System
.
Drawing
.
Size
(
134
,
63
);
this
.
panImg
.
TabIndex
=
328
;
this
.
panImg
.
TabIndex
=
328
;
...
@@ -537,25 +562,46 @@
...
@@ -537,25 +562,46 @@
this
.
lbltype
.
Text
=
"点形状:"
;
this
.
lbltype
.
Text
=
"点形状:"
;
this
.
lbltype
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lbltype
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
//
//
groupBox1
//
numAngle
//
//
this
.
groupBox1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
this
.
numAngle
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
numAngle
.
Increment
=
new
decimal
(
new
int
[]
{
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
9
,
54
);
5
,
this
.
groupBox1
.
Name
=
"groupBox1"
;
0
,
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
508
,
1
);
0
,
this
.
groupBox1
.
TabIndex
=
338
;
0
});
this
.
groupBox1
.
TabStop
=
false
;
this
.
numAngle
.
Location
=
new
System
.
Drawing
.
Point
(
283
,
138
);
this
.
numAngle
.
Maximum
=
new
decimal
(
new
int
[]
{
360
,
0
,
0
,
0
});
this
.
numAngle
.
Minimum
=
new
decimal
(
new
int
[]
{
1
,
0
,
0
,
-
2147483648
});
this
.
numAngle
.
Name
=
"numAngle"
;
this
.
numAngle
.
Size
=
new
System
.
Drawing
.
Size
(
61
,
26
);
this
.
numAngle
.
TabIndex
=
340
;
this
.
numAngle
.
Value
=
new
decimal
(
new
int
[]
{
30
,
0
,
0
,
0
});
this
.
numAngle
.
ValueChanged
+=
new
System
.
EventHandler
(
this
.
numAngle_ValueChanged
);
//
//
//
groupBox2
//
label1
//
//
this
.
groupBox2
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
this
.
label1
.
AutoSize
=
true
;
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
label1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
9
,
171
);
this
.
label1
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
349
,
143
);
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
508
,
1
);
this
.
label1
.
Name
=
"label1"
;
this
.
groupBox2
.
TabIndex
=
339
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
13
,
17
);
this
.
groupBox2
.
TabStop
=
false
;
this
.
label1
.
TabIndex
=
341
;
this
.
label1
.
Text
=
"°"
;
this
.
label1
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
//
// ProjectorControl
// ProjectorControl
//
//
...
@@ -580,6 +626,7 @@
...
@@ -580,6 +626,7 @@
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numY
)).
EndInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numY
)).
EndInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numX
)).
EndInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numX
)).
EndInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numPenWidth
)).
EndInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numPenWidth
)).
EndInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numAngle
)).
EndInit
();
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
}
}
...
@@ -619,5 +666,7 @@
...
@@ -619,5 +666,7 @@
private
System
.
Windows
.
Forms
.
PictureBox
pictureBox3
;
private
System
.
Windows
.
Forms
.
PictureBox
pictureBox3
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox1
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox1
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox2
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox2
;
private
System
.
Windows
.
Forms
.
NumericUpDown
numAngle
;
private
System
.
Windows
.
Forms
.
Label
label1
;
}
}
}
}
UserFromControl/ProjectorControl.cs
查看文件 @
cf1beef
...
@@ -128,6 +128,8 @@ namespace UserFromControl
...
@@ -128,6 +128,8 @@ namespace UserFromControl
int
penWidth
=
(
int
)
numPenWidth
.
Value
;
int
penWidth
=
(
int
)
numPenWidth
.
Value
;
string
name
=
FormUtil
.
getValue
(
txtname
);
string
name
=
FormUtil
.
getValue
(
txtname
);
int
ptype
=
cmbpolarities
.
SelectedIndex
;
int
ptype
=
cmbpolarities
.
SelectedIndex
;
int
angle
=
(
int
)
numAngle
.
Value
;
angle
=
ProjectorPInfo
.
getAngleByType
(
ptype
,
angle
);
////如果亮度和大小超过范围,直接用默认值
////如果亮度和大小超过范围,直接用默认值
//if (sizeX < 1 || sizeX > 255)
//if (sizeX < 1 || sizeX > 255)
//{
//{
...
@@ -139,7 +141,7 @@ namespace UserFromControl
...
@@ -139,7 +141,7 @@ namespace UserFromControl
// sizeY = DefaultPSize;
// sizeY = DefaultPSize;
// numSizeY.Text = sizeY.ToString();
// numSizeY.Text = sizeY.ToString();
//}
//}
ProjectorPInfo
p
=
new
ProjectorPInfo
(
px
,
py
,
pointType
,
ptype
,
sizeX
,
sizeY
,
penWidth
,
name
,
ShowColor
);
ProjectorPInfo
p
=
new
ProjectorPInfo
(
px
,
py
,
pointType
,
ptype
,
angle
,
sizeX
,
sizeY
,
penWidth
,
name
,
ShowColor
);
return
p
;
return
p
;
}
}
public
void
ShowCurrPoint
()
public
void
ShowCurrPoint
()
...
@@ -224,13 +226,14 @@ namespace UserFromControl
...
@@ -224,13 +226,14 @@ namespace UserFromControl
if
(!(
cmbType
.
SelectedIndex
+
1
).
Equals
(
lastType
))
if
(!(
cmbType
.
SelectedIndex
+
1
).
Equals
(
lastType
))
{
{
lastType
=
cmbType
.
SelectedIndex
+
1
;
lastType
=
cmbType
.
SelectedIndex
+
1
;
DrawPoint
(
lastType
,
lastPolaritiesType
);
DrawPoint
(
lastType
,
lastPolaritiesType
,
lastAngle
);
ShowCurrPoint
();
ShowCurrPoint
();
TypeUpdate
(
cmbType
.
SelectedIndex
);
TypeUpdate
(
cmbType
.
SelectedIndex
);
}
}
}
}
private
int
lastType
=
1
;
private
int
lastType
=
1
;
private
int
lastPolaritiesType
=
0
;
private
int
lastPolaritiesType
=
0
;
private
int
lastAngle
=
0
;
public
double
XValue
public
double
XValue
{
{
set
set
...
@@ -343,6 +346,24 @@ namespace UserFromControl
...
@@ -343,6 +346,24 @@ namespace UserFromControl
}
}
}
}
public
int
PolarityAngle
{
set
{
if
((
int
)
value
>=
0
)
{
numAngle
.
Value
=
value
;
}
else
{
numAngle
.
Value
=
ProjectorPInfo
.
getAngleByType
(
PolaritiesType
,
value
);
}
}
get
{
return
(
int
)
numAngle
.
Value
;
}
}
public
void
UpdateStatus
()
public
void
UpdateStatus
()
{
{
...
@@ -439,7 +460,7 @@ namespace UserFromControl
...
@@ -439,7 +460,7 @@ namespace UserFromControl
LogUtil
.
error
(
"ProjectorControl_Load 出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"ProjectorControl_Load 出错:"
+
ex
.
ToString
());
}
}
}
}
private
void
DrawPoint
(
int
type
,
int
polaritiesType
,
int
x
=
0
,
int
y
=
0
,
int
sizeX
=
2
,
int
sizeY
=
2
,
int
lineLength
=
2
)
private
void
DrawPoint
(
int
type
,
int
polaritiesType
,
int
angle
,
int
x
=
0
,
int
y
=
0
,
int
sizeX
=
2
,
int
sizeY
=
2
,
int
lineLength
=
2
)
{
{
Graphics
g
=
panImg
.
CreateGraphics
();
Graphics
g
=
panImg
.
CreateGraphics
();
if
(
sizeX
<
2
)
if
(
sizeX
<
2
)
...
@@ -459,7 +480,11 @@ namespace UserFromControl
...
@@ -459,7 +480,11 @@ namespace UserFromControl
g
.
Clear
(
panImg
.
BackColor
);
g
.
Clear
(
panImg
.
BackColor
);
Pen
pen
=
new
Pen
(
panImg
.
ForeColor
,
lineLength
);
Pen
pen
=
new
Pen
(
panImg
.
ForeColor
,
lineLength
);
int
pointWidth
=
sizeX
;
//圆形的半径
if
(
sizeY
>
sizeX
)
{
pointWidth
=
sizeY
;
}
System
.
Drawing
.
SolidBrush
myBrush
=
new
System
.
Drawing
.
SolidBrush
(
panImg
.
ForeColor
);
System
.
Drawing
.
SolidBrush
myBrush
=
new
System
.
Drawing
.
SolidBrush
(
panImg
.
ForeColor
);
//点类型,1 = 点,2 = +,3 =|,4 = -,5 = 方形,6 = 圆圈
//点类型,1 = 点,2 = +,3 =|,4 = -,5 = 方形,6 = 圆圈
if
(
type
.
Equals
(
2
))
if
(
type
.
Equals
(
2
))
...
@@ -490,7 +515,7 @@ namespace UserFromControl
...
@@ -490,7 +515,7 @@ namespace UserFromControl
{
{
g
.
FillEllipse
(
myBrush
,
new
Rectangle
(
x
-
sizeX
/
2
,
y
-
sizeY
/
2
,
sizeX
,
sizeY
));
//画实心椭圆
g
.
FillEllipse
(
myBrush
,
new
Rectangle
(
x
-
sizeX
/
2
,
y
-
sizeY
/
2
,
sizeX
,
sizeY
));
//画实心椭圆
}
}
if
(
polaritiesType
.
Equals
(
0
))
if
(
polaritiesType
.
Equals
(
0
))
{
{
}
}
...
@@ -580,14 +605,18 @@ namespace UserFromControl
...
@@ -580,14 +605,18 @@ namespace UserFromControl
int
pY
=
y
+
sizeY
/
2
+
lineLength
+
plusSize
;
int
pY
=
y
+
sizeY
/
2
+
lineLength
+
plusSize
;
g
.
DrawLine
(
pen
,
new
Point
(
pX
-
plusSize
,
pY
),
new
Point
(
pX
+
plusSize
,
pY
));
g
.
DrawLine
(
pen
,
new
Point
(
pX
-
plusSize
,
pY
),
new
Point
(
pX
+
plusSize
,
pY
));
g
.
DrawLine
(
pen
,
new
Point
(
pX
,
pY
-
plusSize
),
new
Point
(
pX
,
pY
+
plusSize
));
g
.
DrawLine
(
pen
,
new
Point
(
pX
,
pY
-
plusSize
),
new
Point
(
pX
,
pY
+
plusSize
));
}
}
}
else
if
(
angle
>
0
)
{
Point
drawP
=
ProjectorPInfo
.
CalculatePoint
(
new
Point
(
x
,
y
),
pointWidth
,
angle
);
g
.
DrawLine
(
pen
,
new
Point
(
drawP
.
X
-
pointWidth
/
2
,
drawP
.
Y
),
new
Point
(
drawP
.
X
+
pointWidth
/
2
,
drawP
.
Y
));
g
.
DrawLine
(
pen
,
new
Point
(
drawP
.
X
,
drawP
.
Y
-
pointWidth
/
2
),
new
Point
(
drawP
.
X
,
drawP
.
Y
+
pointWidth
/
2
));
}
}
private
void
group_Paint
(
object
sender
,
PaintEventArgs
e
)
private
void
group_Paint
(
object
sender
,
PaintEventArgs
e
)
{
{
return
;
return
;
DrawPoint
(
lastType
,
lastPolaritiesType
);
ShowCurrPoint
();
}
}
private
void
cmbpolarities_SelectedIndexChanged
(
object
sender
,
EventArgs
e
)
private
void
cmbpolarities_SelectedIndexChanged
(
object
sender
,
EventArgs
e
)
...
@@ -595,19 +624,23 @@ namespace UserFromControl
...
@@ -595,19 +624,23 @@ namespace UserFromControl
if
(!(
cmbpolarities
.
SelectedIndex
+
1
).
Equals
(
lastPolaritiesType
))
if
(!(
cmbpolarities
.
SelectedIndex
+
1
).
Equals
(
lastPolaritiesType
))
{
{
lastPolaritiesType
=
cmbpolarities
.
SelectedIndex
;
lastPolaritiesType
=
cmbpolarities
.
SelectedIndex
;
DrawPoint
(
lastType
,
lastPolaritiesType
);
lastAngle
=(
int
)
numAngle
.
Value
;
lastAngle
=
ProjectorPInfo
.
getAngleByType
(
lastPolaritiesType
,
lastAngle
);
numAngle
.
Value
=
lastAngle
;
DrawPoint
(
lastType
,
lastPolaritiesType
,
lastAngle
);
ShowCurrPoint
();
ShowCurrPoint
();
}
}
}
}
public
void
SetPointType
(
int
pointType
,
int
pointSizeX
,
int
pointSizeY
,
int
penWidth
,
int
polaritiesType
)
public
void
SetPointType
(
int
pointType
,
int
pointSizeX
,
int
pointSizeY
,
int
penWidth
,
int
polaritiesType
,
int
angle
)
{
{
this
.
PointType
=
pointType
;
this
.
PointType
=
pointType
;
this
.
PointSizeX
=
pointSizeX
;
this
.
PointSizeX
=
pointSizeX
;
this
.
PointSizeY
=
pointSizeY
;
this
.
PointSizeY
=
pointSizeY
;
this
.
PenWidth
=
penWidth
;
this
.
PenWidth
=
penWidth
;
this
.
PolaritiesType
=
polaritiesType
;
this
.
PolaritiesType
=
polaritiesType
;
this
.
PolarityAngle
=
ProjectorPInfo
.
getAngleByType
(
polaritiesType
,
angle
);
}
}
private
void
TypeUpdate
(
int
index
)
private
void
TypeUpdate
(
int
index
)
{
{
...
@@ -654,5 +687,14 @@ namespace UserFromControl
...
@@ -654,5 +687,14 @@ namespace UserFromControl
{
{
PointType
=
6
;
PointType
=
6
;
}
}
private
void
numAngle_ValueChanged
(
object
sender
,
EventArgs
e
)
{
lastPolaritiesType
=
cmbpolarities
.
SelectedIndex
;
lastAngle
=
(
int
)
numAngle
.
Value
;
lastAngle
=
ProjectorPInfo
.
getAngleByType
(
lastPolaritiesType
,
lastAngle
);
DrawPoint
(
lastType
,
lastPolaritiesType
,
lastAngle
);
ShowCurrPoint
();
}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论