Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit aac3d48b
由
LN
编写于
2024-09-06 13:17:27 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加RGBLED
1 个父辈
81cd6d0a
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
1017 行增加
和
272 行删除
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
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.IO
;
using
System.IO.Ports
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
TSA_V.Common
;
namespace
TSA_V.DeviceLibrary
{
public
class
Flyelectronic_485_RGB_Controller
:
IDisposable
{
ILog
loge
;
int
baudRate
=
115200
;
//波特率
Parity
parity
=
Parity
.
None
;
//校验位
int
dataBits
=
8
;
//数据位
StopBits
stopBits
=
StopBits
.
One
;
//停止位
SerialPort
_serialPort
=
null
;
string
comPortName
;
string
Name
;
private
Dictionary
<
string
,
byte
[][
]>
effactValue
=
new
Dictionary
<
string
,
byte
[][
]>
();
public
Flyelectronic_485_RGB_Controller
(
string
name
,
string
logname
=
"RollingLogFileAppender"
)
{
Name
=
name
;
loge
=
LogManager
.
GetLogger
(
logname
);
}
bool
ok
=
false
;
/// <summary>
/// 打开串口资源
/// <returns>返回bool类型</returns>
/// </summary>
public
bool
OpenPort
(
string
_comport
,
out
string
errmsg
)
{
comPortName
=
_comport
;
//如果串口是打开的,先关闭
errmsg
=
""
;
if
(
_serialPort
==
null
)
{
_serialPort
=
new
SerialPort
(
comPortName
,
baudRate
,
parity
,
dataBits
,
stopBits
);
//_serialPort.RtsEnable = true; //自动请求
_serialPort
.
ReadTimeout
=
100
;
//超时
}
errmsg
+=
ResourceControl
.
GetString
(
"comInitError"
,
"{0}初始化失败"
,
_comport
)
;
if
(
_serialPort
.
IsOpen
)
{
_serialPort
.
Close
();
_serialPort
=
null
;
OpenPort
(
comPortName
,
out
errmsg
);
}
ok
=
false
;
try
{
//打开串口
errmsg
+=
ResourceControl
.
GetString
(
"comOpenFail"
,
"串口{0}打开失败"
,
_comport
);
_serialPort
.
Open
();
LogUtil
.
info
(
"氛围灯"
+
comPortName
+
"打开成功"
);
for
(
int
i
=
1
;
i
<
10
;
i
++)
{
Thread
.
Sleep
(
100
);
//errmsg += "检测数据.";
var
rev
=
SendAndReceive
(
CommandByte
.
GetDeviceID
);
errmsg
+=
Encoding
.
ASCII
.
GetString
(
rev
);
if
(
rev
.
Count
()
>
0
)
{
ok
=
true
;
Run
();
break
;
}
}
}
catch
(
Exception
Ex
)
{
errmsg
+=
Ex
.
ToString
();
//throw Ex;
}
return
ok
;
}
private
void
Run
()
{
return
;
//Task.Run(() => {
// try
// {
// while (ok)
// {
// Task.Delay(200).Wait();
// if (RobotManage.mainMachine.lastColor.Equals("yellowL")) {
// ShowYellowLight();
// } else if (RobotManage.mainMachine.lastColor.Equals("greenL"))
// {
// ShowGreenLight();
// } else if (RobotManage.mainMachine.lastColor.Equals(Color.Black.Name.ToString())){
// }
// //else if (RobotManage.mainMachine.lastColor != "")
// //{
// // Color color = Color.FromName(RobotManage.mainMachine.lastColor);
// // if (color != null)
// // {
// // ShowColor(color);
// // }
// //}
// }
// }
// catch (Exception Ex)
// {
// LogUtil.error("出错:" + Ex.ToString());
// }
//});
}
public
bool
ShowColor
(
Color
color
,
ColorFormat
colorFormat
=
ColorFormat
.
GRB
)
{
var
newbyte
=
CommandByte
.
SetOneColor
;
var
colorbyte
=
ConvertColorToByteArray
(
color
,
colorFormat
);
newbyte
[
16
]
=
colorbyte
[
0
];
newbyte
[
17
]
=
colorbyte
[
1
];
newbyte
[
18
]
=
colorbyte
[
2
];
var
rev
=
SendAndReceive
(
newbyte
);
if
(
rev
.
Length
>
0
)
{
var
txt
=
Encoding
.
ASCII
.
GetString
(
rev
);
if
(
txt
.
IndexOf
(
"RecvEnd"
)
>=
0
)
{
return
true
;
}
}
return
false
;
}
public
bool
ShowLedColor
(
Color
color
,
int
startIndex
,
int
endIndex
)
{
List
<
int
>
ledIndex
=
new
List
<
int
>();
for
(
int
i
=
startIndex
;
i
<
endIndex
;
i
++)
{
ledIndex
.
Add
(
i
);
}
return
ShowLedColor
(
color
,
ledIndex
);
}
/// <summary>
/// 指定索引的灯显示指定颜色,其他的灯灭
/// </summary>
/// <param name="color"></param>
/// <param name="colorFormat"></param>
/// <param name="ledIndex"></param>
/// <returns></returns>
public
bool
ShowLedColor
(
Color
color
,
List
<
int
>
ledIndex
,
int
maxledIndex
=
100
,
ColorFormat
colorFormat
=
ColorFormat
.
GRB
)
{
List
<
byte
>
allData
=
new
List
<
byte
>();
byte
[]
startByte
=
CommandByte
.
ledColorStart
;
byte
[]
endByte
=
CommandByte
.
ledColorEnd
;
allData
.
AddRange
(
startByte
.
ToList
());
foreach
(
int
index
in
ledIndex
)
{
if
(
maxledIndex
<
index
)
{
maxledIndex
=
index
;
}
}
int
length
=
maxledIndex
*
3
;
byte
[]
lengthByte
=
IntToByteArr
(
length
);
allData
[
12
]
=
lengthByte
[
0
];
allData
[
13
]
=
lengthByte
[
1
];
byte
[]
colorbyte
=
ConvertColorToByteArray
(
color
,
colorFormat
);
byte
[]
blackbyte
=
ConvertColorToByteArray
(
Color
.
Black
,
colorFormat
);
for
(
int
i
=
0
;
i
<=
maxledIndex
;
i
++)
{
if
(
ledIndex
.
Contains
(
i
))
{
allData
.
Add
(
colorbyte
[
0
]);
allData
.
Add
(
colorbyte
[
1
]);
allData
.
Add
(
colorbyte
[
2
]);
}
else
{
allData
.
Add
(
blackbyte
[
0
]);
allData
.
Add
(
blackbyte
[
1
]);
allData
.
Add
(
blackbyte
[
2
]);
}
}
allData
.
AddRange
(
endByte
.
ToList
());
var
rev
=
SendAndReceive
(
allData
.
ToArray
());
if
(
rev
.
Length
>
0
)
{
var
txt
=
Encoding
.
ASCII
.
GetString
(
rev
);
if
(
txt
.
IndexOf
(
"RecvEnd"
)
>=
0
)
{
return
true
;
}
}
return
false
;
}
private
byte
[]
IntToByteArr
(
int
value
)
{
int
number
=
42
;
// 要转换的数字
byte
b1
=
(
byte
)(
number
>>
8
);
// 取高8位
byte
b2
=
(
byte
)(
number
&
0xFF
);
// 取低8位
byte
[]
bytes
=
new
byte
[]
{
b1
,
b2
};
// 存储转换后的byte数组
return
bytes
;
}
private
byte
[][]
getEffactValue
(
string
fileName
)
{
if
(
effactValue
==
null
)
{
effactValue
=
new
Dictionary
<
string
,
byte
[][
]>
();
}
if
(
effactValue
.
ContainsKey
(
fileName
))
{
return
effactValue
[
fileName
];
}
return
null
;
}
public
bool
ShowEffact
(
string
fileName
,
Color
defColor
)
{
var
newbyte
=
getEffactValue
(
fileName
);
if
(
newbyte
!=
null
)
{
foreach
(
var
b
in
newbyte
)
{
var
rev
=
SendAndReceive
(
b
);
}
}
else
if
(
fileName
!=
""
&&
File
.
Exists
(
fileName
))
{
string
Text
=
File
.
ReadAllText
(
fileName
);
newbyte
=
CommandByte
.
GetEffBytes
(
Text
);
foreach
(
var
b
in
newbyte
)
{
var
rev
=
SendAndReceive
(
b
);
}
}
else
{
//newbyte = CommandByte.GetEffBytes(CommandByte.eff1);
ShowColor
(
defColor
);
}
return
true
;
}
public
bool
ShowYellowLight
()
{
string
fileName
=
Application
.
StartupPath
+
"/ledColor/yellow.txt"
;
return
ShowEffact
(
fileName
,
Color
.
Yellow
);
}
public
bool
ShowGreenLight
()
{
string
fileName
=
Application
.
StartupPath
+
"/ledColor/green.txt"
;
return
ShowEffact
(
fileName
,
Color
.
Green
);
}
public
bool
CloseLed
()
{
return
ShowColor
(
Color
.
Black
);
}
byte
[]
SendAndReceive
(
byte
[]
buff
)
{
byte
[]
restr
=
new
byte
[
0
];
if
(
_serialPort
==
null
||
!
_serialPort
.
IsOpen
)
{
if
(!
OpenPort
(
comPortName
,
out
string
errmsg
))
{
log
(
"未初始化,或已断开连接:"
+
errmsg
);
return
restr
;
}
}
var
t
=
Task
.
Run
(
delegate
{
byte
[]
recv
=
new
byte
[
512
];
try
{
_serialPort
.
Write
(
buff
,
0
,
buff
.
Length
);
Thread
.
Sleep
(
20
);
int
r
=
_serialPort
.
Read
(
recv
,
0
,
recv
.
Length
);
if
(
r
>
0
)
{
var
recvdata
=
Encoding
.
ASCII
.
GetString
(
recv
,
0
,
r
);
debuglog
(
"recvdata: "
+
recvdata
);
return
recv
.
Take
(
r
).
ToArray
();
//.Split(',');
}
}
catch
(
Exception
e
)
{
log
(
string
.
Format
(
"{0}"
,
e
));
}
return
restr
;
});
try
{
t
.
Wait
(
500
);
if
(
t
.
IsCompleted
)
return
t
.
Result
;
else
return
new
byte
[
0
];
}
catch
{
return
new
byte
[
0
];
}
}
void
log
(
string
msg
)
{
loge
.
Info
(
Name
+
$
"[{comPortName}]"
+
":"
+
msg
);
Console
.
WriteLine
(
msg
);
}
void
debuglog
(
string
msg
)
{
loge
.
Debug
(
Name
+
$
"[{comPortName}]"
+
":"
+
msg
);
Console
.
WriteLine
(
msg
);
}
static
class
CommandByte
{
public
static
byte
[]
GetDeviceID
=
ConvertStringToByteArray
(
"DD 55 EE 00 00 00 00 00 8F 01 00 00 00 03 00 01 00 00 00 AA BB"
);
public
static
byte
[]
SetOneColor
=
ConvertStringToByteArray
(
"DD 55 EE 00 00 00 01 00 99 01 00 00 00 03 00 C9 FF 00 00 AA BB"
);
//12,13 为数据数量
public
static
byte
[]
ledColorStart
=
ConvertStringToByteArray
(
"DD 55 EE 00 00 00 01 00 99 01 00 00 00 03 00 01 "
);
public
static
byte
[]
ledColorEnd
=
ConvertStringToByteArray
(
"AA BB"
);
// DD 55 EE 00 00 00 01 00 99 01 00 00 00 03 00 C9 F0 F0 F0 AA BB
//DD 55 EE 00 00 00 01 00 99 01 00 00 00 03 00 C9 F0 F0 F0 AA BB
public
static
string
eff1
=
@
"
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
6D
67
44
4D
43
53
2
C
1D
63
1D
0
B
6
B
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
C4
CC
18
9
A
9
C
2D
5
A
51
4D
2
B
1
C
64
1
C
0
A
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
E6
F4
07
D5
E0
10
A0
A2
2
A
55
4D
4F
29
19
65
1D
0
B
6
B
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
E7
F5
07
E7
F5
07
D5
E0
10
9
B
9
E
2
C
52
49
51
29
19
65
1
C
0
A
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
D6
E1
0F
E8
F6
06
E9
F7
06
D5
E0
10
9
A
9
C
2D
50
46
52
26
15
67
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
A3
A6
29
D8
E3
0F
E8
F6
06
EA
F8
06
D1
DC
12
90
90
32
48
3D
56
25
14
67
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
5D
55
4
B
A5
A9
27
D8
E4
0
E
EA
F8
06
E6
F3
08
CA
D4
15
8
B
8
B
35
49
3
E
55
27
16
66
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
2F
20
62
61
5
A
49
AA
AF
25
DD
EA
0
C
EB
F9
05
E6
F3
08
CD
D7
14
91
91
32
4
E
44
53
28
18
65
1
C
0
A
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1D
0
C
6
B
32
24
61
68
63
46
B2
B7
21
DF
EC
0
B
EB
FA
05
E8
F6
06
D1
DC
12
99
9
B
2
E
54
4
B
50
29
19
65
1D
0
B
6
B
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
E
0D
6
A
34
26
60
6
A
64
45
B3
B9
21
DE
EB
0
B
EA
F8
06
E8
F6
06
D5
E0
10
9
C
9F
2
C
55
4
C
4F
2
A
1
A
65
1
C
0
A
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1F
0
E
6
A
34
26
60
65
5F
47
A9
AD
26
D9
E5
0
E
E9
F7
06
E8
F6
06
D6
E1
0F
9D
A0
2
C
54
4
B
50
28
18
65
1
C
0
A
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1D
0
B
6
B
30
21
62
5
C
54
4
C
A4
A7
28
D8
E3
0F
E7
F5
07
EA
F8
06
D3
DE
11
9
B
9
E
2
C
54
4
B
50
29
19
65
1
C
0
A
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1D
0
B
6
B
2D
1
E
63
5
B
53
4
C
A2
A5
29
D5
E0
10
E7
F5
07
E7
F5
07
D3
DE
11
9
A
9
C
2D
51
47
51
27
17
66
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1D
0
B
6
B
2
E
1F
63
5
A
52
4D
A2
A5
29
D8
E3
0F
E9
F7
06
E8
F6
06
D3
DE
11
93
94
30
4
A
3F
55
25
14
67
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1D
0
C
6
B
2D
1
E
63
5
C
54
4
C
A5
A8
28
D8
E4
0
E
E9
F7
06
E7
F5
07
CC
D6
14
88
87
36
42
36
59
22
11
69
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
C
0
A
6
C
2D
1
E
63
5D
55
4
B
A8
AC
26
DD
EA
0
C
EB
FA
05
E5
F2
08
C4
CC
18
7
E
7
B
3
B
41
35
59
22
11
69
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
C
0
A
6
C
2F
20
62
63
5
C
49
B2
B7
21
E1
EE
0
A
EA
F8
06
E3
F1
09
C0
C8
1
A
7
C
79
3
C
3F
33
5
A
22
12
68
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1D
0
C
6
B
34
26
60
6
E
69
43
BC
C4
1
C
E1
EF
0
A
E9
F7
06
E1
EF
0
A
C1
C9
1
A
7F
7
C
3
B
40
34
5
A
22
12
68
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
20
0F
6
A
3D
30
5
B
7
B
78
3D
C0
C8
1
A
E2
F0
09
E8
F6
06
E2
F0
09
C3
CB
19
7D
7
A
3
B
3
A
2D
5D
1
E
0D
6
A
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
22
11
69
3F
33
5
A
7
B
78
3D
BD
C5
1
C
E0
ED
0
B
EA
F8
06
E5
F2
08
BD
C5
1
C
6
B
65
44
31
23
61
1
C
0
A
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
22
12
68
3
E
31
5
B
78
75
3
E
BC
C4
1
C
E2
F0
09
EB
FA
05
E0
ED
0
B
AD
B2
24
5
E
56
4
B
2
C
1D
63
1D
0
B
6
B
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
21
10
69
3D
30
5
B
7
C
79
3
C
C6
CF
17
E6
F4
07
EA
F8
06
D9
E5
0
E
A4
A7
28
5
A
52
4D
2D
1
E
63
1D
0
C
6
B
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
21
10
69
43
37
58
8D
8D
34
D0
DB
12
E8
F6
06
E9
F7
06
D8
E3
0F
A1
A4
2
A
5
B
53
4
C
2
B
1
B
64
1D
0
B
6
B
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
27
17
66
50
46
52
98
9
A
2
E
D6
E1
0F
E9
F7
06
E8
F6
06
D6
E1
0F
A1
A4
2
A
5
A
52
4D
2
B
1
C
64
1D
0
B
6
B
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
C
0
A
6
C
29
19
65
55
4D
4F
9D
A0
2
C
D6
E1
0F
E9
F7
06
E8
F6
06
D7
E2
0F
A1
A4
2
A
5
A
52
4D
2
B
1
C
64
1D
0
B
6
B
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
C
0
A
6
C
2
A
1
A
65
55
4
C
4F
9D
A0
2
C
D7
E2
0F
E9
F7
06
E8
F6
06
D8
E4
0
E
A8
AC
26
61
5
A
49
31
23
61
1
E
0D
6
A
1
B
09
6
C
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
C
0
A
6
C
2
C
1D
63
56
4
E
4F
9
E
A1
2
B
D5
E0
10
E7
F5
07
EA
F8
06
DD
E9
0
C
AD
B2
24
66
60
47
34
26
60
20
0F
6
A
1
B
09
6
C
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1D
0
B
6
B
2
B
1
B
64
54
4
B
50
9
B
9D
2D
D3
DE
11
E7
F5
07
EB
FA
05
DE
EB
0
B
B1
B6
22
6
C
66
44
39
2
B
5D
1F
0
E
6
A
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1D
0
B
6
B
2
A
1
A
65
53
4
A
50
94
95
30
CF
DA
13
E6
F4
07
E9
F7
06
DD
EA
0
C
B4
BA
20
6F
6
A
42
38
2
A
5
E
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
C
0
A
6
C
28
18
65
4D
43
53
8
E
8
E
33
CB
D5
15
E5
F2
08
E7
F5
07
DE
EB
0
B
B4
BA
20
71
6D
41
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
27
17
66
49
3
E
55
88
87
36
C9
D2
16
E4
F2
08
E7
F5
07
DD
EA
0
C
B7
BD
1F
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
24
13
68
47
3
C
56
88
87
36
C5
CE
18
E3
F1
09
E8
F6
06
E0
ED
0
B
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
25
14
67
45
3
A
57
87
86
37
C5
CD
18
E4
F2
08
EB
F9
05
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
C
0
A
6
C
25
14
67
43
38
58
82
80
39
C2
CA
19
E4
F2
08
AA
BB
DD
55
EE
00
00
00
01
00
99
01
00
00
00
5
A
00
01
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
B
09
6
C
1
C
0
A
6
C
23
13
68
41
35
59
77
74
3
E
BA
C1
1D
AA
BB
";
public
static
byte
[][]
GetEffBytes
(
string
eff
)
{
List
<
byte
[
]>
bytes
=
new
List
<
byte
[
]>
();
var
effs
=
eff
.
Split
(
new
char
[]
{
'\r'
,
'\n'
},
StringSplitOptions
.
RemoveEmptyEntries
);
foreach
(
var
ef
in
effs
)
{
bytes
.
Add
(
ConvertStringToByteArray
(
ef
));
}
return
bytes
.
ToArray
();
}
}
static
byte
[]
ConvertStringToByteArray
(
string
input
)
{
// 去除字符串中的空格
string
[]
hexValues
=
input
.
Trim
().
Split
(
' '
);
// 创建一个与字符串长度相等的byte[]数组
byte
[]
byteArray
=
new
byte
[
hexValues
.
Length
];
// 将每个字符串转换为对应的byte值
for
(
int
i
=
0
;
i
<
hexValues
.
Length
;
i
++)
{
byteArray
[
i
]
=
Convert
.
ToByte
(
hexValues
[
i
],
16
);
}
return
byteArray
;
}
public
enum
ColorFormat
{
RGB
,
BGR
,
BRG
,
GRB
,
GBR
,
RBG
}
public
static
byte
[]
ConvertColorToByteArray
(
Color
color
,
ColorFormat
format
)
{
byte
[]
result
=
new
byte
[
3
];
switch
(
format
)
{
case
ColorFormat
.
RGB
:
result
[
0
]
=
color
.
R
;
result
[
1
]
=
color
.
G
;
result
[
2
]
=
color
.
B
;
break
;
case
ColorFormat
.
BGR
:
result
[
0
]
=
color
.
B
;
result
[
1
]
=
color
.
G
;
result
[
2
]
=
color
.
R
;
break
;
case
ColorFormat
.
BRG
:
result
[
0
]
=
color
.
B
;
result
[
1
]
=
color
.
R
;
result
[
2
]
=
color
.
G
;
break
;
case
ColorFormat
.
GRB
:
result
[
0
]
=
color
.
G
;
result
[
1
]
=
color
.
R
;
result
[
2
]
=
color
.
B
;
break
;
case
ColorFormat
.
GBR
:
result
[
0
]
=
color
.
G
;
result
[
1
]
=
color
.
B
;
result
[
2
]
=
color
.
R
;
break
;
case
ColorFormat
.
RBG
:
result
[
0
]
=
color
.
R
;
result
[
1
]
=
color
.
B
;
result
[
2
]
=
color
.
G
;
break
;
default
:
throw
new
ArgumentException
(
"Invalid format specified."
);
}
return
result
;
}
public
void
Dispose
()
{
ok
=
false
;
_serialPort
?.
Close
();
}
}
}
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
...
...
@@ -32,18 +32,11 @@ namespace TSA_V
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
btnExit
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
DgvPointInfo
=
new
System
.
Windows
.
Forms
.
DataGridView
();
this
.
DgvOperateInfo
=
new
System
.
Windows
.
Forms
.
DataGridView
();
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
BtnQuery
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
DtpTimeBack
=
new
System
.
Windows
.
Forms
.
DateTimePicker
();
this
.
DtpTimeFront
=
new
System
.
Windows
.
Forms
.
DateTimePicker
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
TxtCode
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
pcol_ID
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
pcol_PartNum
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
pcol_PointName
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
pcol_CreateDate
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
DgvOperateInfo
=
new
System
.
Windows
.
Forms
.
DataGridView
();
this
.
col_ID
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
col_ProName
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
col_ProType
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
...
...
@@ -53,6 +46,13 @@ namespace TSA_V
this
.
col_AoiResult
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
col_UserName
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
col_CreateDate
=
new
System
.
Windows
.
Forms
.
DataGridViewTextBoxColumn
();
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
BtnQuery
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
DtpTimeBack
=
new
System
.
Windows
.
Forms
.
DateTimePicker
();
this
.
DtpTimeFront
=
new
System
.
Windows
.
Forms
.
DateTimePicker
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
TxtCode
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox1
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
DgvPointInfo
)).
BeginInit
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
DgvOperateInfo
)).
BeginInit
();
...
...
@@ -112,110 +112,10 @@ namespace TSA_V
this
.
DgvPointInfo
.
ReadOnly
=
true
;
this
.
DgvPointInfo
.
RowHeadersWidth
=
10
;
this
.
DgvPointInfo
.
RowTemplate
.
Height
=
23
;
this
.
DgvPointInfo
.
SelectionMode
=
System
.
Windows
.
Forms
.
DataGridViewSelectionMode
.
FullRowSelect
;
this
.
DgvPointInfo
.
Size
=
new
System
.
Drawing
.
Size
(
1211
,
404
);
this
.
DgvPointInfo
.
TabIndex
=
15
;
//
// DgvOperateInfo
//
this
.
DgvOperateInfo
.
AllowUserToAddRows
=
false
;
this
.
DgvOperateInfo
.
AllowUserToDeleteRows
=
false
;
this
.
DgvOperateInfo
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
DgvOperateInfo
.
ColumnHeadersHeightSizeMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnHeadersHeightSizeMode
.
AutoSize
;
this
.
DgvOperateInfo
.
Columns
.
AddRange
(
new
System
.
Windows
.
Forms
.
DataGridViewColumn
[]
{
this
.
col_ID
,
this
.
col_ProName
,
this
.
col_ProType
,
this
.
col_BarCode
,
this
.
col_BoardWidth
,
this
.
col_BoardLength
,
this
.
col_AoiResult
,
this
.
col_UserName
,
this
.
col_CreateDate
});
this
.
DgvOperateInfo
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
75
);
this
.
DgvOperateInfo
.
Name
=
"DgvOperateInfo"
;
this
.
DgvOperateInfo
.
ReadOnly
=
true
;
this
.
DgvOperateInfo
.
RowHeadersWidth
=
10
;
this
.
DgvOperateInfo
.
RowTemplate
.
Height
=
23
;
this
.
DgvOperateInfo
.
Size
=
new
System
.
Drawing
.
Size
(
1211
,
179
);
this
.
DgvOperateInfo
.
TabIndex
=
14
;
this
.
DgvOperateInfo
.
CellContentClick
+=
new
System
.
Windows
.
Forms
.
DataGridViewCellEventHandler
(
this
.
DgvOperateInfo_CellClick
);
//
// label3
//
this
.
label3
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label3
.
Location
=
new
System
.
Drawing
.
Point
(
616
,
28
);
this
.
label3
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
label3
.
Name
=
"label3"
;
this
.
label3
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
21
);
this
.
label3
.
TabIndex
=
13
;
this
.
label3
.
Text
=
"结束时间"
;
this
.
label3
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
// BtnQuery
//
this
.
BtnQuery
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
BtnQuery
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
BtnQuery
.
Location
=
new
System
.
Drawing
.
Point
(
956
,
21
);
this
.
BtnQuery
.
Name
=
"BtnQuery"
;
this
.
BtnQuery
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
35
);
this
.
BtnQuery
.
TabIndex
=
12
;
this
.
BtnQuery
.
Text
=
"查询"
;
this
.
BtnQuery
.
UseVisualStyleBackColor
=
true
;
this
.
BtnQuery
.
Click
+=
new
System
.
EventHandler
(
this
.
BtnQuery_Click
);
//
// DtpTimeBack
//
this
.
DtpTimeBack
.
CustomFormat
=
"yyyy/MM/dd HH:mm:ss"
;
this
.
DtpTimeBack
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
DtpTimeBack
.
Format
=
System
.
Windows
.
Forms
.
DateTimePickerFormat
.
Custom
;
this
.
DtpTimeBack
.
Location
=
new
System
.
Drawing
.
Point
(
707
,
25
);
this
.
DtpTimeBack
.
Name
=
"DtpTimeBack"
;
this
.
DtpTimeBack
.
ShowCheckBox
=
true
;
this
.
DtpTimeBack
.
Size
=
new
System
.
Drawing
.
Size
(
197
,
26
);
this
.
DtpTimeBack
.
TabIndex
=
11
;
//
// DtpTimeFront
//
this
.
DtpTimeFront
.
CustomFormat
=
"yyyy/MM/dd HH:mm:ss"
;
this
.
DtpTimeFront
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
DtpTimeFront
.
Format
=
System
.
Windows
.
Forms
.
DateTimePickerFormat
.
Custom
;
this
.
DtpTimeFront
.
Location
=
new
System
.
Drawing
.
Point
(
402
,
25
);
this
.
DtpTimeFront
.
Name
=
"DtpTimeFront"
;
this
.
DtpTimeFront
.
ShowCheckBox
=
true
;
this
.
DtpTimeFront
.
Size
=
new
System
.
Drawing
.
Size
(
197
,
26
);
this
.
DtpTimeFront
.
TabIndex
=
10
;
//
// label2
//
this
.
label2
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
311
,
28
);
this
.
label2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
21
);
this
.
label2
.
TabIndex
=
9
;
this
.
label2
.
Text
=
"开始时间"
;
this
.
label2
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
// TxtCode
//
this
.
TxtCode
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
TxtCode
.
Location
=
new
System
.
Drawing
.
Point
(
97
,
25
);
this
.
TxtCode
.
Name
=
"TxtCode"
;
this
.
TxtCode
.
Size
=
new
System
.
Drawing
.
Size
(
197
,
26
);
this
.
TxtCode
.
TabIndex
=
8
;
//
// label1
//
this
.
label1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
28
);
this
.
label1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
21
);
this
.
label1
.
TabIndex
=
7
;
this
.
label1
.
Text
=
"条码"
;
this
.
label1
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
// pcol_ID
//
this
.
pcol_ID
.
HeaderText
=
"ID"
;
...
...
@@ -247,6 +147,33 @@ namespace TSA_V
this
.
pcol_CreateDate
.
SortMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnSortMode
.
NotSortable
;
this
.
pcol_CreateDate
.
Width
=
160
;
//
// DgvOperateInfo
//
this
.
DgvOperateInfo
.
AllowUserToAddRows
=
false
;
this
.
DgvOperateInfo
.
AllowUserToDeleteRows
=
false
;
this
.
DgvOperateInfo
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
DgvOperateInfo
.
ColumnHeadersHeightSizeMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnHeadersHeightSizeMode
.
AutoSize
;
this
.
DgvOperateInfo
.
Columns
.
AddRange
(
new
System
.
Windows
.
Forms
.
DataGridViewColumn
[]
{
this
.
col_ID
,
this
.
col_ProName
,
this
.
col_ProType
,
this
.
col_BarCode
,
this
.
col_BoardWidth
,
this
.
col_BoardLength
,
this
.
col_AoiResult
,
this
.
col_UserName
,
this
.
col_CreateDate
});
this
.
DgvOperateInfo
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
75
);
this
.
DgvOperateInfo
.
Name
=
"DgvOperateInfo"
;
this
.
DgvOperateInfo
.
ReadOnly
=
true
;
this
.
DgvOperateInfo
.
RowHeadersWidth
=
10
;
this
.
DgvOperateInfo
.
RowTemplate
.
Height
=
23
;
this
.
DgvOperateInfo
.
SelectionMode
=
System
.
Windows
.
Forms
.
DataGridViewSelectionMode
.
FullRowSelect
;
this
.
DgvOperateInfo
.
Size
=
new
System
.
Drawing
.
Size
(
1211
,
179
);
this
.
DgvOperateInfo
.
TabIndex
=
14
;
this
.
DgvOperateInfo
.
CellContentClick
+=
new
System
.
Windows
.
Forms
.
DataGridViewCellEventHandler
(
this
.
DgvOperateInfo_CellClick
);
//
// col_ID
//
this
.
col_ID
.
HeaderText
=
"ID"
;
...
...
@@ -317,6 +244,81 @@ namespace TSA_V
this
.
col_CreateDate
.
SortMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnSortMode
.
NotSortable
;
this
.
col_CreateDate
.
Width
=
120
;
//
// label3
//
this
.
label3
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label3
.
Location
=
new
System
.
Drawing
.
Point
(
616
,
28
);
this
.
label3
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
label3
.
Name
=
"label3"
;
this
.
label3
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
21
);
this
.
label3
.
TabIndex
=
13
;
this
.
label3
.
Text
=
"结束时间"
;
this
.
label3
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
// BtnQuery
//
this
.
BtnQuery
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
BtnQuery
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
BtnQuery
.
Location
=
new
System
.
Drawing
.
Point
(
956
,
21
);
this
.
BtnQuery
.
Name
=
"BtnQuery"
;
this
.
BtnQuery
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
35
);
this
.
BtnQuery
.
TabIndex
=
12
;
this
.
BtnQuery
.
Text
=
"查询"
;
this
.
BtnQuery
.
UseVisualStyleBackColor
=
true
;
this
.
BtnQuery
.
Click
+=
new
System
.
EventHandler
(
this
.
BtnQuery_Click
);
//
// DtpTimeBack
//
this
.
DtpTimeBack
.
CustomFormat
=
"yyyy/MM/dd HH:mm:ss"
;
this
.
DtpTimeBack
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
DtpTimeBack
.
Format
=
System
.
Windows
.
Forms
.
DateTimePickerFormat
.
Custom
;
this
.
DtpTimeBack
.
Location
=
new
System
.
Drawing
.
Point
(
707
,
25
);
this
.
DtpTimeBack
.
Name
=
"DtpTimeBack"
;
this
.
DtpTimeBack
.
ShowCheckBox
=
true
;
this
.
DtpTimeBack
.
Size
=
new
System
.
Drawing
.
Size
(
197
,
26
);
this
.
DtpTimeBack
.
TabIndex
=
11
;
//
// DtpTimeFront
//
this
.
DtpTimeFront
.
CustomFormat
=
"yyyy/MM/dd HH:mm:ss"
;
this
.
DtpTimeFront
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
DtpTimeFront
.
Format
=
System
.
Windows
.
Forms
.
DateTimePickerFormat
.
Custom
;
this
.
DtpTimeFront
.
Location
=
new
System
.
Drawing
.
Point
(
402
,
25
);
this
.
DtpTimeFront
.
Name
=
"DtpTimeFront"
;
this
.
DtpTimeFront
.
ShowCheckBox
=
true
;
this
.
DtpTimeFront
.
Size
=
new
System
.
Drawing
.
Size
(
197
,
26
);
this
.
DtpTimeFront
.
TabIndex
=
10
;
//
// label2
//
this
.
label2
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
311
,
28
);
this
.
label2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
21
);
this
.
label2
.
TabIndex
=
9
;
this
.
label2
.
Text
=
"开始时间"
;
this
.
label2
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
// TxtCode
//
this
.
TxtCode
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
TxtCode
.
Location
=
new
System
.
Drawing
.
Point
(
97
,
25
);
this
.
TxtCode
.
Name
=
"TxtCode"
;
this
.
TxtCode
.
Size
=
new
System
.
Drawing
.
Size
(
197
,
26
);
this
.
TxtCode
.
TabIndex
=
8
;
//
// label1
//
this
.
label1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
28
);
this
.
label1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
85
,
21
);
this
.
label1
.
TabIndex
=
7
;
this
.
label1
.
Text
=
"条码"
;
this
.
label1
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
// FrmHistorySearch
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
...
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
请
注册
或
登录
后发表评论