Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 57061555
由
LN
编写于
2024-09-11 14:05:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
RGB灯库位调试修改
1 个父辈
6bec1bd3
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
30 行增加
和
14 行删除
DeviceLibrary/deviceLibrary/rgbLed/flyelectronicControl/Flyelectronic_485_RGB_Controller.cs
DeviceLibrary/manager/work/StockInfo.cs
DeviceLibrary/manager/work/TSAVBean.cs
DeviceLibrary/manager/work/WorkInfo.cs
DeviceLibrary/deviceLibrary/rgbLed/flyelectronicControl/Flyelectronic_485_RGB_Controller.cs
查看文件 @
5706155
...
@@ -75,6 +75,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -75,6 +75,7 @@ namespace TSA_V.DeviceLibrary
errmsg
+=
Encoding
.
ASCII
.
GetString
(
rev
);
errmsg
+=
Encoding
.
ASCII
.
GetString
(
rev
);
if
(
rev
.
Count
()
>
0
)
if
(
rev
.
Count
()
>
0
)
{
{
LogUtil
.
info
(
"氛围灯"
+
comPortName
+
"查询到设备信息"
);
ok
=
true
;
ok
=
true
;
Run
();
Run
();
break
;
break
;
...
@@ -127,6 +128,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -127,6 +128,7 @@ namespace TSA_V.DeviceLibrary
}
}
public
bool
ShowColor
(
Color
color
,
ColorFormat
colorFormat
=
ColorFormat
.
GBR
)
public
bool
ShowColor
(
Color
color
,
ColorFormat
colorFormat
=
ColorFormat
.
GBR
)
{
{
log
(
"ShowColor,color="
+
color
);
var
newbyte
=
CommandByte
.
SetOneColor
;
var
newbyte
=
CommandByte
.
SetOneColor
;
var
colorbyte
=
ConvertColorToByteArray
(
color
,
colorFormat
);
var
colorbyte
=
ConvertColorToByteArray
(
color
,
colorFormat
);
newbyte
[
16
]
=
colorbyte
[
0
];
newbyte
[
16
]
=
colorbyte
[
0
];
...
@@ -161,6 +163,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -161,6 +163,7 @@ namespace TSA_V.DeviceLibrary
/// <returns></returns>
/// <returns></returns>
public
bool
ShowLedColor
(
Color
color
,
List
<
int
>
ledIndex
,
int
maxledIndex
=
0
,
ColorFormat
colorFormat
=
ColorFormat
.
GBR
)
public
bool
ShowLedColor
(
Color
color
,
List
<
int
>
ledIndex
,
int
maxledIndex
=
0
,
ColorFormat
colorFormat
=
ColorFormat
.
GBR
)
{
{
log
(
"开灯,color="
+
color
+
":"
+
string
.
Join
(
"#"
,
ledIndex
));
ShowColor
(
Color
.
Black
);
ShowColor
(
Color
.
Black
);
List
<
byte
>
allData
=
new
List
<
byte
>();
List
<
byte
>
allData
=
new
List
<
byte
>();
byte
[]
startByte
=
CommandByte
.
ledColorStart
;
byte
[]
startByte
=
CommandByte
.
ledColorStart
;
...
@@ -326,7 +329,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -326,7 +329,7 @@ namespace TSA_V.DeviceLibrary
{
{
debuglog
(
"sendData:"
+
byteToHexStr
(
buff
,
" "
));
debuglog
(
"sendData:"
+
byteToHexStr
(
buff
,
" "
));
_serialPort
.
Write
(
buff
,
0
,
buff
.
Length
);
_serialPort
.
Write
(
buff
,
0
,
buff
.
Length
);
Thread
.
Sleep
(
8
0
);
Thread
.
Sleep
(
3
0
);
int
r
=
_serialPort
.
Read
(
recv
,
0
,
recv
.
Length
);
int
r
=
_serialPort
.
Read
(
recv
,
0
,
recv
.
Length
);
if
(
r
>
0
)
if
(
r
>
0
)
...
@@ -384,11 +387,11 @@ namespace TSA_V.DeviceLibrary
...
@@ -384,11 +387,11 @@ namespace TSA_V.DeviceLibrary
//DD 55 EE 00 00 00 00 00 99 01 00 00 00 03 00 08 50 00 00 AABB
//DD 55 EE 00 00 00 00 00 99 01 00 00 00 03 00 08 50 00 00 AABB
public
static
byte
[]
GetDeviceID
=
ConvertStringToByteArray
(
"DD 55 EE 00 00 00 00 00 8F 0
2
00 00 00 03 00 01 00 00 00 AA BB"
);
public
static
byte
[]
GetDeviceID
=
ConvertStringToByteArray
(
"DD 55 EE 00 00 00 00 00 8F 0
1
00 00 00 03 00 01 00 00 00 AA BB"
);
// DD55EE0000000000990100000003006F500000AABB
// DD55EE0000000000990100000003006F500000AABB
public
static
byte
[]
SetOneColor
=
ConvertStringToByteArray
(
"DD 55 EE 00 00 00 01 00 99 0
2
00 00 00 03 00 6F FF 00 00 AA BB"
);
public
static
byte
[]
SetOneColor
=
ConvertStringToByteArray
(
"DD 55 EE 00 00 00 01 00 99 0
1
00 00 00 03 00 6F FF 00 00 AA BB"
);
//12,13 为数据数量
//12,13 为数据数量
public
static
byte
[]
ledColorStart
=
ConvertStringToByteArray
(
"DD 55 EE 00 00 00 0
0
00 99 01 00 00 00 03 00 01 "
);
public
static
byte
[]
ledColorStart
=
ConvertStringToByteArray
(
"DD 55 EE 00 00 00 0
1
00 99 01 00 00 00 03 00 01 "
);
public
static
byte
[]
ledColorEnd
=
ConvertStringToByteArray
(
"AA BB"
);
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
//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
...
...
DeviceLibrary/manager/work/StockInfo.cs
查看文件 @
5706155
...
@@ -24,6 +24,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -24,6 +24,7 @@ namespace TSA_V.DeviceLibrary
public
DateTime
endWorkTime
=
DateTime
.
Now
;
public
DateTime
endWorkTime
=
DateTime
.
Now
;
public
DateTime
LastSetpTime
=
DateTime
.
Now
;
public
DateTime
LastSetpTime
=
DateTime
.
Now
;
public
uint
PreNodeId
=
0
;
public
uint
PreNodeId
=
0
;
private
List
<
int
>
PreRgbLed
=
new
List
<
int
>();
public
void
StartWork
()
public
void
StartWork
()
{
{
//开始工作
//开始工作
...
@@ -42,7 +43,11 @@ namespace TSA_V.DeviceLibrary
...
@@ -42,7 +43,11 @@ namespace TSA_V.DeviceLibrary
}
}
if
(
PreLabel
!=
null
)
if
(
PreLabel
!=
null
)
{
{
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
}
if
(
PreRgbLed
.
Count
>
0
)
{
RgbLedController
.
CloseAll
();
}
}
Thread
.
Sleep
(
500
);
Thread
.
Sleep
(
500
);
endWorkTime
=
DateTime
.
Now
;
endWorkTime
=
DateTime
.
Now
;
...
@@ -56,7 +61,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -56,7 +61,7 @@ namespace TSA_V.DeviceLibrary
waitList
=
new
List
<
WaitResultInfo
>();
waitList
=
new
List
<
WaitResultInfo
>();
}
}
private
LabelInfo
PreLabel
=
null
;
private
LabelInfo
PreLabel
=
null
;
public
void
MoveToBag
(
TSAVPosition
position
,
ComponetInfo
componet
)
public
void
MoveToBag
(
TSAVPosition
position
,
ComponetInfo
componet
)
{
{
try
try
{
{
...
@@ -70,9 +75,12 @@ namespace TSA_V.DeviceLibrary
...
@@ -70,9 +75,12 @@ namespace TSA_V.DeviceLibrary
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
LedLabelController
.
CloseLed
(
PreLabel
.
ip
,
PreLabel
.
mac
);
Thread
.
Sleep
(
300
);
Thread
.
Sleep
(
300
);
}
}
if
(
PreRgbLed
.
Count
>
0
)
{
RgbLedController
.
CloseAll
();
}
if
(
position
.
IsNodePos
())
if
(
position
.
IsNodePos
())
{
{
NodeInfo
moveNode
=
position
.
GetNode
(
TSAVBean
.
RotateMap
);
NodeInfo
moveNode
=
position
.
GetNode
(
TSAVBean
.
RotateMap
);
if
(
moveNode
!=
null
)
if
(
moveNode
!=
null
)
{
{
...
@@ -104,17 +112,19 @@ namespace TSA_V.DeviceLibrary
...
@@ -104,17 +112,19 @@ namespace TSA_V.DeviceLibrary
LedLabelController
.
UpdateScreen
(
label
);
LedLabelController
.
UpdateScreen
(
label
);
PreLabel
=
label
;
PreLabel
=
label
;
}
}
else
if
(
position
.
IsRgbLed
())
else
if
(
position
.
IsRgbLed
())
{
{
if
(
PreNodeId
>
0
)
if
(
PreNodeId
>
0
)
{
{
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
}
}
PreNodeId
=
0
;
PreNodeId
=
0
;
LedManager
.
LightOn
(
position
.
DeviceIP
,
position
.
getLedList
());
RgbLedController
.
OpenPosLed
(
position
);
PreRgbLed
=
position
.
getLedList
();
waitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
waitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"MoveToBag 出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"MoveToBag 出错:"
+
ex
.
ToString
());
}
}
...
...
DeviceLibrary/manager/work/TSAVBean.cs
查看文件 @
5706155
...
@@ -310,8 +310,9 @@ namespace TSA_V.DeviceLibrary
...
@@ -310,8 +310,9 @@ namespace TSA_V.DeviceLibrary
IsInSuddenDown
=
false
;
IsInSuddenDown
=
false
;
IOManager
.
IOMove
(
IOManager
.
Line_FStart
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IOManager
.
Line_FStart
,
IO_VALUE
.
LOW
);
LogUtil
.
info
(
Name
+
"开始重置设备,打开设备照明"
);
LogUtil
.
info
(
Name
+
"开始重置设备,打开设备照明
,打开所有RGB灯测试
"
);
IOManager
.
IOMove
(
IOManager
.
Device_Led
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IOManager
.
Device_Led
,
IO_VALUE
.
HIGH
);
RgbLedController
.
OpenAll
();
LastResetChangeTime
=
DateTime
.
Now
;
LastResetChangeTime
=
DateTime
.
Now
;
Status
=
TSAVStatus
.
Reset
;
Status
=
TSAVStatus
.
Reset
;
...
@@ -330,7 +331,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -330,7 +331,7 @@ namespace TSA_V.DeviceLibrary
{
{
PUSICANControl
.
InitNode
(
LWidthManager
.
Line_NodeAddr
);
PUSICANControl
.
InitNode
(
LWidthManager
.
Line_NodeAddr
);
}
}
LogUtil
.
info
(
Name
+
"重置中 "
+
resetStep
+
":InitNode 所有节点 "
);
LogUtil
.
info
(
Name
+
"重置中 "
+
resetStep
+
":InitNode 所有节点
"
);
}
}
public
delegate
bool
ShowPointDelegate
(
ProjectorPInfo
p
);
public
delegate
bool
ShowPointDelegate
(
ProjectorPInfo
p
);
public
static
event
ShowPointDelegate
ShowPointEvent
;
public
static
event
ShowPointDelegate
ShowPointEvent
;
...
@@ -408,6 +409,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -408,6 +409,7 @@ namespace TSA_V.DeviceLibrary
}
}
WarnMsg
=
""
;
WarnMsg
=
""
;
LogUtil
.
info
(
Name
+
msg
);
LogUtil
.
info
(
Name
+
msg
);
RgbLedController
.
CloseAll
();
Status
=
TSAVStatus
.
Runing
;
Status
=
TSAVStatus
.
Runing
;
}
}
/// <summary>
/// <summary>
...
@@ -567,7 +569,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -567,7 +569,7 @@ namespace TSA_V.DeviceLibrary
//}
//}
if
(
isAllOk
.
Equals
(
true
))
if
(
isAllOk
.
Equals
(
true
))
{
{
ToRunning
(
"重置完成:所有旋转轴回到待机点"
);
ToRunning
(
"重置完成:所有旋转轴回到待机点
,关闭所有灯
"
);
}
}
}
}
if
(
isTimeOut
)
if
(
isTimeOut
)
...
...
DeviceLibrary/manager/work/WorkInfo.cs
查看文件 @
5706155
...
@@ -379,6 +379,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -379,6 +379,7 @@ namespace TSA_V.DeviceLibrary
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
PUSICANControl
.
AbsMove
(
PreNodeId
,
TSAVBean
.
RotateNode_DefaultPosition
);
}
}
RgbLedController
.
OpenPosLed
(
position
);
RgbLedController
.
OpenPosLed
(
position
);
PreRgbLed
=
position
.
getLedList
();
}
}
else
else
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论