Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit aac3d48b
由
LN
编写于
2024-09-06 13:17:27 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加RGBLED
1 个父辈
81cd6d0a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
404 行增加
和
163 行删除
Common/Setting_NInit.cs
DeviceLibrary/DeviceLibrary.csproj
DeviceLibrary/SQLite.cs
DeviceLibrary/config/Positions.csv
DeviceLibrary/csvLoad/position/PostionBase.cs
DeviceLibrary/csvLoad/position/TSAVPosition.cs
DeviceLibrary/deviceLibrary/ledLabel/LedLabelController.cs
DeviceLibrary/deviceLibrary/rgbLed/RgbLedController.cs
DeviceLibrary/deviceLibrary/rgbLed/flyelectronicControl/Flyelectronic_485_RGB_Controller.cs
DeviceLibrary/manager/LineWidthManager.cs
DeviceLibrary/manager/work/StockInfo.cs
DeviceLibrary/manager/work/TSAVBean.cs
DeviceLibrary/manager/work/WorkInfo.cs
TSA-V/FrmComponentList.Designer.cs
TSA-V/FrmComponentList.cs
TSA-V/FrmComponentList.resx
TSA-V/FrmHistorySearch.Designer.cs
TSA-V/FrmHistorySearch.resx
TSA-V/workForm/FrmTSAV.Designer.cs
Common/Setting_NInit.cs
查看文件 @
aac3d48
...
...
@@ -162,6 +162,11 @@ namespace TSA_V.Common
[
MyConfigComment
(
"最后一次校准信息,保存后作为新板子的基准"
)]
public
static
MyConfig
<
string
>
Data_LastCalibrateInfo
=
""
;
[
MyConfigComment
(
"RGB灯带端口号"
)]
public
static
MyConfig
<
string
>
RGBLed_PortName
=
""
;
public
static
void
ChangeConfig
()
{
try
...
...
DeviceLibrary/DeviceLibrary.csproj
查看文件 @
aac3d48
...
...
@@ -108,6 +108,8 @@
<Compile Include="deviceLibrary\IO\NiRenIO.cs" />
<Compile Include="deviceLibrary\ledLabel\LedLabelController.cs" />
<Compile Include="deviceLibrary\ledLabel\LabelInfo.cs" />
<Compile Include="deviceLibrary\rgbLed\flyelectronicControl\Flyelectronic_485_RGB_Controller.cs" />
<Compile Include="deviceLibrary\rgbLed\RgbLedController.cs" />
<Compile Include="manager\ImageUtilM.cs" />
<Compile Include="manager\PTipSoundProcess.cs" />
<Compile Include="deviceLibrary\led\LedManager.cs" />
...
...
DeviceLibrary/SQLite.cs
查看文件 @
aac3d48
...
...
@@ -79,13 +79,60 @@ namespace DAL
return
rtn
;
}
//public bool AddHistory(TSA_V.DeviceLibrary.OpInfo info, out int id)
//{
// string sql;
// bool rtn;
// id = info.ID;
// //查询可写入的ID
// if (info.ID == 0)
// {
// sql = "SELECT MAX(ID) FROM PointInfo";
// rtn = Select(sql, out string[][] data);
// if (!rtn) return false;
// int.TryParse(data[0][0], out id);
// id++;
// }
// //添加操作信息记录
// string createDate = string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now);
// sql = "INSERT INTO OperateInfo(ID,ProName,ProType,BarCode,BoardWidth,BoardLength,AoiResult,UserName,CreateDate) " +
// "VALUES(" + id + ",'" + info.ProName + "','" + info.ProType + "','" + info.BarCode + "'," + info.BoardWidth + "," +
// info.BoardLength + ",'" + info.AoiResult + "','" + TSA_V.DeviceLibrary.DB.userName + "','" + createDate + "')";
// rtn = Execute(sql);
// if (!rtn) return false;
// //添加操作点信息
// if (info.ID == 0)
// {
// SQLiteTransaction tr = _con.BeginTransaction();
// for (int i = 0; i < info.pointList.Count; i++)
// {
// sql = "INSERT INTO PointInfo(ID,PartNum,PointName,CreateDate) " +
// "VALUES(" + id + ",'" + info.pointList[i].PartNum + "','" + info.pointList[i].PointName + "','" + createDate + "')";
// rtn = Execute(sql);
// if (!rtn) break;
// }
// LogUtil.info("数据库Commit");
// if (rtn)
// tr.Commit();
// else
// tr.Rollback();
// LogUtil.info("数据库 完成");
// }
// return rtn;
//}
public
bool
AddHistory
(
TSA_V
.
DeviceLibrary
.
OpInfo
info
,
out
int
id
)
{
string
sql
;
bool
rtn
;
id
=
info
.
ID
;
//查询可写入的ID
//
查询可写入的ID
if
(
info
.
ID
==
0
)
{
sql
=
"SELECT MAX(ID) FROM PointInfo"
;
...
...
@@ -95,31 +142,37 @@ namespace DAL
id
++;
}
//添加操作信息记录
string
createDate
=
string
.
Format
(
"{0:yyyy-MM-dd HH:mm:ss}"
,
DateTime
.
Now
);
sql
=
"INSERT INTO OperateInfo(ID,ProName,ProType,BarCode,BoardWidth,BoardLength,AoiResult,UserName,
CreateDate) "
+
"VALUES("
+
id
+
",'"
+
info
.
ProName
+
"','"
+
info
.
ProType
+
"','"
+
info
.
BarCode
+
"',"
+
info
.
BoardWidth
+
","
+
info
.
BoardLength
+
",'"
+
info
.
AoiResult
+
"','"
+
TSA_V
.
DeviceLibrary
.
DB
.
userName
+
"','"
+
createDate
+
"
')"
;
//
添加操作信息记录
string
createDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
sql
=
$
"INSERT INTO OperateInfo(ID, ProName, ProType, BarCode, BoardWidth, BoardLength, AoiResult, UserName,
CreateDate) "
+
$
"VALUES({id}, '{info.ProName}', '{info.ProType}', '{info.BarCode}', {info.BoardWidth}, {info.BoardLength}, "
+
$
"'{info.AoiResult}', '{TSA_V.DeviceLibrary.DB.userName}', '{createDate}
')"
;
rtn
=
Execute
(
sql
);
if
(!
rtn
)
return
false
;
//添加操作点信息
//
添加操作点信息
if
(
info
.
ID
==
0
)
{
SQLiteTransaction
tr
=
_con
.
BeginTransaction
();
for
(
int
i
=
0
;
i
<
info
.
pointList
.
Count
;
i
++)
using
(
SQLiteTransaction
tr
=
_con
.
BeginTransaction
())
{
sql
=
"INSERT INTO PointInfo(ID,PartNum,PointName,CreateDate) "
+
"VALUES("
+
id
+
",'"
+
info
.
pointList
[
i
].
PartNum
+
"','"
+
info
.
pointList
[
i
].
PointName
+
"','"
+
createDate
+
"')"
;
rtn
=
Execute
(
sql
);
if
(!
rtn
)
break
;
try
{
foreach
(
var
point
in
info
.
pointList
)
{
sql
=
$
"INSERT INTO PointInfo(ID, PartNum, PointName, CreateDate) "
+
$
"VALUES({id}, '{point.PartNum}', '{point.PointName}', '{createDate}')"
;
rtn
=
Execute
(
sql
);
if
(!
rtn
)
break
;
}
LogUtil
.
info
(
"数据库Commit"
);
tr
.
Commit
();
}
catch
{
tr
.
Rollback
();
return
false
;
}
}
LogUtil
.
info
(
"数据库Commit"
);
if
(
rtn
)
tr
.
Commit
();
else
tr
.
Rollback
();
LogUtil
.
info
(
"数据库 完成"
);
}
...
...
@@ -129,7 +182,6 @@ namespace DAL
private
bool
Select
(
string
sql
,
out
string
[][]
data
)
{
data
=
null
;
...
...
DeviceLibrary/config/Positions.csv
查看文件 @
aac3d48
...
...
@@ -106,3 +106,20 @@
10_8,98,1,2_5_8,14160,0,
10_9,99,1,2_5_9,8940,0,
10_10,100,1,2_5_10,3720,0,
,,,,,,
20_1,101,3,COM3,0,1#2#3#4#5,
20_2,102,3,COM3,1,6#7#8#9#10,
20_3,103,3,COM3,2,1#2#3#4#6,
20_4,104,3,COM3,3,6#7#8#9#11,
20_5,105,3,COM3,4,1#2#3#4#7,
20_6,106,3,COM3,5,6#7#8#9#12,
20_7,107,3,COM3,6,1#2#3#4#8,
20_8,108,3,COM3,7,6#7#8#9#13,
20_9,109,3,COM3,8,1#2#3#4#9,
20_10,110,3,COM3,9,6#7#8#9#14,
20_11,111,3,COM3,10,1#2#3#4#10,
20_12,112,3,COM3,11,6#7#8#9#15,
20_13,113,3,COM3,12,1#2#3#4#11,
20_14,114,3,COM3,13,6#7#8#9#16,
20_15,115,3,COM3,14,1#2#3#4#12,
20_16,116,3,COM3,15,6#7#8#9#17,
DeviceLibrary/csvLoad/position/PostionBase.cs
查看文件 @
aac3d48
...
...
@@ -14,7 +14,7 @@ namespace TSA_V.LoadCSVLibrary
[
CSVAttribute
(
"节点名称"
)]
public
string
PositionName
{
get
;
set
;
}
/// <summary>
///类型,1=转盘。2=
灯
///类型,1=转盘。2=
led标签灯。3=rgb灯带
/// </summary>
[
CSVAttribute
(
"类型"
)]
public
int
PositionType
{
get
;
set
;
}
...
...
DeviceLibrary/csvLoad/position/TSAVPosition.cs
查看文件 @
aac3d48
...
...
@@ -41,58 +41,92 @@ namespace TSA_V.LoadCSVLibrary
}
return
null
;
}
private
List
<
int
>
list
=
null
;
public
List
<
int
>
getLedList
()
private
List
<
int
>
l
edL
ist
=
null
;
public
List
<
int
>
getLedList
(
string
text
=
""
)
{
if
(
list
==
null
)
{
list
=
new
List
<
int
>();
if
(
Leds
.
IndexOf
(
'#'
)
>=
0
)
if
(
text
==
""
)
{
if
(
ledList
==
null
)
{
string
[]
str
=
Leds
.
Split
(
'#'
);
foreach
(
string
s
in
str
)
{
try
{
int
value
=
Convert
.
ToInt32
(
s
);
list
.
Add
(
value
);
}
catch
(
Exception
e
)
{
}
}
ledList
=
TextToIndexs
(
Leds
);
}
else
if
(
Leds
.
IndexOf
(
'-'
)
>=
0
)
return
ledList
;
}
else
{
return
TextToIndexs
(
text
);
}
}
private
List
<
int
>
TextToIndexs
(
string
text
)
{
List
<
int
>
list
=
new
List
<
int
>();
if
(
text
.
IndexOf
(
'#'
)
>=
0
)
{
string
[]
str
=
text
.
Split
(
'#'
);
foreach
(
string
s
in
str
)
{
string
[]
str
=
Leds
.
Split
(
'-'
);
try
{
int
min
=
Convert
.
ToInt32
(
str
[
0
]);
int
max
=
Convert
.
ToInt32
(
str
[
str
.
Length
-
1
]);
for
(
int
i
=
min
;
i
<=
max
;
i
++)
{
list
.
Add
(
i
);
}
int
value
=
Convert
.
ToInt32
(
s
);
list
.
Add
(
value
);
}
catch
(
Exception
e
x
)
catch
(
Exception
e
)
{
}
}
else
}
else
if
(
text
.
IndexOf
(
'-'
)
>=
0
)
{
string
[]
str
=
text
.
Split
(
'-'
);
try
{
try
{
int
value
=
Convert
.
ToInt32
(
Leds
);
list
.
Add
(
value
);
}
catch
(
Exception
e
)
int
min
=
Convert
.
ToInt32
(
str
[
0
]);
int
max
=
Convert
.
ToInt32
(
str
[
str
.
Length
-
1
]);
for
(
int
i
=
min
;
i
<=
max
;
i
++)
{
list
.
Add
(
i
);
}
}
catch
(
Exception
ex
)
{
}
}
else
{
try
{
int
value
=
Convert
.
ToInt32
(
text
);
list
.
Add
(
value
);
}
catch
(
Exception
e
)
{
}
}
return
list
;
}
public
bool
IsRgbLed
()
{
return
PositionType
.
Equals
(
3
);
}
public
bool
IsLedLabel
()
{
return
PositionType
.
Equals
(
2
);
}
public
bool
IsNodePos
()
{
if
(
PositionType
.
Equals
(
2
))
{
return
false
;
}
if
(
PositionType
.
Equals
(
3
))
{
return
false
;
}
return
true
;
}
}
}
DeviceLibrary/deviceLibrary/ledLabel/LedLabelController.cs
查看文件 @
aac3d48
...
...
@@ -27,7 +27,7 @@ namespace TSA_V.DeviceLibrary
string
ip
=
""
;
foreach
(
var
pos
in
positions
)
{
if
(
pos
.
PositionType
.
Equals
(
2
))
if
(
pos
.
IsLedLabel
(
))
{
ip
=
pos
.
DeviceIP
;
macs
.
Add
(
pos
.
Leds
);
...
...
@@ -51,7 +51,7 @@ namespace TSA_V.DeviceLibrary
{
position
=
new
TSAVPosition
();
}
if
(!
position
.
PositionType
.
Equals
(
2
))
if
(!
position
.
IsLedLabel
(
))
{
return
new
LabelInfo
();
}
...
...
DeviceLibrary/deviceLibrary/rgbLed/RgbLedController.cs
0 → 100644
查看文件 @
aac3d48
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
TSA_V.Common
;
using
TSA_V.LoadCSVLibrary
;
namespace
TSA_V.DeviceLibrary
{
public
class
RgbLedController
{
public
static
Flyelectronic_485_RGB_Controller
rGB_Controller
=
null
;
public
static
bool
Init
()
{
if
(
Setting_NInit
.
RGBLed_PortName
==
""
)
{
LogUtil
.
error
(
"未配置RGBLED端口号"
);
return
false
;
}
rGB_Controller
=
new
Flyelectronic_485_RGB_Controller
(
"LED"
);
rGB_Controller
.
OpenPort
(
Setting_NInit
.
RGBLed_PortName
,
out
string
errmsg
);
if
(
errmsg
!=
null
)
{
LogUtil
.
error
(
"初始化RgbLed灯失败:"
+
errmsg
);
return
false
;
}
return
true
;
}
private
static
Color
defColor
=
Color
.
Green
;
public
static
void
OpenPosLed
(
TSAVPosition
position
)
{
if
(
position
.
IsRgbLed
())
{
List
<
int
>
leds
=
position
.
getLedList
();
OpenPosLed
(
leds
);
}
}
public
static
void
OpenPosLed
(
List
<
int
>
leds
)
{
if
(
rGB_Controller
==
null
)
{
return
;
}
rGB_Controller
.
ShowLedColor
(
defColor
,
leds
);
}
public
static
void
CloseAll
()
{
if
(
rGB_Controller
==
null
)
{
return
;
}
rGB_Controller
.
ShowColor
(
Color
.
Black
);
}
public
static
void
OpenAll
()
{
if
(
rGB_Controller
==
null
)
{
return
;
}
rGB_Controller
.
ShowColor
(
defColor
);
}
}
}
DeviceLibrary/deviceLibrary/rgbLed/flyelectronicControl/Flyelectronic_485_RGB_Controller.cs
0 → 100644
查看文件 @
aac3d48
此文件的差异被折叠,
点击展开。
DeviceLibrary/manager/LineWidthManager.cs
查看文件 @
aac3d48
...
...
@@ -126,13 +126,18 @@ namespace TSA_V.DeviceLibrary
result
=
ResourceControl
.
GetString
(
ResourceControl
.
UserStop
,
"用户中止"
);
break
;
}
else
if
(!
IOManager
.
ShuddenOK
())
{
result
=
ResourceControl
.
GetString
(
ResourceControl
.
UserStop
,
"用户中止"
);
break
;
}
else
if
(
stopwatch
.
ElapsedMilliseconds
/
1000
>
timeOutSeconds
)
{
{
result
=
ResourceControl
.
GetString
(
ResourceControl
.
HomeMoveTimeout
,
"等待原点完成超时"
);
break
;
}
else
if
(
PUSICANControl
.
IsHomeEnd
(
LWidthManager
.
Line_NodeAddr
))
{
{
result
=
""
;
break
;
}
...
...
@@ -160,6 +165,12 @@ namespace TSA_V.DeviceLibrary
IsStop
=
true
;
result
=
ResourceControl
.
GetString
(
ResourceControl
.
UserStop
,
"用户中止"
);
break
;
}
else
if
(!
IOManager
.
ShuddenOK
())
{
IsStop
=
true
;
result
=
ResourceControl
.
GetString
(
ResourceControl
.
UserStop
,
"用户中止"
);
break
;
}
else
if
(
stopwatch
.
ElapsedMilliseconds
/
1000
>
timeOutSeconds
)
{
...
...
DeviceLibrary/manager/work/StockInfo.cs
查看文件 @
aac3d48
...
...
@@ -70,7 +70,8 @@ namespace TSA_V.DeviceLibrary
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
Thread
.
Sleep
(
300
);
}
if
(
position
.
PositionType
.
Equals
(
1
))
if
(
position
.
IsNodePos
())
{
NodeInfo
moveNode
=
position
.
GetNode
(
TSAVBean
.
RotateMap
);
if
(
moveNode
!=
null
)
...
...
@@ -92,13 +93,18 @@ namespace TSA_V.DeviceLibrary
LogUtil
.
error
(
"positionNum="
+
position
.
PositionNum
+
",未找到对应的运动轴!"
);
}
}
else
if
(
position
.
PositionType
.
Equals
(
2
))
{
else
if
(
position
.
IsLedLabel
())
{
if
(
PreNodeId
>
0
)
{
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
}
PreNodeId
=
0
;
LabelInfo
label
=
LedLabelController
.
GetLabel
(
position
,
componet
,
true
);
LedLabelController
.
UpdateScreen
(
label
);
PreLabel
=
label
;
}
else
else
if
(
position
.
IsRgbLed
())
{
if
(
PreNodeId
>
0
)
{
...
...
DeviceLibrary/manager/work/TSAVBean.cs
查看文件 @
aac3d48
...
...
@@ -947,6 +947,9 @@ namespace TSA_V.DeviceLibrary
}
}
}
//调宽也停止
}
//LedLabelController.CloseAll();
...
...
DeviceLibrary/manager/work/WorkInfo.cs
查看文件 @
aac3d48
...
...
@@ -33,6 +33,7 @@ namespace TSA_V.DeviceLibrary
public
DateTime
LastSetpTime
=
DateTime
.
Now
;
public
uint
PreNodeId
=
0
;
public
LabelInfo
PreLabel
=
null
;
public
List
<
int
>
PreRgbLed
=
new
List
<
int
>();
public
List
<
SMTPointInfo
>
needWorkSmtList
=
new
List
<
SMTPointInfo
>();
//开始工作后共工作了几块电路板``````
public
int
BoardCount
=
0
;
...
...
@@ -125,6 +126,11 @@ namespace TSA_V.DeviceLibrary
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
PreLabel
=
null
;
}
if
(
PreRgbLed
.
Count
>
0
)
{
RgbLedController
.
CloseAll
();
PreRgbLed
=
new
List
<
int
>();
}
//把上次的旋转轴转回待机点
if
(
this
.
WorkType
.
Equals
(
1
)
&&
PreNodeId
>
0
)
{
...
...
@@ -199,17 +205,8 @@ namespace TSA_V.DeviceLibrary
{
if
(
WorkType
.
Equals
(
1
))
{
LogUtil
.
info
(
" 程序【"
+
currBoard
.
boardName
+
"】所有位置已走完 "
);
if
(
PreNodeId
>
0
)
{
//上一个节点返回原点
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
}
if
(
PreLabel
!=
null
)
{
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
Thread
.
Sleep
(
300
);
}
LogUtil
.
info
(
" 程序【"
+
currBoard
.
boardName
+
"】所有位置已走完 "
);
ClosePrePos
();
//if (TSAVBean.IsNeedSoldering)
//{
// LogUtil.info(" 程序【" + currBoard.boardName + "】需要焊接,打开烙铁灯 ");
...
...
@@ -309,14 +306,37 @@ namespace TSA_V.DeviceLibrary
}
}
public
void
ClosePrePos
()
{
if
(
PreNodeId
>
0
)
{
//上一个节点返回原点
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
}
if
(
PreLabel
!=
null
)
{
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
Thread
.
Sleep
(
300
);
}
if
(
PreRgbLed
.
Count
>
0
)
{
RgbLedController
.
CloseAll
();
PreRgbLed
=
new
List
<
int
>();
}
}
public
void
MoveToBag
(
TSAVPosition
position
)
{
if
(
PreLabel
!=
null
)
{
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
Thread
.
Sleep
(
300
);
}
if
(
position
.
PositionType
.
Equals
(
1
))
}
if
(
PreRgbLed
.
Count
>
0
)
{
RgbLedController
.
CloseAll
();
PreRgbLed
=
new
List
<
int
>();
}
if
(
position
.
IsNodePos
())
{
//转盘转动
NodeInfo
moveNode
=
position
.
GetNode
(
TSAVBean
.
RotateMap
);
...
...
@@ -338,8 +358,12 @@ namespace TSA_V.DeviceLibrary
}
}
#
region
2023
-
09
-
22
添加
控制便签功能
else
if
(
position
.
PositionType
.
Equals
(
2
))
else
if
(
position
.
IsLedLabel
(
))
{
if
(
PreNodeId
>
0
)
{
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
}
var
smtPoint
=
TSAVBean
.
Work
.
currPoint
;
ComponetInfo
com
=
CSVBomManager
.
GetCom
(
BoardManager
.
CurrBoard
.
bomName
,
smtPoint
);
LabelInfo
label
=
LedLabelController
.
GetLabel
(
position
,
com
,
true
);
...
...
@@ -348,6 +372,14 @@ namespace TSA_V.DeviceLibrary
PTipSoundProcess
.
PlayFile
(
Setting_NInit
.
Set_PointChangeSound
);
}
#
endregion
else
if
(
position
.
IsRgbLed
())
{
if
(
PreNodeId
>
0
)
{
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
}
RgbLedController
.
OpenPosLed
(
position
);
}
else
{
if
(
PreNodeId
>
0
)
...
...
TSA-V/FrmComponentList.Designer.cs
查看文件 @
aac3d48
...
...
@@ -30,6 +30,7 @@
{
System
.
ComponentModel
.
ComponentResourceManager
resources
=
new
System
.
ComponentModel
.
ComponentResourceManager
(
typeof
(
FrmComponentList
));
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
btnImport
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnExport
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnDel
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnBeiLiao
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -70,8 +71,8 @@
this
.
Column_Del
=
new
System
.
Windows
.
Forms
.
DataGridViewLinkColumn
();
this
.
btnBack
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnNew
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnImport
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
openFileDialog1
=
new
System
.
Windows
.
Forms
.
OpenFileDialog
();
this
.
txtLedIndex
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupInfo
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
dgvList
)).
BeginInit
();
...
...
@@ -101,6 +102,18 @@
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
Text
=
"元器件库管理"
;
//
// btnImport
//
this
.
btnImport
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnImport
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnImport
.
Location
=
new
System
.
Drawing
.
Point
(
842
,
21
);
this
.
btnImport
.
Name
=
"btnImport"
;
this
.
btnImport
.
Size
=
new
System
.
Drawing
.
Size
(
130
,
45
);
this
.
btnImport
.
TabIndex
=
74
;
this
.
btnImport
.
Text
=
"导入"
;
this
.
btnImport
.
UseVisualStyleBackColor
=
true
;
this
.
btnImport
.
Click
+=
new
System
.
EventHandler
(
this
.
btnImport_Click
);
//
// btnExport
//
this
.
btnExport
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
...
...
@@ -175,6 +188,7 @@
//
this
.
groupInfo
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
groupInfo
.
Controls
.
Add
(
this
.
txtLedIndex
);
this
.
groupInfo
.
Controls
.
Add
(
this
.
linkCloseAll
);
this
.
groupInfo
.
Controls
.
Add
(
this
.
linkOpenAll
);
this
.
groupInfo
.
Controls
.
Add
(
this
.
linkUpdate
);
...
...
@@ -552,22 +566,19 @@
this
.
btnNew
.
Visible
=
false
;
this
.
btnNew
.
Click
+=
new
System
.
EventHandler
(
this
.
btnNew_Click
);
//
// btnImport
//
this
.
btnImport
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnImport
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnImport
.
Location
=
new
System
.
Drawing
.
Point
(
842
,
21
);
this
.
btnImport
.
Name
=
"btnImport"
;
this
.
btnImport
.
Size
=
new
System
.
Drawing
.
Size
(
130
,
45
);
this
.
btnImport
.
TabIndex
=
74
;
this
.
btnImport
.
Text
=
"导入"
;
this
.
btnImport
.
UseVisualStyleBackColor
=
true
;
this
.
btnImport
.
Click
+=
new
System
.
EventHandler
(
this
.
btnImport_Click
);
//
// openFileDialog1
//
this
.
openFileDialog1
.
FileName
=
"openFileDialog1"
;
//
// txtLedIndex
//
this
.
txtLedIndex
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtLedIndex
.
Location
=
new
System
.
Drawing
.
Point
(
246
,
302
);
this
.
txtLedIndex
.
MaxLength
=
30
;
this
.
txtLedIndex
.
Name
=
"txtLedIndex"
;
this
.
txtLedIndex
.
Size
=
new
System
.
Drawing
.
Size
(
151
,
29
);
this
.
txtLedIndex
.
TabIndex
=
83
;
//
// FrmComponentList
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
...
@@ -635,5 +646,6 @@
private
System
.
Windows
.
Forms
.
LinkLabel
linkOpenAll
;
private
System
.
Windows
.
Forms
.
Button
btnImport
;
private
System
.
Windows
.
Forms
.
OpenFileDialog
openFileDialog1
;
private
System
.
Windows
.
Forms
.
TextBox
txtLedIndex
;
}
}
\ No newline at end of file
TSA-V/FrmComponentList.cs
查看文件 @
aac3d48
...
...
@@ -579,32 +579,35 @@ namespace TSA_V
LanguagePro
();
}
}
private
TSAVPosition
position
=
null
;
private
void
cmbPositionNumList_SelectedIndexChanged
(
object
sender
,
EventArgs
e
)
{
string
pNum
=
cmbPositionNumList
.
Text
;
if
(
pNum
.
Equals
(
""
))
{
position
=
null
;
return
;
}
TSAVPosition
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
pNum
);
if
(
position
!=
null
&&
position
.
PositionType
.
Equals
(
2
))
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
pNum
);
if
(
position
!=
null
&&
(
position
.
IsLedLabel
()
||
position
.
IsRgbLed
()
))
{
LinkVisible
(
true
);
LinkVisible
(
true
,
position
.
PositionType
);
txtLedIndex
.
Text
=
position
.
Leds
;
}
else
{
LinkVisible
(
false
);
}
}
private
void
LinkVisible
(
bool
show
)
private
void
LinkVisible
(
bool
show
,
int
type
=
0
)
{
linkLabel1
.
Visible
=
show
;
linkLabel2
.
Visible
=
show
;
linkCloseAll
.
Visible
=
show
;
linkOpenAll
.
Visible
=
show
;
linkUpdate
.
Visible
=
show
;
linkUpdate
.
Visible
=
show
&&
type
==
2
;
txtLedIndex
.
Visible
=
show
&&
type
==
3
;
}
private
LabelInfo
PreLabel
=
null
;
private
void
CloseLed
(
string
pPnum
)
...
...
@@ -618,28 +621,44 @@ namespace TSA_V
}
}
}
private
void
linkLabel1_LinkClicked
(
object
sender
,
LinkLabelLinkClickedEventArgs
e
)
{
string
pNum
=
cmbPositionNumList
.
Text
;
CloseLed
(
pNum
);
TSAVPosition
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
pNum
);
if
(
position
!=
null
&&
position
.
PositionType
.
Equals
(
2
))
if
(
position
!=
null
&&
position
.
IsRgbLed
())
{
PreLabel
=
LedLabelController
.
GetLabel
(
position
,
selCom
,
true
);
LedLabelController
.
OpenLed
(
position
.
DeviceIP
,
position
.
Leds
);
//LedLabelController.UpdateScreen(PreLabel);
List
<
int
>
leds
=
position
.
getLedList
(
txtLedIndex
.
Text
);
RgbLedController
.
OpenPosLed
(
leds
);
}
else
{
string
pNum
=
cmbPositionNumList
.
Text
;
CloseLed
(
pNum
);
//TSAVPosition position = CSVPositionReader<TSAVPosition>.GetPositonByNum(pNum);
if
(
position
!=
null
&&
position
.
IsLedLabel
())
{
PreLabel
=
LedLabelController
.
GetLabel
(
position
,
selCom
,
true
);
LedLabelController
.
OpenLed
(
position
.
DeviceIP
,
position
.
Leds
);
//LedLabelController.UpdateScreen(PreLabel);
}
}
}
private
void
linkLabel2_LinkClicked
(
object
sender
,
LinkLabelLinkClickedEventArgs
e
)
{
CloseLed
(
""
);
string
pNum
=
cmbPositionNumList
.
Text
;
TSAVPosition
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
pNum
);
if
(
position
!=
null
&&
position
.
PositionType
.
Equals
(
2
))
if
(
position
!=
null
&&
position
.
IsRgbLed
())
{
RgbLedController
.
CloseAll
();
}
else
{
PreLabel
=
LedLabelController
.
GetLabel
(
position
,
selCom
,
true
);
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
CloseLed
(
""
);
string
pNum
=
cmbPositionNumList
.
Text
;
//TSAVPosition position = CSVPositionReader<TSAVPosition>.GetPositonByNum(pNum);
if
(
position
!=
null
&&
position
.
IsLedLabel
())
{
PreLabel
=
LedLabelController
.
GetLabel
(
position
,
selCom
,
true
);
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
}
}
}
...
...
@@ -721,25 +740,42 @@ namespace TSA_V
private
void
linkLabel3_LinkClicked
(
object
sender
,
LinkLabelLinkClickedEventArgs
e
)
{
string
pNum
=
cmbPositionNumList
.
Text
;
CloseLed
(
pNum
);
TSAVPosition
position
=
CSVPositionReader
<
TSAVPosition
>.
GetPositonByNum
(
pNum
);
if
(
position
!=
null
&&
position
.
PositionType
.
Equals
(
2
))
if
(
position
!=
null
&&
position
.
IsLedLabel
())
{
PreLabel
=
LedLabelController
.
GetLabel
(
position
,
selCom
,
true
);
LedLabelController
.
UpdateScreen
(
PreLabel
);
string
pNum
=
cmbPositionNumList
.
Text
;
CloseLed
(
pNum
);
//TSAVPosition position = CSVPositionReader<TSAVPosition>.GetPositonByNum(pNum);
if
(
position
!=
null
&&
position
.
IsLedLabel
())
{
PreLabel
=
LedLabelController
.
GetLabel
(
position
,
selCom
,
true
);
LedLabelController
.
UpdateScreen
(
PreLabel
);
}
}
}
private
void
linkLabel4_LinkClicked
(
object
sender
,
LinkLabelLinkClickedEventArgs
e
)
{
LedLabelController
.
OpenAll
();
if
(
position
!=
null
&&
position
.
IsRgbLed
())
{
RgbLedController
.
OpenAll
();
}
else
{
LedLabelController
.
OpenAll
();
}
}
private
void
linkLabel5_LinkClicked
(
object
sender
,
LinkLabelLinkClickedEventArgs
e
)
{
LedLabelController
.
CloseAll
();
if
(
position
!=
null
&&
position
.
IsRgbLed
())
{
RgbLedController
.
CloseAll
();
}
else
{
LedLabelController
.
CloseAll
();
}
}
private
void
btnImport_Click
(
object
sender
,
EventArgs
e
)
...
...
TSA-V/FrmComponentList.resx
查看文件 @
aac3d48
...
...
@@ -147,36 +147,6 @@
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_partNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_PN.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Count.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Position.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Notes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_description.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_X.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Y.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
...
...
TSA-V/FrmHistorySearch.Designer.cs
查看文件 @
aac3d48
此文件的差异被折叠,
点击展开。
TSA-V/FrmHistorySearch.resx
查看文件 @
aac3d48
...
...
@@ -156,18 +156,6 @@
<metadata name="col_CreateDate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pcol_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pcol_PartNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pcol_PointName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pcol_CreateDate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="col_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
...
...
TSA-V/workForm/FrmTSAV.Designer.cs
查看文件 @
aac3d48
...
...
@@ -913,7 +913,7 @@
//
this
.
linkLabel1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
linkLabel1
.
AutoSize
=
true
;
this
.
linkLabel1
.
Location
=
new
System
.
Drawing
.
Point
(
570
,
583
);
this
.
linkLabel1
.
Location
=
new
System
.
Drawing
.
Point
(
484
,
578
);
this
.
linkLabel1
.
Name
=
"linkLabel1"
;
this
.
linkLabel1
.
Size
=
new
System
.
Drawing
.
Size
(
65
,
12
);
this
.
linkLabel1
.
TabIndex
=
281
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论