Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1538b02e
由
LN
编写于
2024-06-27 11:18:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
超声波差异大时未报警。2.颜色调整
1 个父辈
5ecb48bb
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
100 行增加
和
55 行删除
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary/flyelectronicControl/Flyelectronic_485_RGB_Controller.cs
DeviceLibrary/theMachine/MainMachine _LedRGBProcess.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/RobotManage.cs
TheMachine/AxisControl.cs
Common/Setting_Init.cs
查看文件 @
1538b02
...
...
@@ -240,10 +240,14 @@ namespace OnlineStore.Common
public
static
MyConfig
<
int
>
Device_DauxiKS107_BaseValue
=
1000
;
[
MyConfigComment
(
"红外传感器_最大误差值"
)]
public
static
MyConfig
<
int
>
Device_DauxiKS107_ErrorValue
=
10000
;
[
MyConfigComment
(
"红外传感器_调试状态,打印实时值"
)]
public
static
MyConfig
<
bool
>
Device_DauxiKS107_Debug
=
true
;
[
MyConfigComment
(
"重力传感器_端口号"
)]
public
static
MyConfig
<
string
>
Device_WeightSensor_PortName
=
""
;
[
MyConfigComment
(
"重力传感器_上限值"
)]
public
static
MyConfig
<
int
>
Device_WeightSensor_MaxValue
=
10000
;
}
public
enum
InOut_Roller_Mode
{
...
...
DeviceLibrary/DeviceLibrary/flyelectronicControl/Flyelectronic_485_RGB_Controller.cs
查看文件 @
1538b02
...
...
@@ -253,7 +253,7 @@ namespace DeviceLibrary
}
void
debuglog
(
string
msg
)
{
loge
.
Info
(
Name
+
$
"[{comPortName}]"
+
":"
+
msg
);
loge
.
Debug
(
Name
+
$
"[{comPortName}]"
+
":"
+
msg
);
Console
.
WriteLine
(
msg
);
}
static
class
CommandByte
...
...
DeviceLibrary/theMachine/MainMachine _LedRGBProcess.cs
查看文件 @
1538b02
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics.Eventing.Reader
;
...
...
@@ -9,6 +10,7 @@ using System.Text;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Timers
;
using
System.Web.UI
;
using
static
System
.
Windows
.
Forms
.
AxHost
;
namespace
DeviceLibrary
...
...
@@ -19,11 +21,12 @@ namespace DeviceLibrary
private
bool
rgbLedInitOk
=
false
;
public
string
lastColor
=
""
;
public
string
lastS
=
""
;
System
.
Threading
.
Timer
ledRgbTimer
;
public
bool
CloseRgbLed
()
{
if
(
rgbLedInitOk
)
if
(
rgbLedInitOk
)
{
rGB_Controller
.
Dispose
();
}
...
...
@@ -36,7 +39,7 @@ namespace DeviceLibrary
string
port
=
Setting_Init
.
Device_LedLight_PortName
;
if
(
port
==
""
)
{
LogUtil
.
info
(
"未配置LED灯端口号"
);
LogUtil
.
info
(
"未配置LED灯端口号"
);
return
false
;
}
rGB_Controller
=
new
Flyelectronic_485_RGB_Controller
(
"LED"
);
...
...
@@ -60,10 +63,11 @@ namespace DeviceLibrary
{
rGB_Controller
.
CloseLed
();
lastColor
=
""
;
lastS
=
""
;
}
public
void
ShowColor
(
Color
color
)
public
void
ShowColor
(
Color
color
)
{
if
(
lastColor
!=
""
&&
lastColor
.
Equals
(
color
.
Name
.
ToString
()))
if
(
lastColor
!=
""
&&
lastColor
.
Equals
(
color
.
Name
.
ToString
()))
{
return
;
}
...
...
@@ -71,7 +75,7 @@ namespace DeviceLibrary
rGB_Controller
.
ShowColor
(
color
);
lastColor
=
color
.
Name
.
ToString
();
}
public
void
ShowYellowLight
()
public
void
ShowYellowLight
()
{
lastColor
=
"yellowL"
;
//rGB_Controller.CloseLed();
...
...
@@ -97,76 +101,110 @@ namespace DeviceLibrary
//流动黄: 出库,
//白色: 等待用户响应(等待取走盘等),
//蓝色: 扫码检测
if
(
runStatus
==
RunStatus
.
Stop
)
bool
inPut
=
false
;
bool
scanCode
=
false
;
bool
inOut
=
false
;
bool
waitTake
=
false
;
if
(
runStatus
==
RunStatus
.
Running
)
{
//未启动 黑色
ShowColor
(
Color
.
Black
);
var
h
=
NGDoor_Tray_Test_Reel
;
//出入库 绿闪 黄闪
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreOut10
)
{
inOut
=
true
;
}
else
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreIn01
)
{
inPut
=
true
;
}
else
if
(
StringMoveInfo
.
MoveStep
>=
MoveStep
.
StringReadyGet
&&
StringMoveInfo
.
MoveStep
<=
MoveStep
.
StringReelGetFail
)
{
inPut
=
true
;
}
else
if
(
StringMoveInfo
.
MoveStep
>=
MoveStep
.
StringReelPut
&&
StringMoveInfo
.
MoveStep
<=
MoveStep
.
StringReelPut_05
)
{
inOut
=
true
;
}
if
(
ClampMoveInfo
.
IsStep
(
MoveStep
.
ReelClamp_10
)
&&
(!
RobotManage
.
InoutDebugMode
)
&&
(!
ClampMoveInfo
.
MoveParam
.
IsNg
))
{
scanCode
=
true
;
}
if
(
h
!=
null
&&
h
.
Value
&&
UserPause
)
{
waitTake
=
true
;
}
}
else
if
(
isInSuddenDown
)
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
)
||
isInSuddenDown
)
{
//红色: 急停,
ShowColor
(
Color
.
Red
);
lastS
=
"suddenStop"
;
}
else
if
(
runStatus
==
RunStatus
.
Stop
)
{
//未启动 黑色
ShowColor
(
Color
.
Black
);
lastS
=
"stop"
;
}
else
if
(
scanCode
)
{
//蓝色: 扫码检测
ShowColor
(
Color
.
Blue
);
lastS
=
"scanCode"
;
}
//出入库 绿闪 黄闪
else
if
(
inOut
)
{
////流动黄: 出库,
ShowYellowLight
();
lastS
=
"storeOut"
;
}
else
if
(
inPut
)
{
ShowGreenLight
();
lastS
=
"storeIn"
;
}
else
if
(
waitTake
)
{
//暂停等待料盘拿走
//白色: 等待用户响应(等待取走盘等),
//蓝色: 扫码检测
ShowColor
(
Color
.
White
);
lastS
=
"waitTask"
;
}
else
if
(
hasAlarm
)
{
//紫色: 异常,
ShowColor
(
Color
.
Purple
);
lastS
=
"hasAlarm"
;
}
//温度超限
else
if
(
IsTHoutRange
())
{
//紫色: 异常,
ShowColor
(
Color
.
Purple
);
lastS
=
"IsTHoutRange"
;
}
//温度超限30分钟
else
if
(
IsTHoutRangeOver30m
())
{
//紫色: 异常,
ShowColor
(
Color
.
Purple
);
}
else
if
(
runStatus
==
RunStatus
.
Running
)
{
var
h
=
NGDoor_Tray_Test_Reel
;
if
(
h
!=
null
&&
h
.
Value
)
{
//等待料盘拿走
//白色: 等待用户响应(等待取走盘等),
//蓝色: 扫码检测
ShowColor
(
Color
.
White
);
}
else
if
(
ClampMoveInfo
.
IsStep
(
MoveStep
.
ReelClamp_10
)
&&
(!
RobotManage
.
InoutDebugMode
)
&&
(!
ClampMoveInfo
.
MoveParam
.
IsNg
))
{
//蓝色: 扫码检测
ShowColor
(
Color
.
Blue
);
}
//出入库 绿闪 黄闪
else
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreOut10
)
{
////流动黄: 出库,
//if (lastColor.Equals("yellowRun"))
//{
// return;
//}
ShowYellowLight
();
}
else
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreIn01
)
{
////流动绿: 入库
//if (lastColor.Equals("yellowRun"))
//{
// return;
//}
ShowGreenLight
();
}
lastS
=
"IsTHoutRangeOver30m"
;
}
else
{
//待机 蓝绿
ShowColor
(
Color
.
FromArgb
(
0
,
128
,
128
));
lastS
=
"waiting"
;
}
}
}
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
1538b02
...
...
@@ -671,13 +671,13 @@ namespace DeviceLibrary
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H27_HomeCheck
);
InOut_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
InOut_P1
,
Config
.
InOut_P1_speed
);
ResetMoveInfo
.
log
(
$
"{FixPos.posid}:进出轴返回待机点【{Config.InOut_P1}】【{Config.InOut_P1_speed}】"
);
ResetMoveInfo
.
log
(
$
"{FixPos.posid}:
声波传感器OK,
进出轴返回待机点【{Config.InOut_P1}】【{Config.InOut_P1_speed}】"
);
}
else
{
//直接到报警步骤
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H31_HomeError
);
ResetMoveInfo
.
log
(
$
"{FixPos.posid}:声波
感应
器误差过大,需要报警"
);
ResetMoveInfo
.
log
(
$
"{FixPos.posid}:声波
传感
器误差过大,需要报警"
);
}
break
;
...
...
@@ -692,12 +692,13 @@ namespace DeviceLibrary
case
MoveStep
.
H28_HomeCheck
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
HEND_HomeReset
);
ResetMoveInfo
.
log
(
"声波
感应
器检测OK"
);
ResetMoveInfo
.
log
(
"声波
传感
器检测OK"
);
break
;
case
MoveStep
.
H31_HomeError
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
HEND_HomeReset
);
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
Msg
.
add
(
crc
.
GetString
(
"shengboError"
,
"声波感应器误差过大,请检查后重新复位"
),
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"shengboError"
,
"声波传感器误差过大,请检查后重新复位"
),
MsgLevel
.
alarm
);
ResetMoveInfo
.
log
(
crc
.
GetString
(
"shengboError"
,
"声波传感器误差过大,请检查后重新复位"
));
break
;
// H22_HomeCheck,//旋转轴到校准为止,升降轴到高点,压紧轴压紧
//H23_HomeCheck,//进出轴进入
...
...
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
1538b02
...
...
@@ -324,13 +324,14 @@ namespace DeviceLibrary
}
if
(
RobotManage
.
dauxiKS107Controller
.
Quary
(
out
int
value
,
out
string
errMsg
))
{
int
cha
=
value
-
Setting_Init
.
Device_DauxiKS107_BaseValue
;
int
cha
=
Math
.
Abs
(
value
-
Setting_Init
.
Device_DauxiKS107_BaseValue
);
LogUtil
.
info
(
$
"传感器检测:当前值{value},基准值{Setting_Init.Device_DauxiKS107_BaseValue},最大误差值:{Setting_Init.Device_DauxiKS107_ErrorValue}"
);
if
(
cha
>
Setting_Init
.
Device_DauxiKS107_ErrorValue
)
{
TimeSpan
span
=
DateTime
.
Now
-
RobotManage
.
LastResetTime
;
RobotManage
.
SensorNeedReset
=
true
;
if
(
span
.
TotalHours
>
1
)
if
(
span
.
TotalHours
<
1
)
{
LogUtil
.
error
(
$
"传感器误差过大,需要复位:当前值:{value},基准值:{Setting_Init.Device_DauxiKS107_BaseValue},SensorErroCount={RobotManage.SensorNeedReset}, 最大误差:{Setting_Init.Device_DauxiKS107_ErrorValue},"
+
$
"上次复位时间{RobotManage.LastResetTime.ToShortDateString()},一小时内出现红外传感器检测错误,需要报警"
);
...
...
@@ -340,6 +341,7 @@ namespace DeviceLibrary
else
{
LogUtil
.
error
(
$
"传感器误差过大,需要复位:当前值:{value},基准值:{Setting_Init.Device_DauxiKS107_BaseValue},SensorErroCount={RobotManage.SensorNeedReset},最大误差:{Setting_Init.Device_DauxiKS107_ErrorValue}"
);
return
false
;
}
}
}
...
...
TheMachine/AxisControl.cs
查看文件 @
1538b02
...
...
@@ -166,7 +166,7 @@ namespace TheMachine
{
if
(
Setting_Init
.
Device_LedLight_PortName
!=
""
)
{
lblLed
.
Text
=
"LED"
+
Setting_Init
.
Device_LedLight_PortName
+
":"
+
RobotManage
.
mainMachine
.
lastColor
.
ToString
();
lblLed
.
Text
=
"LED"
+
Setting_Init
.
Device_LedLight_PortName
+
","
+
RobotManage
.
mainMachine
.
lastS
+
":"
+
RobotManage
.
mainMachine
.
lastColor
.
ToString
();
}
else
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论